]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
c061081e34d549d5831d5658c8943949ddb26098
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20170501.
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 Features:
650   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
651   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
652
653 Optional Packages:
654   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
655   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
656
657   --enable-string-hacks   work around bogus compiler/loader warnings
658 General Options:
659   --with-pkg-config{=path} enable/disable use of pkg-config
660   --disable-echo          do not display "compiling" commands
661 Curses Version-dependent Options:
662   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
663   --disable-widec         disable checks for wide-character functions
664   --with-curses-dir=DIR   directory in which (n)curses is installed
665   --with-screen=XXX       use specified curses-libraries
666   --with-ncursesw         use wide ncurses-libraries
667   --with-ncurses          use ncurses-libraries
668   --with-pdcurses         compile/link with pdcurses X11 library
669   --with-curses-colr      compile/link with HPUX 10.x color-curses
670   --with-curses-5lib      compile/link with SunOS 5lib curses
671   --with-Xaw3d            link with Xaw 3d library
672   --with-Xaw3dxft         link with Xaw 3d xft library
673   --with-neXtaw           link with neXT Athena library
674   --with-XawPlus          link with Athena-Plus library
675   --with-x                use the X Window System
676 Testing/development Options:
677   --enable-warnings       test: turn on gcc compiler warnings
678   --with-dmalloc          test: use Gray Watson's dmalloc library
679   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
680   --with-valgrind         test: use valgrind
681   --disable-leaks         test: free permanent memory, analyze leaks
682   --disable-rpath-hack    don't add rpath options for additional libraries
683
684 Some influential environment variables:
685   CC          C compiler command
686   CFLAGS      C compiler flags
687   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
688               nonstandard directory <lib dir>
689   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
690               headers in a nonstandard directory <include dir>
691   CPP         C preprocessor
692
693 Use these variables to override the choices made by `configure' or to help
694 it to find libraries and programs with nonstandard names/locations.
695
696 EOF
697 fi
698
699 if test "$ac_init_help" = "recursive"; then
700   # If there are subdirs, report their specific --help.
701   ac_popdir=`pwd`
702   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
703     cd $ac_subdir
704     # A "../" for each directory in /$ac_subdir.
705     ac_dots=`echo $ac_subdir |
706              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
707
708     case $srcdir in
709     .) # No --srcdir option.  We are building in place.
710       ac_sub_srcdir=$srcdir ;;
711     [\\/]* | ?:[\\/]* ) # Absolute path.
712       ac_sub_srcdir=$srcdir/$ac_subdir ;;
713     *) # Relative path.
714       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
715     esac
716
717     # Check for guested configure; otherwise get Cygnus style configure.
718     if test -f $ac_sub_srcdir/configure.gnu; then
719       echo
720       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
721     elif test -f $ac_sub_srcdir/configure; then
722       echo
723       $SHELL $ac_sub_srcdir/configure  --help=recursive
724     elif test -f $ac_sub_srcdir/configure.ac ||
725            test -f $ac_sub_srcdir/configure.in; then
726       echo
727       $ac_configure --help
728     else
729       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
730     fi
731     cd $ac_popdir
732   done
733 fi
734
735 test -n "$ac_init_help" && exit 0
736 if $ac_init_version; then
737   cat <<\EOF
738
739 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
740 Free Software Foundation, Inc.
741 This configure script is free software; the Free Software Foundation
742 gives unlimited permission to copy, distribute and modify it.
743 EOF
744   exit 0
745 fi
746 exec 5>config.log
747 cat >&5 <<EOF
748 This file contains any messages produced by compilers while
749 running configure, to aid debugging if configure makes a mistake.
750
751 It was created by $as_me, which was
752 generated by GNU Autoconf 2.52.20170501.  Invocation command line was
753
754   $ $0 $@
755
756 EOF
757 {
758 cat <<_ASUNAME
759 ## ---------- ##
760 ## Platform.  ##
761 ## ---------- ##
762
763 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
764 uname -m = `(uname -m) 2>/dev/null || echo unknown`
765 uname -r = `(uname -r) 2>/dev/null || echo unknown`
766 uname -s = `(uname -s) 2>/dev/null || echo unknown`
767 uname -v = `(uname -v) 2>/dev/null || echo unknown`
768
769 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
770 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
771
772 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
773 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
774 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
775 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
776 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
777 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
778 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
779
780 PATH = $PATH
781
782 _ASUNAME
783 } >&5
784
785 cat >&5 <<EOF
786 ## ------------ ##
787 ## Core tests.  ##
788 ## ------------ ##
789
790 EOF
791
792 # Keep a trace of the command line.
793 # Strip out --no-create and --no-recursion so they do not pile up.
794 # Also quote any args containing shell meta-characters.
795 ac_configure_args=
796 ac_sep=
797 for ac_arg
798 do
799   case $ac_arg in
800   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
801   | --no-cr | --no-c) ;;
802   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
803   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
804   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
805     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
806     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
807     ac_sep=" " ;;
808   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
809      ac_sep=" " ;;
810   esac
811   # Get rid of the leading space.
812 done
813
814 # When interrupted or exit'd, cleanup temporary files, and complete
815 # config.log.  We remove comments because anyway the quotes in there
816 # would cause problems or look ugly.
817 trap 'exit_status=$?
818   # Save into config.log some information that might help in debugging.
819   echo >&5
820   echo "## ----------------- ##" >&5
821   echo "## Cache variables.  ##" >&5
822   echo "## ----------------- ##" >&5
823   echo >&5
824   # The following way of writing the cache mishandles newlines in values,
825 {
826   (set) 2>&1 |
827     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
828     *ac_space=\ *)
829       sed -n \
830         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
831           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
832       ;;
833     *)
834       sed -n \
835         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
836       ;;
837     esac;
838 } >&5
839   sed "/^$/d" confdefs.h >conftest.log
840   if test -s conftest.log; then
841     echo >&5
842     echo "## ------------ ##" >&5
843     echo "## confdefs.h.  ##" >&5
844     echo "## ------------ ##" >&5
845     echo >&5
846     cat conftest.log >&5
847   fi
848   (echo; echo) >&5
849   test "$ac_signal" != 0 &&
850     echo "$as_me: caught signal $ac_signal" >&5
851   echo "$as_me: exit $exit_status" >&5
852   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
853     exit $exit_status
854      ' 0
855 for ac_signal in 1 2 13 15; do
856   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
857 done
858 ac_signal=0
859
860 # confdefs.h avoids OS command line length limits that DEFS can exceed.
861 rm -rf conftest* confdefs.h
862 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
863 echo >confdefs.h
864
865 # Let the site file select an alternate cache file if it wants to.
866 # Prefer explicitly selected file to automatically selected ones.
867 if test -z "$CONFIG_SITE"; then
868   if test "x$prefix" != xNONE; then
869     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
870   else
871     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
872   fi
873 fi
874 for ac_site_file in $CONFIG_SITE; do
875   if test -r "$ac_site_file"; then
876     { echo "$as_me:876: loading site script $ac_site_file" >&5
877 echo "$as_me: loading site script $ac_site_file" >&6;}
878     cat "$ac_site_file" >&5
879     . "$ac_site_file"
880   fi
881 done
882
883 if test -r "$cache_file"; then
884   # Some versions of bash will fail to source /dev/null (special
885   # files actually), so we avoid doing that.
886   if test -f "$cache_file"; then
887     { echo "$as_me:887: loading cache $cache_file" >&5
888 echo "$as_me: loading cache $cache_file" >&6;}
889     case $cache_file in
890       [\\/]* | ?:[\\/]* ) . $cache_file;;
891       *)                      . ./$cache_file;;
892     esac
893   fi
894 else
895   { echo "$as_me:895: creating cache $cache_file" >&5
896 echo "$as_me: creating cache $cache_file" >&6;}
897   >$cache_file
898 fi
899
900 # Check that the precious variables saved in the cache have kept the same
901 # value.
902 ac_cache_corrupted=false
903 for ac_var in `(set) 2>&1 |
904                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
905   eval ac_old_set=\$ac_cv_env_${ac_var}_set
906   eval ac_new_set=\$ac_env_${ac_var}_set
907   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
908   eval ac_new_val="\$ac_env_${ac_var}_value"
909   case $ac_old_set,$ac_new_set in
910     set,)
911       { echo "$as_me:911: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
912 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
913       ac_cache_corrupted=: ;;
914     ,set)
915       { echo "$as_me:915: error: \`$ac_var' was not set in the previous run" >&5
916 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
917       ac_cache_corrupted=: ;;
918     ,);;
919     *)
920       if test "x$ac_old_val" != "x$ac_new_val"; then
921         { echo "$as_me:921: error: \`$ac_var' has changed since the previous run:" >&5
922 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
923         { echo "$as_me:923:   former value:  $ac_old_val" >&5
924 echo "$as_me:   former value:  $ac_old_val" >&2;}
925         { echo "$as_me:925:   current value: $ac_new_val" >&5
926 echo "$as_me:   current value: $ac_new_val" >&2;}
927         ac_cache_corrupted=:
928       fi;;
929   esac
930   # Pass precious variables to config.status.  It doesn't matter if
931   # we pass some twice (in addition to the command line arguments).
932   if test "$ac_new_set" = set; then
933     case $ac_new_val in
934     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
935       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
936       ac_configure_args="$ac_configure_args '$ac_arg'"
937       ;;
938     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
939        ;;
940     esac
941   fi
942 done
943 if $ac_cache_corrupted; then
944   { echo "$as_me:944: error: changes in the environment can compromise the build" >&5
945 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
946   { { echo "$as_me:946: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
947 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
948    { (exit 1); exit 1; }; }
949 fi
950
951 ac_ext=c
952 ac_cpp='$CPP $CPPFLAGS'
953 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
954 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
955 ac_compiler_gnu=$ac_cv_c_compiler_gnu
956 ac_main_return=return
957
958 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
959   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
960                    ECHO_T='     ' ;;
961   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
962   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
963 esac
964 echo "#! $SHELL" >conftest.sh
965 echo  "exit 0"   >>conftest.sh
966 chmod +x conftest.sh
967 if { (echo "$as_me:967: PATH=\".;.\"; conftest.sh") >&5
968   (PATH=".;."; conftest.sh) 2>&5
969   ac_status=$?
970   echo "$as_me:970: \$? = $ac_status" >&5
971   (exit $ac_status); }; then
972   ac_path_separator=';'
973 else
974   ac_path_separator=:
975 fi
976 PATH_SEPARATOR="$ac_path_separator"
977 rm -f conftest.sh
978
979 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
980
981 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
982
983 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
984
985 ac_aux_dir=
986 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
987   if test -f $ac_dir/install-sh; then
988     ac_aux_dir=$ac_dir
989     ac_install_sh="$ac_aux_dir/install-sh -c"
990     break
991   elif test -f $ac_dir/install.sh; then
992     ac_aux_dir=$ac_dir
993     ac_install_sh="$ac_aux_dir/install.sh -c"
994     break
995   elif test -f $ac_dir/shtool; then
996     ac_aux_dir=$ac_dir
997     ac_install_sh="$ac_aux_dir/shtool install -c"
998     break
999   fi
1000 done
1001 if test -z "$ac_aux_dir"; then
1002   { { echo "$as_me:1002: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1003 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1004    { (exit 1); exit 1; }; }
1005 fi
1006 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1007 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1008 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1009
1010 # Make sure we can run config.sub.
1011 $ac_config_sub sun4 >/dev/null 2>&1 ||
1012   { { echo "$as_me:1012: error: cannot run $ac_config_sub" >&5
1013 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1014    { (exit 1); exit 1; }; }
1015
1016 echo "$as_me:1016: checking build system type" >&5
1017 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1018 if test "${ac_cv_build+set}" = set; then
1019   echo $ECHO_N "(cached) $ECHO_C" >&6
1020 else
1021   ac_cv_build_alias=$build_alias
1022 test -z "$ac_cv_build_alias" &&
1023   ac_cv_build_alias=`$ac_config_guess`
1024 test -z "$ac_cv_build_alias" &&
1025   { { echo "$as_me:1025: error: cannot guess build type; you must specify one" >&5
1026 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1027    { (exit 1); exit 1; }; }
1028 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1029   { { echo "$as_me:1029: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1030 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1031    { (exit 1); exit 1; }; }
1032
1033 fi
1034 echo "$as_me:1034: result: $ac_cv_build" >&5
1035 echo "${ECHO_T}$ac_cv_build" >&6
1036 build=$ac_cv_build
1037 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1038 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1039 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1040
1041 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1042         echo "$as_me:1042: checking host system type" >&5
1043 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1044 if test "${ac_cv_host+set}" = set; then
1045   echo $ECHO_N "(cached) $ECHO_C" >&6
1046 else
1047   ac_cv_host_alias=$host_alias
1048 test -z "$ac_cv_host_alias" &&
1049   ac_cv_host_alias=$ac_cv_build_alias
1050 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1051   { { echo "$as_me:1051: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1052 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1053    { (exit 1); exit 1; }; }
1054
1055 fi
1056 echo "$as_me:1056: result: $ac_cv_host" >&5
1057 echo "${ECHO_T}$ac_cv_host" >&6
1058 host=$ac_cv_host
1059 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1060 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1061 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1062
1063         system_name="$host_os"
1064 else
1065         system_name="`(uname -s -r) 2>/dev/null`"
1066         if test -z "$system_name" ; then
1067                 system_name="`(hostname) 2>/dev/null`"
1068         fi
1069 fi
1070 test -n "$system_name" &&
1071 cat >>confdefs.h <<EOF
1072 #define SYSTEM_NAME "$system_name"
1073 EOF
1074
1075 if test "${cf_cv_system_name+set}" = set; then
1076   echo $ECHO_N "(cached) $ECHO_C" >&6
1077 else
1078   cf_cv_system_name="$system_name"
1079 fi
1080
1081 test -z "$system_name" && system_name="$cf_cv_system_name"
1082 test -n "$cf_cv_system_name" && echo "$as_me:1082: result: Configuring for $cf_cv_system_name" >&5
1083 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1084
1085 if test ".$system_name" != ".$cf_cv_system_name" ; then
1086         echo "$as_me:1086: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1087 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1088         { { echo "$as_me:1088: error: \"Please remove config.cache and try again.\"" >&5
1089 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1090    { (exit 1); exit 1; }; }
1091 fi
1092
1093 test "$program_prefix" != NONE &&
1094   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1095 # Use a double $ so make ignores it.
1096 test "$program_suffix" != NONE &&
1097   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1098 # Double any \ or $.  echo might interpret backslashes.
1099 # By default was `s,x,x', remove it if useless.
1100 cat <<\_ACEOF >conftest.sed
1101 s/[\\$]/&&/g;s/;s,x,x,$//
1102 _ACEOF
1103 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1104 rm conftest.sed
1105
1106 echo "$as_me:1106: checking whether ${MAKE-make} sets \${MAKE}" >&5
1107 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1108 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1109 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1110   echo $ECHO_N "(cached) $ECHO_C" >&6
1111 else
1112   cat >conftest.make <<\EOF
1113 all:
1114         @echo 'ac_maketemp="${MAKE}"'
1115 EOF
1116 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1117 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1118 if test -n "$ac_maketemp"; then
1119   eval ac_cv_prog_make_${ac_make}_set=yes
1120 else
1121   eval ac_cv_prog_make_${ac_make}_set=no
1122 fi
1123 rm -f conftest.make
1124 fi
1125 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1126   echo "$as_me:1126: result: yes" >&5
1127 echo "${ECHO_T}yes" >&6
1128   SET_MAKE=
1129 else
1130   echo "$as_me:1130: result: no" >&5
1131 echo "${ECHO_T}no" >&6
1132   SET_MAKE="MAKE=${MAKE-make}"
1133 fi
1134
1135 ac_ext=c
1136 ac_cpp='$CPP $CPPFLAGS'
1137 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1138 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1139 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1140 ac_main_return=return
1141 if test -n "$ac_tool_prefix"; then
1142   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1143 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1144 echo "$as_me:1144: checking for $ac_word" >&5
1145 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1146 if test "${ac_cv_prog_CC+set}" = set; then
1147   echo $ECHO_N "(cached) $ECHO_C" >&6
1148 else
1149   if test -n "$CC"; then
1150   ac_cv_prog_CC="$CC" # Let the user override the test.
1151 else
1152   ac_save_IFS=$IFS; IFS=$ac_path_separator
1153 ac_dummy="$PATH"
1154 for ac_dir in $ac_dummy; do
1155   IFS=$ac_save_IFS
1156   test -z "$ac_dir" && ac_dir=.
1157   $as_executable_p "$ac_dir/$ac_word" || continue
1158 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1159 echo "$as_me:1159: found $ac_dir/$ac_word" >&5
1160 break
1161 done
1162
1163 fi
1164 fi
1165 CC=$ac_cv_prog_CC
1166 if test -n "$CC"; then
1167   echo "$as_me:1167: result: $CC" >&5
1168 echo "${ECHO_T}$CC" >&6
1169 else
1170   echo "$as_me:1170: result: no" >&5
1171 echo "${ECHO_T}no" >&6
1172 fi
1173
1174 fi
1175 if test -z "$ac_cv_prog_CC"; then
1176   ac_ct_CC=$CC
1177   # Extract the first word of "gcc", so it can be a program name with args.
1178 set dummy gcc; ac_word=$2
1179 echo "$as_me:1179: checking for $ac_word" >&5
1180 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1181 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   if test -n "$ac_ct_CC"; then
1185   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1186 else
1187   ac_save_IFS=$IFS; IFS=$ac_path_separator
1188 ac_dummy="$PATH"
1189 for ac_dir in $ac_dummy; do
1190   IFS=$ac_save_IFS
1191   test -z "$ac_dir" && ac_dir=.
1192   $as_executable_p "$ac_dir/$ac_word" || continue
1193 ac_cv_prog_ac_ct_CC="gcc"
1194 echo "$as_me:1194: found $ac_dir/$ac_word" >&5
1195 break
1196 done
1197
1198 fi
1199 fi
1200 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1201 if test -n "$ac_ct_CC"; then
1202   echo "$as_me:1202: result: $ac_ct_CC" >&5
1203 echo "${ECHO_T}$ac_ct_CC" >&6
1204 else
1205   echo "$as_me:1205: result: no" >&5
1206 echo "${ECHO_T}no" >&6
1207 fi
1208
1209   CC=$ac_ct_CC
1210 else
1211   CC="$ac_cv_prog_CC"
1212 fi
1213
1214 if test -z "$CC"; then
1215   if test -n "$ac_tool_prefix"; then
1216   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1217 set dummy ${ac_tool_prefix}cc; ac_word=$2
1218 echo "$as_me:1218: checking for $ac_word" >&5
1219 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1220 if test "${ac_cv_prog_CC+set}" = set; then
1221   echo $ECHO_N "(cached) $ECHO_C" >&6
1222 else
1223   if test -n "$CC"; then
1224   ac_cv_prog_CC="$CC" # Let the user override the test.
1225 else
1226   ac_save_IFS=$IFS; IFS=$ac_path_separator
1227 ac_dummy="$PATH"
1228 for ac_dir in $ac_dummy; do
1229   IFS=$ac_save_IFS
1230   test -z "$ac_dir" && ac_dir=.
1231   $as_executable_p "$ac_dir/$ac_word" || continue
1232 ac_cv_prog_CC="${ac_tool_prefix}cc"
1233 echo "$as_me:1233: found $ac_dir/$ac_word" >&5
1234 break
1235 done
1236
1237 fi
1238 fi
1239 CC=$ac_cv_prog_CC
1240 if test -n "$CC"; then
1241   echo "$as_me:1241: result: $CC" >&5
1242 echo "${ECHO_T}$CC" >&6
1243 else
1244   echo "$as_me:1244: result: no" >&5
1245 echo "${ECHO_T}no" >&6
1246 fi
1247
1248 fi
1249 if test -z "$ac_cv_prog_CC"; then
1250   ac_ct_CC=$CC
1251   # Extract the first word of "cc", so it can be a program name with args.
1252 set dummy cc; ac_word=$2
1253 echo "$as_me:1253: checking for $ac_word" >&5
1254 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1255 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1256   echo $ECHO_N "(cached) $ECHO_C" >&6
1257 else
1258   if test -n "$ac_ct_CC"; then
1259   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1260 else
1261   ac_save_IFS=$IFS; IFS=$ac_path_separator
1262 ac_dummy="$PATH"
1263 for ac_dir in $ac_dummy; do
1264   IFS=$ac_save_IFS
1265   test -z "$ac_dir" && ac_dir=.
1266   $as_executable_p "$ac_dir/$ac_word" || continue
1267 ac_cv_prog_ac_ct_CC="cc"
1268 echo "$as_me:1268: found $ac_dir/$ac_word" >&5
1269 break
1270 done
1271
1272 fi
1273 fi
1274 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1275 if test -n "$ac_ct_CC"; then
1276   echo "$as_me:1276: result: $ac_ct_CC" >&5
1277 echo "${ECHO_T}$ac_ct_CC" >&6
1278 else
1279   echo "$as_me:1279: result: no" >&5
1280 echo "${ECHO_T}no" >&6
1281 fi
1282
1283   CC=$ac_ct_CC
1284 else
1285   CC="$ac_cv_prog_CC"
1286 fi
1287
1288 fi
1289 if test -z "$CC"; then
1290   # Extract the first word of "cc", so it can be a program name with args.
1291 set dummy cc; ac_word=$2
1292 echo "$as_me:1292: checking for $ac_word" >&5
1293 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1294 if test "${ac_cv_prog_CC+set}" = set; then
1295   echo $ECHO_N "(cached) $ECHO_C" >&6
1296 else
1297   if test -n "$CC"; then
1298   ac_cv_prog_CC="$CC" # Let the user override the test.
1299 else
1300   ac_prog_rejected=no
1301   ac_save_IFS=$IFS; IFS=$ac_path_separator
1302 ac_dummy="$PATH"
1303 for ac_dir in $ac_dummy; do
1304   IFS=$ac_save_IFS
1305   test -z "$ac_dir" && ac_dir=.
1306   $as_executable_p "$ac_dir/$ac_word" || continue
1307 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1308   ac_prog_rejected=yes
1309   continue
1310 fi
1311 ac_cv_prog_CC="cc"
1312 echo "$as_me:1312: found $ac_dir/$ac_word" >&5
1313 break
1314 done
1315
1316 if test $ac_prog_rejected = yes; then
1317   # We found a bogon in the path, so make sure we never use it.
1318   set dummy $ac_cv_prog_CC
1319   shift
1320   if test $# != 0; then
1321     # We chose a different compiler from the bogus one.
1322     # However, it has the same basename, so the bogon will be chosen
1323     # first if we set CC to just the basename; use the full file name.
1324     shift
1325     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1326     shift
1327     ac_cv_prog_CC="$@"
1328   fi
1329 fi
1330 fi
1331 fi
1332 CC=$ac_cv_prog_CC
1333 if test -n "$CC"; then
1334   echo "$as_me:1334: result: $CC" >&5
1335 echo "${ECHO_T}$CC" >&6
1336 else
1337   echo "$as_me:1337: result: no" >&5
1338 echo "${ECHO_T}no" >&6
1339 fi
1340
1341 fi
1342 if test -z "$CC"; then
1343   if test -n "$ac_tool_prefix"; then
1344   for ac_prog in cl
1345   do
1346     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1347 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1348 echo "$as_me:1348: checking for $ac_word" >&5
1349 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1350 if test "${ac_cv_prog_CC+set}" = set; then
1351   echo $ECHO_N "(cached) $ECHO_C" >&6
1352 else
1353   if test -n "$CC"; then
1354   ac_cv_prog_CC="$CC" # Let the user override the test.
1355 else
1356   ac_save_IFS=$IFS; IFS=$ac_path_separator
1357 ac_dummy="$PATH"
1358 for ac_dir in $ac_dummy; do
1359   IFS=$ac_save_IFS
1360   test -z "$ac_dir" && ac_dir=.
1361   $as_executable_p "$ac_dir/$ac_word" || continue
1362 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1363 echo "$as_me:1363: found $ac_dir/$ac_word" >&5
1364 break
1365 done
1366
1367 fi
1368 fi
1369 CC=$ac_cv_prog_CC
1370 if test -n "$CC"; then
1371   echo "$as_me:1371: result: $CC" >&5
1372 echo "${ECHO_T}$CC" >&6
1373 else
1374   echo "$as_me:1374: result: no" >&5
1375 echo "${ECHO_T}no" >&6
1376 fi
1377
1378     test -n "$CC" && break
1379   done
1380 fi
1381 if test -z "$CC"; then
1382   ac_ct_CC=$CC
1383   for ac_prog in cl
1384 do
1385   # Extract the first word of "$ac_prog", so it can be a program name with args.
1386 set dummy $ac_prog; ac_word=$2
1387 echo "$as_me:1387: checking for $ac_word" >&5
1388 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1389 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1390   echo $ECHO_N "(cached) $ECHO_C" >&6
1391 else
1392   if test -n "$ac_ct_CC"; then
1393   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1394 else
1395   ac_save_IFS=$IFS; IFS=$ac_path_separator
1396 ac_dummy="$PATH"
1397 for ac_dir in $ac_dummy; do
1398   IFS=$ac_save_IFS
1399   test -z "$ac_dir" && ac_dir=.
1400   $as_executable_p "$ac_dir/$ac_word" || continue
1401 ac_cv_prog_ac_ct_CC="$ac_prog"
1402 echo "$as_me:1402: found $ac_dir/$ac_word" >&5
1403 break
1404 done
1405
1406 fi
1407 fi
1408 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1409 if test -n "$ac_ct_CC"; then
1410   echo "$as_me:1410: result: $ac_ct_CC" >&5
1411 echo "${ECHO_T}$ac_ct_CC" >&6
1412 else
1413   echo "$as_me:1413: result: no" >&5
1414 echo "${ECHO_T}no" >&6
1415 fi
1416
1417   test -n "$ac_ct_CC" && break
1418 done
1419
1420   CC=$ac_ct_CC
1421 fi
1422
1423 fi
1424
1425 test -z "$CC" && { { echo "$as_me:1425: error: no acceptable cc found in \$PATH" >&5
1426 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1427    { (exit 1); exit 1; }; }
1428
1429 # Provide some information about the compiler.
1430 echo "$as_me:1430:" \
1431      "checking for C compiler version" >&5
1432 ac_compiler=`set X $ac_compile; echo $2`
1433 { (eval echo "$as_me:1433: \"$ac_compiler --version </dev/null >&5\"") >&5
1434   (eval $ac_compiler --version </dev/null >&5) 2>&5
1435   ac_status=$?
1436   echo "$as_me:1436: \$? = $ac_status" >&5
1437   (exit $ac_status); }
1438 { (eval echo "$as_me:1438: \"$ac_compiler -v </dev/null >&5\"") >&5
1439   (eval $ac_compiler -v </dev/null >&5) 2>&5
1440   ac_status=$?
1441   echo "$as_me:1441: \$? = $ac_status" >&5
1442   (exit $ac_status); }
1443 { (eval echo "$as_me:1443: \"$ac_compiler -V </dev/null >&5\"") >&5
1444   (eval $ac_compiler -V </dev/null >&5) 2>&5
1445   ac_status=$?
1446   echo "$as_me:1446: \$? = $ac_status" >&5
1447   (exit $ac_status); }
1448
1449 cat >conftest.$ac_ext <<_ACEOF
1450 #line 1450 "configure"
1451 #include "confdefs.h"
1452
1453 int
1454 main (void)
1455 {
1456
1457   ;
1458   return 0;
1459 }
1460 _ACEOF
1461 ac_clean_files_save=$ac_clean_files
1462 ac_clean_files="$ac_clean_files a.out a.exe"
1463 # Try to create an executable without -o first, disregard a.out.
1464 # It will help us diagnose broken compilers, and finding out an intuition
1465 # of exeext.
1466 echo "$as_me:1466: checking for C compiler default output" >&5
1467 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1468 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1469 if { (eval echo "$as_me:1469: \"$ac_link_default\"") >&5
1470   (eval $ac_link_default) 2>&5
1471   ac_status=$?
1472   echo "$as_me:1472: \$? = $ac_status" >&5
1473   (exit $ac_status); }; then
1474   # Find the output, starting from the most likely.  This scheme is
1475 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1476 # resort.
1477 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1478                 ls a.out conftest 2>/dev/null;
1479                 ls a.* conftest.* 2>/dev/null`; do
1480   case $ac_file in
1481     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1482     a.out ) # We found the default executable, but exeext='' is most
1483             # certainly right.
1484             break;;
1485     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1486           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1487           export ac_cv_exeext
1488           break;;
1489     * ) break;;
1490   esac
1491 done
1492 else
1493   echo "$as_me: failed program was:" >&5
1494 cat conftest.$ac_ext >&5
1495 { { echo "$as_me:1495: error: C compiler cannot create executables" >&5
1496 echo "$as_me: error: C compiler cannot create executables" >&2;}
1497    { (exit 77); exit 77; }; }
1498 fi
1499
1500 ac_exeext=$ac_cv_exeext
1501 echo "$as_me:1501: result: $ac_file" >&5
1502 echo "${ECHO_T}$ac_file" >&6
1503
1504 # Check the compiler produces executables we can run.  If not, either
1505 # the compiler is broken, or we cross compile.
1506 echo "$as_me:1506: checking whether the C compiler works" >&5
1507 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1508 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1509 # If not cross compiling, check that we can run a simple program.
1510 if test "$cross_compiling" != yes; then
1511   if { ac_try='./$ac_file'
1512   { (eval echo "$as_me:1512: \"$ac_try\"") >&5
1513   (eval $ac_try) 2>&5
1514   ac_status=$?
1515   echo "$as_me:1515: \$? = $ac_status" >&5
1516   (exit $ac_status); }; }; then
1517     cross_compiling=no
1518   else
1519     if test "$cross_compiling" = maybe; then
1520         cross_compiling=yes
1521     else
1522         { { echo "$as_me:1522: error: cannot run C compiled programs.
1523 If you meant to cross compile, use \`--host'." >&5
1524 echo "$as_me: error: cannot run C compiled programs.
1525 If you meant to cross compile, use \`--host'." >&2;}
1526    { (exit 1); exit 1; }; }
1527     fi
1528   fi
1529 fi
1530 echo "$as_me:1530: result: yes" >&5
1531 echo "${ECHO_T}yes" >&6
1532
1533 rm -f a.out a.exe conftest$ac_cv_exeext
1534 ac_clean_files=$ac_clean_files_save
1535 # Check the compiler produces executables we can run.  If not, either
1536 # the compiler is broken, or we cross compile.
1537 echo "$as_me:1537: checking whether we are cross compiling" >&5
1538 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1539 echo "$as_me:1539: result: $cross_compiling" >&5
1540 echo "${ECHO_T}$cross_compiling" >&6
1541
1542 echo "$as_me:1542: checking for executable suffix" >&5
1543 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1544 if { (eval echo "$as_me:1544: \"$ac_link\"") >&5
1545   (eval $ac_link) 2>&5
1546   ac_status=$?
1547   echo "$as_me:1547: \$? = $ac_status" >&5
1548   (exit $ac_status); }; then
1549   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1550 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1551 # work properly (i.e., refer to `conftest.exe'), while it won't with
1552 # `rm'.
1553 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1554   case $ac_file in
1555     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1556     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1557           export ac_cv_exeext
1558           break;;
1559     * ) break;;
1560   esac
1561 done
1562 else
1563   { { echo "$as_me:1563: error: cannot compute EXEEXT: cannot compile and link" >&5
1564 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1565    { (exit 1); exit 1; }; }
1566 fi
1567
1568 rm -f conftest$ac_cv_exeext
1569 echo "$as_me:1569: result: $ac_cv_exeext" >&5
1570 echo "${ECHO_T}$ac_cv_exeext" >&6
1571
1572 rm -f conftest.$ac_ext
1573 EXEEXT=$ac_cv_exeext
1574 ac_exeext=$EXEEXT
1575 echo "$as_me:1575: checking for object suffix" >&5
1576 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1577 if test "${ac_cv_objext+set}" = set; then
1578   echo $ECHO_N "(cached) $ECHO_C" >&6
1579 else
1580   cat >conftest.$ac_ext <<_ACEOF
1581 #line 1581 "configure"
1582 #include "confdefs.h"
1583
1584 int
1585 main (void)
1586 {
1587
1588   ;
1589   return 0;
1590 }
1591 _ACEOF
1592 rm -f conftest.o conftest.obj
1593 if { (eval echo "$as_me:1593: \"$ac_compile\"") >&5
1594   (eval $ac_compile) 2>&5
1595   ac_status=$?
1596   echo "$as_me:1596: \$? = $ac_status" >&5
1597   (exit $ac_status); }; then
1598   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1599   case $ac_file in
1600     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1601     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1602        break;;
1603   esac
1604 done
1605 else
1606   echo "$as_me: failed program was:" >&5
1607 cat conftest.$ac_ext >&5
1608 { { echo "$as_me:1608: error: cannot compute OBJEXT: cannot compile" >&5
1609 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1610    { (exit 1); exit 1; }; }
1611 fi
1612
1613 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1614 fi
1615 echo "$as_me:1615: result: $ac_cv_objext" >&5
1616 echo "${ECHO_T}$ac_cv_objext" >&6
1617 OBJEXT=$ac_cv_objext
1618 ac_objext=$OBJEXT
1619 echo "$as_me:1619: checking whether we are using the GNU C compiler" >&5
1620 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1621 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1622   echo $ECHO_N "(cached) $ECHO_C" >&6
1623 else
1624   cat >conftest.$ac_ext <<_ACEOF
1625 #line 1625 "configure"
1626 #include "confdefs.h"
1627
1628 int
1629 main (void)
1630 {
1631 #ifndef __GNUC__
1632        choke me
1633 #endif
1634
1635   ;
1636   return 0;
1637 }
1638 _ACEOF
1639 rm -f conftest.$ac_objext
1640 if { (eval echo "$as_me:1640: \"$ac_compile\"") >&5
1641   (eval $ac_compile) 2>&5
1642   ac_status=$?
1643   echo "$as_me:1643: \$? = $ac_status" >&5
1644   (exit $ac_status); } &&
1645          { ac_try='test -s conftest.$ac_objext'
1646   { (eval echo "$as_me:1646: \"$ac_try\"") >&5
1647   (eval $ac_try) 2>&5
1648   ac_status=$?
1649   echo "$as_me:1649: \$? = $ac_status" >&5
1650   (exit $ac_status); }; }; then
1651   ac_compiler_gnu=yes
1652 else
1653   echo "$as_me: failed program was:" >&5
1654 cat conftest.$ac_ext >&5
1655 ac_compiler_gnu=no
1656 fi
1657 rm -f conftest.$ac_objext conftest.$ac_ext
1658 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1659
1660 fi
1661 echo "$as_me:1661: result: $ac_cv_c_compiler_gnu" >&5
1662 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1663 GCC=`test $ac_compiler_gnu = yes && echo yes`
1664 ac_test_CFLAGS=${CFLAGS+set}
1665 ac_save_CFLAGS=$CFLAGS
1666 CFLAGS="-g"
1667 echo "$as_me:1667: checking whether $CC accepts -g" >&5
1668 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1669 if test "${ac_cv_prog_cc_g+set}" = set; then
1670   echo $ECHO_N "(cached) $ECHO_C" >&6
1671 else
1672   cat >conftest.$ac_ext <<_ACEOF
1673 #line 1673 "configure"
1674 #include "confdefs.h"
1675
1676 int
1677 main (void)
1678 {
1679
1680   ;
1681   return 0;
1682 }
1683 _ACEOF
1684 rm -f conftest.$ac_objext
1685 if { (eval echo "$as_me:1685: \"$ac_compile\"") >&5
1686   (eval $ac_compile) 2>&5
1687   ac_status=$?
1688   echo "$as_me:1688: \$? = $ac_status" >&5
1689   (exit $ac_status); } &&
1690          { ac_try='test -s conftest.$ac_objext'
1691   { (eval echo "$as_me:1691: \"$ac_try\"") >&5
1692   (eval $ac_try) 2>&5
1693   ac_status=$?
1694   echo "$as_me:1694: \$? = $ac_status" >&5
1695   (exit $ac_status); }; }; then
1696   ac_cv_prog_cc_g=yes
1697 else
1698   echo "$as_me: failed program was:" >&5
1699 cat conftest.$ac_ext >&5
1700 ac_cv_prog_cc_g=no
1701 fi
1702 rm -f conftest.$ac_objext conftest.$ac_ext
1703 fi
1704 echo "$as_me:1704: result: $ac_cv_prog_cc_g" >&5
1705 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1706 if test "$ac_test_CFLAGS" = set; then
1707   CFLAGS=$ac_save_CFLAGS
1708 elif test $ac_cv_prog_cc_g = yes; then
1709   if test "$GCC" = yes; then
1710     CFLAGS="-g -O2"
1711   else
1712     CFLAGS="-g"
1713   fi
1714 else
1715   if test "$GCC" = yes; then
1716     CFLAGS="-O2"
1717   else
1718     CFLAGS=
1719   fi
1720 fi
1721 # Some people use a C++ compiler to compile C.  Since we use `exit',
1722 # in C++ we need to declare it.  In case someone uses the same compiler
1723 # for both compiling C and C++ we need to have the C++ compiler decide
1724 # the declaration of exit, since it's the most demanding environment.
1725 cat >conftest.$ac_ext <<_ACEOF
1726 #ifndef __cplusplus
1727   choke me
1728 #endif
1729 _ACEOF
1730 rm -f conftest.$ac_objext
1731 if { (eval echo "$as_me:1731: \"$ac_compile\"") >&5
1732   (eval $ac_compile) 2>&5
1733   ac_status=$?
1734   echo "$as_me:1734: \$? = $ac_status" >&5
1735   (exit $ac_status); } &&
1736          { ac_try='test -s conftest.$ac_objext'
1737   { (eval echo "$as_me:1737: \"$ac_try\"") >&5
1738   (eval $ac_try) 2>&5
1739   ac_status=$?
1740   echo "$as_me:1740: \$? = $ac_status" >&5
1741   (exit $ac_status); }; }; then
1742   for ac_declaration in \
1743    ''\
1744    '#include <stdlib.h>' \
1745    'extern "C" void std::exit (int) throw (); using std::exit;' \
1746    'extern "C" void std::exit (int); using std::exit;' \
1747    'extern "C" void exit (int) throw ();' \
1748    'extern "C" void exit (int);' \
1749    'void exit (int);'
1750 do
1751   cat >conftest.$ac_ext <<_ACEOF
1752 #line 1752 "configure"
1753 #include "confdefs.h"
1754 #include <stdlib.h>
1755 $ac_declaration
1756 int
1757 main (void)
1758 {
1759 exit (42);
1760   ;
1761   return 0;
1762 }
1763 _ACEOF
1764 rm -f conftest.$ac_objext
1765 if { (eval echo "$as_me:1765: \"$ac_compile\"") >&5
1766   (eval $ac_compile) 2>&5
1767   ac_status=$?
1768   echo "$as_me:1768: \$? = $ac_status" >&5
1769   (exit $ac_status); } &&
1770          { ac_try='test -s conftest.$ac_objext'
1771   { (eval echo "$as_me:1771: \"$ac_try\"") >&5
1772   (eval $ac_try) 2>&5
1773   ac_status=$?
1774   echo "$as_me:1774: \$? = $ac_status" >&5
1775   (exit $ac_status); }; }; then
1776   :
1777 else
1778   echo "$as_me: failed program was:" >&5
1779 cat conftest.$ac_ext >&5
1780 continue
1781 fi
1782 rm -f conftest.$ac_objext conftest.$ac_ext
1783   cat >conftest.$ac_ext <<_ACEOF
1784 #line 1784 "configure"
1785 #include "confdefs.h"
1786 $ac_declaration
1787 int
1788 main (void)
1789 {
1790 exit (42);
1791   ;
1792   return 0;
1793 }
1794 _ACEOF
1795 rm -f conftest.$ac_objext
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit $ac_status); } &&
1801          { ac_try='test -s conftest.$ac_objext'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit $ac_status); }; }; then
1807   break
1808 else
1809   echo "$as_me: failed program was:" >&5
1810 cat conftest.$ac_ext >&5
1811 fi
1812 rm -f conftest.$ac_objext conftest.$ac_ext
1813 done
1814 rm -rf conftest*
1815 if test -n "$ac_declaration"; then
1816   echo '#ifdef __cplusplus' >>confdefs.h
1817   echo $ac_declaration      >>confdefs.h
1818   echo '#endif'             >>confdefs.h
1819 fi
1820
1821 else
1822   echo "$as_me: failed program was:" >&5
1823 cat conftest.$ac_ext >&5
1824 fi
1825 rm -f conftest.$ac_objext conftest.$ac_ext
1826 ac_ext=c
1827 ac_cpp='$CPP $CPPFLAGS'
1828 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1829 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1830 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1831 ac_main_return=return
1832
1833 GCC_VERSION=none
1834 if test "$GCC" = yes ; then
1835         echo "$as_me:1835: checking version of $CC" >&5
1836 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1837         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.].*//'`"
1838         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1839         echo "$as_me:1839: result: $GCC_VERSION" >&5
1840 echo "${ECHO_T}$GCC_VERSION" >&6
1841 fi
1842
1843 echo "$as_me:1843: checking for $CC option to accept ANSI C" >&5
1844 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1845 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1846   echo $ECHO_N "(cached) $ECHO_C" >&6
1847 else
1848   ac_cv_prog_cc_stdc=no
1849 ac_save_CC=$CC
1850 cat >conftest.$ac_ext <<_ACEOF
1851 #line 1851 "configure"
1852 #include "confdefs.h"
1853 #include <stdarg.h>
1854 #include <stdio.h>
1855 #include <sys/types.h>
1856 #include <sys/stat.h>
1857 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1858 struct buf { int x; };
1859 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1860 static char *e (p, i)
1861      char **p;
1862      int i;
1863 {
1864   return p[i];
1865 }
1866 static char *f (char * (*g) (char **, int), char **p, ...)
1867 {
1868   char *s;
1869   va_list v;
1870   va_start (v,p);
1871   s = g (p, va_arg (v,int));
1872   va_end (v);
1873   return s;
1874 }
1875 int test (int i, double x);
1876 struct s1 {int (*f) (int a);};
1877 struct s2 {int (*f) (double a);};
1878 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1879 int argc;
1880 char **argv;
1881 int
1882 main (void)
1883 {
1884 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1885   ;
1886   return 0;
1887 }
1888 _ACEOF
1889 # Don't try gcc -ansi; that turns off useful extensions and
1890 # breaks some systems' header files.
1891 # AIX                   -qlanglvl=ansi
1892 # Ultrix and OSF/1      -std1
1893 # HP-UX 10.20 and later -Ae
1894 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1895 # SVR4                  -Xc -D__EXTENSIONS__
1896 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1897 do
1898   CC="$ac_save_CC $ac_arg"
1899   rm -f conftest.$ac_objext
1900 if { (eval echo "$as_me:1900: \"$ac_compile\"") >&5
1901   (eval $ac_compile) 2>&5
1902   ac_status=$?
1903   echo "$as_me:1903: \$? = $ac_status" >&5
1904   (exit $ac_status); } &&
1905          { ac_try='test -s conftest.$ac_objext'
1906   { (eval echo "$as_me:1906: \"$ac_try\"") >&5
1907   (eval $ac_try) 2>&5
1908   ac_status=$?
1909   echo "$as_me:1909: \$? = $ac_status" >&5
1910   (exit $ac_status); }; }; then
1911   ac_cv_prog_cc_stdc=$ac_arg
1912 break
1913 else
1914   echo "$as_me: failed program was:" >&5
1915 cat conftest.$ac_ext >&5
1916 fi
1917 rm -f conftest.$ac_objext
1918 done
1919 rm -f conftest.$ac_ext conftest.$ac_objext
1920 CC=$ac_save_CC
1921
1922 fi
1923
1924 case "x$ac_cv_prog_cc_stdc" in
1925   x|xno)
1926     echo "$as_me:1926: result: none needed" >&5
1927 echo "${ECHO_T}none needed" >&6 ;;
1928   *)
1929     echo "$as_me:1929: result: $ac_cv_prog_cc_stdc" >&5
1930 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1931     CC="$CC $ac_cv_prog_cc_stdc" ;;
1932 esac
1933
1934 # This should have been defined by AC_PROG_CC
1935 : ${CC:=cc}
1936
1937 echo "$as_me:1937: checking \$CC variable" >&5
1938 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1939 case "$CC" in
1940 (*[\ \  ]-*)
1941         echo "$as_me:1941: result: broken" >&5
1942 echo "${ECHO_T}broken" >&6
1943         { echo "$as_me:1943: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1944 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1945         # humor him...
1946         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1947         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1948         CC="$cf_prog"
1949         for cf_arg in $cf_flags
1950         do
1951                 case "x$cf_arg" in
1952                 (x-[IUDfgOW]*)
1953
1954 cf_fix_cppflags=no
1955 cf_new_cflags=
1956 cf_new_cppflags=
1957 cf_new_extra_cppflags=
1958
1959 for cf_add_cflags in $cf_arg
1960 do
1961 case $cf_fix_cppflags in
1962 (no)
1963         case $cf_add_cflags in
1964         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1965                 case $cf_add_cflags in
1966                 (-D*)
1967                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1968
1969                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1970                                 && test -z "${cf_tst_cflags}" \
1971                                 && cf_fix_cppflags=yes
1972
1973                         if test $cf_fix_cppflags = yes ; then
1974
1975         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1976         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1977
1978                                 continue
1979                         elif test "${cf_tst_cflags}" = "\"'" ; then
1980
1981         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1982         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1983
1984                                 continue
1985                         fi
1986                         ;;
1987                 esac
1988                 case "$CPPFLAGS" in
1989                 (*$cf_add_cflags)
1990                         ;;
1991                 (*)
1992                         case $cf_add_cflags in
1993                         (-D*)
1994                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1995
1996 CPPFLAGS=`echo "$CPPFLAGS" | \
1997         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1998                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1999
2000                                 ;;
2001                         esac
2002
2003         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2004         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2005
2006                         ;;
2007                 esac
2008                 ;;
2009         (*)
2010
2011         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2012         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2013
2014                 ;;
2015         esac
2016         ;;
2017 (yes)
2018
2019         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2020         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2021
2022         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2023
2024         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2025                 && test -z "${cf_tst_cflags}" \
2026                 && cf_fix_cppflags=no
2027         ;;
2028 esac
2029 done
2030
2031 if test -n "$cf_new_cflags" ; then
2032
2033         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2034         CFLAGS="${CFLAGS}$cf_new_cflags"
2035
2036 fi
2037
2038 if test -n "$cf_new_cppflags" ; then
2039
2040         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2041         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2042
2043 fi
2044
2045 if test -n "$cf_new_extra_cppflags" ; then
2046
2047         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2048         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2049
2050 fi
2051
2052                         ;;
2053                 (*)
2054                         CC="$CC $cf_arg"
2055                         ;;
2056                 esac
2057         done
2058         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2059
2060 echo "${as_me:-configure}:2060: testing resulting CC: '$CC' ..." 1>&5
2061
2062         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2063
2064 echo "${as_me:-configure}:2064: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2065
2066         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2067
2068 echo "${as_me:-configure}:2068: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2069
2070         ;;
2071 (*)
2072         echo "$as_me:2072: result: ok" >&5
2073 echo "${ECHO_T}ok" >&6
2074         ;;
2075 esac
2076
2077 ac_ext=c
2078 ac_cpp='$CPP $CPPFLAGS'
2079 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2080 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2081 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2082 ac_main_return=return
2083 echo "$as_me:2083: checking how to run the C preprocessor" >&5
2084 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2085 # On Suns, sometimes $CPP names a directory.
2086 if test -n "$CPP" && test -d "$CPP"; then
2087   CPP=
2088 fi
2089 if test -z "$CPP"; then
2090   if test "${ac_cv_prog_CPP+set}" = set; then
2091   echo $ECHO_N "(cached) $ECHO_C" >&6
2092 else
2093       # Double quotes because CPP needs to be expanded
2094     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2095     do
2096       ac_preproc_ok=false
2097 for ac_c_preproc_warn_flag in '' yes
2098 do
2099   # Use a header file that comes with gcc, so configuring glibc
2100   # with a fresh cross-compiler works.
2101   # On the NeXT, cc -E runs the code through the compiler's parser,
2102   # not just through cpp. "Syntax error" is here to catch this case.
2103   cat >conftest.$ac_ext <<_ACEOF
2104 #line 2104 "configure"
2105 #include "confdefs.h"
2106 #include <assert.h>
2107                      Syntax error
2108 _ACEOF
2109 if { (eval echo "$as_me:2109: \"$ac_cpp conftest.$ac_ext\"") >&5
2110   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2111   ac_status=$?
2112   egrep -v '^ *\+' conftest.er1 >conftest.err
2113   rm -f conftest.er1
2114   cat conftest.err >&5
2115   echo "$as_me:2115: \$? = $ac_status" >&5
2116   (exit $ac_status); } >/dev/null; then
2117   if test -s conftest.err; then
2118     ac_cpp_err=$ac_c_preproc_warn_flag
2119   else
2120     ac_cpp_err=
2121   fi
2122 else
2123   ac_cpp_err=yes
2124 fi
2125 if test -z "$ac_cpp_err"; then
2126   :
2127 else
2128   echo "$as_me: failed program was:" >&5
2129   cat conftest.$ac_ext >&5
2130   # Broken: fails on valid input.
2131 continue
2132 fi
2133 rm -f conftest.err conftest.$ac_ext
2134
2135   # OK, works on sane cases.  Now check whether non-existent headers
2136   # can be detected and how.
2137   cat >conftest.$ac_ext <<_ACEOF
2138 #line 2138 "configure"
2139 #include "confdefs.h"
2140 #include <ac_nonexistent.h>
2141 _ACEOF
2142 if { (eval echo "$as_me:2142: \"$ac_cpp conftest.$ac_ext\"") >&5
2143   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2144   ac_status=$?
2145   egrep -v '^ *\+' conftest.er1 >conftest.err
2146   rm -f conftest.er1
2147   cat conftest.err >&5
2148   echo "$as_me:2148: \$? = $ac_status" >&5
2149   (exit $ac_status); } >/dev/null; then
2150   if test -s conftest.err; then
2151     ac_cpp_err=$ac_c_preproc_warn_flag
2152   else
2153     ac_cpp_err=
2154   fi
2155 else
2156   ac_cpp_err=yes
2157 fi
2158 if test -z "$ac_cpp_err"; then
2159   # Broken: success on invalid input.
2160 continue
2161 else
2162   echo "$as_me: failed program was:" >&5
2163   cat conftest.$ac_ext >&5
2164   # Passes both tests.
2165 ac_preproc_ok=:
2166 break
2167 fi
2168 rm -f conftest.err conftest.$ac_ext
2169
2170 done
2171 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2172 rm -f conftest.err conftest.$ac_ext
2173 if $ac_preproc_ok; then
2174   break
2175 fi
2176
2177     done
2178     ac_cv_prog_CPP=$CPP
2179
2180 fi
2181   CPP=$ac_cv_prog_CPP
2182 else
2183   ac_cv_prog_CPP=$CPP
2184 fi
2185 echo "$as_me:2185: result: $CPP" >&5
2186 echo "${ECHO_T}$CPP" >&6
2187 ac_preproc_ok=false
2188 for ac_c_preproc_warn_flag in '' yes
2189 do
2190   # Use a header file that comes with gcc, so configuring glibc
2191   # with a fresh cross-compiler works.
2192   # On the NeXT, cc -E runs the code through the compiler's parser,
2193   # not just through cpp. "Syntax error" is here to catch this case.
2194   cat >conftest.$ac_ext <<_ACEOF
2195 #line 2195 "configure"
2196 #include "confdefs.h"
2197 #include <assert.h>
2198                      Syntax error
2199 _ACEOF
2200 if { (eval echo "$as_me:2200: \"$ac_cpp conftest.$ac_ext\"") >&5
2201   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2202   ac_status=$?
2203   egrep -v '^ *\+' conftest.er1 >conftest.err
2204   rm -f conftest.er1
2205   cat conftest.err >&5
2206   echo "$as_me:2206: \$? = $ac_status" >&5
2207   (exit $ac_status); } >/dev/null; then
2208   if test -s conftest.err; then
2209     ac_cpp_err=$ac_c_preproc_warn_flag
2210   else
2211     ac_cpp_err=
2212   fi
2213 else
2214   ac_cpp_err=yes
2215 fi
2216 if test -z "$ac_cpp_err"; then
2217   :
2218 else
2219   echo "$as_me: failed program was:" >&5
2220   cat conftest.$ac_ext >&5
2221   # Broken: fails on valid input.
2222 continue
2223 fi
2224 rm -f conftest.err conftest.$ac_ext
2225
2226   # OK, works on sane cases.  Now check whether non-existent headers
2227   # can be detected and how.
2228   cat >conftest.$ac_ext <<_ACEOF
2229 #line 2229 "configure"
2230 #include "confdefs.h"
2231 #include <ac_nonexistent.h>
2232 _ACEOF
2233 if { (eval echo "$as_me:2233: \"$ac_cpp conftest.$ac_ext\"") >&5
2234   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2235   ac_status=$?
2236   egrep -v '^ *\+' conftest.er1 >conftest.err
2237   rm -f conftest.er1
2238   cat conftest.err >&5
2239   echo "$as_me:2239: \$? = $ac_status" >&5
2240   (exit $ac_status); } >/dev/null; then
2241   if test -s conftest.err; then
2242     ac_cpp_err=$ac_c_preproc_warn_flag
2243   else
2244     ac_cpp_err=
2245   fi
2246 else
2247   ac_cpp_err=yes
2248 fi
2249 if test -z "$ac_cpp_err"; then
2250   # Broken: success on invalid input.
2251 continue
2252 else
2253   echo "$as_me: failed program was:" >&5
2254   cat conftest.$ac_ext >&5
2255   # Passes both tests.
2256 ac_preproc_ok=:
2257 break
2258 fi
2259 rm -f conftest.err conftest.$ac_ext
2260
2261 done
2262 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2263 rm -f conftest.err conftest.$ac_ext
2264 if $ac_preproc_ok; then
2265   :
2266 else
2267   { { echo "$as_me:2267: error: C preprocessor \"$CPP\" fails sanity check" >&5
2268 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2269    { (exit 1); exit 1; }; }
2270 fi
2271
2272 ac_ext=c
2273 ac_cpp='$CPP $CPPFLAGS'
2274 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2275 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2276 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2277 ac_main_return=return
2278
2279 for ac_prog in mawk gawk nawk awk
2280 do
2281   # Extract the first word of "$ac_prog", so it can be a program name with args.
2282 set dummy $ac_prog; ac_word=$2
2283 echo "$as_me:2283: checking for $ac_word" >&5
2284 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2285 if test "${ac_cv_prog_AWK+set}" = set; then
2286   echo $ECHO_N "(cached) $ECHO_C" >&6
2287 else
2288   if test -n "$AWK"; then
2289   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2290 else
2291   ac_save_IFS=$IFS; IFS=$ac_path_separator
2292 ac_dummy="$PATH"
2293 for ac_dir in $ac_dummy; do
2294   IFS=$ac_save_IFS
2295   test -z "$ac_dir" && ac_dir=.
2296   $as_executable_p "$ac_dir/$ac_word" || continue
2297 ac_cv_prog_AWK="$ac_prog"
2298 echo "$as_me:2298: found $ac_dir/$ac_word" >&5
2299 break
2300 done
2301
2302 fi
2303 fi
2304 AWK=$ac_cv_prog_AWK
2305 if test -n "$AWK"; then
2306   echo "$as_me:2306: result: $AWK" >&5
2307 echo "${ECHO_T}$AWK" >&6
2308 else
2309   echo "$as_me:2309: result: no" >&5
2310 echo "${ECHO_T}no" >&6
2311 fi
2312
2313   test -n "$AWK" && break
2314 done
2315
2316 # Find a good install program.  We prefer a C program (faster),
2317 # so one script is as good as another.  But avoid the broken or
2318 # incompatible versions:
2319 # SysV /etc/install, /usr/sbin/install
2320 # SunOS /usr/etc/install
2321 # IRIX /sbin/install
2322 # AIX /bin/install
2323 # AmigaOS /C/install, which installs bootblocks on floppy discs
2324 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2325 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2326 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2327 # ./install, which can be erroneously created by make from ./install.sh.
2328 echo "$as_me:2328: checking for a BSD compatible install" >&5
2329 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2330 if test -z "$INSTALL"; then
2331 if test "${ac_cv_path_install+set}" = set; then
2332   echo $ECHO_N "(cached) $ECHO_C" >&6
2333 else
2334     ac_save_IFS=$IFS; IFS=$ac_path_separator
2335   for ac_dir in $PATH; do
2336     IFS=$ac_save_IFS
2337     # Account for people who put trailing slashes in PATH elements.
2338     case $ac_dir/ in
2339     / | ./ | .// | /cC/* \
2340     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2341     | /usr/ucb/* ) ;;
2342     *)
2343       # OSF1 and SCO ODT 3.0 have their own names for install.
2344       # Don't use installbsd from OSF since it installs stuff as root
2345       # by default.
2346       for ac_prog in ginstall scoinst install; do
2347         if $as_executable_p "$ac_dir/$ac_prog"; then
2348           if test $ac_prog = install &&
2349             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2350             # AIX install.  It has an incompatible calling convention.
2351             :
2352           elif test $ac_prog = install &&
2353             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2354             # program-specific install script used by HP pwplus--don't use.
2355             :
2356           else
2357             ac_cv_path_install="$ac_dir/$ac_prog -c"
2358             break 2
2359           fi
2360         fi
2361       done
2362       ;;
2363     esac
2364   done
2365
2366 fi
2367   if test "${ac_cv_path_install+set}" = set; then
2368     INSTALL=$ac_cv_path_install
2369   else
2370     # As a last resort, use the slow shell script.  We don't cache a
2371     # path for INSTALL within a source directory, because that will
2372     # break other packages using the cache if that directory is
2373     # removed, or if the path is relative.
2374     INSTALL=$ac_install_sh
2375   fi
2376 fi
2377 echo "$as_me:2377: result: $INSTALL" >&5
2378 echo "${ECHO_T}$INSTALL" >&6
2379
2380 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2381 # It thinks the first close brace ends the variable substitution.
2382 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2383
2384 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2385
2386 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2387
2388 case $INSTALL in
2389 (/*)
2390         ;;
2391 (*)
2392         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2393         test -z "$cf_dir" && cf_dir=.
2394         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2395         ;;
2396 esac
2397
2398 for ac_prog in lint cppcheck splint
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_prog_LINT+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   if test -n "$LINT"; then
2408   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2409 else
2410   ac_save_IFS=$IFS; IFS=$ac_path_separator
2411 ac_dummy="$PATH"
2412 for ac_dir in $ac_dummy; do
2413   IFS=$ac_save_IFS
2414   test -z "$ac_dir" && ac_dir=.
2415   $as_executable_p "$ac_dir/$ac_word" || continue
2416 ac_cv_prog_LINT="$ac_prog"
2417 echo "$as_me:2417: found $ac_dir/$ac_word" >&5
2418 break
2419 done
2420
2421 fi
2422 fi
2423 LINT=$ac_cv_prog_LINT
2424 if test -n "$LINT"; then
2425   echo "$as_me:2425: result: $LINT" >&5
2426 echo "${ECHO_T}$LINT" >&6
2427 else
2428   echo "$as_me:2428: result: no" >&5
2429 echo "${ECHO_T}no" >&6
2430 fi
2431
2432   test -n "$LINT" && break
2433 done
2434
2435 echo "$as_me:2435: checking if filesystem supports mixed-case filenames" >&5
2436 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2437 if test "${cf_cv_mixedcase+set}" = set; then
2438   echo $ECHO_N "(cached) $ECHO_C" >&6
2439 else
2440
2441 if test "$cross_compiling" = yes ; then
2442         case $target_alias in
2443         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2444                 cf_cv_mixedcase=no
2445                 ;;
2446         (*)
2447                 cf_cv_mixedcase=yes
2448                 ;;
2449         esac
2450 else
2451         rm -f conftest CONFTEST
2452         echo test >conftest
2453         if test -f CONFTEST ; then
2454                 cf_cv_mixedcase=no
2455         else
2456                 cf_cv_mixedcase=yes
2457         fi
2458         rm -f conftest CONFTEST
2459 fi
2460
2461 fi
2462 echo "$as_me:2462: result: $cf_cv_mixedcase" >&5
2463 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2464 test "$cf_cv_mixedcase" = yes &&
2465 cat >>confdefs.h <<\EOF
2466 #define MIXEDCASE_FILENAMES 1
2467 EOF
2468
2469 for ac_prog in exctags ctags
2470 do
2471   # Extract the first word of "$ac_prog", so it can be a program name with args.
2472 set dummy $ac_prog; ac_word=$2
2473 echo "$as_me:2473: checking for $ac_word" >&5
2474 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2475 if test "${ac_cv_prog_CTAGS+set}" = set; then
2476   echo $ECHO_N "(cached) $ECHO_C" >&6
2477 else
2478   if test -n "$CTAGS"; then
2479   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2480 else
2481   ac_save_IFS=$IFS; IFS=$ac_path_separator
2482 ac_dummy="$PATH"
2483 for ac_dir in $ac_dummy; do
2484   IFS=$ac_save_IFS
2485   test -z "$ac_dir" && ac_dir=.
2486   $as_executable_p "$ac_dir/$ac_word" || continue
2487 ac_cv_prog_CTAGS="$ac_prog"
2488 echo "$as_me:2488: found $ac_dir/$ac_word" >&5
2489 break
2490 done
2491
2492 fi
2493 fi
2494 CTAGS=$ac_cv_prog_CTAGS
2495 if test -n "$CTAGS"; then
2496   echo "$as_me:2496: result: $CTAGS" >&5
2497 echo "${ECHO_T}$CTAGS" >&6
2498 else
2499   echo "$as_me:2499: result: no" >&5
2500 echo "${ECHO_T}no" >&6
2501 fi
2502
2503   test -n "$CTAGS" && break
2504 done
2505
2506 for ac_prog in exetags etags
2507 do
2508   # Extract the first word of "$ac_prog", so it can be a program name with args.
2509 set dummy $ac_prog; ac_word=$2
2510 echo "$as_me:2510: checking for $ac_word" >&5
2511 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2512 if test "${ac_cv_prog_ETAGS+set}" = set; then
2513   echo $ECHO_N "(cached) $ECHO_C" >&6
2514 else
2515   if test -n "$ETAGS"; then
2516   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2517 else
2518   ac_save_IFS=$IFS; IFS=$ac_path_separator
2519 ac_dummy="$PATH"
2520 for ac_dir in $ac_dummy; do
2521   IFS=$ac_save_IFS
2522   test -z "$ac_dir" && ac_dir=.
2523   $as_executable_p "$ac_dir/$ac_word" || continue
2524 ac_cv_prog_ETAGS="$ac_prog"
2525 echo "$as_me:2525: found $ac_dir/$ac_word" >&5
2526 break
2527 done
2528
2529 fi
2530 fi
2531 ETAGS=$ac_cv_prog_ETAGS
2532 if test -n "$ETAGS"; then
2533   echo "$as_me:2533: result: $ETAGS" >&5
2534 echo "${ECHO_T}$ETAGS" >&6
2535 else
2536   echo "$as_me:2536: result: no" >&5
2537 echo "${ECHO_T}no" >&6
2538 fi
2539
2540   test -n "$ETAGS" && break
2541 done
2542
2543 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2544 set dummy ${CTAGS:-ctags}; ac_word=$2
2545 echo "$as_me:2545: checking for $ac_word" >&5
2546 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2547 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2548   echo $ECHO_N "(cached) $ECHO_C" >&6
2549 else
2550   if test -n "$MAKE_LOWER_TAGS"; then
2551   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2552 else
2553   ac_save_IFS=$IFS; IFS=$ac_path_separator
2554 ac_dummy="$PATH"
2555 for ac_dir in $ac_dummy; do
2556   IFS=$ac_save_IFS
2557   test -z "$ac_dir" && ac_dir=.
2558   $as_executable_p "$ac_dir/$ac_word" || continue
2559 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2560 echo "$as_me:2560: found $ac_dir/$ac_word" >&5
2561 break
2562 done
2563
2564   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2565 fi
2566 fi
2567 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2568 if test -n "$MAKE_LOWER_TAGS"; then
2569   echo "$as_me:2569: result: $MAKE_LOWER_TAGS" >&5
2570 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2571 else
2572   echo "$as_me:2572: result: no" >&5
2573 echo "${ECHO_T}no" >&6
2574 fi
2575
2576 if test "$cf_cv_mixedcase" = yes ; then
2577         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2578 set dummy ${ETAGS:-etags}; ac_word=$2
2579 echo "$as_me:2579: checking for $ac_word" >&5
2580 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2581 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2582   echo $ECHO_N "(cached) $ECHO_C" >&6
2583 else
2584   if test -n "$MAKE_UPPER_TAGS"; then
2585   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2586 else
2587   ac_save_IFS=$IFS; IFS=$ac_path_separator
2588 ac_dummy="$PATH"
2589 for ac_dir in $ac_dummy; do
2590   IFS=$ac_save_IFS
2591   test -z "$ac_dir" && ac_dir=.
2592   $as_executable_p "$ac_dir/$ac_word" || continue
2593 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2594 echo "$as_me:2594: found $ac_dir/$ac_word" >&5
2595 break
2596 done
2597
2598   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2599 fi
2600 fi
2601 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2602 if test -n "$MAKE_UPPER_TAGS"; then
2603   echo "$as_me:2603: result: $MAKE_UPPER_TAGS" >&5
2604 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2605 else
2606   echo "$as_me:2606: result: no" >&5
2607 echo "${ECHO_T}no" >&6
2608 fi
2609
2610 else
2611         MAKE_UPPER_TAGS=no
2612 fi
2613
2614 if test "$MAKE_UPPER_TAGS" = yes ; then
2615         MAKE_UPPER_TAGS=
2616 else
2617         MAKE_UPPER_TAGS="#"
2618 fi
2619
2620 if test "$MAKE_LOWER_TAGS" = yes ; then
2621         MAKE_LOWER_TAGS=
2622 else
2623         MAKE_LOWER_TAGS="#"
2624 fi
2625
2626 echo "$as_me:2626: checking if -lm needed for math functions" >&5
2627 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2628 if test "${cf_cv_need_libm+set}" = set; then
2629   echo $ECHO_N "(cached) $ECHO_C" >&6
2630 else
2631
2632         cat >conftest.$ac_ext <<_ACEOF
2633 #line 2633 "configure"
2634 #include "confdefs.h"
2635
2636         #include <stdio.h>
2637         #include <stdlib.h>
2638         #include <math.h>
2639
2640 int
2641 main (void)
2642 {
2643 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2644   ;
2645   return 0;
2646 }
2647 _ACEOF
2648 rm -f conftest.$ac_objext conftest$ac_exeext
2649 if { (eval echo "$as_me:2649: \"$ac_link\"") >&5
2650   (eval $ac_link) 2>&5
2651   ac_status=$?
2652   echo "$as_me:2652: \$? = $ac_status" >&5
2653   (exit $ac_status); } &&
2654          { ac_try='test -s conftest$ac_exeext'
2655   { (eval echo "$as_me:2655: \"$ac_try\"") >&5
2656   (eval $ac_try) 2>&5
2657   ac_status=$?
2658   echo "$as_me:2658: \$? = $ac_status" >&5
2659   (exit $ac_status); }; }; then
2660   cf_cv_need_libm=no
2661 else
2662   echo "$as_me: failed program was:" >&5
2663 cat conftest.$ac_ext >&5
2664 cf_cv_need_libm=yes
2665 fi
2666 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2667 fi
2668 echo "$as_me:2668: result: $cf_cv_need_libm" >&5
2669 echo "${ECHO_T}$cf_cv_need_libm" >&6
2670 if test "$cf_cv_need_libm" = yes
2671 then
2672 MATH_LIB=-lm
2673 fi
2674
2675 top_builddir=`pwd`
2676
2677 CC_G_OPT="-g"
2678 CC_SHARED_OPTS=unknown
2679 CPPFLAGS="$CPPFLAGS"
2680 DFT_DEP_SUFFIX=""
2681 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2682 DFT_UPR_MODEL="NORMAL"
2683 LD="ld"
2684 LDFLAGS_SHARED=""
2685 LDFLAGS_STATIC=""
2686 LD_MODEL=""
2687 LD_SHARED_OPTS=""
2688 LIBTOOL=""
2689 LIBTOOL_OPTS=""
2690 LIB_CLEAN=""
2691 LIB_COMPILE=""
2692 LIB_LINK='${CC}'
2693 LINK_TESTS=""
2694 LOCAL_LDFLAGS=""
2695 PACKAGE="ncurses-examples"
2696 PTHREAD="-lm"
2697 TEST_ARGS=""
2698 TEST_DEPS=""
2699 TEST_LIBS=""
2700 TINFO_LDFLAGS=''
2701 TINFO_LIBS='$(LIBS_CURSES)'
2702 cf_cv_abi_version=""
2703 cf_cv_rel_version=""
2704 includesubdir=""
2705
2706 cf_cv_screen=curses
2707 cf_cv_libtype=
2708
2709 if test "$GCC" = yes
2710 then
2711 cat > conftest.i <<EOF
2712 #ifndef GCC_PRINTF
2713 #define GCC_PRINTF 0
2714 #endif
2715 #ifndef GCC_SCANF
2716 #define GCC_SCANF 0
2717 #endif
2718 #ifndef GCC_NORETURN
2719 #define GCC_NORETURN /* nothing */
2720 #endif
2721 #ifndef GCC_UNUSED
2722 #define GCC_UNUSED /* nothing */
2723 #endif
2724 EOF
2725 if test "$GCC" = yes
2726 then
2727         { echo "$as_me:2727: checking for $CC __attribute__ directives..." >&5
2728 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2729 cat > conftest.$ac_ext <<EOF
2730 #line 2730 "${as_me:-configure}"
2731 #include "confdefs.h"
2732 #include "conftest.h"
2733 #include "conftest.i"
2734 #if     GCC_PRINTF
2735 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2736 #else
2737 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2738 #endif
2739 #if     GCC_SCANF
2740 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2741 #else
2742 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2743 #endif
2744 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2745 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2746 extern void foo(void) GCC_NORETURN;
2747 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2748 EOF
2749         cf_printf_attribute=no
2750         cf_scanf_attribute=no
2751         for cf_attribute in scanf printf unused noreturn
2752         do
2753
2754 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2755
2756                 cf_directive="__attribute__(($cf_attribute))"
2757                 echo "checking for $CC $cf_directive" 1>&5
2758
2759                 case $cf_attribute in
2760                 (printf)
2761                         cf_printf_attribute=yes
2762                         cat >conftest.h <<EOF
2763 #define GCC_$cf_ATTRIBUTE 1
2764 EOF
2765                         ;;
2766                 (scanf)
2767                         cf_scanf_attribute=yes
2768                         cat >conftest.h <<EOF
2769 #define GCC_$cf_ATTRIBUTE 1
2770 EOF
2771                         ;;
2772                 (*)
2773                         cat >conftest.h <<EOF
2774 #define GCC_$cf_ATTRIBUTE $cf_directive
2775 EOF
2776                         ;;
2777                 esac
2778
2779                 if { (eval echo "$as_me:2779: \"$ac_compile\"") >&5
2780   (eval $ac_compile) 2>&5
2781   ac_status=$?
2782   echo "$as_me:2782: \$? = $ac_status" >&5
2783   (exit $ac_status); }; then
2784                         test -n "$verbose" && echo "$as_me:2784: result: ... $cf_attribute" >&5
2785 echo "${ECHO_T}... $cf_attribute" >&6
2786                         cat conftest.h >>confdefs.h
2787                         case $cf_attribute in
2788                         (noreturn)
2789
2790 cat >>confdefs.h <<EOF
2791 #define GCC_NORETURN $cf_directive
2792 EOF
2793
2794                                 ;;
2795                         (printf)
2796                                 cf_value='/* nothing */'
2797                                 if test "$cf_printf_attribute" != no ; then
2798                                         cf_value='__attribute__((format(printf,fmt,var)))'
2799
2800 cat >>confdefs.h <<\EOF
2801 #define GCC_PRINTF 1
2802 EOF
2803
2804                                 fi
2805
2806 cat >>confdefs.h <<EOF
2807 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2808 EOF
2809
2810                                 ;;
2811                         (scanf)
2812                                 cf_value='/* nothing */'
2813                                 if test "$cf_scanf_attribute" != no ; then
2814                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2815
2816 cat >>confdefs.h <<\EOF
2817 #define GCC_SCANF 1
2818 EOF
2819
2820                                 fi
2821
2822 cat >>confdefs.h <<EOF
2823 #define GCC_SCANFLIKE(fmt,var) $cf_value
2824 EOF
2825
2826                                 ;;
2827                         (unused)
2828
2829 cat >>confdefs.h <<EOF
2830 #define GCC_UNUSED $cf_directive
2831 EOF
2832
2833                                 ;;
2834                         esac
2835                 fi
2836         done
2837 else
2838         fgrep define conftest.i >>confdefs.h
2839 fi
2840 rm -rf conftest*
2841 fi
2842
2843 echo "$as_me:2843: checking if you want to work around bogus compiler/loader warnings" >&5
2844 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
2845
2846 # Check whether --enable-string-hacks or --disable-string-hacks was given.
2847 if test "${enable_string_hacks+set}" = set; then
2848   enableval="$enable_string_hacks"
2849   with_string_hacks=$enableval
2850 else
2851   with_string_hacks=no
2852 fi;
2853 echo "$as_me:2853: result: $with_string_hacks" >&5
2854 echo "${ECHO_T}$with_string_hacks" >&6
2855
2856 if test "x$with_string_hacks" = "xyes"; then
2857
2858 cat >>confdefs.h <<\EOF
2859 #define USE_STRING_HACKS 1
2860 EOF
2861
2862         { echo "$as_me:2862: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
2863 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
2864         echo "$as_me:2864: checking for strlcat" >&5
2865 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
2866 if test "${ac_cv_func_strlcat+set}" = set; then
2867   echo $ECHO_N "(cached) $ECHO_C" >&6
2868 else
2869   cat >conftest.$ac_ext <<_ACEOF
2870 #line 2870 "configure"
2871 #include "confdefs.h"
2872 /* System header to define __stub macros and hopefully few prototypes,
2873     which can conflict with char strlcat (); below.  */
2874 #include <assert.h>
2875 /* Override any gcc2 internal prototype to avoid an error.  */
2876 #ifdef __cplusplus
2877 extern "C"
2878 #endif
2879 /* We use char because int might match the return type of a gcc2
2880    builtin and then its argument prototype would still apply.  */
2881 char strlcat ();
2882 char (*f) ();
2883
2884 int
2885 main (void)
2886 {
2887 /* The GNU C library defines this for functions which it implements
2888     to always fail with ENOSYS.  Some functions are actually named
2889     something starting with __ and the normal name is an alias.  */
2890 #if defined (__stub_strlcat) || defined (__stub___strlcat)
2891 choke me
2892 #else
2893 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
2894 #endif
2895
2896   ;
2897   return 0;
2898 }
2899 _ACEOF
2900 rm -f conftest.$ac_objext conftest$ac_exeext
2901 if { (eval echo "$as_me:2901: \"$ac_link\"") >&5
2902   (eval $ac_link) 2>&5
2903   ac_status=$?
2904   echo "$as_me:2904: \$? = $ac_status" >&5
2905   (exit $ac_status); } &&
2906          { ac_try='test -s conftest$ac_exeext'
2907   { (eval echo "$as_me:2907: \"$ac_try\"") >&5
2908   (eval $ac_try) 2>&5
2909   ac_status=$?
2910   echo "$as_me:2910: \$? = $ac_status" >&5
2911   (exit $ac_status); }; }; then
2912   ac_cv_func_strlcat=yes
2913 else
2914   echo "$as_me: failed program was:" >&5
2915 cat conftest.$ac_ext >&5
2916 ac_cv_func_strlcat=no
2917 fi
2918 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2919 fi
2920 echo "$as_me:2920: result: $ac_cv_func_strlcat" >&5
2921 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
2922 if test $ac_cv_func_strlcat = yes; then
2923
2924 cat >>confdefs.h <<\EOF
2925 #define HAVE_STRLCAT 1
2926 EOF
2927
2928 else
2929
2930                 echo "$as_me:2930: checking for strlcat in -lbsd" >&5
2931 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
2932 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
2933   echo $ECHO_N "(cached) $ECHO_C" >&6
2934 else
2935   ac_check_lib_save_LIBS=$LIBS
2936 LIBS="-lbsd  $LIBS"
2937 cat >conftest.$ac_ext <<_ACEOF
2938 #line 2938 "configure"
2939 #include "confdefs.h"
2940
2941 /* Override any gcc2 internal prototype to avoid an error.  */
2942 #ifdef __cplusplus
2943 extern "C"
2944 #endif
2945 /* We use char because int might match the return type of a gcc2
2946    builtin and then its argument prototype would still apply.  */
2947 char strlcat ();
2948 int
2949 main (void)
2950 {
2951 strlcat ();
2952   ;
2953   return 0;
2954 }
2955 _ACEOF
2956 rm -f conftest.$ac_objext conftest$ac_exeext
2957 if { (eval echo "$as_me:2957: \"$ac_link\"") >&5
2958   (eval $ac_link) 2>&5
2959   ac_status=$?
2960   echo "$as_me:2960: \$? = $ac_status" >&5
2961   (exit $ac_status); } &&
2962          { ac_try='test -s conftest$ac_exeext'
2963   { (eval echo "$as_me:2963: \"$ac_try\"") >&5
2964   (eval $ac_try) 2>&5
2965   ac_status=$?
2966   echo "$as_me:2966: \$? = $ac_status" >&5
2967   (exit $ac_status); }; }; then
2968   ac_cv_lib_bsd_strlcat=yes
2969 else
2970   echo "$as_me: failed program was:" >&5
2971 cat conftest.$ac_ext >&5
2972 ac_cv_lib_bsd_strlcat=no
2973 fi
2974 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2975 LIBS=$ac_check_lib_save_LIBS
2976 fi
2977 echo "$as_me:2977: result: $ac_cv_lib_bsd_strlcat" >&5
2978 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
2979 if test $ac_cv_lib_bsd_strlcat = yes; then
2980
2981 cf_add_libs="-lbsd"
2982 # Filter out duplicates - this happens with badly-designed ".pc" files...
2983 for cf_add_1lib in $LIBS
2984 do
2985         for cf_add_2lib in $cf_add_libs
2986         do
2987                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
2988                 then
2989                         cf_add_1lib=
2990                         break
2991                 fi
2992         done
2993         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
2994 done
2995 LIBS="$cf_add_libs"
2996
2997 for ac_header in bsd/string.h
2998 do
2999 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3000 echo "$as_me:3000: checking for $ac_header" >&5
3001 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3002 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3003   echo $ECHO_N "(cached) $ECHO_C" >&6
3004 else
3005   cat >conftest.$ac_ext <<_ACEOF
3006 #line 3006 "configure"
3007 #include "confdefs.h"
3008 #include <$ac_header>
3009 _ACEOF
3010 if { (eval echo "$as_me:3010: \"$ac_cpp conftest.$ac_ext\"") >&5
3011   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3012   ac_status=$?
3013   egrep -v '^ *\+' conftest.er1 >conftest.err
3014   rm -f conftest.er1
3015   cat conftest.err >&5
3016   echo "$as_me:3016: \$? = $ac_status" >&5
3017   (exit $ac_status); } >/dev/null; then
3018   if test -s conftest.err; then
3019     ac_cpp_err=$ac_c_preproc_warn_flag
3020   else
3021     ac_cpp_err=
3022   fi
3023 else
3024   ac_cpp_err=yes
3025 fi
3026 if test -z "$ac_cpp_err"; then
3027   eval "$as_ac_Header=yes"
3028 else
3029   echo "$as_me: failed program was:" >&5
3030   cat conftest.$ac_ext >&5
3031   eval "$as_ac_Header=no"
3032 fi
3033 rm -f conftest.err conftest.$ac_ext
3034 fi
3035 echo "$as_me:3035: result: `eval echo '${'$as_ac_Header'}'`" >&5
3036 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3037 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3038   cat >>confdefs.h <<EOF
3039 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3040 EOF
3041
3042 fi
3043 done
3044
3045 cat >>confdefs.h <<\EOF
3046 #define HAVE_STRLCAT 1
3047 EOF
3048
3049 fi
3050
3051 fi
3052
3053 for ac_func in strlcpy snprintf
3054 do
3055 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3056 echo "$as_me:3056: checking for $ac_func" >&5
3057 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3058 if eval "test \"\${$as_ac_var+set}\" = set"; then
3059   echo $ECHO_N "(cached) $ECHO_C" >&6
3060 else
3061   cat >conftest.$ac_ext <<_ACEOF
3062 #line 3062 "configure"
3063 #include "confdefs.h"
3064 /* System header to define __stub macros and hopefully few prototypes,
3065     which can conflict with char $ac_func (); below.  */
3066 #include <assert.h>
3067 /* Override any gcc2 internal prototype to avoid an error.  */
3068 #ifdef __cplusplus
3069 extern "C"
3070 #endif
3071 /* We use char because int might match the return type of a gcc2
3072    builtin and then its argument prototype would still apply.  */
3073 char $ac_func ();
3074 char (*f) ();
3075
3076 int
3077 main (void)
3078 {
3079 /* The GNU C library defines this for functions which it implements
3080     to always fail with ENOSYS.  Some functions are actually named
3081     something starting with __ and the normal name is an alias.  */
3082 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3083 choke me
3084 #else
3085 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3086 #endif
3087
3088   ;
3089   return 0;
3090 }
3091 _ACEOF
3092 rm -f conftest.$ac_objext conftest$ac_exeext
3093 if { (eval echo "$as_me:3093: \"$ac_link\"") >&5
3094   (eval $ac_link) 2>&5
3095   ac_status=$?
3096   echo "$as_me:3096: \$? = $ac_status" >&5
3097   (exit $ac_status); } &&
3098          { ac_try='test -s conftest$ac_exeext'
3099   { (eval echo "$as_me:3099: \"$ac_try\"") >&5
3100   (eval $ac_try) 2>&5
3101   ac_status=$?
3102   echo "$as_me:3102: \$? = $ac_status" >&5
3103   (exit $ac_status); }; }; then
3104   eval "$as_ac_var=yes"
3105 else
3106   echo "$as_me: failed program was:" >&5
3107 cat conftest.$ac_ext >&5
3108 eval "$as_ac_var=no"
3109 fi
3110 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3111 fi
3112 echo "$as_me:3112: result: `eval echo '${'$as_ac_var'}'`" >&5
3113 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3114 if test `eval echo '${'$as_ac_var'}'` = yes; then
3115   cat >>confdefs.h <<EOF
3116 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3117 EOF
3118
3119 fi
3120 done
3121
3122 fi
3123
3124 cf_XOPEN_SOURCE=500
3125 cf_POSIX_C_SOURCE=199506L
3126 cf_xopen_source=
3127
3128 case $host_os in
3129 (aix[4-7]*)
3130         cf_xopen_source="-D_ALL_SOURCE"
3131         ;;
3132 (msys)
3133         cf_XOPEN_SOURCE=600
3134         ;;
3135 (darwin[0-8].*)
3136         cf_xopen_source="-D_APPLE_C_SOURCE"
3137         ;;
3138 (darwin*)
3139         cf_xopen_source="-D_DARWIN_C_SOURCE"
3140         cf_XOPEN_SOURCE=
3141         ;;
3142 (freebsd*|dragonfly*)
3143         # 5.x headers associate
3144         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3145         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3146         cf_POSIX_C_SOURCE=200112L
3147         cf_XOPEN_SOURCE=600
3148         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3149         ;;
3150 (hpux11*)
3151         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3152         ;;
3153 (hpux*)
3154         cf_xopen_source="-D_HPUX_SOURCE"
3155         ;;
3156 (irix[56].*)
3157         cf_xopen_source="-D_SGI_SOURCE"
3158         cf_XOPEN_SOURCE=
3159         ;;
3160 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3161
3162 echo "$as_me:3162: checking if we must define _GNU_SOURCE" >&5
3163 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3164 if test "${cf_cv_gnu_source+set}" = set; then
3165   echo $ECHO_N "(cached) $ECHO_C" >&6
3166 else
3167
3168 cat >conftest.$ac_ext <<_ACEOF
3169 #line 3169 "configure"
3170 #include "confdefs.h"
3171 #include <sys/types.h>
3172 int
3173 main (void)
3174 {
3175
3176 #ifndef _XOPEN_SOURCE
3177 make an error
3178 #endif
3179   ;
3180   return 0;
3181 }
3182 _ACEOF
3183 rm -f conftest.$ac_objext
3184 if { (eval echo "$as_me:3184: \"$ac_compile\"") >&5
3185   (eval $ac_compile) 2>&5
3186   ac_status=$?
3187   echo "$as_me:3187: \$? = $ac_status" >&5
3188   (exit $ac_status); } &&
3189          { ac_try='test -s conftest.$ac_objext'
3190   { (eval echo "$as_me:3190: \"$ac_try\"") >&5
3191   (eval $ac_try) 2>&5
3192   ac_status=$?
3193   echo "$as_me:3193: \$? = $ac_status" >&5
3194   (exit $ac_status); }; }; then
3195   cf_cv_gnu_source=no
3196 else
3197   echo "$as_me: failed program was:" >&5
3198 cat conftest.$ac_ext >&5
3199 cf_save="$CPPFLAGS"
3200          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3201          cat >conftest.$ac_ext <<_ACEOF
3202 #line 3202 "configure"
3203 #include "confdefs.h"
3204 #include <sys/types.h>
3205 int
3206 main (void)
3207 {
3208
3209 #ifdef _XOPEN_SOURCE
3210 make an error
3211 #endif
3212   ;
3213   return 0;
3214 }
3215 _ACEOF
3216 rm -f conftest.$ac_objext
3217 if { (eval echo "$as_me:3217: \"$ac_compile\"") >&5
3218   (eval $ac_compile) 2>&5
3219   ac_status=$?
3220   echo "$as_me:3220: \$? = $ac_status" >&5
3221   (exit $ac_status); } &&
3222          { ac_try='test -s conftest.$ac_objext'
3223   { (eval echo "$as_me:3223: \"$ac_try\"") >&5
3224   (eval $ac_try) 2>&5
3225   ac_status=$?
3226   echo "$as_me:3226: \$? = $ac_status" >&5
3227   (exit $ac_status); }; }; then
3228   cf_cv_gnu_source=no
3229 else
3230   echo "$as_me: failed program was:" >&5
3231 cat conftest.$ac_ext >&5
3232 cf_cv_gnu_source=yes
3233 fi
3234 rm -f conftest.$ac_objext conftest.$ac_ext
3235         CPPFLAGS="$cf_save"
3236
3237 fi
3238 rm -f conftest.$ac_objext conftest.$ac_ext
3239
3240 fi
3241 echo "$as_me:3241: result: $cf_cv_gnu_source" >&5
3242 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3243
3244 if test "$cf_cv_gnu_source" = yes
3245 then
3246 echo "$as_me:3246: checking if we should also define _DEFAULT_SOURCE" >&5
3247 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3248 if test "${cf_cv_default_source+set}" = set; then
3249   echo $ECHO_N "(cached) $ECHO_C" >&6
3250 else
3251
3252 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3253         cat >conftest.$ac_ext <<_ACEOF
3254 #line 3254 "configure"
3255 #include "confdefs.h"
3256 #include <sys/types.h>
3257 int
3258 main (void)
3259 {
3260
3261 #ifdef _DEFAULT_SOURCE
3262 make an error
3263 #endif
3264   ;
3265   return 0;
3266 }
3267 _ACEOF
3268 rm -f conftest.$ac_objext
3269 if { (eval echo "$as_me:3269: \"$ac_compile\"") >&5
3270   (eval $ac_compile) 2>&5
3271   ac_status=$?
3272   echo "$as_me:3272: \$? = $ac_status" >&5
3273   (exit $ac_status); } &&
3274          { ac_try='test -s conftest.$ac_objext'
3275   { (eval echo "$as_me:3275: \"$ac_try\"") >&5
3276   (eval $ac_try) 2>&5
3277   ac_status=$?
3278   echo "$as_me:3278: \$? = $ac_status" >&5
3279   (exit $ac_status); }; }; then
3280   cf_cv_default_source=no
3281 else
3282   echo "$as_me: failed program was:" >&5
3283 cat conftest.$ac_ext >&5
3284 cf_cv_default_source=yes
3285 fi
3286 rm -f conftest.$ac_objext conftest.$ac_ext
3287
3288 fi
3289 echo "$as_me:3289: result: $cf_cv_default_source" >&5
3290 echo "${ECHO_T}$cf_cv_default_source" >&6
3291 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3292 fi
3293
3294         ;;
3295 (minix*)
3296         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3297         ;;
3298 (mirbsd*)
3299         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3300         cf_XOPEN_SOURCE=
3301
3302 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3303
3304 cf_save_CFLAGS="$CFLAGS"
3305 cf_save_CPPFLAGS="$CPPFLAGS"
3306
3307 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3308         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3309                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3310
3311 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3312         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3313                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3314
3315 echo "$as_me:3315: checking if we should define _POSIX_C_SOURCE" >&5
3316 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3317 if test "${cf_cv_posix_c_source+set}" = set; then
3318   echo $ECHO_N "(cached) $ECHO_C" >&6
3319 else
3320
3321 echo "${as_me:-configure}:3321: testing if the symbol is already defined go no further ..." 1>&5
3322
3323         cat >conftest.$ac_ext <<_ACEOF
3324 #line 3324 "configure"
3325 #include "confdefs.h"
3326 #include <sys/types.h>
3327 int
3328 main (void)
3329 {
3330
3331 #ifndef _POSIX_C_SOURCE
3332 make an error
3333 #endif
3334   ;
3335   return 0;
3336 }
3337 _ACEOF
3338 rm -f conftest.$ac_objext
3339 if { (eval echo "$as_me:3339: \"$ac_compile\"") >&5
3340   (eval $ac_compile) 2>&5
3341   ac_status=$?
3342   echo "$as_me:3342: \$? = $ac_status" >&5
3343   (exit $ac_status); } &&
3344          { ac_try='test -s conftest.$ac_objext'
3345   { (eval echo "$as_me:3345: \"$ac_try\"") >&5
3346   (eval $ac_try) 2>&5
3347   ac_status=$?
3348   echo "$as_me:3348: \$? = $ac_status" >&5
3349   (exit $ac_status); }; }; then
3350   cf_cv_posix_c_source=no
3351 else
3352   echo "$as_me: failed program was:" >&5
3353 cat conftest.$ac_ext >&5
3354 cf_want_posix_source=no
3355          case .$cf_POSIX_C_SOURCE in
3356          (.[12]??*)
3357                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3358                 ;;
3359          (.2)
3360                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3361                 cf_want_posix_source=yes
3362                 ;;
3363          (.*)
3364                 cf_want_posix_source=yes
3365                 ;;
3366          esac
3367          if test "$cf_want_posix_source" = yes ; then
3368                 cat >conftest.$ac_ext <<_ACEOF
3369 #line 3369 "configure"
3370 #include "confdefs.h"
3371 #include <sys/types.h>
3372 int
3373 main (void)
3374 {
3375
3376 #ifdef _POSIX_SOURCE
3377 make an error
3378 #endif
3379   ;
3380   return 0;
3381 }
3382 _ACEOF
3383 rm -f conftest.$ac_objext
3384 if { (eval echo "$as_me:3384: \"$ac_compile\"") >&5
3385   (eval $ac_compile) 2>&5
3386   ac_status=$?
3387   echo "$as_me:3387: \$? = $ac_status" >&5
3388   (exit $ac_status); } &&
3389          { ac_try='test -s conftest.$ac_objext'
3390   { (eval echo "$as_me:3390: \"$ac_try\"") >&5
3391   (eval $ac_try) 2>&5
3392   ac_status=$?
3393   echo "$as_me:3393: \$? = $ac_status" >&5
3394   (exit $ac_status); }; }; then
3395   :
3396 else
3397   echo "$as_me: failed program was:" >&5
3398 cat conftest.$ac_ext >&5
3399 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3400 fi
3401 rm -f conftest.$ac_objext conftest.$ac_ext
3402          fi
3403
3404 echo "${as_me:-configure}:3404: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3405
3406          CFLAGS="$cf_trim_CFLAGS"
3407          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3408
3409 echo "${as_me:-configure}:3409: testing if the second compile does not leave our definition intact error ..." 1>&5
3410
3411          cat >conftest.$ac_ext <<_ACEOF
3412 #line 3412 "configure"
3413 #include "confdefs.h"
3414 #include <sys/types.h>
3415 int
3416 main (void)
3417 {
3418
3419 #ifndef _POSIX_C_SOURCE
3420 make an error
3421 #endif
3422   ;
3423   return 0;
3424 }
3425 _ACEOF
3426 rm -f conftest.$ac_objext
3427 if { (eval echo "$as_me:3427: \"$ac_compile\"") >&5
3428   (eval $ac_compile) 2>&5
3429   ac_status=$?
3430   echo "$as_me:3430: \$? = $ac_status" >&5
3431   (exit $ac_status); } &&
3432          { ac_try='test -s conftest.$ac_objext'
3433   { (eval echo "$as_me:3433: \"$ac_try\"") >&5
3434   (eval $ac_try) 2>&5
3435   ac_status=$?
3436   echo "$as_me:3436: \$? = $ac_status" >&5
3437   (exit $ac_status); }; }; then
3438   :
3439 else
3440   echo "$as_me: failed program was:" >&5
3441 cat conftest.$ac_ext >&5
3442 cf_cv_posix_c_source=no
3443 fi
3444 rm -f conftest.$ac_objext conftest.$ac_ext
3445          CFLAGS="$cf_save_CFLAGS"
3446          CPPFLAGS="$cf_save_CPPFLAGS"
3447
3448 fi
3449 rm -f conftest.$ac_objext conftest.$ac_ext
3450
3451 fi
3452 echo "$as_me:3452: result: $cf_cv_posix_c_source" >&5
3453 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3454
3455 if test "$cf_cv_posix_c_source" != no ; then
3456         CFLAGS="$cf_trim_CFLAGS"
3457         CPPFLAGS="$cf_trim_CPPFLAGS"
3458
3459 cf_fix_cppflags=no
3460 cf_new_cflags=
3461 cf_new_cppflags=
3462 cf_new_extra_cppflags=
3463
3464 for cf_add_cflags in $cf_cv_posix_c_source
3465 do
3466 case $cf_fix_cppflags in
3467 (no)
3468         case $cf_add_cflags in
3469         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3470                 case $cf_add_cflags in
3471                 (-D*)
3472                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3473
3474                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3475                                 && test -z "${cf_tst_cflags}" \
3476                                 && cf_fix_cppflags=yes
3477
3478                         if test $cf_fix_cppflags = yes ; then
3479
3480         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3481         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3482
3483                                 continue
3484                         elif test "${cf_tst_cflags}" = "\"'" ; then
3485
3486         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3487         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3488
3489                                 continue
3490                         fi
3491                         ;;
3492                 esac
3493                 case "$CPPFLAGS" in
3494                 (*$cf_add_cflags)
3495                         ;;
3496                 (*)
3497                         case $cf_add_cflags in
3498                         (-D*)
3499                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3500
3501 CPPFLAGS=`echo "$CPPFLAGS" | \
3502         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3503                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3504
3505                                 ;;
3506                         esac
3507
3508         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3509         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3510
3511                         ;;
3512                 esac
3513                 ;;
3514         (*)
3515
3516         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3517         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3518
3519                 ;;
3520         esac
3521         ;;
3522 (yes)
3523
3524         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3525         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3526
3527         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3528
3529         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3530                 && test -z "${cf_tst_cflags}" \
3531                 && cf_fix_cppflags=no
3532         ;;
3533 esac
3534 done
3535
3536 if test -n "$cf_new_cflags" ; then
3537
3538         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3539         CFLAGS="${CFLAGS}$cf_new_cflags"
3540
3541 fi
3542
3543 if test -n "$cf_new_cppflags" ; then
3544
3545         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3546         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3547
3548 fi
3549
3550 if test -n "$cf_new_extra_cppflags" ; then
3551
3552         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3553         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3554
3555 fi
3556
3557 fi
3558
3559         ;;
3560 (netbsd*)
3561         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3562         ;;
3563 (openbsd[4-9]*)
3564         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3565         cf_xopen_source="-D_BSD_SOURCE"
3566         cf_XOPEN_SOURCE=600
3567         ;;
3568 (openbsd*)
3569         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3570         ;;
3571 (osf[45]*)
3572         cf_xopen_source="-D_OSF_SOURCE"
3573         ;;
3574 (nto-qnx*)
3575         cf_xopen_source="-D_QNX_SOURCE"
3576         ;;
3577 (sco*)
3578         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3579         ;;
3580 (solaris2.*)
3581         cf_xopen_source="-D__EXTENSIONS__"
3582         cf_cv_xopen_source=broken
3583         ;;
3584 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3585         cf_XOPEN_SOURCE=
3586         cf_POSIX_C_SOURCE=
3587         ;;
3588 (*)
3589
3590 echo "$as_me:3590: checking if we should define _XOPEN_SOURCE" >&5
3591 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3592 if test "${cf_cv_xopen_source+set}" = set; then
3593   echo $ECHO_N "(cached) $ECHO_C" >&6
3594 else
3595
3596         cat >conftest.$ac_ext <<_ACEOF
3597 #line 3597 "configure"
3598 #include "confdefs.h"
3599
3600 #include <stdlib.h>
3601 #include <string.h>
3602 #include <sys/types.h>
3603
3604 int
3605 main (void)
3606 {
3607
3608 #ifndef _XOPEN_SOURCE
3609 make an error
3610 #endif
3611   ;
3612   return 0;
3613 }
3614 _ACEOF
3615 rm -f conftest.$ac_objext
3616 if { (eval echo "$as_me:3616: \"$ac_compile\"") >&5
3617   (eval $ac_compile) 2>&5
3618   ac_status=$?
3619   echo "$as_me:3619: \$? = $ac_status" >&5
3620   (exit $ac_status); } &&
3621          { ac_try='test -s conftest.$ac_objext'
3622   { (eval echo "$as_me:3622: \"$ac_try\"") >&5
3623   (eval $ac_try) 2>&5
3624   ac_status=$?
3625   echo "$as_me:3625: \$? = $ac_status" >&5
3626   (exit $ac_status); }; }; then
3627   cf_cv_xopen_source=no
3628 else
3629   echo "$as_me: failed program was:" >&5
3630 cat conftest.$ac_ext >&5
3631 cf_save="$CPPFLAGS"
3632          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3633          cat >conftest.$ac_ext <<_ACEOF
3634 #line 3634 "configure"
3635 #include "confdefs.h"
3636
3637 #include <stdlib.h>
3638 #include <string.h>
3639 #include <sys/types.h>
3640
3641 int
3642 main (void)
3643 {
3644
3645 #ifdef _XOPEN_SOURCE
3646 make an error
3647 #endif
3648   ;
3649   return 0;
3650 }
3651 _ACEOF
3652 rm -f conftest.$ac_objext
3653 if { (eval echo "$as_me:3653: \"$ac_compile\"") >&5
3654   (eval $ac_compile) 2>&5
3655   ac_status=$?
3656   echo "$as_me:3656: \$? = $ac_status" >&5
3657   (exit $ac_status); } &&
3658          { ac_try='test -s conftest.$ac_objext'
3659   { (eval echo "$as_me:3659: \"$ac_try\"") >&5
3660   (eval $ac_try) 2>&5
3661   ac_status=$?
3662   echo "$as_me:3662: \$? = $ac_status" >&5
3663   (exit $ac_status); }; }; then
3664   cf_cv_xopen_source=no
3665 else
3666   echo "$as_me: failed program was:" >&5
3667 cat conftest.$ac_ext >&5
3668 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3669 fi
3670 rm -f conftest.$ac_objext conftest.$ac_ext
3671         CPPFLAGS="$cf_save"
3672
3673 fi
3674 rm -f conftest.$ac_objext conftest.$ac_ext
3675
3676 fi
3677 echo "$as_me:3677: result: $cf_cv_xopen_source" >&5
3678 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3679
3680 if test "$cf_cv_xopen_source" != no ; then
3681
3682 CFLAGS=`echo "$CFLAGS" | \
3683         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3684                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3685
3686 CPPFLAGS=`echo "$CPPFLAGS" | \
3687         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3688                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3689
3690         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3691
3692 cf_fix_cppflags=no
3693 cf_new_cflags=
3694 cf_new_cppflags=
3695 cf_new_extra_cppflags=
3696
3697 for cf_add_cflags in $cf_temp_xopen_source
3698 do
3699 case $cf_fix_cppflags in
3700 (no)
3701         case $cf_add_cflags in
3702         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3703                 case $cf_add_cflags in
3704                 (-D*)
3705                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3706
3707                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3708                                 && test -z "${cf_tst_cflags}" \
3709                                 && cf_fix_cppflags=yes
3710
3711                         if test $cf_fix_cppflags = yes ; then
3712
3713         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3714         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3715
3716                                 continue
3717                         elif test "${cf_tst_cflags}" = "\"'" ; then
3718
3719         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3720         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3721
3722                                 continue
3723                         fi
3724                         ;;
3725                 esac
3726                 case "$CPPFLAGS" in
3727                 (*$cf_add_cflags)
3728                         ;;
3729                 (*)
3730                         case $cf_add_cflags in
3731                         (-D*)
3732                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3733
3734 CPPFLAGS=`echo "$CPPFLAGS" | \
3735         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3736                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3737
3738                                 ;;
3739                         esac
3740
3741         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3742         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3743
3744                         ;;
3745                 esac
3746                 ;;
3747         (*)
3748
3749         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3750         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3751
3752                 ;;
3753         esac
3754         ;;
3755 (yes)
3756
3757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3759
3760         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3761
3762         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3763                 && test -z "${cf_tst_cflags}" \
3764                 && cf_fix_cppflags=no
3765         ;;
3766 esac
3767 done
3768
3769 if test -n "$cf_new_cflags" ; then
3770
3771         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3772         CFLAGS="${CFLAGS}$cf_new_cflags"
3773
3774 fi
3775
3776 if test -n "$cf_new_cppflags" ; then
3777
3778         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3779         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3780
3781 fi
3782
3783 if test -n "$cf_new_extra_cppflags" ; then
3784
3785         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3786         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3787
3788 fi
3789
3790 fi
3791
3792 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3793
3794 cf_save_CFLAGS="$CFLAGS"
3795 cf_save_CPPFLAGS="$CPPFLAGS"
3796
3797 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3798         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3799                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3800
3801 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3802         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3803                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3804
3805 echo "$as_me:3805: checking if we should define _POSIX_C_SOURCE" >&5
3806 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3807 if test "${cf_cv_posix_c_source+set}" = set; then
3808   echo $ECHO_N "(cached) $ECHO_C" >&6
3809 else
3810
3811 echo "${as_me:-configure}:3811: testing if the symbol is already defined go no further ..." 1>&5
3812
3813         cat >conftest.$ac_ext <<_ACEOF
3814 #line 3814 "configure"
3815 #include "confdefs.h"
3816 #include <sys/types.h>
3817 int
3818 main (void)
3819 {
3820
3821 #ifndef _POSIX_C_SOURCE
3822 make an error
3823 #endif
3824   ;
3825   return 0;
3826 }
3827 _ACEOF
3828 rm -f conftest.$ac_objext
3829 if { (eval echo "$as_me:3829: \"$ac_compile\"") >&5
3830   (eval $ac_compile) 2>&5
3831   ac_status=$?
3832   echo "$as_me:3832: \$? = $ac_status" >&5
3833   (exit $ac_status); } &&
3834          { ac_try='test -s conftest.$ac_objext'
3835   { (eval echo "$as_me:3835: \"$ac_try\"") >&5
3836   (eval $ac_try) 2>&5
3837   ac_status=$?
3838   echo "$as_me:3838: \$? = $ac_status" >&5
3839   (exit $ac_status); }; }; then
3840   cf_cv_posix_c_source=no
3841 else
3842   echo "$as_me: failed program was:" >&5
3843 cat conftest.$ac_ext >&5
3844 cf_want_posix_source=no
3845          case .$cf_POSIX_C_SOURCE in
3846          (.[12]??*)
3847                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3848                 ;;
3849          (.2)
3850                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3851                 cf_want_posix_source=yes
3852                 ;;
3853          (.*)
3854                 cf_want_posix_source=yes
3855                 ;;
3856          esac
3857          if test "$cf_want_posix_source" = yes ; then
3858                 cat >conftest.$ac_ext <<_ACEOF
3859 #line 3859 "configure"
3860 #include "confdefs.h"
3861 #include <sys/types.h>
3862 int
3863 main (void)
3864 {
3865
3866 #ifdef _POSIX_SOURCE
3867 make an error
3868 #endif
3869   ;
3870   return 0;
3871 }
3872 _ACEOF
3873 rm -f conftest.$ac_objext
3874 if { (eval echo "$as_me:3874: \"$ac_compile\"") >&5
3875   (eval $ac_compile) 2>&5
3876   ac_status=$?
3877   echo "$as_me:3877: \$? = $ac_status" >&5
3878   (exit $ac_status); } &&
3879          { ac_try='test -s conftest.$ac_objext'
3880   { (eval echo "$as_me:3880: \"$ac_try\"") >&5
3881   (eval $ac_try) 2>&5
3882   ac_status=$?
3883   echo "$as_me:3883: \$? = $ac_status" >&5
3884   (exit $ac_status); }; }; then
3885   :
3886 else
3887   echo "$as_me: failed program was:" >&5
3888 cat conftest.$ac_ext >&5
3889 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3890 fi
3891 rm -f conftest.$ac_objext conftest.$ac_ext
3892          fi
3893
3894 echo "${as_me:-configure}:3894: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3895
3896          CFLAGS="$cf_trim_CFLAGS"
3897          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3898
3899 echo "${as_me:-configure}:3899: testing if the second compile does not leave our definition intact error ..." 1>&5
3900
3901          cat >conftest.$ac_ext <<_ACEOF
3902 #line 3902 "configure"
3903 #include "confdefs.h"
3904 #include <sys/types.h>
3905 int
3906 main (void)
3907 {
3908
3909 #ifndef _POSIX_C_SOURCE
3910 make an error
3911 #endif
3912   ;
3913   return 0;
3914 }
3915 _ACEOF
3916 rm -f conftest.$ac_objext
3917 if { (eval echo "$as_me:3917: \"$ac_compile\"") >&5
3918   (eval $ac_compile) 2>&5
3919   ac_status=$?
3920   echo "$as_me:3920: \$? = $ac_status" >&5
3921   (exit $ac_status); } &&
3922          { ac_try='test -s conftest.$ac_objext'
3923   { (eval echo "$as_me:3923: \"$ac_try\"") >&5
3924   (eval $ac_try) 2>&5
3925   ac_status=$?
3926   echo "$as_me:3926: \$? = $ac_status" >&5
3927   (exit $ac_status); }; }; then
3928   :
3929 else
3930   echo "$as_me: failed program was:" >&5
3931 cat conftest.$ac_ext >&5
3932 cf_cv_posix_c_source=no
3933 fi
3934 rm -f conftest.$ac_objext conftest.$ac_ext
3935          CFLAGS="$cf_save_CFLAGS"
3936          CPPFLAGS="$cf_save_CPPFLAGS"
3937
3938 fi
3939 rm -f conftest.$ac_objext conftest.$ac_ext
3940
3941 fi
3942 echo "$as_me:3942: result: $cf_cv_posix_c_source" >&5
3943 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3944
3945 if test "$cf_cv_posix_c_source" != no ; then
3946         CFLAGS="$cf_trim_CFLAGS"
3947         CPPFLAGS="$cf_trim_CPPFLAGS"
3948
3949 cf_fix_cppflags=no
3950 cf_new_cflags=
3951 cf_new_cppflags=
3952 cf_new_extra_cppflags=
3953
3954 for cf_add_cflags in $cf_cv_posix_c_source
3955 do
3956 case $cf_fix_cppflags in
3957 (no)
3958         case $cf_add_cflags in
3959         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3960                 case $cf_add_cflags in
3961                 (-D*)
3962                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3963
3964                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3965                                 && test -z "${cf_tst_cflags}" \
3966                                 && cf_fix_cppflags=yes
3967
3968                         if test $cf_fix_cppflags = yes ; then
3969
3970         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3971         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3972
3973                                 continue
3974                         elif test "${cf_tst_cflags}" = "\"'" ; then
3975
3976         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3977         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3978
3979                                 continue
3980                         fi
3981                         ;;
3982                 esac
3983                 case "$CPPFLAGS" in
3984                 (*$cf_add_cflags)
3985                         ;;
3986                 (*)
3987                         case $cf_add_cflags in
3988                         (-D*)
3989                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3990
3991 CPPFLAGS=`echo "$CPPFLAGS" | \
3992         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3993                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3994
3995                                 ;;
3996                         esac
3997
3998         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3999         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4000
4001                         ;;
4002                 esac
4003                 ;;
4004         (*)
4005
4006         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4007         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4008
4009                 ;;
4010         esac
4011         ;;
4012 (yes)
4013
4014         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4015         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4016
4017         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4018
4019         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4020                 && test -z "${cf_tst_cflags}" \
4021                 && cf_fix_cppflags=no
4022         ;;
4023 esac
4024 done
4025
4026 if test -n "$cf_new_cflags" ; then
4027
4028         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4029         CFLAGS="${CFLAGS}$cf_new_cflags"
4030
4031 fi
4032
4033 if test -n "$cf_new_cppflags" ; then
4034
4035         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4036         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4037
4038 fi
4039
4040 if test -n "$cf_new_extra_cppflags" ; then
4041
4042         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4043         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4044
4045 fi
4046
4047 fi
4048
4049         ;;
4050 esac
4051
4052 if test -n "$cf_xopen_source" ; then
4053
4054 cf_fix_cppflags=no
4055 cf_new_cflags=
4056 cf_new_cppflags=
4057 cf_new_extra_cppflags=
4058
4059 for cf_add_cflags in $cf_xopen_source
4060 do
4061 case $cf_fix_cppflags in
4062 (no)
4063         case $cf_add_cflags in
4064         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4065                 case $cf_add_cflags in
4066                 (-D*)
4067                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4068
4069                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4070                                 && test -z "${cf_tst_cflags}" \
4071                                 && cf_fix_cppflags=yes
4072
4073                         if test $cf_fix_cppflags = yes ; then
4074
4075         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4076         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4077
4078                                 continue
4079                         elif test "${cf_tst_cflags}" = "\"'" ; then
4080
4081         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4082         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4083
4084                                 continue
4085                         fi
4086                         ;;
4087                 esac
4088                 case "$CPPFLAGS" in
4089                 (*$cf_add_cflags)
4090                         ;;
4091                 (*)
4092                         case $cf_add_cflags in
4093                         (-D*)
4094                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4095
4096 CPPFLAGS=`echo "$CPPFLAGS" | \
4097         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4098                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4099
4100                                 ;;
4101                         esac
4102
4103         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4104         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4105
4106                         ;;
4107                 esac
4108                 ;;
4109         (*)
4110
4111         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4112         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4113
4114                 ;;
4115         esac
4116         ;;
4117 (yes)
4118
4119         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4120         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4121
4122         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4123
4124         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4125                 && test -z "${cf_tst_cflags}" \
4126                 && cf_fix_cppflags=no
4127         ;;
4128 esac
4129 done
4130
4131 if test -n "$cf_new_cflags" ; then
4132         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4133
4134 echo "${as_me:-configure}:4134: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4135
4136         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4137         CFLAGS="${CFLAGS}$cf_new_cflags"
4138
4139 fi
4140
4141 if test -n "$cf_new_cppflags" ; then
4142         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4143
4144 echo "${as_me:-configure}:4144: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4145
4146         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4147         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4148
4149 fi
4150
4151 if test -n "$cf_new_extra_cppflags" ; then
4152         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4153
4154 echo "${as_me:-configure}:4154: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4155
4156         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4157         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4158
4159 fi
4160
4161 fi
4162
4163 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4164         echo "$as_me:4164: checking if _XOPEN_SOURCE really is set" >&5
4165 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4166         cat >conftest.$ac_ext <<_ACEOF
4167 #line 4167 "configure"
4168 #include "confdefs.h"
4169 #include <stdlib.h>
4170 int
4171 main (void)
4172 {
4173
4174 #ifndef _XOPEN_SOURCE
4175 make an error
4176 #endif
4177   ;
4178   return 0;
4179 }
4180 _ACEOF
4181 rm -f conftest.$ac_objext
4182 if { (eval echo "$as_me:4182: \"$ac_compile\"") >&5
4183   (eval $ac_compile) 2>&5
4184   ac_status=$?
4185   echo "$as_me:4185: \$? = $ac_status" >&5
4186   (exit $ac_status); } &&
4187          { ac_try='test -s conftest.$ac_objext'
4188   { (eval echo "$as_me:4188: \"$ac_try\"") >&5
4189   (eval $ac_try) 2>&5
4190   ac_status=$?
4191   echo "$as_me:4191: \$? = $ac_status" >&5
4192   (exit $ac_status); }; }; then
4193   cf_XOPEN_SOURCE_set=yes
4194 else
4195   echo "$as_me: failed program was:" >&5
4196 cat conftest.$ac_ext >&5
4197 cf_XOPEN_SOURCE_set=no
4198 fi
4199 rm -f conftest.$ac_objext conftest.$ac_ext
4200         echo "$as_me:4200: result: $cf_XOPEN_SOURCE_set" >&5
4201 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4202         if test $cf_XOPEN_SOURCE_set = yes
4203         then
4204                 cat >conftest.$ac_ext <<_ACEOF
4205 #line 4205 "configure"
4206 #include "confdefs.h"
4207 #include <stdlib.h>
4208 int
4209 main (void)
4210 {
4211
4212 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4213 make an error
4214 #endif
4215   ;
4216   return 0;
4217 }
4218 _ACEOF
4219 rm -f conftest.$ac_objext
4220 if { (eval echo "$as_me:4220: \"$ac_compile\"") >&5
4221   (eval $ac_compile) 2>&5
4222   ac_status=$?
4223   echo "$as_me:4223: \$? = $ac_status" >&5
4224   (exit $ac_status); } &&
4225          { ac_try='test -s conftest.$ac_objext'
4226   { (eval echo "$as_me:4226: \"$ac_try\"") >&5
4227   (eval $ac_try) 2>&5
4228   ac_status=$?
4229   echo "$as_me:4229: \$? = $ac_status" >&5
4230   (exit $ac_status); }; }; then
4231   cf_XOPEN_SOURCE_set_ok=yes
4232 else
4233   echo "$as_me: failed program was:" >&5
4234 cat conftest.$ac_ext >&5
4235 cf_XOPEN_SOURCE_set_ok=no
4236 fi
4237 rm -f conftest.$ac_objext conftest.$ac_ext
4238                 if test $cf_XOPEN_SOURCE_set_ok = no
4239                 then
4240                         { echo "$as_me:4240: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4241 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4242                 fi
4243         else
4244
4245 echo "$as_me:4245: checking if we should define _XOPEN_SOURCE" >&5
4246 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4247 if test "${cf_cv_xopen_source+set}" = set; then
4248   echo $ECHO_N "(cached) $ECHO_C" >&6
4249 else
4250
4251         cat >conftest.$ac_ext <<_ACEOF
4252 #line 4252 "configure"
4253 #include "confdefs.h"
4254
4255 #include <stdlib.h>
4256 #include <string.h>
4257 #include <sys/types.h>
4258
4259 int
4260 main (void)
4261 {
4262
4263 #ifndef _XOPEN_SOURCE
4264 make an error
4265 #endif
4266   ;
4267   return 0;
4268 }
4269 _ACEOF
4270 rm -f conftest.$ac_objext
4271 if { (eval echo "$as_me:4271: \"$ac_compile\"") >&5
4272   (eval $ac_compile) 2>&5
4273   ac_status=$?
4274   echo "$as_me:4274: \$? = $ac_status" >&5
4275   (exit $ac_status); } &&
4276          { ac_try='test -s conftest.$ac_objext'
4277   { (eval echo "$as_me:4277: \"$ac_try\"") >&5
4278   (eval $ac_try) 2>&5
4279   ac_status=$?
4280   echo "$as_me:4280: \$? = $ac_status" >&5
4281   (exit $ac_status); }; }; then
4282   cf_cv_xopen_source=no
4283 else
4284   echo "$as_me: failed program was:" >&5
4285 cat conftest.$ac_ext >&5
4286 cf_save="$CPPFLAGS"
4287          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4288          cat >conftest.$ac_ext <<_ACEOF
4289 #line 4289 "configure"
4290 #include "confdefs.h"
4291
4292 #include <stdlib.h>
4293 #include <string.h>
4294 #include <sys/types.h>
4295
4296 int
4297 main (void)
4298 {
4299
4300 #ifdef _XOPEN_SOURCE
4301 make an error
4302 #endif
4303   ;
4304   return 0;
4305 }
4306 _ACEOF
4307 rm -f conftest.$ac_objext
4308 if { (eval echo "$as_me:4308: \"$ac_compile\"") >&5
4309   (eval $ac_compile) 2>&5
4310   ac_status=$?
4311   echo "$as_me:4311: \$? = $ac_status" >&5
4312   (exit $ac_status); } &&
4313          { ac_try='test -s conftest.$ac_objext'
4314   { (eval echo "$as_me:4314: \"$ac_try\"") >&5
4315   (eval $ac_try) 2>&5
4316   ac_status=$?
4317   echo "$as_me:4317: \$? = $ac_status" >&5
4318   (exit $ac_status); }; }; then
4319   cf_cv_xopen_source=no
4320 else
4321   echo "$as_me: failed program was:" >&5
4322 cat conftest.$ac_ext >&5
4323 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4324 fi
4325 rm -f conftest.$ac_objext conftest.$ac_ext
4326         CPPFLAGS="$cf_save"
4327
4328 fi
4329 rm -f conftest.$ac_objext conftest.$ac_ext
4330
4331 fi
4332 echo "$as_me:4332: result: $cf_cv_xopen_source" >&5
4333 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4334
4335 if test "$cf_cv_xopen_source" != no ; then
4336
4337 CFLAGS=`echo "$CFLAGS" | \
4338         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4339                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4340
4341 CPPFLAGS=`echo "$CPPFLAGS" | \
4342         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4343                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4344
4345         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4346
4347 cf_fix_cppflags=no
4348 cf_new_cflags=
4349 cf_new_cppflags=
4350 cf_new_extra_cppflags=
4351
4352 for cf_add_cflags in $cf_temp_xopen_source
4353 do
4354 case $cf_fix_cppflags in
4355 (no)
4356         case $cf_add_cflags in
4357         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4358                 case $cf_add_cflags in
4359                 (-D*)
4360                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4361
4362                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4363                                 && test -z "${cf_tst_cflags}" \
4364                                 && cf_fix_cppflags=yes
4365
4366                         if test $cf_fix_cppflags = yes ; then
4367
4368         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4369         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4370
4371                                 continue
4372                         elif test "${cf_tst_cflags}" = "\"'" ; then
4373
4374         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4375         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4376
4377                                 continue
4378                         fi
4379                         ;;
4380                 esac
4381                 case "$CPPFLAGS" in
4382                 (*$cf_add_cflags)
4383                         ;;
4384                 (*)
4385                         case $cf_add_cflags in
4386                         (-D*)
4387                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4388
4389 CPPFLAGS=`echo "$CPPFLAGS" | \
4390         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4391                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4392
4393                                 ;;
4394                         esac
4395
4396         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4397         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4398
4399                         ;;
4400                 esac
4401                 ;;
4402         (*)
4403
4404         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4405         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4406
4407                 ;;
4408         esac
4409         ;;
4410 (yes)
4411
4412         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4413         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4414
4415         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4416
4417         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4418                 && test -z "${cf_tst_cflags}" \
4419                 && cf_fix_cppflags=no
4420         ;;
4421 esac
4422 done
4423
4424 if test -n "$cf_new_cflags" ; then
4425
4426         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4427         CFLAGS="${CFLAGS}$cf_new_cflags"
4428
4429 fi
4430
4431 if test -n "$cf_new_cppflags" ; then
4432
4433         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4434         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4435
4436 fi
4437
4438 if test -n "$cf_new_extra_cppflags" ; then
4439
4440         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4441         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4442
4443 fi
4444
4445 fi
4446
4447         fi
4448 fi
4449
4450 echo "$as_me:4450: checking for signal global datatype" >&5
4451 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4452 if test "${cf_cv_sig_atomic_t+set}" = set; then
4453   echo $ECHO_N "(cached) $ECHO_C" >&6
4454 else
4455
4456         for cf_type in \
4457                 "volatile sig_atomic_t" \
4458                 "sig_atomic_t" \
4459                 "int"
4460         do
4461         cat >conftest.$ac_ext <<_ACEOF
4462 #line 4462 "configure"
4463 #include "confdefs.h"
4464
4465 #include <sys/types.h>
4466 #include <signal.h>
4467 #include <stdio.h>
4468
4469 extern $cf_type x;
4470 $cf_type x;
4471 static void handler(int sig)
4472 {
4473         x = 5;
4474 }
4475 int
4476 main (void)
4477 {
4478 signal(SIGINT, handler);
4479                  x = 1
4480   ;
4481   return 0;
4482 }
4483 _ACEOF
4484 rm -f conftest.$ac_objext
4485 if { (eval echo "$as_me:4485: \"$ac_compile\"") >&5
4486   (eval $ac_compile) 2>&5
4487   ac_status=$?
4488   echo "$as_me:4488: \$? = $ac_status" >&5
4489   (exit $ac_status); } &&
4490          { ac_try='test -s conftest.$ac_objext'
4491   { (eval echo "$as_me:4491: \"$ac_try\"") >&5
4492   (eval $ac_try) 2>&5
4493   ac_status=$?
4494   echo "$as_me:4494: \$? = $ac_status" >&5
4495   (exit $ac_status); }; }; then
4496   cf_cv_sig_atomic_t=$cf_type
4497 else
4498   echo "$as_me: failed program was:" >&5
4499 cat conftest.$ac_ext >&5
4500 cf_cv_sig_atomic_t=no
4501 fi
4502 rm -f conftest.$ac_objext conftest.$ac_ext
4503                 test "$cf_cv_sig_atomic_t" != no && break
4504         done
4505
4506 fi
4507
4508 echo "$as_me:4508: result: $cf_cv_sig_atomic_t" >&5
4509 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4510 test "$cf_cv_sig_atomic_t" != no &&
4511 cat >>confdefs.h <<EOF
4512 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4513 EOF
4514
4515 # Work around breakage on OS X
4516
4517 echo "$as_me:4517: checking if SIGWINCH is defined" >&5
4518 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4519 if test "${cf_cv_define_sigwinch+set}" = set; then
4520   echo $ECHO_N "(cached) $ECHO_C" >&6
4521 else
4522
4523         cat >conftest.$ac_ext <<_ACEOF
4524 #line 4524 "configure"
4525 #include "confdefs.h"
4526
4527 #include <sys/types.h>
4528 #include <sys/signal.h>
4529
4530 int
4531 main (void)
4532 {
4533 int x = SIGWINCH
4534   ;
4535   return 0;
4536 }
4537 _ACEOF
4538 rm -f conftest.$ac_objext
4539 if { (eval echo "$as_me:4539: \"$ac_compile\"") >&5
4540   (eval $ac_compile) 2>&5
4541   ac_status=$?
4542   echo "$as_me:4542: \$? = $ac_status" >&5
4543   (exit $ac_status); } &&
4544          { ac_try='test -s conftest.$ac_objext'
4545   { (eval echo "$as_me:4545: \"$ac_try\"") >&5
4546   (eval $ac_try) 2>&5
4547   ac_status=$?
4548   echo "$as_me:4548: \$? = $ac_status" >&5
4549   (exit $ac_status); }; }; then
4550   cf_cv_define_sigwinch=yes
4551 else
4552   echo "$as_me: failed program was:" >&5
4553 cat conftest.$ac_ext >&5
4554 cat >conftest.$ac_ext <<_ACEOF
4555 #line 4555 "configure"
4556 #include "confdefs.h"
4557
4558 #undef _XOPEN_SOURCE
4559 #undef _POSIX_SOURCE
4560 #undef _POSIX_C_SOURCE
4561 #include <sys/types.h>
4562 #include <sys/signal.h>
4563
4564 int
4565 main (void)
4566 {
4567 int x = SIGWINCH
4568   ;
4569   return 0;
4570 }
4571 _ACEOF
4572 rm -f conftest.$ac_objext
4573 if { (eval echo "$as_me:4573: \"$ac_compile\"") >&5
4574   (eval $ac_compile) 2>&5
4575   ac_status=$?
4576   echo "$as_me:4576: \$? = $ac_status" >&5
4577   (exit $ac_status); } &&
4578          { ac_try='test -s conftest.$ac_objext'
4579   { (eval echo "$as_me:4579: \"$ac_try\"") >&5
4580   (eval $ac_try) 2>&5
4581   ac_status=$?
4582   echo "$as_me:4582: \$? = $ac_status" >&5
4583   (exit $ac_status); }; }; then
4584   cf_cv_define_sigwinch=maybe
4585 else
4586   echo "$as_me: failed program was:" >&5
4587 cat conftest.$ac_ext >&5
4588 cf_cv_define_sigwinch=no
4589 fi
4590 rm -f conftest.$ac_objext conftest.$ac_ext
4591
4592 fi
4593 rm -f conftest.$ac_objext conftest.$ac_ext
4594
4595 fi
4596 echo "$as_me:4596: result: $cf_cv_define_sigwinch" >&5
4597 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4598
4599 if test "$cf_cv_define_sigwinch" = maybe ; then
4600 echo "$as_me:4600: checking for actual SIGWINCH definition" >&5
4601 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4602 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4603   echo $ECHO_N "(cached) $ECHO_C" >&6
4604 else
4605
4606 cf_cv_fixup_sigwinch=unknown
4607 cf_sigwinch=32
4608 while test $cf_sigwinch != 1
4609 do
4610         cat >conftest.$ac_ext <<_ACEOF
4611 #line 4611 "configure"
4612 #include "confdefs.h"
4613
4614 #undef _XOPEN_SOURCE
4615 #undef _POSIX_SOURCE
4616 #undef _POSIX_C_SOURCE
4617 #include <sys/types.h>
4618 #include <sys/signal.h>
4619
4620 int
4621 main (void)
4622 {
4623
4624 #if SIGWINCH != $cf_sigwinch
4625 make an error
4626 #endif
4627 int x = SIGWINCH
4628   ;
4629   return 0;
4630 }
4631 _ACEOF
4632 rm -f conftest.$ac_objext
4633 if { (eval echo "$as_me:4633: \"$ac_compile\"") >&5
4634   (eval $ac_compile) 2>&5
4635   ac_status=$?
4636   echo "$as_me:4636: \$? = $ac_status" >&5
4637   (exit $ac_status); } &&
4638          { ac_try='test -s conftest.$ac_objext'
4639   { (eval echo "$as_me:4639: \"$ac_try\"") >&5
4640   (eval $ac_try) 2>&5
4641   ac_status=$?
4642   echo "$as_me:4642: \$? = $ac_status" >&5
4643   (exit $ac_status); }; }; then
4644   cf_cv_fixup_sigwinch=$cf_sigwinch
4645          break
4646 else
4647   echo "$as_me: failed program was:" >&5
4648 cat conftest.$ac_ext >&5
4649 fi
4650 rm -f conftest.$ac_objext conftest.$ac_ext
4651
4652 cf_sigwinch=`expr $cf_sigwinch - 1`
4653 done
4654
4655 fi
4656 echo "$as_me:4656: result: $cf_cv_fixup_sigwinch" >&5
4657 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4658
4659         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4660                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4661         fi
4662 fi
4663
4664 # Checks for CODESET support.
4665
4666 echo "$as_me:4666: checking for nl_langinfo and CODESET" >&5
4667 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4668 if test "${am_cv_langinfo_codeset+set}" = set; then
4669   echo $ECHO_N "(cached) $ECHO_C" >&6
4670 else
4671   cat >conftest.$ac_ext <<_ACEOF
4672 #line 4672 "configure"
4673 #include "confdefs.h"
4674 #include <langinfo.h>
4675 int
4676 main (void)
4677 {
4678 char* cs = nl_langinfo(CODESET);
4679   ;
4680   return 0;
4681 }
4682 _ACEOF
4683 rm -f conftest.$ac_objext conftest$ac_exeext
4684 if { (eval echo "$as_me:4684: \"$ac_link\"") >&5
4685   (eval $ac_link) 2>&5
4686   ac_status=$?
4687   echo "$as_me:4687: \$? = $ac_status" >&5
4688   (exit $ac_status); } &&
4689          { ac_try='test -s conftest$ac_exeext'
4690   { (eval echo "$as_me:4690: \"$ac_try\"") >&5
4691   (eval $ac_try) 2>&5
4692   ac_status=$?
4693   echo "$as_me:4693: \$? = $ac_status" >&5
4694   (exit $ac_status); }; }; then
4695   am_cv_langinfo_codeset=yes
4696 else
4697   echo "$as_me: failed program was:" >&5
4698 cat conftest.$ac_ext >&5
4699 am_cv_langinfo_codeset=no
4700 fi
4701 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4702
4703 fi
4704 echo "$as_me:4704: result: $am_cv_langinfo_codeset" >&5
4705 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4706         if test $am_cv_langinfo_codeset = yes; then
4707
4708 cat >>confdefs.h <<\EOF
4709 #define HAVE_LANGINFO_CODESET 1
4710 EOF
4711
4712         fi
4713
4714 echo "$as_me:4714: checking if you want to use pkg-config" >&5
4715 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4716
4717 # Check whether --with-pkg-config or --without-pkg-config was given.
4718 if test "${with_pkg_config+set}" = set; then
4719   withval="$with_pkg_config"
4720   cf_pkg_config=$withval
4721 else
4722   cf_pkg_config=yes
4723 fi;
4724 echo "$as_me:4724: result: $cf_pkg_config" >&5
4725 echo "${ECHO_T}$cf_pkg_config" >&6
4726
4727 case $cf_pkg_config in
4728 (no)
4729         PKG_CONFIG=none
4730         ;;
4731 (yes)
4732
4733 if test -n "$ac_tool_prefix"; then
4734   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4735 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4736 echo "$as_me:4736: checking for $ac_word" >&5
4737 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4738 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4739   echo $ECHO_N "(cached) $ECHO_C" >&6
4740 else
4741   case $PKG_CONFIG in
4742   [\\/]* | ?:[\\/]*)
4743   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4744   ;;
4745   *)
4746   ac_save_IFS=$IFS; IFS=$ac_path_separator
4747 ac_dummy="$PATH"
4748 for ac_dir in $ac_dummy; do
4749   IFS=$ac_save_IFS
4750   test -z "$ac_dir" && ac_dir=.
4751   if $as_executable_p "$ac_dir/$ac_word"; then
4752    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4753    echo "$as_me:4753: found $ac_dir/$ac_word" >&5
4754    break
4755 fi
4756 done
4757
4758   ;;
4759 esac
4760 fi
4761 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4762
4763 if test -n "$PKG_CONFIG"; then
4764   echo "$as_me:4764: result: $PKG_CONFIG" >&5
4765 echo "${ECHO_T}$PKG_CONFIG" >&6
4766 else
4767   echo "$as_me:4767: result: no" >&5
4768 echo "${ECHO_T}no" >&6
4769 fi
4770
4771 fi
4772 if test -z "$ac_cv_path_PKG_CONFIG"; then
4773   ac_pt_PKG_CONFIG=$PKG_CONFIG
4774   # Extract the first word of "pkg-config", so it can be a program name with args.
4775 set dummy pkg-config; ac_word=$2
4776 echo "$as_me:4776: checking for $ac_word" >&5
4777 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4778 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4779   echo $ECHO_N "(cached) $ECHO_C" >&6
4780 else
4781   case $ac_pt_PKG_CONFIG in
4782   [\\/]* | ?:[\\/]*)
4783   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4784   ;;
4785   *)
4786   ac_save_IFS=$IFS; IFS=$ac_path_separator
4787 ac_dummy="$PATH"
4788 for ac_dir in $ac_dummy; do
4789   IFS=$ac_save_IFS
4790   test -z "$ac_dir" && ac_dir=.
4791   if $as_executable_p "$ac_dir/$ac_word"; then
4792    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4793    echo "$as_me:4793: found $ac_dir/$ac_word" >&5
4794    break
4795 fi
4796 done
4797
4798   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4799   ;;
4800 esac
4801 fi
4802 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4803
4804 if test -n "$ac_pt_PKG_CONFIG"; then
4805   echo "$as_me:4805: result: $ac_pt_PKG_CONFIG" >&5
4806 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4807 else
4808   echo "$as_me:4808: result: no" >&5
4809 echo "${ECHO_T}no" >&6
4810 fi
4811
4812   PKG_CONFIG=$ac_pt_PKG_CONFIG
4813 else
4814   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4815 fi
4816
4817         ;;
4818 (*)
4819         PKG_CONFIG=$withval
4820         ;;
4821 esac
4822
4823 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4824 if test "$PKG_CONFIG" != none ; then
4825
4826 if test "x$prefix" != xNONE; then
4827         cf_path_syntax="$prefix"
4828 else
4829         cf_path_syntax="$ac_default_prefix"
4830 fi
4831
4832 case ".$PKG_CONFIG" in
4833 (.\$\(*\)*|.\'*\'*)
4834         ;;
4835 (..|./*|.\\*)
4836         ;;
4837 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4838         ;;
4839 (.\${*prefix}*|.\${*dir}*)
4840         eval PKG_CONFIG="$PKG_CONFIG"
4841         case ".$PKG_CONFIG" in
4842         (.NONE/*)
4843                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4844                 ;;
4845         esac
4846         ;;
4847 (.no|.NONE/*)
4848         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4849         ;;
4850 (*)
4851         { { echo "$as_me:4851: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4852 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4853    { (exit 1); exit 1; }; }
4854         ;;
4855 esac
4856
4857 elif test "x$cf_pkg_config" != xno ; then
4858         { echo "$as_me:4858: WARNING: pkg-config is not installed" >&5
4859 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4860 fi
4861
4862 echo "$as_me:4862: checking if you want to see long compiling messages" >&5
4863 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4864
4865 # Check whether --enable-echo or --disable-echo was given.
4866 if test "${enable_echo+set}" = set; then
4867   enableval="$enable_echo"
4868   test "$enableval" != no && enableval=yes
4869         if test "$enableval" != "yes" ; then
4870
4871         ECHO_LT='--silent'
4872         ECHO_LD='@echo linking $@;'
4873         RULE_CC='@echo compiling $<'
4874         SHOW_CC='@echo compiling $@'
4875         ECHO_CC='@'
4876
4877         else
4878
4879         ECHO_LT=''
4880         ECHO_LD=''
4881         RULE_CC=''
4882         SHOW_CC=''
4883         ECHO_CC=''
4884
4885         fi
4886 else
4887   enableval=yes
4888
4889         ECHO_LT=''
4890         ECHO_LD=''
4891         RULE_CC=''
4892         SHOW_CC=''
4893         ECHO_CC=''
4894
4895 fi;
4896 echo "$as_me:4896: result: $enableval" >&5
4897 echo "${ECHO_T}$enableval" >&6
4898
4899 echo "$as_me:4899: checking for ncurses wrap-prefix" >&5
4900 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4901
4902 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4903 if test "${with_ncurses_wrap_prefix+set}" = set; then
4904   withval="$with_ncurses_wrap_prefix"
4905   NCURSES_WRAP_PREFIX=$withval
4906 else
4907   NCURSES_WRAP_PREFIX=_nc_
4908 fi;
4909 echo "$as_me:4909: result: $NCURSES_WRAP_PREFIX" >&5
4910 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4911
4912 echo "$as_me:4912: checking if you want to check for wide-character functions" >&5
4913 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4914
4915 # Check whether --enable-widec or --disable-widec was given.
4916 if test "${enable_widec+set}" = set; then
4917   enableval="$enable_widec"
4918   test "$enableval" != no && enableval=yes
4919         if test "$enableval" != "yes" ; then
4920     cf_enable_widec=no
4921         else
4922                 cf_enable_widec=yes
4923         fi
4924 else
4925   enableval=yes
4926         cf_enable_widec=yes
4927
4928 fi;
4929 echo "$as_me:4929: result: $cf_enable_widec" >&5
4930 echo "${ECHO_T}$cf_enable_widec" >&6
4931
4932 echo "$as_me:4932: checking for specific curses-directory" >&5
4933 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4934
4935 # Check whether --with-curses-dir or --without-curses-dir was given.
4936 if test "${with_curses_dir+set}" = set; then
4937   withval="$with_curses_dir"
4938   cf_cv_curses_dir=$withval
4939 else
4940   cf_cv_curses_dir=no
4941 fi;
4942 echo "$as_me:4942: result: $cf_cv_curses_dir" >&5
4943 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4944
4945 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4946 then
4947
4948 if test "x$prefix" != xNONE; then
4949         cf_path_syntax="$prefix"
4950 else
4951         cf_path_syntax="$ac_default_prefix"
4952 fi
4953
4954 case ".$withval" in
4955 (.\$\(*\)*|.\'*\'*)
4956         ;;
4957 (..|./*|.\\*)
4958         ;;
4959 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4960         ;;
4961 (.\${*prefix}*|.\${*dir}*)
4962         eval withval="$withval"
4963         case ".$withval" in
4964         (.NONE/*)
4965                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4966                 ;;
4967         esac
4968         ;;
4969 (.no|.NONE/*)
4970         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4971         ;;
4972 (*)
4973         { { echo "$as_me:4973: error: expected a pathname, not \"$withval\"" >&5
4974 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4975    { (exit 1); exit 1; }; }
4976         ;;
4977 esac
4978
4979         if test -d "$cf_cv_curses_dir"
4980         then
4981
4982 if test -n "$cf_cv_curses_dir/include" ; then
4983   for cf_add_incdir in $cf_cv_curses_dir/include
4984   do
4985         while test $cf_add_incdir != /usr/include
4986         do
4987           if test -d $cf_add_incdir
4988           then
4989                 cf_have_incdir=no
4990                 if test -n "$CFLAGS$CPPFLAGS" ; then
4991                   # a loop is needed to ensure we can add subdirs of existing dirs
4992                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4993                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4994                           cf_have_incdir=yes; break
4995                         fi
4996                   done
4997                 fi
4998
4999                 if test "$cf_have_incdir" = no ; then
5000                   if test "$cf_add_incdir" = /usr/local/include ; then
5001                         if test "$GCC" = yes
5002                         then
5003                           cf_save_CPPFLAGS=$CPPFLAGS
5004                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5005                           cat >conftest.$ac_ext <<_ACEOF
5006 #line 5006 "configure"
5007 #include "confdefs.h"
5008 #include <stdio.h>
5009 int
5010 main (void)
5011 {
5012 printf("Hello")
5013   ;
5014   return 0;
5015 }
5016 _ACEOF
5017 rm -f conftest.$ac_objext
5018 if { (eval echo "$as_me:5018: \"$ac_compile\"") >&5
5019   (eval $ac_compile) 2>&5
5020   ac_status=$?
5021   echo "$as_me:5021: \$? = $ac_status" >&5
5022   (exit $ac_status); } &&
5023          { ac_try='test -s conftest.$ac_objext'
5024   { (eval echo "$as_me:5024: \"$ac_try\"") >&5
5025   (eval $ac_try) 2>&5
5026   ac_status=$?
5027   echo "$as_me:5027: \$? = $ac_status" >&5
5028   (exit $ac_status); }; }; then
5029   :
5030 else
5031   echo "$as_me: failed program was:" >&5
5032 cat conftest.$ac_ext >&5
5033 cf_have_incdir=yes
5034 fi
5035 rm -f conftest.$ac_objext conftest.$ac_ext
5036                           CPPFLAGS=$cf_save_CPPFLAGS
5037                         fi
5038                   fi
5039                 fi
5040
5041                 if test "$cf_have_incdir" = no ; then
5042                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5043
5044 echo "${as_me:-configure}:5044: testing adding $cf_add_incdir to include-path ..." 1>&5
5045
5046                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5047
5048                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5049                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5050                   cf_add_incdir="$cf_top_incdir"
5051                 else
5052                   break
5053                 fi
5054           else
5055                 break
5056           fi
5057         done
5058   done
5059 fi
5060
5061 if test -n "$cf_cv_curses_dir/lib" ; then
5062         for cf_add_libdir in $cf_cv_curses_dir/lib
5063         do
5064                 if test $cf_add_libdir = /usr/lib ; then
5065                         :
5066                 elif test -d $cf_add_libdir
5067                 then
5068                         cf_have_libdir=no
5069                         if test -n "$LDFLAGS$LIBS" ; then
5070                                 # a loop is needed to ensure we can add subdirs of existing dirs
5071                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5072                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5073                                                 cf_have_libdir=yes; break
5074                                         fi
5075                                 done
5076                         fi
5077                         if test "$cf_have_libdir" = no ; then
5078                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5079
5080 echo "${as_me:-configure}:5080: testing adding $cf_add_libdir to library-path ..." 1>&5
5081
5082                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5083                         fi
5084                 fi
5085         done
5086 fi
5087
5088         fi
5089 fi
5090
5091 cf_cv_screen=curses
5092
5093 echo "$as_me:5093: checking for specified curses library type" >&5
5094 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5095
5096 # Check whether --with-screen or --without-screen was given.
5097 if test "${with_screen+set}" = set; then
5098   withval="$with_screen"
5099   cf_cv_screen=$withval
5100 else
5101
5102 # Check whether --with-ncursesw or --without-ncursesw was given.
5103 if test "${with_ncursesw+set}" = set; then
5104   withval="$with_ncursesw"
5105   cf_cv_screen=ncursesw
5106 else
5107
5108 # Check whether --with-ncurses or --without-ncurses was given.
5109 if test "${with_ncurses+set}" = set; then
5110   withval="$with_ncurses"
5111   cf_cv_screen=ncurses
5112 else
5113
5114 # Check whether --with-pdcurses or --without-pdcurses was given.
5115 if test "${with_pdcurses+set}" = set; then
5116   withval="$with_pdcurses"
5117   cf_cv_screen=pdcurses
5118 else
5119
5120 # Check whether --with-curses-colr or --without-curses-colr was given.
5121 if test "${with_curses_colr+set}" = set; then
5122   withval="$with_curses_colr"
5123   cf_cv_screen=curses_colr
5124 else
5125
5126 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5127 if test "${with_curses_5lib+set}" = set; then
5128   withval="$with_curses_5lib"
5129   cf_cv_screen=curses_5lib
5130 fi;
5131 fi;
5132 fi;
5133 fi;
5134 fi;
5135 fi;
5136
5137 echo "$as_me:5137: result: $cf_cv_screen" >&5
5138 echo "${ECHO_T}$cf_cv_screen" >&6
5139
5140 case $cf_cv_screen in
5141 (curses|curses_*)
5142
5143 echo "$as_me:5143: checking for extra include directories" >&5
5144 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5145 if test "${cf_cv_curses_incdir+set}" = set; then
5146   echo $ECHO_N "(cached) $ECHO_C" >&6
5147 else
5148
5149 cf_cv_curses_incdir=no
5150 case $host_os in
5151 (hpux10.*)
5152         if test "x$cf_cv_screen" = "xcurses_colr"
5153         then
5154                 test -d /usr/include/curses_colr && \
5155                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5156         fi
5157         ;;
5158 (sunos3*|sunos4*)
5159         if test "x$cf_cv_screen" = "xcurses_5lib"
5160         then
5161                 test -d /usr/5lib && \
5162                 test -d /usr/5include && \
5163                 cf_cv_curses_incdir="-I/usr/5include"
5164         fi
5165         ;;
5166 esac
5167
5168 fi
5169 echo "$as_me:5169: result: $cf_cv_curses_incdir" >&5
5170 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5171 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5172
5173 echo "$as_me:5173: checking if we have identified curses headers" >&5
5174 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5175 if test "${cf_cv_ncurses_header+set}" = set; then
5176   echo $ECHO_N "(cached) $ECHO_C" >&6
5177 else
5178
5179 cf_cv_ncurses_header=none
5180 for cf_header in \
5181         ncurses.h  \
5182         curses.h  ncurses/ncurses.h ncurses/curses.h
5183 do
5184 cat >conftest.$ac_ext <<_ACEOF
5185 #line 5185 "configure"
5186 #include "confdefs.h"
5187 #include <${cf_header}>
5188 int
5189 main (void)
5190 {
5191 initscr(); tgoto("?", 0,0)
5192   ;
5193   return 0;
5194 }
5195 _ACEOF
5196 rm -f conftest.$ac_objext
5197 if { (eval echo "$as_me:5197: \"$ac_compile\"") >&5
5198   (eval $ac_compile) 2>&5
5199   ac_status=$?
5200   echo "$as_me:5200: \$? = $ac_status" >&5
5201   (exit $ac_status); } &&
5202          { ac_try='test -s conftest.$ac_objext'
5203   { (eval echo "$as_me:5203: \"$ac_try\"") >&5
5204   (eval $ac_try) 2>&5
5205   ac_status=$?
5206   echo "$as_me:5206: \$? = $ac_status" >&5
5207   (exit $ac_status); }; }; then
5208   cf_cv_ncurses_header=$cf_header; break
5209 else
5210   echo "$as_me: failed program was:" >&5
5211 cat conftest.$ac_ext >&5
5212 fi
5213 rm -f conftest.$ac_objext conftest.$ac_ext
5214 done
5215
5216 fi
5217 echo "$as_me:5217: result: $cf_cv_ncurses_header" >&5
5218 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5219
5220 if test "$cf_cv_ncurses_header" = none ; then
5221         { { echo "$as_me:5221: error: No curses header-files found" >&5
5222 echo "$as_me: error: No curses header-files found" >&2;}
5223    { (exit 1); exit 1; }; }
5224 fi
5225
5226 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5227
5228 for ac_header in $cf_cv_ncurses_header
5229 do
5230 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5231 echo "$as_me:5231: checking for $ac_header" >&5
5232 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5233 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5234   echo $ECHO_N "(cached) $ECHO_C" >&6
5235 else
5236   cat >conftest.$ac_ext <<_ACEOF
5237 #line 5237 "configure"
5238 #include "confdefs.h"
5239 #include <$ac_header>
5240 _ACEOF
5241 if { (eval echo "$as_me:5241: \"$ac_cpp conftest.$ac_ext\"") >&5
5242   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5243   ac_status=$?
5244   egrep -v '^ *\+' conftest.er1 >conftest.err
5245   rm -f conftest.er1
5246   cat conftest.err >&5
5247   echo "$as_me:5247: \$? = $ac_status" >&5
5248   (exit $ac_status); } >/dev/null; then
5249   if test -s conftest.err; then
5250     ac_cpp_err=$ac_c_preproc_warn_flag
5251   else
5252     ac_cpp_err=
5253   fi
5254 else
5255   ac_cpp_err=yes
5256 fi
5257 if test -z "$ac_cpp_err"; then
5258   eval "$as_ac_Header=yes"
5259 else
5260   echo "$as_me: failed program was:" >&5
5261   cat conftest.$ac_ext >&5
5262   eval "$as_ac_Header=no"
5263 fi
5264 rm -f conftest.err conftest.$ac_ext
5265 fi
5266 echo "$as_me:5266: result: `eval echo '${'$as_ac_Header'}'`" >&5
5267 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5268 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5269   cat >>confdefs.h <<EOF
5270 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5271 EOF
5272
5273 fi
5274 done
5275
5276 echo "$as_me:5276: checking for terminfo header" >&5
5277 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5278 if test "${cf_cv_term_header+set}" = set; then
5279   echo $ECHO_N "(cached) $ECHO_C" >&6
5280 else
5281
5282 case ${cf_cv_ncurses_header} in
5283 (*/ncurses.h|*/ncursesw.h)
5284         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5285         ;;
5286 (*)
5287         cf_term_header=term.h
5288         ;;
5289 esac
5290
5291 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5292 do
5293 cat >conftest.$ac_ext <<_ACEOF
5294 #line 5294 "configure"
5295 #include "confdefs.h"
5296 #include <stdio.h>
5297 #include <${cf_cv_ncurses_header:-curses.h}>
5298 #include <$cf_test>
5299
5300 int
5301 main (void)
5302 {
5303 int x = auto_left_margin
5304   ;
5305   return 0;
5306 }
5307 _ACEOF
5308 rm -f conftest.$ac_objext
5309 if { (eval echo "$as_me:5309: \"$ac_compile\"") >&5
5310   (eval $ac_compile) 2>&5
5311   ac_status=$?
5312   echo "$as_me:5312: \$? = $ac_status" >&5
5313   (exit $ac_status); } &&
5314          { ac_try='test -s conftest.$ac_objext'
5315   { (eval echo "$as_me:5315: \"$ac_try\"") >&5
5316   (eval $ac_try) 2>&5
5317   ac_status=$?
5318   echo "$as_me:5318: \$? = $ac_status" >&5
5319   (exit $ac_status); }; }; then
5320
5321         cf_cv_term_header="$cf_test"
5322 else
5323   echo "$as_me: failed program was:" >&5
5324 cat conftest.$ac_ext >&5
5325
5326         cf_cv_term_header=unknown
5327
5328 fi
5329 rm -f conftest.$ac_objext conftest.$ac_ext
5330         test "$cf_cv_term_header" != unknown && break
5331 done
5332
5333 fi
5334 echo "$as_me:5334: result: $cf_cv_term_header" >&5
5335 echo "${ECHO_T}$cf_cv_term_header" >&6
5336
5337 # Set definitions to allow ifdef'ing to accommodate subdirectories
5338
5339 case $cf_cv_term_header in
5340 (*term.h)
5341
5342 cat >>confdefs.h <<\EOF
5343 #define HAVE_TERM_H 1
5344 EOF
5345
5346         ;;
5347 esac
5348
5349 case $cf_cv_term_header in
5350 (ncurses/term.h)
5351
5352 cat >>confdefs.h <<\EOF
5353 #define HAVE_NCURSES_TERM_H 1
5354 EOF
5355
5356         ;;
5357 (ncursesw/term.h)
5358
5359 cat >>confdefs.h <<\EOF
5360 #define HAVE_NCURSESW_TERM_H 1
5361 EOF
5362
5363         ;;
5364 esac
5365
5366 echo "$as_me:5366: checking for ncurses version" >&5
5367 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5368 if test "${cf_cv_ncurses_version+set}" = set; then
5369   echo $ECHO_N "(cached) $ECHO_C" >&6
5370 else
5371
5372         cf_cv_ncurses_version=no
5373         cf_tempfile=out$$
5374         rm -f $cf_tempfile
5375         if test "$cross_compiling" = yes; then
5376
5377         # This will not work if the preprocessor splits the line after the
5378         # Autoconf token.  The 'unproto' program does that.
5379         cat > conftest.$ac_ext <<EOF
5380 #include <${cf_cv_ncurses_header:-curses.h}>
5381 #undef Autoconf
5382 #ifdef NCURSES_VERSION
5383 Autoconf NCURSES_VERSION
5384 #else
5385 #ifdef __NCURSES_H
5386 Autoconf "old"
5387 #endif
5388 ;
5389 #endif
5390 EOF
5391         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5392         { (eval echo "$as_me:5392: \"$cf_try\"") >&5
5393   (eval $cf_try) 2>&5
5394   ac_status=$?
5395   echo "$as_me:5395: \$? = $ac_status" >&5
5396   (exit $ac_status); }
5397         if test -f conftest.out ; then
5398                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5399                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5400                 rm -f conftest.out
5401         fi
5402
5403 else
5404   cat >conftest.$ac_ext <<_ACEOF
5405 #line 5405 "configure"
5406 #include "confdefs.h"
5407
5408 #include <${cf_cv_ncurses_header:-curses.h}>
5409 #include <stdio.h>
5410 int main(void)
5411 {
5412         FILE *fp = fopen("$cf_tempfile", "w");
5413 #ifdef NCURSES_VERSION
5414 # ifdef NCURSES_VERSION_PATCH
5415         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5416 # else
5417         fprintf(fp, "%s\n", NCURSES_VERSION);
5418 # endif
5419 #else
5420 # ifdef __NCURSES_H
5421         fprintf(fp, "old\n");
5422 # else
5423         make an error
5424 # endif
5425 #endif
5426         ${cf_cv_main_return:-return}(0);
5427 }
5428 _ACEOF
5429 rm -f conftest$ac_exeext
5430 if { (eval echo "$as_me:5430: \"$ac_link\"") >&5
5431   (eval $ac_link) 2>&5
5432   ac_status=$?
5433   echo "$as_me:5433: \$? = $ac_status" >&5
5434   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5435   { (eval echo "$as_me:5435: \"$ac_try\"") >&5
5436   (eval $ac_try) 2>&5
5437   ac_status=$?
5438   echo "$as_me:5438: \$? = $ac_status" >&5
5439   (exit $ac_status); }; }; then
5440
5441         cf_cv_ncurses_version=`cat $cf_tempfile`
5442 else
5443   echo "$as_me: program exited with status $ac_status" >&5
5444 echo "$as_me: failed program was:" >&5
5445 cat conftest.$ac_ext >&5
5446 fi
5447 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5448 fi
5449         rm -f $cf_tempfile
5450
5451 fi
5452 echo "$as_me:5452: result: $cf_cv_ncurses_version" >&5
5453 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5454 test "$cf_cv_ncurses_version" = no ||
5455 cat >>confdefs.h <<\EOF
5456 #define NCURSES 1
5457 EOF
5458
5459 echo "$as_me:5459: checking if we have identified curses libraries" >&5
5460 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5461 cat >conftest.$ac_ext <<_ACEOF
5462 #line 5462 "configure"
5463 #include "confdefs.h"
5464 #include <${cf_cv_ncurses_header:-curses.h}>
5465 int
5466 main (void)
5467 {
5468 initscr(); tgoto("?", 0,0)
5469   ;
5470   return 0;
5471 }
5472 _ACEOF
5473 rm -f conftest.$ac_objext conftest$ac_exeext
5474 if { (eval echo "$as_me:5474: \"$ac_link\"") >&5
5475   (eval $ac_link) 2>&5
5476   ac_status=$?
5477   echo "$as_me:5477: \$? = $ac_status" >&5
5478   (exit $ac_status); } &&
5479          { ac_try='test -s conftest$ac_exeext'
5480   { (eval echo "$as_me:5480: \"$ac_try\"") >&5
5481   (eval $ac_try) 2>&5
5482   ac_status=$?
5483   echo "$as_me:5483: \$? = $ac_status" >&5
5484   (exit $ac_status); }; }; then
5485   cf_result=yes
5486 else
5487   echo "$as_me: failed program was:" >&5
5488 cat conftest.$ac_ext >&5
5489 cf_result=no
5490 fi
5491 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5492 echo "$as_me:5492: result: $cf_result" >&5
5493 echo "${ECHO_T}$cf_result" >&6
5494
5495 if test "$cf_result" = no ; then
5496 case $host_os in
5497 (freebsd*)
5498         echo "$as_me:5498: checking for tgoto in -lmytinfo" >&5
5499 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5500 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5501   echo $ECHO_N "(cached) $ECHO_C" >&6
5502 else
5503   ac_check_lib_save_LIBS=$LIBS
5504 LIBS="-lmytinfo  $LIBS"
5505 cat >conftest.$ac_ext <<_ACEOF
5506 #line 5506 "configure"
5507 #include "confdefs.h"
5508
5509 /* Override any gcc2 internal prototype to avoid an error.  */
5510 #ifdef __cplusplus
5511 extern "C"
5512 #endif
5513 /* We use char because int might match the return type of a gcc2
5514    builtin and then its argument prototype would still apply.  */
5515 char tgoto ();
5516 int
5517 main (void)
5518 {
5519 tgoto ();
5520   ;
5521   return 0;
5522 }
5523 _ACEOF
5524 rm -f conftest.$ac_objext conftest$ac_exeext
5525 if { (eval echo "$as_me:5525: \"$ac_link\"") >&5
5526   (eval $ac_link) 2>&5
5527   ac_status=$?
5528   echo "$as_me:5528: \$? = $ac_status" >&5
5529   (exit $ac_status); } &&
5530          { ac_try='test -s conftest$ac_exeext'
5531   { (eval echo "$as_me:5531: \"$ac_try\"") >&5
5532   (eval $ac_try) 2>&5
5533   ac_status=$?
5534   echo "$as_me:5534: \$? = $ac_status" >&5
5535   (exit $ac_status); }; }; then
5536   ac_cv_lib_mytinfo_tgoto=yes
5537 else
5538   echo "$as_me: failed program was:" >&5
5539 cat conftest.$ac_ext >&5
5540 ac_cv_lib_mytinfo_tgoto=no
5541 fi
5542 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5543 LIBS=$ac_check_lib_save_LIBS
5544 fi
5545 echo "$as_me:5545: result: $ac_cv_lib_mytinfo_tgoto" >&5
5546 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5547 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5548
5549 cf_add_libs="-lmytinfo"
5550 # Filter out duplicates - this happens with badly-designed ".pc" files...
5551 for cf_add_1lib in $LIBS
5552 do
5553         for cf_add_2lib in $cf_add_libs
5554         do
5555                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5556                 then
5557                         cf_add_1lib=
5558                         break
5559                 fi
5560         done
5561         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5562 done
5563 LIBS="$cf_add_libs"
5564
5565 fi
5566
5567         ;;
5568 (hpux10.*)
5569         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5570         # next (1998), and xcurses "newer" (2000).  There is no header file for
5571         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5572         # term.h) for cur_colr
5573         if test "x$cf_cv_screen" = "xcurses_colr"
5574         then
5575                 echo "$as_me:5575: checking for initscr in -lcur_colr" >&5
5576 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5577 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5578   echo $ECHO_N "(cached) $ECHO_C" >&6
5579 else
5580   ac_check_lib_save_LIBS=$LIBS
5581 LIBS="-lcur_colr  $LIBS"
5582 cat >conftest.$ac_ext <<_ACEOF
5583 #line 5583 "configure"
5584 #include "confdefs.h"
5585
5586 /* Override any gcc2 internal prototype to avoid an error.  */
5587 #ifdef __cplusplus
5588 extern "C"
5589 #endif
5590 /* We use char because int might match the return type of a gcc2
5591    builtin and then its argument prototype would still apply.  */
5592 char initscr ();
5593 int
5594 main (void)
5595 {
5596 initscr ();
5597   ;
5598   return 0;
5599 }
5600 _ACEOF
5601 rm -f conftest.$ac_objext conftest$ac_exeext
5602 if { (eval echo "$as_me:5602: \"$ac_link\"") >&5
5603   (eval $ac_link) 2>&5
5604   ac_status=$?
5605   echo "$as_me:5605: \$? = $ac_status" >&5
5606   (exit $ac_status); } &&
5607          { ac_try='test -s conftest$ac_exeext'
5608   { (eval echo "$as_me:5608: \"$ac_try\"") >&5
5609   (eval $ac_try) 2>&5
5610   ac_status=$?
5611   echo "$as_me:5611: \$? = $ac_status" >&5
5612   (exit $ac_status); }; }; then
5613   ac_cv_lib_cur_colr_initscr=yes
5614 else
5615   echo "$as_me: failed program was:" >&5
5616 cat conftest.$ac_ext >&5
5617 ac_cv_lib_cur_colr_initscr=no
5618 fi
5619 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5620 LIBS=$ac_check_lib_save_LIBS
5621 fi
5622 echo "$as_me:5622: result: $ac_cv_lib_cur_colr_initscr" >&5
5623 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5624 if test $ac_cv_lib_cur_colr_initscr = yes; then
5625
5626 cf_add_libs="-lcur_colr"
5627 # Filter out duplicates - this happens with badly-designed ".pc" files...
5628 for cf_add_1lib in $LIBS
5629 do
5630         for cf_add_2lib in $cf_add_libs
5631         do
5632                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5633                 then
5634                         cf_add_1lib=
5635                         break
5636                 fi
5637         done
5638         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5639 done
5640 LIBS="$cf_add_libs"
5641
5642                         ac_cv_func_initscr=yes
5643
5644 else
5645
5646                 echo "$as_me:5646: checking for initscr in -lHcurses" >&5
5647 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5648 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5649   echo $ECHO_N "(cached) $ECHO_C" >&6
5650 else
5651   ac_check_lib_save_LIBS=$LIBS
5652 LIBS="-lHcurses  $LIBS"
5653 cat >conftest.$ac_ext <<_ACEOF
5654 #line 5654 "configure"
5655 #include "confdefs.h"
5656
5657 /* Override any gcc2 internal prototype to avoid an error.  */
5658 #ifdef __cplusplus
5659 extern "C"
5660 #endif
5661 /* We use char because int might match the return type of a gcc2
5662    builtin and then its argument prototype would still apply.  */
5663 char initscr ();
5664 int
5665 main (void)
5666 {
5667 initscr ();
5668   ;
5669   return 0;
5670 }
5671 _ACEOF
5672 rm -f conftest.$ac_objext conftest$ac_exeext
5673 if { (eval echo "$as_me:5673: \"$ac_link\"") >&5
5674   (eval $ac_link) 2>&5
5675   ac_status=$?
5676   echo "$as_me:5676: \$? = $ac_status" >&5
5677   (exit $ac_status); } &&
5678          { ac_try='test -s conftest$ac_exeext'
5679   { (eval echo "$as_me:5679: \"$ac_try\"") >&5
5680   (eval $ac_try) 2>&5
5681   ac_status=$?
5682   echo "$as_me:5682: \$? = $ac_status" >&5
5683   (exit $ac_status); }; }; then
5684   ac_cv_lib_Hcurses_initscr=yes
5685 else
5686   echo "$as_me: failed program was:" >&5
5687 cat conftest.$ac_ext >&5
5688 ac_cv_lib_Hcurses_initscr=no
5689 fi
5690 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5691 LIBS=$ac_check_lib_save_LIBS
5692 fi
5693 echo "$as_me:5693: result: $ac_cv_lib_Hcurses_initscr" >&5
5694 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5695 if test $ac_cv_lib_Hcurses_initscr = yes; then
5696
5697                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5698
5699 cf_add_libs="-lHcurses"
5700 # Filter out duplicates - this happens with badly-designed ".pc" files...
5701 for cf_add_1lib in $LIBS
5702 do
5703         for cf_add_2lib in $cf_add_libs
5704         do
5705                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5706                 then
5707                         cf_add_1lib=
5708                         break
5709                 fi
5710         done
5711         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5712 done
5713 LIBS="$cf_add_libs"
5714
5715                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5716                         ac_cv_func_initscr=yes
5717
5718 fi
5719
5720 fi
5721
5722         fi
5723         ;;
5724 (linux*)
5725         case `arch 2>/dev/null` in
5726         (x86_64)
5727                 if test -d /lib64
5728                 then
5729
5730 if test -n "/lib64" ; then
5731         for cf_add_libdir in /lib64
5732         do
5733                 if test $cf_add_libdir = /usr/lib ; then
5734                         :
5735                 elif test -d $cf_add_libdir
5736                 then
5737                         cf_have_libdir=no
5738                         if test -n "$LDFLAGS$LIBS" ; then
5739                                 # a loop is needed to ensure we can add subdirs of existing dirs
5740                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5741                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5742                                                 cf_have_libdir=yes; break
5743                                         fi
5744                                 done
5745                         fi
5746                         if test "$cf_have_libdir" = no ; then
5747                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5748
5749 echo "${as_me:-configure}:5749: testing adding $cf_add_libdir to library-path ..." 1>&5
5750
5751                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5752                         fi
5753                 fi
5754         done
5755 fi
5756
5757                 else
5758
5759 if test -n "/lib" ; then
5760         for cf_add_libdir in /lib
5761         do
5762                 if test $cf_add_libdir = /usr/lib ; then
5763                         :
5764                 elif test -d $cf_add_libdir
5765                 then
5766                         cf_have_libdir=no
5767                         if test -n "$LDFLAGS$LIBS" ; then
5768                                 # a loop is needed to ensure we can add subdirs of existing dirs
5769                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5770                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5771                                                 cf_have_libdir=yes; break
5772                                         fi
5773                                 done
5774                         fi
5775                         if test "$cf_have_libdir" = no ; then
5776                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5777
5778 echo "${as_me:-configure}:5778: testing adding $cf_add_libdir to library-path ..." 1>&5
5779
5780                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5781                         fi
5782                 fi
5783         done
5784 fi
5785
5786                 fi
5787                 ;;
5788         (*)
5789
5790 if test -n "/lib" ; then
5791         for cf_add_libdir in /lib
5792         do
5793                 if test $cf_add_libdir = /usr/lib ; then
5794                         :
5795                 elif test -d $cf_add_libdir
5796                 then
5797                         cf_have_libdir=no
5798                         if test -n "$LDFLAGS$LIBS" ; then
5799                                 # a loop is needed to ensure we can add subdirs of existing dirs
5800                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5801                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5802                                                 cf_have_libdir=yes; break
5803                                         fi
5804                                 done
5805                         fi
5806                         if test "$cf_have_libdir" = no ; then
5807                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5808
5809 echo "${as_me:-configure}:5809: testing adding $cf_add_libdir to library-path ..." 1>&5
5810
5811                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5812                         fi
5813                 fi
5814         done
5815 fi
5816
5817                 ;;
5818         esac
5819         ;;
5820 (sunos3*|sunos4*)
5821         if test "x$cf_cv_screen" = "xcurses_5lib"
5822         then
5823                 if test -d /usr/5lib ; then
5824
5825 if test -n "/usr/5lib" ; then
5826         for cf_add_libdir in /usr/5lib
5827         do
5828                 if test $cf_add_libdir = /usr/lib ; then
5829                         :
5830                 elif test -d $cf_add_libdir
5831                 then
5832                         cf_have_libdir=no
5833                         if test -n "$LDFLAGS$LIBS" ; then
5834                                 # a loop is needed to ensure we can add subdirs of existing dirs
5835                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5836                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5837                                                 cf_have_libdir=yes; break
5838                                         fi
5839                                 done
5840                         fi
5841                         if test "$cf_have_libdir" = no ; then
5842                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5843
5844 echo "${as_me:-configure}:5844: testing adding $cf_add_libdir to library-path ..." 1>&5
5845
5846                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5847                         fi
5848                 fi
5849         done
5850 fi
5851
5852 cf_add_libs="-lcurses -ltermcap"
5853 # Filter out duplicates - this happens with badly-designed ".pc" files...
5854 for cf_add_1lib in $LIBS
5855 do
5856         for cf_add_2lib in $cf_add_libs
5857         do
5858                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5859                 then
5860                         cf_add_1lib=
5861                         break
5862                 fi
5863         done
5864         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5865 done
5866 LIBS="$cf_add_libs"
5867
5868                 fi
5869         fi
5870         ac_cv_func_initscr=yes
5871         ;;
5872 esac
5873
5874 if test ".$ac_cv_func_initscr" != .yes ; then
5875         cf_save_LIBS="$LIBS"
5876
5877         if test ".${cf_cv_ncurses_version:-no}" != .no
5878         then
5879                 cf_check_list="ncurses curses cursesX"
5880         else
5881                 cf_check_list="cursesX curses ncurses"
5882         fi
5883
5884         # Check for library containing tgoto.  Do this before curses library
5885         # because it may be needed to link the test-case for initscr.
5886         if test "x$cf_term_lib" = x
5887         then
5888                 echo "$as_me:5888: checking for tgoto" >&5
5889 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5890 if test "${ac_cv_func_tgoto+set}" = set; then
5891   echo $ECHO_N "(cached) $ECHO_C" >&6
5892 else
5893   cat >conftest.$ac_ext <<_ACEOF
5894 #line 5894 "configure"
5895 #include "confdefs.h"
5896 /* System header to define __stub macros and hopefully few prototypes,
5897     which can conflict with char tgoto (); below.  */
5898 #include <assert.h>
5899 /* Override any gcc2 internal prototype to avoid an error.  */
5900 #ifdef __cplusplus
5901 extern "C"
5902 #endif
5903 /* We use char because int might match the return type of a gcc2
5904    builtin and then its argument prototype would still apply.  */
5905 char tgoto ();
5906 char (*f) ();
5907
5908 int
5909 main (void)
5910 {
5911 /* The GNU C library defines this for functions which it implements
5912     to always fail with ENOSYS.  Some functions are actually named
5913     something starting with __ and the normal name is an alias.  */
5914 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5915 choke me
5916 #else
5917 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5918 #endif
5919
5920   ;
5921   return 0;
5922 }
5923 _ACEOF
5924 rm -f conftest.$ac_objext conftest$ac_exeext
5925 if { (eval echo "$as_me:5925: \"$ac_link\"") >&5
5926   (eval $ac_link) 2>&5
5927   ac_status=$?
5928   echo "$as_me:5928: \$? = $ac_status" >&5
5929   (exit $ac_status); } &&
5930          { ac_try='test -s conftest$ac_exeext'
5931   { (eval echo "$as_me:5931: \"$ac_try\"") >&5
5932   (eval $ac_try) 2>&5
5933   ac_status=$?
5934   echo "$as_me:5934: \$? = $ac_status" >&5
5935   (exit $ac_status); }; }; then
5936   ac_cv_func_tgoto=yes
5937 else
5938   echo "$as_me: failed program was:" >&5
5939 cat conftest.$ac_ext >&5
5940 ac_cv_func_tgoto=no
5941 fi
5942 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5943 fi
5944 echo "$as_me:5944: result: $ac_cv_func_tgoto" >&5
5945 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5946 if test $ac_cv_func_tgoto = yes; then
5947   cf_term_lib=predefined
5948 else
5949
5950                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5951                         do
5952                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5953 echo "$as_me:5953: checking for tgoto in -l$cf_term_lib" >&5
5954 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5955 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5956   echo $ECHO_N "(cached) $ECHO_C" >&6
5957 else
5958   ac_check_lib_save_LIBS=$LIBS
5959 LIBS="-l$cf_term_lib  $LIBS"
5960 cat >conftest.$ac_ext <<_ACEOF
5961 #line 5961 "configure"
5962 #include "confdefs.h"
5963
5964 /* Override any gcc2 internal prototype to avoid an error.  */
5965 #ifdef __cplusplus
5966 extern "C"
5967 #endif
5968 /* We use char because int might match the return type of a gcc2
5969    builtin and then its argument prototype would still apply.  */
5970 char tgoto ();
5971 int
5972 main (void)
5973 {
5974 tgoto ();
5975   ;
5976   return 0;
5977 }
5978 _ACEOF
5979 rm -f conftest.$ac_objext conftest$ac_exeext
5980 if { (eval echo "$as_me:5980: \"$ac_link\"") >&5
5981   (eval $ac_link) 2>&5
5982   ac_status=$?
5983   echo "$as_me:5983: \$? = $ac_status" >&5
5984   (exit $ac_status); } &&
5985          { ac_try='test -s conftest$ac_exeext'
5986   { (eval echo "$as_me:5986: \"$ac_try\"") >&5
5987   (eval $ac_try) 2>&5
5988   ac_status=$?
5989   echo "$as_me:5989: \$? = $ac_status" >&5
5990   (exit $ac_status); }; }; then
5991   eval "$as_ac_Lib=yes"
5992 else
5993   echo "$as_me: failed program was:" >&5
5994 cat conftest.$ac_ext >&5
5995 eval "$as_ac_Lib=no"
5996 fi
5997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5998 LIBS=$ac_check_lib_save_LIBS
5999 fi
6000 echo "$as_me:6000: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6001 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6002 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6003   break
6004 fi
6005
6006                         done
6007
6008 fi
6009
6010         fi
6011
6012         # Check for library containing initscr
6013         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6014         if test "x$cf_curs_lib" = x
6015         then
6016                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6017                 do
6018                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
6019 echo "$as_me:6019: checking for initscr in -l$cf_curs_lib" >&5
6020 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
6021 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6022   echo $ECHO_N "(cached) $ECHO_C" >&6
6023 else
6024   ac_check_lib_save_LIBS=$LIBS
6025 LIBS="-l$cf_curs_lib  $LIBS"
6026 cat >conftest.$ac_ext <<_ACEOF
6027 #line 6027 "configure"
6028 #include "confdefs.h"
6029
6030 /* Override any gcc2 internal prototype to avoid an error.  */
6031 #ifdef __cplusplus
6032 extern "C"
6033 #endif
6034 /* We use char because int might match the return type of a gcc2
6035    builtin and then its argument prototype would still apply.  */
6036 char initscr ();
6037 int
6038 main (void)
6039 {
6040 initscr ();
6041   ;
6042   return 0;
6043 }
6044 _ACEOF
6045 rm -f conftest.$ac_objext conftest$ac_exeext
6046 if { (eval echo "$as_me:6046: \"$ac_link\"") >&5
6047   (eval $ac_link) 2>&5
6048   ac_status=$?
6049   echo "$as_me:6049: \$? = $ac_status" >&5
6050   (exit $ac_status); } &&
6051          { ac_try='test -s conftest$ac_exeext'
6052   { (eval echo "$as_me:6052: \"$ac_try\"") >&5
6053   (eval $ac_try) 2>&5
6054   ac_status=$?
6055   echo "$as_me:6055: \$? = $ac_status" >&5
6056   (exit $ac_status); }; }; then
6057   eval "$as_ac_Lib=yes"
6058 else
6059   echo "$as_me: failed program was:" >&5
6060 cat conftest.$ac_ext >&5
6061 eval "$as_ac_Lib=no"
6062 fi
6063 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6064 LIBS=$ac_check_lib_save_LIBS
6065 fi
6066 echo "$as_me:6066: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6067 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6068 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6069   break
6070 fi
6071
6072                 done
6073         fi
6074         test $cf_curs_lib = unknown && { { echo "$as_me:6074: error: no curses library found" >&5
6075 echo "$as_me: error: no curses library found" >&2;}
6076    { (exit 1); exit 1; }; }
6077
6078         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6079         if test "$cf_term_lib" = unknown ; then
6080                 echo "$as_me:6080: checking if we can link with $cf_curs_lib library" >&5
6081 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6082                 cat >conftest.$ac_ext <<_ACEOF
6083 #line 6083 "configure"
6084 #include "confdefs.h"
6085 #include <${cf_cv_ncurses_header:-curses.h}>
6086 int
6087 main (void)
6088 {
6089 initscr()
6090   ;
6091   return 0;
6092 }
6093 _ACEOF
6094 rm -f conftest.$ac_objext conftest$ac_exeext
6095 if { (eval echo "$as_me:6095: \"$ac_link\"") >&5
6096   (eval $ac_link) 2>&5
6097   ac_status=$?
6098   echo "$as_me:6098: \$? = $ac_status" >&5
6099   (exit $ac_status); } &&
6100          { ac_try='test -s conftest$ac_exeext'
6101   { (eval echo "$as_me:6101: \"$ac_try\"") >&5
6102   (eval $ac_try) 2>&5
6103   ac_status=$?
6104   echo "$as_me:6104: \$? = $ac_status" >&5
6105   (exit $ac_status); }; }; then
6106   cf_result=yes
6107 else
6108   echo "$as_me: failed program was:" >&5
6109 cat conftest.$ac_ext >&5
6110 cf_result=no
6111 fi
6112 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6113                 echo "$as_me:6113: result: $cf_result" >&5
6114 echo "${ECHO_T}$cf_result" >&6
6115                 test $cf_result = no && { { echo "$as_me:6115: error: Cannot link curses library" >&5
6116 echo "$as_me: error: Cannot link curses library" >&2;}
6117    { (exit 1); exit 1; }; }
6118         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6119                 :
6120         elif test "$cf_term_lib" != predefined ; then
6121                 echo "$as_me:6121: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6122 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6123                 cat >conftest.$ac_ext <<_ACEOF
6124 #line 6124 "configure"
6125 #include "confdefs.h"
6126 #include <${cf_cv_ncurses_header:-curses.h}>
6127 int
6128 main (void)
6129 {
6130 initscr(); tgoto((char *)0, 0, 0);
6131   ;
6132   return 0;
6133 }
6134 _ACEOF
6135 rm -f conftest.$ac_objext conftest$ac_exeext
6136 if { (eval echo "$as_me:6136: \"$ac_link\"") >&5
6137   (eval $ac_link) 2>&5
6138   ac_status=$?
6139   echo "$as_me:6139: \$? = $ac_status" >&5
6140   (exit $ac_status); } &&
6141          { ac_try='test -s conftest$ac_exeext'
6142   { (eval echo "$as_me:6142: \"$ac_try\"") >&5
6143   (eval $ac_try) 2>&5
6144   ac_status=$?
6145   echo "$as_me:6145: \$? = $ac_status" >&5
6146   (exit $ac_status); }; }; then
6147   cf_result=no
6148 else
6149   echo "$as_me: failed program was:" >&5
6150 cat conftest.$ac_ext >&5
6151
6152                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6153                         cat >conftest.$ac_ext <<_ACEOF
6154 #line 6154 "configure"
6155 #include "confdefs.h"
6156 #include <${cf_cv_ncurses_header:-curses.h}>
6157 int
6158 main (void)
6159 {
6160 initscr()
6161   ;
6162   return 0;
6163 }
6164 _ACEOF
6165 rm -f conftest.$ac_objext conftest$ac_exeext
6166 if { (eval echo "$as_me:6166: \"$ac_link\"") >&5
6167   (eval $ac_link) 2>&5
6168   ac_status=$?
6169   echo "$as_me:6169: \$? = $ac_status" >&5
6170   (exit $ac_status); } &&
6171          { ac_try='test -s conftest$ac_exeext'
6172   { (eval echo "$as_me:6172: \"$ac_try\"") >&5
6173   (eval $ac_try) 2>&5
6174   ac_status=$?
6175   echo "$as_me:6175: \$? = $ac_status" >&5
6176   (exit $ac_status); }; }; then
6177   cf_result=yes
6178 else
6179   echo "$as_me: failed program was:" >&5
6180 cat conftest.$ac_ext >&5
6181 cf_result=error
6182 fi
6183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6184
6185 fi
6186 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6187                 echo "$as_me:6187: result: $cf_result" >&5
6188 echo "${ECHO_T}$cf_result" >&6
6189         fi
6190 fi
6191 fi
6192
6193         ;;
6194 (ncursesw*)
6195
6196 echo "$as_me:6196: checking for multibyte character support" >&5
6197 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6198 if test "${cf_cv_utf8_lib+set}" = set; then
6199   echo $ECHO_N "(cached) $ECHO_C" >&6
6200 else
6201
6202         cf_save_LIBS="$LIBS"
6203         cat >conftest.$ac_ext <<_ACEOF
6204 #line 6204 "configure"
6205 #include "confdefs.h"
6206
6207 #include <stdlib.h>
6208 int
6209 main (void)
6210 {
6211 putwc(0,0);
6212   ;
6213   return 0;
6214 }
6215 _ACEOF
6216 rm -f conftest.$ac_objext conftest$ac_exeext
6217 if { (eval echo "$as_me:6217: \"$ac_link\"") >&5
6218   (eval $ac_link) 2>&5
6219   ac_status=$?
6220   echo "$as_me:6220: \$? = $ac_status" >&5
6221   (exit $ac_status); } &&
6222          { ac_try='test -s conftest$ac_exeext'
6223   { (eval echo "$as_me:6223: \"$ac_try\"") >&5
6224   (eval $ac_try) 2>&5
6225   ac_status=$?
6226   echo "$as_me:6226: \$? = $ac_status" >&5
6227   (exit $ac_status); }; }; then
6228   cf_cv_utf8_lib=yes
6229 else
6230   echo "$as_me: failed program was:" >&5
6231 cat conftest.$ac_ext >&5
6232
6233 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6234 # will be set on completion of the AC_TRY_LINK below.
6235 cf_cv_header_path_utf8=
6236 cf_cv_library_path_utf8=
6237
6238 echo "${as_me:-configure}:6238: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6239
6240 cf_save_LIBS="$LIBS"
6241
6242 cat >conftest.$ac_ext <<_ACEOF
6243 #line 6243 "configure"
6244 #include "confdefs.h"
6245
6246 #include <libutf8.h>
6247 int
6248 main (void)
6249 {
6250 putwc(0,0);
6251   ;
6252   return 0;
6253 }
6254 _ACEOF
6255 rm -f conftest.$ac_objext conftest$ac_exeext
6256 if { (eval echo "$as_me:6256: \"$ac_link\"") >&5
6257   (eval $ac_link) 2>&5
6258   ac_status=$?
6259   echo "$as_me:6259: \$? = $ac_status" >&5
6260   (exit $ac_status); } &&
6261          { ac_try='test -s conftest$ac_exeext'
6262   { (eval echo "$as_me:6262: \"$ac_try\"") >&5
6263   (eval $ac_try) 2>&5
6264   ac_status=$?
6265   echo "$as_me:6265: \$? = $ac_status" >&5
6266   (exit $ac_status); }; }; then
6267
6268         cf_cv_find_linkage_utf8=yes
6269         cf_cv_header_path_utf8=/usr/include
6270         cf_cv_library_path_utf8=/usr/lib
6271
6272 else
6273   echo "$as_me: failed program was:" >&5
6274 cat conftest.$ac_ext >&5
6275
6276 LIBS="-lutf8  $cf_save_LIBS"
6277
6278 cat >conftest.$ac_ext <<_ACEOF
6279 #line 6279 "configure"
6280 #include "confdefs.h"
6281
6282 #include <libutf8.h>
6283 int
6284 main (void)
6285 {
6286 putwc(0,0);
6287   ;
6288   return 0;
6289 }
6290 _ACEOF
6291 rm -f conftest.$ac_objext conftest$ac_exeext
6292 if { (eval echo "$as_me:6292: \"$ac_link\"") >&5
6293   (eval $ac_link) 2>&5
6294   ac_status=$?
6295   echo "$as_me:6295: \$? = $ac_status" >&5
6296   (exit $ac_status); } &&
6297          { ac_try='test -s conftest$ac_exeext'
6298   { (eval echo "$as_me:6298: \"$ac_try\"") >&5
6299   (eval $ac_try) 2>&5
6300   ac_status=$?
6301   echo "$as_me:6301: \$? = $ac_status" >&5
6302   (exit $ac_status); }; }; then
6303
6304         cf_cv_find_linkage_utf8=yes
6305         cf_cv_header_path_utf8=/usr/include
6306         cf_cv_library_path_utf8=/usr/lib
6307         cf_cv_library_file_utf8="-lutf8"
6308
6309 else
6310   echo "$as_me: failed program was:" >&5
6311 cat conftest.$ac_ext >&5
6312
6313         cf_cv_find_linkage_utf8=no
6314         LIBS="$cf_save_LIBS"
6315
6316         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6317
6318 echo "${as_me:-configure}:6318: testing find linkage for utf8 library ..." 1>&5
6319
6320 echo "${as_me:-configure}:6320: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6321
6322         cf_save_CPPFLAGS="$CPPFLAGS"
6323         cf_test_CPPFLAGS="$CPPFLAGS"
6324
6325 cf_search=
6326
6327 # collect the current set of include-directories from compiler flags
6328 cf_header_path_list=""
6329 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6330         for cf_header_path in $CPPFLAGS $CFLAGS
6331         do
6332                 case $cf_header_path in
6333                 (-I*)
6334                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6335
6336 test "x$cf_header_path" != "xNONE" && \
6337 test -d "$cf_header_path" && \
6338  {
6339         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6340         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6341         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6342         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6343         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6344         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6345 }
6346
6347                         cf_header_path_list="$cf_header_path_list $cf_search"
6348                         ;;
6349                 esac
6350         done
6351 fi
6352
6353 # add the variations for the package we are looking for
6354
6355 cf_search=
6356
6357 test "x$prefix" != "xNONE" && \
6358 test -d "$prefix" && \
6359  {
6360         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6361         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6362         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6363         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6364         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6365         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6366 }
6367
6368 for cf_subdir_prefix in \
6369         /usr \
6370         /usr/local \
6371         /usr/pkg \
6372         /opt \
6373         /opt/local \
6374         $HOME
6375 do
6376
6377 test "x$cf_subdir_prefix" != "x$prefix" && \
6378 test -d "$cf_subdir_prefix" && \
6379 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6380         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6381         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6382         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6383         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6384         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6385         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6386 }
6387
6388 done
6389
6390 test "$includedir" != NONE && \
6391 test "$includedir" != "/usr/include" && \
6392 test -d "$includedir" && {
6393         test -d $includedir &&    cf_search="$cf_search $includedir"
6394         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6395 }
6396
6397 test "$oldincludedir" != NONE && \
6398 test "$oldincludedir" != "/usr/include" && \
6399 test -d "$oldincludedir" && {
6400         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6401         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6402 }
6403
6404 cf_search="$cf_search $cf_header_path_list"
6405
6406         for cf_cv_header_path_utf8 in $cf_search
6407         do
6408                 if test -d $cf_cv_header_path_utf8 ; then
6409                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6410
6411 echo "${as_me:-configure}:6411: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6412
6413                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6414                         cat >conftest.$ac_ext <<_ACEOF
6415 #line 6415 "configure"
6416 #include "confdefs.h"
6417
6418 #include <libutf8.h>
6419 int
6420 main (void)
6421 {
6422 putwc(0,0);
6423   ;
6424   return 0;
6425 }
6426 _ACEOF
6427 rm -f conftest.$ac_objext
6428 if { (eval echo "$as_me:6428: \"$ac_compile\"") >&5
6429   (eval $ac_compile) 2>&5
6430   ac_status=$?
6431   echo "$as_me:6431: \$? = $ac_status" >&5
6432   (exit $ac_status); } &&
6433          { ac_try='test -s conftest.$ac_objext'
6434   { (eval echo "$as_me:6434: \"$ac_try\"") >&5
6435   (eval $ac_try) 2>&5
6436   ac_status=$?
6437   echo "$as_me:6437: \$? = $ac_status" >&5
6438   (exit $ac_status); }; }; then
6439
6440                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6441
6442 echo "${as_me:-configure}:6442: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6443
6444                                 cf_cv_find_linkage_utf8=maybe
6445                                 cf_test_CPPFLAGS="$CPPFLAGS"
6446                                 break
6447 else
6448   echo "$as_me: failed program was:" >&5
6449 cat conftest.$ac_ext >&5
6450
6451                                 CPPFLAGS="$cf_save_CPPFLAGS"
6452
6453 fi
6454 rm -f conftest.$ac_objext conftest.$ac_ext
6455                 fi
6456         done
6457
6458         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6459
6460 echo "${as_me:-configure}:6460: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6461
6462                 cf_save_LIBS="$LIBS"
6463                 cf_save_LDFLAGS="$LDFLAGS"
6464
6465                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6466
6467 cf_search=
6468 cf_library_path_list=""
6469 if test -n "${LDFLAGS}${LIBS}" ; then
6470         for cf_library_path in $LDFLAGS $LIBS
6471         do
6472                 case $cf_library_path in
6473                 (-L*)
6474                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6475
6476 test "x$cf_library_path" != "xNONE" && \
6477 test -d "$cf_library_path" && \
6478  {
6479         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6480         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6481         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6482         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6483         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6484         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6485 }
6486
6487                         cf_library_path_list="$cf_library_path_list $cf_search"
6488                         ;;
6489                 esac
6490         done
6491 fi
6492
6493 cf_search=
6494
6495 test "x$prefix" != "xNONE" && \
6496 test -d "$prefix" && \
6497  {
6498         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6499         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6500         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6501         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6502         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6503         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6504 }
6505
6506 for cf_subdir_prefix in \
6507         /usr \
6508         /usr/local \
6509         /usr/pkg \
6510         /opt \
6511         /opt/local \
6512         $HOME
6513 do
6514
6515 test "x$cf_subdir_prefix" != "x$prefix" && \
6516 test -d "$cf_subdir_prefix" && \
6517 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6518         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6519         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6520         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6521         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6522         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6523         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6524 }
6525
6526 done
6527
6528 cf_search="$cf_library_path_list $cf_search"
6529
6530                         for cf_cv_library_path_utf8 in $cf_search
6531                         do
6532                                 if test -d $cf_cv_library_path_utf8 ; then
6533                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6534
6535 echo "${as_me:-configure}:6535: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6536
6537                                         CPPFLAGS="$cf_test_CPPFLAGS"
6538                                         LIBS="-lutf8  $cf_save_LIBS"
6539                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6540                                         cat >conftest.$ac_ext <<_ACEOF
6541 #line 6541 "configure"
6542 #include "confdefs.h"
6543
6544 #include <libutf8.h>
6545 int
6546 main (void)
6547 {
6548 putwc(0,0);
6549   ;
6550   return 0;
6551 }
6552 _ACEOF
6553 rm -f conftest.$ac_objext conftest$ac_exeext
6554 if { (eval echo "$as_me:6554: \"$ac_link\"") >&5
6555   (eval $ac_link) 2>&5
6556   ac_status=$?
6557   echo "$as_me:6557: \$? = $ac_status" >&5
6558   (exit $ac_status); } &&
6559          { ac_try='test -s conftest$ac_exeext'
6560   { (eval echo "$as_me:6560: \"$ac_try\"") >&5
6561   (eval $ac_try) 2>&5
6562   ac_status=$?
6563   echo "$as_me:6563: \$? = $ac_status" >&5
6564   (exit $ac_status); }; }; then
6565
6566                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6567
6568 echo "${as_me:-configure}:6568: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6569
6570                                         cf_cv_find_linkage_utf8=yes
6571                                         cf_cv_library_file_utf8="-lutf8"
6572                                         break
6573 else
6574   echo "$as_me: failed program was:" >&5
6575 cat conftest.$ac_ext >&5
6576
6577                                         CPPFLAGS="$cf_save_CPPFLAGS"
6578                                         LIBS="$cf_save_LIBS"
6579                                         LDFLAGS="$cf_save_LDFLAGS"
6580
6581 fi
6582 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6583                                 fi
6584                         done
6585                         CPPFLAGS="$cf_save_CPPFLAGS"
6586                         LDFLAGS="$cf_save_LDFLAGS"
6587                 fi
6588
6589         else
6590                 cf_cv_find_linkage_utf8=no
6591         fi
6592
6593 fi
6594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6595
6596 fi
6597 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6598
6599 LIBS="$cf_save_LIBS"
6600
6601 if test "$cf_cv_find_linkage_utf8" = yes ; then
6602 cf_cv_utf8_lib=add-on
6603 else
6604 cf_cv_utf8_lib=no
6605 fi
6606
6607 fi
6608 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6609 fi
6610 echo "$as_me:6610: result: $cf_cv_utf8_lib" >&5
6611 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6612
6613 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6614 # ncurses/ncursesw:
6615 if test "$cf_cv_utf8_lib" = "add-on" ; then
6616
6617 cat >>confdefs.h <<\EOF
6618 #define HAVE_LIBUTF8_H 1
6619 EOF
6620
6621 if test -n "$cf_cv_header_path_utf8" ; then
6622   for cf_add_incdir in $cf_cv_header_path_utf8
6623   do
6624         while test $cf_add_incdir != /usr/include
6625         do
6626           if test -d $cf_add_incdir
6627           then
6628                 cf_have_incdir=no
6629                 if test -n "$CFLAGS$CPPFLAGS" ; then
6630                   # a loop is needed to ensure we can add subdirs of existing dirs
6631                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6632                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6633                           cf_have_incdir=yes; break
6634                         fi
6635                   done
6636                 fi
6637
6638                 if test "$cf_have_incdir" = no ; then
6639                   if test "$cf_add_incdir" = /usr/local/include ; then
6640                         if test "$GCC" = yes
6641                         then
6642                           cf_save_CPPFLAGS=$CPPFLAGS
6643                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6644                           cat >conftest.$ac_ext <<_ACEOF
6645 #line 6645 "configure"
6646 #include "confdefs.h"
6647 #include <stdio.h>
6648 int
6649 main (void)
6650 {
6651 printf("Hello")
6652   ;
6653   return 0;
6654 }
6655 _ACEOF
6656 rm -f conftest.$ac_objext
6657 if { (eval echo "$as_me:6657: \"$ac_compile\"") >&5
6658   (eval $ac_compile) 2>&5
6659   ac_status=$?
6660   echo "$as_me:6660: \$? = $ac_status" >&5
6661   (exit $ac_status); } &&
6662          { ac_try='test -s conftest.$ac_objext'
6663   { (eval echo "$as_me:6663: \"$ac_try\"") >&5
6664   (eval $ac_try) 2>&5
6665   ac_status=$?
6666   echo "$as_me:6666: \$? = $ac_status" >&5
6667   (exit $ac_status); }; }; then
6668   :
6669 else
6670   echo "$as_me: failed program was:" >&5
6671 cat conftest.$ac_ext >&5
6672 cf_have_incdir=yes
6673 fi
6674 rm -f conftest.$ac_objext conftest.$ac_ext
6675                           CPPFLAGS=$cf_save_CPPFLAGS
6676                         fi
6677                   fi
6678                 fi
6679
6680                 if test "$cf_have_incdir" = no ; then
6681                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6682
6683 echo "${as_me:-configure}:6683: testing adding $cf_add_incdir to include-path ..." 1>&5
6684
6685                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6686
6687                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6688                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6689                   cf_add_incdir="$cf_top_incdir"
6690                 else
6691                   break
6692                 fi
6693           else
6694                 break
6695           fi
6696         done
6697   done
6698 fi
6699
6700 if test -n "$cf_cv_library_path_utf8" ; then
6701         for cf_add_libdir in $cf_cv_library_path_utf8
6702         do
6703                 if test $cf_add_libdir = /usr/lib ; then
6704                         :
6705                 elif test -d $cf_add_libdir
6706                 then
6707                         cf_have_libdir=no
6708                         if test -n "$LDFLAGS$LIBS" ; then
6709                                 # a loop is needed to ensure we can add subdirs of existing dirs
6710                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6711                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6712                                                 cf_have_libdir=yes; break
6713                                         fi
6714                                 done
6715                         fi
6716                         if test "$cf_have_libdir" = no ; then
6717                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6718
6719 echo "${as_me:-configure}:6719: testing adding $cf_add_libdir to library-path ..." 1>&5
6720
6721                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6722                         fi
6723                 fi
6724         done
6725 fi
6726
6727 cf_add_libs="$cf_cv_library_file_utf8"
6728 # Filter out duplicates - this happens with badly-designed ".pc" files...
6729 for cf_add_1lib in $LIBS
6730 do
6731         for cf_add_2lib in $cf_add_libs
6732         do
6733                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6734                 then
6735                         cf_add_1lib=
6736                         break
6737                 fi
6738         done
6739         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6740 done
6741 LIBS="$cf_add_libs"
6742
6743 fi
6744
6745 cf_ncuconfig_root=$cf_cv_screen
6746 cf_have_ncuconfig=no
6747
6748 if test "x${PKG_CONFIG:=none}" != xnone; then
6749         echo "$as_me:6749: checking pkg-config for $cf_ncuconfig_root" >&5
6750 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6751         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6752                 echo "$as_me:6752: result: yes" >&5
6753 echo "${ECHO_T}yes" >&6
6754
6755                 echo "$as_me:6755: checking if the $cf_ncuconfig_root package files work" >&5
6756 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6757                 cf_have_ncuconfig=unknown
6758
6759                 cf_save_CPPFLAGS="$CPPFLAGS"
6760                 cf_save_LIBS="$LIBS"
6761
6762                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6763
6764 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6765 # Filter out duplicates - this happens with badly-designed ".pc" files...
6766 for cf_add_1lib in $LIBS
6767 do
6768         for cf_add_2lib in $cf_add_libs
6769         do
6770                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6771                 then
6772                         cf_add_1lib=
6773                         break
6774                 fi
6775         done
6776         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6777 done
6778 LIBS="$cf_add_libs"
6779
6780                 cat >conftest.$ac_ext <<_ACEOF
6781 #line 6781 "configure"
6782 #include "confdefs.h"
6783 #include <${cf_cv_ncurses_header:-curses.h}>
6784 int
6785 main (void)
6786 {
6787 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6788   ;
6789   return 0;
6790 }
6791 _ACEOF
6792 rm -f conftest.$ac_objext conftest$ac_exeext
6793 if { (eval echo "$as_me:6793: \"$ac_link\"") >&5
6794   (eval $ac_link) 2>&5
6795   ac_status=$?
6796   echo "$as_me:6796: \$? = $ac_status" >&5
6797   (exit $ac_status); } &&
6798          { ac_try='test -s conftest$ac_exeext'
6799   { (eval echo "$as_me:6799: \"$ac_try\"") >&5
6800   (eval $ac_try) 2>&5
6801   ac_status=$?
6802   echo "$as_me:6802: \$? = $ac_status" >&5
6803   (exit $ac_status); }; }; then
6804   if test "$cross_compiling" = yes; then
6805   cf_have_ncuconfig=maybe
6806 else
6807   cat >conftest.$ac_ext <<_ACEOF
6808 #line 6808 "configure"
6809 #include "confdefs.h"
6810 #include <${cf_cv_ncurses_header:-curses.h}>
6811                                 int main(void)
6812                                 { char *xx = curses_version(); return (xx == 0); }
6813 _ACEOF
6814 rm -f conftest$ac_exeext
6815 if { (eval echo "$as_me:6815: \"$ac_link\"") >&5
6816   (eval $ac_link) 2>&5
6817   ac_status=$?
6818   echo "$as_me:6818: \$? = $ac_status" >&5
6819   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6820   { (eval echo "$as_me:6820: \"$ac_try\"") >&5
6821   (eval $ac_try) 2>&5
6822   ac_status=$?
6823   echo "$as_me:6823: \$? = $ac_status" >&5
6824   (exit $ac_status); }; }; then
6825   cf_have_ncuconfig=yes
6826 else
6827   echo "$as_me: program exited with status $ac_status" >&5
6828 echo "$as_me: failed program was:" >&5
6829 cat conftest.$ac_ext >&5
6830 cf_have_ncuconfig=no
6831 fi
6832 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6833 fi
6834 else
6835   echo "$as_me: failed program was:" >&5
6836 cat conftest.$ac_ext >&5
6837 cf_have_ncuconfig=no
6838 fi
6839 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6840                 echo "$as_me:6840: result: $cf_have_ncuconfig" >&5
6841 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6842                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6843                 if test "$cf_have_ncuconfig" != "yes"
6844                 then
6845                         CPPFLAGS="$cf_save_CPPFLAGS"
6846                         LIBS="$cf_save_LIBS"
6847                         NCURSES_CONFIG_PKG=none
6848                 else
6849
6850 cat >>confdefs.h <<\EOF
6851 #define NCURSES 1
6852 EOF
6853
6854                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6855                 fi
6856
6857 echo "$as_me:6857: checking for terminfo header" >&5
6858 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6859 if test "${cf_cv_term_header+set}" = set; then
6860   echo $ECHO_N "(cached) $ECHO_C" >&6
6861 else
6862
6863 case ${cf_cv_ncurses_header} in
6864 (*/ncurses.h|*/ncursesw.h)
6865         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6866         ;;
6867 (*)
6868         cf_term_header=term.h
6869         ;;
6870 esac
6871
6872 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6873 do
6874 cat >conftest.$ac_ext <<_ACEOF
6875 #line 6875 "configure"
6876 #include "confdefs.h"
6877 #include <stdio.h>
6878 #include <${cf_cv_ncurses_header:-curses.h}>
6879 #include <$cf_test>
6880
6881 int
6882 main (void)
6883 {
6884 int x = auto_left_margin
6885   ;
6886   return 0;
6887 }
6888 _ACEOF
6889 rm -f conftest.$ac_objext
6890 if { (eval echo "$as_me:6890: \"$ac_compile\"") >&5
6891   (eval $ac_compile) 2>&5
6892   ac_status=$?
6893   echo "$as_me:6893: \$? = $ac_status" >&5
6894   (exit $ac_status); } &&
6895          { ac_try='test -s conftest.$ac_objext'
6896   { (eval echo "$as_me:6896: \"$ac_try\"") >&5
6897   (eval $ac_try) 2>&5
6898   ac_status=$?
6899   echo "$as_me:6899: \$? = $ac_status" >&5
6900   (exit $ac_status); }; }; then
6901
6902         cf_cv_term_header="$cf_test"
6903 else
6904   echo "$as_me: failed program was:" >&5
6905 cat conftest.$ac_ext >&5
6906
6907         cf_cv_term_header=unknown
6908
6909 fi
6910 rm -f conftest.$ac_objext conftest.$ac_ext
6911         test "$cf_cv_term_header" != unknown && break
6912 done
6913
6914 fi
6915 echo "$as_me:6915: result: $cf_cv_term_header" >&5
6916 echo "${ECHO_T}$cf_cv_term_header" >&6
6917
6918 # Set definitions to allow ifdef'ing to accommodate subdirectories
6919
6920 case $cf_cv_term_header in
6921 (*term.h)
6922
6923 cat >>confdefs.h <<\EOF
6924 #define HAVE_TERM_H 1
6925 EOF
6926
6927         ;;
6928 esac
6929
6930 case $cf_cv_term_header in
6931 (ncurses/term.h)
6932
6933 cat >>confdefs.h <<\EOF
6934 #define HAVE_NCURSES_TERM_H 1
6935 EOF
6936
6937         ;;
6938 (ncursesw/term.h)
6939
6940 cat >>confdefs.h <<\EOF
6941 #define HAVE_NCURSESW_TERM_H 1
6942 EOF
6943
6944         ;;
6945 esac
6946
6947         else
6948                 echo "$as_me:6948: result: no" >&5
6949 echo "${ECHO_T}no" >&6
6950                 NCURSES_CONFIG_PKG=none
6951         fi
6952 else
6953         NCURSES_CONFIG_PKG=none
6954 fi
6955
6956 if test "x$cf_have_ncuconfig" = "xno"; then
6957         echo "Looking for ${cf_ncuconfig_root}-config"
6958
6959 if test -n "$ac_tool_prefix"; then
6960   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6961   do
6962     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6963 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6964 echo "$as_me:6964: checking for $ac_word" >&5
6965 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6966 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6967   echo $ECHO_N "(cached) $ECHO_C" >&6
6968 else
6969   if test -n "$NCURSES_CONFIG"; then
6970   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6971 else
6972   ac_save_IFS=$IFS; IFS=$ac_path_separator
6973 ac_dummy="$PATH"
6974 for ac_dir in $ac_dummy; do
6975   IFS=$ac_save_IFS
6976   test -z "$ac_dir" && ac_dir=.
6977   $as_executable_p "$ac_dir/$ac_word" || continue
6978 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6979 echo "$as_me:6979: found $ac_dir/$ac_word" >&5
6980 break
6981 done
6982
6983 fi
6984 fi
6985 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6986 if test -n "$NCURSES_CONFIG"; then
6987   echo "$as_me:6987: result: $NCURSES_CONFIG" >&5
6988 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6989 else
6990   echo "$as_me:6990: result: no" >&5
6991 echo "${ECHO_T}no" >&6
6992 fi
6993
6994     test -n "$NCURSES_CONFIG" && break
6995   done
6996 fi
6997 if test -z "$NCURSES_CONFIG"; then
6998   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6999   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7000 do
7001   # Extract the first word of "$ac_prog", so it can be a program name with args.
7002 set dummy $ac_prog; ac_word=$2
7003 echo "$as_me:7003: checking for $ac_word" >&5
7004 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7005 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7006   echo $ECHO_N "(cached) $ECHO_C" >&6
7007 else
7008   if test -n "$ac_ct_NCURSES_CONFIG"; then
7009   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7010 else
7011   ac_save_IFS=$IFS; IFS=$ac_path_separator
7012 ac_dummy="$PATH"
7013 for ac_dir in $ac_dummy; do
7014   IFS=$ac_save_IFS
7015   test -z "$ac_dir" && ac_dir=.
7016   $as_executable_p "$ac_dir/$ac_word" || continue
7017 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7018 echo "$as_me:7018: found $ac_dir/$ac_word" >&5
7019 break
7020 done
7021
7022 fi
7023 fi
7024 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7025 if test -n "$ac_ct_NCURSES_CONFIG"; then
7026   echo "$as_me:7026: result: $ac_ct_NCURSES_CONFIG" >&5
7027 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7028 else
7029   echo "$as_me:7029: result: no" >&5
7030 echo "${ECHO_T}no" >&6
7031 fi
7032
7033   test -n "$ac_ct_NCURSES_CONFIG" && break
7034 done
7035 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7036
7037   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7038 fi
7039
7040         if test "$NCURSES_CONFIG" != none ; then
7041
7042                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7043
7044 cf_add_libs="`$NCURSES_CONFIG --libs`"
7045 # Filter out duplicates - this happens with badly-designed ".pc" files...
7046 for cf_add_1lib in $LIBS
7047 do
7048         for cf_add_2lib in $cf_add_libs
7049         do
7050                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7051                 then
7052                         cf_add_1lib=
7053                         break
7054                 fi
7055         done
7056         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7057 done
7058 LIBS="$cf_add_libs"
7059
7060                 # even with config script, some packages use no-override for curses.h
7061
7062 echo "$as_me:7062: checking if we have identified curses headers" >&5
7063 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7064 if test "${cf_cv_ncurses_header+set}" = set; then
7065   echo $ECHO_N "(cached) $ECHO_C" >&6
7066 else
7067
7068 cf_cv_ncurses_header=none
7069 for cf_header in \
7070         ncurses.h $cf_cv_screen/ncurses.h \
7071         curses.h $cf_cv_screen/curses.h
7072 do
7073 cat >conftest.$ac_ext <<_ACEOF
7074 #line 7074 "configure"
7075 #include "confdefs.h"
7076 #include <${cf_header}>
7077 int
7078 main (void)
7079 {
7080 initscr(); tgoto("?", 0,0)
7081   ;
7082   return 0;
7083 }
7084 _ACEOF
7085 rm -f conftest.$ac_objext
7086 if { (eval echo "$as_me:7086: \"$ac_compile\"") >&5
7087   (eval $ac_compile) 2>&5
7088   ac_status=$?
7089   echo "$as_me:7089: \$? = $ac_status" >&5
7090   (exit $ac_status); } &&
7091          { ac_try='test -s conftest.$ac_objext'
7092   { (eval echo "$as_me:7092: \"$ac_try\"") >&5
7093   (eval $ac_try) 2>&5
7094   ac_status=$?
7095   echo "$as_me:7095: \$? = $ac_status" >&5
7096   (exit $ac_status); }; }; then
7097   cf_cv_ncurses_header=$cf_header; break
7098 else
7099   echo "$as_me: failed program was:" >&5
7100 cat conftest.$ac_ext >&5
7101 fi
7102 rm -f conftest.$ac_objext conftest.$ac_ext
7103 done
7104
7105 fi
7106 echo "$as_me:7106: result: $cf_cv_ncurses_header" >&5
7107 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7108
7109 if test "$cf_cv_ncurses_header" = none ; then
7110         { { echo "$as_me:7110: error: No curses header-files found" >&5
7111 echo "$as_me: error: No curses header-files found" >&2;}
7112    { (exit 1); exit 1; }; }
7113 fi
7114
7115 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7116
7117 for ac_header in $cf_cv_ncurses_header
7118 do
7119 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7120 echo "$as_me:7120: checking for $ac_header" >&5
7121 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7122 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7123   echo $ECHO_N "(cached) $ECHO_C" >&6
7124 else
7125   cat >conftest.$ac_ext <<_ACEOF
7126 #line 7126 "configure"
7127 #include "confdefs.h"
7128 #include <$ac_header>
7129 _ACEOF
7130 if { (eval echo "$as_me:7130: \"$ac_cpp conftest.$ac_ext\"") >&5
7131   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7132   ac_status=$?
7133   egrep -v '^ *\+' conftest.er1 >conftest.err
7134   rm -f conftest.er1
7135   cat conftest.err >&5
7136   echo "$as_me:7136: \$? = $ac_status" >&5
7137   (exit $ac_status); } >/dev/null; then
7138   if test -s conftest.err; then
7139     ac_cpp_err=$ac_c_preproc_warn_flag
7140   else
7141     ac_cpp_err=
7142   fi
7143 else
7144   ac_cpp_err=yes
7145 fi
7146 if test -z "$ac_cpp_err"; then
7147   eval "$as_ac_Header=yes"
7148 else
7149   echo "$as_me: failed program was:" >&5
7150   cat conftest.$ac_ext >&5
7151   eval "$as_ac_Header=no"
7152 fi
7153 rm -f conftest.err conftest.$ac_ext
7154 fi
7155 echo "$as_me:7155: result: `eval echo '${'$as_ac_Header'}'`" >&5
7156 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7157 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7158   cat >>confdefs.h <<EOF
7159 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7160 EOF
7161
7162 fi
7163 done
7164
7165 cat >>confdefs.h <<\EOF
7166 #define NCURSES 1
7167 EOF
7168
7169 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7170
7171                 cat >>confdefs.h <<EOF
7172 #define $cf_nculib_ROOT 1
7173 EOF
7174
7175                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7176
7177         else
7178
7179 cf_ncuhdr_root=$cf_cv_screen
7180
7181 test -n "$cf_cv_curses_dir" && \
7182 test "$cf_cv_curses_dir" != "no" && { \
7183
7184 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7185   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7186   do
7187         while test $cf_add_incdir != /usr/include
7188         do
7189           if test -d $cf_add_incdir
7190           then
7191                 cf_have_incdir=no
7192                 if test -n "$CFLAGS$CPPFLAGS" ; then
7193                   # a loop is needed to ensure we can add subdirs of existing dirs
7194                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7195                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7196                           cf_have_incdir=yes; break
7197                         fi
7198                   done
7199                 fi
7200
7201                 if test "$cf_have_incdir" = no ; then
7202                   if test "$cf_add_incdir" = /usr/local/include ; then
7203                         if test "$GCC" = yes
7204                         then
7205                           cf_save_CPPFLAGS=$CPPFLAGS
7206                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7207                           cat >conftest.$ac_ext <<_ACEOF
7208 #line 7208 "configure"
7209 #include "confdefs.h"
7210 #include <stdio.h>
7211 int
7212 main (void)
7213 {
7214 printf("Hello")
7215   ;
7216   return 0;
7217 }
7218 _ACEOF
7219 rm -f conftest.$ac_objext
7220 if { (eval echo "$as_me:7220: \"$ac_compile\"") >&5
7221   (eval $ac_compile) 2>&5
7222   ac_status=$?
7223   echo "$as_me:7223: \$? = $ac_status" >&5
7224   (exit $ac_status); } &&
7225          { ac_try='test -s conftest.$ac_objext'
7226   { (eval echo "$as_me:7226: \"$ac_try\"") >&5
7227   (eval $ac_try) 2>&5
7228   ac_status=$?
7229   echo "$as_me:7229: \$? = $ac_status" >&5
7230   (exit $ac_status); }; }; then
7231   :
7232 else
7233   echo "$as_me: failed program was:" >&5
7234 cat conftest.$ac_ext >&5
7235 cf_have_incdir=yes
7236 fi
7237 rm -f conftest.$ac_objext conftest.$ac_ext
7238                           CPPFLAGS=$cf_save_CPPFLAGS
7239                         fi
7240                   fi
7241                 fi
7242
7243                 if test "$cf_have_incdir" = no ; then
7244                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7245
7246 echo "${as_me:-configure}:7246: testing adding $cf_add_incdir to include-path ..." 1>&5
7247
7248                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7249
7250                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7251                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7252                   cf_add_incdir="$cf_top_incdir"
7253                 else
7254                   break
7255                 fi
7256           else
7257                 break
7258           fi
7259         done
7260   done
7261 fi
7262
7263 }
7264
7265 echo "$as_me:7265: checking for $cf_ncuhdr_root header in include-path" >&5
7266 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7267 if test "${cf_cv_ncurses_h+set}" = set; then
7268   echo $ECHO_N "(cached) $ECHO_C" >&6
7269 else
7270
7271         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7272         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7273         for cf_header in $cf_header_list
7274         do
7275
7276         cat >conftest.$ac_ext <<_ACEOF
7277 #line 7277 "configure"
7278 #include "confdefs.h"
7279
7280 #include <$cf_header>
7281 int
7282 main (void)
7283 {
7284
7285 #ifdef NCURSES_VERSION
7286
7287 printf("%s\n", NCURSES_VERSION);
7288 #else
7289 #ifdef __NCURSES_H
7290 printf("old\n");
7291 #else
7292         make an error
7293 #endif
7294 #endif
7295
7296   ;
7297   return 0;
7298 }
7299 _ACEOF
7300 rm -f conftest.$ac_objext
7301 if { (eval echo "$as_me:7301: \"$ac_compile\"") >&5
7302   (eval $ac_compile) 2>&5
7303   ac_status=$?
7304   echo "$as_me:7304: \$? = $ac_status" >&5
7305   (exit $ac_status); } &&
7306          { ac_try='test -s conftest.$ac_objext'
7307   { (eval echo "$as_me:7307: \"$ac_try\"") >&5
7308   (eval $ac_try) 2>&5
7309   ac_status=$?
7310   echo "$as_me:7310: \$? = $ac_status" >&5
7311   (exit $ac_status); }; }; then
7312   cf_cv_ncurses_h=$cf_header
7313
7314 else
7315   echo "$as_me: failed program was:" >&5
7316 cat conftest.$ac_ext >&5
7317 cf_cv_ncurses_h=no
7318 fi
7319 rm -f conftest.$ac_objext conftest.$ac_ext
7320
7321                 test "$cf_cv_ncurses_h" != no && break
7322         done
7323
7324 fi
7325 echo "$as_me:7325: result: $cf_cv_ncurses_h" >&5
7326 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7327
7328 if test "$cf_cv_ncurses_h" != no ; then
7329         cf_cv_ncurses_header=$cf_cv_ncurses_h
7330 else
7331
7332 echo "$as_me:7332: checking for $cf_ncuhdr_root include-path" >&5
7333 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7334 if test "${cf_cv_ncurses_h2+set}" = set; then
7335   echo $ECHO_N "(cached) $ECHO_C" >&6
7336 else
7337
7338         test -n "$verbose" && echo
7339
7340 cf_search=
7341
7342 # collect the current set of include-directories from compiler flags
7343 cf_header_path_list=""
7344 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7345         for cf_header_path in $CPPFLAGS $CFLAGS
7346         do
7347                 case $cf_header_path in
7348                 (-I*)
7349                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7350
7351 test "x$cf_header_path" != "xNONE" && \
7352 test -d "$cf_header_path" && \
7353  {
7354         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7355         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7356         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7357         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7358         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7359         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"
7360 }
7361
7362                         cf_header_path_list="$cf_header_path_list $cf_search"
7363                         ;;
7364                 esac
7365         done
7366 fi
7367
7368 # add the variations for the package we are looking for
7369
7370 cf_search=
7371
7372 test "x$prefix" != "xNONE" && \
7373 test -d "$prefix" && \
7374  {
7375         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7376         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7377         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7378         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7379         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7380         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7381 }
7382
7383 for cf_subdir_prefix in \
7384         /usr \
7385         /usr/local \
7386         /usr/pkg \
7387         /opt \
7388         /opt/local \
7389         $HOME
7390 do
7391
7392 test "x$cf_subdir_prefix" != "x$prefix" && \
7393 test -d "$cf_subdir_prefix" && \
7394 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7395         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7396         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7397         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7398         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7399         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7400         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"
7401 }
7402
7403 done
7404
7405 test "$includedir" != NONE && \
7406 test "$includedir" != "/usr/include" && \
7407 test -d "$includedir" && {
7408         test -d $includedir &&    cf_search="$cf_search $includedir"
7409         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7410 }
7411
7412 test "$oldincludedir" != NONE && \
7413 test "$oldincludedir" != "/usr/include" && \
7414 test -d "$oldincludedir" && {
7415         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7416         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7417 }
7418
7419 cf_search="$cf_search $cf_header_path_list"
7420
7421         test -n "$verbose" && echo search path $cf_search
7422         cf_save2_CPPFLAGS="$CPPFLAGS"
7423         for cf_incdir in $cf_search
7424         do
7425
7426 if test -n "$cf_incdir" ; then
7427   for cf_add_incdir in $cf_incdir
7428   do
7429         while test $cf_add_incdir != /usr/include
7430         do
7431           if test -d $cf_add_incdir
7432           then
7433                 cf_have_incdir=no
7434                 if test -n "$CFLAGS$CPPFLAGS" ; then
7435                   # a loop is needed to ensure we can add subdirs of existing dirs
7436                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7437                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7438                           cf_have_incdir=yes; break
7439                         fi
7440                   done
7441                 fi
7442
7443                 if test "$cf_have_incdir" = no ; then
7444                   if test "$cf_add_incdir" = /usr/local/include ; then
7445                         if test "$GCC" = yes
7446                         then
7447                           cf_save_CPPFLAGS=$CPPFLAGS
7448                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7449                           cat >conftest.$ac_ext <<_ACEOF
7450 #line 7450 "configure"
7451 #include "confdefs.h"
7452 #include <stdio.h>
7453 int
7454 main (void)
7455 {
7456 printf("Hello")
7457   ;
7458   return 0;
7459 }
7460 _ACEOF
7461 rm -f conftest.$ac_objext
7462 if { (eval echo "$as_me:7462: \"$ac_compile\"") >&5
7463   (eval $ac_compile) 2>&5
7464   ac_status=$?
7465   echo "$as_me:7465: \$? = $ac_status" >&5
7466   (exit $ac_status); } &&
7467          { ac_try='test -s conftest.$ac_objext'
7468   { (eval echo "$as_me:7468: \"$ac_try\"") >&5
7469   (eval $ac_try) 2>&5
7470   ac_status=$?
7471   echo "$as_me:7471: \$? = $ac_status" >&5
7472   (exit $ac_status); }; }; then
7473   :
7474 else
7475   echo "$as_me: failed program was:" >&5
7476 cat conftest.$ac_ext >&5
7477 cf_have_incdir=yes
7478 fi
7479 rm -f conftest.$ac_objext conftest.$ac_ext
7480                           CPPFLAGS=$cf_save_CPPFLAGS
7481                         fi
7482                   fi
7483                 fi
7484
7485                 if test "$cf_have_incdir" = no ; then
7486                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7487
7488 echo "${as_me:-configure}:7488: testing adding $cf_add_incdir to include-path ..." 1>&5
7489
7490                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7491
7492                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7493                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7494                   cf_add_incdir="$cf_top_incdir"
7495                 else
7496                   break
7497                 fi
7498           else
7499                 break
7500           fi
7501         done
7502   done
7503 fi
7504
7505                 for cf_header in \
7506                         ncurses.h \
7507                         curses.h
7508                 do
7509
7510         cat >conftest.$ac_ext <<_ACEOF
7511 #line 7511 "configure"
7512 #include "confdefs.h"
7513
7514 #include <$cf_header>
7515 int
7516 main (void)
7517 {
7518
7519 #ifdef NCURSES_VERSION
7520
7521 printf("%s\n", NCURSES_VERSION);
7522 #else
7523 #ifdef __NCURSES_H
7524 printf("old\n");
7525 #else
7526         make an error
7527 #endif
7528 #endif
7529
7530   ;
7531   return 0;
7532 }
7533 _ACEOF
7534 rm -f conftest.$ac_objext
7535 if { (eval echo "$as_me:7535: \"$ac_compile\"") >&5
7536   (eval $ac_compile) 2>&5
7537   ac_status=$?
7538   echo "$as_me:7538: \$? = $ac_status" >&5
7539   (exit $ac_status); } &&
7540          { ac_try='test -s conftest.$ac_objext'
7541   { (eval echo "$as_me:7541: \"$ac_try\"") >&5
7542   (eval $ac_try) 2>&5
7543   ac_status=$?
7544   echo "$as_me:7544: \$? = $ac_status" >&5
7545   (exit $ac_status); }; }; then
7546   cf_cv_ncurses_h2=$cf_header
7547
7548 else
7549   echo "$as_me: failed program was:" >&5
7550 cat conftest.$ac_ext >&5
7551 cf_cv_ncurses_h2=no
7552 fi
7553 rm -f conftest.$ac_objext conftest.$ac_ext
7554
7555                         if test "$cf_cv_ncurses_h2" != no ; then
7556                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7557                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7558                                 break
7559                         fi
7560                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7561                 done
7562                 CPPFLAGS="$cf_save2_CPPFLAGS"
7563                 test "$cf_cv_ncurses_h2" != no && break
7564         done
7565         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7565: error: not found" >&5
7566 echo "$as_me: error: not found" >&2;}
7567    { (exit 1); exit 1; }; }
7568
7569 fi
7570 echo "$as_me:7570: result: $cf_cv_ncurses_h2" >&5
7571 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7572
7573         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7574         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7575         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7576                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7577         fi
7578
7579 if test -n "$cf_1st_incdir" ; then
7580   for cf_add_incdir in $cf_1st_incdir
7581   do
7582         while test $cf_add_incdir != /usr/include
7583         do
7584           if test -d $cf_add_incdir
7585           then
7586                 cf_have_incdir=no
7587                 if test -n "$CFLAGS$CPPFLAGS" ; then
7588                   # a loop is needed to ensure we can add subdirs of existing dirs
7589                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7590                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7591                           cf_have_incdir=yes; break
7592                         fi
7593                   done
7594                 fi
7595
7596                 if test "$cf_have_incdir" = no ; then
7597                   if test "$cf_add_incdir" = /usr/local/include ; then
7598                         if test "$GCC" = yes
7599                         then
7600                           cf_save_CPPFLAGS=$CPPFLAGS
7601                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7602                           cat >conftest.$ac_ext <<_ACEOF
7603 #line 7603 "configure"
7604 #include "confdefs.h"
7605 #include <stdio.h>
7606 int
7607 main (void)
7608 {
7609 printf("Hello")
7610   ;
7611   return 0;
7612 }
7613 _ACEOF
7614 rm -f conftest.$ac_objext
7615 if { (eval echo "$as_me:7615: \"$ac_compile\"") >&5
7616   (eval $ac_compile) 2>&5
7617   ac_status=$?
7618   echo "$as_me:7618: \$? = $ac_status" >&5
7619   (exit $ac_status); } &&
7620          { ac_try='test -s conftest.$ac_objext'
7621   { (eval echo "$as_me:7621: \"$ac_try\"") >&5
7622   (eval $ac_try) 2>&5
7623   ac_status=$?
7624   echo "$as_me:7624: \$? = $ac_status" >&5
7625   (exit $ac_status); }; }; then
7626   :
7627 else
7628   echo "$as_me: failed program was:" >&5
7629 cat conftest.$ac_ext >&5
7630 cf_have_incdir=yes
7631 fi
7632 rm -f conftest.$ac_objext conftest.$ac_ext
7633                           CPPFLAGS=$cf_save_CPPFLAGS
7634                         fi
7635                   fi
7636                 fi
7637
7638                 if test "$cf_have_incdir" = no ; then
7639                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7640
7641 echo "${as_me:-configure}:7641: testing adding $cf_add_incdir to include-path ..." 1>&5
7642
7643                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7644
7645                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7646                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7647                   cf_add_incdir="$cf_top_incdir"
7648                 else
7649                   break
7650                 fi
7651           else
7652                 break
7653           fi
7654         done
7655   done
7656 fi
7657
7658 fi
7659
7660 # Set definitions to allow ifdef'ing for ncurses.h
7661
7662 case $cf_cv_ncurses_header in
7663 (*ncurses.h)
7664
7665 cat >>confdefs.h <<\EOF
7666 #define HAVE_NCURSES_H 1
7667 EOF
7668
7669         ;;
7670 esac
7671
7672 case $cf_cv_ncurses_header in
7673 (ncurses/curses.h|ncurses/ncurses.h)
7674
7675 cat >>confdefs.h <<\EOF
7676 #define HAVE_NCURSES_NCURSES_H 1
7677 EOF
7678
7679         ;;
7680 (ncursesw/curses.h|ncursesw/ncurses.h)
7681
7682 cat >>confdefs.h <<\EOF
7683 #define HAVE_NCURSESW_NCURSES_H 1
7684 EOF
7685
7686         ;;
7687 esac
7688
7689 echo "$as_me:7689: checking for terminfo header" >&5
7690 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7691 if test "${cf_cv_term_header+set}" = set; then
7692   echo $ECHO_N "(cached) $ECHO_C" >&6
7693 else
7694
7695 case ${cf_cv_ncurses_header} in
7696 (*/ncurses.h|*/ncursesw.h)
7697         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7698         ;;
7699 (*)
7700         cf_term_header=term.h
7701         ;;
7702 esac
7703
7704 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7705 do
7706 cat >conftest.$ac_ext <<_ACEOF
7707 #line 7707 "configure"
7708 #include "confdefs.h"
7709 #include <stdio.h>
7710 #include <${cf_cv_ncurses_header:-curses.h}>
7711 #include <$cf_test>
7712
7713 int
7714 main (void)
7715 {
7716 int x = auto_left_margin
7717   ;
7718   return 0;
7719 }
7720 _ACEOF
7721 rm -f conftest.$ac_objext
7722 if { (eval echo "$as_me:7722: \"$ac_compile\"") >&5
7723   (eval $ac_compile) 2>&5
7724   ac_status=$?
7725   echo "$as_me:7725: \$? = $ac_status" >&5
7726   (exit $ac_status); } &&
7727          { ac_try='test -s conftest.$ac_objext'
7728   { (eval echo "$as_me:7728: \"$ac_try\"") >&5
7729   (eval $ac_try) 2>&5
7730   ac_status=$?
7731   echo "$as_me:7731: \$? = $ac_status" >&5
7732   (exit $ac_status); }; }; then
7733
7734         cf_cv_term_header="$cf_test"
7735 else
7736   echo "$as_me: failed program was:" >&5
7737 cat conftest.$ac_ext >&5
7738
7739         cf_cv_term_header=unknown
7740
7741 fi
7742 rm -f conftest.$ac_objext conftest.$ac_ext
7743         test "$cf_cv_term_header" != unknown && break
7744 done
7745
7746 fi
7747 echo "$as_me:7747: result: $cf_cv_term_header" >&5
7748 echo "${ECHO_T}$cf_cv_term_header" >&6
7749
7750 # Set definitions to allow ifdef'ing to accommodate subdirectories
7751
7752 case $cf_cv_term_header in
7753 (*term.h)
7754
7755 cat >>confdefs.h <<\EOF
7756 #define HAVE_TERM_H 1
7757 EOF
7758
7759         ;;
7760 esac
7761
7762 case $cf_cv_term_header in
7763 (ncurses/term.h)
7764
7765 cat >>confdefs.h <<\EOF
7766 #define HAVE_NCURSES_TERM_H 1
7767 EOF
7768
7769         ;;
7770 (ncursesw/term.h)
7771
7772 cat >>confdefs.h <<\EOF
7773 #define HAVE_NCURSESW_TERM_H 1
7774 EOF
7775
7776         ;;
7777 esac
7778
7779 # some applications need this, but should check for NCURSES_VERSION
7780
7781 cat >>confdefs.h <<\EOF
7782 #define NCURSES 1
7783 EOF
7784
7785 echo "$as_me:7785: checking for ncurses version" >&5
7786 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7787 if test "${cf_cv_ncurses_version+set}" = set; then
7788   echo $ECHO_N "(cached) $ECHO_C" >&6
7789 else
7790
7791         cf_cv_ncurses_version=no
7792         cf_tempfile=out$$
7793         rm -f $cf_tempfile
7794         if test "$cross_compiling" = yes; then
7795
7796         # This will not work if the preprocessor splits the line after the
7797         # Autoconf token.  The 'unproto' program does that.
7798         cat > conftest.$ac_ext <<EOF
7799 #include <${cf_cv_ncurses_header:-curses.h}>
7800 #undef Autoconf
7801 #ifdef NCURSES_VERSION
7802 Autoconf NCURSES_VERSION
7803 #else
7804 #ifdef __NCURSES_H
7805 Autoconf "old"
7806 #endif
7807 ;
7808 #endif
7809 EOF
7810         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7811         { (eval echo "$as_me:7811: \"$cf_try\"") >&5
7812   (eval $cf_try) 2>&5
7813   ac_status=$?
7814   echo "$as_me:7814: \$? = $ac_status" >&5
7815   (exit $ac_status); }
7816         if test -f conftest.out ; then
7817                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7818                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7819                 rm -f conftest.out
7820         fi
7821
7822 else
7823   cat >conftest.$ac_ext <<_ACEOF
7824 #line 7824 "configure"
7825 #include "confdefs.h"
7826
7827 #include <${cf_cv_ncurses_header:-curses.h}>
7828 #include <stdio.h>
7829 int main(void)
7830 {
7831         FILE *fp = fopen("$cf_tempfile", "w");
7832 #ifdef NCURSES_VERSION
7833 # ifdef NCURSES_VERSION_PATCH
7834         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7835 # else
7836         fprintf(fp, "%s\n", NCURSES_VERSION);
7837 # endif
7838 #else
7839 # ifdef __NCURSES_H
7840         fprintf(fp, "old\n");
7841 # else
7842         make an error
7843 # endif
7844 #endif
7845         ${cf_cv_main_return:-return}(0);
7846 }
7847 _ACEOF
7848 rm -f conftest$ac_exeext
7849 if { (eval echo "$as_me:7849: \"$ac_link\"") >&5
7850   (eval $ac_link) 2>&5
7851   ac_status=$?
7852   echo "$as_me:7852: \$? = $ac_status" >&5
7853   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7854   { (eval echo "$as_me:7854: \"$ac_try\"") >&5
7855   (eval $ac_try) 2>&5
7856   ac_status=$?
7857   echo "$as_me:7857: \$? = $ac_status" >&5
7858   (exit $ac_status); }; }; then
7859
7860         cf_cv_ncurses_version=`cat $cf_tempfile`
7861 else
7862   echo "$as_me: program exited with status $ac_status" >&5
7863 echo "$as_me: failed program was:" >&5
7864 cat conftest.$ac_ext >&5
7865 fi
7866 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7867 fi
7868         rm -f $cf_tempfile
7869
7870 fi
7871 echo "$as_me:7871: result: $cf_cv_ncurses_version" >&5
7872 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7873 test "$cf_cv_ncurses_version" = no ||
7874 cat >>confdefs.h <<\EOF
7875 #define NCURSES 1
7876 EOF
7877
7878 cf_nculib_root=$cf_cv_screen
7879         # This works, except for the special case where we find gpm, but
7880         # ncurses is in a nonstandard location via $LIBS, and we really want
7881         # to link gpm.
7882 cf_ncurses_LIBS=""
7883 cf_ncurses_SAVE="$LIBS"
7884 echo "$as_me:7884: checking for Gpm_Open in -lgpm" >&5
7885 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7886 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7887   echo $ECHO_N "(cached) $ECHO_C" >&6
7888 else
7889   ac_check_lib_save_LIBS=$LIBS
7890 LIBS="-lgpm  $LIBS"
7891 cat >conftest.$ac_ext <<_ACEOF
7892 #line 7892 "configure"
7893 #include "confdefs.h"
7894
7895 /* Override any gcc2 internal prototype to avoid an error.  */
7896 #ifdef __cplusplus
7897 extern "C"
7898 #endif
7899 /* We use char because int might match the return type of a gcc2
7900    builtin and then its argument prototype would still apply.  */
7901 char Gpm_Open ();
7902 int
7903 main (void)
7904 {
7905 Gpm_Open ();
7906   ;
7907   return 0;
7908 }
7909 _ACEOF
7910 rm -f conftest.$ac_objext conftest$ac_exeext
7911 if { (eval echo "$as_me:7911: \"$ac_link\"") >&5
7912   (eval $ac_link) 2>&5
7913   ac_status=$?
7914   echo "$as_me:7914: \$? = $ac_status" >&5
7915   (exit $ac_status); } &&
7916          { ac_try='test -s conftest$ac_exeext'
7917   { (eval echo "$as_me:7917: \"$ac_try\"") >&5
7918   (eval $ac_try) 2>&5
7919   ac_status=$?
7920   echo "$as_me:7920: \$? = $ac_status" >&5
7921   (exit $ac_status); }; }; then
7922   ac_cv_lib_gpm_Gpm_Open=yes
7923 else
7924   echo "$as_me: failed program was:" >&5
7925 cat conftest.$ac_ext >&5
7926 ac_cv_lib_gpm_Gpm_Open=no
7927 fi
7928 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7929 LIBS=$ac_check_lib_save_LIBS
7930 fi
7931 echo "$as_me:7931: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7932 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7933 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7934   echo "$as_me:7934: checking for initscr in -lgpm" >&5
7935 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7936 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7937   echo $ECHO_N "(cached) $ECHO_C" >&6
7938 else
7939   ac_check_lib_save_LIBS=$LIBS
7940 LIBS="-lgpm  $LIBS"
7941 cat >conftest.$ac_ext <<_ACEOF
7942 #line 7942 "configure"
7943 #include "confdefs.h"
7944
7945 /* Override any gcc2 internal prototype to avoid an error.  */
7946 #ifdef __cplusplus
7947 extern "C"
7948 #endif
7949 /* We use char because int might match the return type of a gcc2
7950    builtin and then its argument prototype would still apply.  */
7951 char initscr ();
7952 int
7953 main (void)
7954 {
7955 initscr ();
7956   ;
7957   return 0;
7958 }
7959 _ACEOF
7960 rm -f conftest.$ac_objext conftest$ac_exeext
7961 if { (eval echo "$as_me:7961: \"$ac_link\"") >&5
7962   (eval $ac_link) 2>&5
7963   ac_status=$?
7964   echo "$as_me:7964: \$? = $ac_status" >&5
7965   (exit $ac_status); } &&
7966          { ac_try='test -s conftest$ac_exeext'
7967   { (eval echo "$as_me:7967: \"$ac_try\"") >&5
7968   (eval $ac_try) 2>&5
7969   ac_status=$?
7970   echo "$as_me:7970: \$? = $ac_status" >&5
7971   (exit $ac_status); }; }; then
7972   ac_cv_lib_gpm_initscr=yes
7973 else
7974   echo "$as_me: failed program was:" >&5
7975 cat conftest.$ac_ext >&5
7976 ac_cv_lib_gpm_initscr=no
7977 fi
7978 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7979 LIBS=$ac_check_lib_save_LIBS
7980 fi
7981 echo "$as_me:7981: result: $ac_cv_lib_gpm_initscr" >&5
7982 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7983 if test $ac_cv_lib_gpm_initscr = yes; then
7984   LIBS="$cf_ncurses_SAVE"
7985 else
7986   cf_ncurses_LIBS="-lgpm"
7987 fi
7988
7989 fi
7990
7991 case $host_os in
7992 (freebsd*)
7993         # This is only necessary if you are linking against an obsolete
7994         # version of ncurses (but it should do no harm, since it's static).
7995         if test "$cf_nculib_root" = ncurses ; then
7996                 echo "$as_me:7996: checking for tgoto in -lmytinfo" >&5
7997 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7998 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7999   echo $ECHO_N "(cached) $ECHO_C" >&6
8000 else
8001   ac_check_lib_save_LIBS=$LIBS
8002 LIBS="-lmytinfo  $LIBS"
8003 cat >conftest.$ac_ext <<_ACEOF
8004 #line 8004 "configure"
8005 #include "confdefs.h"
8006
8007 /* Override any gcc2 internal prototype to avoid an error.  */
8008 #ifdef __cplusplus
8009 extern "C"
8010 #endif
8011 /* We use char because int might match the return type of a gcc2
8012    builtin and then its argument prototype would still apply.  */
8013 char tgoto ();
8014 int
8015 main (void)
8016 {
8017 tgoto ();
8018   ;
8019   return 0;
8020 }
8021 _ACEOF
8022 rm -f conftest.$ac_objext conftest$ac_exeext
8023 if { (eval echo "$as_me:8023: \"$ac_link\"") >&5
8024   (eval $ac_link) 2>&5
8025   ac_status=$?
8026   echo "$as_me:8026: \$? = $ac_status" >&5
8027   (exit $ac_status); } &&
8028          { ac_try='test -s conftest$ac_exeext'
8029   { (eval echo "$as_me:8029: \"$ac_try\"") >&5
8030   (eval $ac_try) 2>&5
8031   ac_status=$?
8032   echo "$as_me:8032: \$? = $ac_status" >&5
8033   (exit $ac_status); }; }; then
8034   ac_cv_lib_mytinfo_tgoto=yes
8035 else
8036   echo "$as_me: failed program was:" >&5
8037 cat conftest.$ac_ext >&5
8038 ac_cv_lib_mytinfo_tgoto=no
8039 fi
8040 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8041 LIBS=$ac_check_lib_save_LIBS
8042 fi
8043 echo "$as_me:8043: result: $ac_cv_lib_mytinfo_tgoto" >&5
8044 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8045 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8046   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8047 fi
8048
8049         fi
8050         ;;
8051 esac
8052
8053 cf_add_libs="$cf_ncurses_LIBS"
8054 # Filter out duplicates - this happens with badly-designed ".pc" files...
8055 for cf_add_1lib in $LIBS
8056 do
8057         for cf_add_2lib in $cf_add_libs
8058         do
8059                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8060                 then
8061                         cf_add_1lib=
8062                         break
8063                 fi
8064         done
8065         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8066 done
8067 LIBS="$cf_add_libs"
8068
8069 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8070 then
8071
8072 cf_add_libs="-l$cf_nculib_root"
8073 # Filter out duplicates - this happens with badly-designed ".pc" files...
8074 for cf_add_1lib in $LIBS
8075 do
8076         for cf_add_2lib in $cf_add_libs
8077         do
8078                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8079                 then
8080                         cf_add_1lib=
8081                         break
8082                 fi
8083         done
8084         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8085 done
8086 LIBS="$cf_add_libs"
8087
8088 else
8089
8090         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8091         cf_libdir=""
8092         echo "$as_me:8092: checking for initscr" >&5
8093 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8094 if test "${ac_cv_func_initscr+set}" = set; then
8095   echo $ECHO_N "(cached) $ECHO_C" >&6
8096 else
8097   cat >conftest.$ac_ext <<_ACEOF
8098 #line 8098 "configure"
8099 #include "confdefs.h"
8100 /* System header to define __stub macros and hopefully few prototypes,
8101     which can conflict with char initscr (); below.  */
8102 #include <assert.h>
8103 /* Override any gcc2 internal prototype to avoid an error.  */
8104 #ifdef __cplusplus
8105 extern "C"
8106 #endif
8107 /* We use char because int might match the return type of a gcc2
8108    builtin and then its argument prototype would still apply.  */
8109 char initscr ();
8110 char (*f) ();
8111
8112 int
8113 main (void)
8114 {
8115 /* The GNU C library defines this for functions which it implements
8116     to always fail with ENOSYS.  Some functions are actually named
8117     something starting with __ and the normal name is an alias.  */
8118 #if defined (__stub_initscr) || defined (__stub___initscr)
8119 choke me
8120 #else
8121 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8122 #endif
8123
8124   ;
8125   return 0;
8126 }
8127 _ACEOF
8128 rm -f conftest.$ac_objext conftest$ac_exeext
8129 if { (eval echo "$as_me:8129: \"$ac_link\"") >&5
8130   (eval $ac_link) 2>&5
8131   ac_status=$?
8132   echo "$as_me:8132: \$? = $ac_status" >&5
8133   (exit $ac_status); } &&
8134          { ac_try='test -s conftest$ac_exeext'
8135   { (eval echo "$as_me:8135: \"$ac_try\"") >&5
8136   (eval $ac_try) 2>&5
8137   ac_status=$?
8138   echo "$as_me:8138: \$? = $ac_status" >&5
8139   (exit $ac_status); }; }; then
8140   ac_cv_func_initscr=yes
8141 else
8142   echo "$as_me: failed program was:" >&5
8143 cat conftest.$ac_ext >&5
8144 ac_cv_func_initscr=no
8145 fi
8146 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8147 fi
8148 echo "$as_me:8148: result: $ac_cv_func_initscr" >&5
8149 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8150 if test $ac_cv_func_initscr = yes; then
8151   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8152 else
8153
8154                 cf_save_LIBS="$LIBS"
8155                 echo "$as_me:8155: checking for initscr in -l$cf_nculib_root" >&5
8156 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8157                 LIBS="-l$cf_nculib_root $LIBS"
8158                 cat >conftest.$ac_ext <<_ACEOF
8159 #line 8159 "configure"
8160 #include "confdefs.h"
8161 #include <${cf_cv_ncurses_header:-curses.h}>
8162 int
8163 main (void)
8164 {
8165 initscr()
8166   ;
8167   return 0;
8168 }
8169 _ACEOF
8170 rm -f conftest.$ac_objext conftest$ac_exeext
8171 if { (eval echo "$as_me:8171: \"$ac_link\"") >&5
8172   (eval $ac_link) 2>&5
8173   ac_status=$?
8174   echo "$as_me:8174: \$? = $ac_status" >&5
8175   (exit $ac_status); } &&
8176          { ac_try='test -s conftest$ac_exeext'
8177   { (eval echo "$as_me:8177: \"$ac_try\"") >&5
8178   (eval $ac_try) 2>&5
8179   ac_status=$?
8180   echo "$as_me:8180: \$? = $ac_status" >&5
8181   (exit $ac_status); }; }; then
8182   echo "$as_me:8182: result: yes" >&5
8183 echo "${ECHO_T}yes" >&6
8184                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8185
8186 else
8187   echo "$as_me: failed program was:" >&5
8188 cat conftest.$ac_ext >&5
8189 echo "$as_me:8189: result: no" >&5
8190 echo "${ECHO_T}no" >&6
8191
8192 cf_search=
8193 cf_library_path_list=""
8194 if test -n "${LDFLAGS}${LIBS}" ; then
8195         for cf_library_path in $LDFLAGS $LIBS
8196         do
8197                 case $cf_library_path in
8198                 (-L*)
8199                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8200
8201 test "x$cf_library_path" != "xNONE" && \
8202 test -d "$cf_library_path" && \
8203  {
8204         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8205         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8206         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8207         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8208         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8209         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"
8210 }
8211
8212                         cf_library_path_list="$cf_library_path_list $cf_search"
8213                         ;;
8214                 esac
8215         done
8216 fi
8217
8218 cf_search=
8219
8220 test "x$prefix" != "xNONE" && \
8221 test -d "$prefix" && \
8222  {
8223         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8224         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8225         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8226         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8227         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8228         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8229 }
8230
8231 for cf_subdir_prefix in \
8232         /usr \
8233         /usr/local \
8234         /usr/pkg \
8235         /opt \
8236         /opt/local \
8237         $HOME
8238 do
8239
8240 test "x$cf_subdir_prefix" != "x$prefix" && \
8241 test -d "$cf_subdir_prefix" && \
8242 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8243         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8244         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8245         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8246         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8247         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8248         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"
8249 }
8250
8251 done
8252
8253 cf_search="$cf_library_path_list $cf_search"
8254
8255                         for cf_libdir in $cf_search
8256                         do
8257                                 echo "$as_me:8257: checking for -l$cf_nculib_root in $cf_libdir" >&5
8258 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8259                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8260                                 cat >conftest.$ac_ext <<_ACEOF
8261 #line 8261 "configure"
8262 #include "confdefs.h"
8263 #include <${cf_cv_ncurses_header:-curses.h}>
8264 int
8265 main (void)
8266 {
8267 initscr()
8268   ;
8269   return 0;
8270 }
8271 _ACEOF
8272 rm -f conftest.$ac_objext conftest$ac_exeext
8273 if { (eval echo "$as_me:8273: \"$ac_link\"") >&5
8274   (eval $ac_link) 2>&5
8275   ac_status=$?
8276   echo "$as_me:8276: \$? = $ac_status" >&5
8277   (exit $ac_status); } &&
8278          { ac_try='test -s conftest$ac_exeext'
8279   { (eval echo "$as_me:8279: \"$ac_try\"") >&5
8280   (eval $ac_try) 2>&5
8281   ac_status=$?
8282   echo "$as_me:8282: \$? = $ac_status" >&5
8283   (exit $ac_status); }; }; then
8284   echo "$as_me:8284: result: yes" >&5
8285 echo "${ECHO_T}yes" >&6
8286                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8287                                          break
8288 else
8289   echo "$as_me: failed program was:" >&5
8290 cat conftest.$ac_ext >&5
8291 echo "$as_me:8291: result: no" >&5
8292 echo "${ECHO_T}no" >&6
8293                                          LIBS="$cf_save_LIBS"
8294 fi
8295 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8296                         done
8297
8298 fi
8299 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8300
8301 fi
8302
8303 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8304
8305 if test $cf_found_library = no ; then
8306         { { echo "$as_me:8306: error: Cannot link $cf_nculib_root library" >&5
8307 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8308    { (exit 1); exit 1; }; }
8309 fi
8310
8311 fi
8312
8313 if test -n "$cf_ncurses_LIBS" ; then
8314         echo "$as_me:8314: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8315 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8316         cf_ncurses_SAVE="$LIBS"
8317         for p in $cf_ncurses_LIBS ; do
8318                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8319                 if test "$q" != "$LIBS" ; then
8320                         LIBS="$q"
8321                 fi
8322         done
8323         cat >conftest.$ac_ext <<_ACEOF
8324 #line 8324 "configure"
8325 #include "confdefs.h"
8326 #include <${cf_cv_ncurses_header:-curses.h}>
8327 int
8328 main (void)
8329 {
8330 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8331   ;
8332   return 0;
8333 }
8334 _ACEOF
8335 rm -f conftest.$ac_objext conftest$ac_exeext
8336 if { (eval echo "$as_me:8336: \"$ac_link\"") >&5
8337   (eval $ac_link) 2>&5
8338   ac_status=$?
8339   echo "$as_me:8339: \$? = $ac_status" >&5
8340   (exit $ac_status); } &&
8341          { ac_try='test -s conftest$ac_exeext'
8342   { (eval echo "$as_me:8342: \"$ac_try\"") >&5
8343   (eval $ac_try) 2>&5
8344   ac_status=$?
8345   echo "$as_me:8345: \$? = $ac_status" >&5
8346   (exit $ac_status); }; }; then
8347   echo "$as_me:8347: result: yes" >&5
8348 echo "${ECHO_T}yes" >&6
8349 else
8350   echo "$as_me: failed program was:" >&5
8351 cat conftest.$ac_ext >&5
8352 echo "$as_me:8352: result: no" >&5
8353 echo "${ECHO_T}no" >&6
8354                  LIBS="$cf_ncurses_SAVE"
8355 fi
8356 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8357 fi
8358
8359 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8360
8361 cat >>confdefs.h <<EOF
8362 #define $cf_nculib_ROOT 1
8363 EOF
8364
8365         fi
8366 else
8367         NCURSES_CONFIG=none
8368 fi
8369
8370         ;;
8371 (ncurses*)
8372
8373 cf_ncuconfig_root=$cf_cv_screen
8374 cf_have_ncuconfig=no
8375
8376 if test "x${PKG_CONFIG:=none}" != xnone; then
8377         echo "$as_me:8377: checking pkg-config for $cf_ncuconfig_root" >&5
8378 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8379         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8380                 echo "$as_me:8380: result: yes" >&5
8381 echo "${ECHO_T}yes" >&6
8382
8383                 echo "$as_me:8383: checking if the $cf_ncuconfig_root package files work" >&5
8384 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8385                 cf_have_ncuconfig=unknown
8386
8387                 cf_save_CPPFLAGS="$CPPFLAGS"
8388                 cf_save_LIBS="$LIBS"
8389
8390                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8391
8392 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8393 # Filter out duplicates - this happens with badly-designed ".pc" files...
8394 for cf_add_1lib in $LIBS
8395 do
8396         for cf_add_2lib in $cf_add_libs
8397         do
8398                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8399                 then
8400                         cf_add_1lib=
8401                         break
8402                 fi
8403         done
8404         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8405 done
8406 LIBS="$cf_add_libs"
8407
8408                 cat >conftest.$ac_ext <<_ACEOF
8409 #line 8409 "configure"
8410 #include "confdefs.h"
8411 #include <${cf_cv_ncurses_header:-curses.h}>
8412 int
8413 main (void)
8414 {
8415 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8416   ;
8417   return 0;
8418 }
8419 _ACEOF
8420 rm -f conftest.$ac_objext conftest$ac_exeext
8421 if { (eval echo "$as_me:8421: \"$ac_link\"") >&5
8422   (eval $ac_link) 2>&5
8423   ac_status=$?
8424   echo "$as_me:8424: \$? = $ac_status" >&5
8425   (exit $ac_status); } &&
8426          { ac_try='test -s conftest$ac_exeext'
8427   { (eval echo "$as_me:8427: \"$ac_try\"") >&5
8428   (eval $ac_try) 2>&5
8429   ac_status=$?
8430   echo "$as_me:8430: \$? = $ac_status" >&5
8431   (exit $ac_status); }; }; then
8432   if test "$cross_compiling" = yes; then
8433   cf_have_ncuconfig=maybe
8434 else
8435   cat >conftest.$ac_ext <<_ACEOF
8436 #line 8436 "configure"
8437 #include "confdefs.h"
8438 #include <${cf_cv_ncurses_header:-curses.h}>
8439                                 int main(void)
8440                                 { char *xx = curses_version(); return (xx == 0); }
8441 _ACEOF
8442 rm -f conftest$ac_exeext
8443 if { (eval echo "$as_me:8443: \"$ac_link\"") >&5
8444   (eval $ac_link) 2>&5
8445   ac_status=$?
8446   echo "$as_me:8446: \$? = $ac_status" >&5
8447   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8448   { (eval echo "$as_me:8448: \"$ac_try\"") >&5
8449   (eval $ac_try) 2>&5
8450   ac_status=$?
8451   echo "$as_me:8451: \$? = $ac_status" >&5
8452   (exit $ac_status); }; }; then
8453   cf_have_ncuconfig=yes
8454 else
8455   echo "$as_me: program exited with status $ac_status" >&5
8456 echo "$as_me: failed program was:" >&5
8457 cat conftest.$ac_ext >&5
8458 cf_have_ncuconfig=no
8459 fi
8460 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8461 fi
8462 else
8463   echo "$as_me: failed program was:" >&5
8464 cat conftest.$ac_ext >&5
8465 cf_have_ncuconfig=no
8466 fi
8467 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8468                 echo "$as_me:8468: result: $cf_have_ncuconfig" >&5
8469 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8470                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8471                 if test "$cf_have_ncuconfig" != "yes"
8472                 then
8473                         CPPFLAGS="$cf_save_CPPFLAGS"
8474                         LIBS="$cf_save_LIBS"
8475                         NCURSES_CONFIG_PKG=none
8476                 else
8477
8478 cat >>confdefs.h <<\EOF
8479 #define NCURSES 1
8480 EOF
8481
8482                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8483                 fi
8484
8485 echo "$as_me:8485: checking for terminfo header" >&5
8486 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8487 if test "${cf_cv_term_header+set}" = set; then
8488   echo $ECHO_N "(cached) $ECHO_C" >&6
8489 else
8490
8491 case ${cf_cv_ncurses_header} in
8492 (*/ncurses.h|*/ncursesw.h)
8493         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8494         ;;
8495 (*)
8496         cf_term_header=term.h
8497         ;;
8498 esac
8499
8500 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8501 do
8502 cat >conftest.$ac_ext <<_ACEOF
8503 #line 8503 "configure"
8504 #include "confdefs.h"
8505 #include <stdio.h>
8506 #include <${cf_cv_ncurses_header:-curses.h}>
8507 #include <$cf_test>
8508
8509 int
8510 main (void)
8511 {
8512 int x = auto_left_margin
8513   ;
8514   return 0;
8515 }
8516 _ACEOF
8517 rm -f conftest.$ac_objext
8518 if { (eval echo "$as_me:8518: \"$ac_compile\"") >&5
8519   (eval $ac_compile) 2>&5
8520   ac_status=$?
8521   echo "$as_me:8521: \$? = $ac_status" >&5
8522   (exit $ac_status); } &&
8523          { ac_try='test -s conftest.$ac_objext'
8524   { (eval echo "$as_me:8524: \"$ac_try\"") >&5
8525   (eval $ac_try) 2>&5
8526   ac_status=$?
8527   echo "$as_me:8527: \$? = $ac_status" >&5
8528   (exit $ac_status); }; }; then
8529
8530         cf_cv_term_header="$cf_test"
8531 else
8532   echo "$as_me: failed program was:" >&5
8533 cat conftest.$ac_ext >&5
8534
8535         cf_cv_term_header=unknown
8536
8537 fi
8538 rm -f conftest.$ac_objext conftest.$ac_ext
8539         test "$cf_cv_term_header" != unknown && break
8540 done
8541
8542 fi
8543 echo "$as_me:8543: result: $cf_cv_term_header" >&5
8544 echo "${ECHO_T}$cf_cv_term_header" >&6
8545
8546 # Set definitions to allow ifdef'ing to accommodate subdirectories
8547
8548 case $cf_cv_term_header in
8549 (*term.h)
8550
8551 cat >>confdefs.h <<\EOF
8552 #define HAVE_TERM_H 1
8553 EOF
8554
8555         ;;
8556 esac
8557
8558 case $cf_cv_term_header in
8559 (ncurses/term.h)
8560
8561 cat >>confdefs.h <<\EOF
8562 #define HAVE_NCURSES_TERM_H 1
8563 EOF
8564
8565         ;;
8566 (ncursesw/term.h)
8567
8568 cat >>confdefs.h <<\EOF
8569 #define HAVE_NCURSESW_TERM_H 1
8570 EOF
8571
8572         ;;
8573 esac
8574
8575         else
8576                 echo "$as_me:8576: result: no" >&5
8577 echo "${ECHO_T}no" >&6
8578                 NCURSES_CONFIG_PKG=none
8579         fi
8580 else
8581         NCURSES_CONFIG_PKG=none
8582 fi
8583
8584 if test "x$cf_have_ncuconfig" = "xno"; then
8585         echo "Looking for ${cf_ncuconfig_root}-config"
8586
8587 if test -n "$ac_tool_prefix"; then
8588   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8589   do
8590     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8591 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8592 echo "$as_me:8592: checking for $ac_word" >&5
8593 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8594 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8595   echo $ECHO_N "(cached) $ECHO_C" >&6
8596 else
8597   if test -n "$NCURSES_CONFIG"; then
8598   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8599 else
8600   ac_save_IFS=$IFS; IFS=$ac_path_separator
8601 ac_dummy="$PATH"
8602 for ac_dir in $ac_dummy; do
8603   IFS=$ac_save_IFS
8604   test -z "$ac_dir" && ac_dir=.
8605   $as_executable_p "$ac_dir/$ac_word" || continue
8606 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8607 echo "$as_me:8607: found $ac_dir/$ac_word" >&5
8608 break
8609 done
8610
8611 fi
8612 fi
8613 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8614 if test -n "$NCURSES_CONFIG"; then
8615   echo "$as_me:8615: result: $NCURSES_CONFIG" >&5
8616 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8617 else
8618   echo "$as_me:8618: result: no" >&5
8619 echo "${ECHO_T}no" >&6
8620 fi
8621
8622     test -n "$NCURSES_CONFIG" && break
8623   done
8624 fi
8625 if test -z "$NCURSES_CONFIG"; then
8626   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8627   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8628 do
8629   # Extract the first word of "$ac_prog", so it can be a program name with args.
8630 set dummy $ac_prog; ac_word=$2
8631 echo "$as_me:8631: checking for $ac_word" >&5
8632 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8633 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8634   echo $ECHO_N "(cached) $ECHO_C" >&6
8635 else
8636   if test -n "$ac_ct_NCURSES_CONFIG"; then
8637   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8638 else
8639   ac_save_IFS=$IFS; IFS=$ac_path_separator
8640 ac_dummy="$PATH"
8641 for ac_dir in $ac_dummy; do
8642   IFS=$ac_save_IFS
8643   test -z "$ac_dir" && ac_dir=.
8644   $as_executable_p "$ac_dir/$ac_word" || continue
8645 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8646 echo "$as_me:8646: found $ac_dir/$ac_word" >&5
8647 break
8648 done
8649
8650 fi
8651 fi
8652 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8653 if test -n "$ac_ct_NCURSES_CONFIG"; then
8654   echo "$as_me:8654: result: $ac_ct_NCURSES_CONFIG" >&5
8655 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8656 else
8657   echo "$as_me:8657: result: no" >&5
8658 echo "${ECHO_T}no" >&6
8659 fi
8660
8661   test -n "$ac_ct_NCURSES_CONFIG" && break
8662 done
8663 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8664
8665   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8666 fi
8667
8668         if test "$NCURSES_CONFIG" != none ; then
8669
8670                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8671
8672 cf_add_libs="`$NCURSES_CONFIG --libs`"
8673 # Filter out duplicates - this happens with badly-designed ".pc" files...
8674 for cf_add_1lib in $LIBS
8675 do
8676         for cf_add_2lib in $cf_add_libs
8677         do
8678                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8679                 then
8680                         cf_add_1lib=
8681                         break
8682                 fi
8683         done
8684         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8685 done
8686 LIBS="$cf_add_libs"
8687
8688                 # even with config script, some packages use no-override for curses.h
8689
8690 echo "$as_me:8690: checking if we have identified curses headers" >&5
8691 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8692 if test "${cf_cv_ncurses_header+set}" = set; then
8693   echo $ECHO_N "(cached) $ECHO_C" >&6
8694 else
8695
8696 cf_cv_ncurses_header=none
8697 for cf_header in \
8698         ncurses.h $cf_cv_screen/ncurses.h \
8699         curses.h $cf_cv_screen/curses.h
8700 do
8701 cat >conftest.$ac_ext <<_ACEOF
8702 #line 8702 "configure"
8703 #include "confdefs.h"
8704 #include <${cf_header}>
8705 int
8706 main (void)
8707 {
8708 initscr(); tgoto("?", 0,0)
8709   ;
8710   return 0;
8711 }
8712 _ACEOF
8713 rm -f conftest.$ac_objext
8714 if { (eval echo "$as_me:8714: \"$ac_compile\"") >&5
8715   (eval $ac_compile) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit $ac_status); } &&
8719          { ac_try='test -s conftest.$ac_objext'
8720   { (eval echo "$as_me:8720: \"$ac_try\"") >&5
8721   (eval $ac_try) 2>&5
8722   ac_status=$?
8723   echo "$as_me:8723: \$? = $ac_status" >&5
8724   (exit $ac_status); }; }; then
8725   cf_cv_ncurses_header=$cf_header; break
8726 else
8727   echo "$as_me: failed program was:" >&5
8728 cat conftest.$ac_ext >&5
8729 fi
8730 rm -f conftest.$ac_objext conftest.$ac_ext
8731 done
8732
8733 fi
8734 echo "$as_me:8734: result: $cf_cv_ncurses_header" >&5
8735 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8736
8737 if test "$cf_cv_ncurses_header" = none ; then
8738         { { echo "$as_me:8738: error: No curses header-files found" >&5
8739 echo "$as_me: error: No curses header-files found" >&2;}
8740    { (exit 1); exit 1; }; }
8741 fi
8742
8743 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8744
8745 for ac_header in $cf_cv_ncurses_header
8746 do
8747 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8748 echo "$as_me:8748: checking for $ac_header" >&5
8749 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8750 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8751   echo $ECHO_N "(cached) $ECHO_C" >&6
8752 else
8753   cat >conftest.$ac_ext <<_ACEOF
8754 #line 8754 "configure"
8755 #include "confdefs.h"
8756 #include <$ac_header>
8757 _ACEOF
8758 if { (eval echo "$as_me:8758: \"$ac_cpp conftest.$ac_ext\"") >&5
8759   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8760   ac_status=$?
8761   egrep -v '^ *\+' conftest.er1 >conftest.err
8762   rm -f conftest.er1
8763   cat conftest.err >&5
8764   echo "$as_me:8764: \$? = $ac_status" >&5
8765   (exit $ac_status); } >/dev/null; then
8766   if test -s conftest.err; then
8767     ac_cpp_err=$ac_c_preproc_warn_flag
8768   else
8769     ac_cpp_err=
8770   fi
8771 else
8772   ac_cpp_err=yes
8773 fi
8774 if test -z "$ac_cpp_err"; then
8775   eval "$as_ac_Header=yes"
8776 else
8777   echo "$as_me: failed program was:" >&5
8778   cat conftest.$ac_ext >&5
8779   eval "$as_ac_Header=no"
8780 fi
8781 rm -f conftest.err conftest.$ac_ext
8782 fi
8783 echo "$as_me:8783: result: `eval echo '${'$as_ac_Header'}'`" >&5
8784 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8785 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8786   cat >>confdefs.h <<EOF
8787 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8788 EOF
8789
8790 fi
8791 done
8792
8793 cat >>confdefs.h <<\EOF
8794 #define NCURSES 1
8795 EOF
8796
8797 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8798
8799                 cat >>confdefs.h <<EOF
8800 #define $cf_nculib_ROOT 1
8801 EOF
8802
8803                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8804
8805         else
8806
8807 cf_ncuhdr_root=$cf_cv_screen
8808
8809 test -n "$cf_cv_curses_dir" && \
8810 test "$cf_cv_curses_dir" != "no" && { \
8811
8812 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8813   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8814   do
8815         while test $cf_add_incdir != /usr/include
8816         do
8817           if test -d $cf_add_incdir
8818           then
8819                 cf_have_incdir=no
8820                 if test -n "$CFLAGS$CPPFLAGS" ; then
8821                   # a loop is needed to ensure we can add subdirs of existing dirs
8822                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8823                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8824                           cf_have_incdir=yes; break
8825                         fi
8826                   done
8827                 fi
8828
8829                 if test "$cf_have_incdir" = no ; then
8830                   if test "$cf_add_incdir" = /usr/local/include ; then
8831                         if test "$GCC" = yes
8832                         then
8833                           cf_save_CPPFLAGS=$CPPFLAGS
8834                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8835                           cat >conftest.$ac_ext <<_ACEOF
8836 #line 8836 "configure"
8837 #include "confdefs.h"
8838 #include <stdio.h>
8839 int
8840 main (void)
8841 {
8842 printf("Hello")
8843   ;
8844   return 0;
8845 }
8846 _ACEOF
8847 rm -f conftest.$ac_objext
8848 if { (eval echo "$as_me:8848: \"$ac_compile\"") >&5
8849   (eval $ac_compile) 2>&5
8850   ac_status=$?
8851   echo "$as_me:8851: \$? = $ac_status" >&5
8852   (exit $ac_status); } &&
8853          { ac_try='test -s conftest.$ac_objext'
8854   { (eval echo "$as_me:8854: \"$ac_try\"") >&5
8855   (eval $ac_try) 2>&5
8856   ac_status=$?
8857   echo "$as_me:8857: \$? = $ac_status" >&5
8858   (exit $ac_status); }; }; then
8859   :
8860 else
8861   echo "$as_me: failed program was:" >&5
8862 cat conftest.$ac_ext >&5
8863 cf_have_incdir=yes
8864 fi
8865 rm -f conftest.$ac_objext conftest.$ac_ext
8866                           CPPFLAGS=$cf_save_CPPFLAGS
8867                         fi
8868                   fi
8869                 fi
8870
8871                 if test "$cf_have_incdir" = no ; then
8872                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8873
8874 echo "${as_me:-configure}:8874: testing adding $cf_add_incdir to include-path ..." 1>&5
8875
8876                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8877
8878                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8879                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8880                   cf_add_incdir="$cf_top_incdir"
8881                 else
8882                   break
8883                 fi
8884           else
8885                 break
8886           fi
8887         done
8888   done
8889 fi
8890
8891 }
8892
8893 echo "$as_me:8893: checking for $cf_ncuhdr_root header in include-path" >&5
8894 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8895 if test "${cf_cv_ncurses_h+set}" = set; then
8896   echo $ECHO_N "(cached) $ECHO_C" >&6
8897 else
8898
8899         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8900         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8901         for cf_header in $cf_header_list
8902         do
8903
8904         cat >conftest.$ac_ext <<_ACEOF
8905 #line 8905 "configure"
8906 #include "confdefs.h"
8907
8908 #include <$cf_header>
8909 int
8910 main (void)
8911 {
8912
8913 #ifdef NCURSES_VERSION
8914
8915 printf("%s\n", NCURSES_VERSION);
8916 #else
8917 #ifdef __NCURSES_H
8918 printf("old\n");
8919 #else
8920         make an error
8921 #endif
8922 #endif
8923
8924   ;
8925   return 0;
8926 }
8927 _ACEOF
8928 rm -f conftest.$ac_objext
8929 if { (eval echo "$as_me:8929: \"$ac_compile\"") >&5
8930   (eval $ac_compile) 2>&5
8931   ac_status=$?
8932   echo "$as_me:8932: \$? = $ac_status" >&5
8933   (exit $ac_status); } &&
8934          { ac_try='test -s conftest.$ac_objext'
8935   { (eval echo "$as_me:8935: \"$ac_try\"") >&5
8936   (eval $ac_try) 2>&5
8937   ac_status=$?
8938   echo "$as_me:8938: \$? = $ac_status" >&5
8939   (exit $ac_status); }; }; then
8940   cf_cv_ncurses_h=$cf_header
8941
8942 else
8943   echo "$as_me: failed program was:" >&5
8944 cat conftest.$ac_ext >&5
8945 cf_cv_ncurses_h=no
8946 fi
8947 rm -f conftest.$ac_objext conftest.$ac_ext
8948
8949                 test "$cf_cv_ncurses_h" != no && break
8950         done
8951
8952 fi
8953 echo "$as_me:8953: result: $cf_cv_ncurses_h" >&5
8954 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8955
8956 if test "$cf_cv_ncurses_h" != no ; then
8957         cf_cv_ncurses_header=$cf_cv_ncurses_h
8958 else
8959
8960 echo "$as_me:8960: checking for $cf_ncuhdr_root include-path" >&5
8961 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8962 if test "${cf_cv_ncurses_h2+set}" = set; then
8963   echo $ECHO_N "(cached) $ECHO_C" >&6
8964 else
8965
8966         test -n "$verbose" && echo
8967
8968 cf_search=
8969
8970 # collect the current set of include-directories from compiler flags
8971 cf_header_path_list=""
8972 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8973         for cf_header_path in $CPPFLAGS $CFLAGS
8974         do
8975                 case $cf_header_path in
8976                 (-I*)
8977                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8978
8979 test "x$cf_header_path" != "xNONE" && \
8980 test -d "$cf_header_path" && \
8981  {
8982         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8983         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8984         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8985         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8986         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8987         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"
8988 }
8989
8990                         cf_header_path_list="$cf_header_path_list $cf_search"
8991                         ;;
8992                 esac
8993         done
8994 fi
8995
8996 # add the variations for the package we are looking for
8997
8998 cf_search=
8999
9000 test "x$prefix" != "xNONE" && \
9001 test -d "$prefix" && \
9002  {
9003         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9004         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9005         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9006         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9007         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9008         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9009 }
9010
9011 for cf_subdir_prefix in \
9012         /usr \
9013         /usr/local \
9014         /usr/pkg \
9015         /opt \
9016         /opt/local \
9017         $HOME
9018 do
9019
9020 test "x$cf_subdir_prefix" != "x$prefix" && \
9021 test -d "$cf_subdir_prefix" && \
9022 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9023         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9024         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9025         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9026         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9027         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9028         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"
9029 }
9030
9031 done
9032
9033 test "$includedir" != NONE && \
9034 test "$includedir" != "/usr/include" && \
9035 test -d "$includedir" && {
9036         test -d $includedir &&    cf_search="$cf_search $includedir"
9037         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9038 }
9039
9040 test "$oldincludedir" != NONE && \
9041 test "$oldincludedir" != "/usr/include" && \
9042 test -d "$oldincludedir" && {
9043         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9044         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9045 }
9046
9047 cf_search="$cf_search $cf_header_path_list"
9048
9049         test -n "$verbose" && echo search path $cf_search
9050         cf_save2_CPPFLAGS="$CPPFLAGS"
9051         for cf_incdir in $cf_search
9052         do
9053
9054 if test -n "$cf_incdir" ; then
9055   for cf_add_incdir in $cf_incdir
9056   do
9057         while test $cf_add_incdir != /usr/include
9058         do
9059           if test -d $cf_add_incdir
9060           then
9061                 cf_have_incdir=no
9062                 if test -n "$CFLAGS$CPPFLAGS" ; then
9063                   # a loop is needed to ensure we can add subdirs of existing dirs
9064                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9065                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9066                           cf_have_incdir=yes; break
9067                         fi
9068                   done
9069                 fi
9070
9071                 if test "$cf_have_incdir" = no ; then
9072                   if test "$cf_add_incdir" = /usr/local/include ; then
9073                         if test "$GCC" = yes
9074                         then
9075                           cf_save_CPPFLAGS=$CPPFLAGS
9076                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9077                           cat >conftest.$ac_ext <<_ACEOF
9078 #line 9078 "configure"
9079 #include "confdefs.h"
9080 #include <stdio.h>
9081 int
9082 main (void)
9083 {
9084 printf("Hello")
9085   ;
9086   return 0;
9087 }
9088 _ACEOF
9089 rm -f conftest.$ac_objext
9090 if { (eval echo "$as_me:9090: \"$ac_compile\"") >&5
9091   (eval $ac_compile) 2>&5
9092   ac_status=$?
9093   echo "$as_me:9093: \$? = $ac_status" >&5
9094   (exit $ac_status); } &&
9095          { ac_try='test -s conftest.$ac_objext'
9096   { (eval echo "$as_me:9096: \"$ac_try\"") >&5
9097   (eval $ac_try) 2>&5
9098   ac_status=$?
9099   echo "$as_me:9099: \$? = $ac_status" >&5
9100   (exit $ac_status); }; }; then
9101   :
9102 else
9103   echo "$as_me: failed program was:" >&5
9104 cat conftest.$ac_ext >&5
9105 cf_have_incdir=yes
9106 fi
9107 rm -f conftest.$ac_objext conftest.$ac_ext
9108                           CPPFLAGS=$cf_save_CPPFLAGS
9109                         fi
9110                   fi
9111                 fi
9112
9113                 if test "$cf_have_incdir" = no ; then
9114                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9115
9116 echo "${as_me:-configure}:9116: testing adding $cf_add_incdir to include-path ..." 1>&5
9117
9118                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9119
9120                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9121                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9122                   cf_add_incdir="$cf_top_incdir"
9123                 else
9124                   break
9125                 fi
9126           else
9127                 break
9128           fi
9129         done
9130   done
9131 fi
9132
9133                 for cf_header in \
9134                         ncurses.h \
9135                         curses.h
9136                 do
9137
9138         cat >conftest.$ac_ext <<_ACEOF
9139 #line 9139 "configure"
9140 #include "confdefs.h"
9141
9142 #include <$cf_header>
9143 int
9144 main (void)
9145 {
9146
9147 #ifdef NCURSES_VERSION
9148
9149 printf("%s\n", NCURSES_VERSION);
9150 #else
9151 #ifdef __NCURSES_H
9152 printf("old\n");
9153 #else
9154         make an error
9155 #endif
9156 #endif
9157
9158   ;
9159   return 0;
9160 }
9161 _ACEOF
9162 rm -f conftest.$ac_objext
9163 if { (eval echo "$as_me:9163: \"$ac_compile\"") >&5
9164   (eval $ac_compile) 2>&5
9165   ac_status=$?
9166   echo "$as_me:9166: \$? = $ac_status" >&5
9167   (exit $ac_status); } &&
9168          { ac_try='test -s conftest.$ac_objext'
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   cf_cv_ncurses_h2=$cf_header
9175
9176 else
9177   echo "$as_me: failed program was:" >&5
9178 cat conftest.$ac_ext >&5
9179 cf_cv_ncurses_h2=no
9180 fi
9181 rm -f conftest.$ac_objext conftest.$ac_ext
9182
9183                         if test "$cf_cv_ncurses_h2" != no ; then
9184                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9185                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9186                                 break
9187                         fi
9188                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9189                 done
9190                 CPPFLAGS="$cf_save2_CPPFLAGS"
9191                 test "$cf_cv_ncurses_h2" != no && break
9192         done
9193         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9193: error: not found" >&5
9194 echo "$as_me: error: not found" >&2;}
9195    { (exit 1); exit 1; }; }
9196
9197 fi
9198 echo "$as_me:9198: result: $cf_cv_ncurses_h2" >&5
9199 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9200
9201         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9202         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9203         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9204                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9205         fi
9206
9207 if test -n "$cf_1st_incdir" ; then
9208   for cf_add_incdir in $cf_1st_incdir
9209   do
9210         while test $cf_add_incdir != /usr/include
9211         do
9212           if test -d $cf_add_incdir
9213           then
9214                 cf_have_incdir=no
9215                 if test -n "$CFLAGS$CPPFLAGS" ; then
9216                   # a loop is needed to ensure we can add subdirs of existing dirs
9217                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9218                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9219                           cf_have_incdir=yes; break
9220                         fi
9221                   done
9222                 fi
9223
9224                 if test "$cf_have_incdir" = no ; then
9225                   if test "$cf_add_incdir" = /usr/local/include ; then
9226                         if test "$GCC" = yes
9227                         then
9228                           cf_save_CPPFLAGS=$CPPFLAGS
9229                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9230                           cat >conftest.$ac_ext <<_ACEOF
9231 #line 9231 "configure"
9232 #include "confdefs.h"
9233 #include <stdio.h>
9234 int
9235 main (void)
9236 {
9237 printf("Hello")
9238   ;
9239   return 0;
9240 }
9241 _ACEOF
9242 rm -f conftest.$ac_objext
9243 if { (eval echo "$as_me:9243: \"$ac_compile\"") >&5
9244   (eval $ac_compile) 2>&5
9245   ac_status=$?
9246   echo "$as_me:9246: \$? = $ac_status" >&5
9247   (exit $ac_status); } &&
9248          { ac_try='test -s conftest.$ac_objext'
9249   { (eval echo "$as_me:9249: \"$ac_try\"") >&5
9250   (eval $ac_try) 2>&5
9251   ac_status=$?
9252   echo "$as_me:9252: \$? = $ac_status" >&5
9253   (exit $ac_status); }; }; then
9254   :
9255 else
9256   echo "$as_me: failed program was:" >&5
9257 cat conftest.$ac_ext >&5
9258 cf_have_incdir=yes
9259 fi
9260 rm -f conftest.$ac_objext conftest.$ac_ext
9261                           CPPFLAGS=$cf_save_CPPFLAGS
9262                         fi
9263                   fi
9264                 fi
9265
9266                 if test "$cf_have_incdir" = no ; then
9267                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9268
9269 echo "${as_me:-configure}:9269: testing adding $cf_add_incdir to include-path ..." 1>&5
9270
9271                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9272
9273                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9274                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9275                   cf_add_incdir="$cf_top_incdir"
9276                 else
9277                   break
9278                 fi
9279           else
9280                 break
9281           fi
9282         done
9283   done
9284 fi
9285
9286 fi
9287
9288 # Set definitions to allow ifdef'ing for ncurses.h
9289
9290 case $cf_cv_ncurses_header in
9291 (*ncurses.h)
9292
9293 cat >>confdefs.h <<\EOF
9294 #define HAVE_NCURSES_H 1
9295 EOF
9296
9297         ;;
9298 esac
9299
9300 case $cf_cv_ncurses_header in
9301 (ncurses/curses.h|ncurses/ncurses.h)
9302
9303 cat >>confdefs.h <<\EOF
9304 #define HAVE_NCURSES_NCURSES_H 1
9305 EOF
9306
9307         ;;
9308 (ncursesw/curses.h|ncursesw/ncurses.h)
9309
9310 cat >>confdefs.h <<\EOF
9311 #define HAVE_NCURSESW_NCURSES_H 1
9312 EOF
9313
9314         ;;
9315 esac
9316
9317 echo "$as_me:9317: checking for terminfo header" >&5
9318 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9319 if test "${cf_cv_term_header+set}" = set; then
9320   echo $ECHO_N "(cached) $ECHO_C" >&6
9321 else
9322
9323 case ${cf_cv_ncurses_header} in
9324 (*/ncurses.h|*/ncursesw.h)
9325         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9326         ;;
9327 (*)
9328         cf_term_header=term.h
9329         ;;
9330 esac
9331
9332 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9333 do
9334 cat >conftest.$ac_ext <<_ACEOF
9335 #line 9335 "configure"
9336 #include "confdefs.h"
9337 #include <stdio.h>
9338 #include <${cf_cv_ncurses_header:-curses.h}>
9339 #include <$cf_test>
9340
9341 int
9342 main (void)
9343 {
9344 int x = auto_left_margin
9345   ;
9346   return 0;
9347 }
9348 _ACEOF
9349 rm -f conftest.$ac_objext
9350 if { (eval echo "$as_me:9350: \"$ac_compile\"") >&5
9351   (eval $ac_compile) 2>&5
9352   ac_status=$?
9353   echo "$as_me:9353: \$? = $ac_status" >&5
9354   (exit $ac_status); } &&
9355          { ac_try='test -s conftest.$ac_objext'
9356   { (eval echo "$as_me:9356: \"$ac_try\"") >&5
9357   (eval $ac_try) 2>&5
9358   ac_status=$?
9359   echo "$as_me:9359: \$? = $ac_status" >&5
9360   (exit $ac_status); }; }; then
9361
9362         cf_cv_term_header="$cf_test"
9363 else
9364   echo "$as_me: failed program was:" >&5
9365 cat conftest.$ac_ext >&5
9366
9367         cf_cv_term_header=unknown
9368
9369 fi
9370 rm -f conftest.$ac_objext conftest.$ac_ext
9371         test "$cf_cv_term_header" != unknown && break
9372 done
9373
9374 fi
9375 echo "$as_me:9375: result: $cf_cv_term_header" >&5
9376 echo "${ECHO_T}$cf_cv_term_header" >&6
9377
9378 # Set definitions to allow ifdef'ing to accommodate subdirectories
9379
9380 case $cf_cv_term_header in
9381 (*term.h)
9382
9383 cat >>confdefs.h <<\EOF
9384 #define HAVE_TERM_H 1
9385 EOF
9386
9387         ;;
9388 esac
9389
9390 case $cf_cv_term_header in
9391 (ncurses/term.h)
9392
9393 cat >>confdefs.h <<\EOF
9394 #define HAVE_NCURSES_TERM_H 1
9395 EOF
9396
9397         ;;
9398 (ncursesw/term.h)
9399
9400 cat >>confdefs.h <<\EOF
9401 #define HAVE_NCURSESW_TERM_H 1
9402 EOF
9403
9404         ;;
9405 esac
9406
9407 # some applications need this, but should check for NCURSES_VERSION
9408
9409 cat >>confdefs.h <<\EOF
9410 #define NCURSES 1
9411 EOF
9412
9413 echo "$as_me:9413: checking for ncurses version" >&5
9414 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9415 if test "${cf_cv_ncurses_version+set}" = set; then
9416   echo $ECHO_N "(cached) $ECHO_C" >&6
9417 else
9418
9419         cf_cv_ncurses_version=no
9420         cf_tempfile=out$$
9421         rm -f $cf_tempfile
9422         if test "$cross_compiling" = yes; then
9423
9424         # This will not work if the preprocessor splits the line after the
9425         # Autoconf token.  The 'unproto' program does that.
9426         cat > conftest.$ac_ext <<EOF
9427 #include <${cf_cv_ncurses_header:-curses.h}>
9428 #undef Autoconf
9429 #ifdef NCURSES_VERSION
9430 Autoconf NCURSES_VERSION
9431 #else
9432 #ifdef __NCURSES_H
9433 Autoconf "old"
9434 #endif
9435 ;
9436 #endif
9437 EOF
9438         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9439         { (eval echo "$as_me:9439: \"$cf_try\"") >&5
9440   (eval $cf_try) 2>&5
9441   ac_status=$?
9442   echo "$as_me:9442: \$? = $ac_status" >&5
9443   (exit $ac_status); }
9444         if test -f conftest.out ; then
9445                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9446                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9447                 rm -f conftest.out
9448         fi
9449
9450 else
9451   cat >conftest.$ac_ext <<_ACEOF
9452 #line 9452 "configure"
9453 #include "confdefs.h"
9454
9455 #include <${cf_cv_ncurses_header:-curses.h}>
9456 #include <stdio.h>
9457 int main(void)
9458 {
9459         FILE *fp = fopen("$cf_tempfile", "w");
9460 #ifdef NCURSES_VERSION
9461 # ifdef NCURSES_VERSION_PATCH
9462         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9463 # else
9464         fprintf(fp, "%s\n", NCURSES_VERSION);
9465 # endif
9466 #else
9467 # ifdef __NCURSES_H
9468         fprintf(fp, "old\n");
9469 # else
9470         make an error
9471 # endif
9472 #endif
9473         ${cf_cv_main_return:-return}(0);
9474 }
9475 _ACEOF
9476 rm -f conftest$ac_exeext
9477 if { (eval echo "$as_me:9477: \"$ac_link\"") >&5
9478   (eval $ac_link) 2>&5
9479   ac_status=$?
9480   echo "$as_me:9480: \$? = $ac_status" >&5
9481   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9482   { (eval echo "$as_me:9482: \"$ac_try\"") >&5
9483   (eval $ac_try) 2>&5
9484   ac_status=$?
9485   echo "$as_me:9485: \$? = $ac_status" >&5
9486   (exit $ac_status); }; }; then
9487
9488         cf_cv_ncurses_version=`cat $cf_tempfile`
9489 else
9490   echo "$as_me: program exited with status $ac_status" >&5
9491 echo "$as_me: failed program was:" >&5
9492 cat conftest.$ac_ext >&5
9493 fi
9494 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9495 fi
9496         rm -f $cf_tempfile
9497
9498 fi
9499 echo "$as_me:9499: result: $cf_cv_ncurses_version" >&5
9500 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9501 test "$cf_cv_ncurses_version" = no ||
9502 cat >>confdefs.h <<\EOF
9503 #define NCURSES 1
9504 EOF
9505
9506 cf_nculib_root=$cf_cv_screen
9507         # This works, except for the special case where we find gpm, but
9508         # ncurses is in a nonstandard location via $LIBS, and we really want
9509         # to link gpm.
9510 cf_ncurses_LIBS=""
9511 cf_ncurses_SAVE="$LIBS"
9512 echo "$as_me:9512: checking for Gpm_Open in -lgpm" >&5
9513 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9514 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9515   echo $ECHO_N "(cached) $ECHO_C" >&6
9516 else
9517   ac_check_lib_save_LIBS=$LIBS
9518 LIBS="-lgpm  $LIBS"
9519 cat >conftest.$ac_ext <<_ACEOF
9520 #line 9520 "configure"
9521 #include "confdefs.h"
9522
9523 /* Override any gcc2 internal prototype to avoid an error.  */
9524 #ifdef __cplusplus
9525 extern "C"
9526 #endif
9527 /* We use char because int might match the return type of a gcc2
9528    builtin and then its argument prototype would still apply.  */
9529 char Gpm_Open ();
9530 int
9531 main (void)
9532 {
9533 Gpm_Open ();
9534   ;
9535   return 0;
9536 }
9537 _ACEOF
9538 rm -f conftest.$ac_objext conftest$ac_exeext
9539 if { (eval echo "$as_me:9539: \"$ac_link\"") >&5
9540   (eval $ac_link) 2>&5
9541   ac_status=$?
9542   echo "$as_me:9542: \$? = $ac_status" >&5
9543   (exit $ac_status); } &&
9544          { ac_try='test -s conftest$ac_exeext'
9545   { (eval echo "$as_me:9545: \"$ac_try\"") >&5
9546   (eval $ac_try) 2>&5
9547   ac_status=$?
9548   echo "$as_me:9548: \$? = $ac_status" >&5
9549   (exit $ac_status); }; }; then
9550   ac_cv_lib_gpm_Gpm_Open=yes
9551 else
9552   echo "$as_me: failed program was:" >&5
9553 cat conftest.$ac_ext >&5
9554 ac_cv_lib_gpm_Gpm_Open=no
9555 fi
9556 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9557 LIBS=$ac_check_lib_save_LIBS
9558 fi
9559 echo "$as_me:9559: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9560 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9561 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9562   echo "$as_me:9562: checking for initscr in -lgpm" >&5
9563 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9564 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9565   echo $ECHO_N "(cached) $ECHO_C" >&6
9566 else
9567   ac_check_lib_save_LIBS=$LIBS
9568 LIBS="-lgpm  $LIBS"
9569 cat >conftest.$ac_ext <<_ACEOF
9570 #line 9570 "configure"
9571 #include "confdefs.h"
9572
9573 /* Override any gcc2 internal prototype to avoid an error.  */
9574 #ifdef __cplusplus
9575 extern "C"
9576 #endif
9577 /* We use char because int might match the return type of a gcc2
9578    builtin and then its argument prototype would still apply.  */
9579 char initscr ();
9580 int
9581 main (void)
9582 {
9583 initscr ();
9584   ;
9585   return 0;
9586 }
9587 _ACEOF
9588 rm -f conftest.$ac_objext conftest$ac_exeext
9589 if { (eval echo "$as_me:9589: \"$ac_link\"") >&5
9590   (eval $ac_link) 2>&5
9591   ac_status=$?
9592   echo "$as_me:9592: \$? = $ac_status" >&5
9593   (exit $ac_status); } &&
9594          { ac_try='test -s conftest$ac_exeext'
9595   { (eval echo "$as_me:9595: \"$ac_try\"") >&5
9596   (eval $ac_try) 2>&5
9597   ac_status=$?
9598   echo "$as_me:9598: \$? = $ac_status" >&5
9599   (exit $ac_status); }; }; then
9600   ac_cv_lib_gpm_initscr=yes
9601 else
9602   echo "$as_me: failed program was:" >&5
9603 cat conftest.$ac_ext >&5
9604 ac_cv_lib_gpm_initscr=no
9605 fi
9606 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9607 LIBS=$ac_check_lib_save_LIBS
9608 fi
9609 echo "$as_me:9609: result: $ac_cv_lib_gpm_initscr" >&5
9610 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9611 if test $ac_cv_lib_gpm_initscr = yes; then
9612   LIBS="$cf_ncurses_SAVE"
9613 else
9614   cf_ncurses_LIBS="-lgpm"
9615 fi
9616
9617 fi
9618
9619 case $host_os in
9620 (freebsd*)
9621         # This is only necessary if you are linking against an obsolete
9622         # version of ncurses (but it should do no harm, since it's static).
9623         if test "$cf_nculib_root" = ncurses ; then
9624                 echo "$as_me:9624: checking for tgoto in -lmytinfo" >&5
9625 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9626 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9627   echo $ECHO_N "(cached) $ECHO_C" >&6
9628 else
9629   ac_check_lib_save_LIBS=$LIBS
9630 LIBS="-lmytinfo  $LIBS"
9631 cat >conftest.$ac_ext <<_ACEOF
9632 #line 9632 "configure"
9633 #include "confdefs.h"
9634
9635 /* Override any gcc2 internal prototype to avoid an error.  */
9636 #ifdef __cplusplus
9637 extern "C"
9638 #endif
9639 /* We use char because int might match the return type of a gcc2
9640    builtin and then its argument prototype would still apply.  */
9641 char tgoto ();
9642 int
9643 main (void)
9644 {
9645 tgoto ();
9646   ;
9647   return 0;
9648 }
9649 _ACEOF
9650 rm -f conftest.$ac_objext conftest$ac_exeext
9651 if { (eval echo "$as_me:9651: \"$ac_link\"") >&5
9652   (eval $ac_link) 2>&5
9653   ac_status=$?
9654   echo "$as_me:9654: \$? = $ac_status" >&5
9655   (exit $ac_status); } &&
9656          { ac_try='test -s conftest$ac_exeext'
9657   { (eval echo "$as_me:9657: \"$ac_try\"") >&5
9658   (eval $ac_try) 2>&5
9659   ac_status=$?
9660   echo "$as_me:9660: \$? = $ac_status" >&5
9661   (exit $ac_status); }; }; then
9662   ac_cv_lib_mytinfo_tgoto=yes
9663 else
9664   echo "$as_me: failed program was:" >&5
9665 cat conftest.$ac_ext >&5
9666 ac_cv_lib_mytinfo_tgoto=no
9667 fi
9668 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9669 LIBS=$ac_check_lib_save_LIBS
9670 fi
9671 echo "$as_me:9671: result: $ac_cv_lib_mytinfo_tgoto" >&5
9672 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9673 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9674   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9675 fi
9676
9677         fi
9678         ;;
9679 esac
9680
9681 cf_add_libs="$cf_ncurses_LIBS"
9682 # Filter out duplicates - this happens with badly-designed ".pc" files...
9683 for cf_add_1lib in $LIBS
9684 do
9685         for cf_add_2lib in $cf_add_libs
9686         do
9687                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9688                 then
9689                         cf_add_1lib=
9690                         break
9691                 fi
9692         done
9693         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9694 done
9695 LIBS="$cf_add_libs"
9696
9697 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9698 then
9699
9700 cf_add_libs="-l$cf_nculib_root"
9701 # Filter out duplicates - this happens with badly-designed ".pc" files...
9702 for cf_add_1lib in $LIBS
9703 do
9704         for cf_add_2lib in $cf_add_libs
9705         do
9706                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9707                 then
9708                         cf_add_1lib=
9709                         break
9710                 fi
9711         done
9712         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9713 done
9714 LIBS="$cf_add_libs"
9715
9716 else
9717
9718         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9719         cf_libdir=""
9720         echo "$as_me:9720: checking for initscr" >&5
9721 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9722 if test "${ac_cv_func_initscr+set}" = set; then
9723   echo $ECHO_N "(cached) $ECHO_C" >&6
9724 else
9725   cat >conftest.$ac_ext <<_ACEOF
9726 #line 9726 "configure"
9727 #include "confdefs.h"
9728 /* System header to define __stub macros and hopefully few prototypes,
9729     which can conflict with char initscr (); below.  */
9730 #include <assert.h>
9731 /* Override any gcc2 internal prototype to avoid an error.  */
9732 #ifdef __cplusplus
9733 extern "C"
9734 #endif
9735 /* We use char because int might match the return type of a gcc2
9736    builtin and then its argument prototype would still apply.  */
9737 char initscr ();
9738 char (*f) ();
9739
9740 int
9741 main (void)
9742 {
9743 /* The GNU C library defines this for functions which it implements
9744     to always fail with ENOSYS.  Some functions are actually named
9745     something starting with __ and the normal name is an alias.  */
9746 #if defined (__stub_initscr) || defined (__stub___initscr)
9747 choke me
9748 #else
9749 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9750 #endif
9751
9752   ;
9753   return 0;
9754 }
9755 _ACEOF
9756 rm -f conftest.$ac_objext conftest$ac_exeext
9757 if { (eval echo "$as_me:9757: \"$ac_link\"") >&5
9758   (eval $ac_link) 2>&5
9759   ac_status=$?
9760   echo "$as_me:9760: \$? = $ac_status" >&5
9761   (exit $ac_status); } &&
9762          { ac_try='test -s conftest$ac_exeext'
9763   { (eval echo "$as_me:9763: \"$ac_try\"") >&5
9764   (eval $ac_try) 2>&5
9765   ac_status=$?
9766   echo "$as_me:9766: \$? = $ac_status" >&5
9767   (exit $ac_status); }; }; then
9768   ac_cv_func_initscr=yes
9769 else
9770   echo "$as_me: failed program was:" >&5
9771 cat conftest.$ac_ext >&5
9772 ac_cv_func_initscr=no
9773 fi
9774 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9775 fi
9776 echo "$as_me:9776: result: $ac_cv_func_initscr" >&5
9777 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9778 if test $ac_cv_func_initscr = yes; then
9779   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9780 else
9781
9782                 cf_save_LIBS="$LIBS"
9783                 echo "$as_me:9783: checking for initscr in -l$cf_nculib_root" >&5
9784 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9785                 LIBS="-l$cf_nculib_root $LIBS"
9786                 cat >conftest.$ac_ext <<_ACEOF
9787 #line 9787 "configure"
9788 #include "confdefs.h"
9789 #include <${cf_cv_ncurses_header:-curses.h}>
9790 int
9791 main (void)
9792 {
9793 initscr()
9794   ;
9795   return 0;
9796 }
9797 _ACEOF
9798 rm -f conftest.$ac_objext conftest$ac_exeext
9799 if { (eval echo "$as_me:9799: \"$ac_link\"") >&5
9800   (eval $ac_link) 2>&5
9801   ac_status=$?
9802   echo "$as_me:9802: \$? = $ac_status" >&5
9803   (exit $ac_status); } &&
9804          { ac_try='test -s conftest$ac_exeext'
9805   { (eval echo "$as_me:9805: \"$ac_try\"") >&5
9806   (eval $ac_try) 2>&5
9807   ac_status=$?
9808   echo "$as_me:9808: \$? = $ac_status" >&5
9809   (exit $ac_status); }; }; then
9810   echo "$as_me:9810: result: yes" >&5
9811 echo "${ECHO_T}yes" >&6
9812                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9813
9814 else
9815   echo "$as_me: failed program was:" >&5
9816 cat conftest.$ac_ext >&5
9817 echo "$as_me:9817: result: no" >&5
9818 echo "${ECHO_T}no" >&6
9819
9820 cf_search=
9821 cf_library_path_list=""
9822 if test -n "${LDFLAGS}${LIBS}" ; then
9823         for cf_library_path in $LDFLAGS $LIBS
9824         do
9825                 case $cf_library_path in
9826                 (-L*)
9827                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9828
9829 test "x$cf_library_path" != "xNONE" && \
9830 test -d "$cf_library_path" && \
9831  {
9832         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9833         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9834         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9835         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9836         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9837         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"
9838 }
9839
9840                         cf_library_path_list="$cf_library_path_list $cf_search"
9841                         ;;
9842                 esac
9843         done
9844 fi
9845
9846 cf_search=
9847
9848 test "x$prefix" != "xNONE" && \
9849 test -d "$prefix" && \
9850  {
9851         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9852         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9853         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9854         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9855         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9856         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9857 }
9858
9859 for cf_subdir_prefix in \
9860         /usr \
9861         /usr/local \
9862         /usr/pkg \
9863         /opt \
9864         /opt/local \
9865         $HOME
9866 do
9867
9868 test "x$cf_subdir_prefix" != "x$prefix" && \
9869 test -d "$cf_subdir_prefix" && \
9870 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9871         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9872         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9873         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9874         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9875         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9876         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"
9877 }
9878
9879 done
9880
9881 cf_search="$cf_library_path_list $cf_search"
9882
9883                         for cf_libdir in $cf_search
9884                         do
9885                                 echo "$as_me:9885: checking for -l$cf_nculib_root in $cf_libdir" >&5
9886 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9887                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9888                                 cat >conftest.$ac_ext <<_ACEOF
9889 #line 9889 "configure"
9890 #include "confdefs.h"
9891 #include <${cf_cv_ncurses_header:-curses.h}>
9892 int
9893 main (void)
9894 {
9895 initscr()
9896   ;
9897   return 0;
9898 }
9899 _ACEOF
9900 rm -f conftest.$ac_objext conftest$ac_exeext
9901 if { (eval echo "$as_me:9901: \"$ac_link\"") >&5
9902   (eval $ac_link) 2>&5
9903   ac_status=$?
9904   echo "$as_me:9904: \$? = $ac_status" >&5
9905   (exit $ac_status); } &&
9906          { ac_try='test -s conftest$ac_exeext'
9907   { (eval echo "$as_me:9907: \"$ac_try\"") >&5
9908   (eval $ac_try) 2>&5
9909   ac_status=$?
9910   echo "$as_me:9910: \$? = $ac_status" >&5
9911   (exit $ac_status); }; }; then
9912   echo "$as_me:9912: result: yes" >&5
9913 echo "${ECHO_T}yes" >&6
9914                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9915                                          break
9916 else
9917   echo "$as_me: failed program was:" >&5
9918 cat conftest.$ac_ext >&5
9919 echo "$as_me:9919: result: no" >&5
9920 echo "${ECHO_T}no" >&6
9921                                          LIBS="$cf_save_LIBS"
9922 fi
9923 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9924                         done
9925
9926 fi
9927 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9928
9929 fi
9930
9931 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9932
9933 if test $cf_found_library = no ; then
9934         { { echo "$as_me:9934: error: Cannot link $cf_nculib_root library" >&5
9935 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9936    { (exit 1); exit 1; }; }
9937 fi
9938
9939 fi
9940
9941 if test -n "$cf_ncurses_LIBS" ; then
9942         echo "$as_me:9942: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9943 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9944         cf_ncurses_SAVE="$LIBS"
9945         for p in $cf_ncurses_LIBS ; do
9946                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9947                 if test "$q" != "$LIBS" ; then
9948                         LIBS="$q"
9949                 fi
9950         done
9951         cat >conftest.$ac_ext <<_ACEOF
9952 #line 9952 "configure"
9953 #include "confdefs.h"
9954 #include <${cf_cv_ncurses_header:-curses.h}>
9955 int
9956 main (void)
9957 {
9958 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9959   ;
9960   return 0;
9961 }
9962 _ACEOF
9963 rm -f conftest.$ac_objext conftest$ac_exeext
9964 if { (eval echo "$as_me:9964: \"$ac_link\"") >&5
9965   (eval $ac_link) 2>&5
9966   ac_status=$?
9967   echo "$as_me:9967: \$? = $ac_status" >&5
9968   (exit $ac_status); } &&
9969          { ac_try='test -s conftest$ac_exeext'
9970   { (eval echo "$as_me:9970: \"$ac_try\"") >&5
9971   (eval $ac_try) 2>&5
9972   ac_status=$?
9973   echo "$as_me:9973: \$? = $ac_status" >&5
9974   (exit $ac_status); }; }; then
9975   echo "$as_me:9975: result: yes" >&5
9976 echo "${ECHO_T}yes" >&6
9977 else
9978   echo "$as_me: failed program was:" >&5
9979 cat conftest.$ac_ext >&5
9980 echo "$as_me:9980: result: no" >&5
9981 echo "${ECHO_T}no" >&6
9982                  LIBS="$cf_ncurses_SAVE"
9983 fi
9984 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9985 fi
9986
9987 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9988
9989 cat >>confdefs.h <<EOF
9990 #define $cf_nculib_ROOT 1
9991 EOF
9992
9993         fi
9994 else
9995         NCURSES_CONFIG=none
9996 fi
9997
9998         ;;
9999 (pdcurses)
10000         echo "$as_me:10000: checking for X" >&5
10001 echo $ECHO_N "checking for X... $ECHO_C" >&6
10002
10003 # Check whether --with-x or --without-x was given.
10004 if test "${with_x+set}" = set; then
10005   withval="$with_x"
10006
10007 fi;
10008 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10009 if test "x$with_x" = xno; then
10010   # The user explicitly disabled X.
10011   have_x=disabled
10012 else
10013   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10014     # Both variables are already set.
10015     have_x=yes
10016   else
10017     if test "${ac_cv_have_x+set}" = set; then
10018   echo $ECHO_N "(cached) $ECHO_C" >&6
10019 else
10020   # One or both of the vars are not set, and there is no cached value.
10021 ac_x_includes=no ac_x_libraries=no
10022 rm -fr conftest.dir
10023 if mkdir conftest.dir; then
10024   cd conftest.dir
10025   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10026   cat >Imakefile <<'EOF'
10027 acfindx:
10028         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10029 EOF
10030   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10031     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10032     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10033     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10034     for ac_extension in a so sl dylib dll; do
10035       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10036          test -f $ac_im_libdir/libX11.$ac_extension; then
10037         ac_im_usrlibdir=$ac_im_libdir; break
10038       fi
10039     done
10040     # Screen out bogus values from the imake configuration.  They are
10041     # bogus both because they are the default anyway, and because
10042     # using them would break gcc on systems where it needs fixed includes.
10043     case $ac_im_incroot in
10044         /usr/include) ;;
10045         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10046     esac
10047     case $ac_im_usrlibdir in
10048         /usr/lib | /lib) ;;
10049         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10050     esac
10051   fi
10052   cd ..
10053   rm -fr conftest.dir
10054 fi
10055
10056 # Standard set of common directories for X headers.
10057 # Check X11 before X11Rn because it is often a symlink to the current release.
10058 ac_x_header_dirs='
10059 /usr/X11/include
10060 /usr/X11R6/include
10061 /usr/X11R5/include
10062 /usr/X11R4/include
10063
10064 /usr/include/X11
10065 /usr/include/X11R6
10066 /usr/include/X11R5
10067 /usr/include/X11R4
10068
10069 /usr/local/X11/include
10070 /usr/local/X11R6/include
10071 /usr/local/X11R5/include
10072 /usr/local/X11R4/include
10073
10074 /usr/local/include/X11
10075 /usr/local/include/X11R6
10076 /usr/local/include/X11R5
10077 /usr/local/include/X11R4
10078
10079 /usr/X386/include
10080 /usr/x386/include
10081 /usr/XFree86/include/X11
10082
10083 /usr/include
10084 /usr/local/include
10085 /usr/unsupported/include
10086 /usr/athena/include
10087 /usr/local/x11r5/include
10088 /usr/lpp/Xamples/include
10089
10090 /usr/openwin/include
10091 /usr/openwin/share/include'
10092
10093 if test "$ac_x_includes" = no; then
10094   # Guess where to find include files, by looking for Intrinsic.h.
10095   # First, try using that file with no special directory specified.
10096   cat >conftest.$ac_ext <<_ACEOF
10097 #line 10097 "configure"
10098 #include "confdefs.h"
10099 #include <X11/Intrinsic.h>
10100 _ACEOF
10101 if { (eval echo "$as_me:10101: \"$ac_cpp conftest.$ac_ext\"") >&5
10102   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10103   ac_status=$?
10104   egrep -v '^ *\+' conftest.er1 >conftest.err
10105   rm -f conftest.er1
10106   cat conftest.err >&5
10107   echo "$as_me:10107: \$? = $ac_status" >&5
10108   (exit $ac_status); } >/dev/null; then
10109   if test -s conftest.err; then
10110     ac_cpp_err=$ac_c_preproc_warn_flag
10111   else
10112     ac_cpp_err=
10113   fi
10114 else
10115   ac_cpp_err=yes
10116 fi
10117 if test -z "$ac_cpp_err"; then
10118   # We can compile using X headers with no special include directory.
10119 ac_x_includes=
10120 else
10121   echo "$as_me: failed program was:" >&5
10122   cat conftest.$ac_ext >&5
10123   for ac_dir in $ac_x_header_dirs; do
10124   if test -r "$ac_dir/X11/Intrinsic.h"; then
10125     ac_x_includes=$ac_dir
10126     break
10127   fi
10128 done
10129 fi
10130 rm -f conftest.err conftest.$ac_ext
10131 fi # $ac_x_includes = no
10132
10133 if test "$ac_x_libraries" = no; then
10134   # Check for the libraries.
10135   # See if we find them without any special options.
10136   # Don't add to $LIBS permanently.
10137   ac_save_LIBS=$LIBS
10138   LIBS="-lXt $LIBS"
10139   cat >conftest.$ac_ext <<_ACEOF
10140 #line 10140 "configure"
10141 #include "confdefs.h"
10142 #include <X11/Intrinsic.h>
10143 int
10144 main (void)
10145 {
10146 XtMalloc (0)
10147   ;
10148   return 0;
10149 }
10150 _ACEOF
10151 rm -f conftest.$ac_objext conftest$ac_exeext
10152 if { (eval echo "$as_me:10152: \"$ac_link\"") >&5
10153   (eval $ac_link) 2>&5
10154   ac_status=$?
10155   echo "$as_me:10155: \$? = $ac_status" >&5
10156   (exit $ac_status); } &&
10157          { ac_try='test -s conftest$ac_exeext'
10158   { (eval echo "$as_me:10158: \"$ac_try\"") >&5
10159   (eval $ac_try) 2>&5
10160   ac_status=$?
10161   echo "$as_me:10161: \$? = $ac_status" >&5
10162   (exit $ac_status); }; }; then
10163   LIBS=$ac_save_LIBS
10164 # We can link X programs with no special library path.
10165 ac_x_libraries=
10166 else
10167   echo "$as_me: failed program was:" >&5
10168 cat conftest.$ac_ext >&5
10169 LIBS=$ac_save_LIBS
10170 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10171 do
10172   # Don't even attempt the hair of trying to link an X program!
10173   for ac_extension in a so sl dylib dll; do
10174     if test -r $ac_dir/libXt.$ac_extension; then
10175       ac_x_libraries=$ac_dir
10176       break 2
10177     fi
10178   done
10179 done
10180 fi
10181 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10182 fi # $ac_x_libraries = no
10183
10184 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10185   # Didn't find X anywhere.  Cache the known absence of X.
10186   ac_cv_have_x="have_x=no"
10187 else
10188   # Record where we found X for the cache.
10189   ac_cv_have_x="have_x=yes \
10190                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10191 fi
10192 fi
10193
10194   fi
10195   eval "$ac_cv_have_x"
10196 fi # $with_x != no
10197
10198 if test "$have_x" != yes; then
10199   echo "$as_me:10199: result: $have_x" >&5
10200 echo "${ECHO_T}$have_x" >&6
10201   no_x=yes
10202 else
10203   # If each of the values was on the command line, it overrides each guess.
10204   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10205   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10206   # Update the cache value to reflect the command line values.
10207   ac_cv_have_x="have_x=yes \
10208                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10209   echo "$as_me:10209: result: libraries $x_libraries, headers $x_includes" >&5
10210 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10211 fi
10212
10213 if test "$no_x" = yes; then
10214   # Not all programs may use this symbol, but it does not hurt to define it.
10215
10216 cat >>confdefs.h <<\EOF
10217 #define X_DISPLAY_MISSING 1
10218 EOF
10219
10220   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10221 else
10222   if test -n "$x_includes"; then
10223     X_CFLAGS="$X_CFLAGS -I$x_includes"
10224   fi
10225
10226   # It would also be nice to do this for all -L options, not just this one.
10227   if test -n "$x_libraries"; then
10228     X_LIBS="$X_LIBS -L$x_libraries"
10229     # For Solaris; some versions of Sun CC require a space after -R and
10230     # others require no space.  Words are not sufficient . . . .
10231     case `(uname -sr) 2>/dev/null` in
10232     "SunOS 5"*)
10233       echo "$as_me:10233: checking whether -R must be followed by a space" >&5
10234 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10235       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10236       cat >conftest.$ac_ext <<_ACEOF
10237 #line 10237 "configure"
10238 #include "confdefs.h"
10239
10240 int
10241 main (void)
10242 {
10243
10244   ;
10245   return 0;
10246 }
10247 _ACEOF
10248 rm -f conftest.$ac_objext conftest$ac_exeext
10249 if { (eval echo "$as_me:10249: \"$ac_link\"") >&5
10250   (eval $ac_link) 2>&5
10251   ac_status=$?
10252   echo "$as_me:10252: \$? = $ac_status" >&5
10253   (exit $ac_status); } &&
10254          { ac_try='test -s conftest$ac_exeext'
10255   { (eval echo "$as_me:10255: \"$ac_try\"") >&5
10256   (eval $ac_try) 2>&5
10257   ac_status=$?
10258   echo "$as_me:10258: \$? = $ac_status" >&5
10259   (exit $ac_status); }; }; then
10260   ac_R_nospace=yes
10261 else
10262   echo "$as_me: failed program was:" >&5
10263 cat conftest.$ac_ext >&5
10264 ac_R_nospace=no
10265 fi
10266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10267       if test $ac_R_nospace = yes; then
10268         echo "$as_me:10268: result: no" >&5
10269 echo "${ECHO_T}no" >&6
10270         X_LIBS="$X_LIBS -R$x_libraries"
10271       else
10272         LIBS="$ac_xsave_LIBS -R $x_libraries"
10273         cat >conftest.$ac_ext <<_ACEOF
10274 #line 10274 "configure"
10275 #include "confdefs.h"
10276
10277 int
10278 main (void)
10279 {
10280
10281   ;
10282   return 0;
10283 }
10284 _ACEOF
10285 rm -f conftest.$ac_objext conftest$ac_exeext
10286 if { (eval echo "$as_me:10286: \"$ac_link\"") >&5
10287   (eval $ac_link) 2>&5
10288   ac_status=$?
10289   echo "$as_me:10289: \$? = $ac_status" >&5
10290   (exit $ac_status); } &&
10291          { ac_try='test -s conftest$ac_exeext'
10292   { (eval echo "$as_me:10292: \"$ac_try\"") >&5
10293   (eval $ac_try) 2>&5
10294   ac_status=$?
10295   echo "$as_me:10295: \$? = $ac_status" >&5
10296   (exit $ac_status); }; }; then
10297   ac_R_space=yes
10298 else
10299   echo "$as_me: failed program was:" >&5
10300 cat conftest.$ac_ext >&5
10301 ac_R_space=no
10302 fi
10303 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10304         if test $ac_R_space = yes; then
10305           echo "$as_me:10305: result: yes" >&5
10306 echo "${ECHO_T}yes" >&6
10307           X_LIBS="$X_LIBS -R $x_libraries"
10308         else
10309           echo "$as_me:10309: result: neither works" >&5
10310 echo "${ECHO_T}neither works" >&6
10311         fi
10312       fi
10313       LIBS=$ac_xsave_LIBS
10314     esac
10315   fi
10316
10317   # Check for system-dependent libraries X programs must link with.
10318   # Do this before checking for the system-independent R6 libraries
10319   # (-lICE), since we may need -lsocket or whatever for X linking.
10320
10321   if test "$ISC" = yes; then
10322     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10323   else
10324     # Martyn Johnson says this is needed for Ultrix, if the X
10325     # libraries were built with DECnet support.  And Karl Berry says
10326     # the Alpha needs dnet_stub (dnet does not exist).
10327     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10328     cat >conftest.$ac_ext <<_ACEOF
10329 #line 10329 "configure"
10330 #include "confdefs.h"
10331
10332 /* Override any gcc2 internal prototype to avoid an error.  */
10333 #ifdef __cplusplus
10334 extern "C"
10335 #endif
10336 /* We use char because int might match the return type of a gcc2
10337    builtin and then its argument prototype would still apply.  */
10338 char XOpenDisplay ();
10339 int
10340 main (void)
10341 {
10342 XOpenDisplay ();
10343   ;
10344   return 0;
10345 }
10346 _ACEOF
10347 rm -f conftest.$ac_objext conftest$ac_exeext
10348 if { (eval echo "$as_me:10348: \"$ac_link\"") >&5
10349   (eval $ac_link) 2>&5
10350   ac_status=$?
10351   echo "$as_me:10351: \$? = $ac_status" >&5
10352   (exit $ac_status); } &&
10353          { ac_try='test -s conftest$ac_exeext'
10354   { (eval echo "$as_me:10354: \"$ac_try\"") >&5
10355   (eval $ac_try) 2>&5
10356   ac_status=$?
10357   echo "$as_me:10357: \$? = $ac_status" >&5
10358   (exit $ac_status); }; }; then
10359   :
10360 else
10361   echo "$as_me: failed program was:" >&5
10362 cat conftest.$ac_ext >&5
10363 echo "$as_me:10363: checking for dnet_ntoa in -ldnet" >&5
10364 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10365 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10366   echo $ECHO_N "(cached) $ECHO_C" >&6
10367 else
10368   ac_check_lib_save_LIBS=$LIBS
10369 LIBS="-ldnet  $LIBS"
10370 cat >conftest.$ac_ext <<_ACEOF
10371 #line 10371 "configure"
10372 #include "confdefs.h"
10373
10374 /* Override any gcc2 internal prototype to avoid an error.  */
10375 #ifdef __cplusplus
10376 extern "C"
10377 #endif
10378 /* We use char because int might match the return type of a gcc2
10379    builtin and then its argument prototype would still apply.  */
10380 char dnet_ntoa ();
10381 int
10382 main (void)
10383 {
10384 dnet_ntoa ();
10385   ;
10386   return 0;
10387 }
10388 _ACEOF
10389 rm -f conftest.$ac_objext conftest$ac_exeext
10390 if { (eval echo "$as_me:10390: \"$ac_link\"") >&5
10391   (eval $ac_link) 2>&5
10392   ac_status=$?
10393   echo "$as_me:10393: \$? = $ac_status" >&5
10394   (exit $ac_status); } &&
10395          { ac_try='test -s conftest$ac_exeext'
10396   { (eval echo "$as_me:10396: \"$ac_try\"") >&5
10397   (eval $ac_try) 2>&5
10398   ac_status=$?
10399   echo "$as_me:10399: \$? = $ac_status" >&5
10400   (exit $ac_status); }; }; then
10401   ac_cv_lib_dnet_dnet_ntoa=yes
10402 else
10403   echo "$as_me: failed program was:" >&5
10404 cat conftest.$ac_ext >&5
10405 ac_cv_lib_dnet_dnet_ntoa=no
10406 fi
10407 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10408 LIBS=$ac_check_lib_save_LIBS
10409 fi
10410 echo "$as_me:10410: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10411 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10412 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10413   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10414 fi
10415
10416     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10417       echo "$as_me:10417: checking for dnet_ntoa in -ldnet_stub" >&5
10418 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10419 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10420   echo $ECHO_N "(cached) $ECHO_C" >&6
10421 else
10422   ac_check_lib_save_LIBS=$LIBS
10423 LIBS="-ldnet_stub  $LIBS"
10424 cat >conftest.$ac_ext <<_ACEOF
10425 #line 10425 "configure"
10426 #include "confdefs.h"
10427
10428 /* Override any gcc2 internal prototype to avoid an error.  */
10429 #ifdef __cplusplus
10430 extern "C"
10431 #endif
10432 /* We use char because int might match the return type of a gcc2
10433    builtin and then its argument prototype would still apply.  */
10434 char dnet_ntoa ();
10435 int
10436 main (void)
10437 {
10438 dnet_ntoa ();
10439   ;
10440   return 0;
10441 }
10442 _ACEOF
10443 rm -f conftest.$ac_objext conftest$ac_exeext
10444 if { (eval echo "$as_me:10444: \"$ac_link\"") >&5
10445   (eval $ac_link) 2>&5
10446   ac_status=$?
10447   echo "$as_me:10447: \$? = $ac_status" >&5
10448   (exit $ac_status); } &&
10449          { ac_try='test -s conftest$ac_exeext'
10450   { (eval echo "$as_me:10450: \"$ac_try\"") >&5
10451   (eval $ac_try) 2>&5
10452   ac_status=$?
10453   echo "$as_me:10453: \$? = $ac_status" >&5
10454   (exit $ac_status); }; }; then
10455   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10456 else
10457   echo "$as_me: failed program was:" >&5
10458 cat conftest.$ac_ext >&5
10459 ac_cv_lib_dnet_stub_dnet_ntoa=no
10460 fi
10461 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10462 LIBS=$ac_check_lib_save_LIBS
10463 fi
10464 echo "$as_me:10464: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10465 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10466 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10467   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10468 fi
10469
10470     fi
10471 fi
10472 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10473     LIBS="$ac_xsave_LIBS"
10474
10475     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10476     # to get the SysV transport functions.
10477     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10478     # needs -lnsl.
10479     # The nsl library prevents programs from opening the X display
10480     # on Irix 5.2, according to T.E. Dickey.
10481     # The functions gethostbyname, getservbyname, and inet_addr are
10482     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10483     echo "$as_me:10483: checking for gethostbyname" >&5
10484 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10485 if test "${ac_cv_func_gethostbyname+set}" = set; then
10486   echo $ECHO_N "(cached) $ECHO_C" >&6
10487 else
10488   cat >conftest.$ac_ext <<_ACEOF
10489 #line 10489 "configure"
10490 #include "confdefs.h"
10491 /* System header to define __stub macros and hopefully few prototypes,
10492     which can conflict with char gethostbyname (); below.  */
10493 #include <assert.h>
10494 /* Override any gcc2 internal prototype to avoid an error.  */
10495 #ifdef __cplusplus
10496 extern "C"
10497 #endif
10498 /* We use char because int might match the return type of a gcc2
10499    builtin and then its argument prototype would still apply.  */
10500 char gethostbyname ();
10501 char (*f) ();
10502
10503 int
10504 main (void)
10505 {
10506 /* The GNU C library defines this for functions which it implements
10507     to always fail with ENOSYS.  Some functions are actually named
10508     something starting with __ and the normal name is an alias.  */
10509 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10510 choke me
10511 #else
10512 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10513 #endif
10514
10515   ;
10516   return 0;
10517 }
10518 _ACEOF
10519 rm -f conftest.$ac_objext conftest$ac_exeext
10520 if { (eval echo "$as_me:10520: \"$ac_link\"") >&5
10521   (eval $ac_link) 2>&5
10522   ac_status=$?
10523   echo "$as_me:10523: \$? = $ac_status" >&5
10524   (exit $ac_status); } &&
10525          { ac_try='test -s conftest$ac_exeext'
10526   { (eval echo "$as_me:10526: \"$ac_try\"") >&5
10527   (eval $ac_try) 2>&5
10528   ac_status=$?
10529   echo "$as_me:10529: \$? = $ac_status" >&5
10530   (exit $ac_status); }; }; then
10531   ac_cv_func_gethostbyname=yes
10532 else
10533   echo "$as_me: failed program was:" >&5
10534 cat conftest.$ac_ext >&5
10535 ac_cv_func_gethostbyname=no
10536 fi
10537 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10538 fi
10539 echo "$as_me:10539: result: $ac_cv_func_gethostbyname" >&5
10540 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10541
10542     if test $ac_cv_func_gethostbyname = no; then
10543       echo "$as_me:10543: checking for gethostbyname in -lnsl" >&5
10544 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10545 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10546   echo $ECHO_N "(cached) $ECHO_C" >&6
10547 else
10548   ac_check_lib_save_LIBS=$LIBS
10549 LIBS="-lnsl  $LIBS"
10550 cat >conftest.$ac_ext <<_ACEOF
10551 #line 10551 "configure"
10552 #include "confdefs.h"
10553
10554 /* Override any gcc2 internal prototype to avoid an error.  */
10555 #ifdef __cplusplus
10556 extern "C"
10557 #endif
10558 /* We use char because int might match the return type of a gcc2
10559    builtin and then its argument prototype would still apply.  */
10560 char gethostbyname ();
10561 int
10562 main (void)
10563 {
10564 gethostbyname ();
10565   ;
10566   return 0;
10567 }
10568 _ACEOF
10569 rm -f conftest.$ac_objext conftest$ac_exeext
10570 if { (eval echo "$as_me:10570: \"$ac_link\"") >&5
10571   (eval $ac_link) 2>&5
10572   ac_status=$?
10573   echo "$as_me:10573: \$? = $ac_status" >&5
10574   (exit $ac_status); } &&
10575          { ac_try='test -s conftest$ac_exeext'
10576   { (eval echo "$as_me:10576: \"$ac_try\"") >&5
10577   (eval $ac_try) 2>&5
10578   ac_status=$?
10579   echo "$as_me:10579: \$? = $ac_status" >&5
10580   (exit $ac_status); }; }; then
10581   ac_cv_lib_nsl_gethostbyname=yes
10582 else
10583   echo "$as_me: failed program was:" >&5
10584 cat conftest.$ac_ext >&5
10585 ac_cv_lib_nsl_gethostbyname=no
10586 fi
10587 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10588 LIBS=$ac_check_lib_save_LIBS
10589 fi
10590 echo "$as_me:10590: result: $ac_cv_lib_nsl_gethostbyname" >&5
10591 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10592 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10593   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10594 fi
10595
10596       if test $ac_cv_lib_nsl_gethostbyname = no; then
10597         echo "$as_me:10597: checking for gethostbyname in -lbsd" >&5
10598 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10599 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10600   echo $ECHO_N "(cached) $ECHO_C" >&6
10601 else
10602   ac_check_lib_save_LIBS=$LIBS
10603 LIBS="-lbsd  $LIBS"
10604 cat >conftest.$ac_ext <<_ACEOF
10605 #line 10605 "configure"
10606 #include "confdefs.h"
10607
10608 /* Override any gcc2 internal prototype to avoid an error.  */
10609 #ifdef __cplusplus
10610 extern "C"
10611 #endif
10612 /* We use char because int might match the return type of a gcc2
10613    builtin and then its argument prototype would still apply.  */
10614 char gethostbyname ();
10615 int
10616 main (void)
10617 {
10618 gethostbyname ();
10619   ;
10620   return 0;
10621 }
10622 _ACEOF
10623 rm -f conftest.$ac_objext conftest$ac_exeext
10624 if { (eval echo "$as_me:10624: \"$ac_link\"") >&5
10625   (eval $ac_link) 2>&5
10626   ac_status=$?
10627   echo "$as_me:10627: \$? = $ac_status" >&5
10628   (exit $ac_status); } &&
10629          { ac_try='test -s conftest$ac_exeext'
10630   { (eval echo "$as_me:10630: \"$ac_try\"") >&5
10631   (eval $ac_try) 2>&5
10632   ac_status=$?
10633   echo "$as_me:10633: \$? = $ac_status" >&5
10634   (exit $ac_status); }; }; then
10635   ac_cv_lib_bsd_gethostbyname=yes
10636 else
10637   echo "$as_me: failed program was:" >&5
10638 cat conftest.$ac_ext >&5
10639 ac_cv_lib_bsd_gethostbyname=no
10640 fi
10641 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10642 LIBS=$ac_check_lib_save_LIBS
10643 fi
10644 echo "$as_me:10644: result: $ac_cv_lib_bsd_gethostbyname" >&5
10645 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10646 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10647   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10648 fi
10649
10650       fi
10651     fi
10652
10653     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10654     # socket/setsockopt and other routines are undefined under SCO ODT
10655     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10656     # on later versions), says Simon Leinen: it contains gethostby*
10657     # variants that don't use the nameserver (or something).  -lsocket
10658     # must be given before -lnsl if both are needed.  We assume that
10659     # if connect needs -lnsl, so does gethostbyname.
10660     echo "$as_me:10660: checking for connect" >&5
10661 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10662 if test "${ac_cv_func_connect+set}" = set; then
10663   echo $ECHO_N "(cached) $ECHO_C" >&6
10664 else
10665   cat >conftest.$ac_ext <<_ACEOF
10666 #line 10666 "configure"
10667 #include "confdefs.h"
10668 /* System header to define __stub macros and hopefully few prototypes,
10669     which can conflict with char connect (); below.  */
10670 #include <assert.h>
10671 /* Override any gcc2 internal prototype to avoid an error.  */
10672 #ifdef __cplusplus
10673 extern "C"
10674 #endif
10675 /* We use char because int might match the return type of a gcc2
10676    builtin and then its argument prototype would still apply.  */
10677 char connect ();
10678 char (*f) ();
10679
10680 int
10681 main (void)
10682 {
10683 /* The GNU C library defines this for functions which it implements
10684     to always fail with ENOSYS.  Some functions are actually named
10685     something starting with __ and the normal name is an alias.  */
10686 #if defined (__stub_connect) || defined (__stub___connect)
10687 choke me
10688 #else
10689 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10690 #endif
10691
10692   ;
10693   return 0;
10694 }
10695 _ACEOF
10696 rm -f conftest.$ac_objext conftest$ac_exeext
10697 if { (eval echo "$as_me:10697: \"$ac_link\"") >&5
10698   (eval $ac_link) 2>&5
10699   ac_status=$?
10700   echo "$as_me:10700: \$? = $ac_status" >&5
10701   (exit $ac_status); } &&
10702          { ac_try='test -s conftest$ac_exeext'
10703   { (eval echo "$as_me:10703: \"$ac_try\"") >&5
10704   (eval $ac_try) 2>&5
10705   ac_status=$?
10706   echo "$as_me:10706: \$? = $ac_status" >&5
10707   (exit $ac_status); }; }; then
10708   ac_cv_func_connect=yes
10709 else
10710   echo "$as_me: failed program was:" >&5
10711 cat conftest.$ac_ext >&5
10712 ac_cv_func_connect=no
10713 fi
10714 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10715 fi
10716 echo "$as_me:10716: result: $ac_cv_func_connect" >&5
10717 echo "${ECHO_T}$ac_cv_func_connect" >&6
10718
10719     if test $ac_cv_func_connect = no; then
10720       echo "$as_me:10720: checking for connect in -lsocket" >&5
10721 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10722 if test "${ac_cv_lib_socket_connect+set}" = set; then
10723   echo $ECHO_N "(cached) $ECHO_C" >&6
10724 else
10725   ac_check_lib_save_LIBS=$LIBS
10726 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10727 cat >conftest.$ac_ext <<_ACEOF
10728 #line 10728 "configure"
10729 #include "confdefs.h"
10730
10731 /* Override any gcc2 internal prototype to avoid an error.  */
10732 #ifdef __cplusplus
10733 extern "C"
10734 #endif
10735 /* We use char because int might match the return type of a gcc2
10736    builtin and then its argument prototype would still apply.  */
10737 char connect ();
10738 int
10739 main (void)
10740 {
10741 connect ();
10742   ;
10743   return 0;
10744 }
10745 _ACEOF
10746 rm -f conftest.$ac_objext conftest$ac_exeext
10747 if { (eval echo "$as_me:10747: \"$ac_link\"") >&5
10748   (eval $ac_link) 2>&5
10749   ac_status=$?
10750   echo "$as_me:10750: \$? = $ac_status" >&5
10751   (exit $ac_status); } &&
10752          { ac_try='test -s conftest$ac_exeext'
10753   { (eval echo "$as_me:10753: \"$ac_try\"") >&5
10754   (eval $ac_try) 2>&5
10755   ac_status=$?
10756   echo "$as_me:10756: \$? = $ac_status" >&5
10757   (exit $ac_status); }; }; then
10758   ac_cv_lib_socket_connect=yes
10759 else
10760   echo "$as_me: failed program was:" >&5
10761 cat conftest.$ac_ext >&5
10762 ac_cv_lib_socket_connect=no
10763 fi
10764 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10765 LIBS=$ac_check_lib_save_LIBS
10766 fi
10767 echo "$as_me:10767: result: $ac_cv_lib_socket_connect" >&5
10768 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10769 if test $ac_cv_lib_socket_connect = yes; then
10770   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10771 fi
10772
10773     fi
10774
10775     # Guillermo Gomez says -lposix is necessary on A/UX.
10776     echo "$as_me:10776: checking for remove" >&5
10777 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10778 if test "${ac_cv_func_remove+set}" = set; then
10779   echo $ECHO_N "(cached) $ECHO_C" >&6
10780 else
10781   cat >conftest.$ac_ext <<_ACEOF
10782 #line 10782 "configure"
10783 #include "confdefs.h"
10784 /* System header to define __stub macros and hopefully few prototypes,
10785     which can conflict with char remove (); below.  */
10786 #include <assert.h>
10787 /* Override any gcc2 internal prototype to avoid an error.  */
10788 #ifdef __cplusplus
10789 extern "C"
10790 #endif
10791 /* We use char because int might match the return type of a gcc2
10792    builtin and then its argument prototype would still apply.  */
10793 char remove ();
10794 char (*f) ();
10795
10796 int
10797 main (void)
10798 {
10799 /* The GNU C library defines this for functions which it implements
10800     to always fail with ENOSYS.  Some functions are actually named
10801     something starting with __ and the normal name is an alias.  */
10802 #if defined (__stub_remove) || defined (__stub___remove)
10803 choke me
10804 #else
10805 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10806 #endif
10807
10808   ;
10809   return 0;
10810 }
10811 _ACEOF
10812 rm -f conftest.$ac_objext conftest$ac_exeext
10813 if { (eval echo "$as_me:10813: \"$ac_link\"") >&5
10814   (eval $ac_link) 2>&5
10815   ac_status=$?
10816   echo "$as_me:10816: \$? = $ac_status" >&5
10817   (exit $ac_status); } &&
10818          { ac_try='test -s conftest$ac_exeext'
10819   { (eval echo "$as_me:10819: \"$ac_try\"") >&5
10820   (eval $ac_try) 2>&5
10821   ac_status=$?
10822   echo "$as_me:10822: \$? = $ac_status" >&5
10823   (exit $ac_status); }; }; then
10824   ac_cv_func_remove=yes
10825 else
10826   echo "$as_me: failed program was:" >&5
10827 cat conftest.$ac_ext >&5
10828 ac_cv_func_remove=no
10829 fi
10830 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10831 fi
10832 echo "$as_me:10832: result: $ac_cv_func_remove" >&5
10833 echo "${ECHO_T}$ac_cv_func_remove" >&6
10834
10835     if test $ac_cv_func_remove = no; then
10836       echo "$as_me:10836: checking for remove in -lposix" >&5
10837 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10838 if test "${ac_cv_lib_posix_remove+set}" = set; then
10839   echo $ECHO_N "(cached) $ECHO_C" >&6
10840 else
10841   ac_check_lib_save_LIBS=$LIBS
10842 LIBS="-lposix  $LIBS"
10843 cat >conftest.$ac_ext <<_ACEOF
10844 #line 10844 "configure"
10845 #include "confdefs.h"
10846
10847 /* Override any gcc2 internal prototype to avoid an error.  */
10848 #ifdef __cplusplus
10849 extern "C"
10850 #endif
10851 /* We use char because int might match the return type of a gcc2
10852    builtin and then its argument prototype would still apply.  */
10853 char remove ();
10854 int
10855 main (void)
10856 {
10857 remove ();
10858   ;
10859   return 0;
10860 }
10861 _ACEOF
10862 rm -f conftest.$ac_objext conftest$ac_exeext
10863 if { (eval echo "$as_me:10863: \"$ac_link\"") >&5
10864   (eval $ac_link) 2>&5
10865   ac_status=$?
10866   echo "$as_me:10866: \$? = $ac_status" >&5
10867   (exit $ac_status); } &&
10868          { ac_try='test -s conftest$ac_exeext'
10869   { (eval echo "$as_me:10869: \"$ac_try\"") >&5
10870   (eval $ac_try) 2>&5
10871   ac_status=$?
10872   echo "$as_me:10872: \$? = $ac_status" >&5
10873   (exit $ac_status); }; }; then
10874   ac_cv_lib_posix_remove=yes
10875 else
10876   echo "$as_me: failed program was:" >&5
10877 cat conftest.$ac_ext >&5
10878 ac_cv_lib_posix_remove=no
10879 fi
10880 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10881 LIBS=$ac_check_lib_save_LIBS
10882 fi
10883 echo "$as_me:10883: result: $ac_cv_lib_posix_remove" >&5
10884 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10885 if test $ac_cv_lib_posix_remove = yes; then
10886   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10887 fi
10888
10889     fi
10890
10891     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10892     echo "$as_me:10892: checking for shmat" >&5
10893 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10894 if test "${ac_cv_func_shmat+set}" = set; then
10895   echo $ECHO_N "(cached) $ECHO_C" >&6
10896 else
10897   cat >conftest.$ac_ext <<_ACEOF
10898 #line 10898 "configure"
10899 #include "confdefs.h"
10900 /* System header to define __stub macros and hopefully few prototypes,
10901     which can conflict with char shmat (); below.  */
10902 #include <assert.h>
10903 /* Override any gcc2 internal prototype to avoid an error.  */
10904 #ifdef __cplusplus
10905 extern "C"
10906 #endif
10907 /* We use char because int might match the return type of a gcc2
10908    builtin and then its argument prototype would still apply.  */
10909 char shmat ();
10910 char (*f) ();
10911
10912 int
10913 main (void)
10914 {
10915 /* The GNU C library defines this for functions which it implements
10916     to always fail with ENOSYS.  Some functions are actually named
10917     something starting with __ and the normal name is an alias.  */
10918 #if defined (__stub_shmat) || defined (__stub___shmat)
10919 choke me
10920 #else
10921 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10922 #endif
10923
10924   ;
10925   return 0;
10926 }
10927 _ACEOF
10928 rm -f conftest.$ac_objext conftest$ac_exeext
10929 if { (eval echo "$as_me:10929: \"$ac_link\"") >&5
10930   (eval $ac_link) 2>&5
10931   ac_status=$?
10932   echo "$as_me:10932: \$? = $ac_status" >&5
10933   (exit $ac_status); } &&
10934          { ac_try='test -s conftest$ac_exeext'
10935   { (eval echo "$as_me:10935: \"$ac_try\"") >&5
10936   (eval $ac_try) 2>&5
10937   ac_status=$?
10938   echo "$as_me:10938: \$? = $ac_status" >&5
10939   (exit $ac_status); }; }; then
10940   ac_cv_func_shmat=yes
10941 else
10942   echo "$as_me: failed program was:" >&5
10943 cat conftest.$ac_ext >&5
10944 ac_cv_func_shmat=no
10945 fi
10946 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10947 fi
10948 echo "$as_me:10948: result: $ac_cv_func_shmat" >&5
10949 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10950
10951     if test $ac_cv_func_shmat = no; then
10952       echo "$as_me:10952: checking for shmat in -lipc" >&5
10953 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10954 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10955   echo $ECHO_N "(cached) $ECHO_C" >&6
10956 else
10957   ac_check_lib_save_LIBS=$LIBS
10958 LIBS="-lipc  $LIBS"
10959 cat >conftest.$ac_ext <<_ACEOF
10960 #line 10960 "configure"
10961 #include "confdefs.h"
10962
10963 /* Override any gcc2 internal prototype to avoid an error.  */
10964 #ifdef __cplusplus
10965 extern "C"
10966 #endif
10967 /* We use char because int might match the return type of a gcc2
10968    builtin and then its argument prototype would still apply.  */
10969 char shmat ();
10970 int
10971 main (void)
10972 {
10973 shmat ();
10974   ;
10975   return 0;
10976 }
10977 _ACEOF
10978 rm -f conftest.$ac_objext conftest$ac_exeext
10979 if { (eval echo "$as_me:10979: \"$ac_link\"") >&5
10980   (eval $ac_link) 2>&5
10981   ac_status=$?
10982   echo "$as_me:10982: \$? = $ac_status" >&5
10983   (exit $ac_status); } &&
10984          { ac_try='test -s conftest$ac_exeext'
10985   { (eval echo "$as_me:10985: \"$ac_try\"") >&5
10986   (eval $ac_try) 2>&5
10987   ac_status=$?
10988   echo "$as_me:10988: \$? = $ac_status" >&5
10989   (exit $ac_status); }; }; then
10990   ac_cv_lib_ipc_shmat=yes
10991 else
10992   echo "$as_me: failed program was:" >&5
10993 cat conftest.$ac_ext >&5
10994 ac_cv_lib_ipc_shmat=no
10995 fi
10996 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10997 LIBS=$ac_check_lib_save_LIBS
10998 fi
10999 echo "$as_me:10999: result: $ac_cv_lib_ipc_shmat" >&5
11000 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11001 if test $ac_cv_lib_ipc_shmat = yes; then
11002   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11003 fi
11004
11005     fi
11006   fi
11007
11008   # Check for libraries that X11R6 Xt/Xaw programs need.
11009   ac_save_LDFLAGS=$LDFLAGS
11010   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11011   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11012   # check for ICE first), but we must link in the order -lSM -lICE or
11013   # we get undefined symbols.  So assume we have SM if we have ICE.
11014   # These have to be linked with before -lX11, unlike the other
11015   # libraries we check for below, so use a different variable.
11016   # John Interrante, Karl Berry
11017   echo "$as_me:11017: checking for IceConnectionNumber in -lICE" >&5
11018 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11019 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11020   echo $ECHO_N "(cached) $ECHO_C" >&6
11021 else
11022   ac_check_lib_save_LIBS=$LIBS
11023 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11024 cat >conftest.$ac_ext <<_ACEOF
11025 #line 11025 "configure"
11026 #include "confdefs.h"
11027
11028 /* Override any gcc2 internal prototype to avoid an error.  */
11029 #ifdef __cplusplus
11030 extern "C"
11031 #endif
11032 /* We use char because int might match the return type of a gcc2
11033    builtin and then its argument prototype would still apply.  */
11034 char IceConnectionNumber ();
11035 int
11036 main (void)
11037 {
11038 IceConnectionNumber ();
11039   ;
11040   return 0;
11041 }
11042 _ACEOF
11043 rm -f conftest.$ac_objext conftest$ac_exeext
11044 if { (eval echo "$as_me:11044: \"$ac_link\"") >&5
11045   (eval $ac_link) 2>&5
11046   ac_status=$?
11047   echo "$as_me:11047: \$? = $ac_status" >&5
11048   (exit $ac_status); } &&
11049          { ac_try='test -s conftest$ac_exeext'
11050   { (eval echo "$as_me:11050: \"$ac_try\"") >&5
11051   (eval $ac_try) 2>&5
11052   ac_status=$?
11053   echo "$as_me:11053: \$? = $ac_status" >&5
11054   (exit $ac_status); }; }; then
11055   ac_cv_lib_ICE_IceConnectionNumber=yes
11056 else
11057   echo "$as_me: failed program was:" >&5
11058 cat conftest.$ac_ext >&5
11059 ac_cv_lib_ICE_IceConnectionNumber=no
11060 fi
11061 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11062 LIBS=$ac_check_lib_save_LIBS
11063 fi
11064 echo "$as_me:11064: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11065 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11066 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11067   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11068 fi
11069
11070   LDFLAGS=$ac_save_LDFLAGS
11071
11072 fi
11073
11074 cf_x_athena=${cf_x_athena:-Xaw}
11075
11076 echo "$as_me:11076: checking if you want to link with Xaw 3d library" >&5
11077 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11078 withval=
11079
11080 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11081 if test "${with_Xaw3d+set}" = set; then
11082   withval="$with_Xaw3d"
11083
11084 fi;
11085 if test "$withval" = yes ; then
11086         cf_x_athena=Xaw3d
11087         echo "$as_me:11087: result: yes" >&5
11088 echo "${ECHO_T}yes" >&6
11089 else
11090         echo "$as_me:11090: result: no" >&5
11091 echo "${ECHO_T}no" >&6
11092 fi
11093
11094 echo "$as_me:11094: checking if you want to link with Xaw 3d xft library" >&5
11095 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
11096 withval=
11097
11098 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
11099 if test "${with_Xaw3dxft+set}" = set; then
11100   withval="$with_Xaw3dxft"
11101
11102 fi;
11103 if test "$withval" = yes ; then
11104         cf_x_athena=Xaw3dxft
11105         echo "$as_me:11105: result: yes" >&5
11106 echo "${ECHO_T}yes" >&6
11107 else
11108         echo "$as_me:11108: result: no" >&5
11109 echo "${ECHO_T}no" >&6
11110 fi
11111
11112 echo "$as_me:11112: checking if you want to link with neXT Athena library" >&5
11113 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11114 withval=
11115
11116 # Check whether --with-neXtaw or --without-neXtaw was given.
11117 if test "${with_neXtaw+set}" = set; then
11118   withval="$with_neXtaw"
11119
11120 fi;
11121 if test "$withval" = yes ; then
11122         cf_x_athena=neXtaw
11123         echo "$as_me:11123: result: yes" >&5
11124 echo "${ECHO_T}yes" >&6
11125 else
11126         echo "$as_me:11126: result: no" >&5
11127 echo "${ECHO_T}no" >&6
11128 fi
11129
11130 echo "$as_me:11130: checking if you want to link with Athena-Plus library" >&5
11131 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11132 withval=
11133
11134 # Check whether --with-XawPlus or --without-XawPlus was given.
11135 if test "${with_XawPlus+set}" = set; then
11136   withval="$with_XawPlus"
11137
11138 fi;
11139 if test "$withval" = yes ; then
11140         cf_x_athena=XawPlus
11141         echo "$as_me:11141: result: yes" >&5
11142 echo "${ECHO_T}yes" >&6
11143 else
11144         echo "$as_me:11144: result: no" >&5
11145 echo "${ECHO_T}no" >&6
11146 fi
11147
11148 cf_x_athena_lib=""
11149
11150 if test "$PKG_CONFIG" != none ; then
11151         cf_athena_list=
11152         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11153         for cf_athena_pkg in \
11154                 $cf_athena_list \
11155                 ${cf_x_athena} \
11156                 ${cf_x_athena}-devel \
11157                 lib${cf_x_athena} \
11158                 lib${cf_x_athena}-devel
11159         do
11160
11161 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11162         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11163
11164 echo "${as_me:-configure}:11164: testing found package $cf_athena_pkg ..." 1>&5
11165
11166         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11167         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11168         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11169
11170 echo "${as_me:-configure}:11170: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11171
11172         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11173
11174 echo "${as_me:-configure}:11174: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11175
11176 cf_fix_cppflags=no
11177 cf_new_cflags=
11178 cf_new_cppflags=
11179 cf_new_extra_cppflags=
11180
11181 for cf_add_cflags in $cf_pkgconfig_incs
11182 do
11183 case $cf_fix_cppflags in
11184 (no)
11185         case $cf_add_cflags in
11186         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11187                 case $cf_add_cflags in
11188                 (-D*)
11189                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11190
11191                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11192                                 && test -z "${cf_tst_cflags}" \
11193                                 && cf_fix_cppflags=yes
11194
11195                         if test $cf_fix_cppflags = yes ; then
11196
11197         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11198         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11199
11200                                 continue
11201                         elif test "${cf_tst_cflags}" = "\"'" ; then
11202
11203         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11204         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11205
11206                                 continue
11207                         fi
11208                         ;;
11209                 esac
11210                 case "$CPPFLAGS" in
11211                 (*$cf_add_cflags)
11212                         ;;
11213                 (*)
11214                         case $cf_add_cflags in
11215                         (-D*)
11216                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11217
11218 CPPFLAGS=`echo "$CPPFLAGS" | \
11219         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11220                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11221
11222                                 ;;
11223                         esac
11224
11225         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11226         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11227
11228                         ;;
11229                 esac
11230                 ;;
11231         (*)
11232
11233         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11234         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11235
11236                 ;;
11237         esac
11238         ;;
11239 (yes)
11240
11241         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11242         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11243
11244         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11245
11246         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11247                 && test -z "${cf_tst_cflags}" \
11248                 && cf_fix_cppflags=no
11249         ;;
11250 esac
11251 done
11252
11253 if test -n "$cf_new_cflags" ; then
11254
11255         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11256         CFLAGS="${CFLAGS}$cf_new_cflags"
11257
11258 fi
11259
11260 if test -n "$cf_new_cppflags" ; then
11261
11262         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11263         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11264
11265 fi
11266
11267 if test -n "$cf_new_extra_cppflags" ; then
11268
11269         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11270         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11271
11272 fi
11273
11274 cf_add_libs="$cf_pkgconfig_libs"
11275 # Filter out duplicates - this happens with badly-designed ".pc" files...
11276 for cf_add_1lib in $LIBS
11277 do
11278         for cf_add_2lib in $cf_add_libs
11279         do
11280                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11281                 then
11282                         cf_add_1lib=
11283                         break
11284                 fi
11285         done
11286         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11287 done
11288 LIBS="$cf_add_libs"
11289
11290                         cf_x_athena_lib="$cf_pkgconfig_libs"
11291
11292 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11293
11294                         cat >>confdefs.h <<EOF
11295 #define $cf_x_athena_LIBS 1
11296 EOF
11297
11298         for cf_trim_lib in Xmu Xt X11
11299         do
11300                 case "$LIBS" in
11301                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11302                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11303                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11304
11305 echo "${as_me:-configure}:11305: testing ..trimmed $LIBS ..." 1>&5
11306
11307                         ;;
11308                 esac
11309         done
11310
11311 echo "$as_me:11311: checking for usable $cf_x_athena/Xmu package" >&5
11312 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11313 if test "${cf_cv_xaw_compat+set}" = set; then
11314   echo $ECHO_N "(cached) $ECHO_C" >&6
11315 else
11316
11317 cat >conftest.$ac_ext <<_ACEOF
11318 #line 11318 "configure"
11319 #include "confdefs.h"
11320
11321 #include <X11/Xmu/CharSet.h>
11322
11323 int
11324 main (void)
11325 {
11326
11327 int check = XmuCompareISOLatin1("big", "small")
11328
11329   ;
11330   return 0;
11331 }
11332 _ACEOF
11333 rm -f conftest.$ac_objext conftest$ac_exeext
11334 if { (eval echo "$as_me:11334: \"$ac_link\"") >&5
11335   (eval $ac_link) 2>&5
11336   ac_status=$?
11337   echo "$as_me:11337: \$? = $ac_status" >&5
11338   (exit $ac_status); } &&
11339          { ac_try='test -s conftest$ac_exeext'
11340   { (eval echo "$as_me:11340: \"$ac_try\"") >&5
11341   (eval $ac_try) 2>&5
11342   ac_status=$?
11343   echo "$as_me:11343: \$? = $ac_status" >&5
11344   (exit $ac_status); }; }; then
11345   cf_cv_xaw_compat=yes
11346 else
11347   echo "$as_me: failed program was:" >&5
11348 cat conftest.$ac_ext >&5
11349 cf_cv_xaw_compat=no
11350 fi
11351 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11352 fi
11353 echo "$as_me:11353: result: $cf_cv_xaw_compat" >&5
11354 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11355
11356                         if test "$cf_cv_xaw_compat" = no
11357                         then
11358                                 # workaround for broken ".pc" files...
11359                                 case "$cf_x_athena_lib" in
11360                                 (*-lXmu*)
11361                                         ;;
11362                                 (*)
11363                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11364
11365 echo "${as_me:-configure}:11365: testing work around broken package ..." 1>&5
11366
11367                                         cf_save_xmu="$LIBS"
11368                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11369
11370 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11371         test -n "$verbose" && echo "    found package xmu" 1>&6
11372
11373 echo "${as_me:-configure}:11373: testing found package xmu ..." 1>&5
11374
11375         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11376         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11377         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11378
11379 echo "${as_me:-configure}:11379: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11380
11381         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11382
11383 echo "${as_me:-configure}:11383: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11384
11385 cf_fix_cppflags=no
11386 cf_new_cflags=
11387 cf_new_cppflags=
11388 cf_new_extra_cppflags=
11389
11390 for cf_add_cflags in $cf_pkgconfig_incs
11391 do
11392 case $cf_fix_cppflags in
11393 (no)
11394         case $cf_add_cflags in
11395         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11396                 case $cf_add_cflags in
11397                 (-D*)
11398                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11399
11400                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11401                                 && test -z "${cf_tst_cflags}" \
11402                                 && cf_fix_cppflags=yes
11403
11404                         if test $cf_fix_cppflags = yes ; then
11405
11406         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11407         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11408
11409                                 continue
11410                         elif test "${cf_tst_cflags}" = "\"'" ; then
11411
11412         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11413         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11414
11415                                 continue
11416                         fi
11417                         ;;
11418                 esac
11419                 case "$CPPFLAGS" in
11420                 (*$cf_add_cflags)
11421                         ;;
11422                 (*)
11423                         case $cf_add_cflags in
11424                         (-D*)
11425                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11426
11427 CPPFLAGS=`echo "$CPPFLAGS" | \
11428         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11429                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11430
11431                                 ;;
11432                         esac
11433
11434         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11435         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11436
11437                         ;;
11438                 esac
11439                 ;;
11440         (*)
11441
11442         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11443         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11444
11445                 ;;
11446         esac
11447         ;;
11448 (yes)
11449
11450         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11451         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11452
11453         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11454
11455         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11456                 && test -z "${cf_tst_cflags}" \
11457                 && cf_fix_cppflags=no
11458         ;;
11459 esac
11460 done
11461
11462 if test -n "$cf_new_cflags" ; then
11463
11464         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11465         CFLAGS="${CFLAGS}$cf_new_cflags"
11466
11467 fi
11468
11469 if test -n "$cf_new_cppflags" ; then
11470
11471         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11472         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11473
11474 fi
11475
11476 if test -n "$cf_new_extra_cppflags" ; then
11477
11478         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11479         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11480
11481 fi
11482
11483 cf_add_libs="$cf_pkgconfig_libs"
11484 # Filter out duplicates - this happens with badly-designed ".pc" files...
11485 for cf_add_1lib in $LIBS
11486 do
11487         for cf_add_2lib in $cf_add_libs
11488         do
11489                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11490                 then
11491                         cf_add_1lib=
11492                         break
11493                 fi
11494         done
11495         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11496 done
11497 LIBS="$cf_add_libs"
11498
11499                                                         LIBS="$cf_save_xmu"
11500
11501 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11502
11503 echo "${as_me:-configure}:11503: testing ...before $LIBS ..." 1>&5
11504
11505 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11506 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11507
11508 echo "${as_me:-configure}:11508: testing ...after  $LIBS ..." 1>&5
11509
11510 else
11511         cf_pkgconfig_incs=
11512         cf_pkgconfig_libs=
11513
11514 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11515
11516 echo "${as_me:-configure}:11516: testing ...before $LIBS ..." 1>&5
11517
11518 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11519 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11520
11521 echo "${as_me:-configure}:11521: testing ...after  $LIBS ..." 1>&5
11522
11523 fi
11524
11525         for cf_trim_lib in Xmu Xt X11
11526         do
11527                 case "$LIBS" in
11528                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11529                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11530                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11531
11532 echo "${as_me:-configure}:11532: testing ..trimmed $LIBS ..." 1>&5
11533
11534                         ;;
11535                 esac
11536         done
11537
11538                                         ;;
11539                                 esac
11540                         fi
11541
11542                         break
11543 else
11544         cf_pkgconfig_incs=
11545         cf_pkgconfig_libs=
11546         :
11547 fi
11548
11549         done
11550 fi
11551
11552 if test -z "$cf_x_athena_lib" ; then
11553
11554 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11555         test -n "$verbose" && echo "    found package Xext" 1>&6
11556
11557 echo "${as_me:-configure}:11557: testing found package Xext ..." 1>&5
11558
11559         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11560         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11561         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11562
11563 echo "${as_me:-configure}:11563: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11564
11565         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11566
11567 echo "${as_me:-configure}:11567: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11568
11569 cf_fix_cppflags=no
11570 cf_new_cflags=
11571 cf_new_cppflags=
11572 cf_new_extra_cppflags=
11573
11574 for cf_add_cflags in $cf_pkgconfig_incs
11575 do
11576 case $cf_fix_cppflags in
11577 (no)
11578         case $cf_add_cflags in
11579         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11580                 case $cf_add_cflags in
11581                 (-D*)
11582                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11583
11584                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11585                                 && test -z "${cf_tst_cflags}" \
11586                                 && cf_fix_cppflags=yes
11587
11588                         if test $cf_fix_cppflags = yes ; then
11589
11590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11592
11593                                 continue
11594                         elif test "${cf_tst_cflags}" = "\"'" ; then
11595
11596         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11597         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11598
11599                                 continue
11600                         fi
11601                         ;;
11602                 esac
11603                 case "$CPPFLAGS" in
11604                 (*$cf_add_cflags)
11605                         ;;
11606                 (*)
11607                         case $cf_add_cflags in
11608                         (-D*)
11609                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11610
11611 CPPFLAGS=`echo "$CPPFLAGS" | \
11612         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11613                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11614
11615                                 ;;
11616                         esac
11617
11618         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11619         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11620
11621                         ;;
11622                 esac
11623                 ;;
11624         (*)
11625
11626         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11627         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11628
11629                 ;;
11630         esac
11631         ;;
11632 (yes)
11633
11634         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11635         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11636
11637         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11638
11639         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11640                 && test -z "${cf_tst_cflags}" \
11641                 && cf_fix_cppflags=no
11642         ;;
11643 esac
11644 done
11645
11646 if test -n "$cf_new_cflags" ; then
11647
11648         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11649         CFLAGS="${CFLAGS}$cf_new_cflags"
11650
11651 fi
11652
11653 if test -n "$cf_new_cppflags" ; then
11654
11655         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11656         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11657
11658 fi
11659
11660 if test -n "$cf_new_extra_cppflags" ; then
11661
11662         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11663         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11664
11665 fi
11666
11667 cf_add_libs="$cf_pkgconfig_libs"
11668 # Filter out duplicates - this happens with badly-designed ".pc" files...
11669 for cf_add_1lib in $LIBS
11670 do
11671         for cf_add_2lib in $cf_add_libs
11672         do
11673                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11674                 then
11675                         cf_add_1lib=
11676                         break
11677                 fi
11678         done
11679         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11680 done
11681 LIBS="$cf_add_libs"
11682
11683         :
11684 else
11685         cf_pkgconfig_incs=
11686         cf_pkgconfig_libs=
11687
11688         echo "$as_me:11688: checking for XextCreateExtension in -lXext" >&5
11689 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11690 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11691   echo $ECHO_N "(cached) $ECHO_C" >&6
11692 else
11693   ac_check_lib_save_LIBS=$LIBS
11694 LIBS="-lXext  $LIBS"
11695 cat >conftest.$ac_ext <<_ACEOF
11696 #line 11696 "configure"
11697 #include "confdefs.h"
11698
11699 /* Override any gcc2 internal prototype to avoid an error.  */
11700 #ifdef __cplusplus
11701 extern "C"
11702 #endif
11703 /* We use char because int might match the return type of a gcc2
11704    builtin and then its argument prototype would still apply.  */
11705 char XextCreateExtension ();
11706 int
11707 main (void)
11708 {
11709 XextCreateExtension ();
11710   ;
11711   return 0;
11712 }
11713 _ACEOF
11714 rm -f conftest.$ac_objext conftest$ac_exeext
11715 if { (eval echo "$as_me:11715: \"$ac_link\"") >&5
11716   (eval $ac_link) 2>&5
11717   ac_status=$?
11718   echo "$as_me:11718: \$? = $ac_status" >&5
11719   (exit $ac_status); } &&
11720          { ac_try='test -s conftest$ac_exeext'
11721   { (eval echo "$as_me:11721: \"$ac_try\"") >&5
11722   (eval $ac_try) 2>&5
11723   ac_status=$?
11724   echo "$as_me:11724: \$? = $ac_status" >&5
11725   (exit $ac_status); }; }; then
11726   ac_cv_lib_Xext_XextCreateExtension=yes
11727 else
11728   echo "$as_me: failed program was:" >&5
11729 cat conftest.$ac_ext >&5
11730 ac_cv_lib_Xext_XextCreateExtension=no
11731 fi
11732 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11733 LIBS=$ac_check_lib_save_LIBS
11734 fi
11735 echo "$as_me:11735: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11736 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11737 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11738
11739 cf_add_libs="-lXext"
11740 # Filter out duplicates - this happens with badly-designed ".pc" files...
11741 for cf_add_1lib in $LIBS
11742 do
11743         for cf_add_2lib in $cf_add_libs
11744         do
11745                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11746                 then
11747                         cf_add_1lib=
11748                         break
11749                 fi
11750         done
11751         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11752 done
11753 LIBS="$cf_add_libs"
11754
11755 fi
11756
11757 fi
11758
11759 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11760 # in some cases has installed dummy files in the former, other cases replaced
11761 # it with a link to the new location).  This complicates the configure script.
11762 # Check for that pitfall, and recover using pkg-config
11763 #
11764 # If none of these are set, the configuration is almost certainly broken.
11765 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11766 then
11767
11768 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11769         test -n "$verbose" && echo "    found package x11" 1>&6
11770
11771 echo "${as_me:-configure}:11771: testing found package x11 ..." 1>&5
11772
11773         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11774         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11775         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11776
11777 echo "${as_me:-configure}:11777: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11778
11779         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11780
11781 echo "${as_me:-configure}:11781: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11782
11783 cf_fix_cppflags=no
11784 cf_new_cflags=
11785 cf_new_cppflags=
11786 cf_new_extra_cppflags=
11787
11788 for cf_add_cflags in $cf_pkgconfig_incs
11789 do
11790 case $cf_fix_cppflags in
11791 (no)
11792         case $cf_add_cflags in
11793         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11794                 case $cf_add_cflags in
11795                 (-D*)
11796                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11797
11798                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11799                                 && test -z "${cf_tst_cflags}" \
11800                                 && cf_fix_cppflags=yes
11801
11802                         if test $cf_fix_cppflags = yes ; then
11803
11804         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11805         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11806
11807                                 continue
11808                         elif test "${cf_tst_cflags}" = "\"'" ; then
11809
11810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11812
11813                                 continue
11814                         fi
11815                         ;;
11816                 esac
11817                 case "$CPPFLAGS" in
11818                 (*$cf_add_cflags)
11819                         ;;
11820                 (*)
11821                         case $cf_add_cflags in
11822                         (-D*)
11823                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11824
11825 CPPFLAGS=`echo "$CPPFLAGS" | \
11826         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11827                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11828
11829                                 ;;
11830                         esac
11831
11832         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11833         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11834
11835                         ;;
11836                 esac
11837                 ;;
11838         (*)
11839
11840         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11841         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11842
11843                 ;;
11844         esac
11845         ;;
11846 (yes)
11847
11848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11850
11851         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11852
11853         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11854                 && test -z "${cf_tst_cflags}" \
11855                 && cf_fix_cppflags=no
11856         ;;
11857 esac
11858 done
11859
11860 if test -n "$cf_new_cflags" ; then
11861
11862         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11863         CFLAGS="${CFLAGS}$cf_new_cflags"
11864
11865 fi
11866
11867 if test -n "$cf_new_cppflags" ; then
11868
11869         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11870         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11871
11872 fi
11873
11874 if test -n "$cf_new_extra_cppflags" ; then
11875
11876         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11877         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11878
11879 fi
11880
11881 cf_add_libs="$cf_pkgconfig_libs"
11882 # Filter out duplicates - this happens with badly-designed ".pc" files...
11883 for cf_add_1lib in $LIBS
11884 do
11885         for cf_add_2lib in $cf_add_libs
11886         do
11887                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11888                 then
11889                         cf_add_1lib=
11890                         break
11891                 fi
11892         done
11893         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11894 done
11895 LIBS="$cf_add_libs"
11896
11897         :
11898 else
11899         cf_pkgconfig_incs=
11900         cf_pkgconfig_libs=
11901         { echo "$as_me:11901: WARNING: unable to find X11 library" >&5
11902 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11903 fi
11904
11905 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11906         test -n "$verbose" && echo "    found package ice" 1>&6
11907
11908 echo "${as_me:-configure}:11908: testing found package ice ..." 1>&5
11909
11910         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11911         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11912         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11913
11914 echo "${as_me:-configure}:11914: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11915
11916         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11917
11918 echo "${as_me:-configure}:11918: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11919
11920 cf_fix_cppflags=no
11921 cf_new_cflags=
11922 cf_new_cppflags=
11923 cf_new_extra_cppflags=
11924
11925 for cf_add_cflags in $cf_pkgconfig_incs
11926 do
11927 case $cf_fix_cppflags in
11928 (no)
11929         case $cf_add_cflags in
11930         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11931                 case $cf_add_cflags in
11932                 (-D*)
11933                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11934
11935                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11936                                 && test -z "${cf_tst_cflags}" \
11937                                 && cf_fix_cppflags=yes
11938
11939                         if test $cf_fix_cppflags = yes ; then
11940
11941         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11942         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11943
11944                                 continue
11945                         elif test "${cf_tst_cflags}" = "\"'" ; then
11946
11947         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11948         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11949
11950                                 continue
11951                         fi
11952                         ;;
11953                 esac
11954                 case "$CPPFLAGS" in
11955                 (*$cf_add_cflags)
11956                         ;;
11957                 (*)
11958                         case $cf_add_cflags in
11959                         (-D*)
11960                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11961
11962 CPPFLAGS=`echo "$CPPFLAGS" | \
11963         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11964                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11965
11966                                 ;;
11967                         esac
11968
11969         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11970         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11971
11972                         ;;
11973                 esac
11974                 ;;
11975         (*)
11976
11977         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11978         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11979
11980                 ;;
11981         esac
11982         ;;
11983 (yes)
11984
11985         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11986         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11987
11988         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11989
11990         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11991                 && test -z "${cf_tst_cflags}" \
11992                 && cf_fix_cppflags=no
11993         ;;
11994 esac
11995 done
11996
11997 if test -n "$cf_new_cflags" ; then
11998
11999         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12000         CFLAGS="${CFLAGS}$cf_new_cflags"
12001
12002 fi
12003
12004 if test -n "$cf_new_cppflags" ; then
12005
12006         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12007         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12008
12009 fi
12010
12011 if test -n "$cf_new_extra_cppflags" ; then
12012
12013         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12014         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12015
12016 fi
12017
12018 cf_add_libs="$cf_pkgconfig_libs"
12019 # Filter out duplicates - this happens with badly-designed ".pc" files...
12020 for cf_add_1lib in $LIBS
12021 do
12022         for cf_add_2lib in $cf_add_libs
12023         do
12024                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12025                 then
12026                         cf_add_1lib=
12027                         break
12028                 fi
12029         done
12030         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12031 done
12032 LIBS="$cf_add_libs"
12033
12034         :
12035 else
12036         cf_pkgconfig_incs=
12037         cf_pkgconfig_libs=
12038         { echo "$as_me:12038: WARNING: unable to find ICE library" >&5
12039 echo "$as_me: WARNING: unable to find ICE library" >&2;}
12040 fi
12041
12042 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12043         test -n "$verbose" && echo "    found package sm" 1>&6
12044
12045 echo "${as_me:-configure}:12045: testing found package sm ..." 1>&5
12046
12047         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12048         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12049         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12050
12051 echo "${as_me:-configure}:12051: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12052
12053         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12054
12055 echo "${as_me:-configure}:12055: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12056
12057 cf_fix_cppflags=no
12058 cf_new_cflags=
12059 cf_new_cppflags=
12060 cf_new_extra_cppflags=
12061
12062 for cf_add_cflags in $cf_pkgconfig_incs
12063 do
12064 case $cf_fix_cppflags in
12065 (no)
12066         case $cf_add_cflags in
12067         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12068                 case $cf_add_cflags in
12069                 (-D*)
12070                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12071
12072                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12073                                 && test -z "${cf_tst_cflags}" \
12074                                 && cf_fix_cppflags=yes
12075
12076                         if test $cf_fix_cppflags = yes ; then
12077
12078         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12079         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12080
12081                                 continue
12082                         elif test "${cf_tst_cflags}" = "\"'" ; then
12083
12084         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12085         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12086
12087                                 continue
12088                         fi
12089                         ;;
12090                 esac
12091                 case "$CPPFLAGS" in
12092                 (*$cf_add_cflags)
12093                         ;;
12094                 (*)
12095                         case $cf_add_cflags in
12096                         (-D*)
12097                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12098
12099 CPPFLAGS=`echo "$CPPFLAGS" | \
12100         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12101                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12102
12103                                 ;;
12104                         esac
12105
12106         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12107         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12108
12109                         ;;
12110                 esac
12111                 ;;
12112         (*)
12113
12114         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12115         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12116
12117                 ;;
12118         esac
12119         ;;
12120 (yes)
12121
12122         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12123         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12124
12125         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12126
12127         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12128                 && test -z "${cf_tst_cflags}" \
12129                 && cf_fix_cppflags=no
12130         ;;
12131 esac
12132 done
12133
12134 if test -n "$cf_new_cflags" ; then
12135
12136         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12137         CFLAGS="${CFLAGS}$cf_new_cflags"
12138
12139 fi
12140
12141 if test -n "$cf_new_cppflags" ; then
12142
12143         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12144         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12145
12146 fi
12147
12148 if test -n "$cf_new_extra_cppflags" ; then
12149
12150         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12151         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12152
12153 fi
12154
12155 cf_add_libs="$cf_pkgconfig_libs"
12156 # Filter out duplicates - this happens with badly-designed ".pc" files...
12157 for cf_add_1lib in $LIBS
12158 do
12159         for cf_add_2lib in $cf_add_libs
12160         do
12161                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12162                 then
12163                         cf_add_1lib=
12164                         break
12165                 fi
12166         done
12167         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12168 done
12169 LIBS="$cf_add_libs"
12170
12171         :
12172 else
12173         cf_pkgconfig_incs=
12174         cf_pkgconfig_libs=
12175         { echo "$as_me:12175: WARNING: unable to find SM library" >&5
12176 echo "$as_me: WARNING: unable to find SM library" >&2;}
12177 fi
12178
12179 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12180         test -n "$verbose" && echo "    found package xt" 1>&6
12181
12182 echo "${as_me:-configure}:12182: testing found package xt ..." 1>&5
12183
12184         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12185         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12186         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12187
12188 echo "${as_me:-configure}:12188: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12189
12190         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12191
12192 echo "${as_me:-configure}:12192: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12193
12194 cf_fix_cppflags=no
12195 cf_new_cflags=
12196 cf_new_cppflags=
12197 cf_new_extra_cppflags=
12198
12199 for cf_add_cflags in $cf_pkgconfig_incs
12200 do
12201 case $cf_fix_cppflags in
12202 (no)
12203         case $cf_add_cflags in
12204         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12205                 case $cf_add_cflags in
12206                 (-D*)
12207                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12208
12209                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12210                                 && test -z "${cf_tst_cflags}" \
12211                                 && cf_fix_cppflags=yes
12212
12213                         if test $cf_fix_cppflags = yes ; then
12214
12215         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12216         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12217
12218                                 continue
12219                         elif test "${cf_tst_cflags}" = "\"'" ; then
12220
12221         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12222         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12223
12224                                 continue
12225                         fi
12226                         ;;
12227                 esac
12228                 case "$CPPFLAGS" in
12229                 (*$cf_add_cflags)
12230                         ;;
12231                 (*)
12232                         case $cf_add_cflags in
12233                         (-D*)
12234                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12235
12236 CPPFLAGS=`echo "$CPPFLAGS" | \
12237         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12238                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12239
12240                                 ;;
12241                         esac
12242
12243         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12244         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12245
12246                         ;;
12247                 esac
12248                 ;;
12249         (*)
12250
12251         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12252         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12253
12254                 ;;
12255         esac
12256         ;;
12257 (yes)
12258
12259         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12260         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12261
12262         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12263
12264         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12265                 && test -z "${cf_tst_cflags}" \
12266                 && cf_fix_cppflags=no
12267         ;;
12268 esac
12269 done
12270
12271 if test -n "$cf_new_cflags" ; then
12272
12273         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12274         CFLAGS="${CFLAGS}$cf_new_cflags"
12275
12276 fi
12277
12278 if test -n "$cf_new_cppflags" ; then
12279
12280         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12281         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12282
12283 fi
12284
12285 if test -n "$cf_new_extra_cppflags" ; then
12286
12287         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12288         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12289
12290 fi
12291
12292 cf_add_libs="$cf_pkgconfig_libs"
12293 # Filter out duplicates - this happens with badly-designed ".pc" files...
12294 for cf_add_1lib in $LIBS
12295 do
12296         for cf_add_2lib in $cf_add_libs
12297         do
12298                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12299                 then
12300                         cf_add_1lib=
12301                         break
12302                 fi
12303         done
12304         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12305 done
12306 LIBS="$cf_add_libs"
12307
12308         :
12309 else
12310         cf_pkgconfig_incs=
12311         cf_pkgconfig_libs=
12312         { echo "$as_me:12312: WARNING: unable to find Xt library" >&5
12313 echo "$as_me: WARNING: unable to find Xt library" >&2;}
12314 fi
12315
12316 fi
12317
12318 cf_have_X_LIBS=no
12319
12320 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12321         test -n "$verbose" && echo "    found package xt" 1>&6
12322
12323 echo "${as_me:-configure}:12323: testing found package xt ..." 1>&5
12324
12325         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12326         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12327         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12328
12329 echo "${as_me:-configure}:12329: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12330
12331         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12332
12333 echo "${as_me:-configure}:12333: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12334
12335 cf_fix_cppflags=no
12336 cf_new_cflags=
12337 cf_new_cppflags=
12338 cf_new_extra_cppflags=
12339
12340 for cf_add_cflags in $cf_pkgconfig_incs
12341 do
12342 case $cf_fix_cppflags in
12343 (no)
12344         case $cf_add_cflags in
12345         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12346                 case $cf_add_cflags in
12347                 (-D*)
12348                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12349
12350                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12351                                 && test -z "${cf_tst_cflags}" \
12352                                 && cf_fix_cppflags=yes
12353
12354                         if test $cf_fix_cppflags = yes ; then
12355
12356         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12357         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12358
12359                                 continue
12360                         elif test "${cf_tst_cflags}" = "\"'" ; then
12361
12362         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12363         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12364
12365                                 continue
12366                         fi
12367                         ;;
12368                 esac
12369                 case "$CPPFLAGS" in
12370                 (*$cf_add_cflags)
12371                         ;;
12372                 (*)
12373                         case $cf_add_cflags in
12374                         (-D*)
12375                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12376
12377 CPPFLAGS=`echo "$CPPFLAGS" | \
12378         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12379                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12380
12381                                 ;;
12382                         esac
12383
12384         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12385         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12386
12387                         ;;
12388                 esac
12389                 ;;
12390         (*)
12391
12392         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12393         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12394
12395                 ;;
12396         esac
12397         ;;
12398 (yes)
12399
12400         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12401         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12402
12403         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12404
12405         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12406                 && test -z "${cf_tst_cflags}" \
12407                 && cf_fix_cppflags=no
12408         ;;
12409 esac
12410 done
12411
12412 if test -n "$cf_new_cflags" ; then
12413
12414         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12415         CFLAGS="${CFLAGS}$cf_new_cflags"
12416
12417 fi
12418
12419 if test -n "$cf_new_cppflags" ; then
12420
12421         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12422         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12423
12424 fi
12425
12426 if test -n "$cf_new_extra_cppflags" ; then
12427
12428         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12429         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12430
12431 fi
12432
12433 cf_add_libs="$cf_pkgconfig_libs"
12434 # Filter out duplicates - this happens with badly-designed ".pc" files...
12435 for cf_add_1lib in $LIBS
12436 do
12437         for cf_add_2lib in $cf_add_libs
12438         do
12439                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12440                 then
12441                         cf_add_1lib=
12442                         break
12443                 fi
12444         done
12445         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12446 done
12447 LIBS="$cf_add_libs"
12448
12449         case "x$LIBS" in
12450         (*-lX11*)
12451                 ;;
12452         (*)
12453 # we have an "xt" package, but it may omit Xt's dependency on X11
12454 echo "$as_me:12454: checking for usable X dependency" >&5
12455 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
12456 if test "${cf_cv_xt_x11_compat+set}" = set; then
12457   echo $ECHO_N "(cached) $ECHO_C" >&6
12458 else
12459
12460 cat >conftest.$ac_ext <<_ACEOF
12461 #line 12461 "configure"
12462 #include "confdefs.h"
12463
12464 #include <X11/Xlib.h>
12465
12466 int
12467 main (void)
12468 {
12469
12470         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12471         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12472         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12473         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12474
12475   ;
12476   return 0;
12477 }
12478 _ACEOF
12479 rm -f conftest.$ac_objext conftest$ac_exeext
12480 if { (eval echo "$as_me:12480: \"$ac_link\"") >&5
12481   (eval $ac_link) 2>&5
12482   ac_status=$?
12483   echo "$as_me:12483: \$? = $ac_status" >&5
12484   (exit $ac_status); } &&
12485          { ac_try='test -s conftest$ac_exeext'
12486   { (eval echo "$as_me:12486: \"$ac_try\"") >&5
12487   (eval $ac_try) 2>&5
12488   ac_status=$?
12489   echo "$as_me:12489: \$? = $ac_status" >&5
12490   (exit $ac_status); }; }; then
12491   cf_cv_xt_x11_compat=yes
12492 else
12493   echo "$as_me: failed program was:" >&5
12494 cat conftest.$ac_ext >&5
12495 cf_cv_xt_x11_compat=no
12496 fi
12497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12498 fi
12499 echo "$as_me:12499: result: $cf_cv_xt_x11_compat" >&5
12500 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12501                 if test "$cf_cv_xt_x11_compat" = no
12502                 then
12503                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12504
12505 echo "${as_me:-configure}:12505: testing work around broken X11 dependency ..." 1>&5
12506
12507                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12508
12509 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12510         test -n "$verbose" && echo "    found package x11" 1>&6
12511
12512 echo "${as_me:-configure}:12512: testing found package x11 ..." 1>&5
12513
12514         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12515         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12516         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12517
12518 echo "${as_me:-configure}:12518: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12519
12520         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12521
12522 echo "${as_me:-configure}:12522: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12523
12524 cf_fix_cppflags=no
12525 cf_new_cflags=
12526 cf_new_cppflags=
12527 cf_new_extra_cppflags=
12528
12529 for cf_add_cflags in $cf_pkgconfig_incs
12530 do
12531 case $cf_fix_cppflags in
12532 (no)
12533         case $cf_add_cflags in
12534         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12535                 case $cf_add_cflags in
12536                 (-D*)
12537                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12538
12539                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12540                                 && test -z "${cf_tst_cflags}" \
12541                                 && cf_fix_cppflags=yes
12542
12543                         if test $cf_fix_cppflags = yes ; then
12544
12545         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12546         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12547
12548                                 continue
12549                         elif test "${cf_tst_cflags}" = "\"'" ; then
12550
12551         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12552         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12553
12554                                 continue
12555                         fi
12556                         ;;
12557                 esac
12558                 case "$CPPFLAGS" in
12559                 (*$cf_add_cflags)
12560                         ;;
12561                 (*)
12562                         case $cf_add_cflags in
12563                         (-D*)
12564                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12565
12566 CPPFLAGS=`echo "$CPPFLAGS" | \
12567         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12568                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12569
12570                                 ;;
12571                         esac
12572
12573         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12574         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12575
12576                         ;;
12577                 esac
12578                 ;;
12579         (*)
12580
12581         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12582         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12583
12584                 ;;
12585         esac
12586         ;;
12587 (yes)
12588
12589         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12590         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12591
12592         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12593
12594         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12595                 && test -z "${cf_tst_cflags}" \
12596                 && cf_fix_cppflags=no
12597         ;;
12598 esac
12599 done
12600
12601 if test -n "$cf_new_cflags" ; then
12602
12603         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12604         CFLAGS="${CFLAGS}$cf_new_cflags"
12605
12606 fi
12607
12608 if test -n "$cf_new_cppflags" ; then
12609
12610         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12611         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12612
12613 fi
12614
12615 if test -n "$cf_new_extra_cppflags" ; then
12616
12617         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12618         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12619
12620 fi
12621
12622 cf_add_libs="$cf_pkgconfig_libs"
12623 # Filter out duplicates - this happens with badly-designed ".pc" files...
12624 for cf_add_1lib in $LIBS
12625 do
12626         for cf_add_2lib in $cf_add_libs
12627         do
12628                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12629                 then
12630                         cf_add_1lib=
12631                         break
12632                 fi
12633         done
12634         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12635 done
12636 LIBS="$cf_add_libs"
12637
12638         :
12639 else
12640         cf_pkgconfig_incs=
12641         cf_pkgconfig_libs=
12642
12643 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12644
12645 echo "${as_me:-configure}:12645: testing ...before $LIBS ..." 1>&5
12646
12647 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12648 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12649
12650 echo "${as_me:-configure}:12650: testing ...after  $LIBS ..." 1>&5
12651
12652 fi
12653
12654                 fi
12655                 ;;
12656         esac
12657
12658 echo "$as_me:12658: checking for usable X Toolkit package" >&5
12659 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12660 if test "${cf_cv_xt_ice_compat+set}" = set; then
12661   echo $ECHO_N "(cached) $ECHO_C" >&6
12662 else
12663
12664 cat >conftest.$ac_ext <<_ACEOF
12665 #line 12665 "configure"
12666 #include "confdefs.h"
12667
12668 #include <X11/Shell.h>
12669
12670 int
12671 main (void)
12672 {
12673 int num = IceConnectionNumber(0)
12674
12675   ;
12676   return 0;
12677 }
12678 _ACEOF
12679 rm -f conftest.$ac_objext conftest$ac_exeext
12680 if { (eval echo "$as_me:12680: \"$ac_link\"") >&5
12681   (eval $ac_link) 2>&5
12682   ac_status=$?
12683   echo "$as_me:12683: \$? = $ac_status" >&5
12684   (exit $ac_status); } &&
12685          { ac_try='test -s conftest$ac_exeext'
12686   { (eval echo "$as_me:12686: \"$ac_try\"") >&5
12687   (eval $ac_try) 2>&5
12688   ac_status=$?
12689   echo "$as_me:12689: \$? = $ac_status" >&5
12690   (exit $ac_status); }; }; then
12691   cf_cv_xt_ice_compat=yes
12692 else
12693   echo "$as_me: failed program was:" >&5
12694 cat conftest.$ac_ext >&5
12695 cf_cv_xt_ice_compat=no
12696 fi
12697 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12698 fi
12699 echo "$as_me:12699: result: $cf_cv_xt_ice_compat" >&5
12700 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12701
12702         if test "$cf_cv_xt_ice_compat" = no
12703         then
12704                 # workaround for broken ".pc" files used for X Toolkit.
12705                 case "x$X_PRE_LIBS" in
12706                 (*-lICE*)
12707                         case "x$LIBS" in
12708                         (*-lICE*)
12709                                 ;;
12710                         (*)
12711                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12712
12713 echo "${as_me:-configure}:12713: testing work around broken ICE dependency ..." 1>&5
12714
12715 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12716         test -n "$verbose" && echo "    found package ice" 1>&6
12717
12718 echo "${as_me:-configure}:12718: testing found package ice ..." 1>&5
12719
12720         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12721         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12722         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12723
12724 echo "${as_me:-configure}:12724: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12725
12726         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12727
12728 echo "${as_me:-configure}:12728: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12729
12730 cf_fix_cppflags=no
12731 cf_new_cflags=
12732 cf_new_cppflags=
12733 cf_new_extra_cppflags=
12734
12735 for cf_add_cflags in $cf_pkgconfig_incs
12736 do
12737 case $cf_fix_cppflags in
12738 (no)
12739         case $cf_add_cflags in
12740         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12741                 case $cf_add_cflags in
12742                 (-D*)
12743                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12744
12745                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12746                                 && test -z "${cf_tst_cflags}" \
12747                                 && cf_fix_cppflags=yes
12748
12749                         if test $cf_fix_cppflags = yes ; then
12750
12751         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12752         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12753
12754                                 continue
12755                         elif test "${cf_tst_cflags}" = "\"'" ; then
12756
12757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12759
12760                                 continue
12761                         fi
12762                         ;;
12763                 esac
12764                 case "$CPPFLAGS" in
12765                 (*$cf_add_cflags)
12766                         ;;
12767                 (*)
12768                         case $cf_add_cflags in
12769                         (-D*)
12770                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12771
12772 CPPFLAGS=`echo "$CPPFLAGS" | \
12773         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12774                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12775
12776                                 ;;
12777                         esac
12778
12779         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12780         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12781
12782                         ;;
12783                 esac
12784                 ;;
12785         (*)
12786
12787         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12788         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12789
12790                 ;;
12791         esac
12792         ;;
12793 (yes)
12794
12795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12797
12798         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12799
12800         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12801                 && test -z "${cf_tst_cflags}" \
12802                 && cf_fix_cppflags=no
12803         ;;
12804 esac
12805 done
12806
12807 if test -n "$cf_new_cflags" ; then
12808
12809         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12810         CFLAGS="${CFLAGS}$cf_new_cflags"
12811
12812 fi
12813
12814 if test -n "$cf_new_cppflags" ; then
12815
12816         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12817         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12818
12819 fi
12820
12821 if test -n "$cf_new_extra_cppflags" ; then
12822
12823         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12824         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12825
12826 fi
12827
12828 cf_add_libs="$cf_pkgconfig_libs"
12829 # Filter out duplicates - this happens with badly-designed ".pc" files...
12830 for cf_add_1lib in $LIBS
12831 do
12832         for cf_add_2lib in $cf_add_libs
12833         do
12834                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12835                 then
12836                         cf_add_1lib=
12837                         break
12838                 fi
12839         done
12840         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12841 done
12842 LIBS="$cf_add_libs"
12843
12844 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12845         test -n "$verbose" && echo "    found package sm" 1>&6
12846
12847 echo "${as_me:-configure}:12847: testing found package sm ..." 1>&5
12848
12849         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12850         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12851         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12852
12853 echo "${as_me:-configure}:12853: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12854
12855         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12856
12857 echo "${as_me:-configure}:12857: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12858
12859 cf_fix_cppflags=no
12860 cf_new_cflags=
12861 cf_new_cppflags=
12862 cf_new_extra_cppflags=
12863
12864 for cf_add_cflags in $cf_pkgconfig_incs
12865 do
12866 case $cf_fix_cppflags in
12867 (no)
12868         case $cf_add_cflags in
12869         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12870                 case $cf_add_cflags in
12871                 (-D*)
12872                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12873
12874                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12875                                 && test -z "${cf_tst_cflags}" \
12876                                 && cf_fix_cppflags=yes
12877
12878                         if test $cf_fix_cppflags = yes ; then
12879
12880         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12881         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12882
12883                                 continue
12884                         elif test "${cf_tst_cflags}" = "\"'" ; then
12885
12886         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12887         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12888
12889                                 continue
12890                         fi
12891                         ;;
12892                 esac
12893                 case "$CPPFLAGS" in
12894                 (*$cf_add_cflags)
12895                         ;;
12896                 (*)
12897                         case $cf_add_cflags in
12898                         (-D*)
12899                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12900
12901 CPPFLAGS=`echo "$CPPFLAGS" | \
12902         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12903                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12904
12905                                 ;;
12906                         esac
12907
12908         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12909         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12910
12911                         ;;
12912                 esac
12913                 ;;
12914         (*)
12915
12916         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12917         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12918
12919                 ;;
12920         esac
12921         ;;
12922 (yes)
12923
12924         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12925         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12926
12927         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12928
12929         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12930                 && test -z "${cf_tst_cflags}" \
12931                 && cf_fix_cppflags=no
12932         ;;
12933 esac
12934 done
12935
12936 if test -n "$cf_new_cflags" ; then
12937
12938         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12939         CFLAGS="${CFLAGS}$cf_new_cflags"
12940
12941 fi
12942
12943 if test -n "$cf_new_cppflags" ; then
12944
12945         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12946         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12947
12948 fi
12949
12950 if test -n "$cf_new_extra_cppflags" ; then
12951
12952         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12953         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12954
12955 fi
12956
12957 cf_add_libs="$cf_pkgconfig_libs"
12958 # Filter out duplicates - this happens with badly-designed ".pc" files...
12959 for cf_add_1lib in $LIBS
12960 do
12961         for cf_add_2lib in $cf_add_libs
12962         do
12963                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12964                 then
12965                         cf_add_1lib=
12966                         break
12967                 fi
12968         done
12969         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12970 done
12971 LIBS="$cf_add_libs"
12972
12973         :
12974 else
12975         cf_pkgconfig_incs=
12976         cf_pkgconfig_libs=
12977         :
12978 fi
12979
12980 else
12981         cf_pkgconfig_incs=
12982         cf_pkgconfig_libs=
12983
12984 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12985
12986 echo "${as_me:-configure}:12986: testing ...before $LIBS ..." 1>&5
12987
12988 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12989 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12990
12991 echo "${as_me:-configure}:12991: testing ...after  $LIBS ..." 1>&5
12992
12993 fi
12994
12995                                 ;;
12996                         esac
12997                         ;;
12998                 esac
12999         fi
13000
13001         cf_have_X_LIBS=yes
13002
13003 else
13004         cf_pkgconfig_incs=
13005         cf_pkgconfig_libs=
13006
13007         LDFLAGS="$X_LIBS $LDFLAGS"
13008
13009 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13010
13011 echo "${as_me:-configure}:13011: testing checking additions to CFLAGS ..." 1>&5
13012
13013 cf_check_cflags="$CFLAGS"
13014 cf_check_cppflags="$CPPFLAGS"
13015
13016 cf_fix_cppflags=no
13017 cf_new_cflags=
13018 cf_new_cppflags=
13019 cf_new_extra_cppflags=
13020
13021 for cf_add_cflags in $X_CFLAGS
13022 do
13023 case $cf_fix_cppflags in
13024 (no)
13025         case $cf_add_cflags in
13026         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13027                 case $cf_add_cflags in
13028                 (-D*)
13029                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13030
13031                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13032                                 && test -z "${cf_tst_cflags}" \
13033                                 && cf_fix_cppflags=yes
13034
13035                         if test $cf_fix_cppflags = yes ; then
13036
13037         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13038         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13039
13040                                 continue
13041                         elif test "${cf_tst_cflags}" = "\"'" ; then
13042
13043         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13044         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13045
13046                                 continue
13047                         fi
13048                         ;;
13049                 esac
13050                 case "$CPPFLAGS" in
13051                 (*$cf_add_cflags)
13052                         ;;
13053                 (*)
13054                         case $cf_add_cflags in
13055                         (-D*)
13056                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13057
13058 CPPFLAGS=`echo "$CPPFLAGS" | \
13059         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13060                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13061
13062                                 ;;
13063                         esac
13064
13065         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13066         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13067
13068                         ;;
13069                 esac
13070                 ;;
13071         (*)
13072
13073         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13074         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13075
13076                 ;;
13077         esac
13078         ;;
13079 (yes)
13080
13081         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13082         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13083
13084         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13085
13086         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13087                 && test -z "${cf_tst_cflags}" \
13088                 && cf_fix_cppflags=no
13089         ;;
13090 esac
13091 done
13092
13093 if test -n "$cf_new_cflags" ; then
13094         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13095
13096 echo "${as_me:-configure}:13096: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13097
13098         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13099         CFLAGS="${CFLAGS}$cf_new_cflags"
13100
13101 fi
13102
13103 if test -n "$cf_new_cppflags" ; then
13104         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13105
13106 echo "${as_me:-configure}:13106: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13107
13108         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13109         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13110
13111 fi
13112
13113 if test -n "$cf_new_extra_cppflags" ; then
13114         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13115
13116 echo "${as_me:-configure}:13116: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13117
13118         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13119         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13120
13121 fi
13122
13123 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13124 cat >conftest.$ac_ext <<_ACEOF
13125 #line 13125 "configure"
13126 #include "confdefs.h"
13127 #include <stdio.h>
13128 int
13129 main (void)
13130 {
13131 printf("Hello world");
13132   ;
13133   return 0;
13134 }
13135 _ACEOF
13136 rm -f conftest.$ac_objext conftest$ac_exeext
13137 if { (eval echo "$as_me:13137: \"$ac_link\"") >&5
13138   (eval $ac_link) 2>&5
13139   ac_status=$?
13140   echo "$as_me:13140: \$? = $ac_status" >&5
13141   (exit $ac_status); } &&
13142          { ac_try='test -s conftest$ac_exeext'
13143   { (eval echo "$as_me:13143: \"$ac_try\"") >&5
13144   (eval $ac_try) 2>&5
13145   ac_status=$?
13146   echo "$as_me:13146: \$? = $ac_status" >&5
13147   (exit $ac_status); }; }; then
13148   :
13149 else
13150   echo "$as_me: failed program was:" >&5
13151 cat conftest.$ac_ext >&5
13152 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13153
13154 echo "${as_me:-configure}:13154: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13155
13156          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13157                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13158
13159 echo "${as_me:-configure}:13159: testing but keeping change to \$CPPFLAGS ..." 1>&5
13160
13161          fi
13162          CFLAGS="$cf_check_flags"
13163 fi
13164 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13165 fi
13166
13167         echo "$as_me:13167: checking for XOpenDisplay" >&5
13168 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
13169 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
13170   echo $ECHO_N "(cached) $ECHO_C" >&6
13171 else
13172   cat >conftest.$ac_ext <<_ACEOF
13173 #line 13173 "configure"
13174 #include "confdefs.h"
13175 /* System header to define __stub macros and hopefully few prototypes,
13176     which can conflict with char XOpenDisplay (); below.  */
13177 #include <assert.h>
13178 /* Override any gcc2 internal prototype to avoid an error.  */
13179 #ifdef __cplusplus
13180 extern "C"
13181 #endif
13182 /* We use char because int might match the return type of a gcc2
13183    builtin and then its argument prototype would still apply.  */
13184 char XOpenDisplay ();
13185 char (*f) ();
13186
13187 int
13188 main (void)
13189 {
13190 /* The GNU C library defines this for functions which it implements
13191     to always fail with ENOSYS.  Some functions are actually named
13192     something starting with __ and the normal name is an alias.  */
13193 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
13194 choke me
13195 #else
13196 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13197 #endif
13198
13199   ;
13200   return 0;
13201 }
13202 _ACEOF
13203 rm -f conftest.$ac_objext conftest$ac_exeext
13204 if { (eval echo "$as_me:13204: \"$ac_link\"") >&5
13205   (eval $ac_link) 2>&5
13206   ac_status=$?
13207   echo "$as_me:13207: \$? = $ac_status" >&5
13208   (exit $ac_status); } &&
13209          { ac_try='test -s conftest$ac_exeext'
13210   { (eval echo "$as_me:13210: \"$ac_try\"") >&5
13211   (eval $ac_try) 2>&5
13212   ac_status=$?
13213   echo "$as_me:13213: \$? = $ac_status" >&5
13214   (exit $ac_status); }; }; then
13215   ac_cv_func_XOpenDisplay=yes
13216 else
13217   echo "$as_me: failed program was:" >&5
13218 cat conftest.$ac_ext >&5
13219 ac_cv_func_XOpenDisplay=no
13220 fi
13221 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13222 fi
13223 echo "$as_me:13223: result: $ac_cv_func_XOpenDisplay" >&5
13224 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
13225 if test $ac_cv_func_XOpenDisplay = yes; then
13226   :
13227 else
13228
13229         echo "$as_me:13229: checking for XOpenDisplay in -lX11" >&5
13230 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13231 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13232   echo $ECHO_N "(cached) $ECHO_C" >&6
13233 else
13234   ac_check_lib_save_LIBS=$LIBS
13235 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13236 cat >conftest.$ac_ext <<_ACEOF
13237 #line 13237 "configure"
13238 #include "confdefs.h"
13239
13240 /* Override any gcc2 internal prototype to avoid an error.  */
13241 #ifdef __cplusplus
13242 extern "C"
13243 #endif
13244 /* We use char because int might match the return type of a gcc2
13245    builtin and then its argument prototype would still apply.  */
13246 char XOpenDisplay ();
13247 int
13248 main (void)
13249 {
13250 XOpenDisplay ();
13251   ;
13252   return 0;
13253 }
13254 _ACEOF
13255 rm -f conftest.$ac_objext conftest$ac_exeext
13256 if { (eval echo "$as_me:13256: \"$ac_link\"") >&5
13257   (eval $ac_link) 2>&5
13258   ac_status=$?
13259   echo "$as_me:13259: \$? = $ac_status" >&5
13260   (exit $ac_status); } &&
13261          { ac_try='test -s conftest$ac_exeext'
13262   { (eval echo "$as_me:13262: \"$ac_try\"") >&5
13263   (eval $ac_try) 2>&5
13264   ac_status=$?
13265   echo "$as_me:13265: \$? = $ac_status" >&5
13266   (exit $ac_status); }; }; then
13267   ac_cv_lib_X11_XOpenDisplay=yes
13268 else
13269   echo "$as_me: failed program was:" >&5
13270 cat conftest.$ac_ext >&5
13271 ac_cv_lib_X11_XOpenDisplay=no
13272 fi
13273 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13274 LIBS=$ac_check_lib_save_LIBS
13275 fi
13276 echo "$as_me:13276: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13277 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13278 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13279
13280 cf_add_libs="-lX11"
13281 # Filter out duplicates - this happens with badly-designed ".pc" files...
13282 for cf_add_1lib in $LIBS
13283 do
13284         for cf_add_2lib in $cf_add_libs
13285         do
13286                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13287                 then
13288                         cf_add_1lib=
13289                         break
13290                 fi
13291         done
13292         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13293 done
13294 LIBS="$cf_add_libs"
13295
13296 fi
13297
13298 fi
13299
13300         echo "$as_me:13300: checking for XtAppInitialize" >&5
13301 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
13302 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
13303   echo $ECHO_N "(cached) $ECHO_C" >&6
13304 else
13305   cat >conftest.$ac_ext <<_ACEOF
13306 #line 13306 "configure"
13307 #include "confdefs.h"
13308 /* System header to define __stub macros and hopefully few prototypes,
13309     which can conflict with char XtAppInitialize (); below.  */
13310 #include <assert.h>
13311 /* Override any gcc2 internal prototype to avoid an error.  */
13312 #ifdef __cplusplus
13313 extern "C"
13314 #endif
13315 /* We use char because int might match the return type of a gcc2
13316    builtin and then its argument prototype would still apply.  */
13317 char XtAppInitialize ();
13318 char (*f) ();
13319
13320 int
13321 main (void)
13322 {
13323 /* The GNU C library defines this for functions which it implements
13324     to always fail with ENOSYS.  Some functions are actually named
13325     something starting with __ and the normal name is an alias.  */
13326 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
13327 choke me
13328 #else
13329 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13330 #endif
13331
13332   ;
13333   return 0;
13334 }
13335 _ACEOF
13336 rm -f conftest.$ac_objext conftest$ac_exeext
13337 if { (eval echo "$as_me:13337: \"$ac_link\"") >&5
13338   (eval $ac_link) 2>&5
13339   ac_status=$?
13340   echo "$as_me:13340: \$? = $ac_status" >&5
13341   (exit $ac_status); } &&
13342          { ac_try='test -s conftest$ac_exeext'
13343   { (eval echo "$as_me:13343: \"$ac_try\"") >&5
13344   (eval $ac_try) 2>&5
13345   ac_status=$?
13346   echo "$as_me:13346: \$? = $ac_status" >&5
13347   (exit $ac_status); }; }; then
13348   ac_cv_func_XtAppInitialize=yes
13349 else
13350   echo "$as_me: failed program was:" >&5
13351 cat conftest.$ac_ext >&5
13352 ac_cv_func_XtAppInitialize=no
13353 fi
13354 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13355 fi
13356 echo "$as_me:13356: result: $ac_cv_func_XtAppInitialize" >&5
13357 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
13358 if test $ac_cv_func_XtAppInitialize = yes; then
13359   :
13360 else
13361
13362         echo "$as_me:13362: checking for XtAppInitialize in -lXt" >&5
13363 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
13364 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
13365   echo $ECHO_N "(cached) $ECHO_C" >&6
13366 else
13367   ac_check_lib_save_LIBS=$LIBS
13368 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13369 cat >conftest.$ac_ext <<_ACEOF
13370 #line 13370 "configure"
13371 #include "confdefs.h"
13372
13373 /* Override any gcc2 internal prototype to avoid an error.  */
13374 #ifdef __cplusplus
13375 extern "C"
13376 #endif
13377 /* We use char because int might match the return type of a gcc2
13378    builtin and then its argument prototype would still apply.  */
13379 char XtAppInitialize ();
13380 int
13381 main (void)
13382 {
13383 XtAppInitialize ();
13384   ;
13385   return 0;
13386 }
13387 _ACEOF
13388 rm -f conftest.$ac_objext conftest$ac_exeext
13389 if { (eval echo "$as_me:13389: \"$ac_link\"") >&5
13390   (eval $ac_link) 2>&5
13391   ac_status=$?
13392   echo "$as_me:13392: \$? = $ac_status" >&5
13393   (exit $ac_status); } &&
13394          { ac_try='test -s conftest$ac_exeext'
13395   { (eval echo "$as_me:13395: \"$ac_try\"") >&5
13396   (eval $ac_try) 2>&5
13397   ac_status=$?
13398   echo "$as_me:13398: \$? = $ac_status" >&5
13399   (exit $ac_status); }; }; then
13400   ac_cv_lib_Xt_XtAppInitialize=yes
13401 else
13402   echo "$as_me: failed program was:" >&5
13403 cat conftest.$ac_ext >&5
13404 ac_cv_lib_Xt_XtAppInitialize=no
13405 fi
13406 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13407 LIBS=$ac_check_lib_save_LIBS
13408 fi
13409 echo "$as_me:13409: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
13410 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
13411 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
13412
13413 cat >>confdefs.h <<\EOF
13414 #define HAVE_LIBXT 1
13415 EOF
13416
13417                  cf_have_X_LIBS=Xt
13418                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13419 fi
13420
13421 fi
13422
13423 fi
13424
13425 if test $cf_have_X_LIBS = no ; then
13426         { echo "$as_me:13426: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13427 test program.  You will have to check and add the proper libraries by hand
13428 to makefile." >&5
13429 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13430 test program.  You will have to check and add the proper libraries by hand
13431 to makefile." >&2;}
13432 fi
13433
13434 cf_x_athena_root=$cf_x_athena
13435 cf_x_athena_inc=""
13436
13437 for cf_path in default \
13438         /usr/contrib/X11R6 \
13439         /usr/contrib/X11R5 \
13440         /usr/lib/X11R5 \
13441         /usr/local
13442 do
13443         if test -z "$cf_x_athena_inc" ; then
13444                 cf_save="$CPPFLAGS"
13445                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
13446                 if test $cf_path != default ; then
13447                         CPPFLAGS="$cf_save -I$cf_path/include"
13448                         echo "$as_me:13448: checking for $cf_test in $cf_path" >&5
13449 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
13450                 else
13451                         echo "$as_me:13451: checking for $cf_test" >&5
13452 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
13453                 fi
13454                 cat >conftest.$ac_ext <<_ACEOF
13455 #line 13455 "configure"
13456 #include "confdefs.h"
13457
13458 #include <X11/Intrinsic.h>
13459 #include <$cf_test>
13460 int
13461 main (void)
13462 {
13463
13464   ;
13465   return 0;
13466 }
13467 _ACEOF
13468 rm -f conftest.$ac_objext
13469 if { (eval echo "$as_me:13469: \"$ac_compile\"") >&5
13470   (eval $ac_compile) 2>&5
13471   ac_status=$?
13472   echo "$as_me:13472: \$? = $ac_status" >&5
13473   (exit $ac_status); } &&
13474          { ac_try='test -s conftest.$ac_objext'
13475   { (eval echo "$as_me:13475: \"$ac_try\"") >&5
13476   (eval $ac_try) 2>&5
13477   ac_status=$?
13478   echo "$as_me:13478: \$? = $ac_status" >&5
13479   (exit $ac_status); }; }; then
13480   cf_result=yes
13481 else
13482   echo "$as_me: failed program was:" >&5
13483 cat conftest.$ac_ext >&5
13484 cf_result=no
13485 fi
13486 rm -f conftest.$ac_objext conftest.$ac_ext
13487                 echo "$as_me:13487: result: $cf_result" >&5
13488 echo "${ECHO_T}$cf_result" >&6
13489                 if test "$cf_result" = yes ; then
13490                         cf_x_athena_inc=$cf_path
13491                         break
13492                 else
13493                         CPPFLAGS="$cf_save"
13494                 fi
13495         fi
13496 done
13497
13498 if test -z "$cf_x_athena_inc" ; then
13499         { echo "$as_me:13499: WARNING: Unable to successfully find Athena header files with test program" >&5
13500 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
13501 elif test "$cf_x_athena_inc" != default ; then
13502         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
13503 fi
13504
13505 cf_x_athena_root=$cf_x_athena
13506 cf_x_athena_lib=""
13507
13508 for cf_path in default \
13509         /usr/contrib/X11R6 \
13510         /usr/contrib/X11R5 \
13511         /usr/lib/X11R5 \
13512         /usr/local
13513 do
13514         for cf_lib in \
13515                 ${cf_x_athena_root} \
13516                 ${cf_x_athena_root}7 \
13517                 ${cf_x_athena_root}6
13518         do
13519         for cf_libs in \
13520                 "-l$cf_lib -lXmu" \
13521                 "-l$cf_lib -lXpm -lXmu" \
13522                 "-l${cf_lib}_s -lXmu_s"
13523         do
13524                 if test -z "$cf_x_athena_lib" ; then
13525                         cf_save="$LIBS"
13526                         cf_test=XawSimpleMenuAddGlobalActions
13527                         if test $cf_path != default ; then
13528
13529 cf_add_libs="-L$cf_path/lib $cf_libs"
13530 # Filter out duplicates - this happens with badly-designed ".pc" files...
13531 for cf_add_1lib in $LIBS
13532 do
13533         for cf_add_2lib in $cf_add_libs
13534         do
13535                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13536                 then
13537                         cf_add_1lib=
13538                         break
13539                 fi
13540         done
13541         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13542 done
13543 LIBS="$cf_add_libs"
13544
13545                                 echo "$as_me:13545: checking for $cf_libs in $cf_path" >&5
13546 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13547                         else
13548
13549 cf_add_libs="$cf_libs"
13550 # Filter out duplicates - this happens with badly-designed ".pc" files...
13551 for cf_add_1lib in $LIBS
13552 do
13553         for cf_add_2lib in $cf_add_libs
13554         do
13555                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13556                 then
13557                         cf_add_1lib=
13558                         break
13559                 fi
13560         done
13561         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13562 done
13563 LIBS="$cf_add_libs"
13564
13565                                 echo "$as_me:13565: checking for $cf_test in $cf_libs" >&5
13566 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13567                         fi
13568                         cat >conftest.$ac_ext <<_ACEOF
13569 #line 13569 "configure"
13570 #include "confdefs.h"
13571
13572 #include <X11/Intrinsic.h>
13573 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13574
13575 int
13576 main (void)
13577 {
13578
13579 $cf_test((XtAppContext) 0)
13580   ;
13581   return 0;
13582 }
13583 _ACEOF
13584 rm -f conftest.$ac_objext conftest$ac_exeext
13585 if { (eval echo "$as_me:13585: \"$ac_link\"") >&5
13586   (eval $ac_link) 2>&5
13587   ac_status=$?
13588   echo "$as_me:13588: \$? = $ac_status" >&5
13589   (exit $ac_status); } &&
13590          { ac_try='test -s conftest$ac_exeext'
13591   { (eval echo "$as_me:13591: \"$ac_try\"") >&5
13592   (eval $ac_try) 2>&5
13593   ac_status=$?
13594   echo "$as_me:13594: \$? = $ac_status" >&5
13595   (exit $ac_status); }; }; then
13596   cf_result=yes
13597 else
13598   echo "$as_me: failed program was:" >&5
13599 cat conftest.$ac_ext >&5
13600 cf_result=no
13601 fi
13602 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13603                         echo "$as_me:13603: result: $cf_result" >&5
13604 echo "${ECHO_T}$cf_result" >&6
13605                         if test "$cf_result" = yes ; then
13606                                 cf_x_athena_lib="$cf_libs"
13607                                 break
13608                         fi
13609                         LIBS="$cf_save"
13610                 fi
13611         done # cf_libs
13612                 test -n "$cf_x_athena_lib" && break
13613         done # cf_lib
13614 done
13615
13616 if test -z "$cf_x_athena_lib" ; then
13617         { { echo "$as_me:13617: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13618 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13619    { (exit 1); exit 1; }; }
13620 fi
13621
13622 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13623
13624 cat >>confdefs.h <<EOF
13625 #define $cf_x_athena_LIBS 1
13626 EOF
13627
13628 fi
13629
13630 if test -n "$ac_tool_prefix"; then
13631   for ac_prog in xcurses-config
13632   do
13633     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13634 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13635 echo "$as_me:13635: checking for $ac_word" >&5
13636 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13637 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13638   echo $ECHO_N "(cached) $ECHO_C" >&6
13639 else
13640   if test -n "$XCURSES_CONFIG"; then
13641   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13642 else
13643   ac_save_IFS=$IFS; IFS=$ac_path_separator
13644 ac_dummy="$PATH"
13645 for ac_dir in $ac_dummy; do
13646   IFS=$ac_save_IFS
13647   test -z "$ac_dir" && ac_dir=.
13648   $as_executable_p "$ac_dir/$ac_word" || continue
13649 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13650 echo "$as_me:13650: found $ac_dir/$ac_word" >&5
13651 break
13652 done
13653
13654 fi
13655 fi
13656 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13657 if test -n "$XCURSES_CONFIG"; then
13658   echo "$as_me:13658: result: $XCURSES_CONFIG" >&5
13659 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13660 else
13661   echo "$as_me:13661: result: no" >&5
13662 echo "${ECHO_T}no" >&6
13663 fi
13664
13665     test -n "$XCURSES_CONFIG" && break
13666   done
13667 fi
13668 if test -z "$XCURSES_CONFIG"; then
13669   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13670   for ac_prog in xcurses-config
13671 do
13672   # Extract the first word of "$ac_prog", so it can be a program name with args.
13673 set dummy $ac_prog; ac_word=$2
13674 echo "$as_me:13674: checking for $ac_word" >&5
13675 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13676 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13677   echo $ECHO_N "(cached) $ECHO_C" >&6
13678 else
13679   if test -n "$ac_ct_XCURSES_CONFIG"; then
13680   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13681 else
13682   ac_save_IFS=$IFS; IFS=$ac_path_separator
13683 ac_dummy="$PATH"
13684 for ac_dir in $ac_dummy; do
13685   IFS=$ac_save_IFS
13686   test -z "$ac_dir" && ac_dir=.
13687   $as_executable_p "$ac_dir/$ac_word" || continue
13688 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13689 echo "$as_me:13689: found $ac_dir/$ac_word" >&5
13690 break
13691 done
13692
13693 fi
13694 fi
13695 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13696 if test -n "$ac_ct_XCURSES_CONFIG"; then
13697   echo "$as_me:13697: result: $ac_ct_XCURSES_CONFIG" >&5
13698 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13699 else
13700   echo "$as_me:13700: result: no" >&5
13701 echo "${ECHO_T}no" >&6
13702 fi
13703
13704   test -n "$ac_ct_XCURSES_CONFIG" && break
13705 done
13706 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13707
13708   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13709 fi
13710
13711 if test "$XCURSES_CONFIG" != none ; then
13712
13713 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13714
13715 cf_add_libs="`$XCURSES_CONFIG --libs`"
13716 # Filter out duplicates - this happens with badly-designed ".pc" files...
13717 for cf_add_1lib in $LIBS
13718 do
13719         for cf_add_2lib in $cf_add_libs
13720         do
13721                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13722                 then
13723                         cf_add_1lib=
13724                         break
13725                 fi
13726         done
13727         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13728 done
13729 LIBS="$cf_add_libs"
13730
13731 cf_cv_lib_XCurses=yes
13732
13733 else
13734
13735 LDFLAGS="$LDFLAGS $X_LIBS"
13736
13737 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13738
13739 echo "${as_me:-configure}:13739: testing checking additions to CFLAGS ..." 1>&5
13740
13741 cf_check_cflags="$CFLAGS"
13742 cf_check_cppflags="$CPPFLAGS"
13743
13744 cf_fix_cppflags=no
13745 cf_new_cflags=
13746 cf_new_cppflags=
13747 cf_new_extra_cppflags=
13748
13749 for cf_add_cflags in $X_CFLAGS
13750 do
13751 case $cf_fix_cppflags in
13752 (no)
13753         case $cf_add_cflags in
13754         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13755                 case $cf_add_cflags in
13756                 (-D*)
13757                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13758
13759                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13760                                 && test -z "${cf_tst_cflags}" \
13761                                 && cf_fix_cppflags=yes
13762
13763                         if test $cf_fix_cppflags = yes ; then
13764
13765         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13766         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13767
13768                                 continue
13769                         elif test "${cf_tst_cflags}" = "\"'" ; then
13770
13771         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13772         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13773
13774                                 continue
13775                         fi
13776                         ;;
13777                 esac
13778                 case "$CPPFLAGS" in
13779                 (*$cf_add_cflags)
13780                         ;;
13781                 (*)
13782                         case $cf_add_cflags in
13783                         (-D*)
13784                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13785
13786 CPPFLAGS=`echo "$CPPFLAGS" | \
13787         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13788                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13789
13790                                 ;;
13791                         esac
13792
13793         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13794         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13795
13796                         ;;
13797                 esac
13798                 ;;
13799         (*)
13800
13801         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13802         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13803
13804                 ;;
13805         esac
13806         ;;
13807 (yes)
13808
13809         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13810         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13811
13812         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13813
13814         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13815                 && test -z "${cf_tst_cflags}" \
13816                 && cf_fix_cppflags=no
13817         ;;
13818 esac
13819 done
13820
13821 if test -n "$cf_new_cflags" ; then
13822         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13823
13824 echo "${as_me:-configure}:13824: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13825
13826         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13827         CFLAGS="${CFLAGS}$cf_new_cflags"
13828
13829 fi
13830
13831 if test -n "$cf_new_cppflags" ; then
13832         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13833
13834 echo "${as_me:-configure}:13834: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13835
13836         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13837         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13838
13839 fi
13840
13841 if test -n "$cf_new_extra_cppflags" ; then
13842         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13843
13844 echo "${as_me:-configure}:13844: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13845
13846         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13847         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13848
13849 fi
13850
13851 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13852 cat >conftest.$ac_ext <<_ACEOF
13853 #line 13853 "configure"
13854 #include "confdefs.h"
13855 #include <stdio.h>
13856 int
13857 main (void)
13858 {
13859 printf("Hello world");
13860   ;
13861   return 0;
13862 }
13863 _ACEOF
13864 rm -f conftest.$ac_objext conftest$ac_exeext
13865 if { (eval echo "$as_me:13865: \"$ac_link\"") >&5
13866   (eval $ac_link) 2>&5
13867   ac_status=$?
13868   echo "$as_me:13868: \$? = $ac_status" >&5
13869   (exit $ac_status); } &&
13870          { ac_try='test -s conftest$ac_exeext'
13871   { (eval echo "$as_me:13871: \"$ac_try\"") >&5
13872   (eval $ac_try) 2>&5
13873   ac_status=$?
13874   echo "$as_me:13874: \$? = $ac_status" >&5
13875   (exit $ac_status); }; }; then
13876   :
13877 else
13878   echo "$as_me: failed program was:" >&5
13879 cat conftest.$ac_ext >&5
13880 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13881
13882 echo "${as_me:-configure}:13882: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13883
13884          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13885                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13886
13887 echo "${as_me:-configure}:13887: testing but keeping change to \$CPPFLAGS ..." 1>&5
13888
13889          fi
13890          CFLAGS="$cf_check_flags"
13891 fi
13892 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13893 fi
13894
13895 echo "$as_me:13895: checking for XOpenDisplay in -lX11" >&5
13896 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13897 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13898   echo $ECHO_N "(cached) $ECHO_C" >&6
13899 else
13900   ac_check_lib_save_LIBS=$LIBS
13901 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13902 cat >conftest.$ac_ext <<_ACEOF
13903 #line 13903 "configure"
13904 #include "confdefs.h"
13905
13906 /* Override any gcc2 internal prototype to avoid an error.  */
13907 #ifdef __cplusplus
13908 extern "C"
13909 #endif
13910 /* We use char because int might match the return type of a gcc2
13911    builtin and then its argument prototype would still apply.  */
13912 char XOpenDisplay ();
13913 int
13914 main (void)
13915 {
13916 XOpenDisplay ();
13917   ;
13918   return 0;
13919 }
13920 _ACEOF
13921 rm -f conftest.$ac_objext conftest$ac_exeext
13922 if { (eval echo "$as_me:13922: \"$ac_link\"") >&5
13923   (eval $ac_link) 2>&5
13924   ac_status=$?
13925   echo "$as_me:13925: \$? = $ac_status" >&5
13926   (exit $ac_status); } &&
13927          { ac_try='test -s conftest$ac_exeext'
13928   { (eval echo "$as_me:13928: \"$ac_try\"") >&5
13929   (eval $ac_try) 2>&5
13930   ac_status=$?
13931   echo "$as_me:13931: \$? = $ac_status" >&5
13932   (exit $ac_status); }; }; then
13933   ac_cv_lib_X11_XOpenDisplay=yes
13934 else
13935   echo "$as_me: failed program was:" >&5
13936 cat conftest.$ac_ext >&5
13937 ac_cv_lib_X11_XOpenDisplay=no
13938 fi
13939 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13940 LIBS=$ac_check_lib_save_LIBS
13941 fi
13942 echo "$as_me:13942: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13943 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13944 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13945
13946 cf_add_libs="-lX11"
13947 # Filter out duplicates - this happens with badly-designed ".pc" files...
13948 for cf_add_1lib in $LIBS
13949 do
13950         for cf_add_2lib in $cf_add_libs
13951         do
13952                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13953                 then
13954                         cf_add_1lib=
13955                         break
13956                 fi
13957         done
13958         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13959 done
13960 LIBS="$cf_add_libs"
13961
13962 fi
13963
13964 echo "$as_me:13964: checking for XCurses library" >&5
13965 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13966 if test "${cf_cv_lib_XCurses+set}" = set; then
13967   echo $ECHO_N "(cached) $ECHO_C" >&6
13968 else
13969
13970 cf_add_libs="-lXCurses"
13971 # Filter out duplicates - this happens with badly-designed ".pc" files...
13972 for cf_add_1lib in $LIBS
13973 do
13974         for cf_add_2lib in $cf_add_libs
13975         do
13976                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13977                 then
13978                         cf_add_1lib=
13979                         break
13980                 fi
13981         done
13982         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13983 done
13984 LIBS="$cf_add_libs"
13985
13986 cat >conftest.$ac_ext <<_ACEOF
13987 #line 13987 "configure"
13988 #include "confdefs.h"
13989
13990 #include <xcurses.h>
13991 char *XCursesProgramName = "test";
13992
13993 int
13994 main (void)
13995 {
13996 XCursesExit();
13997   ;
13998   return 0;
13999 }
14000 _ACEOF
14001 rm -f conftest.$ac_objext conftest$ac_exeext
14002 if { (eval echo "$as_me:14002: \"$ac_link\"") >&5
14003   (eval $ac_link) 2>&5
14004   ac_status=$?
14005   echo "$as_me:14005: \$? = $ac_status" >&5
14006   (exit $ac_status); } &&
14007          { ac_try='test -s conftest$ac_exeext'
14008   { (eval echo "$as_me:14008: \"$ac_try\"") >&5
14009   (eval $ac_try) 2>&5
14010   ac_status=$?
14011   echo "$as_me:14011: \$? = $ac_status" >&5
14012   (exit $ac_status); }; }; then
14013   cf_cv_lib_XCurses=yes
14014 else
14015   echo "$as_me: failed program was:" >&5
14016 cat conftest.$ac_ext >&5
14017 cf_cv_lib_XCurses=no
14018 fi
14019 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14020
14021 fi
14022 echo "$as_me:14022: result: $cf_cv_lib_XCurses" >&5
14023 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
14024
14025 fi
14026
14027 if test $cf_cv_lib_XCurses = yes ; then
14028
14029 cat >>confdefs.h <<\EOF
14030 #define UNIX 1
14031 EOF
14032
14033 cat >>confdefs.h <<\EOF
14034 #define XCURSES 1
14035 EOF
14036
14037         echo "$as_me:14037: checking for xcurses.h" >&5
14038 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
14039 if test "${ac_cv_header_xcurses_h+set}" = set; then
14040   echo $ECHO_N "(cached) $ECHO_C" >&6
14041 else
14042   cat >conftest.$ac_ext <<_ACEOF
14043 #line 14043 "configure"
14044 #include "confdefs.h"
14045 #include <xcurses.h>
14046 _ACEOF
14047 if { (eval echo "$as_me:14047: \"$ac_cpp conftest.$ac_ext\"") >&5
14048   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14049   ac_status=$?
14050   egrep -v '^ *\+' conftest.er1 >conftest.err
14051   rm -f conftest.er1
14052   cat conftest.err >&5
14053   echo "$as_me:14053: \$? = $ac_status" >&5
14054   (exit $ac_status); } >/dev/null; then
14055   if test -s conftest.err; then
14056     ac_cpp_err=$ac_c_preproc_warn_flag
14057   else
14058     ac_cpp_err=
14059   fi
14060 else
14061   ac_cpp_err=yes
14062 fi
14063 if test -z "$ac_cpp_err"; then
14064   ac_cv_header_xcurses_h=yes
14065 else
14066   echo "$as_me: failed program was:" >&5
14067   cat conftest.$ac_ext >&5
14068   ac_cv_header_xcurses_h=no
14069 fi
14070 rm -f conftest.err conftest.$ac_ext
14071 fi
14072 echo "$as_me:14072: result: $ac_cv_header_xcurses_h" >&5
14073 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
14074 if test $ac_cv_header_xcurses_h = yes; then
14075
14076 cat >>confdefs.h <<\EOF
14077 #define HAVE_XCURSES 1
14078 EOF
14079
14080 fi
14081
14082 else
14083         { { echo "$as_me:14083: error: Cannot link with XCurses" >&5
14084 echo "$as_me: error: Cannot link with XCurses" >&2;}
14085    { (exit 1); exit 1; }; }
14086 fi
14087
14088         ;;
14089 (*)
14090         { { echo "$as_me:14090: error: unexpected screen-value: $cf_cv_screen" >&5
14091 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
14092    { (exit 1); exit 1; }; }
14093         ;;
14094 esac
14095
14096 : ${cf_nculib_root:=$cf_cv_screen}
14097 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
14098 echo "$as_me:14098: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
14099 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
14100 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14101   echo $ECHO_N "(cached) $ECHO_C" >&6
14102 else
14103   ac_check_lib_save_LIBS=$LIBS
14104 LIBS="-l$cf_nculib_root  $LIBS"
14105 cat >conftest.$ac_ext <<_ACEOF
14106 #line 14106 "configure"
14107 #include "confdefs.h"
14108
14109 /* Override any gcc2 internal prototype to avoid an error.  */
14110 #ifdef __cplusplus
14111 extern "C"
14112 #endif
14113 /* We use char because int might match the return type of a gcc2
14114    builtin and then its argument prototype would still apply.  */
14115 char _nc_init_pthreads ();
14116 int
14117 main (void)
14118 {
14119 _nc_init_pthreads ();
14120   ;
14121   return 0;
14122 }
14123 _ACEOF
14124 rm -f conftest.$ac_objext conftest$ac_exeext
14125 if { (eval echo "$as_me:14125: \"$ac_link\"") >&5
14126   (eval $ac_link) 2>&5
14127   ac_status=$?
14128   echo "$as_me:14128: \$? = $ac_status" >&5
14129   (exit $ac_status); } &&
14130          { ac_try='test -s conftest$ac_exeext'
14131   { (eval echo "$as_me:14131: \"$ac_try\"") >&5
14132   (eval $ac_try) 2>&5
14133   ac_status=$?
14134   echo "$as_me:14134: \$? = $ac_status" >&5
14135   (exit $ac_status); }; }; then
14136   eval "$as_ac_Lib=yes"
14137 else
14138   echo "$as_me: failed program was:" >&5
14139 cat conftest.$ac_ext >&5
14140 eval "$as_ac_Lib=no"
14141 fi
14142 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14143 LIBS=$ac_check_lib_save_LIBS
14144 fi
14145 echo "$as_me:14145: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14146 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14147 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14148   cf_cv_ncurses_pthreads=yes
14149 else
14150   cf_cv_ncurses_pthreads=no
14151 fi
14152
14153 if test "$cf_cv_ncurses_pthreads" = yes
14154 then
14155
14156 cf_add_libs="-lpthread"
14157 # Filter out duplicates - this happens with badly-designed ".pc" files...
14158 for cf_add_1lib in $LIBS
14159 do
14160         for cf_add_2lib in $cf_add_libs
14161         do
14162                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14163                 then
14164                         cf_add_1lib=
14165                         break
14166                 fi
14167         done
14168         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14169 done
14170 LIBS="$cf_add_libs"
14171
14172 fi
14173
14174 case $cf_cv_screen in
14175 (ncurses*)
14176         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
14177         ;;
14178 (curses|curses_*)
14179
14180 echo "$as_me:14180: checking for NetBSD form.h" >&5
14181 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
14182 if test "${cf_cv_netbsd_form_h+set}" = set; then
14183   echo $ECHO_N "(cached) $ECHO_C" >&6
14184 else
14185
14186 cat >conftest.$ac_ext <<_ACEOF
14187 #line 14187 "configure"
14188 #include "confdefs.h"
14189
14190 #include <${cf_cv_ncurses_header:-curses.h}>
14191 #include <form.h>
14192
14193 int
14194 main (void)
14195 {
14196
14197         FORM *form;
14198         int y = current_field(form)->cursor_ypos;
14199         int x = current_field(form)->cursor_xpos;
14200
14201   ;
14202   return 0;
14203 }
14204 _ACEOF
14205 rm -f conftest.$ac_objext
14206 if { (eval echo "$as_me:14206: \"$ac_compile\"") >&5
14207   (eval $ac_compile) 2>&5
14208   ac_status=$?
14209   echo "$as_me:14209: \$? = $ac_status" >&5
14210   (exit $ac_status); } &&
14211          { ac_try='test -s conftest.$ac_objext'
14212   { (eval echo "$as_me:14212: \"$ac_try\"") >&5
14213   (eval $ac_try) 2>&5
14214   ac_status=$?
14215   echo "$as_me:14215: \$? = $ac_status" >&5
14216   (exit $ac_status); }; }; then
14217   cf_cv_netbsd_form_h=yes
14218
14219 else
14220   echo "$as_me: failed program was:" >&5
14221 cat conftest.$ac_ext >&5
14222 cf_cv_netbsd_form_h=no
14223 fi
14224 rm -f conftest.$ac_objext conftest.$ac_ext
14225
14226 fi
14227 echo "$as_me:14227: result: $cf_cv_netbsd_form_h" >&5
14228 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
14229
14230 test "$cf_cv_netbsd_form_h" = yes &&
14231 cat >>confdefs.h <<\EOF
14232 #define HAVE_NETBSD_FORM_H 1
14233 EOF
14234
14235 echo "$as_me:14235: checking for NetBSD menu.h" >&5
14236 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
14237 if test "${cf_cv_netbsd_menu_h+set}" = set; then
14238   echo $ECHO_N "(cached) $ECHO_C" >&6
14239 else
14240
14241 cat >conftest.$ac_ext <<_ACEOF
14242 #line 14242 "configure"
14243 #include "confdefs.h"
14244
14245 #include <${cf_cv_ncurses_header:-curses.h}>
14246 #include <menu.h>
14247
14248 int
14249 main (void)
14250 {
14251
14252         MENU *menu;
14253         int y = menu->max_item_width;
14254
14255   ;
14256   return 0;
14257 }
14258 _ACEOF
14259 rm -f conftest.$ac_objext
14260 if { (eval echo "$as_me:14260: \"$ac_compile\"") >&5
14261   (eval $ac_compile) 2>&5
14262   ac_status=$?
14263   echo "$as_me:14263: \$? = $ac_status" >&5
14264   (exit $ac_status); } &&
14265          { ac_try='test -s conftest.$ac_objext'
14266   { (eval echo "$as_me:14266: \"$ac_try\"") >&5
14267   (eval $ac_try) 2>&5
14268   ac_status=$?
14269   echo "$as_me:14269: \$? = $ac_status" >&5
14270   (exit $ac_status); }; }; then
14271   cf_cv_netbsd_menu_h=yes
14272
14273 else
14274   echo "$as_me: failed program was:" >&5
14275 cat conftest.$ac_ext >&5
14276 cf_cv_netbsd_menu_h=no
14277 fi
14278 rm -f conftest.$ac_objext conftest.$ac_ext
14279
14280 fi
14281 echo "$as_me:14281: result: $cf_cv_netbsd_menu_h" >&5
14282 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
14283
14284 test "$cf_cv_netbsd_menu_h" = yes &&
14285 cat >>confdefs.h <<\EOF
14286 #define HAVE_NETBSD_MENU_H 1
14287 EOF
14288
14289         ;;
14290 esac
14291
14292 case $cf_cv_screen in
14293 (pdcurses)
14294         ;;
14295 (*)
14296         # look for curses-related libraries
14297
14298 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
14299 echo "$as_me:14299: checking for new_panel in -lpanel$cf_cv_libtype" >&5
14300 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
14301 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14302   echo $ECHO_N "(cached) $ECHO_C" >&6
14303 else
14304   ac_check_lib_save_LIBS=$LIBS
14305 LIBS="-lpanel$cf_cv_libtype  $LIBS"
14306 cat >conftest.$ac_ext <<_ACEOF
14307 #line 14307 "configure"
14308 #include "confdefs.h"
14309
14310 /* Override any gcc2 internal prototype to avoid an error.  */
14311 #ifdef __cplusplus
14312 extern "C"
14313 #endif
14314 /* We use char because int might match the return type of a gcc2
14315    builtin and then its argument prototype would still apply.  */
14316 char new_panel ();
14317 int
14318 main (void)
14319 {
14320 new_panel ();
14321   ;
14322   return 0;
14323 }
14324 _ACEOF
14325 rm -f conftest.$ac_objext conftest$ac_exeext
14326 if { (eval echo "$as_me:14326: \"$ac_link\"") >&5
14327   (eval $ac_link) 2>&5
14328   ac_status=$?
14329   echo "$as_me:14329: \$? = $ac_status" >&5
14330   (exit $ac_status); } &&
14331          { ac_try='test -s conftest$ac_exeext'
14332   { (eval echo "$as_me:14332: \"$ac_try\"") >&5
14333   (eval $ac_try) 2>&5
14334   ac_status=$?
14335   echo "$as_me:14335: \$? = $ac_status" >&5
14336   (exit $ac_status); }; }; then
14337   eval "$as_ac_Lib=yes"
14338 else
14339   echo "$as_me: failed program was:" >&5
14340 cat conftest.$ac_ext >&5
14341 eval "$as_ac_Lib=no"
14342 fi
14343 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14344 LIBS=$ac_check_lib_save_LIBS
14345 fi
14346 echo "$as_me:14346: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14347 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14348 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14349
14350 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14351
14352 cf_add_libs="-lpanel$cf_cv_libtype"
14353 # Filter out duplicates - this happens with badly-designed ".pc" files...
14354 for cf_add_1lib in $LIBS
14355 do
14356         for cf_add_2lib in $cf_add_libs
14357         do
14358                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14359                 then
14360                         cf_add_1lib=
14361                         break
14362                 fi
14363         done
14364         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14365 done
14366 LIBS="$cf_add_libs"
14367
14368 cat >>confdefs.h <<EOF
14369 #define $cf_upper 1
14370 EOF
14371
14372 fi
14373
14374 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
14375 echo "$as_me:14375: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
14376 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
14377 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14378   echo $ECHO_N "(cached) $ECHO_C" >&6
14379 else
14380   ac_check_lib_save_LIBS=$LIBS
14381 LIBS="-lmenu$cf_cv_libtype  $LIBS"
14382 cat >conftest.$ac_ext <<_ACEOF
14383 #line 14383 "configure"
14384 #include "confdefs.h"
14385
14386 /* Override any gcc2 internal prototype to avoid an error.  */
14387 #ifdef __cplusplus
14388 extern "C"
14389 #endif
14390 /* We use char because int might match the return type of a gcc2
14391    builtin and then its argument prototype would still apply.  */
14392 char menu_driver ();
14393 int
14394 main (void)
14395 {
14396 menu_driver ();
14397   ;
14398   return 0;
14399 }
14400 _ACEOF
14401 rm -f conftest.$ac_objext conftest$ac_exeext
14402 if { (eval echo "$as_me:14402: \"$ac_link\"") >&5
14403   (eval $ac_link) 2>&5
14404   ac_status=$?
14405   echo "$as_me:14405: \$? = $ac_status" >&5
14406   (exit $ac_status); } &&
14407          { ac_try='test -s conftest$ac_exeext'
14408   { (eval echo "$as_me:14408: \"$ac_try\"") >&5
14409   (eval $ac_try) 2>&5
14410   ac_status=$?
14411   echo "$as_me:14411: \$? = $ac_status" >&5
14412   (exit $ac_status); }; }; then
14413   eval "$as_ac_Lib=yes"
14414 else
14415   echo "$as_me: failed program was:" >&5
14416 cat conftest.$ac_ext >&5
14417 eval "$as_ac_Lib=no"
14418 fi
14419 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14420 LIBS=$ac_check_lib_save_LIBS
14421 fi
14422 echo "$as_me:14422: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14423 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14424 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14425
14426 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14427
14428 cf_add_libs="-lmenu$cf_cv_libtype"
14429 # Filter out duplicates - this happens with badly-designed ".pc" files...
14430 for cf_add_1lib in $LIBS
14431 do
14432         for cf_add_2lib in $cf_add_libs
14433         do
14434                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14435                 then
14436                         cf_add_1lib=
14437                         break
14438                 fi
14439         done
14440         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14441 done
14442 LIBS="$cf_add_libs"
14443
14444 cat >>confdefs.h <<EOF
14445 #define $cf_upper 1
14446 EOF
14447
14448 fi
14449
14450 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
14451 echo "$as_me:14451: checking for form_driver in -lform$cf_cv_libtype" >&5
14452 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
14453 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14454   echo $ECHO_N "(cached) $ECHO_C" >&6
14455 else
14456   ac_check_lib_save_LIBS=$LIBS
14457 LIBS="-lform$cf_cv_libtype  $LIBS"
14458 cat >conftest.$ac_ext <<_ACEOF
14459 #line 14459 "configure"
14460 #include "confdefs.h"
14461
14462 /* Override any gcc2 internal prototype to avoid an error.  */
14463 #ifdef __cplusplus
14464 extern "C"
14465 #endif
14466 /* We use char because int might match the return type of a gcc2
14467    builtin and then its argument prototype would still apply.  */
14468 char form_driver ();
14469 int
14470 main (void)
14471 {
14472 form_driver ();
14473   ;
14474   return 0;
14475 }
14476 _ACEOF
14477 rm -f conftest.$ac_objext conftest$ac_exeext
14478 if { (eval echo "$as_me:14478: \"$ac_link\"") >&5
14479   (eval $ac_link) 2>&5
14480   ac_status=$?
14481   echo "$as_me:14481: \$? = $ac_status" >&5
14482   (exit $ac_status); } &&
14483          { ac_try='test -s conftest$ac_exeext'
14484   { (eval echo "$as_me:14484: \"$ac_try\"") >&5
14485   (eval $ac_try) 2>&5
14486   ac_status=$?
14487   echo "$as_me:14487: \$? = $ac_status" >&5
14488   (exit $ac_status); }; }; then
14489   eval "$as_ac_Lib=yes"
14490 else
14491   echo "$as_me: failed program was:" >&5
14492 cat conftest.$ac_ext >&5
14493 eval "$as_ac_Lib=no"
14494 fi
14495 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14496 LIBS=$ac_check_lib_save_LIBS
14497 fi
14498 echo "$as_me:14498: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14499 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14500 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14501
14502 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14503
14504 cf_add_libs="-lform$cf_cv_libtype"
14505 # Filter out duplicates - this happens with badly-designed ".pc" files...
14506 for cf_add_1lib in $LIBS
14507 do
14508         for cf_add_2lib in $cf_add_libs
14509         do
14510                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14511                 then
14512                         cf_add_1lib=
14513                         break
14514                 fi
14515         done
14516         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14517 done
14518 LIBS="$cf_add_libs"
14519
14520 cat >>confdefs.h <<EOF
14521 #define $cf_upper 1
14522 EOF
14523
14524 fi
14525
14526         # look for curses-related headers
14527
14528 for ac_header in \
14529                 nc_alloc.h \
14530                 nomacros.h \
14531                 form.h \
14532                 menu.h \
14533                 panel.h \
14534                 term_entry.h \
14535
14536 do
14537 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14538 echo "$as_me:14538: checking for $ac_header" >&5
14539 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14540 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14541   echo $ECHO_N "(cached) $ECHO_C" >&6
14542 else
14543   cat >conftest.$ac_ext <<_ACEOF
14544 #line 14544 "configure"
14545 #include "confdefs.h"
14546 #include <$ac_header>
14547 _ACEOF
14548 if { (eval echo "$as_me:14548: \"$ac_cpp conftest.$ac_ext\"") >&5
14549   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14550   ac_status=$?
14551   egrep -v '^ *\+' conftest.er1 >conftest.err
14552   rm -f conftest.er1
14553   cat conftest.err >&5
14554   echo "$as_me:14554: \$? = $ac_status" >&5
14555   (exit $ac_status); } >/dev/null; then
14556   if test -s conftest.err; then
14557     ac_cpp_err=$ac_c_preproc_warn_flag
14558   else
14559     ac_cpp_err=
14560   fi
14561 else
14562   ac_cpp_err=yes
14563 fi
14564 if test -z "$ac_cpp_err"; then
14565   eval "$as_ac_Header=yes"
14566 else
14567   echo "$as_me: failed program was:" >&5
14568   cat conftest.$ac_ext >&5
14569   eval "$as_ac_Header=no"
14570 fi
14571 rm -f conftest.err conftest.$ac_ext
14572 fi
14573 echo "$as_me:14573: result: `eval echo '${'$as_ac_Header'}'`" >&5
14574 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14575 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14576   cat >>confdefs.h <<EOF
14577 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14578 EOF
14579
14580 fi
14581 done
14582
14583         ;;
14584 esac
14585
14586 echo "$as_me:14586: checking for ANSI C header files" >&5
14587 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14588 if test "${ac_cv_header_stdc+set}" = set; then
14589   echo $ECHO_N "(cached) $ECHO_C" >&6
14590 else
14591   cat >conftest.$ac_ext <<_ACEOF
14592 #line 14592 "configure"
14593 #include "confdefs.h"
14594 #include <stdlib.h>
14595 #include <stdarg.h>
14596 #include <string.h>
14597 #include <float.h>
14598
14599 _ACEOF
14600 if { (eval echo "$as_me:14600: \"$ac_cpp conftest.$ac_ext\"") >&5
14601   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14602   ac_status=$?
14603   egrep -v '^ *\+' conftest.er1 >conftest.err
14604   rm -f conftest.er1
14605   cat conftest.err >&5
14606   echo "$as_me:14606: \$? = $ac_status" >&5
14607   (exit $ac_status); } >/dev/null; then
14608   if test -s conftest.err; then
14609     ac_cpp_err=$ac_c_preproc_warn_flag
14610   else
14611     ac_cpp_err=
14612   fi
14613 else
14614   ac_cpp_err=yes
14615 fi
14616 if test -z "$ac_cpp_err"; then
14617   ac_cv_header_stdc=yes
14618 else
14619   echo "$as_me: failed program was:" >&5
14620   cat conftest.$ac_ext >&5
14621   ac_cv_header_stdc=no
14622 fi
14623 rm -f conftest.err conftest.$ac_ext
14624
14625 if test $ac_cv_header_stdc = yes; then
14626   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14627   cat >conftest.$ac_ext <<_ACEOF
14628 #line 14628 "configure"
14629 #include "confdefs.h"
14630 #include <string.h>
14631
14632 _ACEOF
14633 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14634   egrep "memchr" >/dev/null 2>&1; then
14635   :
14636 else
14637   ac_cv_header_stdc=no
14638 fi
14639 rm -rf conftest*
14640
14641 fi
14642
14643 if test $ac_cv_header_stdc = yes; then
14644   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14645   cat >conftest.$ac_ext <<_ACEOF
14646 #line 14646 "configure"
14647 #include "confdefs.h"
14648 #include <stdlib.h>
14649
14650 _ACEOF
14651 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14652   egrep "free" >/dev/null 2>&1; then
14653   :
14654 else
14655   ac_cv_header_stdc=no
14656 fi
14657 rm -rf conftest*
14658
14659 fi
14660
14661 if test $ac_cv_header_stdc = yes; then
14662   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14663   if test "$cross_compiling" = yes; then
14664   :
14665 else
14666   cat >conftest.$ac_ext <<_ACEOF
14667 #line 14667 "configure"
14668 #include "confdefs.h"
14669 #include <ctype.h>
14670 #if ((' ' & 0x0FF) == 0x020)
14671 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14672 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14673 #else
14674 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14675                      || ('j' <= (c) && (c) <= 'r') \
14676                      || ('s' <= (c) && (c) <= 'z'))
14677 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14678 #endif
14679
14680 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14681 int
14682 main (void)
14683 {
14684   int i;
14685   for (i = 0; i < 256; i++)
14686     if (XOR (islower (i), ISLOWER (i))
14687         || toupper (i) != TOUPPER (i))
14688       $ac_main_return(2);
14689   $ac_main_return (0);
14690 }
14691 _ACEOF
14692 rm -f conftest$ac_exeext
14693 if { (eval echo "$as_me:14693: \"$ac_link\"") >&5
14694   (eval $ac_link) 2>&5
14695   ac_status=$?
14696   echo "$as_me:14696: \$? = $ac_status" >&5
14697   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14698   { (eval echo "$as_me:14698: \"$ac_try\"") >&5
14699   (eval $ac_try) 2>&5
14700   ac_status=$?
14701   echo "$as_me:14701: \$? = $ac_status" >&5
14702   (exit $ac_status); }; }; then
14703   :
14704 else
14705   echo "$as_me: program exited with status $ac_status" >&5
14706 echo "$as_me: failed program was:" >&5
14707 cat conftest.$ac_ext >&5
14708 ac_cv_header_stdc=no
14709 fi
14710 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14711 fi
14712 fi
14713 fi
14714 echo "$as_me:14714: result: $ac_cv_header_stdc" >&5
14715 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14716 if test $ac_cv_header_stdc = yes; then
14717
14718 cat >>confdefs.h <<\EOF
14719 #define STDC_HEADERS 1
14720 EOF
14721
14722 fi
14723
14724 echo "$as_me:14724: checking whether time.h and sys/time.h may both be included" >&5
14725 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
14726 if test "${ac_cv_header_time+set}" = set; then
14727   echo $ECHO_N "(cached) $ECHO_C" >&6
14728 else
14729   cat >conftest.$ac_ext <<_ACEOF
14730 #line 14730 "configure"
14731 #include "confdefs.h"
14732 #include <sys/types.h>
14733 #include <sys/time.h>
14734 #include <time.h>
14735
14736 int
14737 main (void)
14738 {
14739 if ((struct tm *) 0)
14740 return 0;
14741   ;
14742   return 0;
14743 }
14744 _ACEOF
14745 rm -f conftest.$ac_objext
14746 if { (eval echo "$as_me:14746: \"$ac_compile\"") >&5
14747   (eval $ac_compile) 2>&5
14748   ac_status=$?
14749   echo "$as_me:14749: \$? = $ac_status" >&5
14750   (exit $ac_status); } &&
14751          { ac_try='test -s conftest.$ac_objext'
14752   { (eval echo "$as_me:14752: \"$ac_try\"") >&5
14753   (eval $ac_try) 2>&5
14754   ac_status=$?
14755   echo "$as_me:14755: \$? = $ac_status" >&5
14756   (exit $ac_status); }; }; then
14757   ac_cv_header_time=yes
14758 else
14759   echo "$as_me: failed program was:" >&5
14760 cat conftest.$ac_ext >&5
14761 ac_cv_header_time=no
14762 fi
14763 rm -f conftest.$ac_objext conftest.$ac_ext
14764 fi
14765 echo "$as_me:14765: result: $ac_cv_header_time" >&5
14766 echo "${ECHO_T}$ac_cv_header_time" >&6
14767 if test $ac_cv_header_time = yes; then
14768
14769 cat >>confdefs.h <<\EOF
14770 #define TIME_WITH_SYS_TIME 1
14771 EOF
14772
14773 fi
14774
14775 for ac_header in \
14776 getopt.h \
14777 locale.h \
14778 math.h \
14779 stdarg.h \
14780 stdint.h \
14781 sys/ioctl.h \
14782 sys/select.h \
14783 sys/time.h \
14784 termios.h \
14785 unistd.h \
14786
14787 do
14788 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14789 echo "$as_me:14789: checking for $ac_header" >&5
14790 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14791 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14792   echo $ECHO_N "(cached) $ECHO_C" >&6
14793 else
14794   cat >conftest.$ac_ext <<_ACEOF
14795 #line 14795 "configure"
14796 #include "confdefs.h"
14797 #include <$ac_header>
14798 _ACEOF
14799 if { (eval echo "$as_me:14799: \"$ac_cpp conftest.$ac_ext\"") >&5
14800   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14801   ac_status=$?
14802   egrep -v '^ *\+' conftest.er1 >conftest.err
14803   rm -f conftest.er1
14804   cat conftest.err >&5
14805   echo "$as_me:14805: \$? = $ac_status" >&5
14806   (exit $ac_status); } >/dev/null; then
14807   if test -s conftest.err; then
14808     ac_cpp_err=$ac_c_preproc_warn_flag
14809   else
14810     ac_cpp_err=
14811   fi
14812 else
14813   ac_cpp_err=yes
14814 fi
14815 if test -z "$ac_cpp_err"; then
14816   eval "$as_ac_Header=yes"
14817 else
14818   echo "$as_me: failed program was:" >&5
14819   cat conftest.$ac_ext >&5
14820   eval "$as_ac_Header=no"
14821 fi
14822 rm -f conftest.err conftest.$ac_ext
14823 fi
14824 echo "$as_me:14824: result: `eval echo '${'$as_ac_Header'}'`" >&5
14825 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14826 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14827   cat >>confdefs.h <<EOF
14828 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14829 EOF
14830
14831 fi
14832 done
14833
14834 for ac_header in unistd.h getopt.h
14835 do
14836 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14837 echo "$as_me:14837: checking for $ac_header" >&5
14838 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14839 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14840   echo $ECHO_N "(cached) $ECHO_C" >&6
14841 else
14842   cat >conftest.$ac_ext <<_ACEOF
14843 #line 14843 "configure"
14844 #include "confdefs.h"
14845 #include <$ac_header>
14846 _ACEOF
14847 if { (eval echo "$as_me:14847: \"$ac_cpp conftest.$ac_ext\"") >&5
14848   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14849   ac_status=$?
14850   egrep -v '^ *\+' conftest.er1 >conftest.err
14851   rm -f conftest.er1
14852   cat conftest.err >&5
14853   echo "$as_me:14853: \$? = $ac_status" >&5
14854   (exit $ac_status); } >/dev/null; then
14855   if test -s conftest.err; then
14856     ac_cpp_err=$ac_c_preproc_warn_flag
14857   else
14858     ac_cpp_err=
14859   fi
14860 else
14861   ac_cpp_err=yes
14862 fi
14863 if test -z "$ac_cpp_err"; then
14864   eval "$as_ac_Header=yes"
14865 else
14866   echo "$as_me: failed program was:" >&5
14867   cat conftest.$ac_ext >&5
14868   eval "$as_ac_Header=no"
14869 fi
14870 rm -f conftest.err conftest.$ac_ext
14871 fi
14872 echo "$as_me:14872: result: `eval echo '${'$as_ac_Header'}'`" >&5
14873 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14874 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14875   cat >>confdefs.h <<EOF
14876 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14877 EOF
14878
14879 fi
14880 done
14881
14882 echo "$as_me:14882: checking for header declaring getopt variables" >&5
14883 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
14884 if test "${cf_cv_getopt_header+set}" = set; then
14885   echo $ECHO_N "(cached) $ECHO_C" >&6
14886 else
14887
14888 cf_cv_getopt_header=none
14889 for cf_header in stdio.h stdlib.h unistd.h getopt.h
14890 do
14891 cat >conftest.$ac_ext <<_ACEOF
14892 #line 14892 "configure"
14893 #include "confdefs.h"
14894
14895 #include <$cf_header>
14896 int
14897 main (void)
14898 {
14899 int x = optind; char *y = optarg
14900   ;
14901   return 0;
14902 }
14903 _ACEOF
14904 rm -f conftest.$ac_objext
14905 if { (eval echo "$as_me:14905: \"$ac_compile\"") >&5
14906   (eval $ac_compile) 2>&5
14907   ac_status=$?
14908   echo "$as_me:14908: \$? = $ac_status" >&5
14909   (exit $ac_status); } &&
14910          { ac_try='test -s conftest.$ac_objext'
14911   { (eval echo "$as_me:14911: \"$ac_try\"") >&5
14912   (eval $ac_try) 2>&5
14913   ac_status=$?
14914   echo "$as_me:14914: \$? = $ac_status" >&5
14915   (exit $ac_status); }; }; then
14916   cf_cv_getopt_header=$cf_header
14917  break
14918 else
14919   echo "$as_me: failed program was:" >&5
14920 cat conftest.$ac_ext >&5
14921 fi
14922 rm -f conftest.$ac_objext conftest.$ac_ext
14923 done
14924
14925 fi
14926 echo "$as_me:14926: result: $cf_cv_getopt_header" >&5
14927 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14928 if test $cf_cv_getopt_header != none ; then
14929
14930 cat >>confdefs.h <<\EOF
14931 #define HAVE_GETOPT_HEADER 1
14932 EOF
14933
14934 fi
14935 if test $cf_cv_getopt_header = getopt.h ; then
14936
14937 cat >>confdefs.h <<\EOF
14938 #define NEED_GETOPT_H 1
14939 EOF
14940
14941 fi
14942
14943 for ac_func in \
14944 getopt \
14945 gettimeofday \
14946 tdestroy \
14947 tsearch \
14948
14949 do
14950 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14951 echo "$as_me:14951: checking for $ac_func" >&5
14952 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14953 if eval "test \"\${$as_ac_var+set}\" = set"; then
14954   echo $ECHO_N "(cached) $ECHO_C" >&6
14955 else
14956   cat >conftest.$ac_ext <<_ACEOF
14957 #line 14957 "configure"
14958 #include "confdefs.h"
14959 /* System header to define __stub macros and hopefully few prototypes,
14960     which can conflict with char $ac_func (); below.  */
14961 #include <assert.h>
14962 /* Override any gcc2 internal prototype to avoid an error.  */
14963 #ifdef __cplusplus
14964 extern "C"
14965 #endif
14966 /* We use char because int might match the return type of a gcc2
14967    builtin and then its argument prototype would still apply.  */
14968 char $ac_func ();
14969 char (*f) ();
14970
14971 int
14972 main (void)
14973 {
14974 /* The GNU C library defines this for functions which it implements
14975     to always fail with ENOSYS.  Some functions are actually named
14976     something starting with __ and the normal name is an alias.  */
14977 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14978 choke me
14979 #else
14980 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14981 #endif
14982
14983   ;
14984   return 0;
14985 }
14986 _ACEOF
14987 rm -f conftest.$ac_objext conftest$ac_exeext
14988 if { (eval echo "$as_me:14988: \"$ac_link\"") >&5
14989   (eval $ac_link) 2>&5
14990   ac_status=$?
14991   echo "$as_me:14991: \$? = $ac_status" >&5
14992   (exit $ac_status); } &&
14993          { ac_try='test -s conftest$ac_exeext'
14994   { (eval echo "$as_me:14994: \"$ac_try\"") >&5
14995   (eval $ac_try) 2>&5
14996   ac_status=$?
14997   echo "$as_me:14997: \$? = $ac_status" >&5
14998   (exit $ac_status); }; }; then
14999   eval "$as_ac_var=yes"
15000 else
15001   echo "$as_me: failed program was:" >&5
15002 cat conftest.$ac_ext >&5
15003 eval "$as_ac_var=no"
15004 fi
15005 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15006 fi
15007 echo "$as_me:15007: result: `eval echo '${'$as_ac_var'}'`" >&5
15008 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15009 if test `eval echo '${'$as_ac_var'}'` = yes; then
15010   cat >>confdefs.h <<EOF
15011 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15012 EOF
15013
15014 fi
15015 done
15016
15017 if test "x$ac_cv_func_getopt" = xno; then
15018         { { echo "$as_me:15018: error: getopt is required for building programs" >&5
15019 echo "$as_me: error: getopt is required for building programs" >&2;}
15020    { (exit 1); exit 1; }; }
15021 fi
15022
15023 if test "$cf_enable_widec" = yes; then
15024
15025 for ac_func in \
15026 mblen \
15027 mbrlen \
15028 mbrtowc \
15029 mbsrtowcs \
15030 mbstowcs \
15031 mbtowc \
15032 wcsrtombs \
15033 wcstombs \
15034
15035 do
15036 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15037 echo "$as_me:15037: checking for $ac_func" >&5
15038 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15039 if eval "test \"\${$as_ac_var+set}\" = set"; then
15040   echo $ECHO_N "(cached) $ECHO_C" >&6
15041 else
15042   cat >conftest.$ac_ext <<_ACEOF
15043 #line 15043 "configure"
15044 #include "confdefs.h"
15045 /* System header to define __stub macros and hopefully few prototypes,
15046     which can conflict with char $ac_func (); below.  */
15047 #include <assert.h>
15048 /* Override any gcc2 internal prototype to avoid an error.  */
15049 #ifdef __cplusplus
15050 extern "C"
15051 #endif
15052 /* We use char because int might match the return type of a gcc2
15053    builtin and then its argument prototype would still apply.  */
15054 char $ac_func ();
15055 char (*f) ();
15056
15057 int
15058 main (void)
15059 {
15060 /* The GNU C library defines this for functions which it implements
15061     to always fail with ENOSYS.  Some functions are actually named
15062     something starting with __ and the normal name is an alias.  */
15063 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15064 choke me
15065 #else
15066 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15067 #endif
15068
15069   ;
15070   return 0;
15071 }
15072 _ACEOF
15073 rm -f conftest.$ac_objext conftest$ac_exeext
15074 if { (eval echo "$as_me:15074: \"$ac_link\"") >&5
15075   (eval $ac_link) 2>&5
15076   ac_status=$?
15077   echo "$as_me:15077: \$? = $ac_status" >&5
15078   (exit $ac_status); } &&
15079          { ac_try='test -s conftest$ac_exeext'
15080   { (eval echo "$as_me:15080: \"$ac_try\"") >&5
15081   (eval $ac_try) 2>&5
15082   ac_status=$?
15083   echo "$as_me:15083: \$? = $ac_status" >&5
15084   (exit $ac_status); }; }; then
15085   eval "$as_ac_var=yes"
15086 else
15087   echo "$as_me: failed program was:" >&5
15088 cat conftest.$ac_ext >&5
15089 eval "$as_ac_var=no"
15090 fi
15091 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15092 fi
15093 echo "$as_me:15093: result: `eval echo '${'$as_ac_var'}'`" >&5
15094 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15095 if test `eval echo '${'$as_ac_var'}'` = yes; then
15096   cat >>confdefs.h <<EOF
15097 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15098 EOF
15099
15100 fi
15101 done
15102
15103 fi
15104
15105 echo "$as_me:15105: checking definition to turn on extended curses functions" >&5
15106 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
15107 if test "${cf_cv_need_xopen_extension+set}" = set; then
15108   echo $ECHO_N "(cached) $ECHO_C" >&6
15109 else
15110
15111 cf_cv_need_xopen_extension=unknown
15112 cat >conftest.$ac_ext <<_ACEOF
15113 #line 15113 "configure"
15114 #include "confdefs.h"
15115
15116 #include <stdlib.h>
15117 #include <${cf_cv_ncurses_header:-curses.h}>
15118 int
15119 main (void)
15120 {
15121
15122 #if defined(NCURSES_VERSION_PATCH)
15123 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
15124         make an error
15125 #endif
15126 #endif
15127 #ifdef NCURSES_VERSION
15128         cchar_t check;
15129         int check2 = curs_set((int)sizeof(check));
15130 #endif
15131         long x = winnstr(stdscr, "", 0);
15132         int x1, y1;
15133         getbegyx(stdscr, y1, x1)
15134   ;
15135   return 0;
15136 }
15137 _ACEOF
15138 rm -f conftest.$ac_objext conftest$ac_exeext
15139 if { (eval echo "$as_me:15139: \"$ac_link\"") >&5
15140   (eval $ac_link) 2>&5
15141   ac_status=$?
15142   echo "$as_me:15142: \$? = $ac_status" >&5
15143   (exit $ac_status); } &&
15144          { ac_try='test -s conftest$ac_exeext'
15145   { (eval echo "$as_me:15145: \"$ac_try\"") >&5
15146   (eval $ac_try) 2>&5
15147   ac_status=$?
15148   echo "$as_me:15148: \$? = $ac_status" >&5
15149   (exit $ac_status); }; }; then
15150   cf_cv_need_xopen_extension=none
15151 else
15152   echo "$as_me: failed program was:" >&5
15153 cat conftest.$ac_ext >&5
15154
15155         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
15156         do
15157                 cat >conftest.$ac_ext <<_ACEOF
15158 #line 15158 "configure"
15159 #include "confdefs.h"
15160
15161 #define $cf_try_xopen_extension 1
15162 #include <stdlib.h>
15163 #include <${cf_cv_ncurses_header:-curses.h}>
15164 int
15165 main (void)
15166 {
15167
15168 #ifdef NCURSES_VERSION
15169                 cchar_t check;
15170                 int check2 = curs_set((int)sizeof(check));
15171 #endif
15172                 long x = winnstr(stdscr, "", 0);
15173                 int x1, y1;
15174                 getbegyx(stdscr, y1, x1)
15175   ;
15176   return 0;
15177 }
15178 _ACEOF
15179 rm -f conftest.$ac_objext conftest$ac_exeext
15180 if { (eval echo "$as_me:15180: \"$ac_link\"") >&5
15181   (eval $ac_link) 2>&5
15182   ac_status=$?
15183   echo "$as_me:15183: \$? = $ac_status" >&5
15184   (exit $ac_status); } &&
15185          { ac_try='test -s conftest$ac_exeext'
15186   { (eval echo "$as_me:15186: \"$ac_try\"") >&5
15187   (eval $ac_try) 2>&5
15188   ac_status=$?
15189   echo "$as_me:15189: \$? = $ac_status" >&5
15190   (exit $ac_status); }; }; then
15191   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
15192 else
15193   echo "$as_me: failed program was:" >&5
15194 cat conftest.$ac_ext >&5
15195 fi
15196 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15197         done
15198
15199 fi
15200 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15201
15202 fi
15203 echo "$as_me:15203: result: $cf_cv_need_xopen_extension" >&5
15204 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
15205
15206 case $cf_cv_need_xopen_extension in
15207 (*_*)
15208         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
15209         ;;
15210 esac
15211
15212 echo "$as_me:15212: checking for term.h" >&5
15213 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
15214 if test "${cf_cv_term_header+set}" = set; then
15215   echo $ECHO_N "(cached) $ECHO_C" >&6
15216 else
15217
15218 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
15219 # for <term.h> if we do not find the variant.
15220
15221 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
15222
15223 case ${cf_cv_ncurses_header:-curses.h} in
15224 (*/*)
15225         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
15226         cf_header_list="$cf_header_item $cf_header_list"
15227         ;;
15228 esac
15229
15230 for cf_header in $cf_header_list
15231 do
15232         cat >conftest.$ac_ext <<_ACEOF
15233 #line 15233 "configure"
15234 #include "confdefs.h"
15235
15236 #include <${cf_cv_ncurses_header:-curses.h}>
15237 #include <${cf_header}>
15238 int
15239 main (void)
15240 {
15241 WINDOW *x
15242   ;
15243   return 0;
15244 }
15245 _ACEOF
15246 rm -f conftest.$ac_objext
15247 if { (eval echo "$as_me:15247: \"$ac_compile\"") >&5
15248   (eval $ac_compile) 2>&5
15249   ac_status=$?
15250   echo "$as_me:15250: \$? = $ac_status" >&5
15251   (exit $ac_status); } &&
15252          { ac_try='test -s conftest.$ac_objext'
15253   { (eval echo "$as_me:15253: \"$ac_try\"") >&5
15254   (eval $ac_try) 2>&5
15255   ac_status=$?
15256   echo "$as_me:15256: \$? = $ac_status" >&5
15257   (exit $ac_status); }; }; then
15258   cf_cv_term_header=$cf_header
15259          break
15260 else
15261   echo "$as_me: failed program was:" >&5
15262 cat conftest.$ac_ext >&5
15263 cf_cv_term_header=no
15264 fi
15265 rm -f conftest.$ac_objext conftest.$ac_ext
15266 done
15267
15268 case $cf_cv_term_header in
15269 (no)
15270         # If curses is ncurses, some packagers still mess it up by trying to make
15271         # us use GNU termcap.  This handles the most common case.
15272         for cf_header in ncurses/term.h ncursesw/term.h
15273         do
15274                 cat >conftest.$ac_ext <<_ACEOF
15275 #line 15275 "configure"
15276 #include "confdefs.h"
15277
15278 #include <${cf_cv_ncurses_header:-curses.h}>
15279 #ifdef NCURSES_VERSION
15280 #include <${cf_header}>
15281 #else
15282 make an error
15283 #endif
15284 int
15285 main (void)
15286 {
15287 WINDOW *x
15288   ;
15289   return 0;
15290 }
15291 _ACEOF
15292 rm -f conftest.$ac_objext
15293 if { (eval echo "$as_me:15293: \"$ac_compile\"") >&5
15294   (eval $ac_compile) 2>&5
15295   ac_status=$?
15296   echo "$as_me:15296: \$? = $ac_status" >&5
15297   (exit $ac_status); } &&
15298          { ac_try='test -s conftest.$ac_objext'
15299   { (eval echo "$as_me:15299: \"$ac_try\"") >&5
15300   (eval $ac_try) 2>&5
15301   ac_status=$?
15302   echo "$as_me:15302: \$? = $ac_status" >&5
15303   (exit $ac_status); }; }; then
15304   cf_cv_term_header=$cf_header
15305                          break
15306 else
15307   echo "$as_me: failed program was:" >&5
15308 cat conftest.$ac_ext >&5
15309 cf_cv_term_header=no
15310 fi
15311 rm -f conftest.$ac_objext conftest.$ac_ext
15312         done
15313         ;;
15314 esac
15315
15316 fi
15317 echo "$as_me:15317: result: $cf_cv_term_header" >&5
15318 echo "${ECHO_T}$cf_cv_term_header" >&6
15319
15320 case $cf_cv_term_header in
15321 (term.h)
15322
15323 cat >>confdefs.h <<\EOF
15324 #define HAVE_TERM_H 1
15325 EOF
15326
15327         ;;
15328 (ncurses/term.h)
15329
15330 cat >>confdefs.h <<\EOF
15331 #define HAVE_NCURSES_TERM_H 1
15332 EOF
15333
15334         ;;
15335 (ncursesw/term.h)
15336
15337 cat >>confdefs.h <<\EOF
15338 #define HAVE_NCURSESW_TERM_H 1
15339 EOF
15340
15341         ;;
15342 esac
15343
15344 echo "$as_me:15344: checking for unctrl.h" >&5
15345 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
15346 if test "${cf_cv_unctrl_header+set}" = set; then
15347   echo $ECHO_N "(cached) $ECHO_C" >&6
15348 else
15349
15350 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
15351 # for <unctrl.h> if we do not find the variant.
15352
15353 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
15354
15355 case ${cf_cv_ncurses_header:-curses.h} in
15356 (*/*)
15357         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
15358         cf_header_list="$cf_header_item $cf_header_list"
15359         ;;
15360 esac
15361
15362 for cf_header in $cf_header_list
15363 do
15364         cat >conftest.$ac_ext <<_ACEOF
15365 #line 15365 "configure"
15366 #include "confdefs.h"
15367
15368 #include <${cf_cv_ncurses_header:-curses.h}>
15369 #include <${cf_header}>
15370 int
15371 main (void)
15372 {
15373 WINDOW *x
15374   ;
15375   return 0;
15376 }
15377 _ACEOF
15378 rm -f conftest.$ac_objext
15379 if { (eval echo "$as_me:15379: \"$ac_compile\"") >&5
15380   (eval $ac_compile) 2>&5
15381   ac_status=$?
15382   echo "$as_me:15382: \$? = $ac_status" >&5
15383   (exit $ac_status); } &&
15384          { ac_try='test -s conftest.$ac_objext'
15385   { (eval echo "$as_me:15385: \"$ac_try\"") >&5
15386   (eval $ac_try) 2>&5
15387   ac_status=$?
15388   echo "$as_me:15388: \$? = $ac_status" >&5
15389   (exit $ac_status); }; }; then
15390   cf_cv_unctrl_header=$cf_header
15391          break
15392 else
15393   echo "$as_me: failed program was:" >&5
15394 cat conftest.$ac_ext >&5
15395 cf_cv_unctrl_header=no
15396 fi
15397 rm -f conftest.$ac_objext conftest.$ac_ext
15398 done
15399
15400 fi
15401 echo "$as_me:15401: result: $cf_cv_unctrl_header" >&5
15402 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
15403
15404 case $cf_cv_unctrl_header in
15405 (no)
15406         { echo "$as_me:15406: WARNING: unctrl.h header not found" >&5
15407 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
15408         ;;
15409 esac
15410
15411 case $cf_cv_unctrl_header in
15412 (unctrl.h)
15413
15414 cat >>confdefs.h <<\EOF
15415 #define HAVE_UNCTRL_H 1
15416 EOF
15417
15418         ;;
15419 (ncurses/unctrl.h)
15420
15421 cat >>confdefs.h <<\EOF
15422 #define HAVE_NCURSES_UNCTRL_H 1
15423 EOF
15424
15425         ;;
15426 (ncursesw/unctrl.h)
15427
15428 cat >>confdefs.h <<\EOF
15429 #define HAVE_NCURSESW_UNCTRL_H 1
15430 EOF
15431
15432         ;;
15433 esac
15434
15435 for cf_func in \
15436 alloc_pair \
15437 assume_default_colors \
15438 chgat \
15439 color_set \
15440 filter \
15441 getbegx \
15442 getcurx \
15443 getmaxx \
15444 getnstr \
15445 getparx \
15446 getwin \
15447 init_extended_color \
15448 mvvline \
15449 mvwvline \
15450 napms \
15451 putwin \
15452 resize_term \
15453 resizeterm \
15454 restartterm \
15455 ripoffline \
15456 scr_dump \
15457 setupterm \
15458 slk_color \
15459 slk_init \
15460 termattrs \
15461 tgetent \
15462 tigetnum \
15463 tigetstr \
15464 tputs_sp \
15465 typeahead \
15466 use_default_colors \
15467 use_env \
15468 use_extended_names \
15469 use_screen \
15470 use_window \
15471 vid_puts \
15472 vidputs \
15473 vsscanf \
15474 vw_printw \
15475 wchgat \
15476 winsstr \
15477 wresize \
15478 wsyncdown \
15479 _tracef \
15480
15481 do
15482
15483 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15484
15485         echo "$as_me:15485: checking for ${cf_func}" >&5
15486 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15487
15488 echo "${as_me:-configure}:15488: testing ${cf_func} ..." 1>&5
15489
15490         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15491   echo $ECHO_N "(cached) $ECHO_C" >&6
15492 else
15493
15494                 eval cf_result='$ac_cv_func_'$cf_func
15495                 if test ".$cf_result" != ".no"; then
15496                         cat >conftest.$ac_ext <<_ACEOF
15497 #line 15497 "configure"
15498 #include "confdefs.h"
15499
15500 #ifdef HAVE_XCURSES
15501 #include <xcurses.h>
15502 char * XCursesProgramName = "test";
15503 #else
15504 #include <${cf_cv_ncurses_header:-curses.h}>
15505 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15506 #include <ncursesw/term.h>
15507 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15508 #include <ncurses/term.h>
15509 #elif defined(HAVE_TERM_H)
15510 #include <term.h>
15511 #endif
15512 #endif
15513
15514 int
15515 main (void)
15516 {
15517
15518 #ifndef ${cf_func}
15519 long foo = (long)(&${cf_func});
15520 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15521 if (foo + 1234 > 5678)
15522         ${cf_cv_main_return:-return}(foo);
15523 #endif
15524
15525   ;
15526   return 0;
15527 }
15528 _ACEOF
15529 rm -f conftest.$ac_objext conftest$ac_exeext
15530 if { (eval echo "$as_me:15530: \"$ac_link\"") >&5
15531   (eval $ac_link) 2>&5
15532   ac_status=$?
15533   echo "$as_me:15533: \$? = $ac_status" >&5
15534   (exit $ac_status); } &&
15535          { ac_try='test -s conftest$ac_exeext'
15536   { (eval echo "$as_me:15536: \"$ac_try\"") >&5
15537   (eval $ac_try) 2>&5
15538   ac_status=$?
15539   echo "$as_me:15539: \$? = $ac_status" >&5
15540   (exit $ac_status); }; }; then
15541   cf_result=yes
15542 else
15543   echo "$as_me: failed program was:" >&5
15544 cat conftest.$ac_ext >&5
15545 cf_result=no
15546 fi
15547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15548                 fi
15549                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15550
15551 fi
15552
15553         # use the computed/retrieved cache-value:
15554         eval 'cf_result=$cf_cv_func_'$cf_func
15555         echo "$as_me:15555: result: $cf_result" >&5
15556 echo "${ECHO_T}$cf_result" >&6
15557         if test $cf_result != no; then
15558                 cat >>confdefs.h <<EOF
15559 #define HAVE_${cf_tr_func} 1
15560 EOF
15561
15562         fi
15563 done
15564
15565 for cf_func in tputs
15566 do
15567
15568 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15569
15570         echo "$as_me:15570: checking for ${cf_func}" >&5
15571 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15572
15573 echo "${as_me:-configure}:15573: testing ${cf_func} ..." 1>&5
15574
15575         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15576   echo $ECHO_N "(cached) $ECHO_C" >&6
15577 else
15578
15579                 eval cf_result='$ac_cv_func_'$cf_func
15580                 if test ".$cf_result" != ".no"; then
15581                         cat >conftest.$ac_ext <<_ACEOF
15582 #line 15582 "configure"
15583 #include "confdefs.h"
15584
15585 #ifdef HAVE_XCURSES
15586 #include <xcurses.h>
15587 char * XCursesProgramName = "test";
15588 #else
15589 #include <${cf_cv_ncurses_header:-curses.h}>
15590 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15591 #include <ncursesw/term.h>
15592 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15593 #include <ncurses/term.h>
15594 #elif defined(HAVE_TERM_H)
15595 #include <term.h>
15596 #endif
15597 #endif
15598
15599 int
15600 main (void)
15601 {
15602
15603 #ifndef ${cf_func}
15604 long foo = (long)(&${cf_func});
15605 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15606 if (foo + 1234 > 5678)
15607         ${cf_cv_main_return:-return}(foo);
15608 #endif
15609
15610   ;
15611   return 0;
15612 }
15613 _ACEOF
15614 rm -f conftest.$ac_objext conftest$ac_exeext
15615 if { (eval echo "$as_me:15615: \"$ac_link\"") >&5
15616   (eval $ac_link) 2>&5
15617   ac_status=$?
15618   echo "$as_me:15618: \$? = $ac_status" >&5
15619   (exit $ac_status); } &&
15620          { ac_try='test -s conftest$ac_exeext'
15621   { (eval echo "$as_me:15621: \"$ac_try\"") >&5
15622   (eval $ac_try) 2>&5
15623   ac_status=$?
15624   echo "$as_me:15624: \$? = $ac_status" >&5
15625   (exit $ac_status); }; }; then
15626   cf_result=yes
15627 else
15628   echo "$as_me: failed program was:" >&5
15629 cat conftest.$ac_ext >&5
15630 cf_result=no
15631 fi
15632 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15633                 fi
15634                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15635
15636 fi
15637
15638         # use the computed/retrieved cache-value:
15639         eval 'cf_result=$cf_cv_func_'$cf_func
15640         echo "$as_me:15640: result: $cf_result" >&5
15641 echo "${ECHO_T}$cf_result" >&6
15642         if test $cf_result != no; then
15643                 cat >>confdefs.h <<EOF
15644 #define HAVE_${cf_tr_func} 1
15645 EOF
15646
15647         fi
15648 done
15649
15650 if test x$cf_cv_func_tputs = xyes
15651 then
15652         cf_done=no
15653         for cf_arg in int char
15654         do
15655                 for cf_ret in int void
15656                 do
15657                         if test $cf_ret = void
15658                         then
15659                                 cf_return="/* nothing */"
15660                         else
15661                                 cf_return="return value"
15662                         fi
15663                         cat >conftest.$ac_ext <<_ACEOF
15664 #line 15664 "configure"
15665 #include "confdefs.h"
15666
15667 #include <${cf_cv_ncurses_header:-curses.h}>
15668 #include <$cf_cv_term_header>
15669
15670 static $cf_ret outc($cf_arg value) { $cf_return; }
15671
15672 int
15673 main (void)
15674 {
15675
15676         tputs("hello", 0, outc);
15677         ${cf_cv_main_return:-return}(0);
15678
15679   ;
15680   return 0;
15681 }
15682 _ACEOF
15683 rm -f conftest.$ac_objext
15684 if { (eval echo "$as_me:15684: \"$ac_compile\"") >&5
15685   (eval $ac_compile) 2>&5
15686   ac_status=$?
15687   echo "$as_me:15687: \$? = $ac_status" >&5
15688   (exit $ac_status); } &&
15689          { ac_try='test -s conftest.$ac_objext'
15690   { (eval echo "$as_me:15690: \"$ac_try\"") >&5
15691   (eval $ac_try) 2>&5
15692   ac_status=$?
15693   echo "$as_me:15693: \$? = $ac_status" >&5
15694   (exit $ac_status); }; }; then
15695
15696                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
15697
15698 echo "${as_me:-configure}:15698: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
15699
15700                 cat >>confdefs.h <<EOF
15701 #define TPUTS_ARG               $cf_arg
15702 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
15703 #define TPUTS_RETURN(value)     $cf_return
15704 EOF
15705                 cf_done=yes
15706                 break
15707
15708 else
15709   echo "$as_me: failed program was:" >&5
15710 cat conftest.$ac_ext >&5
15711 fi
15712 rm -f conftest.$ac_objext conftest.$ac_ext
15713                 done
15714                 test $cf_done = yes && break
15715         done
15716 fi
15717
15718 echo "$as_me:15718: checking for ncurses extended functions" >&5
15719 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
15720 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
15721   echo $ECHO_N "(cached) $ECHO_C" >&6
15722 else
15723
15724 cat >conftest.$ac_ext <<_ACEOF
15725 #line 15725 "configure"
15726 #include "confdefs.h"
15727
15728 #include <${cf_cv_ncurses_header:-curses.h}>
15729 int
15730 main (void)
15731 {
15732
15733 int x = NCURSES_EXT_FUNCS
15734
15735   ;
15736   return 0;
15737 }
15738 _ACEOF
15739 rm -f conftest.$ac_objext
15740 if { (eval echo "$as_me:15740: \"$ac_compile\"") >&5
15741   (eval $ac_compile) 2>&5
15742   ac_status=$?
15743   echo "$as_me:15743: \$? = $ac_status" >&5
15744   (exit $ac_status); } &&
15745          { ac_try='test -s conftest.$ac_objext'
15746   { (eval echo "$as_me:15746: \"$ac_try\"") >&5
15747   (eval $ac_try) 2>&5
15748   ac_status=$?
15749   echo "$as_me:15749: \$? = $ac_status" >&5
15750   (exit $ac_status); }; }; then
15751   cf_cv_ncurses_ext_funcs=defined
15752 else
15753   echo "$as_me: failed program was:" >&5
15754 cat conftest.$ac_ext >&5
15755
15756 cat >conftest.$ac_ext <<_ACEOF
15757 #line 15757 "configure"
15758 #include "confdefs.h"
15759
15760 #include <${cf_cv_ncurses_header:-curses.h}>
15761 int
15762 main (void)
15763 {
15764
15765         (void) assume_default_colors (0, 0);
15766         (void) curses_version ();
15767         (void) define_key (0, 0);
15768         (void) is_term_resized (0, 0);
15769         (void) key_defined (0);
15770         (void) keybound (0, 0);
15771         (void) keyok (0, 0);
15772         (void) resize_term (0, 0);
15773         (void) resizeterm (0, 0);
15774         (void) use_default_colors ();
15775         (void) use_extended_names (0);
15776         (void) wresize (0, 0, 0);
15777   ;
15778   return 0;
15779 }
15780 _ACEOF
15781 rm -f conftest.$ac_objext conftest$ac_exeext
15782 if { (eval echo "$as_me:15782: \"$ac_link\"") >&5
15783   (eval $ac_link) 2>&5
15784   ac_status=$?
15785   echo "$as_me:15785: \$? = $ac_status" >&5
15786   (exit $ac_status); } &&
15787          { ac_try='test -s conftest$ac_exeext'
15788   { (eval echo "$as_me:15788: \"$ac_try\"") >&5
15789   (eval $ac_try) 2>&5
15790   ac_status=$?
15791   echo "$as_me:15791: \$? = $ac_status" >&5
15792   (exit $ac_status); }; }; then
15793   cf_cv_ncurses_ext_funcs=yes
15794 else
15795   echo "$as_me: failed program was:" >&5
15796 cat conftest.$ac_ext >&5
15797 cf_cv_ncurses_ext_funcs=no
15798 fi
15799 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15800
15801 fi
15802 rm -f conftest.$ac_objext conftest.$ac_ext
15803
15804 fi
15805 echo "$as_me:15805: result: $cf_cv_ncurses_ext_funcs" >&5
15806 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
15807 test "$cf_cv_ncurses_ext_funcs" = yes &&
15808 cat >>confdefs.h <<\EOF
15809 #define NCURSES_EXT_FUNCS 1
15810 EOF
15811
15812 if test "$cf_enable_widec" = yes
15813 then
15814         # workaround for systems with ncurses before 20111029, due to change of
15815         # feature test macro from _XPG5 to _XOPEN_SOURCE
15816         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
15817         then
15818                 cf_define_xpg5=no
15819                 echo "$as_me:15819: checking if _XPG5 should be defined to enable wide-characters" >&5
15820 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
15821
15822                 cat >conftest.$ac_ext <<_ACEOF
15823 #line 15823 "configure"
15824 #include "confdefs.h"
15825
15826 #include <${cf_cv_ncurses_header:-curses.h}>
15827 int
15828 main (void)
15829 {
15830 int x = _XPG5
15831   ;
15832   return 0;
15833 }
15834 _ACEOF
15835 rm -f conftest.$ac_objext
15836 if { (eval echo "$as_me:15836: \"$ac_compile\"") >&5
15837   (eval $ac_compile) 2>&5
15838   ac_status=$?
15839   echo "$as_me:15839: \$? = $ac_status" >&5
15840   (exit $ac_status); } &&
15841          { ac_try='test -s conftest.$ac_objext'
15842   { (eval echo "$as_me:15842: \"$ac_try\"") >&5
15843   (eval $ac_try) 2>&5
15844   ac_status=$?
15845   echo "$as_me:15845: \$? = $ac_status" >&5
15846   (exit $ac_status); }; }; then
15847   :
15848 else
15849   echo "$as_me: failed program was:" >&5
15850 cat conftest.$ac_ext >&5
15851 cf_save_cppflags="$CPPFLAGS"
15852                          CPPFLAGS="$CPPFLAGS -D_XPG5"
15853                          cat >conftest.$ac_ext <<_ACEOF
15854 #line 15854 "configure"
15855 #include "confdefs.h"
15856
15857 #include <${cf_cv_ncurses_header:-curses.h}>
15858 int
15859 main (void)
15860 {
15861 int x = _XPG5
15862   ;
15863   return 0;
15864 }
15865 _ACEOF
15866 rm -f conftest.$ac_objext
15867 if { (eval echo "$as_me:15867: \"$ac_compile\"") >&5
15868   (eval $ac_compile) 2>&5
15869   ac_status=$?
15870   echo "$as_me:15870: \$? = $ac_status" >&5
15871   (exit $ac_status); } &&
15872          { ac_try='test -s conftest.$ac_objext'
15873   { (eval echo "$as_me:15873: \"$ac_try\"") >&5
15874   (eval $ac_try) 2>&5
15875   ac_status=$?
15876   echo "$as_me:15876: \$? = $ac_status" >&5
15877   (exit $ac_status); }; }; then
15878   cf_define_xpg5=yes
15879 else
15880   echo "$as_me: failed program was:" >&5
15881 cat conftest.$ac_ext >&5
15882 fi
15883 rm -f conftest.$ac_objext conftest.$ac_ext
15884                          CPPFLAGS="$cf_save_cppflags"
15885 fi
15886 rm -f conftest.$ac_objext conftest.$ac_ext
15887                 echo "$as_me:15887: result: $cf_define_xpg5" >&5
15888 echo "${ECHO_T}$cf_define_xpg5" >&6
15889
15890                 if test "$cf_define_xpg5" = yes
15891                 then
15892                         CPPFLAGS="$CPPFLAGS -D_XPG5"
15893                 fi
15894         fi
15895
15896         echo "$as_me:15896: checking for wide-character functions" >&5
15897 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
15898 if test "${cf_cv_widechar_funcs+set}" = set; then
15899   echo $ECHO_N "(cached) $ECHO_C" >&6
15900 else
15901
15902         cat >conftest.$ac_ext <<_ACEOF
15903 #line 15903 "configure"
15904 #include "confdefs.h"
15905
15906 #include <${cf_cv_ncurses_header:-curses.h}>
15907 int
15908 main (void)
15909 {
15910
15911                 static wchar_t src_wchar[2];
15912                 static cchar_t dst_cchar;
15913                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15914
15915   ;
15916   return 0;
15917 }
15918 _ACEOF
15919 rm -f conftest.$ac_objext conftest$ac_exeext
15920 if { (eval echo "$as_me:15920: \"$ac_link\"") >&5
15921   (eval $ac_link) 2>&5
15922   ac_status=$?
15923   echo "$as_me:15923: \$? = $ac_status" >&5
15924   (exit $ac_status); } &&
15925          { ac_try='test -s conftest$ac_exeext'
15926   { (eval echo "$as_me:15926: \"$ac_try\"") >&5
15927   (eval $ac_try) 2>&5
15928   ac_status=$?
15929   echo "$as_me:15929: \$? = $ac_status" >&5
15930   (exit $ac_status); }; }; then
15931   cf_cv_widechar_funcs=yes
15932 else
15933   echo "$as_me: failed program was:" >&5
15934 cat conftest.$ac_ext >&5
15935 cf_cv_widechar_funcs=no
15936 fi
15937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15938
15939 fi
15940 echo "$as_me:15940: result: $cf_cv_widechar_funcs" >&5
15941 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15942         if test "$cf_cv_widechar_funcs" != no ; then
15943
15944 cat >>confdefs.h <<\EOF
15945 #define USE_WIDEC_SUPPORT 1
15946 EOF
15947
15948         else
15949                 cat >>confdefs.h <<\EOF
15950 #define USE_WIDEC_SUPPORT 0
15951 EOF
15952
15953         fi
15954 else
15955         cat >>confdefs.h <<\EOF
15956 #define USE_WIDEC_SUPPORT 0
15957 EOF
15958
15959 fi
15960
15961 echo "$as_me:15961: checking if $cf_cv_screen library uses pthreads" >&5
15962 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15963 if test "${cf_cv_use_pthreads+set}" = set; then
15964   echo $ECHO_N "(cached) $ECHO_C" >&6
15965 else
15966
15967 cat >conftest.$ac_ext <<_ACEOF
15968 #line 15968 "configure"
15969 #include "confdefs.h"
15970
15971 #include <${cf_cv_ncurses_header:-curses.h}>
15972 extern void _nc_init_pthreads(void);
15973
15974 int
15975 main (void)
15976 {
15977
15978         initscr();
15979         _nc_init_pthreads();
15980
15981   ;
15982   return 0;
15983 }
15984 _ACEOF
15985 rm -f conftest.$ac_objext conftest$ac_exeext
15986 if { (eval echo "$as_me:15986: \"$ac_link\"") >&5
15987   (eval $ac_link) 2>&5
15988   ac_status=$?
15989   echo "$as_me:15989: \$? = $ac_status" >&5
15990   (exit $ac_status); } &&
15991          { ac_try='test -s conftest$ac_exeext'
15992   { (eval echo "$as_me:15992: \"$ac_try\"") >&5
15993   (eval $ac_try) 2>&5
15994   ac_status=$?
15995   echo "$as_me:15995: \$? = $ac_status" >&5
15996   (exit $ac_status); }; }; then
15997   cf_cv_use_pthreads=yes
15998 else
15999   echo "$as_me: failed program was:" >&5
16000 cat conftest.$ac_ext >&5
16001 cf_cv_use_pthreads=no
16002 fi
16003 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16004
16005 fi
16006 echo "$as_me:16006: result: $cf_cv_use_pthreads" >&5
16007 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
16008 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
16009 #define USE_PTHREADS 1
16010 EOF
16011
16012 echo "$as_me:16012: checking if sys/time.h works with sys/select.h" >&5
16013 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
16014 if test "${cf_cv_sys_time_select+set}" = set; then
16015   echo $ECHO_N "(cached) $ECHO_C" >&6
16016 else
16017
16018 cat >conftest.$ac_ext <<_ACEOF
16019 #line 16019 "configure"
16020 #include "confdefs.h"
16021
16022 #include <sys/types.h>
16023 #ifdef HAVE_SYS_TIME_H
16024 #include <sys/time.h>
16025 #endif
16026 #ifdef HAVE_SYS_SELECT_H
16027 #include <sys/select.h>
16028 #endif
16029
16030 int
16031 main (void)
16032 {
16033
16034   ;
16035   return 0;
16036 }
16037 _ACEOF
16038 rm -f conftest.$ac_objext
16039 if { (eval echo "$as_me:16039: \"$ac_compile\"") >&5
16040   (eval $ac_compile) 2>&5
16041   ac_status=$?
16042   echo "$as_me:16042: \$? = $ac_status" >&5
16043   (exit $ac_status); } &&
16044          { ac_try='test -s conftest.$ac_objext'
16045   { (eval echo "$as_me:16045: \"$ac_try\"") >&5
16046   (eval $ac_try) 2>&5
16047   ac_status=$?
16048   echo "$as_me:16048: \$? = $ac_status" >&5
16049   (exit $ac_status); }; }; then
16050   cf_cv_sys_time_select=yes
16051 else
16052   echo "$as_me: failed program was:" >&5
16053 cat conftest.$ac_ext >&5
16054 cf_cv_sys_time_select=no
16055 fi
16056 rm -f conftest.$ac_objext conftest.$ac_ext
16057
16058 fi
16059
16060 echo "$as_me:16060: result: $cf_cv_sys_time_select" >&5
16061 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
16062 test "$cf_cv_sys_time_select" = yes &&
16063 cat >>confdefs.h <<\EOF
16064 #define HAVE_SYS_TIME_SELECT 1
16065 EOF
16066
16067 # special check for test/ditto.c
16068
16069 echo "$as_me:16069: checking for openpty in -lutil" >&5
16070 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
16071 if test "${ac_cv_lib_util_openpty+set}" = set; then
16072   echo $ECHO_N "(cached) $ECHO_C" >&6
16073 else
16074   ac_check_lib_save_LIBS=$LIBS
16075 LIBS="-lutil  $LIBS"
16076 cat >conftest.$ac_ext <<_ACEOF
16077 #line 16077 "configure"
16078 #include "confdefs.h"
16079
16080 /* Override any gcc2 internal prototype to avoid an error.  */
16081 #ifdef __cplusplus
16082 extern "C"
16083 #endif
16084 /* We use char because int might match the return type of a gcc2
16085    builtin and then its argument prototype would still apply.  */
16086 char openpty ();
16087 int
16088 main (void)
16089 {
16090 openpty ();
16091   ;
16092   return 0;
16093 }
16094 _ACEOF
16095 rm -f conftest.$ac_objext conftest$ac_exeext
16096 if { (eval echo "$as_me:16096: \"$ac_link\"") >&5
16097   (eval $ac_link) 2>&5
16098   ac_status=$?
16099   echo "$as_me:16099: \$? = $ac_status" >&5
16100   (exit $ac_status); } &&
16101          { ac_try='test -s conftest$ac_exeext'
16102   { (eval echo "$as_me:16102: \"$ac_try\"") >&5
16103   (eval $ac_try) 2>&5
16104   ac_status=$?
16105   echo "$as_me:16105: \$? = $ac_status" >&5
16106   (exit $ac_status); }; }; then
16107   ac_cv_lib_util_openpty=yes
16108 else
16109   echo "$as_me: failed program was:" >&5
16110 cat conftest.$ac_ext >&5
16111 ac_cv_lib_util_openpty=no
16112 fi
16113 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16114 LIBS=$ac_check_lib_save_LIBS
16115 fi
16116 echo "$as_me:16116: result: $ac_cv_lib_util_openpty" >&5
16117 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
16118 if test $ac_cv_lib_util_openpty = yes; then
16119   cf_cv_lib_util=yes
16120 else
16121   cf_cv_lib_util=no
16122 fi
16123
16124 echo "$as_me:16124: checking for openpty header" >&5
16125 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
16126 if test "${cf_cv_func_openpty+set}" = set; then
16127   echo $ECHO_N "(cached) $ECHO_C" >&6
16128 else
16129
16130         cf_save_LIBS="$LIBS"
16131         test $cf_cv_lib_util = yes && {
16132 cf_add_libs="-lutil"
16133 # Filter out duplicates - this happens with badly-designed ".pc" files...
16134 for cf_add_1lib in $LIBS
16135 do
16136         for cf_add_2lib in $cf_add_libs
16137         do
16138                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16139                 then
16140                         cf_add_1lib=
16141                         break
16142                 fi
16143         done
16144         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16145 done
16146 LIBS="$cf_add_libs"
16147  }
16148         for cf_header in pty.h libutil.h util.h
16149         do
16150         cat >conftest.$ac_ext <<_ACEOF
16151 #line 16151 "configure"
16152 #include "confdefs.h"
16153
16154 #include <$cf_header>
16155
16156 int
16157 main (void)
16158 {
16159
16160         int x = openpty((int *)0, (int *)0, (char *)0,
16161                                    (struct termios *)0, (struct winsize *)0);
16162
16163   ;
16164   return 0;
16165 }
16166 _ACEOF
16167 rm -f conftest.$ac_objext conftest$ac_exeext
16168 if { (eval echo "$as_me:16168: \"$ac_link\"") >&5
16169   (eval $ac_link) 2>&5
16170   ac_status=$?
16171   echo "$as_me:16171: \$? = $ac_status" >&5
16172   (exit $ac_status); } &&
16173          { ac_try='test -s conftest$ac_exeext'
16174   { (eval echo "$as_me:16174: \"$ac_try\"") >&5
16175   (eval $ac_try) 2>&5
16176   ac_status=$?
16177   echo "$as_me:16177: \$? = $ac_status" >&5
16178   (exit $ac_status); }; }; then
16179
16180                 cf_cv_func_openpty=$cf_header
16181                 break
16182
16183 else
16184   echo "$as_me: failed program was:" >&5
16185 cat conftest.$ac_ext >&5
16186
16187                 cf_cv_func_openpty=no
16188
16189 fi
16190 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16191         done
16192         LIBS="$cf_save_LIBS"
16193
16194 fi
16195 echo "$as_me:16195: result: $cf_cv_func_openpty" >&5
16196 echo "${ECHO_T}$cf_cv_func_openpty" >&6
16197
16198 if test "$cf_cv_func_openpty" != no ; then
16199
16200 cat >>confdefs.h <<EOF
16201 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
16202 EOF
16203
16204 cat >>confdefs.h <<\EOF
16205 #define USE_XTERM_PTY 1
16206 EOF
16207
16208         if test "x$cf_cv_lib_util" = xyes ; then
16209
16210 cf_add_libs="-lutil"
16211 # Filter out duplicates - this happens with badly-designed ".pc" files...
16212 for cf_add_1lib in $TEST_LIBS
16213 do
16214         for cf_add_2lib in $cf_add_libs
16215         do
16216                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16217                 then
16218                         cf_add_1lib=
16219                         break
16220                 fi
16221         done
16222         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16223 done
16224 TEST_LIBS="$cf_add_libs"
16225
16226         fi
16227 fi
16228
16229 echo "$as_me:16229: checking for function curses_version" >&5
16230 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
16231 if test "${cf_cv_func_curses_version+set}" = set; then
16232   echo $ECHO_N "(cached) $ECHO_C" >&6
16233 else
16234
16235 if test "$cross_compiling" = yes; then
16236   cf_cv_func_curses_version=unknown
16237 else
16238   cat >conftest.$ac_ext <<_ACEOF
16239 #line 16239 "configure"
16240 #include "confdefs.h"
16241
16242 #include <${cf_cv_ncurses_header:-curses.h}>
16243 int main(void)
16244 {
16245         char temp[1024];
16246         sprintf(temp, "%s\n", curses_version());
16247         ${cf_cv_main_return:-return}(0);
16248 }
16249
16250 _ACEOF
16251 rm -f conftest$ac_exeext
16252 if { (eval echo "$as_me:16252: \"$ac_link\"") >&5
16253   (eval $ac_link) 2>&5
16254   ac_status=$?
16255   echo "$as_me:16255: \$? = $ac_status" >&5
16256   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16257   { (eval echo "$as_me:16257: \"$ac_try\"") >&5
16258   (eval $ac_try) 2>&5
16259   ac_status=$?
16260   echo "$as_me:16260: \$? = $ac_status" >&5
16261   (exit $ac_status); }; }; then
16262   cf_cv_func_curses_version=yes
16263
16264 else
16265   echo "$as_me: program exited with status $ac_status" >&5
16266 echo "$as_me: failed program was:" >&5
16267 cat conftest.$ac_ext >&5
16268 cf_cv_func_curses_version=no
16269
16270 fi
16271 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16272 fi
16273 rm -f core
16274 fi
16275 echo "$as_me:16275: result: $cf_cv_func_curses_version" >&5
16276 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
16277 test "$cf_cv_func_curses_version" = yes &&
16278 cat >>confdefs.h <<\EOF
16279 #define HAVE_CURSES_VERSION 1
16280 EOF
16281
16282 echo "$as_me:16282: checking for alternate character set array" >&5
16283 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
16284 if test "${cf_cv_curses_acs_map+set}" = set; then
16285   echo $ECHO_N "(cached) $ECHO_C" >&6
16286 else
16287
16288 cf_cv_curses_acs_map=unknown
16289 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
16290 do
16291 cat >conftest.$ac_ext <<_ACEOF
16292 #line 16292 "configure"
16293 #include "confdefs.h"
16294
16295 #include <${cf_cv_ncurses_header:-curses.h}>
16296
16297 int
16298 main (void)
16299 {
16300
16301 $name['k'] = ACS_PLUS
16302
16303   ;
16304   return 0;
16305 }
16306 _ACEOF
16307 rm -f conftest.$ac_objext conftest$ac_exeext
16308 if { (eval echo "$as_me:16308: \"$ac_link\"") >&5
16309   (eval $ac_link) 2>&5
16310   ac_status=$?
16311   echo "$as_me:16311: \$? = $ac_status" >&5
16312   (exit $ac_status); } &&
16313          { ac_try='test -s conftest$ac_exeext'
16314   { (eval echo "$as_me:16314: \"$ac_try\"") >&5
16315   (eval $ac_try) 2>&5
16316   ac_status=$?
16317   echo "$as_me:16317: \$? = $ac_status" >&5
16318   (exit $ac_status); }; }; then
16319   cf_cv_curses_acs_map=$name; break
16320 else
16321   echo "$as_me: failed program was:" >&5
16322 cat conftest.$ac_ext >&5
16323 fi
16324 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16325 done
16326
16327 fi
16328 echo "$as_me:16328: result: $cf_cv_curses_acs_map" >&5
16329 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
16330
16331 test "$cf_cv_curses_acs_map" != unknown &&
16332 cat >>confdefs.h <<EOF
16333 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
16334 EOF
16335
16336 if test "$cf_enable_widec" = yes; then
16337
16338 echo "$as_me:16338: checking for wide alternate character set array" >&5
16339 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
16340 if test "${cf_cv_curses_wacs_map+set}" = set; then
16341   echo $ECHO_N "(cached) $ECHO_C" >&6
16342 else
16343
16344         cf_cv_curses_wacs_map=unknown
16345         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
16346         do
16347         cat >conftest.$ac_ext <<_ACEOF
16348 #line 16348 "configure"
16349 #include "confdefs.h"
16350
16351 #ifndef _XOPEN_SOURCE_EXTENDED
16352 #define _XOPEN_SOURCE_EXTENDED
16353 #endif
16354 #include <${cf_cv_ncurses_header:-curses.h}>
16355 int
16356 main (void)
16357 {
16358 void *foo = &($name['k'])
16359   ;
16360   return 0;
16361 }
16362 _ACEOF
16363 rm -f conftest.$ac_objext conftest$ac_exeext
16364 if { (eval echo "$as_me:16364: \"$ac_link\"") >&5
16365   (eval $ac_link) 2>&5
16366   ac_status=$?
16367   echo "$as_me:16367: \$? = $ac_status" >&5
16368   (exit $ac_status); } &&
16369          { ac_try='test -s conftest$ac_exeext'
16370   { (eval echo "$as_me:16370: \"$ac_try\"") >&5
16371   (eval $ac_try) 2>&5
16372   ac_status=$?
16373   echo "$as_me:16373: \$? = $ac_status" >&5
16374   (exit $ac_status); }; }; then
16375   cf_cv_curses_wacs_map=$name
16376          break
16377 else
16378   echo "$as_me: failed program was:" >&5
16379 cat conftest.$ac_ext >&5
16380 fi
16381 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16382         done
16383 fi
16384 echo "$as_me:16384: result: $cf_cv_curses_wacs_map" >&5
16385 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
16386
16387 test "$cf_cv_curses_wacs_map" != unknown &&
16388 cat >>confdefs.h <<EOF
16389 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
16390 EOF
16391
16392 echo "$as_me:16392: checking for wide alternate character constants" >&5
16393 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
16394 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
16395   echo $ECHO_N "(cached) $ECHO_C" >&6
16396 else
16397
16398 cf_cv_curses_wacs_symbols=no
16399 if test "$cf_cv_curses_wacs_map" != unknown
16400 then
16401         cat >conftest.$ac_ext <<_ACEOF
16402 #line 16402 "configure"
16403 #include "confdefs.h"
16404
16405 #ifndef _XOPEN_SOURCE_EXTENDED
16406 #define _XOPEN_SOURCE_EXTENDED
16407 #endif
16408 #include <${cf_cv_ncurses_header:-curses.h}>
16409 int
16410 main (void)
16411 {
16412 cchar_t *foo = WACS_PLUS;
16413          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
16414   ;
16415   return 0;
16416 }
16417 _ACEOF
16418 rm -f conftest.$ac_objext conftest$ac_exeext
16419 if { (eval echo "$as_me:16419: \"$ac_link\"") >&5
16420   (eval $ac_link) 2>&5
16421   ac_status=$?
16422   echo "$as_me:16422: \$? = $ac_status" >&5
16423   (exit $ac_status); } &&
16424          { ac_try='test -s conftest$ac_exeext'
16425   { (eval echo "$as_me:16425: \"$ac_try\"") >&5
16426   (eval $ac_try) 2>&5
16427   ac_status=$?
16428   echo "$as_me:16428: \$? = $ac_status" >&5
16429   (exit $ac_status); }; }; then
16430   cf_cv_curses_wacs_symbols=yes
16431 else
16432   echo "$as_me: failed program was:" >&5
16433 cat conftest.$ac_ext >&5
16434 fi
16435 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16436 else
16437         cat >conftest.$ac_ext <<_ACEOF
16438 #line 16438 "configure"
16439 #include "confdefs.h"
16440
16441 #ifndef _XOPEN_SOURCE_EXTENDED
16442 #define _XOPEN_SOURCE_EXTENDED
16443 #endif
16444 #include <${cf_cv_ncurses_header:-curses.h}>
16445 int
16446 main (void)
16447 {
16448 cchar_t *foo = WACS_PLUS
16449   ;
16450   return 0;
16451 }
16452 _ACEOF
16453 rm -f conftest.$ac_objext conftest$ac_exeext
16454 if { (eval echo "$as_me:16454: \"$ac_link\"") >&5
16455   (eval $ac_link) 2>&5
16456   ac_status=$?
16457   echo "$as_me:16457: \$? = $ac_status" >&5
16458   (exit $ac_status); } &&
16459          { ac_try='test -s conftest$ac_exeext'
16460   { (eval echo "$as_me:16460: \"$ac_try\"") >&5
16461   (eval $ac_try) 2>&5
16462   ac_status=$?
16463   echo "$as_me:16463: \$? = $ac_status" >&5
16464   (exit $ac_status); }; }; then
16465   cf_cv_curses_wacs_symbols=yes
16466 else
16467   echo "$as_me: failed program was:" >&5
16468 cat conftest.$ac_ext >&5
16469 fi
16470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16471 fi
16472
16473 fi
16474 echo "$as_me:16474: result: $cf_cv_curses_wacs_symbols" >&5
16475 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
16476
16477 test "$cf_cv_curses_wacs_symbols" != no &&
16478 cat >>confdefs.h <<\EOF
16479 #define CURSES_WACS_SYMBOLS 1
16480 EOF
16481
16482 fi
16483
16484 echo "$as_me:16484: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16485 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16486 cat >conftest.$ac_ext <<_ACEOF
16487 #line 16487 "configure"
16488 #include "confdefs.h"
16489
16490 #ifndef _XOPEN_SOURCE_EXTENDED
16491 #define _XOPEN_SOURCE_EXTENDED
16492 #endif
16493 #include <${cf_cv_ncurses_header:-curses.h}>
16494 int
16495 main (void)
16496 {
16497
16498 attr_t foo
16499
16500   ;
16501   return 0;
16502 }
16503 _ACEOF
16504 rm -f conftest.$ac_objext
16505 if { (eval echo "$as_me:16505: \"$ac_compile\"") >&5
16506   (eval $ac_compile) 2>&5
16507   ac_status=$?
16508   echo "$as_me:16508: \$? = $ac_status" >&5
16509   (exit $ac_status); } &&
16510          { ac_try='test -s conftest.$ac_objext'
16511   { (eval echo "$as_me:16511: \"$ac_try\"") >&5
16512   (eval $ac_try) 2>&5
16513   ac_status=$?
16514   echo "$as_me:16514: \$? = $ac_status" >&5
16515   (exit $ac_status); }; }; then
16516   cf_result=yes
16517 else
16518   echo "$as_me: failed program was:" >&5
16519 cat conftest.$ac_ext >&5
16520 cf_result=no
16521 fi
16522 rm -f conftest.$ac_objext conftest.$ac_ext
16523 echo "$as_me:16523: result: $cf_result" >&5
16524 echo "${ECHO_T}$cf_result" >&6
16525 if test $cf_result = yes ; then
16526
16527 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16528
16529 cat >>confdefs.h <<EOF
16530 #define $cf_result 1
16531 EOF
16532
16533 else
16534
16535 cat >>confdefs.h <<EOF
16536 #define attr_t long
16537 EOF
16538
16539 fi
16540
16541 if test "$cf_enable_widec" = yes; then
16542
16543 # This is needed on Tru64 5.0 to declare mbstate_t
16544 echo "$as_me:16544: checking if we must include wchar.h to declare mbstate_t" >&5
16545 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
16546 if test "${cf_cv_mbstate_t+set}" = set; then
16547   echo $ECHO_N "(cached) $ECHO_C" >&6
16548 else
16549
16550 cat >conftest.$ac_ext <<_ACEOF
16551 #line 16551 "configure"
16552 #include "confdefs.h"
16553
16554 #include <stdlib.h>
16555 #include <stdarg.h>
16556 #include <stdio.h>
16557 #ifdef HAVE_LIBUTF8_H
16558 #include <libutf8.h>
16559 #endif
16560 int
16561 main (void)
16562 {
16563 mbstate_t state
16564   ;
16565   return 0;
16566 }
16567 _ACEOF
16568 rm -f conftest.$ac_objext
16569 if { (eval echo "$as_me:16569: \"$ac_compile\"") >&5
16570   (eval $ac_compile) 2>&5
16571   ac_status=$?
16572   echo "$as_me:16572: \$? = $ac_status" >&5
16573   (exit $ac_status); } &&
16574          { ac_try='test -s conftest.$ac_objext'
16575   { (eval echo "$as_me:16575: \"$ac_try\"") >&5
16576   (eval $ac_try) 2>&5
16577   ac_status=$?
16578   echo "$as_me:16578: \$? = $ac_status" >&5
16579   (exit $ac_status); }; }; then
16580   cf_cv_mbstate_t=no
16581 else
16582   echo "$as_me: failed program was:" >&5
16583 cat conftest.$ac_ext >&5
16584 cat >conftest.$ac_ext <<_ACEOF
16585 #line 16585 "configure"
16586 #include "confdefs.h"
16587
16588 #include <stdlib.h>
16589 #include <stdarg.h>
16590 #include <stdio.h>
16591 #include <wchar.h>
16592 #ifdef HAVE_LIBUTF8_H
16593 #include <libutf8.h>
16594 #endif
16595 int
16596 main (void)
16597 {
16598 mbstate_t value
16599   ;
16600   return 0;
16601 }
16602 _ACEOF
16603 rm -f conftest.$ac_objext
16604 if { (eval echo "$as_me:16604: \"$ac_compile\"") >&5
16605   (eval $ac_compile) 2>&5
16606   ac_status=$?
16607   echo "$as_me:16607: \$? = $ac_status" >&5
16608   (exit $ac_status); } &&
16609          { ac_try='test -s conftest.$ac_objext'
16610   { (eval echo "$as_me:16610: \"$ac_try\"") >&5
16611   (eval $ac_try) 2>&5
16612   ac_status=$?
16613   echo "$as_me:16613: \$? = $ac_status" >&5
16614   (exit $ac_status); }; }; then
16615   cf_cv_mbstate_t=yes
16616 else
16617   echo "$as_me: failed program was:" >&5
16618 cat conftest.$ac_ext >&5
16619 cf_cv_mbstate_t=unknown
16620 fi
16621 rm -f conftest.$ac_objext conftest.$ac_ext
16622 fi
16623 rm -f conftest.$ac_objext conftest.$ac_ext
16624 fi
16625 echo "$as_me:16625: result: $cf_cv_mbstate_t" >&5
16626 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
16627
16628 if test "$cf_cv_mbstate_t" = yes ; then
16629
16630 cat >>confdefs.h <<\EOF
16631 #define NEED_WCHAR_H 1
16632 EOF
16633
16634         NEED_WCHAR_H=1
16635 fi
16636
16637 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
16638 if test "$cf_cv_mbstate_t" = unknown ; then
16639         NCURSES_MBSTATE_T=1
16640 fi
16641
16642 # if we find mbstate_t in either place, use substitution to provide a fallback.
16643 if test "$cf_cv_mbstate_t" != unknown ; then
16644         NCURSES_OK_MBSTATE_T=1
16645 fi
16646
16647 # This is needed on Tru64 5.0 to declare wchar_t
16648 echo "$as_me:16648: checking if we must include wchar.h to declare wchar_t" >&5
16649 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
16650 if test "${cf_cv_wchar_t+set}" = set; then
16651   echo $ECHO_N "(cached) $ECHO_C" >&6
16652 else
16653
16654 cat >conftest.$ac_ext <<_ACEOF
16655 #line 16655 "configure"
16656 #include "confdefs.h"
16657
16658 #include <stdlib.h>
16659 #include <stdarg.h>
16660 #include <stdio.h>
16661 #ifdef HAVE_LIBUTF8_H
16662 #include <libutf8.h>
16663 #endif
16664 int
16665 main (void)
16666 {
16667 wchar_t state
16668   ;
16669   return 0;
16670 }
16671 _ACEOF
16672 rm -f conftest.$ac_objext
16673 if { (eval echo "$as_me:16673: \"$ac_compile\"") >&5
16674   (eval $ac_compile) 2>&5
16675   ac_status=$?
16676   echo "$as_me:16676: \$? = $ac_status" >&5
16677   (exit $ac_status); } &&
16678          { ac_try='test -s conftest.$ac_objext'
16679   { (eval echo "$as_me:16679: \"$ac_try\"") >&5
16680   (eval $ac_try) 2>&5
16681   ac_status=$?
16682   echo "$as_me:16682: \$? = $ac_status" >&5
16683   (exit $ac_status); }; }; then
16684   cf_cv_wchar_t=no
16685 else
16686   echo "$as_me: failed program was:" >&5
16687 cat conftest.$ac_ext >&5
16688 cat >conftest.$ac_ext <<_ACEOF
16689 #line 16689 "configure"
16690 #include "confdefs.h"
16691
16692 #include <stdlib.h>
16693 #include <stdarg.h>
16694 #include <stdio.h>
16695 #include <wchar.h>
16696 #ifdef HAVE_LIBUTF8_H
16697 #include <libutf8.h>
16698 #endif
16699 int
16700 main (void)
16701 {
16702 wchar_t value
16703   ;
16704   return 0;
16705 }
16706 _ACEOF
16707 rm -f conftest.$ac_objext
16708 if { (eval echo "$as_me:16708: \"$ac_compile\"") >&5
16709   (eval $ac_compile) 2>&5
16710   ac_status=$?
16711   echo "$as_me:16711: \$? = $ac_status" >&5
16712   (exit $ac_status); } &&
16713          { ac_try='test -s conftest.$ac_objext'
16714   { (eval echo "$as_me:16714: \"$ac_try\"") >&5
16715   (eval $ac_try) 2>&5
16716   ac_status=$?
16717   echo "$as_me:16717: \$? = $ac_status" >&5
16718   (exit $ac_status); }; }; then
16719   cf_cv_wchar_t=yes
16720 else
16721   echo "$as_me: failed program was:" >&5
16722 cat conftest.$ac_ext >&5
16723 cf_cv_wchar_t=unknown
16724 fi
16725 rm -f conftest.$ac_objext conftest.$ac_ext
16726 fi
16727 rm -f conftest.$ac_objext conftest.$ac_ext
16728 fi
16729 echo "$as_me:16729: result: $cf_cv_wchar_t" >&5
16730 echo "${ECHO_T}$cf_cv_wchar_t" >&6
16731
16732 if test "$cf_cv_wchar_t" = yes ; then
16733
16734 cat >>confdefs.h <<\EOF
16735 #define NEED_WCHAR_H 1
16736 EOF
16737
16738         NEED_WCHAR_H=1
16739 fi
16740
16741 # if we do not find wchar_t in either place, use substitution to provide a fallback.
16742 if test "$cf_cv_wchar_t" = unknown ; then
16743         NCURSES_WCHAR_T=1
16744 fi
16745
16746 # if we find wchar_t in either place, use substitution to provide a fallback.
16747 if test "$cf_cv_wchar_t" != unknown ; then
16748         NCURSES_OK_WCHAR_T=1
16749 fi
16750
16751 # This is needed on Tru64 5.0 to declare wint_t
16752 echo "$as_me:16752: checking if we must include wchar.h to declare wint_t" >&5
16753 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
16754 if test "${cf_cv_wint_t+set}" = set; then
16755   echo $ECHO_N "(cached) $ECHO_C" >&6
16756 else
16757
16758 cat >conftest.$ac_ext <<_ACEOF
16759 #line 16759 "configure"
16760 #include "confdefs.h"
16761
16762 #include <stdlib.h>
16763 #include <stdarg.h>
16764 #include <stdio.h>
16765 #ifdef HAVE_LIBUTF8_H
16766 #include <libutf8.h>
16767 #endif
16768 int
16769 main (void)
16770 {
16771 wint_t state
16772   ;
16773   return 0;
16774 }
16775 _ACEOF
16776 rm -f conftest.$ac_objext
16777 if { (eval echo "$as_me:16777: \"$ac_compile\"") >&5
16778   (eval $ac_compile) 2>&5
16779   ac_status=$?
16780   echo "$as_me:16780: \$? = $ac_status" >&5
16781   (exit $ac_status); } &&
16782          { ac_try='test -s conftest.$ac_objext'
16783   { (eval echo "$as_me:16783: \"$ac_try\"") >&5
16784   (eval $ac_try) 2>&5
16785   ac_status=$?
16786   echo "$as_me:16786: \$? = $ac_status" >&5
16787   (exit $ac_status); }; }; then
16788   cf_cv_wint_t=no
16789 else
16790   echo "$as_me: failed program was:" >&5
16791 cat conftest.$ac_ext >&5
16792 cat >conftest.$ac_ext <<_ACEOF
16793 #line 16793 "configure"
16794 #include "confdefs.h"
16795
16796 #include <stdlib.h>
16797 #include <stdarg.h>
16798 #include <stdio.h>
16799 #include <wchar.h>
16800 #ifdef HAVE_LIBUTF8_H
16801 #include <libutf8.h>
16802 #endif
16803 int
16804 main (void)
16805 {
16806 wint_t value
16807   ;
16808   return 0;
16809 }
16810 _ACEOF
16811 rm -f conftest.$ac_objext
16812 if { (eval echo "$as_me:16812: \"$ac_compile\"") >&5
16813   (eval $ac_compile) 2>&5
16814   ac_status=$?
16815   echo "$as_me:16815: \$? = $ac_status" >&5
16816   (exit $ac_status); } &&
16817          { ac_try='test -s conftest.$ac_objext'
16818   { (eval echo "$as_me:16818: \"$ac_try\"") >&5
16819   (eval $ac_try) 2>&5
16820   ac_status=$?
16821   echo "$as_me:16821: \$? = $ac_status" >&5
16822   (exit $ac_status); }; }; then
16823   cf_cv_wint_t=yes
16824 else
16825   echo "$as_me: failed program was:" >&5
16826 cat conftest.$ac_ext >&5
16827 cf_cv_wint_t=unknown
16828 fi
16829 rm -f conftest.$ac_objext conftest.$ac_ext
16830 fi
16831 rm -f conftest.$ac_objext conftest.$ac_ext
16832 fi
16833 echo "$as_me:16833: result: $cf_cv_wint_t" >&5
16834 echo "${ECHO_T}$cf_cv_wint_t" >&6
16835
16836 if test "$cf_cv_wint_t" = yes ; then
16837
16838 cat >>confdefs.h <<\EOF
16839 #define NEED_WCHAR_H 1
16840 EOF
16841
16842         NEED_WCHAR_H=1
16843 fi
16844
16845 # if we do not find wint_t in either place, use substitution to provide a fallback.
16846 if test "$cf_cv_wint_t" = unknown ; then
16847         NCURSES_WINT_T=1
16848 fi
16849
16850 # if we find wint_t in either place, use substitution to provide a fallback.
16851 if test "$cf_cv_wint_t" != unknown ; then
16852         NCURSES_OK_WINT_T=1
16853 fi
16854
16855         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
16856
16857 echo "$as_me:16857: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16858 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16859 cat >conftest.$ac_ext <<_ACEOF
16860 #line 16860 "configure"
16861 #include "confdefs.h"
16862
16863 #ifndef _XOPEN_SOURCE_EXTENDED
16864 #define _XOPEN_SOURCE_EXTENDED
16865 #endif
16866 #include <${cf_cv_ncurses_header:-curses.h}>
16867 int
16868 main (void)
16869 {
16870
16871 mbstate_t foo
16872
16873   ;
16874   return 0;
16875 }
16876 _ACEOF
16877 rm -f conftest.$ac_objext
16878 if { (eval echo "$as_me:16878: \"$ac_compile\"") >&5
16879   (eval $ac_compile) 2>&5
16880   ac_status=$?
16881   echo "$as_me:16881: \$? = $ac_status" >&5
16882   (exit $ac_status); } &&
16883          { ac_try='test -s conftest.$ac_objext'
16884   { (eval echo "$as_me:16884: \"$ac_try\"") >&5
16885   (eval $ac_try) 2>&5
16886   ac_status=$?
16887   echo "$as_me:16887: \$? = $ac_status" >&5
16888   (exit $ac_status); }; }; then
16889   cf_result=yes
16890 else
16891   echo "$as_me: failed program was:" >&5
16892 cat conftest.$ac_ext >&5
16893 cf_result=no
16894 fi
16895 rm -f conftest.$ac_objext conftest.$ac_ext
16896 echo "$as_me:16896: result: $cf_result" >&5
16897 echo "${ECHO_T}$cf_result" >&6
16898 if test $cf_result = yes ; then
16899
16900 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16901
16902 cat >>confdefs.h <<EOF
16903 #define $cf_result 1
16904 EOF
16905
16906 else
16907
16908 cat >>confdefs.h <<EOF
16909 #define mbstate_t long
16910 EOF
16911
16912 fi
16913
16914         fi
16915
16916         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16917
16918 echo "$as_me:16918: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16919 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16920 cat >conftest.$ac_ext <<_ACEOF
16921 #line 16921 "configure"
16922 #include "confdefs.h"
16923
16924 #ifndef _XOPEN_SOURCE_EXTENDED
16925 #define _XOPEN_SOURCE_EXTENDED
16926 #endif
16927 #include <${cf_cv_ncurses_header:-curses.h}>
16928 int
16929 main (void)
16930 {
16931
16932 wchar_t foo
16933
16934   ;
16935   return 0;
16936 }
16937 _ACEOF
16938 rm -f conftest.$ac_objext
16939 if { (eval echo "$as_me:16939: \"$ac_compile\"") >&5
16940   (eval $ac_compile) 2>&5
16941   ac_status=$?
16942   echo "$as_me:16942: \$? = $ac_status" >&5
16943   (exit $ac_status); } &&
16944          { ac_try='test -s conftest.$ac_objext'
16945   { (eval echo "$as_me:16945: \"$ac_try\"") >&5
16946   (eval $ac_try) 2>&5
16947   ac_status=$?
16948   echo "$as_me:16948: \$? = $ac_status" >&5
16949   (exit $ac_status); }; }; then
16950   cf_result=yes
16951 else
16952   echo "$as_me: failed program was:" >&5
16953 cat conftest.$ac_ext >&5
16954 cf_result=no
16955 fi
16956 rm -f conftest.$ac_objext conftest.$ac_ext
16957 echo "$as_me:16957: result: $cf_result" >&5
16958 echo "${ECHO_T}$cf_result" >&6
16959 if test $cf_result = yes ; then
16960
16961 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16962
16963 cat >>confdefs.h <<EOF
16964 #define $cf_result 1
16965 EOF
16966
16967 else
16968
16969 cat >>confdefs.h <<EOF
16970 #define wchar_t long
16971 EOF
16972
16973 fi
16974
16975         fi
16976
16977         if test "$NCURSES_OK_WINT_T" = 0 ; then
16978
16979 echo "$as_me:16979: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16980 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16981 cat >conftest.$ac_ext <<_ACEOF
16982 #line 16982 "configure"
16983 #include "confdefs.h"
16984
16985 #ifndef _XOPEN_SOURCE_EXTENDED
16986 #define _XOPEN_SOURCE_EXTENDED
16987 #endif
16988 #include <${cf_cv_ncurses_header:-curses.h}>
16989 int
16990 main (void)
16991 {
16992
16993 wint_t foo
16994
16995   ;
16996   return 0;
16997 }
16998 _ACEOF
16999 rm -f conftest.$ac_objext
17000 if { (eval echo "$as_me:17000: \"$ac_compile\"") >&5
17001   (eval $ac_compile) 2>&5
17002   ac_status=$?
17003   echo "$as_me:17003: \$? = $ac_status" >&5
17004   (exit $ac_status); } &&
17005          { ac_try='test -s conftest.$ac_objext'
17006   { (eval echo "$as_me:17006: \"$ac_try\"") >&5
17007   (eval $ac_try) 2>&5
17008   ac_status=$?
17009   echo "$as_me:17009: \$? = $ac_status" >&5
17010   (exit $ac_status); }; }; then
17011   cf_result=yes
17012 else
17013   echo "$as_me: failed program was:" >&5
17014 cat conftest.$ac_ext >&5
17015 cf_result=no
17016 fi
17017 rm -f conftest.$ac_objext conftest.$ac_ext
17018 echo "$as_me:17018: result: $cf_result" >&5
17019 echo "${ECHO_T}$cf_result" >&6
17020 if test $cf_result = yes ; then
17021
17022 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17023
17024 cat >>confdefs.h <<EOF
17025 #define $cf_result 1
17026 EOF
17027
17028 else
17029
17030 cat >>confdefs.h <<EOF
17031 #define wint_t long
17032 EOF
17033
17034 fi
17035
17036         fi
17037 fi
17038
17039 for cf_data in ospeed
17040 do
17041 echo "$as_me:17041: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17042 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17043
17044 cat >conftest.$ac_ext <<_ACEOF
17045 #line 17045 "configure"
17046 #include "confdefs.h"
17047
17048 #ifdef HAVE_XCURSES
17049 #include <xcurses.h>
17050 char * XCursesProgramName = "test";
17051 #else
17052 #include <${cf_cv_ncurses_header:-curses.h}>
17053 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17054 #include <ncursesw/term.h>
17055 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17056 #include <ncurses/term.h>
17057 #elif defined(HAVE_TERM_H)
17058 #include <term.h>
17059 #endif
17060 #endif
17061
17062 int
17063 main (void)
17064 {
17065
17066 void *foo = &($cf_data)
17067
17068   ;
17069   return 0;
17070 }
17071 _ACEOF
17072 rm -f conftest.$ac_objext
17073 if { (eval echo "$as_me:17073: \"$ac_compile\"") >&5
17074   (eval $ac_compile) 2>&5
17075   ac_status=$?
17076   echo "$as_me:17076: \$? = $ac_status" >&5
17077   (exit $ac_status); } &&
17078          { ac_try='test -s conftest.$ac_objext'
17079   { (eval echo "$as_me:17079: \"$ac_try\"") >&5
17080   (eval $ac_try) 2>&5
17081   ac_status=$?
17082   echo "$as_me:17082: \$? = $ac_status" >&5
17083   (exit $ac_status); }; }; then
17084   cf_result=yes
17085
17086 else
17087   echo "$as_me: failed program was:" >&5
17088 cat conftest.$ac_ext >&5
17089 cf_result=no
17090 fi
17091 rm -f conftest.$ac_objext conftest.$ac_ext
17092 echo "$as_me:17092: result: $cf_result" >&5
17093 echo "${ECHO_T}$cf_result" >&6
17094
17095 if test $cf_result = yes ; then
17096
17097 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17098
17099         cat >>confdefs.h <<EOF
17100 #define $cf_result 1
17101 EOF
17102
17103 else
17104         echo "$as_me:17104: checking for data $cf_data in library" >&5
17105 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17106         # BSD linkers insist on making weak linkage, but resolve at runtime.
17107         if test "$cross_compiling" = yes; then
17108
17109         # cross-compiling
17110         cat >conftest.$ac_ext <<_ACEOF
17111 #line 17111 "configure"
17112 #include "confdefs.h"
17113
17114 #ifdef HAVE_XCURSES
17115 #include <xcurses.h>
17116 char * XCursesProgramName = "test";
17117 #else
17118 #include <${cf_cv_ncurses_header:-curses.h}>
17119 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17120 #include <ncursesw/term.h>
17121 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17122 #include <ncurses/term.h>
17123 #elif defined(HAVE_TERM_H)
17124 #include <term.h>
17125 #endif
17126 #endif
17127
17128 extern char $cf_data;
17129 int
17130 main (void)
17131 {
17132
17133         do {
17134                 void *foo = &($cf_data);
17135                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17136                 ${cf_cv_main_return:-return}(foo == 0);
17137         } while (0)
17138
17139   ;
17140   return 0;
17141 }
17142 _ACEOF
17143 rm -f conftest.$ac_objext conftest$ac_exeext
17144 if { (eval echo "$as_me:17144: \"$ac_link\"") >&5
17145   (eval $ac_link) 2>&5
17146   ac_status=$?
17147   echo "$as_me:17147: \$? = $ac_status" >&5
17148   (exit $ac_status); } &&
17149          { ac_try='test -s conftest$ac_exeext'
17150   { (eval echo "$as_me:17150: \"$ac_try\"") >&5
17151   (eval $ac_try) 2>&5
17152   ac_status=$?
17153   echo "$as_me:17153: \$? = $ac_status" >&5
17154   (exit $ac_status); }; }; then
17155   cf_result=yes
17156 else
17157   echo "$as_me: failed program was:" >&5
17158 cat conftest.$ac_ext >&5
17159 cf_result=no
17160 fi
17161 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17162
17163 else
17164   cat >conftest.$ac_ext <<_ACEOF
17165 #line 17165 "configure"
17166 #include "confdefs.h"
17167
17168 #ifdef HAVE_XCURSES
17169 #include <xcurses.h>
17170 char * XCursesProgramName = "test";
17171 #else
17172 #include <${cf_cv_ncurses_header:-curses.h}>
17173 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17174 #include <ncursesw/term.h>
17175 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17176 #include <ncurses/term.h>
17177 #elif defined(HAVE_TERM_H)
17178 #include <term.h>
17179 #endif
17180 #endif
17181
17182 extern char $cf_data;
17183 int main(void)
17184 {
17185         void *foo = &($cf_data);
17186         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17187         ${cf_cv_main_return:-return}(foo == 0);
17188 }
17189 _ACEOF
17190 rm -f conftest$ac_exeext
17191 if { (eval echo "$as_me:17191: \"$ac_link\"") >&5
17192   (eval $ac_link) 2>&5
17193   ac_status=$?
17194   echo "$as_me:17194: \$? = $ac_status" >&5
17195   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17196   { (eval echo "$as_me:17196: \"$ac_try\"") >&5
17197   (eval $ac_try) 2>&5
17198   ac_status=$?
17199   echo "$as_me:17199: \$? = $ac_status" >&5
17200   (exit $ac_status); }; }; then
17201   cf_result=yes
17202
17203 else
17204   echo "$as_me: program exited with status $ac_status" >&5
17205 echo "$as_me: failed program was:" >&5
17206 cat conftest.$ac_ext >&5
17207 cf_result=no
17208 fi
17209 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17210 fi
17211         echo "$as_me:17211: result: $cf_result" >&5
17212 echo "${ECHO_T}$cf_result" >&6
17213         if test $cf_result = yes ; then
17214
17215 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17216
17217                 cat >>confdefs.h <<EOF
17218 #define $cf_result 1
17219 EOF
17220
17221                 # do not exit loop here, since we prefer system's declarations
17222         fi
17223 fi
17224 done
17225
17226 for cf_data in boolnames
17227 do
17228 echo "$as_me:17228: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17229 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17230
17231 cat >conftest.$ac_ext <<_ACEOF
17232 #line 17232 "configure"
17233 #include "confdefs.h"
17234
17235 #ifdef HAVE_XCURSES
17236 #include <xcurses.h>
17237 char * XCursesProgramName = "test";
17238 #else
17239 #include <${cf_cv_ncurses_header:-curses.h}>
17240 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17241 #include <ncursesw/term.h>
17242 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17243 #include <ncurses/term.h>
17244 #elif defined(HAVE_TERM_H)
17245 #include <term.h>
17246 #endif
17247 #endif
17248
17249 int
17250 main (void)
17251 {
17252
17253 void *foo = &($cf_data)
17254
17255   ;
17256   return 0;
17257 }
17258 _ACEOF
17259 rm -f conftest.$ac_objext
17260 if { (eval echo "$as_me:17260: \"$ac_compile\"") >&5
17261   (eval $ac_compile) 2>&5
17262   ac_status=$?
17263   echo "$as_me:17263: \$? = $ac_status" >&5
17264   (exit $ac_status); } &&
17265          { ac_try='test -s conftest.$ac_objext'
17266   { (eval echo "$as_me:17266: \"$ac_try\"") >&5
17267   (eval $ac_try) 2>&5
17268   ac_status=$?
17269   echo "$as_me:17269: \$? = $ac_status" >&5
17270   (exit $ac_status); }; }; then
17271   cf_result=yes
17272
17273 else
17274   echo "$as_me: failed program was:" >&5
17275 cat conftest.$ac_ext >&5
17276 cf_result=no
17277 fi
17278 rm -f conftest.$ac_objext conftest.$ac_ext
17279 echo "$as_me:17279: result: $cf_result" >&5
17280 echo "${ECHO_T}$cf_result" >&6
17281
17282 if test $cf_result = yes ; then
17283
17284 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17285
17286         cat >>confdefs.h <<EOF
17287 #define $cf_result 1
17288 EOF
17289
17290 else
17291         echo "$as_me:17291: checking for data $cf_data in library" >&5
17292 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17293         # BSD linkers insist on making weak linkage, but resolve at runtime.
17294         if test "$cross_compiling" = yes; then
17295
17296         # cross-compiling
17297         cat >conftest.$ac_ext <<_ACEOF
17298 #line 17298 "configure"
17299 #include "confdefs.h"
17300
17301 #ifdef HAVE_XCURSES
17302 #include <xcurses.h>
17303 char * XCursesProgramName = "test";
17304 #else
17305 #include <${cf_cv_ncurses_header:-curses.h}>
17306 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17307 #include <ncursesw/term.h>
17308 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17309 #include <ncurses/term.h>
17310 #elif defined(HAVE_TERM_H)
17311 #include <term.h>
17312 #endif
17313 #endif
17314
17315 extern char $cf_data;
17316 int
17317 main (void)
17318 {
17319
17320         do {
17321                 void *foo = &($cf_data);
17322                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17323                 ${cf_cv_main_return:-return}(foo == 0);
17324         } while (0)
17325
17326   ;
17327   return 0;
17328 }
17329 _ACEOF
17330 rm -f conftest.$ac_objext conftest$ac_exeext
17331 if { (eval echo "$as_me:17331: \"$ac_link\"") >&5
17332   (eval $ac_link) 2>&5
17333   ac_status=$?
17334   echo "$as_me:17334: \$? = $ac_status" >&5
17335   (exit $ac_status); } &&
17336          { ac_try='test -s conftest$ac_exeext'
17337   { (eval echo "$as_me:17337: \"$ac_try\"") >&5
17338   (eval $ac_try) 2>&5
17339   ac_status=$?
17340   echo "$as_me:17340: \$? = $ac_status" >&5
17341   (exit $ac_status); }; }; then
17342   cf_result=yes
17343 else
17344   echo "$as_me: failed program was:" >&5
17345 cat conftest.$ac_ext >&5
17346 cf_result=no
17347 fi
17348 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17349
17350 else
17351   cat >conftest.$ac_ext <<_ACEOF
17352 #line 17352 "configure"
17353 #include "confdefs.h"
17354
17355 #ifdef HAVE_XCURSES
17356 #include <xcurses.h>
17357 char * XCursesProgramName = "test";
17358 #else
17359 #include <${cf_cv_ncurses_header:-curses.h}>
17360 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17361 #include <ncursesw/term.h>
17362 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17363 #include <ncurses/term.h>
17364 #elif defined(HAVE_TERM_H)
17365 #include <term.h>
17366 #endif
17367 #endif
17368
17369 extern char $cf_data;
17370 int main(void)
17371 {
17372         void *foo = &($cf_data);
17373         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17374         ${cf_cv_main_return:-return}(foo == 0);
17375 }
17376 _ACEOF
17377 rm -f conftest$ac_exeext
17378 if { (eval echo "$as_me:17378: \"$ac_link\"") >&5
17379   (eval $ac_link) 2>&5
17380   ac_status=$?
17381   echo "$as_me:17381: \$? = $ac_status" >&5
17382   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17383   { (eval echo "$as_me:17383: \"$ac_try\"") >&5
17384   (eval $ac_try) 2>&5
17385   ac_status=$?
17386   echo "$as_me:17386: \$? = $ac_status" >&5
17387   (exit $ac_status); }; }; then
17388   cf_result=yes
17389
17390 else
17391   echo "$as_me: program exited with status $ac_status" >&5
17392 echo "$as_me: failed program was:" >&5
17393 cat conftest.$ac_ext >&5
17394 cf_result=no
17395 fi
17396 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17397 fi
17398         echo "$as_me:17398: result: $cf_result" >&5
17399 echo "${ECHO_T}$cf_result" >&6
17400         if test $cf_result = yes ; then
17401
17402 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17403
17404                 cat >>confdefs.h <<EOF
17405 #define $cf_result 1
17406 EOF
17407
17408                 # do not exit loop here, since we prefer system's declarations
17409         fi
17410 fi
17411 done
17412
17413 for cf_data in boolfnames
17414 do
17415 echo "$as_me:17415: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17416 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17417
17418 cat >conftest.$ac_ext <<_ACEOF
17419 #line 17419 "configure"
17420 #include "confdefs.h"
17421
17422 #ifdef HAVE_XCURSES
17423 #include <xcurses.h>
17424 char * XCursesProgramName = "test";
17425 #else
17426 #include <${cf_cv_ncurses_header:-curses.h}>
17427 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17428 #include <ncursesw/term.h>
17429 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17430 #include <ncurses/term.h>
17431 #elif defined(HAVE_TERM_H)
17432 #include <term.h>
17433 #endif
17434 #endif
17435
17436 int
17437 main (void)
17438 {
17439
17440 void *foo = &($cf_data)
17441
17442   ;
17443   return 0;
17444 }
17445 _ACEOF
17446 rm -f conftest.$ac_objext
17447 if { (eval echo "$as_me:17447: \"$ac_compile\"") >&5
17448   (eval $ac_compile) 2>&5
17449   ac_status=$?
17450   echo "$as_me:17450: \$? = $ac_status" >&5
17451   (exit $ac_status); } &&
17452          { ac_try='test -s conftest.$ac_objext'
17453   { (eval echo "$as_me:17453: \"$ac_try\"") >&5
17454   (eval $ac_try) 2>&5
17455   ac_status=$?
17456   echo "$as_me:17456: \$? = $ac_status" >&5
17457   (exit $ac_status); }; }; then
17458   cf_result=yes
17459
17460 else
17461   echo "$as_me: failed program was:" >&5
17462 cat conftest.$ac_ext >&5
17463 cf_result=no
17464 fi
17465 rm -f conftest.$ac_objext conftest.$ac_ext
17466 echo "$as_me:17466: result: $cf_result" >&5
17467 echo "${ECHO_T}$cf_result" >&6
17468
17469 if test $cf_result = yes ; then
17470
17471 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17472
17473         cat >>confdefs.h <<EOF
17474 #define $cf_result 1
17475 EOF
17476
17477 else
17478         echo "$as_me:17478: checking for data $cf_data in library" >&5
17479 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17480         # BSD linkers insist on making weak linkage, but resolve at runtime.
17481         if test "$cross_compiling" = yes; then
17482
17483         # cross-compiling
17484         cat >conftest.$ac_ext <<_ACEOF
17485 #line 17485 "configure"
17486 #include "confdefs.h"
17487
17488 #ifdef HAVE_XCURSES
17489 #include <xcurses.h>
17490 char * XCursesProgramName = "test";
17491 #else
17492 #include <${cf_cv_ncurses_header:-curses.h}>
17493 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17494 #include <ncursesw/term.h>
17495 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17496 #include <ncurses/term.h>
17497 #elif defined(HAVE_TERM_H)
17498 #include <term.h>
17499 #endif
17500 #endif
17501
17502 extern char $cf_data;
17503 int
17504 main (void)
17505 {
17506
17507         do {
17508                 void *foo = &($cf_data);
17509                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17510                 ${cf_cv_main_return:-return}(foo == 0);
17511         } while (0)
17512
17513   ;
17514   return 0;
17515 }
17516 _ACEOF
17517 rm -f conftest.$ac_objext conftest$ac_exeext
17518 if { (eval echo "$as_me:17518: \"$ac_link\"") >&5
17519   (eval $ac_link) 2>&5
17520   ac_status=$?
17521   echo "$as_me:17521: \$? = $ac_status" >&5
17522   (exit $ac_status); } &&
17523          { ac_try='test -s conftest$ac_exeext'
17524   { (eval echo "$as_me:17524: \"$ac_try\"") >&5
17525   (eval $ac_try) 2>&5
17526   ac_status=$?
17527   echo "$as_me:17527: \$? = $ac_status" >&5
17528   (exit $ac_status); }; }; then
17529   cf_result=yes
17530 else
17531   echo "$as_me: failed program was:" >&5
17532 cat conftest.$ac_ext >&5
17533 cf_result=no
17534 fi
17535 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17536
17537 else
17538   cat >conftest.$ac_ext <<_ACEOF
17539 #line 17539 "configure"
17540 #include "confdefs.h"
17541
17542 #ifdef HAVE_XCURSES
17543 #include <xcurses.h>
17544 char * XCursesProgramName = "test";
17545 #else
17546 #include <${cf_cv_ncurses_header:-curses.h}>
17547 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17548 #include <ncursesw/term.h>
17549 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17550 #include <ncurses/term.h>
17551 #elif defined(HAVE_TERM_H)
17552 #include <term.h>
17553 #endif
17554 #endif
17555
17556 extern char $cf_data;
17557 int main(void)
17558 {
17559         void *foo = &($cf_data);
17560         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17561         ${cf_cv_main_return:-return}(foo == 0);
17562 }
17563 _ACEOF
17564 rm -f conftest$ac_exeext
17565 if { (eval echo "$as_me:17565: \"$ac_link\"") >&5
17566   (eval $ac_link) 2>&5
17567   ac_status=$?
17568   echo "$as_me:17568: \$? = $ac_status" >&5
17569   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17570   { (eval echo "$as_me:17570: \"$ac_try\"") >&5
17571   (eval $ac_try) 2>&5
17572   ac_status=$?
17573   echo "$as_me:17573: \$? = $ac_status" >&5
17574   (exit $ac_status); }; }; then
17575   cf_result=yes
17576
17577 else
17578   echo "$as_me: program exited with status $ac_status" >&5
17579 echo "$as_me: failed program was:" >&5
17580 cat conftest.$ac_ext >&5
17581 cf_result=no
17582 fi
17583 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17584 fi
17585         echo "$as_me:17585: result: $cf_result" >&5
17586 echo "${ECHO_T}$cf_result" >&6
17587         if test $cf_result = yes ; then
17588
17589 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17590
17591                 cat >>confdefs.h <<EOF
17592 #define $cf_result 1
17593 EOF
17594
17595                 # do not exit loop here, since we prefer system's declarations
17596         fi
17597 fi
17598 done
17599
17600 for cf_data in ttytype
17601 do
17602 echo "$as_me:17602: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17603 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17604
17605 cat >conftest.$ac_ext <<_ACEOF
17606 #line 17606 "configure"
17607 #include "confdefs.h"
17608
17609 #ifdef HAVE_XCURSES
17610 #include <xcurses.h>
17611 char * XCursesProgramName = "test";
17612 #else
17613 #include <${cf_cv_ncurses_header:-curses.h}>
17614 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17615 #include <ncursesw/term.h>
17616 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17617 #include <ncurses/term.h>
17618 #elif defined(HAVE_TERM_H)
17619 #include <term.h>
17620 #endif
17621 #endif
17622
17623 int
17624 main (void)
17625 {
17626
17627 void *foo = &($cf_data)
17628
17629   ;
17630   return 0;
17631 }
17632 _ACEOF
17633 rm -f conftest.$ac_objext
17634 if { (eval echo "$as_me:17634: \"$ac_compile\"") >&5
17635   (eval $ac_compile) 2>&5
17636   ac_status=$?
17637   echo "$as_me:17637: \$? = $ac_status" >&5
17638   (exit $ac_status); } &&
17639          { ac_try='test -s conftest.$ac_objext'
17640   { (eval echo "$as_me:17640: \"$ac_try\"") >&5
17641   (eval $ac_try) 2>&5
17642   ac_status=$?
17643   echo "$as_me:17643: \$? = $ac_status" >&5
17644   (exit $ac_status); }; }; then
17645   cf_result=yes
17646
17647 else
17648   echo "$as_me: failed program was:" >&5
17649 cat conftest.$ac_ext >&5
17650 cf_result=no
17651 fi
17652 rm -f conftest.$ac_objext conftest.$ac_ext
17653 echo "$as_me:17653: result: $cf_result" >&5
17654 echo "${ECHO_T}$cf_result" >&6
17655
17656 if test $cf_result = yes ; then
17657
17658 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17659
17660         cat >>confdefs.h <<EOF
17661 #define $cf_result 1
17662 EOF
17663
17664 else
17665         echo "$as_me:17665: checking for data $cf_data in library" >&5
17666 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17667         # BSD linkers insist on making weak linkage, but resolve at runtime.
17668         if test "$cross_compiling" = yes; then
17669
17670         # cross-compiling
17671         cat >conftest.$ac_ext <<_ACEOF
17672 #line 17672 "configure"
17673 #include "confdefs.h"
17674
17675 #ifdef HAVE_XCURSES
17676 #include <xcurses.h>
17677 char * XCursesProgramName = "test";
17678 #else
17679 #include <${cf_cv_ncurses_header:-curses.h}>
17680 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17681 #include <ncursesw/term.h>
17682 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17683 #include <ncurses/term.h>
17684 #elif defined(HAVE_TERM_H)
17685 #include <term.h>
17686 #endif
17687 #endif
17688
17689 extern char $cf_data;
17690 int
17691 main (void)
17692 {
17693
17694         do {
17695                 void *foo = &($cf_data);
17696                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17697                 ${cf_cv_main_return:-return}(foo == 0);
17698         } while (0)
17699
17700   ;
17701   return 0;
17702 }
17703 _ACEOF
17704 rm -f conftest.$ac_objext conftest$ac_exeext
17705 if { (eval echo "$as_me:17705: \"$ac_link\"") >&5
17706   (eval $ac_link) 2>&5
17707   ac_status=$?
17708   echo "$as_me:17708: \$? = $ac_status" >&5
17709   (exit $ac_status); } &&
17710          { ac_try='test -s conftest$ac_exeext'
17711   { (eval echo "$as_me:17711: \"$ac_try\"") >&5
17712   (eval $ac_try) 2>&5
17713   ac_status=$?
17714   echo "$as_me:17714: \$? = $ac_status" >&5
17715   (exit $ac_status); }; }; then
17716   cf_result=yes
17717 else
17718   echo "$as_me: failed program was:" >&5
17719 cat conftest.$ac_ext >&5
17720 cf_result=no
17721 fi
17722 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17723
17724 else
17725   cat >conftest.$ac_ext <<_ACEOF
17726 #line 17726 "configure"
17727 #include "confdefs.h"
17728
17729 #ifdef HAVE_XCURSES
17730 #include <xcurses.h>
17731 char * XCursesProgramName = "test";
17732 #else
17733 #include <${cf_cv_ncurses_header:-curses.h}>
17734 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17735 #include <ncursesw/term.h>
17736 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17737 #include <ncurses/term.h>
17738 #elif defined(HAVE_TERM_H)
17739 #include <term.h>
17740 #endif
17741 #endif
17742
17743 extern char $cf_data;
17744 int main(void)
17745 {
17746         void *foo = &($cf_data);
17747         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17748         ${cf_cv_main_return:-return}(foo == 0);
17749 }
17750 _ACEOF
17751 rm -f conftest$ac_exeext
17752 if { (eval echo "$as_me:17752: \"$ac_link\"") >&5
17753   (eval $ac_link) 2>&5
17754   ac_status=$?
17755   echo "$as_me:17755: \$? = $ac_status" >&5
17756   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17757   { (eval echo "$as_me:17757: \"$ac_try\"") >&5
17758   (eval $ac_try) 2>&5
17759   ac_status=$?
17760   echo "$as_me:17760: \$? = $ac_status" >&5
17761   (exit $ac_status); }; }; then
17762   cf_result=yes
17763
17764 else
17765   echo "$as_me: program exited with status $ac_status" >&5
17766 echo "$as_me: failed program was:" >&5
17767 cat conftest.$ac_ext >&5
17768 cf_result=no
17769 fi
17770 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17771 fi
17772         echo "$as_me:17772: result: $cf_result" >&5
17773 echo "${ECHO_T}$cf_result" >&6
17774         if test $cf_result = yes ; then
17775
17776 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17777
17778                 cat >>confdefs.h <<EOF
17779 #define $cf_result 1
17780 EOF
17781
17782                 # do not exit loop here, since we prefer system's declarations
17783         fi
17784 fi
17785 done
17786
17787 if ( test "$GCC" = yes || test "$GXX" = yes )
17788 then
17789 echo "$as_me:17789: checking if you want to turn on gcc warnings" >&5
17790 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
17791
17792 # Check whether --enable-warnings or --disable-warnings was given.
17793 if test "${enable_warnings+set}" = set; then
17794   enableval="$enable_warnings"
17795   test "$enableval" != yes && enableval=no
17796         if test "$enableval" != "no" ; then
17797     with_warnings=yes
17798         else
17799                 with_warnings=no
17800         fi
17801 else
17802   enableval=no
17803         with_warnings=no
17804
17805 fi;
17806 echo "$as_me:17806: result: $with_warnings" >&5
17807 echo "${ECHO_T}$with_warnings" >&6
17808 if test "$with_warnings" = "yes"
17809 then
17810
17811 if test "$GCC" = yes
17812 then
17813 cat > conftest.i <<EOF
17814 #ifndef GCC_PRINTF
17815 #define GCC_PRINTF 0
17816 #endif
17817 #ifndef GCC_SCANF
17818 #define GCC_SCANF 0
17819 #endif
17820 #ifndef GCC_NORETURN
17821 #define GCC_NORETURN /* nothing */
17822 #endif
17823 #ifndef GCC_UNUSED
17824 #define GCC_UNUSED /* nothing */
17825 #endif
17826 EOF
17827 if test "$GCC" = yes
17828 then
17829         { echo "$as_me:17829: checking for $CC __attribute__ directives..." >&5
17830 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
17831 cat > conftest.$ac_ext <<EOF
17832 #line 17832 "${as_me:-configure}"
17833 #include "confdefs.h"
17834 #include "conftest.h"
17835 #include "conftest.i"
17836 #if     GCC_PRINTF
17837 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
17838 #else
17839 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
17840 #endif
17841 #if     GCC_SCANF
17842 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
17843 #else
17844 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
17845 #endif
17846 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
17847 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
17848 extern void foo(void) GCC_NORETURN;
17849 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
17850 EOF
17851         cf_printf_attribute=no
17852         cf_scanf_attribute=no
17853         for cf_attribute in scanf printf unused noreturn
17854         do
17855
17856 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17857
17858                 cf_directive="__attribute__(($cf_attribute))"
17859                 echo "checking for $CC $cf_directive" 1>&5
17860
17861                 case $cf_attribute in
17862                 (printf)
17863                         cf_printf_attribute=yes
17864                         cat >conftest.h <<EOF
17865 #define GCC_$cf_ATTRIBUTE 1
17866 EOF
17867                         ;;
17868                 (scanf)
17869                         cf_scanf_attribute=yes
17870                         cat >conftest.h <<EOF
17871 #define GCC_$cf_ATTRIBUTE 1
17872 EOF
17873                         ;;
17874                 (*)
17875                         cat >conftest.h <<EOF
17876 #define GCC_$cf_ATTRIBUTE $cf_directive
17877 EOF
17878                         ;;
17879                 esac
17880
17881                 if { (eval echo "$as_me:17881: \"$ac_compile\"") >&5
17882   (eval $ac_compile) 2>&5
17883   ac_status=$?
17884   echo "$as_me:17884: \$? = $ac_status" >&5
17885   (exit $ac_status); }; then
17886                         test -n "$verbose" && echo "$as_me:17886: result: ... $cf_attribute" >&5
17887 echo "${ECHO_T}... $cf_attribute" >&6
17888                         cat conftest.h >>confdefs.h
17889                         case $cf_attribute in
17890                         (noreturn)
17891
17892 cat >>confdefs.h <<EOF
17893 #define GCC_NORETURN $cf_directive
17894 EOF
17895
17896                                 ;;
17897                         (printf)
17898                                 cf_value='/* nothing */'
17899                                 if test "$cf_printf_attribute" != no ; then
17900                                         cf_value='__attribute__((format(printf,fmt,var)))'
17901
17902 cat >>confdefs.h <<\EOF
17903 #define GCC_PRINTF 1
17904 EOF
17905
17906                                 fi
17907
17908 cat >>confdefs.h <<EOF
17909 #define GCC_PRINTFLIKE(fmt,var) $cf_value
17910 EOF
17911
17912                                 ;;
17913                         (scanf)
17914                                 cf_value='/* nothing */'
17915                                 if test "$cf_scanf_attribute" != no ; then
17916                                         cf_value='__attribute__((format(scanf,fmt,var)))'
17917
17918 cat >>confdefs.h <<\EOF
17919 #define GCC_SCANF 1
17920 EOF
17921
17922                                 fi
17923
17924 cat >>confdefs.h <<EOF
17925 #define GCC_SCANFLIKE(fmt,var) $cf_value
17926 EOF
17927
17928                                 ;;
17929                         (unused)
17930
17931 cat >>confdefs.h <<EOF
17932 #define GCC_UNUSED $cf_directive
17933 EOF
17934
17935                                 ;;
17936                         esac
17937                 fi
17938         done
17939 else
17940         fgrep define conftest.i >>confdefs.h
17941 fi
17942 rm -rf conftest*
17943 fi
17944
17945 INTEL_COMPILER=no
17946
17947 if test "$GCC" = yes ; then
17948         case $host_os in
17949         (linux*|gnu*)
17950                 echo "$as_me:17950: checking if this is really Intel C compiler" >&5
17951 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17952                 cf_save_CFLAGS="$CFLAGS"
17953                 CFLAGS="$CFLAGS -no-gcc"
17954                 cat >conftest.$ac_ext <<_ACEOF
17955 #line 17955 "configure"
17956 #include "confdefs.h"
17957
17958 int
17959 main (void)
17960 {
17961
17962 #ifdef __INTEL_COMPILER
17963 #else
17964 make an error
17965 #endif
17966
17967   ;
17968   return 0;
17969 }
17970 _ACEOF
17971 rm -f conftest.$ac_objext
17972 if { (eval echo "$as_me:17972: \"$ac_compile\"") >&5
17973   (eval $ac_compile) 2>&5
17974   ac_status=$?
17975   echo "$as_me:17975: \$? = $ac_status" >&5
17976   (exit $ac_status); } &&
17977          { ac_try='test -s conftest.$ac_objext'
17978   { (eval echo "$as_me:17978: \"$ac_try\"") >&5
17979   (eval $ac_try) 2>&5
17980   ac_status=$?
17981   echo "$as_me:17981: \$? = $ac_status" >&5
17982   (exit $ac_status); }; }; then
17983   INTEL_COMPILER=yes
17984 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17985
17986 else
17987   echo "$as_me: failed program was:" >&5
17988 cat conftest.$ac_ext >&5
17989 fi
17990 rm -f conftest.$ac_objext conftest.$ac_ext
17991                 CFLAGS="$cf_save_CFLAGS"
17992                 echo "$as_me:17992: result: $INTEL_COMPILER" >&5
17993 echo "${ECHO_T}$INTEL_COMPILER" >&6
17994                 ;;
17995         esac
17996 fi
17997
17998 CLANG_COMPILER=no
17999
18000 if test "$GCC" = yes ; then
18001         echo "$as_me:18001: checking if this is really Clang C compiler" >&5
18002 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
18003         cf_save_CFLAGS="$CFLAGS"
18004         CFLAGS="$CFLAGS -Qunused-arguments"
18005         cat >conftest.$ac_ext <<_ACEOF
18006 #line 18006 "configure"
18007 #include "confdefs.h"
18008
18009 int
18010 main (void)
18011 {
18012
18013 #ifdef __clang__
18014 #else
18015 make an error
18016 #endif
18017
18018   ;
18019   return 0;
18020 }
18021 _ACEOF
18022 rm -f conftest.$ac_objext
18023 if { (eval echo "$as_me:18023: \"$ac_compile\"") >&5
18024   (eval $ac_compile) 2>&5
18025   ac_status=$?
18026   echo "$as_me:18026: \$? = $ac_status" >&5
18027   (exit $ac_status); } &&
18028          { ac_try='test -s conftest.$ac_objext'
18029   { (eval echo "$as_me:18029: \"$ac_try\"") >&5
18030   (eval $ac_try) 2>&5
18031   ac_status=$?
18032   echo "$as_me:18032: \$? = $ac_status" >&5
18033   (exit $ac_status); }; }; then
18034   CLANG_COMPILER=yes
18035 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
18036
18037 else
18038   echo "$as_me: failed program was:" >&5
18039 cat conftest.$ac_ext >&5
18040 fi
18041 rm -f conftest.$ac_objext conftest.$ac_ext
18042         CFLAGS="$cf_save_CFLAGS"
18043         echo "$as_me:18043: result: $CLANG_COMPILER" >&5
18044 echo "${ECHO_T}$CLANG_COMPILER" >&6
18045 fi
18046
18047 cat > conftest.$ac_ext <<EOF
18048 #line 18048 "${as_me:-configure}"
18049 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
18050 EOF
18051
18052 if test "$INTEL_COMPILER" = yes
18053 then
18054 # The "-wdXXX" options suppress warnings:
18055 # remark #1419: external declaration in primary source file
18056 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
18057 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
18058 # remark #193: zero used for undefined preprocessing identifier
18059 # remark #593: variable "curs_sb_left_arrow" was set but never used
18060 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
18061 # remark #869: parameter "tw" was never referenced
18062 # remark #981: operands are evaluated in unspecified order
18063 # warning #279: controlling expression is constant
18064
18065         { echo "$as_me:18065: checking for $CC warning options..." >&5
18066 echo "$as_me: checking for $CC warning options..." >&6;}
18067         cf_save_CFLAGS="$CFLAGS"
18068         EXTRA_CFLAGS="-Wall"
18069         for cf_opt in \
18070                 wd1419 \
18071                 wd1683 \
18072                 wd1684 \
18073                 wd193 \
18074                 wd593 \
18075                 wd279 \
18076                 wd810 \
18077                 wd869 \
18078                 wd981
18079         do
18080                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
18081                 if { (eval echo "$as_me:18081: \"$ac_compile\"") >&5
18082   (eval $ac_compile) 2>&5
18083   ac_status=$?
18084   echo "$as_me:18084: \$? = $ac_status" >&5
18085   (exit $ac_status); }; then
18086                         test -n "$verbose" && echo "$as_me:18086: result: ... -$cf_opt" >&5
18087 echo "${ECHO_T}... -$cf_opt" >&6
18088                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
18089                 fi
18090         done
18091         CFLAGS="$cf_save_CFLAGS"
18092
18093 elif test "$GCC" = yes
18094 then
18095         { echo "$as_me:18095: checking for $CC warning options..." >&5
18096 echo "$as_me: checking for $CC warning options..." >&6;}
18097         cf_save_CFLAGS="$CFLAGS"
18098         EXTRA_CFLAGS=
18099         cf_warn_CONST=""
18100         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
18101         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
18102         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
18103         for cf_opt in W Wall \
18104                 Wbad-function-cast \
18105                 Wcast-align \
18106                 Wcast-qual \
18107                 Wdeclaration-after-statement \
18108                 Wextra \
18109                 Winline \
18110                 Wmissing-declarations \
18111                 Wmissing-prototypes \
18112                 Wnested-externs \
18113                 Wpointer-arith \
18114                 Wshadow \
18115                 Wstrict-prototypes \
18116                 Wundef $cf_gcc_warnings $cf_warn_CONST
18117         do
18118                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
18119                 if { (eval echo "$as_me:18119: \"$ac_compile\"") >&5
18120   (eval $ac_compile) 2>&5
18121   ac_status=$?
18122   echo "$as_me:18122: \$? = $ac_status" >&5
18123   (exit $ac_status); }; then
18124                         test -n "$verbose" && echo "$as_me:18124: result: ... -$cf_opt" >&5
18125 echo "${ECHO_T}... -$cf_opt" >&6
18126                         case $cf_opt in
18127                         (Wcast-qual)
18128                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
18129                                 ;;
18130                         (Winline)
18131                                 case $GCC_VERSION in
18132                                 ([34].*)
18133                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
18134
18135 echo "${as_me:-configure}:18135: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
18136
18137                                         continue;;
18138                                 esac
18139                                 ;;
18140                         (Wpointer-arith)
18141                                 case $GCC_VERSION in
18142                                 ([12].*)
18143                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
18144
18145 echo "${as_me:-configure}:18145: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
18146
18147                                         continue;;
18148                                 esac
18149                                 ;;
18150                         esac
18151                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
18152                 fi
18153         done
18154         CFLAGS="$cf_save_CFLAGS"
18155 fi
18156 rm -rf conftest*
18157
18158 fi
18159 fi
18160
18161 echo "$as_me:18161: checking if you want to use dmalloc for testing" >&5
18162 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
18163
18164 # Check whether --with-dmalloc or --without-dmalloc was given.
18165 if test "${with_dmalloc+set}" = set; then
18166   withval="$with_dmalloc"
18167
18168 cat >>confdefs.h <<EOF
18169 #define USE_DMALLOC 1
18170 EOF
18171
18172         : ${with_cflags:=-g}
18173         : ${with_no_leaks:=yes}
18174          with_dmalloc=yes
18175 else
18176   with_dmalloc=
18177 fi;
18178 echo "$as_me:18178: result: ${with_dmalloc:-no}" >&5
18179 echo "${ECHO_T}${with_dmalloc:-no}" >&6
18180
18181 case .$with_cflags in
18182 (.*-g*)
18183         case .$CFLAGS in
18184         (.*-g*)
18185                 ;;
18186         (*)
18187
18188 cf_fix_cppflags=no
18189 cf_new_cflags=
18190 cf_new_cppflags=
18191 cf_new_extra_cppflags=
18192
18193 for cf_add_cflags in -g
18194 do
18195 case $cf_fix_cppflags in
18196 (no)
18197         case $cf_add_cflags in
18198         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18199                 case $cf_add_cflags in
18200                 (-D*)
18201                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18202
18203                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18204                                 && test -z "${cf_tst_cflags}" \
18205                                 && cf_fix_cppflags=yes
18206
18207                         if test $cf_fix_cppflags = yes ; then
18208
18209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18211
18212                                 continue
18213                         elif test "${cf_tst_cflags}" = "\"'" ; then
18214
18215         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18216         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18217
18218                                 continue
18219                         fi
18220                         ;;
18221                 esac
18222                 case "$CPPFLAGS" in
18223                 (*$cf_add_cflags)
18224                         ;;
18225                 (*)
18226                         case $cf_add_cflags in
18227                         (-D*)
18228                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18229
18230 CPPFLAGS=`echo "$CPPFLAGS" | \
18231         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18232                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18233
18234                                 ;;
18235                         esac
18236
18237         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18238         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18239
18240                         ;;
18241                 esac
18242                 ;;
18243         (*)
18244
18245         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18246         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18247
18248                 ;;
18249         esac
18250         ;;
18251 (yes)
18252
18253         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18254         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18255
18256         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18257
18258         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18259                 && test -z "${cf_tst_cflags}" \
18260                 && cf_fix_cppflags=no
18261         ;;
18262 esac
18263 done
18264
18265 if test -n "$cf_new_cflags" ; then
18266
18267         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18268         CFLAGS="${CFLAGS}$cf_new_cflags"
18269
18270 fi
18271
18272 if test -n "$cf_new_cppflags" ; then
18273
18274         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18275         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18276
18277 fi
18278
18279 if test -n "$cf_new_extra_cppflags" ; then
18280
18281         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18282         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18283
18284 fi
18285
18286                 ;;
18287         esac
18288         ;;
18289 esac
18290
18291 if test "$with_dmalloc" = yes ; then
18292         echo "$as_me:18292: checking for dmalloc.h" >&5
18293 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
18294 if test "${ac_cv_header_dmalloc_h+set}" = set; then
18295   echo $ECHO_N "(cached) $ECHO_C" >&6
18296 else
18297   cat >conftest.$ac_ext <<_ACEOF
18298 #line 18298 "configure"
18299 #include "confdefs.h"
18300 #include <dmalloc.h>
18301 _ACEOF
18302 if { (eval echo "$as_me:18302: \"$ac_cpp conftest.$ac_ext\"") >&5
18303   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18304   ac_status=$?
18305   egrep -v '^ *\+' conftest.er1 >conftest.err
18306   rm -f conftest.er1
18307   cat conftest.err >&5
18308   echo "$as_me:18308: \$? = $ac_status" >&5
18309   (exit $ac_status); } >/dev/null; then
18310   if test -s conftest.err; then
18311     ac_cpp_err=$ac_c_preproc_warn_flag
18312   else
18313     ac_cpp_err=
18314   fi
18315 else
18316   ac_cpp_err=yes
18317 fi
18318 if test -z "$ac_cpp_err"; then
18319   ac_cv_header_dmalloc_h=yes
18320 else
18321   echo "$as_me: failed program was:" >&5
18322   cat conftest.$ac_ext >&5
18323   ac_cv_header_dmalloc_h=no
18324 fi
18325 rm -f conftest.err conftest.$ac_ext
18326 fi
18327 echo "$as_me:18327: result: $ac_cv_header_dmalloc_h" >&5
18328 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
18329 if test $ac_cv_header_dmalloc_h = yes; then
18330
18331 echo "$as_me:18331: checking for dmalloc_debug in -ldmalloc" >&5
18332 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
18333 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
18334   echo $ECHO_N "(cached) $ECHO_C" >&6
18335 else
18336   ac_check_lib_save_LIBS=$LIBS
18337 LIBS="-ldmalloc  $LIBS"
18338 cat >conftest.$ac_ext <<_ACEOF
18339 #line 18339 "configure"
18340 #include "confdefs.h"
18341
18342 /* Override any gcc2 internal prototype to avoid an error.  */
18343 #ifdef __cplusplus
18344 extern "C"
18345 #endif
18346 /* We use char because int might match the return type of a gcc2
18347    builtin and then its argument prototype would still apply.  */
18348 char dmalloc_debug ();
18349 int
18350 main (void)
18351 {
18352 dmalloc_debug ();
18353   ;
18354   return 0;
18355 }
18356 _ACEOF
18357 rm -f conftest.$ac_objext conftest$ac_exeext
18358 if { (eval echo "$as_me:18358: \"$ac_link\"") >&5
18359   (eval $ac_link) 2>&5
18360   ac_status=$?
18361   echo "$as_me:18361: \$? = $ac_status" >&5
18362   (exit $ac_status); } &&
18363          { ac_try='test -s conftest$ac_exeext'
18364   { (eval echo "$as_me:18364: \"$ac_try\"") >&5
18365   (eval $ac_try) 2>&5
18366   ac_status=$?
18367   echo "$as_me:18367: \$? = $ac_status" >&5
18368   (exit $ac_status); }; }; then
18369   ac_cv_lib_dmalloc_dmalloc_debug=yes
18370 else
18371   echo "$as_me: failed program was:" >&5
18372 cat conftest.$ac_ext >&5
18373 ac_cv_lib_dmalloc_dmalloc_debug=no
18374 fi
18375 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18376 LIBS=$ac_check_lib_save_LIBS
18377 fi
18378 echo "$as_me:18378: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
18379 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
18380 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
18381   cat >>confdefs.h <<EOF
18382 #define HAVE_LIBDMALLOC 1
18383 EOF
18384
18385   LIBS="-ldmalloc $LIBS"
18386
18387 fi
18388
18389 fi
18390
18391 fi
18392
18393 echo "$as_me:18393: checking if you want to use dbmalloc for testing" >&5
18394 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
18395
18396 # Check whether --with-dbmalloc or --without-dbmalloc was given.
18397 if test "${with_dbmalloc+set}" = set; then
18398   withval="$with_dbmalloc"
18399
18400 cat >>confdefs.h <<EOF
18401 #define USE_DBMALLOC 1
18402 EOF
18403
18404         : ${with_cflags:=-g}
18405         : ${with_no_leaks:=yes}
18406          with_dbmalloc=yes
18407 else
18408   with_dbmalloc=
18409 fi;
18410 echo "$as_me:18410: result: ${with_dbmalloc:-no}" >&5
18411 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
18412
18413 case .$with_cflags in
18414 (.*-g*)
18415         case .$CFLAGS in
18416         (.*-g*)
18417                 ;;
18418         (*)
18419
18420 cf_fix_cppflags=no
18421 cf_new_cflags=
18422 cf_new_cppflags=
18423 cf_new_extra_cppflags=
18424
18425 for cf_add_cflags in -g
18426 do
18427 case $cf_fix_cppflags in
18428 (no)
18429         case $cf_add_cflags in
18430         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18431                 case $cf_add_cflags in
18432                 (-D*)
18433                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18434
18435                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18436                                 && test -z "${cf_tst_cflags}" \
18437                                 && cf_fix_cppflags=yes
18438
18439                         if test $cf_fix_cppflags = yes ; then
18440
18441         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18442         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18443
18444                                 continue
18445                         elif test "${cf_tst_cflags}" = "\"'" ; then
18446
18447         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18448         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18449
18450                                 continue
18451                         fi
18452                         ;;
18453                 esac
18454                 case "$CPPFLAGS" in
18455                 (*$cf_add_cflags)
18456                         ;;
18457                 (*)
18458                         case $cf_add_cflags in
18459                         (-D*)
18460                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18461
18462 CPPFLAGS=`echo "$CPPFLAGS" | \
18463         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18464                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18465
18466                                 ;;
18467                         esac
18468
18469         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18470         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18471
18472                         ;;
18473                 esac
18474                 ;;
18475         (*)
18476
18477         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18478         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18479
18480                 ;;
18481         esac
18482         ;;
18483 (yes)
18484
18485         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18486         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18487
18488         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18489
18490         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18491                 && test -z "${cf_tst_cflags}" \
18492                 && cf_fix_cppflags=no
18493         ;;
18494 esac
18495 done
18496
18497 if test -n "$cf_new_cflags" ; then
18498
18499         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18500         CFLAGS="${CFLAGS}$cf_new_cflags"
18501
18502 fi
18503
18504 if test -n "$cf_new_cppflags" ; then
18505
18506         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18507         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18508
18509 fi
18510
18511 if test -n "$cf_new_extra_cppflags" ; then
18512
18513         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18514         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18515
18516 fi
18517
18518                 ;;
18519         esac
18520         ;;
18521 esac
18522
18523 if test "$with_dbmalloc" = yes ; then
18524         echo "$as_me:18524: checking for dbmalloc.h" >&5
18525 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
18526 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
18527   echo $ECHO_N "(cached) $ECHO_C" >&6
18528 else
18529   cat >conftest.$ac_ext <<_ACEOF
18530 #line 18530 "configure"
18531 #include "confdefs.h"
18532 #include <dbmalloc.h>
18533 _ACEOF
18534 if { (eval echo "$as_me:18534: \"$ac_cpp conftest.$ac_ext\"") >&5
18535   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18536   ac_status=$?
18537   egrep -v '^ *\+' conftest.er1 >conftest.err
18538   rm -f conftest.er1
18539   cat conftest.err >&5
18540   echo "$as_me:18540: \$? = $ac_status" >&5
18541   (exit $ac_status); } >/dev/null; then
18542   if test -s conftest.err; then
18543     ac_cpp_err=$ac_c_preproc_warn_flag
18544   else
18545     ac_cpp_err=
18546   fi
18547 else
18548   ac_cpp_err=yes
18549 fi
18550 if test -z "$ac_cpp_err"; then
18551   ac_cv_header_dbmalloc_h=yes
18552 else
18553   echo "$as_me: failed program was:" >&5
18554   cat conftest.$ac_ext >&5
18555   ac_cv_header_dbmalloc_h=no
18556 fi
18557 rm -f conftest.err conftest.$ac_ext
18558 fi
18559 echo "$as_me:18559: result: $ac_cv_header_dbmalloc_h" >&5
18560 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
18561 if test $ac_cv_header_dbmalloc_h = yes; then
18562
18563 echo "$as_me:18563: checking for debug_malloc in -ldbmalloc" >&5
18564 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
18565 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
18566   echo $ECHO_N "(cached) $ECHO_C" >&6
18567 else
18568   ac_check_lib_save_LIBS=$LIBS
18569 LIBS="-ldbmalloc  $LIBS"
18570 cat >conftest.$ac_ext <<_ACEOF
18571 #line 18571 "configure"
18572 #include "confdefs.h"
18573
18574 /* Override any gcc2 internal prototype to avoid an error.  */
18575 #ifdef __cplusplus
18576 extern "C"
18577 #endif
18578 /* We use char because int might match the return type of a gcc2
18579    builtin and then its argument prototype would still apply.  */
18580 char debug_malloc ();
18581 int
18582 main (void)
18583 {
18584 debug_malloc ();
18585   ;
18586   return 0;
18587 }
18588 _ACEOF
18589 rm -f conftest.$ac_objext conftest$ac_exeext
18590 if { (eval echo "$as_me:18590: \"$ac_link\"") >&5
18591   (eval $ac_link) 2>&5
18592   ac_status=$?
18593   echo "$as_me:18593: \$? = $ac_status" >&5
18594   (exit $ac_status); } &&
18595          { ac_try='test -s conftest$ac_exeext'
18596   { (eval echo "$as_me:18596: \"$ac_try\"") >&5
18597   (eval $ac_try) 2>&5
18598   ac_status=$?
18599   echo "$as_me:18599: \$? = $ac_status" >&5
18600   (exit $ac_status); }; }; then
18601   ac_cv_lib_dbmalloc_debug_malloc=yes
18602 else
18603   echo "$as_me: failed program was:" >&5
18604 cat conftest.$ac_ext >&5
18605 ac_cv_lib_dbmalloc_debug_malloc=no
18606 fi
18607 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18608 LIBS=$ac_check_lib_save_LIBS
18609 fi
18610 echo "$as_me:18610: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
18611 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
18612 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
18613   cat >>confdefs.h <<EOF
18614 #define HAVE_LIBDBMALLOC 1
18615 EOF
18616
18617   LIBS="-ldbmalloc $LIBS"
18618
18619 fi
18620
18621 fi
18622
18623 fi
18624
18625 echo "$as_me:18625: checking if you want to use valgrind for testing" >&5
18626 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
18627
18628 # Check whether --with-valgrind or --without-valgrind was given.
18629 if test "${with_valgrind+set}" = set; then
18630   withval="$with_valgrind"
18631
18632 cat >>confdefs.h <<EOF
18633 #define USE_VALGRIND 1
18634 EOF
18635
18636         : ${with_cflags:=-g}
18637         : ${with_no_leaks:=yes}
18638          with_valgrind=yes
18639 else
18640   with_valgrind=
18641 fi;
18642 echo "$as_me:18642: result: ${with_valgrind:-no}" >&5
18643 echo "${ECHO_T}${with_valgrind:-no}" >&6
18644
18645 case .$with_cflags in
18646 (.*-g*)
18647         case .$CFLAGS in
18648         (.*-g*)
18649                 ;;
18650         (*)
18651
18652 cf_fix_cppflags=no
18653 cf_new_cflags=
18654 cf_new_cppflags=
18655 cf_new_extra_cppflags=
18656
18657 for cf_add_cflags in -g
18658 do
18659 case $cf_fix_cppflags in
18660 (no)
18661         case $cf_add_cflags in
18662         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18663                 case $cf_add_cflags in
18664                 (-D*)
18665                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18666
18667                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18668                                 && test -z "${cf_tst_cflags}" \
18669                                 && cf_fix_cppflags=yes
18670
18671                         if test $cf_fix_cppflags = yes ; then
18672
18673         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18674         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18675
18676                                 continue
18677                         elif test "${cf_tst_cflags}" = "\"'" ; then
18678
18679         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18680         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18681
18682                                 continue
18683                         fi
18684                         ;;
18685                 esac
18686                 case "$CPPFLAGS" in
18687                 (*$cf_add_cflags)
18688                         ;;
18689                 (*)
18690                         case $cf_add_cflags in
18691                         (-D*)
18692                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18693
18694 CPPFLAGS=`echo "$CPPFLAGS" | \
18695         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18696                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18697
18698                                 ;;
18699                         esac
18700
18701         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18702         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18703
18704                         ;;
18705                 esac
18706                 ;;
18707         (*)
18708
18709         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18710         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18711
18712                 ;;
18713         esac
18714         ;;
18715 (yes)
18716
18717         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18718         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18719
18720         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18721
18722         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18723                 && test -z "${cf_tst_cflags}" \
18724                 && cf_fix_cppflags=no
18725         ;;
18726 esac
18727 done
18728
18729 if test -n "$cf_new_cflags" ; then
18730
18731         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18732         CFLAGS="${CFLAGS}$cf_new_cflags"
18733
18734 fi
18735
18736 if test -n "$cf_new_cppflags" ; then
18737
18738         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18739         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18740
18741 fi
18742
18743 if test -n "$cf_new_extra_cppflags" ; then
18744
18745         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18746         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18747
18748 fi
18749
18750                 ;;
18751         esac
18752         ;;
18753 esac
18754
18755 echo "$as_me:18755: checking if you want to perform memory-leak testing" >&5
18756 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
18757
18758 # Check whether --enable-leaks or --disable-leaks was given.
18759 if test "${enable_leaks+set}" = set; then
18760   enableval="$enable_leaks"
18761   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
18762 else
18763   : ${with_no_leaks:=no}
18764 fi;
18765 echo "$as_me:18765: result: $with_no_leaks" >&5
18766 echo "${ECHO_T}$with_no_leaks" >&6
18767
18768 if test "$with_no_leaks" = yes ; then
18769
18770 cat >>confdefs.h <<\EOF
18771 #define NO_LEAKS 1
18772 EOF
18773
18774 cat >>confdefs.h <<\EOF
18775 #define YY_NO_LEAKS 1
18776 EOF
18777
18778 fi
18779
18780 LD_RPATH_OPT=
18781 echo "$as_me:18781: checking for an rpath option" >&5
18782 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
18783 case $cf_cv_system_name in
18784 (irix*)
18785         if test "$GCC" = yes; then
18786                 LD_RPATH_OPT="-Wl,-rpath,"
18787         else
18788                 LD_RPATH_OPT="-rpath "
18789         fi
18790         ;;
18791 (linux*|gnu*|k*bsd*-gnu|freebsd*)
18792         LD_RPATH_OPT="-Wl,-rpath,"
18793         ;;
18794 (openbsd[2-9].*|mirbsd*)
18795         LD_RPATH_OPT="-Wl,-rpath,"
18796         ;;
18797 (dragonfly*)
18798         LD_RPATH_OPT="-rpath "
18799         ;;
18800 (netbsd*)
18801         LD_RPATH_OPT="-Wl,-rpath,"
18802         ;;
18803 (osf*|mls+*)
18804         LD_RPATH_OPT="-rpath "
18805         ;;
18806 (solaris2*)
18807         LD_RPATH_OPT="-R"
18808         ;;
18809 (*)
18810         ;;
18811 esac
18812 echo "$as_me:18812: result: $LD_RPATH_OPT" >&5
18813 echo "${ECHO_T}$LD_RPATH_OPT" >&6
18814
18815 case "x$LD_RPATH_OPT" in
18816 (x-R*)
18817         echo "$as_me:18817: checking if we need a space after rpath option" >&5
18818 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
18819         cf_save_LIBS="$LIBS"
18820
18821 cf_add_libs="${LD_RPATH_OPT}$libdir"
18822 # Filter out duplicates - this happens with badly-designed ".pc" files...
18823 for cf_add_1lib in $LIBS
18824 do
18825         for cf_add_2lib in $cf_add_libs
18826         do
18827                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18828                 then
18829                         cf_add_1lib=
18830                         break
18831                 fi
18832         done
18833         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18834 done
18835 LIBS="$cf_add_libs"
18836
18837         cat >conftest.$ac_ext <<_ACEOF
18838 #line 18838 "configure"
18839 #include "confdefs.h"
18840
18841 int
18842 main (void)
18843 {
18844
18845   ;
18846   return 0;
18847 }
18848 _ACEOF
18849 rm -f conftest.$ac_objext conftest$ac_exeext
18850 if { (eval echo "$as_me:18850: \"$ac_link\"") >&5
18851   (eval $ac_link) 2>&5
18852   ac_status=$?
18853   echo "$as_me:18853: \$? = $ac_status" >&5
18854   (exit $ac_status); } &&
18855          { ac_try='test -s conftest$ac_exeext'
18856   { (eval echo "$as_me:18856: \"$ac_try\"") >&5
18857   (eval $ac_try) 2>&5
18858   ac_status=$?
18859   echo "$as_me:18859: \$? = $ac_status" >&5
18860   (exit $ac_status); }; }; then
18861   cf_rpath_space=no
18862 else
18863   echo "$as_me: failed program was:" >&5
18864 cat conftest.$ac_ext >&5
18865 cf_rpath_space=yes
18866 fi
18867 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18868         LIBS="$cf_save_LIBS"
18869         echo "$as_me:18869: result: $cf_rpath_space" >&5
18870 echo "${ECHO_T}$cf_rpath_space" >&6
18871         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
18872         ;;
18873 esac
18874
18875 echo "$as_me:18875: checking if rpath-hack should be disabled" >&5
18876 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
18877
18878 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
18879 if test "${enable_rpath_hack+set}" = set; then
18880   enableval="$enable_rpath_hack"
18881   test "$enableval" != no && enableval=yes
18882         if test "$enableval" != "yes" ; then
18883     cf_disable_rpath_hack=yes
18884         else
18885                 cf_disable_rpath_hack=no
18886         fi
18887 else
18888   enableval=yes
18889         cf_disable_rpath_hack=no
18890
18891 fi;
18892 echo "$as_me:18892: result: $cf_disable_rpath_hack" >&5
18893 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
18894 if test "$cf_disable_rpath_hack" = no ; then
18895
18896 echo "$as_me:18896: checking for updated LDFLAGS" >&5
18897 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
18898 if test -n "$LD_RPATH_OPT" ; then
18899         echo "$as_me:18899: result: maybe" >&5
18900 echo "${ECHO_T}maybe" >&6
18901
18902         for ac_prog in ldd
18903 do
18904   # Extract the first word of "$ac_prog", so it can be a program name with args.
18905 set dummy $ac_prog; ac_word=$2
18906 echo "$as_me:18906: checking for $ac_word" >&5
18907 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
18908 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
18909   echo $ECHO_N "(cached) $ECHO_C" >&6
18910 else
18911   if test -n "$cf_ldd_prog"; then
18912   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
18913 else
18914   ac_save_IFS=$IFS; IFS=$ac_path_separator
18915 ac_dummy="$PATH"
18916 for ac_dir in $ac_dummy; do
18917   IFS=$ac_save_IFS
18918   test -z "$ac_dir" && ac_dir=.
18919   $as_executable_p "$ac_dir/$ac_word" || continue
18920 ac_cv_prog_cf_ldd_prog="$ac_prog"
18921 echo "$as_me:18921: found $ac_dir/$ac_word" >&5
18922 break
18923 done
18924
18925 fi
18926 fi
18927 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
18928 if test -n "$cf_ldd_prog"; then
18929   echo "$as_me:18929: result: $cf_ldd_prog" >&5
18930 echo "${ECHO_T}$cf_ldd_prog" >&6
18931 else
18932   echo "$as_me:18932: result: no" >&5
18933 echo "${ECHO_T}no" >&6
18934 fi
18935
18936   test -n "$cf_ldd_prog" && break
18937 done
18938 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
18939
18940         cf_rpath_list="/usr/lib /lib"
18941         if test "$cf_ldd_prog" != no
18942         then
18943                 cf_rpath_oops=
18944
18945 cat >conftest.$ac_ext <<_ACEOF
18946 #line 18946 "configure"
18947 #include "confdefs.h"
18948 #include <stdio.h>
18949 int
18950 main (void)
18951 {
18952 printf("Hello");
18953   ;
18954   return 0;
18955 }
18956 _ACEOF
18957 rm -f conftest.$ac_objext conftest$ac_exeext
18958 if { (eval echo "$as_me:18958: \"$ac_link\"") >&5
18959   (eval $ac_link) 2>&5
18960   ac_status=$?
18961   echo "$as_me:18961: \$? = $ac_status" >&5
18962   (exit $ac_status); } &&
18963          { ac_try='test -s conftest$ac_exeext'
18964   { (eval echo "$as_me:18964: \"$ac_try\"") >&5
18965   (eval $ac_try) 2>&5
18966   ac_status=$?
18967   echo "$as_me:18967: \$? = $ac_status" >&5
18968   (exit $ac_status); }; }; then
18969   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
18970                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
18971 else
18972   echo "$as_me: failed program was:" >&5
18973 cat conftest.$ac_ext >&5
18974 fi
18975 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18976
18977                 # If we passed the link-test, but get a "not found" on a given library,
18978                 # this could be due to inept reconfiguration of gcc to make it only
18979                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
18980                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
18981                 # /usr/local libraries.
18982                 if test -n "$cf_rpath_oops"
18983                 then
18984                         for cf_rpath_src in $cf_rpath_oops
18985                         do
18986                                 for cf_rpath_dir in \
18987                                         /usr/local \
18988                                         /usr/pkg \
18989                                         /opt/sfw
18990                                 do
18991                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18992                                         then
18993                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18994
18995 echo "${as_me:-configure}:18995: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18996
18997                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18998                                                 break
18999                                         fi
19000                                 done
19001                         done
19002                 fi
19003         fi
19004
19005         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
19006
19007 echo "${as_me:-configure}:19007: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
19008
19009 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
19010
19011 echo "${as_me:-configure}:19011: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
19012
19013 cf_rpath_dst=
19014 for cf_rpath_src in $LDFLAGS
19015 do
19016         case $cf_rpath_src in
19017         (-L*)
19018
19019                 # check if this refers to a directory which we will ignore
19020                 cf_rpath_skip=no
19021                 if test -n "$cf_rpath_list"
19022                 then
19023                         for cf_rpath_item in $cf_rpath_list
19024                         do
19025                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
19026                                 then
19027                                         cf_rpath_skip=yes
19028                                         break
19029                                 fi
19030                         done
19031                 fi
19032
19033                 if test "$cf_rpath_skip" = no
19034                 then
19035                         # transform the option
19036                         if test "$LD_RPATH_OPT" = "-R " ; then
19037                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
19038                         else
19039                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
19040                         fi
19041
19042                         # if we have not already added this, add it now
19043                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
19044                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
19045                         then
19046                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
19047
19048 echo "${as_me:-configure}:19048: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
19049
19050                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
19051                         fi
19052                 fi
19053                 ;;
19054         esac
19055         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
19056 done
19057 LDFLAGS=$cf_rpath_dst
19058
19059 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
19060
19061 echo "${as_me:-configure}:19061: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
19062
19063 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
19064
19065 echo "${as_me:-configure}:19065: testing ...checking LIBS $LIBS ..." 1>&5
19066
19067 cf_rpath_dst=
19068 for cf_rpath_src in $LIBS
19069 do
19070         case $cf_rpath_src in
19071         (-L*)
19072
19073                 # check if this refers to a directory which we will ignore
19074                 cf_rpath_skip=no
19075                 if test -n "$cf_rpath_list"
19076                 then
19077                         for cf_rpath_item in $cf_rpath_list
19078                         do
19079                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
19080                                 then
19081                                         cf_rpath_skip=yes
19082                                         break
19083                                 fi
19084                         done
19085                 fi
19086
19087                 if test "$cf_rpath_skip" = no
19088                 then
19089                         # transform the option
19090                         if test "$LD_RPATH_OPT" = "-R " ; then
19091                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
19092                         else
19093                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
19094                         fi
19095
19096                         # if we have not already added this, add it now
19097                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
19098                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
19099                         then
19100                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
19101
19102 echo "${as_me:-configure}:19102: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
19103
19104                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
19105                         fi
19106                 fi
19107                 ;;
19108         esac
19109         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
19110 done
19111 LIBS=$cf_rpath_dst
19112
19113 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
19114
19115 echo "${as_me:-configure}:19115: testing ...checked LIBS $LIBS ..." 1>&5
19116
19117         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
19118
19119 echo "${as_me:-configure}:19119: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
19120
19121 else
19122         echo "$as_me:19122: result: no" >&5
19123 echo "${ECHO_T}no" >&6
19124 fi
19125
19126 fi
19127
19128 TEST_ARGS="$LIBS"
19129 LIBS=
19130
19131 ac_config_files="$ac_config_files Makefile"
19132 ac_config_commands="$ac_config_commands default"
19133 cat >confcache <<\_ACEOF
19134 # This file is a shell script that caches the results of configure
19135 # tests run on this system so they can be shared between configure
19136 # scripts and configure runs, see configure's option --config-cache.
19137 # It is not useful on other systems.  If it contains results you don't
19138 # want to keep, you may remove or edit it.
19139 #
19140 # config.status only pays attention to the cache file if you give it
19141 # the --recheck option to rerun configure.
19142 #
19143 # `ac_cv_env_foo' variables (set or unset) will be overriden when
19144 # loading this file, other *unset* `ac_cv_foo' will be assigned the
19145 # following values.
19146
19147 _ACEOF
19148
19149 # The following way of writing the cache mishandles newlines in values,
19150 # but we know of no workaround that is simple, portable, and efficient.
19151 # So, don't put newlines in cache variables' values.
19152 # Ultrix sh set writes to stderr and can't be redirected directly,
19153 # and sets the high bit in the cache file unless we assign to the vars.
19154 {
19155   (set) 2>&1 |
19156     case `(ac_space=' '; set | grep ac_space) 2>&1` in
19157     *ac_space=\ *)
19158       # `set' does not quote correctly, so add quotes (double-quote
19159       # substitution turns \\\\ into \\, and sed turns \\ into \).
19160       sed -n \
19161         "s/'/'\\\\''/g;
19162           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
19163       ;;
19164     *)
19165       # `set' quotes correctly as required by POSIX, so do not add quotes.
19166       sed -n \
19167         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
19168       ;;
19169     esac;
19170 } |
19171   sed '
19172      t clear
19173      : clear
19174      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
19175      t end
19176      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
19177      : end' >>confcache
19178 if cmp -s $cache_file confcache; then :; else
19179   if test -w $cache_file; then
19180     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
19181     cat confcache >$cache_file
19182   else
19183     echo "not updating unwritable cache $cache_file"
19184   fi
19185 fi
19186 rm -f confcache
19187
19188 test "x$prefix" = xNONE && prefix=$ac_default_prefix
19189 # Let make expand exec_prefix.
19190 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
19191
19192 # VPATH may cause trouble with some makes, so we remove $(srcdir),
19193 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
19194 # trailing colons and then remove the whole line if VPATH becomes empty
19195 # (actually we leave an empty line to preserve line numbers).
19196 if test "x$srcdir" = x.; then
19197   ac_vpsub='/^[         ]*VPATH[        ]*=/{
19198 s/:*\$(srcdir):*/:/;
19199 s/:*\${srcdir}:*/:/;
19200 s/:*@srcdir@:*/:/;
19201 s/^\([^=]*=[    ]*\):*/\1/;
19202 s/:*$//;
19203 s/^[^=]*=[      ]*$//;
19204 }'
19205 fi
19206
19207 DEFS=-DHAVE_CONFIG_H
19208
19209 : ${CONFIG_STATUS=./config.status}
19210 ac_clean_files_save=$ac_clean_files
19211 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
19212 { echo "$as_me:19212: creating $CONFIG_STATUS" >&5
19213 echo "$as_me: creating $CONFIG_STATUS" >&6;}
19214 cat >$CONFIG_STATUS <<_ACEOF
19215 #! $SHELL
19216 # Generated automatically by configure.
19217 # Run this file to recreate the current configuration.
19218 # Compiler output produced by configure, useful for debugging
19219 # configure, is in config.log if it exists.
19220
19221 debug=false
19222 SHELL=\${CONFIG_SHELL-$SHELL}
19223 ac_cs_invocation="\$0 \$@"
19224
19225 _ACEOF
19226
19227 cat >>$CONFIG_STATUS <<\_ACEOF
19228 # Be Bourne compatible
19229 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
19230   emulate sh
19231   NULLCMD=:
19232 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
19233   set -o posix
19234 fi
19235
19236 # Name of the executable.
19237 as_me=`echo "$0" |sed 's,.*[\\/],,'`
19238
19239 if expr a : '\(a\)' >/dev/null 2>&1; then
19240   as_expr=expr
19241 else
19242   as_expr=false
19243 fi
19244
19245 rm -f conf$$ conf$$.exe conf$$.file
19246 echo >conf$$.file
19247 if ln -s conf$$.file conf$$ 2>/dev/null; then
19248   # We could just check for DJGPP; but this test a) works b) is more generic
19249   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
19250   if test -f conf$$.exe; then
19251     # Don't use ln at all; we don't have any links
19252     as_ln_s='cp -p'
19253   else
19254     as_ln_s='ln -s'
19255   fi
19256 elif ln conf$$.file conf$$ 2>/dev/null; then
19257   as_ln_s=ln
19258 else
19259   as_ln_s='cp -p'
19260 fi
19261 rm -f conf$$ conf$$.exe conf$$.file
19262
19263 as_executable_p="test -f"
19264
19265 # Support unset when possible.
19266 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
19267   as_unset=unset
19268 else
19269   as_unset=false
19270 fi
19271
19272 # NLS nuisances.
19273 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
19274 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
19275 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
19276 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
19277 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
19278 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
19279 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
19280 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
19281
19282 # IFS
19283 # We need space, tab and new line, in precisely that order.
19284 as_nl='
19285 '
19286 IFS="   $as_nl"
19287
19288 # CDPATH.
19289 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
19290
19291 exec 6>&1
19292
19293 _ACEOF
19294
19295 # Files that config.status was made for.
19296 if test -n "$ac_config_files"; then
19297   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
19298 fi
19299
19300 if test -n "$ac_config_headers"; then
19301   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
19302 fi
19303
19304 if test -n "$ac_config_links"; then
19305   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
19306 fi
19307
19308 if test -n "$ac_config_commands"; then
19309   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
19310 fi
19311
19312 cat >>$CONFIG_STATUS <<\EOF
19313
19314 ac_cs_usage="\
19315 \`$as_me' instantiates files from templates according to the
19316 current configuration.
19317
19318 Usage: $0 [OPTIONS] [FILE]...
19319
19320   -h, --help       print this help, then exit
19321   -V, --version    print version number, then exit
19322   -d, --debug      don't remove temporary files
19323       --recheck    update $as_me by reconfiguring in the same conditions
19324   --file=FILE[:TEMPLATE]
19325                    instantiate the configuration file FILE
19326   --header=FILE[:TEMPLATE]
19327                    instantiate the configuration header FILE
19328
19329 Configuration files:
19330 $config_files
19331
19332 Configuration headers:
19333 $config_headers
19334
19335 Configuration commands:
19336 $config_commands
19337
19338 Report bugs to <dickey@invisible-island.net>."
19339 EOF
19340
19341 cat >>$CONFIG_STATUS <<EOF
19342 ac_cs_version="\\
19343 config.status
19344 configured by $0, generated by GNU Autoconf 2.52.20170501,
19345   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
19346
19347 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
19348 Free Software Foundation, Inc.
19349 This config.status script is free software; the Free Software Foundation
19350 gives unlimited permission to copy, distribute and modify it."
19351 srcdir=$srcdir
19352 INSTALL="$INSTALL"
19353 EOF
19354
19355 cat >>$CONFIG_STATUS <<\EOF
19356 # If no file are specified by the user, then we need to provide default
19357 # value.  By we need to know if files were specified by the user.
19358 ac_need_defaults=:
19359 while test $# != 0
19360 do
19361   case $1 in
19362   --*=*)
19363     ac_option=`expr "x$1" : 'x\([^=]*\)='`
19364     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
19365     shift
19366     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
19367     shift
19368     ;;
19369   -*);;
19370   *) # This is not an option, so the user has probably given explicit
19371      # arguments.
19372      ac_need_defaults=false;;
19373   esac
19374
19375   case $1 in
19376   # Handling of the options.
19377 EOF
19378 cat >>$CONFIG_STATUS <<EOF
19379   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
19380     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
19381     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
19382 EOF
19383 cat >>$CONFIG_STATUS <<\EOF
19384   --version | --vers* | -V )
19385     echo "$ac_cs_version"; exit 0 ;;
19386   --he | --h)
19387     # Conflict between --help and --header
19388     { { echo "$as_me:19388: error: ambiguous option: $1
19389 Try \`$0 --help' for more information." >&5
19390 echo "$as_me: error: ambiguous option: $1
19391 Try \`$0 --help' for more information." >&2;}
19392    { (exit 1); exit 1; }; };;
19393   --help | --hel | -h )
19394     echo "$ac_cs_usage"; exit 0 ;;
19395   --debug | --d* | -d )
19396     debug=: ;;
19397   --file | --fil | --fi | --f )
19398     shift
19399     CONFIG_FILES="$CONFIG_FILES $1"
19400     ac_need_defaults=false;;
19401   --header | --heade | --head | --hea )
19402     shift
19403     CONFIG_HEADERS="$CONFIG_HEADERS $1"
19404     ac_need_defaults=false;;
19405
19406   # This is an error.
19407   -*) { { echo "$as_me:19407: error: unrecognized option: $1
19408 Try \`$0 --help' for more information." >&5
19409 echo "$as_me: error: unrecognized option: $1
19410 Try \`$0 --help' for more information." >&2;}
19411    { (exit 1); exit 1; }; } ;;
19412
19413   *) ac_config_targets="$ac_config_targets $1" ;;
19414
19415   esac
19416   shift
19417 done
19418
19419 exec 5>>config.log
19420 cat >&5 << _ACEOF
19421
19422 ## ----------------------- ##
19423 ## Running config.status.  ##
19424 ## ----------------------- ##
19425
19426 This file was extended by $as_me 2.52.20170501, executed with
19427   CONFIG_FILES    = $CONFIG_FILES
19428   CONFIG_HEADERS  = $CONFIG_HEADERS
19429   CONFIG_LINKS    = $CONFIG_LINKS
19430   CONFIG_COMMANDS = $CONFIG_COMMANDS
19431   > $ac_cs_invocation
19432 on `(hostname || uname -n) 2>/dev/null | sed 1q`
19433
19434 _ACEOF
19435 EOF
19436
19437 cat >>$CONFIG_STATUS <<EOF
19438 #
19439 # INIT-COMMANDS section.
19440 #
19441
19442 AWK="$AWK"
19443 ECHO_CC="$ECHO_CC"
19444 ECHO_LD="$ECHO_LD"
19445 SHOW_CC="$SHOW_LD"
19446
19447 EOF
19448
19449 cat >>$CONFIG_STATUS <<\EOF
19450 for ac_config_target in $ac_config_targets
19451 do
19452   case "$ac_config_target" in
19453   # Handling of arguments.
19454   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
19455   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
19456   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
19457   *) { { echo "$as_me:19457: error: invalid argument: $ac_config_target" >&5
19458 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
19459    { (exit 1); exit 1; }; };;
19460   esac
19461 done
19462
19463 # If the user did not use the arguments to specify the items to instantiate,
19464 # then the envvar interface is used.  Set only those that are not.
19465 # We use the long form for the default assignment because of an extremely
19466 # bizarre bug on SunOS 4.1.3.
19467 if $ac_need_defaults; then
19468   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
19469   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
19470   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
19471 fi
19472
19473 # Create a temporary directory, and hook for its removal unless debugging.
19474 $debug ||
19475 {
19476   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
19477   trap '{ (exit 1); exit 1; }' 1 2 13 15
19478 }
19479
19480 # Create a (secure) tmp directory for tmp files.
19481 : ${TMPDIR=/tmp}
19482 {
19483   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
19484   test -n "$tmp" && test -d "$tmp"
19485 }  ||
19486 {
19487   tmp=$TMPDIR/cs$$-$RANDOM
19488   (umask 077 && mkdir $tmp)
19489 } ||
19490 {
19491    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
19492    { (exit 1); exit 1; }
19493 }
19494
19495 EOF
19496
19497 cat >>$CONFIG_STATUS <<EOF
19498
19499 #
19500 # CONFIG_FILES section.
19501 #
19502
19503 # No need to generate the scripts if there are no CONFIG_FILES.
19504 # This happens for instance when ./config.status config.h
19505 if test -n "\$CONFIG_FILES"; then
19506   # Protect against being on the right side of a sed subst in config.status.
19507   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
19508    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
19509 s,@SHELL@,$SHELL,;t t
19510 s,@exec_prefix@,$exec_prefix,;t t
19511 s,@prefix@,$prefix,;t t
19512 s,@program_transform_name@,$program_transform_name,;t t
19513 s,@bindir@,$bindir,;t t
19514 s,@sbindir@,$sbindir,;t t
19515 s,@libexecdir@,$libexecdir,;t t
19516 s,@datarootdir@,$datarootdir,;t t
19517 s,@datadir@,$datadir,;t t
19518 s,@sysconfdir@,$sysconfdir,;t t
19519 s,@sharedstatedir@,$sharedstatedir,;t t
19520 s,@localstatedir@,$localstatedir,;t t
19521 s,@libdir@,$libdir,;t t
19522 s,@includedir@,$includedir,;t t
19523 s,@oldincludedir@,$oldincludedir,;t t
19524 s,@infodir@,$infodir,;t t
19525 s,@mandir@,$mandir,;t t
19526 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
19527 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
19528 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
19529 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
19530 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
19531 s,@build_alias@,$build_alias,;t t
19532 s,@host_alias@,$host_alias,;t t
19533 s,@target_alias@,$target_alias,;t t
19534 s,@ECHO_C@,$ECHO_C,;t t
19535 s,@ECHO_N@,$ECHO_N,;t t
19536 s,@ECHO_T@,$ECHO_T,;t t
19537 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
19538 s,@DEFS@,$DEFS,;t t
19539 s,@LIBS@,$LIBS,;t t
19540 s,@build@,$build,;t t
19541 s,@build_cpu@,$build_cpu,;t t
19542 s,@build_vendor@,$build_vendor,;t t
19543 s,@build_os@,$build_os,;t t
19544 s,@host@,$host,;t t
19545 s,@host_cpu@,$host_cpu,;t t
19546 s,@host_vendor@,$host_vendor,;t t
19547 s,@host_os@,$host_os,;t t
19548 s,@SET_MAKE@,$SET_MAKE,;t t
19549 s,@CC@,$CC,;t t
19550 s,@CFLAGS@,$CFLAGS,;t t
19551 s,@LDFLAGS@,$LDFLAGS,;t t
19552 s,@CPPFLAGS@,$CPPFLAGS,;t t
19553 s,@ac_ct_CC@,$ac_ct_CC,;t t
19554 s,@EXEEXT@,$EXEEXT,;t t
19555 s,@OBJEXT@,$OBJEXT,;t t
19556 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
19557 s,@CPP@,$CPP,;t t
19558 s,@AWK@,$AWK,;t t
19559 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
19560 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
19561 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
19562 s,@LINT@,$LINT,;t t
19563 s,@LINT_OPTS@,$LINT_OPTS,;t t
19564 s,@CTAGS@,$CTAGS,;t t
19565 s,@ETAGS@,$ETAGS,;t t
19566 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
19567 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
19568 s,@MATH_LIB@,$MATH_LIB,;t t
19569 s,@top_builddir@,$top_builddir,;t t
19570 s,@CC_G_OPT@,$CC_G_OPT,;t t
19571 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
19572 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
19573 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
19574 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
19575 s,@LD@,$LD,;t t
19576 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
19577 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
19578 s,@LD_MODEL@,$LD_MODEL,;t t
19579 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
19580 s,@LIBTOOL@,$LIBTOOL,;t t
19581 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
19582 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
19583 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
19584 s,@LIB_LINK@,$LIB_LINK,;t t
19585 s,@LINK_TESTS@,$LINK_TESTS,;t t
19586 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
19587 s,@PACKAGE@,$PACKAGE,;t t
19588 s,@PTHREAD@,$PTHREAD,;t t
19589 s,@TEST_ARGS@,$TEST_ARGS,;t t
19590 s,@TEST_DEPS@,$TEST_DEPS,;t t
19591 s,@TEST_LIBS@,$TEST_LIBS,;t t
19592 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
19593 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
19594 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
19595 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
19596 s,@includesubdir@,$includesubdir,;t t
19597 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
19598 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
19599 s,@ECHO_LT@,$ECHO_LT,;t t
19600 s,@ECHO_LD@,$ECHO_LD,;t t
19601 s,@RULE_CC@,$RULE_CC,;t t
19602 s,@SHOW_CC@,$SHOW_CC,;t t
19603 s,@ECHO_CC@,$ECHO_CC,;t t
19604 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
19605 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
19606 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
19607 s,@X_CFLAGS@,$X_CFLAGS,;t t
19608 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
19609 s,@X_LIBS@,$X_LIBS,;t t
19610 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
19611 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
19612 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
19613 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
19614 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
19615 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
19616 CEOF
19617
19618 EOF
19619
19620   cat >>$CONFIG_STATUS <<\EOF
19621   # Split the substitutions into bite-sized pieces for seds with
19622   # small command number limits, like on Digital OSF/1 and HP-UX.
19623   ac_max_sed_lines=48
19624   ac_sed_frag=1 # Number of current file.
19625   ac_beg=1 # First line for current file.
19626   ac_end=$ac_max_sed_lines # Line after last line for current file.
19627   ac_more_lines=:
19628   ac_sed_cmds=
19629   while $ac_more_lines; do
19630     if test $ac_beg -gt 1; then
19631       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19632     else
19633       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19634     fi
19635     if test ! -s $tmp/subs.frag; then
19636       ac_more_lines=false
19637     else
19638       # The purpose of the label and of the branching condition is to
19639       # speed up the sed processing (if there are no `@' at all, there
19640       # is no need to browse any of the substitutions).
19641       # These are the two extra sed commands mentioned above.
19642       (echo ':t
19643   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
19644       # It is possible to make a multiline substitution using escaped newlines.
19645       # Ensure that we do not split the substitution between script fragments.
19646       ac_BEG=$ac_end
19647       ac_END=`expr $ac_end + $ac_max_sed_lines`
19648       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
19649       if test -s $tmp/subs.next; then
19650         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
19651         if test ! -s $tmp/subs.edit; then
19652           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
19653           if test ! -s $tmp/subs.edit; then
19654             if test $ac_beg -gt 1; then
19655               ac_end=`expr $ac_end - 1`
19656               continue
19657             fi
19658           fi
19659         fi
19660       fi
19661
19662       if test -z "$ac_sed_cmds"; then
19663         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
19664       else
19665         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
19666       fi
19667       ac_sed_frag=`expr $ac_sed_frag + 1`
19668       ac_beg=$ac_end
19669       ac_end=`expr $ac_end + $ac_max_sed_lines`
19670     fi
19671   done
19672   if test -z "$ac_sed_cmds"; then
19673     ac_sed_cmds=cat
19674   fi
19675 fi # test -n "$CONFIG_FILES"
19676
19677 EOF
19678 cat >>$CONFIG_STATUS <<\EOF
19679 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19680   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19681   case $ac_file in
19682   - | *:- | *:-:* ) # input from stdin
19683         cat >$tmp/stdin
19684         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19685         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19686   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19687         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19688   * )   ac_file_in=$ac_file.in ;;
19689   esac
19690
19691   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19692   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19693          X"$ac_file" : 'X\(//\)[^/]' \| \
19694          X"$ac_file" : 'X\(//\)$' \| \
19695          X"$ac_file" : 'X\(/\)' \| \
19696          .     : '\(.\)' 2>/dev/null ||
19697 echo X"$ac_file" |
19698     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19699           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19700           /^X\(\/\/\)$/{ s//\1/; q; }
19701           /^X\(\/\).*/{ s//\1/; q; }
19702           s/.*/./; q'`
19703   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19704     { case "$ac_dir" in
19705   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19706   *)                      as_incr_dir=.;;
19707 esac
19708 as_dummy="$ac_dir"
19709 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19710   case $as_mkdir_dir in
19711     # Skip DOS drivespec
19712     ?:) as_incr_dir=$as_mkdir_dir ;;
19713     *)
19714       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19715       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19716     ;;
19717   esac
19718 done; }
19719
19720     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
19721     # A "../" for each directory in $ac_dir_suffix.
19722     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19723   else
19724     ac_dir_suffix= ac_dots=
19725   fi
19726
19727   case $srcdir in
19728   .)  ac_srcdir=.
19729       if test -z "$ac_dots"; then
19730          ac_top_srcdir=.
19731       else
19732          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
19733       fi ;;
19734   [\\/]* | ?:[\\/]* )
19735       ac_srcdir=$srcdir$ac_dir_suffix;
19736       ac_top_srcdir=$srcdir ;;
19737   *) # Relative path.
19738     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
19739     ac_top_srcdir=$ac_dots$srcdir ;;
19740   esac
19741
19742   case $INSTALL in
19743   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19744   *) ac_INSTALL=$ac_dots$INSTALL ;;
19745   esac
19746
19747   if test x"$ac_file" != x-; then
19748     { echo "$as_me:19748: creating $ac_file" >&5
19749 echo "$as_me: creating $ac_file" >&6;}
19750     rm -f "$ac_file"
19751   fi
19752   # Let's still pretend it is `configure' which instantiates (i.e., don't
19753   # use $as_me), people would be surprised to read:
19754   #    /* config.h.  Generated automatically by config.status.  */
19755   configure_input="Generated automatically from `echo $ac_file_in |
19756                                                  sed 's,.*/,,'` by configure."
19757
19758   # First look for the input files in the build tree, otherwise in the
19759   # src tree.
19760   ac_file_inputs=`IFS=:
19761     for f in $ac_file_in; do
19762       case $f in
19763       -) echo $tmp/stdin ;;
19764       [\\/$]*)
19765          # Absolute (can't be DOS-style, as IFS=:)
19766          test -f "$f" || { { echo "$as_me:19766: error: cannot find input file: $f" >&5
19767 echo "$as_me: error: cannot find input file: $f" >&2;}
19768    { (exit 1); exit 1; }; }
19769          echo $f;;
19770       *) # Relative
19771          if test -f "$f"; then
19772            # Build tree
19773            echo $f
19774          elif test -f "$srcdir/$f"; then
19775            # Source tree
19776            echo $srcdir/$f
19777          else
19778            # /dev/null tree
19779            { { echo "$as_me:19779: error: cannot find input file: $f" >&5
19780 echo "$as_me: error: cannot find input file: $f" >&2;}
19781    { (exit 1); exit 1; }; }
19782          fi;;
19783       esac
19784     done` || { (exit 1); exit 1; }
19785 EOF
19786 cat >>$CONFIG_STATUS <<\EOF
19787   ac_warn_datarootdir=no
19788   if test x"$ac_file" != x-; then
19789     for ac_item in $ac_file_inputs
19790     do
19791       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
19792       if test -n "$ac_seen"; then
19793         ac_used=`grep '@datarootdir@' $ac_item`
19794         if test -z "$ac_used"; then
19795           { echo "$as_me:19795: WARNING: datarootdir was used implicitly but not set:
19796 $ac_seen" >&5
19797 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19798 $ac_seen" >&2;}
19799           ac_warn_datarootdir=yes
19800         fi
19801       fi
19802       ac_seen=`grep '${datarootdir}' $ac_item`
19803       if test -n "$ac_seen"; then
19804         { echo "$as_me:19804: WARNING: datarootdir was used explicitly but not set:
19805 $ac_seen" >&5
19806 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19807 $ac_seen" >&2;}
19808         ac_warn_datarootdir=yes
19809       fi
19810     done
19811   fi
19812
19813 if test "x$ac_warn_datarootdir" = xyes; then
19814   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19815 fi
19816
19817 EOF
19818 cat >>$CONFIG_STATUS <<EOF
19819   sed "$ac_vpsub
19820 $extrasub
19821 EOF
19822 cat >>$CONFIG_STATUS <<\EOF
19823 :t
19824 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19825 s,@configure_input@,$configure_input,;t t
19826 s,@srcdir@,$ac_srcdir,;t t
19827 s,@top_srcdir@,$ac_top_srcdir,;t t
19828 s,@INSTALL@,$ac_INSTALL,;t t
19829 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19830   rm -f $tmp/stdin
19831   if test x"$ac_file" != x-; then
19832     cp $tmp/out $ac_file
19833
19834     for ac_name in prefix exec_prefix datarootdir
19835     do
19836         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
19837         if test -n "$ac_seen"; then
19838             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
19839             if test -z "$ac_init"; then
19840               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19841               { echo "$as_me:19841: WARNING: Variable $ac_name is used but was not set:
19842 $ac_seen" >&5
19843 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19844 $ac_seen" >&2;}
19845             fi
19846         fi
19847     done
19848     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
19849     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
19850     if test -s $tmp/out; then
19851       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19852       { echo "$as_me:19852: WARNING: Some variables may not be substituted:
19853 $ac_seen" >&5
19854 echo "$as_me: WARNING: Some variables may not be substituted:
19855 $ac_seen" >&2;}
19856     fi
19857   else
19858     cat $tmp/out
19859   fi
19860   rm -f $tmp/out
19861
19862 done
19863 EOF
19864 cat >>$CONFIG_STATUS <<\EOF
19865
19866 #
19867 # CONFIG_HEADER section.
19868 #
19869
19870 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19871 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19872 #
19873 # ac_d sets the value in "#define NAME VALUE" lines.
19874 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19875 ac_dB='[        ].*$,\1#\2'
19876 ac_dC=' '
19877 ac_dD=',;t'
19878 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19879 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19880 ac_iB='\([      ]\),\1#\2define\3'
19881 ac_iC=' '
19882 ac_iD='\4,;t'
19883 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19884 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19885 ac_uB='$,\1#\2define\3'
19886 ac_uC=' '
19887 ac_uD=',;t'
19888
19889 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19890   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19891   case $ac_file in
19892   - | *:- | *:-:* ) # input from stdin
19893         cat >$tmp/stdin
19894         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19895         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19896   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19897         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19898   * )   ac_file_in=$ac_file.in ;;
19899   esac
19900
19901   test x"$ac_file" != x- && { echo "$as_me:19901: creating $ac_file" >&5
19902 echo "$as_me: creating $ac_file" >&6;}
19903
19904   # First look for the input files in the build tree, otherwise in the
19905   # src tree.
19906   ac_file_inputs=`IFS=:
19907     for f in $ac_file_in; do
19908       case $f in
19909       -) echo $tmp/stdin ;;
19910       [\\/$]*)
19911          # Absolute (can't be DOS-style, as IFS=:)
19912          test -f "$f" || { { echo "$as_me:19912: error: cannot find input file: $f" >&5
19913 echo "$as_me: error: cannot find input file: $f" >&2;}
19914    { (exit 1); exit 1; }; }
19915          echo $f;;
19916       *) # Relative
19917          if test -f "$f"; then
19918            # Build tree
19919            echo $f
19920          elif test -f "$srcdir/$f"; then
19921            # Source tree
19922            echo $srcdir/$f
19923          else
19924            # /dev/null tree
19925            { { echo "$as_me:19925: error: cannot find input file: $f" >&5
19926 echo "$as_me: error: cannot find input file: $f" >&2;}
19927    { (exit 1); exit 1; }; }
19928          fi;;
19929       esac
19930     done` || { (exit 1); exit 1; }
19931   # Remove the trailing spaces.
19932   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19933
19934 EOF
19935
19936 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19937 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19938 # be either 'cat' or 'sort'.
19939 cat confdefs.h | uniq >conftest.vals
19940
19941 # Break up conftest.vals because some shells have a limit on
19942 # the size of here documents, and old seds have small limits too.
19943
19944 rm -f conftest.tail
19945 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
19946 while grep . conftest.vals >/dev/null
19947 do
19948   # Write chunks of a limited-size here document to conftest.frag.
19949   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
19950   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
19951   echo 'CEOF' >> $CONFIG_STATUS
19952   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
19953   rm -f conftest.vals
19954   mv conftest.tail conftest.vals
19955 done
19956 rm -f conftest.vals
19957
19958 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19959 # marker @DEFS@.
19960 echo '  cat >> conftest.edit <<CEOF
19961 /@DEFS@/r conftest.frag
19962 /@DEFS@/d
19963 CEOF
19964 sed -f conftest.edit $tmp/in > $tmp/out
19965 rm -f $tmp/in
19966 mv $tmp/out $tmp/in
19967 rm -f conftest.edit conftest.frag
19968 ' >> $CONFIG_STATUS
19969
19970 cat >>$CONFIG_STATUS <<\EOF
19971   # Let's still pretend it is `configure' which instantiates (i.e., don't
19972   # use $as_me), people would be surprised to read:
19973   #    /* config.h.  Generated automatically by config.status.  */
19974   if test x"$ac_file" = x-; then
19975     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19976   else
19977     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19978   fi
19979   cat $tmp/in >>$tmp/config.h
19980   rm -f $tmp/in
19981   if test x"$ac_file" != x-; then
19982     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19983       { echo "$as_me:19983: $ac_file is unchanged" >&5
19984 echo "$as_me: $ac_file is unchanged" >&6;}
19985     else
19986       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19987          X"$ac_file" : 'X\(//\)[^/]' \| \
19988          X"$ac_file" : 'X\(//\)$' \| \
19989          X"$ac_file" : 'X\(/\)' \| \
19990          .     : '\(.\)' 2>/dev/null ||
19991 echo X"$ac_file" |
19992     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19993           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19994           /^X\(\/\/\)$/{ s//\1/; q; }
19995           /^X\(\/\).*/{ s//\1/; q; }
19996           s/.*/./; q'`
19997       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19998         { case "$ac_dir" in
19999   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
20000   *)                      as_incr_dir=.;;
20001 esac
20002 as_dummy="$ac_dir"
20003 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
20004   case $as_mkdir_dir in
20005     # Skip DOS drivespec
20006     ?:) as_incr_dir=$as_mkdir_dir ;;
20007     *)
20008       as_incr_dir=$as_incr_dir/$as_mkdir_dir
20009       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
20010     ;;
20011   esac
20012 done; }
20013
20014       fi
20015       rm -f $ac_file
20016       mv $tmp/config.h $ac_file
20017     fi
20018   else
20019     cat $tmp/config.h
20020     rm -f $tmp/config.h
20021   fi
20022 done
20023 EOF
20024 cat >>$CONFIG_STATUS <<\EOF
20025 #
20026 # CONFIG_COMMANDS section.
20027 #
20028 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
20029   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
20030   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
20031
20032   case $ac_dest in
20033     default )
20034
20035 for cf_dir in .
20036 do
20037         if test ! -d $srcdir/$cf_dir; then
20038                 continue
20039         elif test -f $srcdir/$cf_dir/programs; then
20040                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
20041         fi
20042 done
20043
20044         cat >>Makefile <<TEST_EOF
20045
20046 # These rules are generated so we do not rely on suffix rules, which do not
20047 # work consistently for different make-programs (the '\$(MODEL)/' confuses
20048 # some, and the '\$x' confuses others).
20049 TEST_EOF
20050
20051 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
20052 for N in $LIST
20053 do
20054         cat >>Makefile <<TEST_EOF
20055
20056 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
20057         \$(srcdir)/test.priv.h \\
20058         ncurses_cfg.h
20059         $SHOW_CC
20060         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
20061 TEST_EOF
20062 done
20063
20064 if test -f ../config.guess && test -f ../config.sub
20065 then
20066         cat >>Makefile <<TEST_EOF
20067
20068 # if we used CF_INHERIT for getting these files, we can remove them
20069 distclean::
20070         rm -f config.guess config.sub
20071 TEST_EOF
20072 fi
20073  ;;
20074   esac
20075 done
20076 EOF
20077
20078 cat >>$CONFIG_STATUS <<\EOF
20079
20080 { (exit 0); exit 0; }
20081 EOF
20082 chmod +x $CONFIG_STATUS
20083 ac_clean_files=$ac_clean_files_save
20084
20085 # configure is writing to config.log, and then calls config.status.
20086 # config.status does its own redirection, appending to config.log.
20087 # Unfortunately, on DOS this fails, as config.log is still kept open
20088 # by configure, so config.status won't be able to write to it; its
20089 # output is simply discarded.  So we exec the FD to /dev/null,
20090 # effectively closing config.log, so it can be properly (re)opened and
20091 # appended to by config.status.  When coming back to configure, we
20092 # need to make the FD available again.
20093 if test "$no_create" != yes; then
20094   ac_cs_success=:
20095   exec 5>/dev/null
20096   $SHELL $CONFIG_STATUS || ac_cs_success=false
20097   exec 5>>config.log
20098   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
20099   # would make configure fail if this is the last instruction.
20100   $ac_cs_success || { (exit 1); exit 1; }
20101 fi
20102