]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
32ac8be5e6dd50140b43bf7cd3fef7c89efa613e
[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   --disable-panel         disable checks for panel functions
677   --disable-menu          disable checks for menu functions
678   --disable-form          disable checks for form functions
679 Testing/development Options:
680   --enable-warnings       test: turn on gcc compiler warnings
681   --with-dmalloc          test: use Gray Watson's dmalloc library
682   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
683   --with-valgrind         test: use valgrind
684   --disable-leaks         test: free permanent memory, analyze leaks
685   --disable-rpath-hack    don't add rpath options for additional libraries
686
687 Some influential environment variables:
688   CC          C compiler command
689   CFLAGS      C compiler flags
690   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
691               nonstandard directory <lib dir>
692   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
693               headers in a nonstandard directory <include dir>
694   CPP         C preprocessor
695
696 Use these variables to override the choices made by `configure' or to help
697 it to find libraries and programs with nonstandard names/locations.
698
699 EOF
700 fi
701
702 if test "$ac_init_help" = "recursive"; then
703   # If there are subdirs, report their specific --help.
704   ac_popdir=`pwd`
705   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
706     cd $ac_subdir
707     # A "../" for each directory in /$ac_subdir.
708     ac_dots=`echo $ac_subdir |
709              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
710
711     case $srcdir in
712     .) # No --srcdir option.  We are building in place.
713       ac_sub_srcdir=$srcdir ;;
714     [\\/]* | ?:[\\/]* ) # Absolute path.
715       ac_sub_srcdir=$srcdir/$ac_subdir ;;
716     *) # Relative path.
717       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
718     esac
719
720     # Check for guested configure; otherwise get Cygnus style configure.
721     if test -f $ac_sub_srcdir/configure.gnu; then
722       echo
723       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
724     elif test -f $ac_sub_srcdir/configure; then
725       echo
726       $SHELL $ac_sub_srcdir/configure  --help=recursive
727     elif test -f $ac_sub_srcdir/configure.ac ||
728            test -f $ac_sub_srcdir/configure.in; then
729       echo
730       $ac_configure --help
731     else
732       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
733     fi
734     cd $ac_popdir
735   done
736 fi
737
738 test -n "$ac_init_help" && exit 0
739 if $ac_init_version; then
740   cat <<\EOF
741
742 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
743 Free Software Foundation, Inc.
744 This configure script is free software; the Free Software Foundation
745 gives unlimited permission to copy, distribute and modify it.
746 EOF
747   exit 0
748 fi
749 exec 5>config.log
750 cat >&5 <<EOF
751 This file contains any messages produced by compilers while
752 running configure, to aid debugging if configure makes a mistake.
753
754 It was created by $as_me, which was
755 generated by GNU Autoconf 2.52.20170501.  Invocation command line was
756
757   $ $0 $@
758
759 EOF
760 {
761 cat <<_ASUNAME
762 ## ---------- ##
763 ## Platform.  ##
764 ## ---------- ##
765
766 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
767 uname -m = `(uname -m) 2>/dev/null || echo unknown`
768 uname -r = `(uname -r) 2>/dev/null || echo unknown`
769 uname -s = `(uname -s) 2>/dev/null || echo unknown`
770 uname -v = `(uname -v) 2>/dev/null || echo unknown`
771
772 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
773 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
774
775 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
776 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
777 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
778 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
779 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
780 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
781 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
782
783 PATH = $PATH
784
785 _ASUNAME
786 } >&5
787
788 cat >&5 <<EOF
789 ## ------------ ##
790 ## Core tests.  ##
791 ## ------------ ##
792
793 EOF
794
795 # Keep a trace of the command line.
796 # Strip out --no-create and --no-recursion so they do not pile up.
797 # Also quote any args containing shell meta-characters.
798 ac_configure_args=
799 ac_sep=
800 for ac_arg
801 do
802   case $ac_arg in
803   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
804   | --no-cr | --no-c) ;;
805   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
806   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
807   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
808     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
809     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
810     ac_sep=" " ;;
811   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
812      ac_sep=" " ;;
813   esac
814   # Get rid of the leading space.
815 done
816
817 # When interrupted or exit'd, cleanup temporary files, and complete
818 # config.log.  We remove comments because anyway the quotes in there
819 # would cause problems or look ugly.
820 trap 'exit_status=$?
821   # Save into config.log some information that might help in debugging.
822   echo >&5
823   echo "## ----------------- ##" >&5
824   echo "## Cache variables.  ##" >&5
825   echo "## ----------------- ##" >&5
826   echo >&5
827   # The following way of writing the cache mishandles newlines in values,
828 {
829   (set) 2>&1 |
830     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
831     *ac_space=\ *)
832       sed -n \
833         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
834           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
835       ;;
836     *)
837       sed -n \
838         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
839       ;;
840     esac;
841 } >&5
842   sed "/^$/d" confdefs.h >conftest.log
843   if test -s conftest.log; then
844     echo >&5
845     echo "## ------------ ##" >&5
846     echo "## confdefs.h.  ##" >&5
847     echo "## ------------ ##" >&5
848     echo >&5
849     cat conftest.log >&5
850   fi
851   (echo; echo) >&5
852   test "$ac_signal" != 0 &&
853     echo "$as_me: caught signal $ac_signal" >&5
854   echo "$as_me: exit $exit_status" >&5
855   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
856     exit $exit_status
857      ' 0
858 for ac_signal in 1 2 13 15; do
859   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
860 done
861 ac_signal=0
862
863 # confdefs.h avoids OS command line length limits that DEFS can exceed.
864 rm -rf conftest* confdefs.h
865 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
866 echo >confdefs.h
867
868 # Let the site file select an alternate cache file if it wants to.
869 # Prefer explicitly selected file to automatically selected ones.
870 if test -z "$CONFIG_SITE"; then
871   if test "x$prefix" != xNONE; then
872     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
873   else
874     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
875   fi
876 fi
877 for ac_site_file in $CONFIG_SITE; do
878   if test -r "$ac_site_file"; then
879     { echo "$as_me:879: loading site script $ac_site_file" >&5
880 echo "$as_me: loading site script $ac_site_file" >&6;}
881     cat "$ac_site_file" >&5
882     . "$ac_site_file"
883   fi
884 done
885
886 if test -r "$cache_file"; then
887   # Some versions of bash will fail to source /dev/null (special
888   # files actually), so we avoid doing that.
889   if test -f "$cache_file"; then
890     { echo "$as_me:890: loading cache $cache_file" >&5
891 echo "$as_me: loading cache $cache_file" >&6;}
892     case $cache_file in
893       [\\/]* | ?:[\\/]* ) . $cache_file;;
894       *)                      . ./$cache_file;;
895     esac
896   fi
897 else
898   { echo "$as_me:898: creating cache $cache_file" >&5
899 echo "$as_me: creating cache $cache_file" >&6;}
900   >$cache_file
901 fi
902
903 # Check that the precious variables saved in the cache have kept the same
904 # value.
905 ac_cache_corrupted=false
906 for ac_var in `(set) 2>&1 |
907                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
908   eval ac_old_set=\$ac_cv_env_${ac_var}_set
909   eval ac_new_set=\$ac_env_${ac_var}_set
910   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
911   eval ac_new_val="\$ac_env_${ac_var}_value"
912   case $ac_old_set,$ac_new_set in
913     set,)
914       { echo "$as_me:914: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
915 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
916       ac_cache_corrupted=: ;;
917     ,set)
918       { echo "$as_me:918: error: \`$ac_var' was not set in the previous run" >&5
919 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
920       ac_cache_corrupted=: ;;
921     ,);;
922     *)
923       if test "x$ac_old_val" != "x$ac_new_val"; then
924         { echo "$as_me:924: error: \`$ac_var' has changed since the previous run:" >&5
925 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
926         { echo "$as_me:926:   former value:  $ac_old_val" >&5
927 echo "$as_me:   former value:  $ac_old_val" >&2;}
928         { echo "$as_me:928:   current value: $ac_new_val" >&5
929 echo "$as_me:   current value: $ac_new_val" >&2;}
930         ac_cache_corrupted=:
931       fi;;
932   esac
933   # Pass precious variables to config.status.  It doesn't matter if
934   # we pass some twice (in addition to the command line arguments).
935   if test "$ac_new_set" = set; then
936     case $ac_new_val in
937     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
938       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
939       ac_configure_args="$ac_configure_args '$ac_arg'"
940       ;;
941     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
942        ;;
943     esac
944   fi
945 done
946 if $ac_cache_corrupted; then
947   { echo "$as_me:947: error: changes in the environment can compromise the build" >&5
948 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
949   { { echo "$as_me:949: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
950 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
951    { (exit 1); exit 1; }; }
952 fi
953
954 ac_ext=c
955 ac_cpp='$CPP $CPPFLAGS'
956 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
957 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
958 ac_compiler_gnu=$ac_cv_c_compiler_gnu
959 ac_main_return=return
960
961 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
962   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
963                    ECHO_T='     ' ;;
964   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
965   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
966 esac
967 echo "#! $SHELL" >conftest.sh
968 echo  "exit 0"   >>conftest.sh
969 chmod +x conftest.sh
970 if { (echo "$as_me:970: PATH=\".;.\"; conftest.sh") >&5
971   (PATH=".;."; conftest.sh) 2>&5
972   ac_status=$?
973   echo "$as_me:973: \$? = $ac_status" >&5
974   (exit $ac_status); }; then
975   ac_path_separator=';'
976 else
977   ac_path_separator=:
978 fi
979 PATH_SEPARATOR="$ac_path_separator"
980 rm -f conftest.sh
981
982 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
983
984 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
985
986 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
987
988 ac_aux_dir=
989 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
990   if test -f $ac_dir/install-sh; then
991     ac_aux_dir=$ac_dir
992     ac_install_sh="$ac_aux_dir/install-sh -c"
993     break
994   elif test -f $ac_dir/install.sh; then
995     ac_aux_dir=$ac_dir
996     ac_install_sh="$ac_aux_dir/install.sh -c"
997     break
998   elif test -f $ac_dir/shtool; then
999     ac_aux_dir=$ac_dir
1000     ac_install_sh="$ac_aux_dir/shtool install -c"
1001     break
1002   fi
1003 done
1004 if test -z "$ac_aux_dir"; then
1005   { { echo "$as_me:1005: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1006 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1007    { (exit 1); exit 1; }; }
1008 fi
1009 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1010 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1011 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1012
1013 # Make sure we can run config.sub.
1014 $ac_config_sub sun4 >/dev/null 2>&1 ||
1015   { { echo "$as_me:1015: error: cannot run $ac_config_sub" >&5
1016 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1017    { (exit 1); exit 1; }; }
1018
1019 echo "$as_me:1019: checking build system type" >&5
1020 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1021 if test "${ac_cv_build+set}" = set; then
1022   echo $ECHO_N "(cached) $ECHO_C" >&6
1023 else
1024   ac_cv_build_alias=$build_alias
1025 test -z "$ac_cv_build_alias" &&
1026   ac_cv_build_alias=`$ac_config_guess`
1027 test -z "$ac_cv_build_alias" &&
1028   { { echo "$as_me:1028: error: cannot guess build type; you must specify one" >&5
1029 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1030    { (exit 1); exit 1; }; }
1031 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1032   { { echo "$as_me:1032: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1033 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1034    { (exit 1); exit 1; }; }
1035
1036 fi
1037 echo "$as_me:1037: result: $ac_cv_build" >&5
1038 echo "${ECHO_T}$ac_cv_build" >&6
1039 build=$ac_cv_build
1040 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1041 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1042 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1043
1044 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1045         echo "$as_me:1045: checking host system type" >&5
1046 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1047 if test "${ac_cv_host+set}" = set; then
1048   echo $ECHO_N "(cached) $ECHO_C" >&6
1049 else
1050   ac_cv_host_alias=$host_alias
1051 test -z "$ac_cv_host_alias" &&
1052   ac_cv_host_alias=$ac_cv_build_alias
1053 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1054   { { echo "$as_me:1054: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1055 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1056    { (exit 1); exit 1; }; }
1057
1058 fi
1059 echo "$as_me:1059: result: $ac_cv_host" >&5
1060 echo "${ECHO_T}$ac_cv_host" >&6
1061 host=$ac_cv_host
1062 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1063 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1064 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1065
1066         system_name="$host_os"
1067 else
1068         system_name="`(uname -s -r) 2>/dev/null`"
1069         if test -z "$system_name" ; then
1070                 system_name="`(hostname) 2>/dev/null`"
1071         fi
1072 fi
1073 test -n "$system_name" &&
1074 cat >>confdefs.h <<EOF
1075 #define SYSTEM_NAME "$system_name"
1076 EOF
1077
1078 if test "${cf_cv_system_name+set}" = set; then
1079   echo $ECHO_N "(cached) $ECHO_C" >&6
1080 else
1081   cf_cv_system_name="$system_name"
1082 fi
1083
1084 test -z "$system_name" && system_name="$cf_cv_system_name"
1085 test -n "$cf_cv_system_name" && echo "$as_me:1085: result: Configuring for $cf_cv_system_name" >&5
1086 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1087
1088 if test ".$system_name" != ".$cf_cv_system_name" ; then
1089         echo "$as_me:1089: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1090 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1091         { { echo "$as_me:1091: error: \"Please remove config.cache and try again.\"" >&5
1092 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1093    { (exit 1); exit 1; }; }
1094 fi
1095
1096 test "$program_prefix" != NONE &&
1097   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1098 # Use a double $ so make ignores it.
1099 test "$program_suffix" != NONE &&
1100   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1101 # Double any \ or $.  echo might interpret backslashes.
1102 # By default was `s,x,x', remove it if useless.
1103 cat <<\_ACEOF >conftest.sed
1104 s/[\\$]/&&/g;s/;s,x,x,$//
1105 _ACEOF
1106 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1107 rm conftest.sed
1108
1109 echo "$as_me:1109: checking whether ${MAKE-make} sets \${MAKE}" >&5
1110 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1111 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1112 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1113   echo $ECHO_N "(cached) $ECHO_C" >&6
1114 else
1115   cat >conftest.make <<\EOF
1116 all:
1117         @echo 'ac_maketemp="${MAKE}"'
1118 EOF
1119 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1120 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1121 if test -n "$ac_maketemp"; then
1122   eval ac_cv_prog_make_${ac_make}_set=yes
1123 else
1124   eval ac_cv_prog_make_${ac_make}_set=no
1125 fi
1126 rm -f conftest.make
1127 fi
1128 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1129   echo "$as_me:1129: result: yes" >&5
1130 echo "${ECHO_T}yes" >&6
1131   SET_MAKE=
1132 else
1133   echo "$as_me:1133: result: no" >&5
1134 echo "${ECHO_T}no" >&6
1135   SET_MAKE="MAKE=${MAKE-make}"
1136 fi
1137
1138 ac_ext=c
1139 ac_cpp='$CPP $CPPFLAGS'
1140 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1141 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1142 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1143 ac_main_return=return
1144 if test -n "$ac_tool_prefix"; then
1145   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1146 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1147 echo "$as_me:1147: checking for $ac_word" >&5
1148 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1149 if test "${ac_cv_prog_CC+set}" = set; then
1150   echo $ECHO_N "(cached) $ECHO_C" >&6
1151 else
1152   if test -n "$CC"; then
1153   ac_cv_prog_CC="$CC" # Let the user override the test.
1154 else
1155   ac_save_IFS=$IFS; IFS=$ac_path_separator
1156 ac_dummy="$PATH"
1157 for ac_dir in $ac_dummy; do
1158   IFS=$ac_save_IFS
1159   test -z "$ac_dir" && ac_dir=.
1160   $as_executable_p "$ac_dir/$ac_word" || continue
1161 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1162 echo "$as_me:1162: found $ac_dir/$ac_word" >&5
1163 break
1164 done
1165
1166 fi
1167 fi
1168 CC=$ac_cv_prog_CC
1169 if test -n "$CC"; then
1170   echo "$as_me:1170: result: $CC" >&5
1171 echo "${ECHO_T}$CC" >&6
1172 else
1173   echo "$as_me:1173: result: no" >&5
1174 echo "${ECHO_T}no" >&6
1175 fi
1176
1177 fi
1178 if test -z "$ac_cv_prog_CC"; then
1179   ac_ct_CC=$CC
1180   # Extract the first word of "gcc", so it can be a program name with args.
1181 set dummy gcc; ac_word=$2
1182 echo "$as_me:1182: checking for $ac_word" >&5
1183 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1184 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1185   echo $ECHO_N "(cached) $ECHO_C" >&6
1186 else
1187   if test -n "$ac_ct_CC"; then
1188   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1189 else
1190   ac_save_IFS=$IFS; IFS=$ac_path_separator
1191 ac_dummy="$PATH"
1192 for ac_dir in $ac_dummy; do
1193   IFS=$ac_save_IFS
1194   test -z "$ac_dir" && ac_dir=.
1195   $as_executable_p "$ac_dir/$ac_word" || continue
1196 ac_cv_prog_ac_ct_CC="gcc"
1197 echo "$as_me:1197: found $ac_dir/$ac_word" >&5
1198 break
1199 done
1200
1201 fi
1202 fi
1203 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1204 if test -n "$ac_ct_CC"; then
1205   echo "$as_me:1205: result: $ac_ct_CC" >&5
1206 echo "${ECHO_T}$ac_ct_CC" >&6
1207 else
1208   echo "$as_me:1208: result: no" >&5
1209 echo "${ECHO_T}no" >&6
1210 fi
1211
1212   CC=$ac_ct_CC
1213 else
1214   CC="$ac_cv_prog_CC"
1215 fi
1216
1217 if test -z "$CC"; then
1218   if test -n "$ac_tool_prefix"; then
1219   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1220 set dummy ${ac_tool_prefix}cc; ac_word=$2
1221 echo "$as_me:1221: checking for $ac_word" >&5
1222 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1223 if test "${ac_cv_prog_CC+set}" = set; then
1224   echo $ECHO_N "(cached) $ECHO_C" >&6
1225 else
1226   if test -n "$CC"; then
1227   ac_cv_prog_CC="$CC" # Let the user override the test.
1228 else
1229   ac_save_IFS=$IFS; IFS=$ac_path_separator
1230 ac_dummy="$PATH"
1231 for ac_dir in $ac_dummy; do
1232   IFS=$ac_save_IFS
1233   test -z "$ac_dir" && ac_dir=.
1234   $as_executable_p "$ac_dir/$ac_word" || continue
1235 ac_cv_prog_CC="${ac_tool_prefix}cc"
1236 echo "$as_me:1236: found $ac_dir/$ac_word" >&5
1237 break
1238 done
1239
1240 fi
1241 fi
1242 CC=$ac_cv_prog_CC
1243 if test -n "$CC"; then
1244   echo "$as_me:1244: result: $CC" >&5
1245 echo "${ECHO_T}$CC" >&6
1246 else
1247   echo "$as_me:1247: result: no" >&5
1248 echo "${ECHO_T}no" >&6
1249 fi
1250
1251 fi
1252 if test -z "$ac_cv_prog_CC"; then
1253   ac_ct_CC=$CC
1254   # Extract the first word of "cc", so it can be a program name with args.
1255 set dummy cc; ac_word=$2
1256 echo "$as_me:1256: checking for $ac_word" >&5
1257 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1258 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1259   echo $ECHO_N "(cached) $ECHO_C" >&6
1260 else
1261   if test -n "$ac_ct_CC"; then
1262   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1263 else
1264   ac_save_IFS=$IFS; IFS=$ac_path_separator
1265 ac_dummy="$PATH"
1266 for ac_dir in $ac_dummy; do
1267   IFS=$ac_save_IFS
1268   test -z "$ac_dir" && ac_dir=.
1269   $as_executable_p "$ac_dir/$ac_word" || continue
1270 ac_cv_prog_ac_ct_CC="cc"
1271 echo "$as_me:1271: found $ac_dir/$ac_word" >&5
1272 break
1273 done
1274
1275 fi
1276 fi
1277 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1278 if test -n "$ac_ct_CC"; then
1279   echo "$as_me:1279: result: $ac_ct_CC" >&5
1280 echo "${ECHO_T}$ac_ct_CC" >&6
1281 else
1282   echo "$as_me:1282: result: no" >&5
1283 echo "${ECHO_T}no" >&6
1284 fi
1285
1286   CC=$ac_ct_CC
1287 else
1288   CC="$ac_cv_prog_CC"
1289 fi
1290
1291 fi
1292 if test -z "$CC"; then
1293   # Extract the first word of "cc", so it can be a program name with args.
1294 set dummy cc; ac_word=$2
1295 echo "$as_me:1295: checking for $ac_word" >&5
1296 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1297 if test "${ac_cv_prog_CC+set}" = set; then
1298   echo $ECHO_N "(cached) $ECHO_C" >&6
1299 else
1300   if test -n "$CC"; then
1301   ac_cv_prog_CC="$CC" # Let the user override the test.
1302 else
1303   ac_prog_rejected=no
1304   ac_save_IFS=$IFS; IFS=$ac_path_separator
1305 ac_dummy="$PATH"
1306 for ac_dir in $ac_dummy; do
1307   IFS=$ac_save_IFS
1308   test -z "$ac_dir" && ac_dir=.
1309   $as_executable_p "$ac_dir/$ac_word" || continue
1310 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1311   ac_prog_rejected=yes
1312   continue
1313 fi
1314 ac_cv_prog_CC="cc"
1315 echo "$as_me:1315: found $ac_dir/$ac_word" >&5
1316 break
1317 done
1318
1319 if test $ac_prog_rejected = yes; then
1320   # We found a bogon in the path, so make sure we never use it.
1321   set dummy $ac_cv_prog_CC
1322   shift
1323   if test $# != 0; then
1324     # We chose a different compiler from the bogus one.
1325     # However, it has the same basename, so the bogon will be chosen
1326     # first if we set CC to just the basename; use the full file name.
1327     shift
1328     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1329     shift
1330     ac_cv_prog_CC="$@"
1331   fi
1332 fi
1333 fi
1334 fi
1335 CC=$ac_cv_prog_CC
1336 if test -n "$CC"; then
1337   echo "$as_me:1337: result: $CC" >&5
1338 echo "${ECHO_T}$CC" >&6
1339 else
1340   echo "$as_me:1340: result: no" >&5
1341 echo "${ECHO_T}no" >&6
1342 fi
1343
1344 fi
1345 if test -z "$CC"; then
1346   if test -n "$ac_tool_prefix"; then
1347   for ac_prog in cl
1348   do
1349     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1350 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1351 echo "$as_me:1351: checking for $ac_word" >&5
1352 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1353 if test "${ac_cv_prog_CC+set}" = set; then
1354   echo $ECHO_N "(cached) $ECHO_C" >&6
1355 else
1356   if test -n "$CC"; then
1357   ac_cv_prog_CC="$CC" # Let the user override the test.
1358 else
1359   ac_save_IFS=$IFS; IFS=$ac_path_separator
1360 ac_dummy="$PATH"
1361 for ac_dir in $ac_dummy; do
1362   IFS=$ac_save_IFS
1363   test -z "$ac_dir" && ac_dir=.
1364   $as_executable_p "$ac_dir/$ac_word" || continue
1365 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1366 echo "$as_me:1366: found $ac_dir/$ac_word" >&5
1367 break
1368 done
1369
1370 fi
1371 fi
1372 CC=$ac_cv_prog_CC
1373 if test -n "$CC"; then
1374   echo "$as_me:1374: result: $CC" >&5
1375 echo "${ECHO_T}$CC" >&6
1376 else
1377   echo "$as_me:1377: result: no" >&5
1378 echo "${ECHO_T}no" >&6
1379 fi
1380
1381     test -n "$CC" && break
1382   done
1383 fi
1384 if test -z "$CC"; then
1385   ac_ct_CC=$CC
1386   for ac_prog in cl
1387 do
1388   # Extract the first word of "$ac_prog", so it can be a program name with args.
1389 set dummy $ac_prog; ac_word=$2
1390 echo "$as_me:1390: checking for $ac_word" >&5
1391 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1392 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1393   echo $ECHO_N "(cached) $ECHO_C" >&6
1394 else
1395   if test -n "$ac_ct_CC"; then
1396   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1397 else
1398   ac_save_IFS=$IFS; IFS=$ac_path_separator
1399 ac_dummy="$PATH"
1400 for ac_dir in $ac_dummy; do
1401   IFS=$ac_save_IFS
1402   test -z "$ac_dir" && ac_dir=.
1403   $as_executable_p "$ac_dir/$ac_word" || continue
1404 ac_cv_prog_ac_ct_CC="$ac_prog"
1405 echo "$as_me:1405: found $ac_dir/$ac_word" >&5
1406 break
1407 done
1408
1409 fi
1410 fi
1411 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1412 if test -n "$ac_ct_CC"; then
1413   echo "$as_me:1413: result: $ac_ct_CC" >&5
1414 echo "${ECHO_T}$ac_ct_CC" >&6
1415 else
1416   echo "$as_me:1416: result: no" >&5
1417 echo "${ECHO_T}no" >&6
1418 fi
1419
1420   test -n "$ac_ct_CC" && break
1421 done
1422
1423   CC=$ac_ct_CC
1424 fi
1425
1426 fi
1427
1428 test -z "$CC" && { { echo "$as_me:1428: error: no acceptable cc found in \$PATH" >&5
1429 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1430    { (exit 1); exit 1; }; }
1431
1432 # Provide some information about the compiler.
1433 echo "$as_me:1433:" \
1434      "checking for C compiler version" >&5
1435 ac_compiler=`set X $ac_compile; echo $2`
1436 { (eval echo "$as_me:1436: \"$ac_compiler --version </dev/null >&5\"") >&5
1437   (eval $ac_compiler --version </dev/null >&5) 2>&5
1438   ac_status=$?
1439   echo "$as_me:1439: \$? = $ac_status" >&5
1440   (exit $ac_status); }
1441 { (eval echo "$as_me:1441: \"$ac_compiler -v </dev/null >&5\"") >&5
1442   (eval $ac_compiler -v </dev/null >&5) 2>&5
1443   ac_status=$?
1444   echo "$as_me:1444: \$? = $ac_status" >&5
1445   (exit $ac_status); }
1446 { (eval echo "$as_me:1446: \"$ac_compiler -V </dev/null >&5\"") >&5
1447   (eval $ac_compiler -V </dev/null >&5) 2>&5
1448   ac_status=$?
1449   echo "$as_me:1449: \$? = $ac_status" >&5
1450   (exit $ac_status); }
1451
1452 cat >conftest.$ac_ext <<_ACEOF
1453 #line 1453 "configure"
1454 #include "confdefs.h"
1455
1456 int
1457 main (void)
1458 {
1459
1460   ;
1461   return 0;
1462 }
1463 _ACEOF
1464 ac_clean_files_save=$ac_clean_files
1465 ac_clean_files="$ac_clean_files a.out a.exe"
1466 # Try to create an executable without -o first, disregard a.out.
1467 # It will help us diagnose broken compilers, and finding out an intuition
1468 # of exeext.
1469 echo "$as_me:1469: checking for C compiler default output" >&5
1470 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1471 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1472 if { (eval echo "$as_me:1472: \"$ac_link_default\"") >&5
1473   (eval $ac_link_default) 2>&5
1474   ac_status=$?
1475   echo "$as_me:1475: \$? = $ac_status" >&5
1476   (exit $ac_status); }; then
1477   # Find the output, starting from the most likely.  This scheme is
1478 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1479 # resort.
1480 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1481                 ls a.out conftest 2>/dev/null;
1482                 ls a.* conftest.* 2>/dev/null`; do
1483   case $ac_file in
1484     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1485     a.out ) # We found the default executable, but exeext='' is most
1486             # certainly right.
1487             break;;
1488     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1489           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1490           export ac_cv_exeext
1491           break;;
1492     * ) break;;
1493   esac
1494 done
1495 else
1496   echo "$as_me: failed program was:" >&5
1497 cat conftest.$ac_ext >&5
1498 { { echo "$as_me:1498: error: C compiler cannot create executables" >&5
1499 echo "$as_me: error: C compiler cannot create executables" >&2;}
1500    { (exit 77); exit 77; }; }
1501 fi
1502
1503 ac_exeext=$ac_cv_exeext
1504 echo "$as_me:1504: result: $ac_file" >&5
1505 echo "${ECHO_T}$ac_file" >&6
1506
1507 # Check the compiler produces executables we can run.  If not, either
1508 # the compiler is broken, or we cross compile.
1509 echo "$as_me:1509: checking whether the C compiler works" >&5
1510 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1511 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1512 # If not cross compiling, check that we can run a simple program.
1513 if test "$cross_compiling" != yes; then
1514   if { ac_try='./$ac_file'
1515   { (eval echo "$as_me:1515: \"$ac_try\"") >&5
1516   (eval $ac_try) 2>&5
1517   ac_status=$?
1518   echo "$as_me:1518: \$? = $ac_status" >&5
1519   (exit $ac_status); }; }; then
1520     cross_compiling=no
1521   else
1522     if test "$cross_compiling" = maybe; then
1523         cross_compiling=yes
1524     else
1525         { { echo "$as_me:1525: error: cannot run C compiled programs.
1526 If you meant to cross compile, use \`--host'." >&5
1527 echo "$as_me: error: cannot run C compiled programs.
1528 If you meant to cross compile, use \`--host'." >&2;}
1529    { (exit 1); exit 1; }; }
1530     fi
1531   fi
1532 fi
1533 echo "$as_me:1533: result: yes" >&5
1534 echo "${ECHO_T}yes" >&6
1535
1536 rm -f a.out a.exe conftest$ac_cv_exeext
1537 ac_clean_files=$ac_clean_files_save
1538 # Check the compiler produces executables we can run.  If not, either
1539 # the compiler is broken, or we cross compile.
1540 echo "$as_me:1540: checking whether we are cross compiling" >&5
1541 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1542 echo "$as_me:1542: result: $cross_compiling" >&5
1543 echo "${ECHO_T}$cross_compiling" >&6
1544
1545 echo "$as_me:1545: checking for executable suffix" >&5
1546 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1547 if { (eval echo "$as_me:1547: \"$ac_link\"") >&5
1548   (eval $ac_link) 2>&5
1549   ac_status=$?
1550   echo "$as_me:1550: \$? = $ac_status" >&5
1551   (exit $ac_status); }; then
1552   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1553 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1554 # work properly (i.e., refer to `conftest.exe'), while it won't with
1555 # `rm'.
1556 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1557   case $ac_file in
1558     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1559     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1560           export ac_cv_exeext
1561           break;;
1562     * ) break;;
1563   esac
1564 done
1565 else
1566   { { echo "$as_me:1566: error: cannot compute EXEEXT: cannot compile and link" >&5
1567 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1568    { (exit 1); exit 1; }; }
1569 fi
1570
1571 rm -f conftest$ac_cv_exeext
1572 echo "$as_me:1572: result: $ac_cv_exeext" >&5
1573 echo "${ECHO_T}$ac_cv_exeext" >&6
1574
1575 rm -f conftest.$ac_ext
1576 EXEEXT=$ac_cv_exeext
1577 ac_exeext=$EXEEXT
1578 echo "$as_me:1578: checking for object suffix" >&5
1579 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1580 if test "${ac_cv_objext+set}" = set; then
1581   echo $ECHO_N "(cached) $ECHO_C" >&6
1582 else
1583   cat >conftest.$ac_ext <<_ACEOF
1584 #line 1584 "configure"
1585 #include "confdefs.h"
1586
1587 int
1588 main (void)
1589 {
1590
1591   ;
1592   return 0;
1593 }
1594 _ACEOF
1595 rm -f conftest.o conftest.obj
1596 if { (eval echo "$as_me:1596: \"$ac_compile\"") >&5
1597   (eval $ac_compile) 2>&5
1598   ac_status=$?
1599   echo "$as_me:1599: \$? = $ac_status" >&5
1600   (exit $ac_status); }; then
1601   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1602   case $ac_file in
1603     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1604     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1605        break;;
1606   esac
1607 done
1608 else
1609   echo "$as_me: failed program was:" >&5
1610 cat conftest.$ac_ext >&5
1611 { { echo "$as_me:1611: error: cannot compute OBJEXT: cannot compile" >&5
1612 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1613    { (exit 1); exit 1; }; }
1614 fi
1615
1616 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1617 fi
1618 echo "$as_me:1618: result: $ac_cv_objext" >&5
1619 echo "${ECHO_T}$ac_cv_objext" >&6
1620 OBJEXT=$ac_cv_objext
1621 ac_objext=$OBJEXT
1622 echo "$as_me:1622: checking whether we are using the GNU C compiler" >&5
1623 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1624 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1625   echo $ECHO_N "(cached) $ECHO_C" >&6
1626 else
1627   cat >conftest.$ac_ext <<_ACEOF
1628 #line 1628 "configure"
1629 #include "confdefs.h"
1630
1631 int
1632 main (void)
1633 {
1634 #ifndef __GNUC__
1635        choke me
1636 #endif
1637
1638   ;
1639   return 0;
1640 }
1641 _ACEOF
1642 rm -f conftest.$ac_objext
1643 if { (eval echo "$as_me:1643: \"$ac_compile\"") >&5
1644   (eval $ac_compile) 2>&5
1645   ac_status=$?
1646   echo "$as_me:1646: \$? = $ac_status" >&5
1647   (exit $ac_status); } &&
1648          { ac_try='test -s conftest.$ac_objext'
1649   { (eval echo "$as_me:1649: \"$ac_try\"") >&5
1650   (eval $ac_try) 2>&5
1651   ac_status=$?
1652   echo "$as_me:1652: \$? = $ac_status" >&5
1653   (exit $ac_status); }; }; then
1654   ac_compiler_gnu=yes
1655 else
1656   echo "$as_me: failed program was:" >&5
1657 cat conftest.$ac_ext >&5
1658 ac_compiler_gnu=no
1659 fi
1660 rm -f conftest.$ac_objext conftest.$ac_ext
1661 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1662
1663 fi
1664 echo "$as_me:1664: result: $ac_cv_c_compiler_gnu" >&5
1665 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1666 GCC=`test $ac_compiler_gnu = yes && echo yes`
1667 ac_test_CFLAGS=${CFLAGS+set}
1668 ac_save_CFLAGS=$CFLAGS
1669 CFLAGS="-g"
1670 echo "$as_me:1670: checking whether $CC accepts -g" >&5
1671 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1672 if test "${ac_cv_prog_cc_g+set}" = set; then
1673   echo $ECHO_N "(cached) $ECHO_C" >&6
1674 else
1675   cat >conftest.$ac_ext <<_ACEOF
1676 #line 1676 "configure"
1677 #include "confdefs.h"
1678
1679 int
1680 main (void)
1681 {
1682
1683   ;
1684   return 0;
1685 }
1686 _ACEOF
1687 rm -f conftest.$ac_objext
1688 if { (eval echo "$as_me:1688: \"$ac_compile\"") >&5
1689   (eval $ac_compile) 2>&5
1690   ac_status=$?
1691   echo "$as_me:1691: \$? = $ac_status" >&5
1692   (exit $ac_status); } &&
1693          { ac_try='test -s conftest.$ac_objext'
1694   { (eval echo "$as_me:1694: \"$ac_try\"") >&5
1695   (eval $ac_try) 2>&5
1696   ac_status=$?
1697   echo "$as_me:1697: \$? = $ac_status" >&5
1698   (exit $ac_status); }; }; then
1699   ac_cv_prog_cc_g=yes
1700 else
1701   echo "$as_me: failed program was:" >&5
1702 cat conftest.$ac_ext >&5
1703 ac_cv_prog_cc_g=no
1704 fi
1705 rm -f conftest.$ac_objext conftest.$ac_ext
1706 fi
1707 echo "$as_me:1707: result: $ac_cv_prog_cc_g" >&5
1708 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1709 if test "$ac_test_CFLAGS" = set; then
1710   CFLAGS=$ac_save_CFLAGS
1711 elif test $ac_cv_prog_cc_g = yes; then
1712   if test "$GCC" = yes; then
1713     CFLAGS="-g -O2"
1714   else
1715     CFLAGS="-g"
1716   fi
1717 else
1718   if test "$GCC" = yes; then
1719     CFLAGS="-O2"
1720   else
1721     CFLAGS=
1722   fi
1723 fi
1724 # Some people use a C++ compiler to compile C.  Since we use `exit',
1725 # in C++ we need to declare it.  In case someone uses the same compiler
1726 # for both compiling C and C++ we need to have the C++ compiler decide
1727 # the declaration of exit, since it's the most demanding environment.
1728 cat >conftest.$ac_ext <<_ACEOF
1729 #ifndef __cplusplus
1730   choke me
1731 #endif
1732 _ACEOF
1733 rm -f conftest.$ac_objext
1734 if { (eval echo "$as_me:1734: \"$ac_compile\"") >&5
1735   (eval $ac_compile) 2>&5
1736   ac_status=$?
1737   echo "$as_me:1737: \$? = $ac_status" >&5
1738   (exit $ac_status); } &&
1739          { ac_try='test -s conftest.$ac_objext'
1740   { (eval echo "$as_me:1740: \"$ac_try\"") >&5
1741   (eval $ac_try) 2>&5
1742   ac_status=$?
1743   echo "$as_me:1743: \$? = $ac_status" >&5
1744   (exit $ac_status); }; }; then
1745   for ac_declaration in \
1746    ''\
1747    '#include <stdlib.h>' \
1748    'extern "C" void std::exit (int) throw (); using std::exit;' \
1749    'extern "C" void std::exit (int); using std::exit;' \
1750    'extern "C" void exit (int) throw ();' \
1751    'extern "C" void exit (int);' \
1752    'void exit (int);'
1753 do
1754   cat >conftest.$ac_ext <<_ACEOF
1755 #line 1755 "configure"
1756 #include "confdefs.h"
1757 #include <stdlib.h>
1758 $ac_declaration
1759 int
1760 main (void)
1761 {
1762 exit (42);
1763   ;
1764   return 0;
1765 }
1766 _ACEOF
1767 rm -f conftest.$ac_objext
1768 if { (eval echo "$as_me:1768: \"$ac_compile\"") >&5
1769   (eval $ac_compile) 2>&5
1770   ac_status=$?
1771   echo "$as_me:1771: \$? = $ac_status" >&5
1772   (exit $ac_status); } &&
1773          { ac_try='test -s conftest.$ac_objext'
1774   { (eval echo "$as_me:1774: \"$ac_try\"") >&5
1775   (eval $ac_try) 2>&5
1776   ac_status=$?
1777   echo "$as_me:1777: \$? = $ac_status" >&5
1778   (exit $ac_status); }; }; then
1779   :
1780 else
1781   echo "$as_me: failed program was:" >&5
1782 cat conftest.$ac_ext >&5
1783 continue
1784 fi
1785 rm -f conftest.$ac_objext conftest.$ac_ext
1786   cat >conftest.$ac_ext <<_ACEOF
1787 #line 1787 "configure"
1788 #include "confdefs.h"
1789 $ac_declaration
1790 int
1791 main (void)
1792 {
1793 exit (42);
1794   ;
1795   return 0;
1796 }
1797 _ACEOF
1798 rm -f conftest.$ac_objext
1799 if { (eval echo "$as_me:1799: \"$ac_compile\"") >&5
1800   (eval $ac_compile) 2>&5
1801   ac_status=$?
1802   echo "$as_me:1802: \$? = $ac_status" >&5
1803   (exit $ac_status); } &&
1804          { ac_try='test -s conftest.$ac_objext'
1805   { (eval echo "$as_me:1805: \"$ac_try\"") >&5
1806   (eval $ac_try) 2>&5
1807   ac_status=$?
1808   echo "$as_me:1808: \$? = $ac_status" >&5
1809   (exit $ac_status); }; }; then
1810   break
1811 else
1812   echo "$as_me: failed program was:" >&5
1813 cat conftest.$ac_ext >&5
1814 fi
1815 rm -f conftest.$ac_objext conftest.$ac_ext
1816 done
1817 rm -rf conftest*
1818 if test -n "$ac_declaration"; then
1819   echo '#ifdef __cplusplus' >>confdefs.h
1820   echo $ac_declaration      >>confdefs.h
1821   echo '#endif'             >>confdefs.h
1822 fi
1823
1824 else
1825   echo "$as_me: failed program was:" >&5
1826 cat conftest.$ac_ext >&5
1827 fi
1828 rm -f conftest.$ac_objext conftest.$ac_ext
1829 ac_ext=c
1830 ac_cpp='$CPP $CPPFLAGS'
1831 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1832 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1833 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1834 ac_main_return=return
1835
1836 GCC_VERSION=none
1837 if test "$GCC" = yes ; then
1838         echo "$as_me:1838: checking version of $CC" >&5
1839 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1840         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.].*//'`"
1841         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1842         echo "$as_me:1842: result: $GCC_VERSION" >&5
1843 echo "${ECHO_T}$GCC_VERSION" >&6
1844 fi
1845
1846 echo "$as_me:1846: checking for $CC option to accept ANSI C" >&5
1847 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1848 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1849   echo $ECHO_N "(cached) $ECHO_C" >&6
1850 else
1851   ac_cv_prog_cc_stdc=no
1852 ac_save_CC=$CC
1853 cat >conftest.$ac_ext <<_ACEOF
1854 #line 1854 "configure"
1855 #include "confdefs.h"
1856 #include <stdarg.h>
1857 #include <stdio.h>
1858 #include <sys/types.h>
1859 #include <sys/stat.h>
1860 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1861 struct buf { int x; };
1862 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1863 static char *e (p, i)
1864      char **p;
1865      int i;
1866 {
1867   return p[i];
1868 }
1869 static char *f (char * (*g) (char **, int), char **p, ...)
1870 {
1871   char *s;
1872   va_list v;
1873   va_start (v,p);
1874   s = g (p, va_arg (v,int));
1875   va_end (v);
1876   return s;
1877 }
1878 int test (int i, double x);
1879 struct s1 {int (*f) (int a);};
1880 struct s2 {int (*f) (double a);};
1881 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1882 int argc;
1883 char **argv;
1884 int
1885 main (void)
1886 {
1887 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1888   ;
1889   return 0;
1890 }
1891 _ACEOF
1892 # Don't try gcc -ansi; that turns off useful extensions and
1893 # breaks some systems' header files.
1894 # AIX                   -qlanglvl=ansi
1895 # Ultrix and OSF/1      -std1
1896 # HP-UX 10.20 and later -Ae
1897 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1898 # SVR4                  -Xc -D__EXTENSIONS__
1899 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1900 do
1901   CC="$ac_save_CC $ac_arg"
1902   rm -f conftest.$ac_objext
1903 if { (eval echo "$as_me:1903: \"$ac_compile\"") >&5
1904   (eval $ac_compile) 2>&5
1905   ac_status=$?
1906   echo "$as_me:1906: \$? = $ac_status" >&5
1907   (exit $ac_status); } &&
1908          { ac_try='test -s conftest.$ac_objext'
1909   { (eval echo "$as_me:1909: \"$ac_try\"") >&5
1910   (eval $ac_try) 2>&5
1911   ac_status=$?
1912   echo "$as_me:1912: \$? = $ac_status" >&5
1913   (exit $ac_status); }; }; then
1914   ac_cv_prog_cc_stdc=$ac_arg
1915 break
1916 else
1917   echo "$as_me: failed program was:" >&5
1918 cat conftest.$ac_ext >&5
1919 fi
1920 rm -f conftest.$ac_objext
1921 done
1922 rm -f conftest.$ac_ext conftest.$ac_objext
1923 CC=$ac_save_CC
1924
1925 fi
1926
1927 case "x$ac_cv_prog_cc_stdc" in
1928   x|xno)
1929     echo "$as_me:1929: result: none needed" >&5
1930 echo "${ECHO_T}none needed" >&6 ;;
1931   *)
1932     echo "$as_me:1932: result: $ac_cv_prog_cc_stdc" >&5
1933 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1934     CC="$CC $ac_cv_prog_cc_stdc" ;;
1935 esac
1936
1937 # This should have been defined by AC_PROG_CC
1938 : ${CC:=cc}
1939
1940 echo "$as_me:1940: checking \$CC variable" >&5
1941 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1942 case "$CC" in
1943 (*[\ \  ]-*)
1944         echo "$as_me:1944: result: broken" >&5
1945 echo "${ECHO_T}broken" >&6
1946         { echo "$as_me:1946: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1947 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1948         # humor him...
1949         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1950         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1951         CC="$cf_prog"
1952         for cf_arg in $cf_flags
1953         do
1954                 case "x$cf_arg" in
1955                 (x-[IUDfgOW]*)
1956
1957 cf_fix_cppflags=no
1958 cf_new_cflags=
1959 cf_new_cppflags=
1960 cf_new_extra_cppflags=
1961
1962 for cf_add_cflags in $cf_arg
1963 do
1964 case $cf_fix_cppflags in
1965 (no)
1966         case $cf_add_cflags in
1967         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1968                 case $cf_add_cflags in
1969                 (-D*)
1970                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1971
1972                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1973                                 && test -z "${cf_tst_cflags}" \
1974                                 && cf_fix_cppflags=yes
1975
1976                         if test $cf_fix_cppflags = yes ; then
1977
1978         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1979         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1980
1981                                 continue
1982                         elif test "${cf_tst_cflags}" = "\"'" ; then
1983
1984         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1985         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1986
1987                                 continue
1988                         fi
1989                         ;;
1990                 esac
1991                 case "$CPPFLAGS" in
1992                 (*$cf_add_cflags)
1993                         ;;
1994                 (*)
1995                         case $cf_add_cflags in
1996                         (-D*)
1997                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1998
1999 CPPFLAGS=`echo "$CPPFLAGS" | \
2000         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2001                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2002
2003                                 ;;
2004                         esac
2005
2006         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2007         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2008
2009                         ;;
2010                 esac
2011                 ;;
2012         (*)
2013
2014         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2015         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2016
2017                 ;;
2018         esac
2019         ;;
2020 (yes)
2021
2022         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2023         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2024
2025         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2026
2027         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2028                 && test -z "${cf_tst_cflags}" \
2029                 && cf_fix_cppflags=no
2030         ;;
2031 esac
2032 done
2033
2034 if test -n "$cf_new_cflags" ; then
2035
2036         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2037         CFLAGS="${CFLAGS}$cf_new_cflags"
2038
2039 fi
2040
2041 if test -n "$cf_new_cppflags" ; then
2042
2043         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2044         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2045
2046 fi
2047
2048 if test -n "$cf_new_extra_cppflags" ; then
2049
2050         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2051         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2052
2053 fi
2054
2055                         ;;
2056                 (*)
2057                         CC="$CC $cf_arg"
2058                         ;;
2059                 esac
2060         done
2061         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2062
2063 echo "${as_me:-configure}:2063: testing resulting CC: '$CC' ..." 1>&5
2064
2065         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2066
2067 echo "${as_me:-configure}:2067: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2068
2069         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2070
2071 echo "${as_me:-configure}:2071: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2072
2073         ;;
2074 (*)
2075         echo "$as_me:2075: result: ok" >&5
2076 echo "${ECHO_T}ok" >&6
2077         ;;
2078 esac
2079
2080 ac_ext=c
2081 ac_cpp='$CPP $CPPFLAGS'
2082 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2083 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2084 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2085 ac_main_return=return
2086 echo "$as_me:2086: checking how to run the C preprocessor" >&5
2087 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2088 # On Suns, sometimes $CPP names a directory.
2089 if test -n "$CPP" && test -d "$CPP"; then
2090   CPP=
2091 fi
2092 if test -z "$CPP"; then
2093   if test "${ac_cv_prog_CPP+set}" = set; then
2094   echo $ECHO_N "(cached) $ECHO_C" >&6
2095 else
2096       # Double quotes because CPP needs to be expanded
2097     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2098     do
2099       ac_preproc_ok=false
2100 for ac_c_preproc_warn_flag in '' yes
2101 do
2102   # Use a header file that comes with gcc, so configuring glibc
2103   # with a fresh cross-compiler works.
2104   # On the NeXT, cc -E runs the code through the compiler's parser,
2105   # not just through cpp. "Syntax error" is here to catch this case.
2106   cat >conftest.$ac_ext <<_ACEOF
2107 #line 2107 "configure"
2108 #include "confdefs.h"
2109 #include <assert.h>
2110                      Syntax error
2111 _ACEOF
2112 if { (eval echo "$as_me:2112: \"$ac_cpp conftest.$ac_ext\"") >&5
2113   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2114   ac_status=$?
2115   egrep -v '^ *\+' conftest.er1 >conftest.err
2116   rm -f conftest.er1
2117   cat conftest.err >&5
2118   echo "$as_me:2118: \$? = $ac_status" >&5
2119   (exit $ac_status); } >/dev/null; then
2120   if test -s conftest.err; then
2121     ac_cpp_err=$ac_c_preproc_warn_flag
2122   else
2123     ac_cpp_err=
2124   fi
2125 else
2126   ac_cpp_err=yes
2127 fi
2128 if test -z "$ac_cpp_err"; then
2129   :
2130 else
2131   echo "$as_me: failed program was:" >&5
2132   cat conftest.$ac_ext >&5
2133   # Broken: fails on valid input.
2134 continue
2135 fi
2136 rm -f conftest.err conftest.$ac_ext
2137
2138   # OK, works on sane cases.  Now check whether non-existent headers
2139   # can be detected and how.
2140   cat >conftest.$ac_ext <<_ACEOF
2141 #line 2141 "configure"
2142 #include "confdefs.h"
2143 #include <ac_nonexistent.h>
2144 _ACEOF
2145 if { (eval echo "$as_me:2145: \"$ac_cpp conftest.$ac_ext\"") >&5
2146   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2147   ac_status=$?
2148   egrep -v '^ *\+' conftest.er1 >conftest.err
2149   rm -f conftest.er1
2150   cat conftest.err >&5
2151   echo "$as_me:2151: \$? = $ac_status" >&5
2152   (exit $ac_status); } >/dev/null; then
2153   if test -s conftest.err; then
2154     ac_cpp_err=$ac_c_preproc_warn_flag
2155   else
2156     ac_cpp_err=
2157   fi
2158 else
2159   ac_cpp_err=yes
2160 fi
2161 if test -z "$ac_cpp_err"; then
2162   # Broken: success on invalid input.
2163 continue
2164 else
2165   echo "$as_me: failed program was:" >&5
2166   cat conftest.$ac_ext >&5
2167   # Passes both tests.
2168 ac_preproc_ok=:
2169 break
2170 fi
2171 rm -f conftest.err conftest.$ac_ext
2172
2173 done
2174 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2175 rm -f conftest.err conftest.$ac_ext
2176 if $ac_preproc_ok; then
2177   break
2178 fi
2179
2180     done
2181     ac_cv_prog_CPP=$CPP
2182
2183 fi
2184   CPP=$ac_cv_prog_CPP
2185 else
2186   ac_cv_prog_CPP=$CPP
2187 fi
2188 echo "$as_me:2188: result: $CPP" >&5
2189 echo "${ECHO_T}$CPP" >&6
2190 ac_preproc_ok=false
2191 for ac_c_preproc_warn_flag in '' yes
2192 do
2193   # Use a header file that comes with gcc, so configuring glibc
2194   # with a fresh cross-compiler works.
2195   # On the NeXT, cc -E runs the code through the compiler's parser,
2196   # not just through cpp. "Syntax error" is here to catch this case.
2197   cat >conftest.$ac_ext <<_ACEOF
2198 #line 2198 "configure"
2199 #include "confdefs.h"
2200 #include <assert.h>
2201                      Syntax error
2202 _ACEOF
2203 if { (eval echo "$as_me:2203: \"$ac_cpp conftest.$ac_ext\"") >&5
2204   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2205   ac_status=$?
2206   egrep -v '^ *\+' conftest.er1 >conftest.err
2207   rm -f conftest.er1
2208   cat conftest.err >&5
2209   echo "$as_me:2209: \$? = $ac_status" >&5
2210   (exit $ac_status); } >/dev/null; then
2211   if test -s conftest.err; then
2212     ac_cpp_err=$ac_c_preproc_warn_flag
2213   else
2214     ac_cpp_err=
2215   fi
2216 else
2217   ac_cpp_err=yes
2218 fi
2219 if test -z "$ac_cpp_err"; then
2220   :
2221 else
2222   echo "$as_me: failed program was:" >&5
2223   cat conftest.$ac_ext >&5
2224   # Broken: fails on valid input.
2225 continue
2226 fi
2227 rm -f conftest.err conftest.$ac_ext
2228
2229   # OK, works on sane cases.  Now check whether non-existent headers
2230   # can be detected and how.
2231   cat >conftest.$ac_ext <<_ACEOF
2232 #line 2232 "configure"
2233 #include "confdefs.h"
2234 #include <ac_nonexistent.h>
2235 _ACEOF
2236 if { (eval echo "$as_me:2236: \"$ac_cpp conftest.$ac_ext\"") >&5
2237   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2238   ac_status=$?
2239   egrep -v '^ *\+' conftest.er1 >conftest.err
2240   rm -f conftest.er1
2241   cat conftest.err >&5
2242   echo "$as_me:2242: \$? = $ac_status" >&5
2243   (exit $ac_status); } >/dev/null; then
2244   if test -s conftest.err; then
2245     ac_cpp_err=$ac_c_preproc_warn_flag
2246   else
2247     ac_cpp_err=
2248   fi
2249 else
2250   ac_cpp_err=yes
2251 fi
2252 if test -z "$ac_cpp_err"; then
2253   # Broken: success on invalid input.
2254 continue
2255 else
2256   echo "$as_me: failed program was:" >&5
2257   cat conftest.$ac_ext >&5
2258   # Passes both tests.
2259 ac_preproc_ok=:
2260 break
2261 fi
2262 rm -f conftest.err conftest.$ac_ext
2263
2264 done
2265 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2266 rm -f conftest.err conftest.$ac_ext
2267 if $ac_preproc_ok; then
2268   :
2269 else
2270   { { echo "$as_me:2270: error: C preprocessor \"$CPP\" fails sanity check" >&5
2271 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2272    { (exit 1); exit 1; }; }
2273 fi
2274
2275 ac_ext=c
2276 ac_cpp='$CPP $CPPFLAGS'
2277 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2278 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2279 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2280 ac_main_return=return
2281
2282 for ac_prog in mawk gawk nawk awk
2283 do
2284   # Extract the first word of "$ac_prog", so it can be a program name with args.
2285 set dummy $ac_prog; ac_word=$2
2286 echo "$as_me:2286: checking for $ac_word" >&5
2287 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2288 if test "${ac_cv_prog_AWK+set}" = set; then
2289   echo $ECHO_N "(cached) $ECHO_C" >&6
2290 else
2291   if test -n "$AWK"; then
2292   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2293 else
2294   ac_save_IFS=$IFS; IFS=$ac_path_separator
2295 ac_dummy="$PATH"
2296 for ac_dir in $ac_dummy; do
2297   IFS=$ac_save_IFS
2298   test -z "$ac_dir" && ac_dir=.
2299   $as_executable_p "$ac_dir/$ac_word" || continue
2300 ac_cv_prog_AWK="$ac_prog"
2301 echo "$as_me:2301: found $ac_dir/$ac_word" >&5
2302 break
2303 done
2304
2305 fi
2306 fi
2307 AWK=$ac_cv_prog_AWK
2308 if test -n "$AWK"; then
2309   echo "$as_me:2309: result: $AWK" >&5
2310 echo "${ECHO_T}$AWK" >&6
2311 else
2312   echo "$as_me:2312: result: no" >&5
2313 echo "${ECHO_T}no" >&6
2314 fi
2315
2316   test -n "$AWK" && break
2317 done
2318
2319 # Find a good install program.  We prefer a C program (faster),
2320 # so one script is as good as another.  But avoid the broken or
2321 # incompatible versions:
2322 # SysV /etc/install, /usr/sbin/install
2323 # SunOS /usr/etc/install
2324 # IRIX /sbin/install
2325 # AIX /bin/install
2326 # AmigaOS /C/install, which installs bootblocks on floppy discs
2327 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2328 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2329 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2330 # ./install, which can be erroneously created by make from ./install.sh.
2331 echo "$as_me:2331: checking for a BSD compatible install" >&5
2332 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2333 if test -z "$INSTALL"; then
2334 if test "${ac_cv_path_install+set}" = set; then
2335   echo $ECHO_N "(cached) $ECHO_C" >&6
2336 else
2337     ac_save_IFS=$IFS; IFS=$ac_path_separator
2338   for ac_dir in $PATH; do
2339     IFS=$ac_save_IFS
2340     # Account for people who put trailing slashes in PATH elements.
2341     case $ac_dir/ in
2342     / | ./ | .// | /cC/* \
2343     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2344     | /usr/ucb/* ) ;;
2345     *)
2346       # OSF1 and SCO ODT 3.0 have their own names for install.
2347       # Don't use installbsd from OSF since it installs stuff as root
2348       # by default.
2349       for ac_prog in ginstall scoinst install; do
2350         if $as_executable_p "$ac_dir/$ac_prog"; then
2351           if test $ac_prog = install &&
2352             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2353             # AIX install.  It has an incompatible calling convention.
2354             :
2355           elif test $ac_prog = install &&
2356             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2357             # program-specific install script used by HP pwplus--don't use.
2358             :
2359           else
2360             ac_cv_path_install="$ac_dir/$ac_prog -c"
2361             break 2
2362           fi
2363         fi
2364       done
2365       ;;
2366     esac
2367   done
2368
2369 fi
2370   if test "${ac_cv_path_install+set}" = set; then
2371     INSTALL=$ac_cv_path_install
2372   else
2373     # As a last resort, use the slow shell script.  We don't cache a
2374     # path for INSTALL within a source directory, because that will
2375     # break other packages using the cache if that directory is
2376     # removed, or if the path is relative.
2377     INSTALL=$ac_install_sh
2378   fi
2379 fi
2380 echo "$as_me:2380: result: $INSTALL" >&5
2381 echo "${ECHO_T}$INSTALL" >&6
2382
2383 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2384 # It thinks the first close brace ends the variable substitution.
2385 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2386
2387 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2388
2389 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2390
2391 case $INSTALL in
2392 (/*)
2393         ;;
2394 (*)
2395         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2396         test -z "$cf_dir" && cf_dir=.
2397         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2398         ;;
2399 esac
2400
2401 for ac_prog in lint cppcheck splint
2402 do
2403   # Extract the first word of "$ac_prog", so it can be a program name with args.
2404 set dummy $ac_prog; ac_word=$2
2405 echo "$as_me:2405: checking for $ac_word" >&5
2406 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2407 if test "${ac_cv_prog_LINT+set}" = set; then
2408   echo $ECHO_N "(cached) $ECHO_C" >&6
2409 else
2410   if test -n "$LINT"; then
2411   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2412 else
2413   ac_save_IFS=$IFS; IFS=$ac_path_separator
2414 ac_dummy="$PATH"
2415 for ac_dir in $ac_dummy; do
2416   IFS=$ac_save_IFS
2417   test -z "$ac_dir" && ac_dir=.
2418   $as_executable_p "$ac_dir/$ac_word" || continue
2419 ac_cv_prog_LINT="$ac_prog"
2420 echo "$as_me:2420: found $ac_dir/$ac_word" >&5
2421 break
2422 done
2423
2424 fi
2425 fi
2426 LINT=$ac_cv_prog_LINT
2427 if test -n "$LINT"; then
2428   echo "$as_me:2428: result: $LINT" >&5
2429 echo "${ECHO_T}$LINT" >&6
2430 else
2431   echo "$as_me:2431: result: no" >&5
2432 echo "${ECHO_T}no" >&6
2433 fi
2434
2435   test -n "$LINT" && break
2436 done
2437
2438 echo "$as_me:2438: checking if filesystem supports mixed-case filenames" >&5
2439 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2440 if test "${cf_cv_mixedcase+set}" = set; then
2441   echo $ECHO_N "(cached) $ECHO_C" >&6
2442 else
2443
2444 if test "$cross_compiling" = yes ; then
2445         case $target_alias in
2446         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2447                 cf_cv_mixedcase=no
2448                 ;;
2449         (*)
2450                 cf_cv_mixedcase=yes
2451                 ;;
2452         esac
2453 else
2454         rm -f conftest CONFTEST
2455         echo test >conftest
2456         if test -f CONFTEST ; then
2457                 cf_cv_mixedcase=no
2458         else
2459                 cf_cv_mixedcase=yes
2460         fi
2461         rm -f conftest CONFTEST
2462 fi
2463
2464 fi
2465 echo "$as_me:2465: result: $cf_cv_mixedcase" >&5
2466 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2467 test "$cf_cv_mixedcase" = yes &&
2468 cat >>confdefs.h <<\EOF
2469 #define MIXEDCASE_FILENAMES 1
2470 EOF
2471
2472 for ac_prog in exctags ctags
2473 do
2474   # Extract the first word of "$ac_prog", so it can be a program name with args.
2475 set dummy $ac_prog; ac_word=$2
2476 echo "$as_me:2476: checking for $ac_word" >&5
2477 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2478 if test "${ac_cv_prog_CTAGS+set}" = set; then
2479   echo $ECHO_N "(cached) $ECHO_C" >&6
2480 else
2481   if test -n "$CTAGS"; then
2482   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2483 else
2484   ac_save_IFS=$IFS; IFS=$ac_path_separator
2485 ac_dummy="$PATH"
2486 for ac_dir in $ac_dummy; do
2487   IFS=$ac_save_IFS
2488   test -z "$ac_dir" && ac_dir=.
2489   $as_executable_p "$ac_dir/$ac_word" || continue
2490 ac_cv_prog_CTAGS="$ac_prog"
2491 echo "$as_me:2491: found $ac_dir/$ac_word" >&5
2492 break
2493 done
2494
2495 fi
2496 fi
2497 CTAGS=$ac_cv_prog_CTAGS
2498 if test -n "$CTAGS"; then
2499   echo "$as_me:2499: result: $CTAGS" >&5
2500 echo "${ECHO_T}$CTAGS" >&6
2501 else
2502   echo "$as_me:2502: result: no" >&5
2503 echo "${ECHO_T}no" >&6
2504 fi
2505
2506   test -n "$CTAGS" && break
2507 done
2508
2509 for ac_prog in exetags etags
2510 do
2511   # Extract the first word of "$ac_prog", so it can be a program name with args.
2512 set dummy $ac_prog; ac_word=$2
2513 echo "$as_me:2513: checking for $ac_word" >&5
2514 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2515 if test "${ac_cv_prog_ETAGS+set}" = set; then
2516   echo $ECHO_N "(cached) $ECHO_C" >&6
2517 else
2518   if test -n "$ETAGS"; then
2519   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2520 else
2521   ac_save_IFS=$IFS; IFS=$ac_path_separator
2522 ac_dummy="$PATH"
2523 for ac_dir in $ac_dummy; do
2524   IFS=$ac_save_IFS
2525   test -z "$ac_dir" && ac_dir=.
2526   $as_executable_p "$ac_dir/$ac_word" || continue
2527 ac_cv_prog_ETAGS="$ac_prog"
2528 echo "$as_me:2528: found $ac_dir/$ac_word" >&5
2529 break
2530 done
2531
2532 fi
2533 fi
2534 ETAGS=$ac_cv_prog_ETAGS
2535 if test -n "$ETAGS"; then
2536   echo "$as_me:2536: result: $ETAGS" >&5
2537 echo "${ECHO_T}$ETAGS" >&6
2538 else
2539   echo "$as_me:2539: result: no" >&5
2540 echo "${ECHO_T}no" >&6
2541 fi
2542
2543   test -n "$ETAGS" && break
2544 done
2545
2546 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2547 set dummy ${CTAGS:-ctags}; ac_word=$2
2548 echo "$as_me:2548: checking for $ac_word" >&5
2549 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2550 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2551   echo $ECHO_N "(cached) $ECHO_C" >&6
2552 else
2553   if test -n "$MAKE_LOWER_TAGS"; then
2554   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2555 else
2556   ac_save_IFS=$IFS; IFS=$ac_path_separator
2557 ac_dummy="$PATH"
2558 for ac_dir in $ac_dummy; do
2559   IFS=$ac_save_IFS
2560   test -z "$ac_dir" && ac_dir=.
2561   $as_executable_p "$ac_dir/$ac_word" || continue
2562 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2563 echo "$as_me:2563: found $ac_dir/$ac_word" >&5
2564 break
2565 done
2566
2567   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2568 fi
2569 fi
2570 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2571 if test -n "$MAKE_LOWER_TAGS"; then
2572   echo "$as_me:2572: result: $MAKE_LOWER_TAGS" >&5
2573 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2574 else
2575   echo "$as_me:2575: result: no" >&5
2576 echo "${ECHO_T}no" >&6
2577 fi
2578
2579 if test "$cf_cv_mixedcase" = yes ; then
2580         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2581 set dummy ${ETAGS:-etags}; ac_word=$2
2582 echo "$as_me:2582: checking for $ac_word" >&5
2583 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2584 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2585   echo $ECHO_N "(cached) $ECHO_C" >&6
2586 else
2587   if test -n "$MAKE_UPPER_TAGS"; then
2588   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2589 else
2590   ac_save_IFS=$IFS; IFS=$ac_path_separator
2591 ac_dummy="$PATH"
2592 for ac_dir in $ac_dummy; do
2593   IFS=$ac_save_IFS
2594   test -z "$ac_dir" && ac_dir=.
2595   $as_executable_p "$ac_dir/$ac_word" || continue
2596 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2597 echo "$as_me:2597: found $ac_dir/$ac_word" >&5
2598 break
2599 done
2600
2601   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2602 fi
2603 fi
2604 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2605 if test -n "$MAKE_UPPER_TAGS"; then
2606   echo "$as_me:2606: result: $MAKE_UPPER_TAGS" >&5
2607 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2608 else
2609   echo "$as_me:2609: result: no" >&5
2610 echo "${ECHO_T}no" >&6
2611 fi
2612
2613 else
2614         MAKE_UPPER_TAGS=no
2615 fi
2616
2617 if test "$MAKE_UPPER_TAGS" = yes ; then
2618         MAKE_UPPER_TAGS=
2619 else
2620         MAKE_UPPER_TAGS="#"
2621 fi
2622
2623 if test "$MAKE_LOWER_TAGS" = yes ; then
2624         MAKE_LOWER_TAGS=
2625 else
2626         MAKE_LOWER_TAGS="#"
2627 fi
2628
2629 echo "$as_me:2629: checking if -lm needed for math functions" >&5
2630 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2631 if test "${cf_cv_need_libm+set}" = set; then
2632   echo $ECHO_N "(cached) $ECHO_C" >&6
2633 else
2634
2635         cat >conftest.$ac_ext <<_ACEOF
2636 #line 2636 "configure"
2637 #include "confdefs.h"
2638
2639         #include <stdio.h>
2640         #include <stdlib.h>
2641         #include <math.h>
2642
2643 int
2644 main (void)
2645 {
2646 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2647   ;
2648   return 0;
2649 }
2650 _ACEOF
2651 rm -f conftest.$ac_objext conftest$ac_exeext
2652 if { (eval echo "$as_me:2652: \"$ac_link\"") >&5
2653   (eval $ac_link) 2>&5
2654   ac_status=$?
2655   echo "$as_me:2655: \$? = $ac_status" >&5
2656   (exit $ac_status); } &&
2657          { ac_try='test -s conftest$ac_exeext'
2658   { (eval echo "$as_me:2658: \"$ac_try\"") >&5
2659   (eval $ac_try) 2>&5
2660   ac_status=$?
2661   echo "$as_me:2661: \$? = $ac_status" >&5
2662   (exit $ac_status); }; }; then
2663   cf_cv_need_libm=no
2664 else
2665   echo "$as_me: failed program was:" >&5
2666 cat conftest.$ac_ext >&5
2667 cf_cv_need_libm=yes
2668 fi
2669 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2670 fi
2671 echo "$as_me:2671: result: $cf_cv_need_libm" >&5
2672 echo "${ECHO_T}$cf_cv_need_libm" >&6
2673 if test "$cf_cv_need_libm" = yes
2674 then
2675 MATH_LIB=-lm
2676 fi
2677
2678 top_builddir=`pwd`
2679
2680 CC_G_OPT="-g"
2681 CC_SHARED_OPTS=unknown
2682 CPPFLAGS="$CPPFLAGS"
2683 DFT_DEP_SUFFIX=""
2684 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2685 DFT_UPR_MODEL="NORMAL"
2686 LD="ld"
2687 LDFLAGS_SHARED=""
2688 LDFLAGS_STATIC=""
2689 LD_MODEL=""
2690 LD_SHARED_OPTS=""
2691 LIBTOOL=""
2692 LIBTOOL_OPTS=""
2693 LIB_CLEAN=""
2694 LIB_COMPILE=""
2695 LIB_LINK='${CC}'
2696 LINK_TESTS=""
2697 LOCAL_LDFLAGS=""
2698 PACKAGE="ncurses-examples"
2699 PTHREAD="-lm"
2700 TEST_ARGS=""
2701 TEST_DEPS=""
2702 TEST_LIBS=""
2703 TINFO_LDFLAGS=''
2704 TINFO_LIBS='$(LIBS_CURSES)'
2705 cf_cv_abi_version=""
2706 cf_cv_rel_version=""
2707 includesubdir=""
2708
2709 cf_cv_screen=curses
2710 cf_cv_libtype=
2711
2712 if test "$GCC" = yes
2713 then
2714 cat > conftest.i <<EOF
2715 #ifndef GCC_PRINTF
2716 #define GCC_PRINTF 0
2717 #endif
2718 #ifndef GCC_SCANF
2719 #define GCC_SCANF 0
2720 #endif
2721 #ifndef GCC_NORETURN
2722 #define GCC_NORETURN /* nothing */
2723 #endif
2724 #ifndef GCC_UNUSED
2725 #define GCC_UNUSED /* nothing */
2726 #endif
2727 EOF
2728 if test "$GCC" = yes
2729 then
2730         { echo "$as_me:2730: checking for $CC __attribute__ directives..." >&5
2731 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2732 cat > conftest.$ac_ext <<EOF
2733 #line 2733 "${as_me:-configure}"
2734 #include "confdefs.h"
2735 #include "conftest.h"
2736 #include "conftest.i"
2737 #if     GCC_PRINTF
2738 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2739 #else
2740 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2741 #endif
2742 #if     GCC_SCANF
2743 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2744 #else
2745 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2746 #endif
2747 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2748 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2749 extern void foo(void) GCC_NORETURN;
2750 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2751 EOF
2752         cf_printf_attribute=no
2753         cf_scanf_attribute=no
2754         for cf_attribute in scanf printf unused noreturn
2755         do
2756
2757 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2758
2759                 cf_directive="__attribute__(($cf_attribute))"
2760                 echo "checking for $CC $cf_directive" 1>&5
2761
2762                 case $cf_attribute in
2763                 (printf)
2764                         cf_printf_attribute=yes
2765                         cat >conftest.h <<EOF
2766 #define GCC_$cf_ATTRIBUTE 1
2767 EOF
2768                         ;;
2769                 (scanf)
2770                         cf_scanf_attribute=yes
2771                         cat >conftest.h <<EOF
2772 #define GCC_$cf_ATTRIBUTE 1
2773 EOF
2774                         ;;
2775                 (*)
2776                         cat >conftest.h <<EOF
2777 #define GCC_$cf_ATTRIBUTE $cf_directive
2778 EOF
2779                         ;;
2780                 esac
2781
2782                 if { (eval echo "$as_me:2782: \"$ac_compile\"") >&5
2783   (eval $ac_compile) 2>&5
2784   ac_status=$?
2785   echo "$as_me:2785: \$? = $ac_status" >&5
2786   (exit $ac_status); }; then
2787                         test -n "$verbose" && echo "$as_me:2787: result: ... $cf_attribute" >&5
2788 echo "${ECHO_T}... $cf_attribute" >&6
2789                         cat conftest.h >>confdefs.h
2790                         case $cf_attribute in
2791                         (noreturn)
2792
2793 cat >>confdefs.h <<EOF
2794 #define GCC_NORETURN $cf_directive
2795 EOF
2796
2797                                 ;;
2798                         (printf)
2799                                 cf_value='/* nothing */'
2800                                 if test "$cf_printf_attribute" != no ; then
2801                                         cf_value='__attribute__((format(printf,fmt,var)))'
2802
2803 cat >>confdefs.h <<\EOF
2804 #define GCC_PRINTF 1
2805 EOF
2806
2807                                 fi
2808
2809 cat >>confdefs.h <<EOF
2810 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2811 EOF
2812
2813                                 ;;
2814                         (scanf)
2815                                 cf_value='/* nothing */'
2816                                 if test "$cf_scanf_attribute" != no ; then
2817                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2818
2819 cat >>confdefs.h <<\EOF
2820 #define GCC_SCANF 1
2821 EOF
2822
2823                                 fi
2824
2825 cat >>confdefs.h <<EOF
2826 #define GCC_SCANFLIKE(fmt,var) $cf_value
2827 EOF
2828
2829                                 ;;
2830                         (unused)
2831
2832 cat >>confdefs.h <<EOF
2833 #define GCC_UNUSED $cf_directive
2834 EOF
2835
2836                                 ;;
2837                         esac
2838                 fi
2839         done
2840 else
2841         fgrep define conftest.i >>confdefs.h
2842 fi
2843 rm -rf conftest*
2844 fi
2845
2846 echo "$as_me:2846: checking if you want to work around bogus compiler/loader warnings" >&5
2847 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
2848
2849 # Check whether --enable-string-hacks or --disable-string-hacks was given.
2850 if test "${enable_string_hacks+set}" = set; then
2851   enableval="$enable_string_hacks"
2852   with_string_hacks=$enableval
2853 else
2854   with_string_hacks=no
2855 fi;
2856 echo "$as_me:2856: result: $with_string_hacks" >&5
2857 echo "${ECHO_T}$with_string_hacks" >&6
2858
2859 if test "x$with_string_hacks" = "xyes"; then
2860
2861 cat >>confdefs.h <<\EOF
2862 #define USE_STRING_HACKS 1
2863 EOF
2864
2865         { echo "$as_me:2865: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
2866 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
2867         echo "$as_me:2867: checking for strlcat" >&5
2868 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
2869 if test "${ac_cv_func_strlcat+set}" = set; then
2870   echo $ECHO_N "(cached) $ECHO_C" >&6
2871 else
2872   cat >conftest.$ac_ext <<_ACEOF
2873 #line 2873 "configure"
2874 #include "confdefs.h"
2875 /* System header to define __stub macros and hopefully few prototypes,
2876     which can conflict with char strlcat (); below.  */
2877 #include <assert.h>
2878 /* Override any gcc2 internal prototype to avoid an error.  */
2879 #ifdef __cplusplus
2880 extern "C"
2881 #endif
2882 /* We use char because int might match the return type of a gcc2
2883    builtin and then its argument prototype would still apply.  */
2884 char strlcat ();
2885 char (*f) ();
2886
2887 int
2888 main (void)
2889 {
2890 /* The GNU C library defines this for functions which it implements
2891     to always fail with ENOSYS.  Some functions are actually named
2892     something starting with __ and the normal name is an alias.  */
2893 #if defined (__stub_strlcat) || defined (__stub___strlcat)
2894 choke me
2895 #else
2896 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
2897 #endif
2898
2899   ;
2900   return 0;
2901 }
2902 _ACEOF
2903 rm -f conftest.$ac_objext conftest$ac_exeext
2904 if { (eval echo "$as_me:2904: \"$ac_link\"") >&5
2905   (eval $ac_link) 2>&5
2906   ac_status=$?
2907   echo "$as_me:2907: \$? = $ac_status" >&5
2908   (exit $ac_status); } &&
2909          { ac_try='test -s conftest$ac_exeext'
2910   { (eval echo "$as_me:2910: \"$ac_try\"") >&5
2911   (eval $ac_try) 2>&5
2912   ac_status=$?
2913   echo "$as_me:2913: \$? = $ac_status" >&5
2914   (exit $ac_status); }; }; then
2915   ac_cv_func_strlcat=yes
2916 else
2917   echo "$as_me: failed program was:" >&5
2918 cat conftest.$ac_ext >&5
2919 ac_cv_func_strlcat=no
2920 fi
2921 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2922 fi
2923 echo "$as_me:2923: result: $ac_cv_func_strlcat" >&5
2924 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
2925 if test $ac_cv_func_strlcat = yes; then
2926
2927 cat >>confdefs.h <<\EOF
2928 #define HAVE_STRLCAT 1
2929 EOF
2930
2931 else
2932
2933                 echo "$as_me:2933: checking for strlcat in -lbsd" >&5
2934 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
2935 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
2936   echo $ECHO_N "(cached) $ECHO_C" >&6
2937 else
2938   ac_check_lib_save_LIBS=$LIBS
2939 LIBS="-lbsd  $LIBS"
2940 cat >conftest.$ac_ext <<_ACEOF
2941 #line 2941 "configure"
2942 #include "confdefs.h"
2943
2944 /* Override any gcc2 internal prototype to avoid an error.  */
2945 #ifdef __cplusplus
2946 extern "C"
2947 #endif
2948 /* We use char because int might match the return type of a gcc2
2949    builtin and then its argument prototype would still apply.  */
2950 char strlcat ();
2951 int
2952 main (void)
2953 {
2954 strlcat ();
2955   ;
2956   return 0;
2957 }
2958 _ACEOF
2959 rm -f conftest.$ac_objext conftest$ac_exeext
2960 if { (eval echo "$as_me:2960: \"$ac_link\"") >&5
2961   (eval $ac_link) 2>&5
2962   ac_status=$?
2963   echo "$as_me:2963: \$? = $ac_status" >&5
2964   (exit $ac_status); } &&
2965          { ac_try='test -s conftest$ac_exeext'
2966   { (eval echo "$as_me:2966: \"$ac_try\"") >&5
2967   (eval $ac_try) 2>&5
2968   ac_status=$?
2969   echo "$as_me:2969: \$? = $ac_status" >&5
2970   (exit $ac_status); }; }; then
2971   ac_cv_lib_bsd_strlcat=yes
2972 else
2973   echo "$as_me: failed program was:" >&5
2974 cat conftest.$ac_ext >&5
2975 ac_cv_lib_bsd_strlcat=no
2976 fi
2977 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2978 LIBS=$ac_check_lib_save_LIBS
2979 fi
2980 echo "$as_me:2980: result: $ac_cv_lib_bsd_strlcat" >&5
2981 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
2982 if test $ac_cv_lib_bsd_strlcat = yes; then
2983
2984 cf_add_libs="-lbsd"
2985 # Filter out duplicates - this happens with badly-designed ".pc" files...
2986 for cf_add_1lib in $LIBS
2987 do
2988         for cf_add_2lib in $cf_add_libs
2989         do
2990                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
2991                 then
2992                         cf_add_1lib=
2993                         break
2994                 fi
2995         done
2996         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
2997 done
2998 LIBS="$cf_add_libs"
2999
3000 for ac_header in bsd/string.h
3001 do
3002 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3003 echo "$as_me:3003: checking for $ac_header" >&5
3004 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3005 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3006   echo $ECHO_N "(cached) $ECHO_C" >&6
3007 else
3008   cat >conftest.$ac_ext <<_ACEOF
3009 #line 3009 "configure"
3010 #include "confdefs.h"
3011 #include <$ac_header>
3012 _ACEOF
3013 if { (eval echo "$as_me:3013: \"$ac_cpp conftest.$ac_ext\"") >&5
3014   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3015   ac_status=$?
3016   egrep -v '^ *\+' conftest.er1 >conftest.err
3017   rm -f conftest.er1
3018   cat conftest.err >&5
3019   echo "$as_me:3019: \$? = $ac_status" >&5
3020   (exit $ac_status); } >/dev/null; then
3021   if test -s conftest.err; then
3022     ac_cpp_err=$ac_c_preproc_warn_flag
3023   else
3024     ac_cpp_err=
3025   fi
3026 else
3027   ac_cpp_err=yes
3028 fi
3029 if test -z "$ac_cpp_err"; then
3030   eval "$as_ac_Header=yes"
3031 else
3032   echo "$as_me: failed program was:" >&5
3033   cat conftest.$ac_ext >&5
3034   eval "$as_ac_Header=no"
3035 fi
3036 rm -f conftest.err conftest.$ac_ext
3037 fi
3038 echo "$as_me:3038: result: `eval echo '${'$as_ac_Header'}'`" >&5
3039 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3040 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3041   cat >>confdefs.h <<EOF
3042 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3043 EOF
3044
3045 fi
3046 done
3047
3048 cat >>confdefs.h <<\EOF
3049 #define HAVE_STRLCAT 1
3050 EOF
3051
3052 fi
3053
3054 fi
3055
3056 for ac_func in strlcpy snprintf
3057 do
3058 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3059 echo "$as_me:3059: checking for $ac_func" >&5
3060 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3061 if eval "test \"\${$as_ac_var+set}\" = set"; then
3062   echo $ECHO_N "(cached) $ECHO_C" >&6
3063 else
3064   cat >conftest.$ac_ext <<_ACEOF
3065 #line 3065 "configure"
3066 #include "confdefs.h"
3067 /* System header to define __stub macros and hopefully few prototypes,
3068     which can conflict with char $ac_func (); below.  */
3069 #include <assert.h>
3070 /* Override any gcc2 internal prototype to avoid an error.  */
3071 #ifdef __cplusplus
3072 extern "C"
3073 #endif
3074 /* We use char because int might match the return type of a gcc2
3075    builtin and then its argument prototype would still apply.  */
3076 char $ac_func ();
3077 char (*f) ();
3078
3079 int
3080 main (void)
3081 {
3082 /* The GNU C library defines this for functions which it implements
3083     to always fail with ENOSYS.  Some functions are actually named
3084     something starting with __ and the normal name is an alias.  */
3085 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3086 choke me
3087 #else
3088 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3089 #endif
3090
3091   ;
3092   return 0;
3093 }
3094 _ACEOF
3095 rm -f conftest.$ac_objext conftest$ac_exeext
3096 if { (eval echo "$as_me:3096: \"$ac_link\"") >&5
3097   (eval $ac_link) 2>&5
3098   ac_status=$?
3099   echo "$as_me:3099: \$? = $ac_status" >&5
3100   (exit $ac_status); } &&
3101          { ac_try='test -s conftest$ac_exeext'
3102   { (eval echo "$as_me:3102: \"$ac_try\"") >&5
3103   (eval $ac_try) 2>&5
3104   ac_status=$?
3105   echo "$as_me:3105: \$? = $ac_status" >&5
3106   (exit $ac_status); }; }; then
3107   eval "$as_ac_var=yes"
3108 else
3109   echo "$as_me: failed program was:" >&5
3110 cat conftest.$ac_ext >&5
3111 eval "$as_ac_var=no"
3112 fi
3113 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3114 fi
3115 echo "$as_me:3115: result: `eval echo '${'$as_ac_var'}'`" >&5
3116 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3117 if test `eval echo '${'$as_ac_var'}'` = yes; then
3118   cat >>confdefs.h <<EOF
3119 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3120 EOF
3121
3122 fi
3123 done
3124
3125 fi
3126
3127 cf_XOPEN_SOURCE=500
3128 cf_POSIX_C_SOURCE=199506L
3129 cf_xopen_source=
3130
3131 case $host_os in
3132 (aix[4-7]*)
3133         cf_xopen_source="-D_ALL_SOURCE"
3134         ;;
3135 (msys)
3136         cf_XOPEN_SOURCE=600
3137         ;;
3138 (darwin[0-8].*)
3139         cf_xopen_source="-D_APPLE_C_SOURCE"
3140         ;;
3141 (darwin*)
3142         cf_xopen_source="-D_DARWIN_C_SOURCE"
3143         cf_XOPEN_SOURCE=
3144         ;;
3145 (freebsd*|dragonfly*)
3146         # 5.x headers associate
3147         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3148         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3149         cf_POSIX_C_SOURCE=200112L
3150         cf_XOPEN_SOURCE=600
3151         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3152         ;;
3153 (hpux11*)
3154         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3155         ;;
3156 (hpux*)
3157         cf_xopen_source="-D_HPUX_SOURCE"
3158         ;;
3159 (irix[56].*)
3160         cf_xopen_source="-D_SGI_SOURCE"
3161         cf_XOPEN_SOURCE=
3162         ;;
3163 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3164
3165 echo "$as_me:3165: checking if we must define _GNU_SOURCE" >&5
3166 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3167 if test "${cf_cv_gnu_source+set}" = set; then
3168   echo $ECHO_N "(cached) $ECHO_C" >&6
3169 else
3170
3171 cat >conftest.$ac_ext <<_ACEOF
3172 #line 3172 "configure"
3173 #include "confdefs.h"
3174 #include <sys/types.h>
3175 int
3176 main (void)
3177 {
3178
3179 #ifndef _XOPEN_SOURCE
3180 make an error
3181 #endif
3182   ;
3183   return 0;
3184 }
3185 _ACEOF
3186 rm -f conftest.$ac_objext
3187 if { (eval echo "$as_me:3187: \"$ac_compile\"") >&5
3188   (eval $ac_compile) 2>&5
3189   ac_status=$?
3190   echo "$as_me:3190: \$? = $ac_status" >&5
3191   (exit $ac_status); } &&
3192          { ac_try='test -s conftest.$ac_objext'
3193   { (eval echo "$as_me:3193: \"$ac_try\"") >&5
3194   (eval $ac_try) 2>&5
3195   ac_status=$?
3196   echo "$as_me:3196: \$? = $ac_status" >&5
3197   (exit $ac_status); }; }; then
3198   cf_cv_gnu_source=no
3199 else
3200   echo "$as_me: failed program was:" >&5
3201 cat conftest.$ac_ext >&5
3202 cf_save="$CPPFLAGS"
3203          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3204          cat >conftest.$ac_ext <<_ACEOF
3205 #line 3205 "configure"
3206 #include "confdefs.h"
3207 #include <sys/types.h>
3208 int
3209 main (void)
3210 {
3211
3212 #ifdef _XOPEN_SOURCE
3213 make an error
3214 #endif
3215   ;
3216   return 0;
3217 }
3218 _ACEOF
3219 rm -f conftest.$ac_objext
3220 if { (eval echo "$as_me:3220: \"$ac_compile\"") >&5
3221   (eval $ac_compile) 2>&5
3222   ac_status=$?
3223   echo "$as_me:3223: \$? = $ac_status" >&5
3224   (exit $ac_status); } &&
3225          { ac_try='test -s conftest.$ac_objext'
3226   { (eval echo "$as_me:3226: \"$ac_try\"") >&5
3227   (eval $ac_try) 2>&5
3228   ac_status=$?
3229   echo "$as_me:3229: \$? = $ac_status" >&5
3230   (exit $ac_status); }; }; then
3231   cf_cv_gnu_source=no
3232 else
3233   echo "$as_me: failed program was:" >&5
3234 cat conftest.$ac_ext >&5
3235 cf_cv_gnu_source=yes
3236 fi
3237 rm -f conftest.$ac_objext conftest.$ac_ext
3238         CPPFLAGS="$cf_save"
3239
3240 fi
3241 rm -f conftest.$ac_objext conftest.$ac_ext
3242
3243 fi
3244 echo "$as_me:3244: result: $cf_cv_gnu_source" >&5
3245 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3246
3247 if test "$cf_cv_gnu_source" = yes
3248 then
3249 echo "$as_me:3249: checking if we should also define _DEFAULT_SOURCE" >&5
3250 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3251 if test "${cf_cv_default_source+set}" = set; then
3252   echo $ECHO_N "(cached) $ECHO_C" >&6
3253 else
3254
3255 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3256         cat >conftest.$ac_ext <<_ACEOF
3257 #line 3257 "configure"
3258 #include "confdefs.h"
3259 #include <sys/types.h>
3260 int
3261 main (void)
3262 {
3263
3264 #ifdef _DEFAULT_SOURCE
3265 make an error
3266 #endif
3267   ;
3268   return 0;
3269 }
3270 _ACEOF
3271 rm -f conftest.$ac_objext
3272 if { (eval echo "$as_me:3272: \"$ac_compile\"") >&5
3273   (eval $ac_compile) 2>&5
3274   ac_status=$?
3275   echo "$as_me:3275: \$? = $ac_status" >&5
3276   (exit $ac_status); } &&
3277          { ac_try='test -s conftest.$ac_objext'
3278   { (eval echo "$as_me:3278: \"$ac_try\"") >&5
3279   (eval $ac_try) 2>&5
3280   ac_status=$?
3281   echo "$as_me:3281: \$? = $ac_status" >&5
3282   (exit $ac_status); }; }; then
3283   cf_cv_default_source=no
3284 else
3285   echo "$as_me: failed program was:" >&5
3286 cat conftest.$ac_ext >&5
3287 cf_cv_default_source=yes
3288 fi
3289 rm -f conftest.$ac_objext conftest.$ac_ext
3290
3291 fi
3292 echo "$as_me:3292: result: $cf_cv_default_source" >&5
3293 echo "${ECHO_T}$cf_cv_default_source" >&6
3294 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3295 fi
3296
3297         ;;
3298 (minix*)
3299         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3300         ;;
3301 (mirbsd*)
3302         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3303         cf_XOPEN_SOURCE=
3304
3305 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3306
3307 cf_save_CFLAGS="$CFLAGS"
3308 cf_save_CPPFLAGS="$CPPFLAGS"
3309
3310 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3311         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3312                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3313
3314 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3315         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3316                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3317
3318 echo "$as_me:3318: checking if we should define _POSIX_C_SOURCE" >&5
3319 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3320 if test "${cf_cv_posix_c_source+set}" = set; then
3321   echo $ECHO_N "(cached) $ECHO_C" >&6
3322 else
3323
3324 echo "${as_me:-configure}:3324: testing if the symbol is already defined go no further ..." 1>&5
3325
3326         cat >conftest.$ac_ext <<_ACEOF
3327 #line 3327 "configure"
3328 #include "confdefs.h"
3329 #include <sys/types.h>
3330 int
3331 main (void)
3332 {
3333
3334 #ifndef _POSIX_C_SOURCE
3335 make an error
3336 #endif
3337   ;
3338   return 0;
3339 }
3340 _ACEOF
3341 rm -f conftest.$ac_objext
3342 if { (eval echo "$as_me:3342: \"$ac_compile\"") >&5
3343   (eval $ac_compile) 2>&5
3344   ac_status=$?
3345   echo "$as_me:3345: \$? = $ac_status" >&5
3346   (exit $ac_status); } &&
3347          { ac_try='test -s conftest.$ac_objext'
3348   { (eval echo "$as_me:3348: \"$ac_try\"") >&5
3349   (eval $ac_try) 2>&5
3350   ac_status=$?
3351   echo "$as_me:3351: \$? = $ac_status" >&5
3352   (exit $ac_status); }; }; then
3353   cf_cv_posix_c_source=no
3354 else
3355   echo "$as_me: failed program was:" >&5
3356 cat conftest.$ac_ext >&5
3357 cf_want_posix_source=no
3358          case .$cf_POSIX_C_SOURCE in
3359          (.[12]??*)
3360                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3361                 ;;
3362          (.2)
3363                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3364                 cf_want_posix_source=yes
3365                 ;;
3366          (.*)
3367                 cf_want_posix_source=yes
3368                 ;;
3369          esac
3370          if test "$cf_want_posix_source" = yes ; then
3371                 cat >conftest.$ac_ext <<_ACEOF
3372 #line 3372 "configure"
3373 #include "confdefs.h"
3374 #include <sys/types.h>
3375 int
3376 main (void)
3377 {
3378
3379 #ifdef _POSIX_SOURCE
3380 make an error
3381 #endif
3382   ;
3383   return 0;
3384 }
3385 _ACEOF
3386 rm -f conftest.$ac_objext
3387 if { (eval echo "$as_me:3387: \"$ac_compile\"") >&5
3388   (eval $ac_compile) 2>&5
3389   ac_status=$?
3390   echo "$as_me:3390: \$? = $ac_status" >&5
3391   (exit $ac_status); } &&
3392          { ac_try='test -s conftest.$ac_objext'
3393   { (eval echo "$as_me:3393: \"$ac_try\"") >&5
3394   (eval $ac_try) 2>&5
3395   ac_status=$?
3396   echo "$as_me:3396: \$? = $ac_status" >&5
3397   (exit $ac_status); }; }; then
3398   :
3399 else
3400   echo "$as_me: failed program was:" >&5
3401 cat conftest.$ac_ext >&5
3402 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3403 fi
3404 rm -f conftest.$ac_objext conftest.$ac_ext
3405          fi
3406
3407 echo "${as_me:-configure}:3407: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3408
3409          CFLAGS="$cf_trim_CFLAGS"
3410          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3411
3412 echo "${as_me:-configure}:3412: testing if the second compile does not leave our definition intact error ..." 1>&5
3413
3414          cat >conftest.$ac_ext <<_ACEOF
3415 #line 3415 "configure"
3416 #include "confdefs.h"
3417 #include <sys/types.h>
3418 int
3419 main (void)
3420 {
3421
3422 #ifndef _POSIX_C_SOURCE
3423 make an error
3424 #endif
3425   ;
3426   return 0;
3427 }
3428 _ACEOF
3429 rm -f conftest.$ac_objext
3430 if { (eval echo "$as_me:3430: \"$ac_compile\"") >&5
3431   (eval $ac_compile) 2>&5
3432   ac_status=$?
3433   echo "$as_me:3433: \$? = $ac_status" >&5
3434   (exit $ac_status); } &&
3435          { ac_try='test -s conftest.$ac_objext'
3436   { (eval echo "$as_me:3436: \"$ac_try\"") >&5
3437   (eval $ac_try) 2>&5
3438   ac_status=$?
3439   echo "$as_me:3439: \$? = $ac_status" >&5
3440   (exit $ac_status); }; }; then
3441   :
3442 else
3443   echo "$as_me: failed program was:" >&5
3444 cat conftest.$ac_ext >&5
3445 cf_cv_posix_c_source=no
3446 fi
3447 rm -f conftest.$ac_objext conftest.$ac_ext
3448          CFLAGS="$cf_save_CFLAGS"
3449          CPPFLAGS="$cf_save_CPPFLAGS"
3450
3451 fi
3452 rm -f conftest.$ac_objext conftest.$ac_ext
3453
3454 fi
3455 echo "$as_me:3455: result: $cf_cv_posix_c_source" >&5
3456 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3457
3458 if test "$cf_cv_posix_c_source" != no ; then
3459         CFLAGS="$cf_trim_CFLAGS"
3460         CPPFLAGS="$cf_trim_CPPFLAGS"
3461
3462 cf_fix_cppflags=no
3463 cf_new_cflags=
3464 cf_new_cppflags=
3465 cf_new_extra_cppflags=
3466
3467 for cf_add_cflags in $cf_cv_posix_c_source
3468 do
3469 case $cf_fix_cppflags in
3470 (no)
3471         case $cf_add_cflags in
3472         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3473                 case $cf_add_cflags in
3474                 (-D*)
3475                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3476
3477                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3478                                 && test -z "${cf_tst_cflags}" \
3479                                 && cf_fix_cppflags=yes
3480
3481                         if test $cf_fix_cppflags = yes ; then
3482
3483         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3484         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3485
3486                                 continue
3487                         elif test "${cf_tst_cflags}" = "\"'" ; then
3488
3489         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3490         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3491
3492                                 continue
3493                         fi
3494                         ;;
3495                 esac
3496                 case "$CPPFLAGS" in
3497                 (*$cf_add_cflags)
3498                         ;;
3499                 (*)
3500                         case $cf_add_cflags in
3501                         (-D*)
3502                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3503
3504 CPPFLAGS=`echo "$CPPFLAGS" | \
3505         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3506                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3507
3508                                 ;;
3509                         esac
3510
3511         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3512         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3513
3514                         ;;
3515                 esac
3516                 ;;
3517         (*)
3518
3519         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3520         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3521
3522                 ;;
3523         esac
3524         ;;
3525 (yes)
3526
3527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3529
3530         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3531
3532         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3533                 && test -z "${cf_tst_cflags}" \
3534                 && cf_fix_cppflags=no
3535         ;;
3536 esac
3537 done
3538
3539 if test -n "$cf_new_cflags" ; then
3540
3541         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3542         CFLAGS="${CFLAGS}$cf_new_cflags"
3543
3544 fi
3545
3546 if test -n "$cf_new_cppflags" ; then
3547
3548         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3549         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3550
3551 fi
3552
3553 if test -n "$cf_new_extra_cppflags" ; then
3554
3555         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3556         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3557
3558 fi
3559
3560 fi
3561
3562         ;;
3563 (netbsd*)
3564         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3565         ;;
3566 (openbsd[4-9]*)
3567         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3568         cf_xopen_source="-D_BSD_SOURCE"
3569         cf_XOPEN_SOURCE=600
3570         ;;
3571 (openbsd*)
3572         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3573         ;;
3574 (osf[45]*)
3575         cf_xopen_source="-D_OSF_SOURCE"
3576         ;;
3577 (nto-qnx*)
3578         cf_xopen_source="-D_QNX_SOURCE"
3579         ;;
3580 (sco*)
3581         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3582         ;;
3583 (solaris2.*)
3584         cf_xopen_source="-D__EXTENSIONS__"
3585         cf_cv_xopen_source=broken
3586         ;;
3587 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3588         cf_XOPEN_SOURCE=
3589         cf_POSIX_C_SOURCE=
3590         ;;
3591 (*)
3592
3593 echo "$as_me:3593: checking if we should define _XOPEN_SOURCE" >&5
3594 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3595 if test "${cf_cv_xopen_source+set}" = set; then
3596   echo $ECHO_N "(cached) $ECHO_C" >&6
3597 else
3598
3599         cat >conftest.$ac_ext <<_ACEOF
3600 #line 3600 "configure"
3601 #include "confdefs.h"
3602
3603 #include <stdlib.h>
3604 #include <string.h>
3605 #include <sys/types.h>
3606
3607 int
3608 main (void)
3609 {
3610
3611 #ifndef _XOPEN_SOURCE
3612 make an error
3613 #endif
3614   ;
3615   return 0;
3616 }
3617 _ACEOF
3618 rm -f conftest.$ac_objext
3619 if { (eval echo "$as_me:3619: \"$ac_compile\"") >&5
3620   (eval $ac_compile) 2>&5
3621   ac_status=$?
3622   echo "$as_me:3622: \$? = $ac_status" >&5
3623   (exit $ac_status); } &&
3624          { ac_try='test -s conftest.$ac_objext'
3625   { (eval echo "$as_me:3625: \"$ac_try\"") >&5
3626   (eval $ac_try) 2>&5
3627   ac_status=$?
3628   echo "$as_me:3628: \$? = $ac_status" >&5
3629   (exit $ac_status); }; }; then
3630   cf_cv_xopen_source=no
3631 else
3632   echo "$as_me: failed program was:" >&5
3633 cat conftest.$ac_ext >&5
3634 cf_save="$CPPFLAGS"
3635          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3636          cat >conftest.$ac_ext <<_ACEOF
3637 #line 3637 "configure"
3638 #include "confdefs.h"
3639
3640 #include <stdlib.h>
3641 #include <string.h>
3642 #include <sys/types.h>
3643
3644 int
3645 main (void)
3646 {
3647
3648 #ifdef _XOPEN_SOURCE
3649 make an error
3650 #endif
3651   ;
3652   return 0;
3653 }
3654 _ACEOF
3655 rm -f conftest.$ac_objext
3656 if { (eval echo "$as_me:3656: \"$ac_compile\"") >&5
3657   (eval $ac_compile) 2>&5
3658   ac_status=$?
3659   echo "$as_me:3659: \$? = $ac_status" >&5
3660   (exit $ac_status); } &&
3661          { ac_try='test -s conftest.$ac_objext'
3662   { (eval echo "$as_me:3662: \"$ac_try\"") >&5
3663   (eval $ac_try) 2>&5
3664   ac_status=$?
3665   echo "$as_me:3665: \$? = $ac_status" >&5
3666   (exit $ac_status); }; }; then
3667   cf_cv_xopen_source=no
3668 else
3669   echo "$as_me: failed program was:" >&5
3670 cat conftest.$ac_ext >&5
3671 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3672 fi
3673 rm -f conftest.$ac_objext conftest.$ac_ext
3674         CPPFLAGS="$cf_save"
3675
3676 fi
3677 rm -f conftest.$ac_objext conftest.$ac_ext
3678
3679 fi
3680 echo "$as_me:3680: result: $cf_cv_xopen_source" >&5
3681 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3682
3683 if test "$cf_cv_xopen_source" != no ; then
3684
3685 CFLAGS=`echo "$CFLAGS" | \
3686         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3687                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3688
3689 CPPFLAGS=`echo "$CPPFLAGS" | \
3690         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3691                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3692
3693         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3694
3695 cf_fix_cppflags=no
3696 cf_new_cflags=
3697 cf_new_cppflags=
3698 cf_new_extra_cppflags=
3699
3700 for cf_add_cflags in $cf_temp_xopen_source
3701 do
3702 case $cf_fix_cppflags in
3703 (no)
3704         case $cf_add_cflags in
3705         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3706                 case $cf_add_cflags in
3707                 (-D*)
3708                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3709
3710                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3711                                 && test -z "${cf_tst_cflags}" \
3712                                 && cf_fix_cppflags=yes
3713
3714                         if test $cf_fix_cppflags = yes ; then
3715
3716         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3717         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3718
3719                                 continue
3720                         elif test "${cf_tst_cflags}" = "\"'" ; then
3721
3722         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3723         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3724
3725                                 continue
3726                         fi
3727                         ;;
3728                 esac
3729                 case "$CPPFLAGS" in
3730                 (*$cf_add_cflags)
3731                         ;;
3732                 (*)
3733                         case $cf_add_cflags in
3734                         (-D*)
3735                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3736
3737 CPPFLAGS=`echo "$CPPFLAGS" | \
3738         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3739                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3740
3741                                 ;;
3742                         esac
3743
3744         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3745         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3746
3747                         ;;
3748                 esac
3749                 ;;
3750         (*)
3751
3752         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3753         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3754
3755                 ;;
3756         esac
3757         ;;
3758 (yes)
3759
3760         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3761         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3762
3763         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3764
3765         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3766                 && test -z "${cf_tst_cflags}" \
3767                 && cf_fix_cppflags=no
3768         ;;
3769 esac
3770 done
3771
3772 if test -n "$cf_new_cflags" ; then
3773
3774         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3775         CFLAGS="${CFLAGS}$cf_new_cflags"
3776
3777 fi
3778
3779 if test -n "$cf_new_cppflags" ; then
3780
3781         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3782         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3783
3784 fi
3785
3786 if test -n "$cf_new_extra_cppflags" ; then
3787
3788         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3789         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3790
3791 fi
3792
3793 fi
3794
3795 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3796
3797 cf_save_CFLAGS="$CFLAGS"
3798 cf_save_CPPFLAGS="$CPPFLAGS"
3799
3800 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3801         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3802                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3803
3804 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3805         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3806                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3807
3808 echo "$as_me:3808: checking if we should define _POSIX_C_SOURCE" >&5
3809 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3810 if test "${cf_cv_posix_c_source+set}" = set; then
3811   echo $ECHO_N "(cached) $ECHO_C" >&6
3812 else
3813
3814 echo "${as_me:-configure}:3814: testing if the symbol is already defined go no further ..." 1>&5
3815
3816         cat >conftest.$ac_ext <<_ACEOF
3817 #line 3817 "configure"
3818 #include "confdefs.h"
3819 #include <sys/types.h>
3820 int
3821 main (void)
3822 {
3823
3824 #ifndef _POSIX_C_SOURCE
3825 make an error
3826 #endif
3827   ;
3828   return 0;
3829 }
3830 _ACEOF
3831 rm -f conftest.$ac_objext
3832 if { (eval echo "$as_me:3832: \"$ac_compile\"") >&5
3833   (eval $ac_compile) 2>&5
3834   ac_status=$?
3835   echo "$as_me:3835: \$? = $ac_status" >&5
3836   (exit $ac_status); } &&
3837          { ac_try='test -s conftest.$ac_objext'
3838   { (eval echo "$as_me:3838: \"$ac_try\"") >&5
3839   (eval $ac_try) 2>&5
3840   ac_status=$?
3841   echo "$as_me:3841: \$? = $ac_status" >&5
3842   (exit $ac_status); }; }; then
3843   cf_cv_posix_c_source=no
3844 else
3845   echo "$as_me: failed program was:" >&5
3846 cat conftest.$ac_ext >&5
3847 cf_want_posix_source=no
3848          case .$cf_POSIX_C_SOURCE in
3849          (.[12]??*)
3850                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3851                 ;;
3852          (.2)
3853                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3854                 cf_want_posix_source=yes
3855                 ;;
3856          (.*)
3857                 cf_want_posix_source=yes
3858                 ;;
3859          esac
3860          if test "$cf_want_posix_source" = yes ; then
3861                 cat >conftest.$ac_ext <<_ACEOF
3862 #line 3862 "configure"
3863 #include "confdefs.h"
3864 #include <sys/types.h>
3865 int
3866 main (void)
3867 {
3868
3869 #ifdef _POSIX_SOURCE
3870 make an error
3871 #endif
3872   ;
3873   return 0;
3874 }
3875 _ACEOF
3876 rm -f conftest.$ac_objext
3877 if { (eval echo "$as_me:3877: \"$ac_compile\"") >&5
3878   (eval $ac_compile) 2>&5
3879   ac_status=$?
3880   echo "$as_me:3880: \$? = $ac_status" >&5
3881   (exit $ac_status); } &&
3882          { ac_try='test -s conftest.$ac_objext'
3883   { (eval echo "$as_me:3883: \"$ac_try\"") >&5
3884   (eval $ac_try) 2>&5
3885   ac_status=$?
3886   echo "$as_me:3886: \$? = $ac_status" >&5
3887   (exit $ac_status); }; }; then
3888   :
3889 else
3890   echo "$as_me: failed program was:" >&5
3891 cat conftest.$ac_ext >&5
3892 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3893 fi
3894 rm -f conftest.$ac_objext conftest.$ac_ext
3895          fi
3896
3897 echo "${as_me:-configure}:3897: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3898
3899          CFLAGS="$cf_trim_CFLAGS"
3900          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3901
3902 echo "${as_me:-configure}:3902: testing if the second compile does not leave our definition intact error ..." 1>&5
3903
3904          cat >conftest.$ac_ext <<_ACEOF
3905 #line 3905 "configure"
3906 #include "confdefs.h"
3907 #include <sys/types.h>
3908 int
3909 main (void)
3910 {
3911
3912 #ifndef _POSIX_C_SOURCE
3913 make an error
3914 #endif
3915   ;
3916   return 0;
3917 }
3918 _ACEOF
3919 rm -f conftest.$ac_objext
3920 if { (eval echo "$as_me:3920: \"$ac_compile\"") >&5
3921   (eval $ac_compile) 2>&5
3922   ac_status=$?
3923   echo "$as_me:3923: \$? = $ac_status" >&5
3924   (exit $ac_status); } &&
3925          { ac_try='test -s conftest.$ac_objext'
3926   { (eval echo "$as_me:3926: \"$ac_try\"") >&5
3927   (eval $ac_try) 2>&5
3928   ac_status=$?
3929   echo "$as_me:3929: \$? = $ac_status" >&5
3930   (exit $ac_status); }; }; then
3931   :
3932 else
3933   echo "$as_me: failed program was:" >&5
3934 cat conftest.$ac_ext >&5
3935 cf_cv_posix_c_source=no
3936 fi
3937 rm -f conftest.$ac_objext conftest.$ac_ext
3938          CFLAGS="$cf_save_CFLAGS"
3939          CPPFLAGS="$cf_save_CPPFLAGS"
3940
3941 fi
3942 rm -f conftest.$ac_objext conftest.$ac_ext
3943
3944 fi
3945 echo "$as_me:3945: result: $cf_cv_posix_c_source" >&5
3946 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3947
3948 if test "$cf_cv_posix_c_source" != no ; then
3949         CFLAGS="$cf_trim_CFLAGS"
3950         CPPFLAGS="$cf_trim_CPPFLAGS"
3951
3952 cf_fix_cppflags=no
3953 cf_new_cflags=
3954 cf_new_cppflags=
3955 cf_new_extra_cppflags=
3956
3957 for cf_add_cflags in $cf_cv_posix_c_source
3958 do
3959 case $cf_fix_cppflags in
3960 (no)
3961         case $cf_add_cflags in
3962         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3963                 case $cf_add_cflags in
3964                 (-D*)
3965                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3966
3967                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3968                                 && test -z "${cf_tst_cflags}" \
3969                                 && cf_fix_cppflags=yes
3970
3971                         if test $cf_fix_cppflags = yes ; then
3972
3973         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3974         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3975
3976                                 continue
3977                         elif test "${cf_tst_cflags}" = "\"'" ; then
3978
3979         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3980         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3981
3982                                 continue
3983                         fi
3984                         ;;
3985                 esac
3986                 case "$CPPFLAGS" in
3987                 (*$cf_add_cflags)
3988                         ;;
3989                 (*)
3990                         case $cf_add_cflags in
3991                         (-D*)
3992                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3993
3994 CPPFLAGS=`echo "$CPPFLAGS" | \
3995         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3996                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3997
3998                                 ;;
3999                         esac
4000
4001         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4002         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4003
4004                         ;;
4005                 esac
4006                 ;;
4007         (*)
4008
4009         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4010         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4011
4012                 ;;
4013         esac
4014         ;;
4015 (yes)
4016
4017         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4018         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4019
4020         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4021
4022         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4023                 && test -z "${cf_tst_cflags}" \
4024                 && cf_fix_cppflags=no
4025         ;;
4026 esac
4027 done
4028
4029 if test -n "$cf_new_cflags" ; then
4030
4031         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4032         CFLAGS="${CFLAGS}$cf_new_cflags"
4033
4034 fi
4035
4036 if test -n "$cf_new_cppflags" ; then
4037
4038         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4039         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4040
4041 fi
4042
4043 if test -n "$cf_new_extra_cppflags" ; then
4044
4045         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4046         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4047
4048 fi
4049
4050 fi
4051
4052         ;;
4053 esac
4054
4055 if test -n "$cf_xopen_source" ; then
4056
4057 cf_fix_cppflags=no
4058 cf_new_cflags=
4059 cf_new_cppflags=
4060 cf_new_extra_cppflags=
4061
4062 for cf_add_cflags in $cf_xopen_source
4063 do
4064 case $cf_fix_cppflags in
4065 (no)
4066         case $cf_add_cflags in
4067         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4068                 case $cf_add_cflags in
4069                 (-D*)
4070                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4071
4072                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4073                                 && test -z "${cf_tst_cflags}" \
4074                                 && cf_fix_cppflags=yes
4075
4076                         if test $cf_fix_cppflags = yes ; then
4077
4078         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4079         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4080
4081                                 continue
4082                         elif test "${cf_tst_cflags}" = "\"'" ; then
4083
4084         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4085         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4086
4087                                 continue
4088                         fi
4089                         ;;
4090                 esac
4091                 case "$CPPFLAGS" in
4092                 (*$cf_add_cflags)
4093                         ;;
4094                 (*)
4095                         case $cf_add_cflags in
4096                         (-D*)
4097                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4098
4099 CPPFLAGS=`echo "$CPPFLAGS" | \
4100         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4101                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4102
4103                                 ;;
4104                         esac
4105
4106         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4107         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4108
4109                         ;;
4110                 esac
4111                 ;;
4112         (*)
4113
4114         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4115         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4116
4117                 ;;
4118         esac
4119         ;;
4120 (yes)
4121
4122         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4123         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4124
4125         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4126
4127         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4128                 && test -z "${cf_tst_cflags}" \
4129                 && cf_fix_cppflags=no
4130         ;;
4131 esac
4132 done
4133
4134 if test -n "$cf_new_cflags" ; then
4135         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4136
4137 echo "${as_me:-configure}:4137: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4138
4139         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4140         CFLAGS="${CFLAGS}$cf_new_cflags"
4141
4142 fi
4143
4144 if test -n "$cf_new_cppflags" ; then
4145         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4146
4147 echo "${as_me:-configure}:4147: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4148
4149         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4150         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4151
4152 fi
4153
4154 if test -n "$cf_new_extra_cppflags" ; then
4155         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4156
4157 echo "${as_me:-configure}:4157: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4158
4159         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4160         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4161
4162 fi
4163
4164 fi
4165
4166 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4167         echo "$as_me:4167: checking if _XOPEN_SOURCE really is set" >&5
4168 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4169         cat >conftest.$ac_ext <<_ACEOF
4170 #line 4170 "configure"
4171 #include "confdefs.h"
4172 #include <stdlib.h>
4173 int
4174 main (void)
4175 {
4176
4177 #ifndef _XOPEN_SOURCE
4178 make an error
4179 #endif
4180   ;
4181   return 0;
4182 }
4183 _ACEOF
4184 rm -f conftest.$ac_objext
4185 if { (eval echo "$as_me:4185: \"$ac_compile\"") >&5
4186   (eval $ac_compile) 2>&5
4187   ac_status=$?
4188   echo "$as_me:4188: \$? = $ac_status" >&5
4189   (exit $ac_status); } &&
4190          { ac_try='test -s conftest.$ac_objext'
4191   { (eval echo "$as_me:4191: \"$ac_try\"") >&5
4192   (eval $ac_try) 2>&5
4193   ac_status=$?
4194   echo "$as_me:4194: \$? = $ac_status" >&5
4195   (exit $ac_status); }; }; then
4196   cf_XOPEN_SOURCE_set=yes
4197 else
4198   echo "$as_me: failed program was:" >&5
4199 cat conftest.$ac_ext >&5
4200 cf_XOPEN_SOURCE_set=no
4201 fi
4202 rm -f conftest.$ac_objext conftest.$ac_ext
4203         echo "$as_me:4203: result: $cf_XOPEN_SOURCE_set" >&5
4204 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4205         if test $cf_XOPEN_SOURCE_set = yes
4206         then
4207                 cat >conftest.$ac_ext <<_ACEOF
4208 #line 4208 "configure"
4209 #include "confdefs.h"
4210 #include <stdlib.h>
4211 int
4212 main (void)
4213 {
4214
4215 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4216 make an error
4217 #endif
4218   ;
4219   return 0;
4220 }
4221 _ACEOF
4222 rm -f conftest.$ac_objext
4223 if { (eval echo "$as_me:4223: \"$ac_compile\"") >&5
4224   (eval $ac_compile) 2>&5
4225   ac_status=$?
4226   echo "$as_me:4226: \$? = $ac_status" >&5
4227   (exit $ac_status); } &&
4228          { ac_try='test -s conftest.$ac_objext'
4229   { (eval echo "$as_me:4229: \"$ac_try\"") >&5
4230   (eval $ac_try) 2>&5
4231   ac_status=$?
4232   echo "$as_me:4232: \$? = $ac_status" >&5
4233   (exit $ac_status); }; }; then
4234   cf_XOPEN_SOURCE_set_ok=yes
4235 else
4236   echo "$as_me: failed program was:" >&5
4237 cat conftest.$ac_ext >&5
4238 cf_XOPEN_SOURCE_set_ok=no
4239 fi
4240 rm -f conftest.$ac_objext conftest.$ac_ext
4241                 if test $cf_XOPEN_SOURCE_set_ok = no
4242                 then
4243                         { echo "$as_me:4243: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4244 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4245                 fi
4246         else
4247
4248 echo "$as_me:4248: checking if we should define _XOPEN_SOURCE" >&5
4249 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4250 if test "${cf_cv_xopen_source+set}" = set; then
4251   echo $ECHO_N "(cached) $ECHO_C" >&6
4252 else
4253
4254         cat >conftest.$ac_ext <<_ACEOF
4255 #line 4255 "configure"
4256 #include "confdefs.h"
4257
4258 #include <stdlib.h>
4259 #include <string.h>
4260 #include <sys/types.h>
4261
4262 int
4263 main (void)
4264 {
4265
4266 #ifndef _XOPEN_SOURCE
4267 make an error
4268 #endif
4269   ;
4270   return 0;
4271 }
4272 _ACEOF
4273 rm -f conftest.$ac_objext
4274 if { (eval echo "$as_me:4274: \"$ac_compile\"") >&5
4275   (eval $ac_compile) 2>&5
4276   ac_status=$?
4277   echo "$as_me:4277: \$? = $ac_status" >&5
4278   (exit $ac_status); } &&
4279          { ac_try='test -s conftest.$ac_objext'
4280   { (eval echo "$as_me:4280: \"$ac_try\"") >&5
4281   (eval $ac_try) 2>&5
4282   ac_status=$?
4283   echo "$as_me:4283: \$? = $ac_status" >&5
4284   (exit $ac_status); }; }; then
4285   cf_cv_xopen_source=no
4286 else
4287   echo "$as_me: failed program was:" >&5
4288 cat conftest.$ac_ext >&5
4289 cf_save="$CPPFLAGS"
4290          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4291          cat >conftest.$ac_ext <<_ACEOF
4292 #line 4292 "configure"
4293 #include "confdefs.h"
4294
4295 #include <stdlib.h>
4296 #include <string.h>
4297 #include <sys/types.h>
4298
4299 int
4300 main (void)
4301 {
4302
4303 #ifdef _XOPEN_SOURCE
4304 make an error
4305 #endif
4306   ;
4307   return 0;
4308 }
4309 _ACEOF
4310 rm -f conftest.$ac_objext
4311 if { (eval echo "$as_me:4311: \"$ac_compile\"") >&5
4312   (eval $ac_compile) 2>&5
4313   ac_status=$?
4314   echo "$as_me:4314: \$? = $ac_status" >&5
4315   (exit $ac_status); } &&
4316          { ac_try='test -s conftest.$ac_objext'
4317   { (eval echo "$as_me:4317: \"$ac_try\"") >&5
4318   (eval $ac_try) 2>&5
4319   ac_status=$?
4320   echo "$as_me:4320: \$? = $ac_status" >&5
4321   (exit $ac_status); }; }; then
4322   cf_cv_xopen_source=no
4323 else
4324   echo "$as_me: failed program was:" >&5
4325 cat conftest.$ac_ext >&5
4326 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4327 fi
4328 rm -f conftest.$ac_objext conftest.$ac_ext
4329         CPPFLAGS="$cf_save"
4330
4331 fi
4332 rm -f conftest.$ac_objext conftest.$ac_ext
4333
4334 fi
4335 echo "$as_me:4335: result: $cf_cv_xopen_source" >&5
4336 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4337
4338 if test "$cf_cv_xopen_source" != no ; then
4339
4340 CFLAGS=`echo "$CFLAGS" | \
4341         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4342                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4343
4344 CPPFLAGS=`echo "$CPPFLAGS" | \
4345         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4346                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4347
4348         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4349
4350 cf_fix_cppflags=no
4351 cf_new_cflags=
4352 cf_new_cppflags=
4353 cf_new_extra_cppflags=
4354
4355 for cf_add_cflags in $cf_temp_xopen_source
4356 do
4357 case $cf_fix_cppflags in
4358 (no)
4359         case $cf_add_cflags in
4360         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4361                 case $cf_add_cflags in
4362                 (-D*)
4363                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4364
4365                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4366                                 && test -z "${cf_tst_cflags}" \
4367                                 && cf_fix_cppflags=yes
4368
4369                         if test $cf_fix_cppflags = yes ; then
4370
4371         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4372         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4373
4374                                 continue
4375                         elif test "${cf_tst_cflags}" = "\"'" ; then
4376
4377         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4378         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4379
4380                                 continue
4381                         fi
4382                         ;;
4383                 esac
4384                 case "$CPPFLAGS" in
4385                 (*$cf_add_cflags)
4386                         ;;
4387                 (*)
4388                         case $cf_add_cflags in
4389                         (-D*)
4390                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4391
4392 CPPFLAGS=`echo "$CPPFLAGS" | \
4393         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4394                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4395
4396                                 ;;
4397                         esac
4398
4399         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4400         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4401
4402                         ;;
4403                 esac
4404                 ;;
4405         (*)
4406
4407         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4408         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4409
4410                 ;;
4411         esac
4412         ;;
4413 (yes)
4414
4415         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4416         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4417
4418         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4419
4420         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4421                 && test -z "${cf_tst_cflags}" \
4422                 && cf_fix_cppflags=no
4423         ;;
4424 esac
4425 done
4426
4427 if test -n "$cf_new_cflags" ; then
4428
4429         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4430         CFLAGS="${CFLAGS}$cf_new_cflags"
4431
4432 fi
4433
4434 if test -n "$cf_new_cppflags" ; then
4435
4436         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4437         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4438
4439 fi
4440
4441 if test -n "$cf_new_extra_cppflags" ; then
4442
4443         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4444         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4445
4446 fi
4447
4448 fi
4449
4450         fi
4451 fi
4452
4453 echo "$as_me:4453: checking for signal global datatype" >&5
4454 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4455 if test "${cf_cv_sig_atomic_t+set}" = set; then
4456   echo $ECHO_N "(cached) $ECHO_C" >&6
4457 else
4458
4459         for cf_type in \
4460                 "volatile sig_atomic_t" \
4461                 "sig_atomic_t" \
4462                 "int"
4463         do
4464         cat >conftest.$ac_ext <<_ACEOF
4465 #line 4465 "configure"
4466 #include "confdefs.h"
4467
4468 #include <sys/types.h>
4469 #include <signal.h>
4470 #include <stdio.h>
4471
4472 extern $cf_type x;
4473 $cf_type x;
4474 static void handler(int sig)
4475 {
4476         x = 5;
4477 }
4478 int
4479 main (void)
4480 {
4481 signal(SIGINT, handler);
4482                  x = 1
4483   ;
4484   return 0;
4485 }
4486 _ACEOF
4487 rm -f conftest.$ac_objext
4488 if { (eval echo "$as_me:4488: \"$ac_compile\"") >&5
4489   (eval $ac_compile) 2>&5
4490   ac_status=$?
4491   echo "$as_me:4491: \$? = $ac_status" >&5
4492   (exit $ac_status); } &&
4493          { ac_try='test -s conftest.$ac_objext'
4494   { (eval echo "$as_me:4494: \"$ac_try\"") >&5
4495   (eval $ac_try) 2>&5
4496   ac_status=$?
4497   echo "$as_me:4497: \$? = $ac_status" >&5
4498   (exit $ac_status); }; }; then
4499   cf_cv_sig_atomic_t=$cf_type
4500 else
4501   echo "$as_me: failed program was:" >&5
4502 cat conftest.$ac_ext >&5
4503 cf_cv_sig_atomic_t=no
4504 fi
4505 rm -f conftest.$ac_objext conftest.$ac_ext
4506                 test "$cf_cv_sig_atomic_t" != no && break
4507         done
4508
4509 fi
4510
4511 echo "$as_me:4511: result: $cf_cv_sig_atomic_t" >&5
4512 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4513 test "$cf_cv_sig_atomic_t" != no &&
4514 cat >>confdefs.h <<EOF
4515 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4516 EOF
4517
4518 # Work around breakage on OS X
4519
4520 echo "$as_me:4520: checking if SIGWINCH is defined" >&5
4521 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4522 if test "${cf_cv_define_sigwinch+set}" = set; then
4523   echo $ECHO_N "(cached) $ECHO_C" >&6
4524 else
4525
4526         cat >conftest.$ac_ext <<_ACEOF
4527 #line 4527 "configure"
4528 #include "confdefs.h"
4529
4530 #include <sys/types.h>
4531 #include <sys/signal.h>
4532
4533 int
4534 main (void)
4535 {
4536 int x = SIGWINCH
4537   ;
4538   return 0;
4539 }
4540 _ACEOF
4541 rm -f conftest.$ac_objext
4542 if { (eval echo "$as_me:4542: \"$ac_compile\"") >&5
4543   (eval $ac_compile) 2>&5
4544   ac_status=$?
4545   echo "$as_me:4545: \$? = $ac_status" >&5
4546   (exit $ac_status); } &&
4547          { ac_try='test -s conftest.$ac_objext'
4548   { (eval echo "$as_me:4548: \"$ac_try\"") >&5
4549   (eval $ac_try) 2>&5
4550   ac_status=$?
4551   echo "$as_me:4551: \$? = $ac_status" >&5
4552   (exit $ac_status); }; }; then
4553   cf_cv_define_sigwinch=yes
4554 else
4555   echo "$as_me: failed program was:" >&5
4556 cat conftest.$ac_ext >&5
4557 cat >conftest.$ac_ext <<_ACEOF
4558 #line 4558 "configure"
4559 #include "confdefs.h"
4560
4561 #undef _XOPEN_SOURCE
4562 #undef _POSIX_SOURCE
4563 #undef _POSIX_C_SOURCE
4564 #include <sys/types.h>
4565 #include <sys/signal.h>
4566
4567 int
4568 main (void)
4569 {
4570 int x = SIGWINCH
4571   ;
4572   return 0;
4573 }
4574 _ACEOF
4575 rm -f conftest.$ac_objext
4576 if { (eval echo "$as_me:4576: \"$ac_compile\"") >&5
4577   (eval $ac_compile) 2>&5
4578   ac_status=$?
4579   echo "$as_me:4579: \$? = $ac_status" >&5
4580   (exit $ac_status); } &&
4581          { ac_try='test -s conftest.$ac_objext'
4582   { (eval echo "$as_me:4582: \"$ac_try\"") >&5
4583   (eval $ac_try) 2>&5
4584   ac_status=$?
4585   echo "$as_me:4585: \$? = $ac_status" >&5
4586   (exit $ac_status); }; }; then
4587   cf_cv_define_sigwinch=maybe
4588 else
4589   echo "$as_me: failed program was:" >&5
4590 cat conftest.$ac_ext >&5
4591 cf_cv_define_sigwinch=no
4592 fi
4593 rm -f conftest.$ac_objext conftest.$ac_ext
4594
4595 fi
4596 rm -f conftest.$ac_objext conftest.$ac_ext
4597
4598 fi
4599 echo "$as_me:4599: result: $cf_cv_define_sigwinch" >&5
4600 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4601
4602 if test "$cf_cv_define_sigwinch" = maybe ; then
4603 echo "$as_me:4603: checking for actual SIGWINCH definition" >&5
4604 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4605 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4606   echo $ECHO_N "(cached) $ECHO_C" >&6
4607 else
4608
4609 cf_cv_fixup_sigwinch=unknown
4610 cf_sigwinch=32
4611 while test $cf_sigwinch != 1
4612 do
4613         cat >conftest.$ac_ext <<_ACEOF
4614 #line 4614 "configure"
4615 #include "confdefs.h"
4616
4617 #undef _XOPEN_SOURCE
4618 #undef _POSIX_SOURCE
4619 #undef _POSIX_C_SOURCE
4620 #include <sys/types.h>
4621 #include <sys/signal.h>
4622
4623 int
4624 main (void)
4625 {
4626
4627 #if SIGWINCH != $cf_sigwinch
4628 make an error
4629 #endif
4630 int x = SIGWINCH
4631   ;
4632   return 0;
4633 }
4634 _ACEOF
4635 rm -f conftest.$ac_objext
4636 if { (eval echo "$as_me:4636: \"$ac_compile\"") >&5
4637   (eval $ac_compile) 2>&5
4638   ac_status=$?
4639   echo "$as_me:4639: \$? = $ac_status" >&5
4640   (exit $ac_status); } &&
4641          { ac_try='test -s conftest.$ac_objext'
4642   { (eval echo "$as_me:4642: \"$ac_try\"") >&5
4643   (eval $ac_try) 2>&5
4644   ac_status=$?
4645   echo "$as_me:4645: \$? = $ac_status" >&5
4646   (exit $ac_status); }; }; then
4647   cf_cv_fixup_sigwinch=$cf_sigwinch
4648          break
4649 else
4650   echo "$as_me: failed program was:" >&5
4651 cat conftest.$ac_ext >&5
4652 fi
4653 rm -f conftest.$ac_objext conftest.$ac_ext
4654
4655 cf_sigwinch=`expr $cf_sigwinch - 1`
4656 done
4657
4658 fi
4659 echo "$as_me:4659: result: $cf_cv_fixup_sigwinch" >&5
4660 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4661
4662         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4663                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4664         fi
4665 fi
4666
4667 # Checks for CODESET support.
4668
4669 echo "$as_me:4669: checking for nl_langinfo and CODESET" >&5
4670 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4671 if test "${am_cv_langinfo_codeset+set}" = set; then
4672   echo $ECHO_N "(cached) $ECHO_C" >&6
4673 else
4674   cat >conftest.$ac_ext <<_ACEOF
4675 #line 4675 "configure"
4676 #include "confdefs.h"
4677 #include <langinfo.h>
4678 int
4679 main (void)
4680 {
4681 char* cs = nl_langinfo(CODESET);
4682   ;
4683   return 0;
4684 }
4685 _ACEOF
4686 rm -f conftest.$ac_objext conftest$ac_exeext
4687 if { (eval echo "$as_me:4687: \"$ac_link\"") >&5
4688   (eval $ac_link) 2>&5
4689   ac_status=$?
4690   echo "$as_me:4690: \$? = $ac_status" >&5
4691   (exit $ac_status); } &&
4692          { ac_try='test -s conftest$ac_exeext'
4693   { (eval echo "$as_me:4693: \"$ac_try\"") >&5
4694   (eval $ac_try) 2>&5
4695   ac_status=$?
4696   echo "$as_me:4696: \$? = $ac_status" >&5
4697   (exit $ac_status); }; }; then
4698   am_cv_langinfo_codeset=yes
4699 else
4700   echo "$as_me: failed program was:" >&5
4701 cat conftest.$ac_ext >&5
4702 am_cv_langinfo_codeset=no
4703 fi
4704 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4705
4706 fi
4707 echo "$as_me:4707: result: $am_cv_langinfo_codeset" >&5
4708 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4709         if test $am_cv_langinfo_codeset = yes; then
4710
4711 cat >>confdefs.h <<\EOF
4712 #define HAVE_LANGINFO_CODESET 1
4713 EOF
4714
4715         fi
4716
4717 echo "$as_me:4717: checking if you want to use pkg-config" >&5
4718 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4719
4720 # Check whether --with-pkg-config or --without-pkg-config was given.
4721 if test "${with_pkg_config+set}" = set; then
4722   withval="$with_pkg_config"
4723   cf_pkg_config=$withval
4724 else
4725   cf_pkg_config=yes
4726 fi;
4727 echo "$as_me:4727: result: $cf_pkg_config" >&5
4728 echo "${ECHO_T}$cf_pkg_config" >&6
4729
4730 case $cf_pkg_config in
4731 (no)
4732         PKG_CONFIG=none
4733         ;;
4734 (yes)
4735
4736 if test -n "$ac_tool_prefix"; then
4737   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4738 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4739 echo "$as_me:4739: checking for $ac_word" >&5
4740 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4741 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4742   echo $ECHO_N "(cached) $ECHO_C" >&6
4743 else
4744   case $PKG_CONFIG in
4745   [\\/]* | ?:[\\/]*)
4746   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4747   ;;
4748   *)
4749   ac_save_IFS=$IFS; IFS=$ac_path_separator
4750 ac_dummy="$PATH"
4751 for ac_dir in $ac_dummy; do
4752   IFS=$ac_save_IFS
4753   test -z "$ac_dir" && ac_dir=.
4754   if $as_executable_p "$ac_dir/$ac_word"; then
4755    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4756    echo "$as_me:4756: found $ac_dir/$ac_word" >&5
4757    break
4758 fi
4759 done
4760
4761   ;;
4762 esac
4763 fi
4764 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4765
4766 if test -n "$PKG_CONFIG"; then
4767   echo "$as_me:4767: result: $PKG_CONFIG" >&5
4768 echo "${ECHO_T}$PKG_CONFIG" >&6
4769 else
4770   echo "$as_me:4770: result: no" >&5
4771 echo "${ECHO_T}no" >&6
4772 fi
4773
4774 fi
4775 if test -z "$ac_cv_path_PKG_CONFIG"; then
4776   ac_pt_PKG_CONFIG=$PKG_CONFIG
4777   # Extract the first word of "pkg-config", so it can be a program name with args.
4778 set dummy pkg-config; ac_word=$2
4779 echo "$as_me:4779: checking for $ac_word" >&5
4780 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4781 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4782   echo $ECHO_N "(cached) $ECHO_C" >&6
4783 else
4784   case $ac_pt_PKG_CONFIG in
4785   [\\/]* | ?:[\\/]*)
4786   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4787   ;;
4788   *)
4789   ac_save_IFS=$IFS; IFS=$ac_path_separator
4790 ac_dummy="$PATH"
4791 for ac_dir in $ac_dummy; do
4792   IFS=$ac_save_IFS
4793   test -z "$ac_dir" && ac_dir=.
4794   if $as_executable_p "$ac_dir/$ac_word"; then
4795    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4796    echo "$as_me:4796: found $ac_dir/$ac_word" >&5
4797    break
4798 fi
4799 done
4800
4801   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4802   ;;
4803 esac
4804 fi
4805 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4806
4807 if test -n "$ac_pt_PKG_CONFIG"; then
4808   echo "$as_me:4808: result: $ac_pt_PKG_CONFIG" >&5
4809 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4810 else
4811   echo "$as_me:4811: result: no" >&5
4812 echo "${ECHO_T}no" >&6
4813 fi
4814
4815   PKG_CONFIG=$ac_pt_PKG_CONFIG
4816 else
4817   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4818 fi
4819
4820         ;;
4821 (*)
4822         PKG_CONFIG=$withval
4823         ;;
4824 esac
4825
4826 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4827 if test "$PKG_CONFIG" != none ; then
4828
4829 if test "x$prefix" != xNONE; then
4830         cf_path_syntax="$prefix"
4831 else
4832         cf_path_syntax="$ac_default_prefix"
4833 fi
4834
4835 case ".$PKG_CONFIG" in
4836 (.\$\(*\)*|.\'*\'*)
4837         ;;
4838 (..|./*|.\\*)
4839         ;;
4840 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4841         ;;
4842 (.\${*prefix}*|.\${*dir}*)
4843         eval PKG_CONFIG="$PKG_CONFIG"
4844         case ".$PKG_CONFIG" in
4845         (.NONE/*)
4846                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4847                 ;;
4848         esac
4849         ;;
4850 (.no|.NONE/*)
4851         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4852         ;;
4853 (*)
4854         { { echo "$as_me:4854: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4855 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4856    { (exit 1); exit 1; }; }
4857         ;;
4858 esac
4859
4860 elif test "x$cf_pkg_config" != xno ; then
4861         { echo "$as_me:4861: WARNING: pkg-config is not installed" >&5
4862 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4863 fi
4864
4865 echo "$as_me:4865: checking if you want to see long compiling messages" >&5
4866 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4867
4868 # Check whether --enable-echo or --disable-echo was given.
4869 if test "${enable_echo+set}" = set; then
4870   enableval="$enable_echo"
4871   test "$enableval" != no && enableval=yes
4872         if test "$enableval" != "yes" ; then
4873
4874         ECHO_LT='--silent'
4875         ECHO_LD='@echo linking $@;'
4876         RULE_CC='@echo compiling $<'
4877         SHOW_CC='@echo compiling $@'
4878         ECHO_CC='@'
4879
4880         else
4881
4882         ECHO_LT=''
4883         ECHO_LD=''
4884         RULE_CC=''
4885         SHOW_CC=''
4886         ECHO_CC=''
4887
4888         fi
4889 else
4890   enableval=yes
4891
4892         ECHO_LT=''
4893         ECHO_LD=''
4894         RULE_CC=''
4895         SHOW_CC=''
4896         ECHO_CC=''
4897
4898 fi;
4899 echo "$as_me:4899: result: $enableval" >&5
4900 echo "${ECHO_T}$enableval" >&6
4901
4902 echo "$as_me:4902: checking for ncurses wrap-prefix" >&5
4903 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4904
4905 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4906 if test "${with_ncurses_wrap_prefix+set}" = set; then
4907   withval="$with_ncurses_wrap_prefix"
4908   NCURSES_WRAP_PREFIX=$withval
4909 else
4910   NCURSES_WRAP_PREFIX=_nc_
4911 fi;
4912 echo "$as_me:4912: result: $NCURSES_WRAP_PREFIX" >&5
4913 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4914
4915 echo "$as_me:4915: checking if you want to check for wide-character functions" >&5
4916 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4917
4918 # Check whether --enable-widec or --disable-widec was given.
4919 if test "${enable_widec+set}" = set; then
4920   enableval="$enable_widec"
4921   test "$enableval" != no && enableval=yes
4922         if test "$enableval" != "yes" ; then
4923     cf_enable_widec=no
4924         else
4925                 cf_enable_widec=yes
4926         fi
4927 else
4928   enableval=yes
4929         cf_enable_widec=yes
4930
4931 fi;
4932 echo "$as_me:4932: result: $cf_enable_widec" >&5
4933 echo "${ECHO_T}$cf_enable_widec" >&6
4934
4935 echo "$as_me:4935: checking for specific curses-directory" >&5
4936 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4937
4938 # Check whether --with-curses-dir or --without-curses-dir was given.
4939 if test "${with_curses_dir+set}" = set; then
4940   withval="$with_curses_dir"
4941   cf_cv_curses_dir=$withval
4942 else
4943   cf_cv_curses_dir=no
4944 fi;
4945 echo "$as_me:4945: result: $cf_cv_curses_dir" >&5
4946 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4947
4948 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4949 then
4950
4951 if test "x$prefix" != xNONE; then
4952         cf_path_syntax="$prefix"
4953 else
4954         cf_path_syntax="$ac_default_prefix"
4955 fi
4956
4957 case ".$withval" in
4958 (.\$\(*\)*|.\'*\'*)
4959         ;;
4960 (..|./*|.\\*)
4961         ;;
4962 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4963         ;;
4964 (.\${*prefix}*|.\${*dir}*)
4965         eval withval="$withval"
4966         case ".$withval" in
4967         (.NONE/*)
4968                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4969                 ;;
4970         esac
4971         ;;
4972 (.no|.NONE/*)
4973         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4974         ;;
4975 (*)
4976         { { echo "$as_me:4976: error: expected a pathname, not \"$withval\"" >&5
4977 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4978    { (exit 1); exit 1; }; }
4979         ;;
4980 esac
4981
4982         if test -d "$cf_cv_curses_dir"
4983         then
4984
4985 if test -n "$cf_cv_curses_dir/include" ; then
4986   for cf_add_incdir in $cf_cv_curses_dir/include
4987   do
4988         while test $cf_add_incdir != /usr/include
4989         do
4990           if test -d $cf_add_incdir
4991           then
4992                 cf_have_incdir=no
4993                 if test -n "$CFLAGS$CPPFLAGS" ; then
4994                   # a loop is needed to ensure we can add subdirs of existing dirs
4995                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4996                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4997                           cf_have_incdir=yes; break
4998                         fi
4999                   done
5000                 fi
5001
5002                 if test "$cf_have_incdir" = no ; then
5003                   if test "$cf_add_incdir" = /usr/local/include ; then
5004                         if test "$GCC" = yes
5005                         then
5006                           cf_save_CPPFLAGS=$CPPFLAGS
5007                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5008                           cat >conftest.$ac_ext <<_ACEOF
5009 #line 5009 "configure"
5010 #include "confdefs.h"
5011 #include <stdio.h>
5012 int
5013 main (void)
5014 {
5015 printf("Hello")
5016   ;
5017   return 0;
5018 }
5019 _ACEOF
5020 rm -f conftest.$ac_objext
5021 if { (eval echo "$as_me:5021: \"$ac_compile\"") >&5
5022   (eval $ac_compile) 2>&5
5023   ac_status=$?
5024   echo "$as_me:5024: \$? = $ac_status" >&5
5025   (exit $ac_status); } &&
5026          { ac_try='test -s conftest.$ac_objext'
5027   { (eval echo "$as_me:5027: \"$ac_try\"") >&5
5028   (eval $ac_try) 2>&5
5029   ac_status=$?
5030   echo "$as_me:5030: \$? = $ac_status" >&5
5031   (exit $ac_status); }; }; then
5032   :
5033 else
5034   echo "$as_me: failed program was:" >&5
5035 cat conftest.$ac_ext >&5
5036 cf_have_incdir=yes
5037 fi
5038 rm -f conftest.$ac_objext conftest.$ac_ext
5039                           CPPFLAGS=$cf_save_CPPFLAGS
5040                         fi
5041                   fi
5042                 fi
5043
5044                 if test "$cf_have_incdir" = no ; then
5045                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5046
5047 echo "${as_me:-configure}:5047: testing adding $cf_add_incdir to include-path ..." 1>&5
5048
5049                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5050
5051                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5052                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5053                   cf_add_incdir="$cf_top_incdir"
5054                 else
5055                   break
5056                 fi
5057           else
5058                 break
5059           fi
5060         done
5061   done
5062 fi
5063
5064 if test -n "$cf_cv_curses_dir/lib" ; then
5065         for cf_add_libdir in $cf_cv_curses_dir/lib
5066         do
5067                 if test $cf_add_libdir = /usr/lib ; then
5068                         :
5069                 elif test -d $cf_add_libdir
5070                 then
5071                         cf_have_libdir=no
5072                         if test -n "$LDFLAGS$LIBS" ; then
5073                                 # a loop is needed to ensure we can add subdirs of existing dirs
5074                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5075                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5076                                                 cf_have_libdir=yes; break
5077                                         fi
5078                                 done
5079                         fi
5080                         if test "$cf_have_libdir" = no ; then
5081                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5082
5083 echo "${as_me:-configure}:5083: testing adding $cf_add_libdir to library-path ..." 1>&5
5084
5085                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5086                         fi
5087                 fi
5088         done
5089 fi
5090
5091         fi
5092 fi
5093
5094 cf_cv_screen=curses
5095
5096 echo "$as_me:5096: checking for specified curses library type" >&5
5097 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5098
5099 # Check whether --with-screen or --without-screen was given.
5100 if test "${with_screen+set}" = set; then
5101   withval="$with_screen"
5102   cf_cv_screen=$withval
5103 else
5104
5105 # Check whether --with-ncursesw or --without-ncursesw was given.
5106 if test "${with_ncursesw+set}" = set; then
5107   withval="$with_ncursesw"
5108   cf_cv_screen=ncursesw
5109 else
5110
5111 # Check whether --with-ncurses or --without-ncurses was given.
5112 if test "${with_ncurses+set}" = set; then
5113   withval="$with_ncurses"
5114   cf_cv_screen=ncurses
5115 else
5116
5117 # Check whether --with-pdcurses or --without-pdcurses was given.
5118 if test "${with_pdcurses+set}" = set; then
5119   withval="$with_pdcurses"
5120   cf_cv_screen=pdcurses
5121 else
5122
5123 # Check whether --with-curses-colr or --without-curses-colr was given.
5124 if test "${with_curses_colr+set}" = set; then
5125   withval="$with_curses_colr"
5126   cf_cv_screen=curses_colr
5127 else
5128
5129 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5130 if test "${with_curses_5lib+set}" = set; then
5131   withval="$with_curses_5lib"
5132   cf_cv_screen=curses_5lib
5133 fi;
5134 fi;
5135 fi;
5136 fi;
5137 fi;
5138 fi;
5139
5140 echo "$as_me:5140: result: $cf_cv_screen" >&5
5141 echo "${ECHO_T}$cf_cv_screen" >&6
5142
5143 case $cf_cv_screen in
5144 (curses|curses_*)
5145
5146 echo "$as_me:5146: checking for extra include directories" >&5
5147 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5148 if test "${cf_cv_curses_incdir+set}" = set; then
5149   echo $ECHO_N "(cached) $ECHO_C" >&6
5150 else
5151
5152 cf_cv_curses_incdir=no
5153 case $host_os in
5154 (hpux10.*)
5155         if test "x$cf_cv_screen" = "xcurses_colr"
5156         then
5157                 test -d /usr/include/curses_colr && \
5158                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5159         fi
5160         ;;
5161 (sunos3*|sunos4*)
5162         if test "x$cf_cv_screen" = "xcurses_5lib"
5163         then
5164                 test -d /usr/5lib && \
5165                 test -d /usr/5include && \
5166                 cf_cv_curses_incdir="-I/usr/5include"
5167         fi
5168         ;;
5169 esac
5170
5171 fi
5172 echo "$as_me:5172: result: $cf_cv_curses_incdir" >&5
5173 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5174 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5175
5176 echo "$as_me:5176: checking if we have identified curses headers" >&5
5177 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5178 if test "${cf_cv_ncurses_header+set}" = set; then
5179   echo $ECHO_N "(cached) $ECHO_C" >&6
5180 else
5181
5182 cf_cv_ncurses_header=none
5183 for cf_header in \
5184         ncurses.h  \
5185         curses.h  ncurses/ncurses.h ncurses/curses.h
5186 do
5187 cat >conftest.$ac_ext <<_ACEOF
5188 #line 5188 "configure"
5189 #include "confdefs.h"
5190 #include <${cf_header}>
5191 int
5192 main (void)
5193 {
5194 initscr(); tgoto("?", 0,0)
5195   ;
5196   return 0;
5197 }
5198 _ACEOF
5199 rm -f conftest.$ac_objext
5200 if { (eval echo "$as_me:5200: \"$ac_compile\"") >&5
5201   (eval $ac_compile) 2>&5
5202   ac_status=$?
5203   echo "$as_me:5203: \$? = $ac_status" >&5
5204   (exit $ac_status); } &&
5205          { ac_try='test -s conftest.$ac_objext'
5206   { (eval echo "$as_me:5206: \"$ac_try\"") >&5
5207   (eval $ac_try) 2>&5
5208   ac_status=$?
5209   echo "$as_me:5209: \$? = $ac_status" >&5
5210   (exit $ac_status); }; }; then
5211   cf_cv_ncurses_header=$cf_header; break
5212 else
5213   echo "$as_me: failed program was:" >&5
5214 cat conftest.$ac_ext >&5
5215 fi
5216 rm -f conftest.$ac_objext conftest.$ac_ext
5217 done
5218
5219 fi
5220 echo "$as_me:5220: result: $cf_cv_ncurses_header" >&5
5221 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5222
5223 if test "$cf_cv_ncurses_header" = none ; then
5224         { { echo "$as_me:5224: error: No curses header-files found" >&5
5225 echo "$as_me: error: No curses header-files found" >&2;}
5226    { (exit 1); exit 1; }; }
5227 fi
5228
5229 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5230
5231 for ac_header in $cf_cv_ncurses_header
5232 do
5233 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5234 echo "$as_me:5234: checking for $ac_header" >&5
5235 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5236 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5237   echo $ECHO_N "(cached) $ECHO_C" >&6
5238 else
5239   cat >conftest.$ac_ext <<_ACEOF
5240 #line 5240 "configure"
5241 #include "confdefs.h"
5242 #include <$ac_header>
5243 _ACEOF
5244 if { (eval echo "$as_me:5244: \"$ac_cpp conftest.$ac_ext\"") >&5
5245   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5246   ac_status=$?
5247   egrep -v '^ *\+' conftest.er1 >conftest.err
5248   rm -f conftest.er1
5249   cat conftest.err >&5
5250   echo "$as_me:5250: \$? = $ac_status" >&5
5251   (exit $ac_status); } >/dev/null; then
5252   if test -s conftest.err; then
5253     ac_cpp_err=$ac_c_preproc_warn_flag
5254   else
5255     ac_cpp_err=
5256   fi
5257 else
5258   ac_cpp_err=yes
5259 fi
5260 if test -z "$ac_cpp_err"; then
5261   eval "$as_ac_Header=yes"
5262 else
5263   echo "$as_me: failed program was:" >&5
5264   cat conftest.$ac_ext >&5
5265   eval "$as_ac_Header=no"
5266 fi
5267 rm -f conftest.err conftest.$ac_ext
5268 fi
5269 echo "$as_me:5269: result: `eval echo '${'$as_ac_Header'}'`" >&5
5270 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5271 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5272   cat >>confdefs.h <<EOF
5273 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5274 EOF
5275
5276 fi
5277 done
5278
5279 echo "$as_me:5279: checking for terminfo header" >&5
5280 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5281 if test "${cf_cv_term_header+set}" = set; then
5282   echo $ECHO_N "(cached) $ECHO_C" >&6
5283 else
5284
5285 case ${cf_cv_ncurses_header} in
5286 (*/ncurses.h|*/ncursesw.h)
5287         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5288         ;;
5289 (*)
5290         cf_term_header=term.h
5291         ;;
5292 esac
5293
5294 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5295 do
5296 cat >conftest.$ac_ext <<_ACEOF
5297 #line 5297 "configure"
5298 #include "confdefs.h"
5299 #include <stdio.h>
5300 #include <${cf_cv_ncurses_header:-curses.h}>
5301 #include <$cf_test>
5302
5303 int
5304 main (void)
5305 {
5306 int x = auto_left_margin
5307   ;
5308   return 0;
5309 }
5310 _ACEOF
5311 rm -f conftest.$ac_objext
5312 if { (eval echo "$as_me:5312: \"$ac_compile\"") >&5
5313   (eval $ac_compile) 2>&5
5314   ac_status=$?
5315   echo "$as_me:5315: \$? = $ac_status" >&5
5316   (exit $ac_status); } &&
5317          { ac_try='test -s conftest.$ac_objext'
5318   { (eval echo "$as_me:5318: \"$ac_try\"") >&5
5319   (eval $ac_try) 2>&5
5320   ac_status=$?
5321   echo "$as_me:5321: \$? = $ac_status" >&5
5322   (exit $ac_status); }; }; then
5323
5324         cf_cv_term_header="$cf_test"
5325 else
5326   echo "$as_me: failed program was:" >&5
5327 cat conftest.$ac_ext >&5
5328
5329         cf_cv_term_header=unknown
5330
5331 fi
5332 rm -f conftest.$ac_objext conftest.$ac_ext
5333         test "$cf_cv_term_header" != unknown && break
5334 done
5335
5336 fi
5337 echo "$as_me:5337: result: $cf_cv_term_header" >&5
5338 echo "${ECHO_T}$cf_cv_term_header" >&6
5339
5340 # Set definitions to allow ifdef'ing to accommodate subdirectories
5341
5342 case $cf_cv_term_header in
5343 (*term.h)
5344
5345 cat >>confdefs.h <<\EOF
5346 #define HAVE_TERM_H 1
5347 EOF
5348
5349         ;;
5350 esac
5351
5352 case $cf_cv_term_header in
5353 (ncurses/term.h)
5354
5355 cat >>confdefs.h <<\EOF
5356 #define HAVE_NCURSES_TERM_H 1
5357 EOF
5358
5359         ;;
5360 (ncursesw/term.h)
5361
5362 cat >>confdefs.h <<\EOF
5363 #define HAVE_NCURSESW_TERM_H 1
5364 EOF
5365
5366         ;;
5367 esac
5368
5369 echo "$as_me:5369: checking for ncurses version" >&5
5370 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5371 if test "${cf_cv_ncurses_version+set}" = set; then
5372   echo $ECHO_N "(cached) $ECHO_C" >&6
5373 else
5374
5375         cf_cv_ncurses_version=no
5376         cf_tempfile=out$$
5377         rm -f $cf_tempfile
5378         if test "$cross_compiling" = yes; then
5379
5380         # This will not work if the preprocessor splits the line after the
5381         # Autoconf token.  The 'unproto' program does that.
5382         cat > conftest.$ac_ext <<EOF
5383 #include <${cf_cv_ncurses_header:-curses.h}>
5384 #undef Autoconf
5385 #ifdef NCURSES_VERSION
5386 Autoconf NCURSES_VERSION
5387 #else
5388 #ifdef __NCURSES_H
5389 Autoconf "old"
5390 #endif
5391 ;
5392 #endif
5393 EOF
5394         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5395         { (eval echo "$as_me:5395: \"$cf_try\"") >&5
5396   (eval $cf_try) 2>&5
5397   ac_status=$?
5398   echo "$as_me:5398: \$? = $ac_status" >&5
5399   (exit $ac_status); }
5400         if test -f conftest.out ; then
5401                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5402                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5403                 rm -f conftest.out
5404         fi
5405
5406 else
5407   cat >conftest.$ac_ext <<_ACEOF
5408 #line 5408 "configure"
5409 #include "confdefs.h"
5410
5411 #include <${cf_cv_ncurses_header:-curses.h}>
5412 #include <stdio.h>
5413 int main(void)
5414 {
5415         FILE *fp = fopen("$cf_tempfile", "w");
5416 #ifdef NCURSES_VERSION
5417 # ifdef NCURSES_VERSION_PATCH
5418         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5419 # else
5420         fprintf(fp, "%s\n", NCURSES_VERSION);
5421 # endif
5422 #else
5423 # ifdef __NCURSES_H
5424         fprintf(fp, "old\n");
5425 # else
5426         make an error
5427 # endif
5428 #endif
5429         ${cf_cv_main_return:-return}(0);
5430 }
5431 _ACEOF
5432 rm -f conftest$ac_exeext
5433 if { (eval echo "$as_me:5433: \"$ac_link\"") >&5
5434   (eval $ac_link) 2>&5
5435   ac_status=$?
5436   echo "$as_me:5436: \$? = $ac_status" >&5
5437   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5438   { (eval echo "$as_me:5438: \"$ac_try\"") >&5
5439   (eval $ac_try) 2>&5
5440   ac_status=$?
5441   echo "$as_me:5441: \$? = $ac_status" >&5
5442   (exit $ac_status); }; }; then
5443
5444         cf_cv_ncurses_version=`cat $cf_tempfile`
5445 else
5446   echo "$as_me: program exited with status $ac_status" >&5
5447 echo "$as_me: failed program was:" >&5
5448 cat conftest.$ac_ext >&5
5449 fi
5450 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5451 fi
5452         rm -f $cf_tempfile
5453
5454 fi
5455 echo "$as_me:5455: result: $cf_cv_ncurses_version" >&5
5456 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5457 test "$cf_cv_ncurses_version" = no ||
5458 cat >>confdefs.h <<\EOF
5459 #define NCURSES 1
5460 EOF
5461
5462 echo "$as_me:5462: checking if we have identified curses libraries" >&5
5463 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5464 cat >conftest.$ac_ext <<_ACEOF
5465 #line 5465 "configure"
5466 #include "confdefs.h"
5467 #include <${cf_cv_ncurses_header:-curses.h}>
5468 int
5469 main (void)
5470 {
5471 initscr(); tgoto("?", 0,0)
5472   ;
5473   return 0;
5474 }
5475 _ACEOF
5476 rm -f conftest.$ac_objext conftest$ac_exeext
5477 if { (eval echo "$as_me:5477: \"$ac_link\"") >&5
5478   (eval $ac_link) 2>&5
5479   ac_status=$?
5480   echo "$as_me:5480: \$? = $ac_status" >&5
5481   (exit $ac_status); } &&
5482          { ac_try='test -s conftest$ac_exeext'
5483   { (eval echo "$as_me:5483: \"$ac_try\"") >&5
5484   (eval $ac_try) 2>&5
5485   ac_status=$?
5486   echo "$as_me:5486: \$? = $ac_status" >&5
5487   (exit $ac_status); }; }; then
5488   cf_result=yes
5489 else
5490   echo "$as_me: failed program was:" >&5
5491 cat conftest.$ac_ext >&5
5492 cf_result=no
5493 fi
5494 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5495 echo "$as_me:5495: result: $cf_result" >&5
5496 echo "${ECHO_T}$cf_result" >&6
5497
5498 if test "$cf_result" = no ; then
5499 case $host_os in
5500 (freebsd*)
5501         echo "$as_me:5501: checking for tgoto in -lmytinfo" >&5
5502 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5503 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5504   echo $ECHO_N "(cached) $ECHO_C" >&6
5505 else
5506   ac_check_lib_save_LIBS=$LIBS
5507 LIBS="-lmytinfo  $LIBS"
5508 cat >conftest.$ac_ext <<_ACEOF
5509 #line 5509 "configure"
5510 #include "confdefs.h"
5511
5512 /* Override any gcc2 internal prototype to avoid an error.  */
5513 #ifdef __cplusplus
5514 extern "C"
5515 #endif
5516 /* We use char because int might match the return type of a gcc2
5517    builtin and then its argument prototype would still apply.  */
5518 char tgoto ();
5519 int
5520 main (void)
5521 {
5522 tgoto ();
5523   ;
5524   return 0;
5525 }
5526 _ACEOF
5527 rm -f conftest.$ac_objext conftest$ac_exeext
5528 if { (eval echo "$as_me:5528: \"$ac_link\"") >&5
5529   (eval $ac_link) 2>&5
5530   ac_status=$?
5531   echo "$as_me:5531: \$? = $ac_status" >&5
5532   (exit $ac_status); } &&
5533          { ac_try='test -s conftest$ac_exeext'
5534   { (eval echo "$as_me:5534: \"$ac_try\"") >&5
5535   (eval $ac_try) 2>&5
5536   ac_status=$?
5537   echo "$as_me:5537: \$? = $ac_status" >&5
5538   (exit $ac_status); }; }; then
5539   ac_cv_lib_mytinfo_tgoto=yes
5540 else
5541   echo "$as_me: failed program was:" >&5
5542 cat conftest.$ac_ext >&5
5543 ac_cv_lib_mytinfo_tgoto=no
5544 fi
5545 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5546 LIBS=$ac_check_lib_save_LIBS
5547 fi
5548 echo "$as_me:5548: result: $ac_cv_lib_mytinfo_tgoto" >&5
5549 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5550 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5551
5552 cf_add_libs="-lmytinfo"
5553 # Filter out duplicates - this happens with badly-designed ".pc" files...
5554 for cf_add_1lib in $LIBS
5555 do
5556         for cf_add_2lib in $cf_add_libs
5557         do
5558                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5559                 then
5560                         cf_add_1lib=
5561                         break
5562                 fi
5563         done
5564         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5565 done
5566 LIBS="$cf_add_libs"
5567
5568 fi
5569
5570         ;;
5571 (hpux10.*)
5572         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5573         # next (1998), and xcurses "newer" (2000).  There is no header file for
5574         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5575         # term.h) for cur_colr
5576         if test "x$cf_cv_screen" = "xcurses_colr"
5577         then
5578                 echo "$as_me:5578: checking for initscr in -lcur_colr" >&5
5579 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5580 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5581   echo $ECHO_N "(cached) $ECHO_C" >&6
5582 else
5583   ac_check_lib_save_LIBS=$LIBS
5584 LIBS="-lcur_colr  $LIBS"
5585 cat >conftest.$ac_ext <<_ACEOF
5586 #line 5586 "configure"
5587 #include "confdefs.h"
5588
5589 /* Override any gcc2 internal prototype to avoid an error.  */
5590 #ifdef __cplusplus
5591 extern "C"
5592 #endif
5593 /* We use char because int might match the return type of a gcc2
5594    builtin and then its argument prototype would still apply.  */
5595 char initscr ();
5596 int
5597 main (void)
5598 {
5599 initscr ();
5600   ;
5601   return 0;
5602 }
5603 _ACEOF
5604 rm -f conftest.$ac_objext conftest$ac_exeext
5605 if { (eval echo "$as_me:5605: \"$ac_link\"") >&5
5606   (eval $ac_link) 2>&5
5607   ac_status=$?
5608   echo "$as_me:5608: \$? = $ac_status" >&5
5609   (exit $ac_status); } &&
5610          { ac_try='test -s conftest$ac_exeext'
5611   { (eval echo "$as_me:5611: \"$ac_try\"") >&5
5612   (eval $ac_try) 2>&5
5613   ac_status=$?
5614   echo "$as_me:5614: \$? = $ac_status" >&5
5615   (exit $ac_status); }; }; then
5616   ac_cv_lib_cur_colr_initscr=yes
5617 else
5618   echo "$as_me: failed program was:" >&5
5619 cat conftest.$ac_ext >&5
5620 ac_cv_lib_cur_colr_initscr=no
5621 fi
5622 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5623 LIBS=$ac_check_lib_save_LIBS
5624 fi
5625 echo "$as_me:5625: result: $ac_cv_lib_cur_colr_initscr" >&5
5626 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5627 if test $ac_cv_lib_cur_colr_initscr = yes; then
5628
5629 cf_add_libs="-lcur_colr"
5630 # Filter out duplicates - this happens with badly-designed ".pc" files...
5631 for cf_add_1lib in $LIBS
5632 do
5633         for cf_add_2lib in $cf_add_libs
5634         do
5635                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5636                 then
5637                         cf_add_1lib=
5638                         break
5639                 fi
5640         done
5641         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5642 done
5643 LIBS="$cf_add_libs"
5644
5645                         ac_cv_func_initscr=yes
5646
5647 else
5648
5649                 echo "$as_me:5649: checking for initscr in -lHcurses" >&5
5650 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5651 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5652   echo $ECHO_N "(cached) $ECHO_C" >&6
5653 else
5654   ac_check_lib_save_LIBS=$LIBS
5655 LIBS="-lHcurses  $LIBS"
5656 cat >conftest.$ac_ext <<_ACEOF
5657 #line 5657 "configure"
5658 #include "confdefs.h"
5659
5660 /* Override any gcc2 internal prototype to avoid an error.  */
5661 #ifdef __cplusplus
5662 extern "C"
5663 #endif
5664 /* We use char because int might match the return type of a gcc2
5665    builtin and then its argument prototype would still apply.  */
5666 char initscr ();
5667 int
5668 main (void)
5669 {
5670 initscr ();
5671   ;
5672   return 0;
5673 }
5674 _ACEOF
5675 rm -f conftest.$ac_objext conftest$ac_exeext
5676 if { (eval echo "$as_me:5676: \"$ac_link\"") >&5
5677   (eval $ac_link) 2>&5
5678   ac_status=$?
5679   echo "$as_me:5679: \$? = $ac_status" >&5
5680   (exit $ac_status); } &&
5681          { ac_try='test -s conftest$ac_exeext'
5682   { (eval echo "$as_me:5682: \"$ac_try\"") >&5
5683   (eval $ac_try) 2>&5
5684   ac_status=$?
5685   echo "$as_me:5685: \$? = $ac_status" >&5
5686   (exit $ac_status); }; }; then
5687   ac_cv_lib_Hcurses_initscr=yes
5688 else
5689   echo "$as_me: failed program was:" >&5
5690 cat conftest.$ac_ext >&5
5691 ac_cv_lib_Hcurses_initscr=no
5692 fi
5693 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5694 LIBS=$ac_check_lib_save_LIBS
5695 fi
5696 echo "$as_me:5696: result: $ac_cv_lib_Hcurses_initscr" >&5
5697 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5698 if test $ac_cv_lib_Hcurses_initscr = yes; then
5699
5700                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5701
5702 cf_add_libs="-lHcurses"
5703 # Filter out duplicates - this happens with badly-designed ".pc" files...
5704 for cf_add_1lib in $LIBS
5705 do
5706         for cf_add_2lib in $cf_add_libs
5707         do
5708                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5709                 then
5710                         cf_add_1lib=
5711                         break
5712                 fi
5713         done
5714         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5715 done
5716 LIBS="$cf_add_libs"
5717
5718                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5719                         ac_cv_func_initscr=yes
5720
5721 fi
5722
5723 fi
5724
5725         fi
5726         ;;
5727 (linux*)
5728         case `arch 2>/dev/null` in
5729         (x86_64)
5730                 if test -d /lib64
5731                 then
5732
5733 if test -n "/lib64" ; then
5734         for cf_add_libdir in /lib64
5735         do
5736                 if test $cf_add_libdir = /usr/lib ; then
5737                         :
5738                 elif test -d $cf_add_libdir
5739                 then
5740                         cf_have_libdir=no
5741                         if test -n "$LDFLAGS$LIBS" ; then
5742                                 # a loop is needed to ensure we can add subdirs of existing dirs
5743                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5744                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5745                                                 cf_have_libdir=yes; break
5746                                         fi
5747                                 done
5748                         fi
5749                         if test "$cf_have_libdir" = no ; then
5750                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5751
5752 echo "${as_me:-configure}:5752: testing adding $cf_add_libdir to library-path ..." 1>&5
5753
5754                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5755                         fi
5756                 fi
5757         done
5758 fi
5759
5760                 else
5761
5762 if test -n "/lib" ; then
5763         for cf_add_libdir in /lib
5764         do
5765                 if test $cf_add_libdir = /usr/lib ; then
5766                         :
5767                 elif test -d $cf_add_libdir
5768                 then
5769                         cf_have_libdir=no
5770                         if test -n "$LDFLAGS$LIBS" ; then
5771                                 # a loop is needed to ensure we can add subdirs of existing dirs
5772                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5773                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5774                                                 cf_have_libdir=yes; break
5775                                         fi
5776                                 done
5777                         fi
5778                         if test "$cf_have_libdir" = no ; then
5779                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5780
5781 echo "${as_me:-configure}:5781: testing adding $cf_add_libdir to library-path ..." 1>&5
5782
5783                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5784                         fi
5785                 fi
5786         done
5787 fi
5788
5789                 fi
5790                 ;;
5791         (*)
5792
5793 if test -n "/lib" ; then
5794         for cf_add_libdir in /lib
5795         do
5796                 if test $cf_add_libdir = /usr/lib ; then
5797                         :
5798                 elif test -d $cf_add_libdir
5799                 then
5800                         cf_have_libdir=no
5801                         if test -n "$LDFLAGS$LIBS" ; then
5802                                 # a loop is needed to ensure we can add subdirs of existing dirs
5803                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5804                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5805                                                 cf_have_libdir=yes; break
5806                                         fi
5807                                 done
5808                         fi
5809                         if test "$cf_have_libdir" = no ; then
5810                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5811
5812 echo "${as_me:-configure}:5812: testing adding $cf_add_libdir to library-path ..." 1>&5
5813
5814                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5815                         fi
5816                 fi
5817         done
5818 fi
5819
5820                 ;;
5821         esac
5822         ;;
5823 (sunos3*|sunos4*)
5824         if test "x$cf_cv_screen" = "xcurses_5lib"
5825         then
5826                 if test -d /usr/5lib ; then
5827
5828 if test -n "/usr/5lib" ; then
5829         for cf_add_libdir in /usr/5lib
5830         do
5831                 if test $cf_add_libdir = /usr/lib ; then
5832                         :
5833                 elif test -d $cf_add_libdir
5834                 then
5835                         cf_have_libdir=no
5836                         if test -n "$LDFLAGS$LIBS" ; then
5837                                 # a loop is needed to ensure we can add subdirs of existing dirs
5838                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5839                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5840                                                 cf_have_libdir=yes; break
5841                                         fi
5842                                 done
5843                         fi
5844                         if test "$cf_have_libdir" = no ; then
5845                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5846
5847 echo "${as_me:-configure}:5847: testing adding $cf_add_libdir to library-path ..." 1>&5
5848
5849                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5850                         fi
5851                 fi
5852         done
5853 fi
5854
5855 cf_add_libs="-lcurses -ltermcap"
5856 # Filter out duplicates - this happens with badly-designed ".pc" files...
5857 for cf_add_1lib in $LIBS
5858 do
5859         for cf_add_2lib in $cf_add_libs
5860         do
5861                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5862                 then
5863                         cf_add_1lib=
5864                         break
5865                 fi
5866         done
5867         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5868 done
5869 LIBS="$cf_add_libs"
5870
5871                 fi
5872         fi
5873         ac_cv_func_initscr=yes
5874         ;;
5875 esac
5876
5877 if test ".$ac_cv_func_initscr" != .yes ; then
5878         cf_save_LIBS="$LIBS"
5879
5880         if test ".${cf_cv_ncurses_version:-no}" != .no
5881         then
5882                 cf_check_list="ncurses curses cursesX"
5883         else
5884                 cf_check_list="cursesX curses ncurses"
5885         fi
5886
5887         # Check for library containing tgoto.  Do this before curses library
5888         # because it may be needed to link the test-case for initscr.
5889         if test "x$cf_term_lib" = x
5890         then
5891                 echo "$as_me:5891: checking for tgoto" >&5
5892 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5893 if test "${ac_cv_func_tgoto+set}" = set; then
5894   echo $ECHO_N "(cached) $ECHO_C" >&6
5895 else
5896   cat >conftest.$ac_ext <<_ACEOF
5897 #line 5897 "configure"
5898 #include "confdefs.h"
5899 /* System header to define __stub macros and hopefully few prototypes,
5900     which can conflict with char tgoto (); below.  */
5901 #include <assert.h>
5902 /* Override any gcc2 internal prototype to avoid an error.  */
5903 #ifdef __cplusplus
5904 extern "C"
5905 #endif
5906 /* We use char because int might match the return type of a gcc2
5907    builtin and then its argument prototype would still apply.  */
5908 char tgoto ();
5909 char (*f) ();
5910
5911 int
5912 main (void)
5913 {
5914 /* The GNU C library defines this for functions which it implements
5915     to always fail with ENOSYS.  Some functions are actually named
5916     something starting with __ and the normal name is an alias.  */
5917 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5918 choke me
5919 #else
5920 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5921 #endif
5922
5923   ;
5924   return 0;
5925 }
5926 _ACEOF
5927 rm -f conftest.$ac_objext conftest$ac_exeext
5928 if { (eval echo "$as_me:5928: \"$ac_link\"") >&5
5929   (eval $ac_link) 2>&5
5930   ac_status=$?
5931   echo "$as_me:5931: \$? = $ac_status" >&5
5932   (exit $ac_status); } &&
5933          { ac_try='test -s conftest$ac_exeext'
5934   { (eval echo "$as_me:5934: \"$ac_try\"") >&5
5935   (eval $ac_try) 2>&5
5936   ac_status=$?
5937   echo "$as_me:5937: \$? = $ac_status" >&5
5938   (exit $ac_status); }; }; then
5939   ac_cv_func_tgoto=yes
5940 else
5941   echo "$as_me: failed program was:" >&5
5942 cat conftest.$ac_ext >&5
5943 ac_cv_func_tgoto=no
5944 fi
5945 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5946 fi
5947 echo "$as_me:5947: result: $ac_cv_func_tgoto" >&5
5948 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5949 if test $ac_cv_func_tgoto = yes; then
5950   cf_term_lib=predefined
5951 else
5952
5953                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5954                         do
5955                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5956 echo "$as_me:5956: checking for tgoto in -l$cf_term_lib" >&5
5957 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5958 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5959   echo $ECHO_N "(cached) $ECHO_C" >&6
5960 else
5961   ac_check_lib_save_LIBS=$LIBS
5962 LIBS="-l$cf_term_lib  $LIBS"
5963 cat >conftest.$ac_ext <<_ACEOF
5964 #line 5964 "configure"
5965 #include "confdefs.h"
5966
5967 /* Override any gcc2 internal prototype to avoid an error.  */
5968 #ifdef __cplusplus
5969 extern "C"
5970 #endif
5971 /* We use char because int might match the return type of a gcc2
5972    builtin and then its argument prototype would still apply.  */
5973 char tgoto ();
5974 int
5975 main (void)
5976 {
5977 tgoto ();
5978   ;
5979   return 0;
5980 }
5981 _ACEOF
5982 rm -f conftest.$ac_objext conftest$ac_exeext
5983 if { (eval echo "$as_me:5983: \"$ac_link\"") >&5
5984   (eval $ac_link) 2>&5
5985   ac_status=$?
5986   echo "$as_me:5986: \$? = $ac_status" >&5
5987   (exit $ac_status); } &&
5988          { ac_try='test -s conftest$ac_exeext'
5989   { (eval echo "$as_me:5989: \"$ac_try\"") >&5
5990   (eval $ac_try) 2>&5
5991   ac_status=$?
5992   echo "$as_me:5992: \$? = $ac_status" >&5
5993   (exit $ac_status); }; }; then
5994   eval "$as_ac_Lib=yes"
5995 else
5996   echo "$as_me: failed program was:" >&5
5997 cat conftest.$ac_ext >&5
5998 eval "$as_ac_Lib=no"
5999 fi
6000 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6001 LIBS=$ac_check_lib_save_LIBS
6002 fi
6003 echo "$as_me:6003: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6004 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6005 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6006   break
6007 fi
6008
6009                         done
6010
6011 fi
6012
6013         fi
6014
6015         # Check for library containing initscr
6016         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6017         if test "x$cf_curs_lib" = x
6018         then
6019                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6020                 do
6021                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6022                         if test "$cf_term_lib" = unknown ; then
6023                                 echo "$as_me:6023: checking if we can link with $cf_curs_lib library" >&5
6024 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6025                                 cat >conftest.$ac_ext <<_ACEOF
6026 #line 6026 "configure"
6027 #include "confdefs.h"
6028 #include <${cf_cv_ncurses_header:-curses.h}>
6029 int
6030 main (void)
6031 {
6032 initscr()
6033   ;
6034   return 0;
6035 }
6036 _ACEOF
6037 rm -f conftest.$ac_objext conftest$ac_exeext
6038 if { (eval echo "$as_me:6038: \"$ac_link\"") >&5
6039   (eval $ac_link) 2>&5
6040   ac_status=$?
6041   echo "$as_me:6041: \$? = $ac_status" >&5
6042   (exit $ac_status); } &&
6043          { ac_try='test -s conftest$ac_exeext'
6044   { (eval echo "$as_me:6044: \"$ac_try\"") >&5
6045   (eval $ac_try) 2>&5
6046   ac_status=$?
6047   echo "$as_me:6047: \$? = $ac_status" >&5
6048   (exit $ac_status); }; }; then
6049   cf_result=yes
6050 else
6051   echo "$as_me: failed program was:" >&5
6052 cat conftest.$ac_ext >&5
6053 cf_result=no
6054 fi
6055 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6056                                 echo "$as_me:6056: result: $cf_result" >&5
6057 echo "${ECHO_T}$cf_result" >&6
6058                                 test $cf_result = yes && break
6059                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6060                                 cf_result=no
6061                         elif test "$cf_term_lib" != predefined ; then
6062                                 echo "$as_me:6062: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6063 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6064                                 cat >conftest.$ac_ext <<_ACEOF
6065 #line 6065 "configure"
6066 #include "confdefs.h"
6067 #include <${cf_cv_ncurses_header:-curses.h}>
6068 int
6069 main (void)
6070 {
6071 initscr(); tgoto((char *)0, 0, 0);
6072   ;
6073   return 0;
6074 }
6075 _ACEOF
6076 rm -f conftest.$ac_objext conftest$ac_exeext
6077 if { (eval echo "$as_me:6077: \"$ac_link\"") >&5
6078   (eval $ac_link) 2>&5
6079   ac_status=$?
6080   echo "$as_me:6080: \$? = $ac_status" >&5
6081   (exit $ac_status); } &&
6082          { ac_try='test -s conftest$ac_exeext'
6083   { (eval echo "$as_me:6083: \"$ac_try\"") >&5
6084   (eval $ac_try) 2>&5
6085   ac_status=$?
6086   echo "$as_me:6086: \$? = $ac_status" >&5
6087   (exit $ac_status); }; }; then
6088   cf_result=no
6089 else
6090   echo "$as_me: failed program was:" >&5
6091 cat conftest.$ac_ext >&5
6092
6093                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6094                                         cat >conftest.$ac_ext <<_ACEOF
6095 #line 6095 "configure"
6096 #include "confdefs.h"
6097 #include <${cf_cv_ncurses_header:-curses.h}>
6098 int
6099 main (void)
6100 {
6101 initscr()
6102   ;
6103   return 0;
6104 }
6105 _ACEOF
6106 rm -f conftest.$ac_objext conftest$ac_exeext
6107 if { (eval echo "$as_me:6107: \"$ac_link\"") >&5
6108   (eval $ac_link) 2>&5
6109   ac_status=$?
6110   echo "$as_me:6110: \$? = $ac_status" >&5
6111   (exit $ac_status); } &&
6112          { ac_try='test -s conftest$ac_exeext'
6113   { (eval echo "$as_me:6113: \"$ac_try\"") >&5
6114   (eval $ac_try) 2>&5
6115   ac_status=$?
6116   echo "$as_me:6116: \$? = $ac_status" >&5
6117   (exit $ac_status); }; }; then
6118   cf_result=yes
6119 else
6120   echo "$as_me: failed program was:" >&5
6121 cat conftest.$ac_ext >&5
6122 cf_result=error
6123 fi
6124 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6125
6126 fi
6127 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6128                                 echo "$as_me:6128: result: $cf_result" >&5
6129 echo "${ECHO_T}$cf_result" >&6
6130                                 test $cf_result != error && break
6131                         fi
6132                 done
6133         fi
6134         test $cf_curs_lib = unknown && { { echo "$as_me:6134: error: no curses library found" >&5
6135 echo "$as_me: error: no curses library found" >&2;}
6136    { (exit 1); exit 1; }; }
6137 fi
6138 fi
6139
6140         ;;
6141 (ncursesw*)
6142
6143 echo "$as_me:6143: checking for multibyte character support" >&5
6144 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6145 if test "${cf_cv_utf8_lib+set}" = set; then
6146   echo $ECHO_N "(cached) $ECHO_C" >&6
6147 else
6148
6149         cf_save_LIBS="$LIBS"
6150         cat >conftest.$ac_ext <<_ACEOF
6151 #line 6151 "configure"
6152 #include "confdefs.h"
6153
6154 #include <stdlib.h>
6155 int
6156 main (void)
6157 {
6158 putwc(0,0);
6159   ;
6160   return 0;
6161 }
6162 _ACEOF
6163 rm -f conftest.$ac_objext conftest$ac_exeext
6164 if { (eval echo "$as_me:6164: \"$ac_link\"") >&5
6165   (eval $ac_link) 2>&5
6166   ac_status=$?
6167   echo "$as_me:6167: \$? = $ac_status" >&5
6168   (exit $ac_status); } &&
6169          { ac_try='test -s conftest$ac_exeext'
6170   { (eval echo "$as_me:6170: \"$ac_try\"") >&5
6171   (eval $ac_try) 2>&5
6172   ac_status=$?
6173   echo "$as_me:6173: \$? = $ac_status" >&5
6174   (exit $ac_status); }; }; then
6175   cf_cv_utf8_lib=yes
6176 else
6177   echo "$as_me: failed program was:" >&5
6178 cat conftest.$ac_ext >&5
6179
6180 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6181 # will be set on completion of the AC_TRY_LINK below.
6182 cf_cv_header_path_utf8=
6183 cf_cv_library_path_utf8=
6184
6185 echo "${as_me:-configure}:6185: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6186
6187 cf_save_LIBS="$LIBS"
6188
6189 cat >conftest.$ac_ext <<_ACEOF
6190 #line 6190 "configure"
6191 #include "confdefs.h"
6192
6193 #include <libutf8.h>
6194 int
6195 main (void)
6196 {
6197 putwc(0,0);
6198   ;
6199   return 0;
6200 }
6201 _ACEOF
6202 rm -f conftest.$ac_objext conftest$ac_exeext
6203 if { (eval echo "$as_me:6203: \"$ac_link\"") >&5
6204   (eval $ac_link) 2>&5
6205   ac_status=$?
6206   echo "$as_me:6206: \$? = $ac_status" >&5
6207   (exit $ac_status); } &&
6208          { ac_try='test -s conftest$ac_exeext'
6209   { (eval echo "$as_me:6209: \"$ac_try\"") >&5
6210   (eval $ac_try) 2>&5
6211   ac_status=$?
6212   echo "$as_me:6212: \$? = $ac_status" >&5
6213   (exit $ac_status); }; }; then
6214
6215         cf_cv_find_linkage_utf8=yes
6216         cf_cv_header_path_utf8=/usr/include
6217         cf_cv_library_path_utf8=/usr/lib
6218
6219 else
6220   echo "$as_me: failed program was:" >&5
6221 cat conftest.$ac_ext >&5
6222
6223 LIBS="-lutf8  $cf_save_LIBS"
6224
6225 cat >conftest.$ac_ext <<_ACEOF
6226 #line 6226 "configure"
6227 #include "confdefs.h"
6228
6229 #include <libutf8.h>
6230 int
6231 main (void)
6232 {
6233 putwc(0,0);
6234   ;
6235   return 0;
6236 }
6237 _ACEOF
6238 rm -f conftest.$ac_objext conftest$ac_exeext
6239 if { (eval echo "$as_me:6239: \"$ac_link\"") >&5
6240   (eval $ac_link) 2>&5
6241   ac_status=$?
6242   echo "$as_me:6242: \$? = $ac_status" >&5
6243   (exit $ac_status); } &&
6244          { ac_try='test -s conftest$ac_exeext'
6245   { (eval echo "$as_me:6245: \"$ac_try\"") >&5
6246   (eval $ac_try) 2>&5
6247   ac_status=$?
6248   echo "$as_me:6248: \$? = $ac_status" >&5
6249   (exit $ac_status); }; }; then
6250
6251         cf_cv_find_linkage_utf8=yes
6252         cf_cv_header_path_utf8=/usr/include
6253         cf_cv_library_path_utf8=/usr/lib
6254         cf_cv_library_file_utf8="-lutf8"
6255
6256 else
6257   echo "$as_me: failed program was:" >&5
6258 cat conftest.$ac_ext >&5
6259
6260         cf_cv_find_linkage_utf8=no
6261         LIBS="$cf_save_LIBS"
6262
6263         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6264
6265 echo "${as_me:-configure}:6265: testing find linkage for utf8 library ..." 1>&5
6266
6267 echo "${as_me:-configure}:6267: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6268
6269         cf_save_CPPFLAGS="$CPPFLAGS"
6270         cf_test_CPPFLAGS="$CPPFLAGS"
6271
6272 cf_search=
6273
6274 # collect the current set of include-directories from compiler flags
6275 cf_header_path_list=""
6276 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6277         for cf_header_path in $CPPFLAGS $CFLAGS
6278         do
6279                 case $cf_header_path in
6280                 (-I*)
6281                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6282
6283 test "x$cf_header_path" != "xNONE" && \
6284 test -d "$cf_header_path" && \
6285  {
6286         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6287         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6288         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6289         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6290         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6291         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6292 }
6293
6294                         cf_header_path_list="$cf_header_path_list $cf_search"
6295                         ;;
6296                 esac
6297         done
6298 fi
6299
6300 # add the variations for the package we are looking for
6301
6302 cf_search=
6303
6304 test "x$prefix" != "xNONE" && \
6305 test -d "$prefix" && \
6306  {
6307         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6308         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6309         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6310         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6311         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6312         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6313 }
6314
6315 for cf_subdir_prefix in \
6316         /usr \
6317         /usr/local \
6318         /usr/pkg \
6319         /opt \
6320         /opt/local \
6321         $HOME
6322 do
6323
6324 test "x$cf_subdir_prefix" != "x$prefix" && \
6325 test -d "$cf_subdir_prefix" && \
6326 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6327         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6328         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6329         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6330         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6331         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6332         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6333 }
6334
6335 done
6336
6337 test "$includedir" != NONE && \
6338 test "$includedir" != "/usr/include" && \
6339 test -d "$includedir" && {
6340         test -d $includedir &&    cf_search="$cf_search $includedir"
6341         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6342 }
6343
6344 test "$oldincludedir" != NONE && \
6345 test "$oldincludedir" != "/usr/include" && \
6346 test -d "$oldincludedir" && {
6347         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6348         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6349 }
6350
6351 cf_search="$cf_search $cf_header_path_list"
6352
6353         for cf_cv_header_path_utf8 in $cf_search
6354         do
6355                 if test -d $cf_cv_header_path_utf8 ; then
6356                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6357
6358 echo "${as_me:-configure}:6358: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6359
6360                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6361                         cat >conftest.$ac_ext <<_ACEOF
6362 #line 6362 "configure"
6363 #include "confdefs.h"
6364
6365 #include <libutf8.h>
6366 int
6367 main (void)
6368 {
6369 putwc(0,0);
6370   ;
6371   return 0;
6372 }
6373 _ACEOF
6374 rm -f conftest.$ac_objext
6375 if { (eval echo "$as_me:6375: \"$ac_compile\"") >&5
6376   (eval $ac_compile) 2>&5
6377   ac_status=$?
6378   echo "$as_me:6378: \$? = $ac_status" >&5
6379   (exit $ac_status); } &&
6380          { ac_try='test -s conftest.$ac_objext'
6381   { (eval echo "$as_me:6381: \"$ac_try\"") >&5
6382   (eval $ac_try) 2>&5
6383   ac_status=$?
6384   echo "$as_me:6384: \$? = $ac_status" >&5
6385   (exit $ac_status); }; }; then
6386
6387                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6388
6389 echo "${as_me:-configure}:6389: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6390
6391                                 cf_cv_find_linkage_utf8=maybe
6392                                 cf_test_CPPFLAGS="$CPPFLAGS"
6393                                 break
6394 else
6395   echo "$as_me: failed program was:" >&5
6396 cat conftest.$ac_ext >&5
6397
6398                                 CPPFLAGS="$cf_save_CPPFLAGS"
6399
6400 fi
6401 rm -f conftest.$ac_objext conftest.$ac_ext
6402                 fi
6403         done
6404
6405         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6406
6407 echo "${as_me:-configure}:6407: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6408
6409                 cf_save_LIBS="$LIBS"
6410                 cf_save_LDFLAGS="$LDFLAGS"
6411
6412                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6413
6414 cf_search=
6415 cf_library_path_list=""
6416 if test -n "${LDFLAGS}${LIBS}" ; then
6417         for cf_library_path in $LDFLAGS $LIBS
6418         do
6419                 case $cf_library_path in
6420                 (-L*)
6421                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6422
6423 test "x$cf_library_path" != "xNONE" && \
6424 test -d "$cf_library_path" && \
6425  {
6426         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6427         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6428         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6429         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6430         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6431         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6432 }
6433
6434                         cf_library_path_list="$cf_library_path_list $cf_search"
6435                         ;;
6436                 esac
6437         done
6438 fi
6439
6440 cf_search=
6441
6442 test "x$prefix" != "xNONE" && \
6443 test -d "$prefix" && \
6444  {
6445         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6446         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6447         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6448         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6449         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6450         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6451 }
6452
6453 for cf_subdir_prefix in \
6454         /usr \
6455         /usr/local \
6456         /usr/pkg \
6457         /opt \
6458         /opt/local \
6459         $HOME
6460 do
6461
6462 test "x$cf_subdir_prefix" != "x$prefix" && \
6463 test -d "$cf_subdir_prefix" && \
6464 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6465         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6466         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6467         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6468         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6469         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6470         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6471 }
6472
6473 done
6474
6475 cf_search="$cf_library_path_list $cf_search"
6476
6477                         for cf_cv_library_path_utf8 in $cf_search
6478                         do
6479                                 if test -d $cf_cv_library_path_utf8 ; then
6480                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6481
6482 echo "${as_me:-configure}:6482: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6483
6484                                         CPPFLAGS="$cf_test_CPPFLAGS"
6485                                         LIBS="-lutf8  $cf_save_LIBS"
6486                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6487                                         cat >conftest.$ac_ext <<_ACEOF
6488 #line 6488 "configure"
6489 #include "confdefs.h"
6490
6491 #include <libutf8.h>
6492 int
6493 main (void)
6494 {
6495 putwc(0,0);
6496   ;
6497   return 0;
6498 }
6499 _ACEOF
6500 rm -f conftest.$ac_objext conftest$ac_exeext
6501 if { (eval echo "$as_me:6501: \"$ac_link\"") >&5
6502   (eval $ac_link) 2>&5
6503   ac_status=$?
6504   echo "$as_me:6504: \$? = $ac_status" >&5
6505   (exit $ac_status); } &&
6506          { ac_try='test -s conftest$ac_exeext'
6507   { (eval echo "$as_me:6507: \"$ac_try\"") >&5
6508   (eval $ac_try) 2>&5
6509   ac_status=$?
6510   echo "$as_me:6510: \$? = $ac_status" >&5
6511   (exit $ac_status); }; }; then
6512
6513                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6514
6515 echo "${as_me:-configure}:6515: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6516
6517                                         cf_cv_find_linkage_utf8=yes
6518                                         cf_cv_library_file_utf8="-lutf8"
6519                                         break
6520 else
6521   echo "$as_me: failed program was:" >&5
6522 cat conftest.$ac_ext >&5
6523
6524                                         CPPFLAGS="$cf_save_CPPFLAGS"
6525                                         LIBS="$cf_save_LIBS"
6526                                         LDFLAGS="$cf_save_LDFLAGS"
6527
6528 fi
6529 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6530                                 fi
6531                         done
6532                         CPPFLAGS="$cf_save_CPPFLAGS"
6533                         LDFLAGS="$cf_save_LDFLAGS"
6534                 fi
6535
6536         else
6537                 cf_cv_find_linkage_utf8=no
6538         fi
6539
6540 fi
6541 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6542
6543 fi
6544 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6545
6546 LIBS="$cf_save_LIBS"
6547
6548 if test "$cf_cv_find_linkage_utf8" = yes ; then
6549 cf_cv_utf8_lib=add-on
6550 else
6551 cf_cv_utf8_lib=no
6552 fi
6553
6554 fi
6555 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6556 fi
6557 echo "$as_me:6557: result: $cf_cv_utf8_lib" >&5
6558 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6559
6560 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6561 # ncurses/ncursesw:
6562 if test "$cf_cv_utf8_lib" = "add-on" ; then
6563
6564 cat >>confdefs.h <<\EOF
6565 #define HAVE_LIBUTF8_H 1
6566 EOF
6567
6568 if test -n "$cf_cv_header_path_utf8" ; then
6569   for cf_add_incdir in $cf_cv_header_path_utf8
6570   do
6571         while test $cf_add_incdir != /usr/include
6572         do
6573           if test -d $cf_add_incdir
6574           then
6575                 cf_have_incdir=no
6576                 if test -n "$CFLAGS$CPPFLAGS" ; then
6577                   # a loop is needed to ensure we can add subdirs of existing dirs
6578                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6579                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6580                           cf_have_incdir=yes; break
6581                         fi
6582                   done
6583                 fi
6584
6585                 if test "$cf_have_incdir" = no ; then
6586                   if test "$cf_add_incdir" = /usr/local/include ; then
6587                         if test "$GCC" = yes
6588                         then
6589                           cf_save_CPPFLAGS=$CPPFLAGS
6590                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6591                           cat >conftest.$ac_ext <<_ACEOF
6592 #line 6592 "configure"
6593 #include "confdefs.h"
6594 #include <stdio.h>
6595 int
6596 main (void)
6597 {
6598 printf("Hello")
6599   ;
6600   return 0;
6601 }
6602 _ACEOF
6603 rm -f conftest.$ac_objext
6604 if { (eval echo "$as_me:6604: \"$ac_compile\"") >&5
6605   (eval $ac_compile) 2>&5
6606   ac_status=$?
6607   echo "$as_me:6607: \$? = $ac_status" >&5
6608   (exit $ac_status); } &&
6609          { ac_try='test -s conftest.$ac_objext'
6610   { (eval echo "$as_me:6610: \"$ac_try\"") >&5
6611   (eval $ac_try) 2>&5
6612   ac_status=$?
6613   echo "$as_me:6613: \$? = $ac_status" >&5
6614   (exit $ac_status); }; }; then
6615   :
6616 else
6617   echo "$as_me: failed program was:" >&5
6618 cat conftest.$ac_ext >&5
6619 cf_have_incdir=yes
6620 fi
6621 rm -f conftest.$ac_objext conftest.$ac_ext
6622                           CPPFLAGS=$cf_save_CPPFLAGS
6623                         fi
6624                   fi
6625                 fi
6626
6627                 if test "$cf_have_incdir" = no ; then
6628                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6629
6630 echo "${as_me:-configure}:6630: testing adding $cf_add_incdir to include-path ..." 1>&5
6631
6632                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6633
6634                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6635                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6636                   cf_add_incdir="$cf_top_incdir"
6637                 else
6638                   break
6639                 fi
6640           else
6641                 break
6642           fi
6643         done
6644   done
6645 fi
6646
6647 if test -n "$cf_cv_library_path_utf8" ; then
6648         for cf_add_libdir in $cf_cv_library_path_utf8
6649         do
6650                 if test $cf_add_libdir = /usr/lib ; then
6651                         :
6652                 elif test -d $cf_add_libdir
6653                 then
6654                         cf_have_libdir=no
6655                         if test -n "$LDFLAGS$LIBS" ; then
6656                                 # a loop is needed to ensure we can add subdirs of existing dirs
6657                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6658                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6659                                                 cf_have_libdir=yes; break
6660                                         fi
6661                                 done
6662                         fi
6663                         if test "$cf_have_libdir" = no ; then
6664                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6665
6666 echo "${as_me:-configure}:6666: testing adding $cf_add_libdir to library-path ..." 1>&5
6667
6668                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6669                         fi
6670                 fi
6671         done
6672 fi
6673
6674 cf_add_libs="$cf_cv_library_file_utf8"
6675 # Filter out duplicates - this happens with badly-designed ".pc" files...
6676 for cf_add_1lib in $LIBS
6677 do
6678         for cf_add_2lib in $cf_add_libs
6679         do
6680                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6681                 then
6682                         cf_add_1lib=
6683                         break
6684                 fi
6685         done
6686         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6687 done
6688 LIBS="$cf_add_libs"
6689
6690 fi
6691
6692 cf_ncuconfig_root=$cf_cv_screen
6693 cf_have_ncuconfig=no
6694
6695 if test "x${PKG_CONFIG:=none}" != xnone; then
6696         echo "$as_me:6696: checking pkg-config for $cf_ncuconfig_root" >&5
6697 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6698         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6699                 echo "$as_me:6699: result: yes" >&5
6700 echo "${ECHO_T}yes" >&6
6701
6702                 echo "$as_me:6702: checking if the $cf_ncuconfig_root package files work" >&5
6703 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6704                 cf_have_ncuconfig=unknown
6705
6706                 cf_save_CPPFLAGS="$CPPFLAGS"
6707                 cf_save_LIBS="$LIBS"
6708
6709                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6710
6711 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6712 # Filter out duplicates - this happens with badly-designed ".pc" files...
6713 for cf_add_1lib in $LIBS
6714 do
6715         for cf_add_2lib in $cf_add_libs
6716         do
6717                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6718                 then
6719                         cf_add_1lib=
6720                         break
6721                 fi
6722         done
6723         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6724 done
6725 LIBS="$cf_add_libs"
6726
6727                 cat >conftest.$ac_ext <<_ACEOF
6728 #line 6728 "configure"
6729 #include "confdefs.h"
6730 #include <${cf_cv_ncurses_header:-curses.h}>
6731 int
6732 main (void)
6733 {
6734 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6735   ;
6736   return 0;
6737 }
6738 _ACEOF
6739 rm -f conftest.$ac_objext conftest$ac_exeext
6740 if { (eval echo "$as_me:6740: \"$ac_link\"") >&5
6741   (eval $ac_link) 2>&5
6742   ac_status=$?
6743   echo "$as_me:6743: \$? = $ac_status" >&5
6744   (exit $ac_status); } &&
6745          { ac_try='test -s conftest$ac_exeext'
6746   { (eval echo "$as_me:6746: \"$ac_try\"") >&5
6747   (eval $ac_try) 2>&5
6748   ac_status=$?
6749   echo "$as_me:6749: \$? = $ac_status" >&5
6750   (exit $ac_status); }; }; then
6751   if test "$cross_compiling" = yes; then
6752   cf_have_ncuconfig=maybe
6753 else
6754   cat >conftest.$ac_ext <<_ACEOF
6755 #line 6755 "configure"
6756 #include "confdefs.h"
6757 #include <${cf_cv_ncurses_header:-curses.h}>
6758                                 int main(void)
6759                                 { char *xx = curses_version(); return (xx == 0); }
6760 _ACEOF
6761 rm -f conftest$ac_exeext
6762 if { (eval echo "$as_me:6762: \"$ac_link\"") >&5
6763   (eval $ac_link) 2>&5
6764   ac_status=$?
6765   echo "$as_me:6765: \$? = $ac_status" >&5
6766   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6767   { (eval echo "$as_me:6767: \"$ac_try\"") >&5
6768   (eval $ac_try) 2>&5
6769   ac_status=$?
6770   echo "$as_me:6770: \$? = $ac_status" >&5
6771   (exit $ac_status); }; }; then
6772   cf_have_ncuconfig=yes
6773 else
6774   echo "$as_me: program exited with status $ac_status" >&5
6775 echo "$as_me: failed program was:" >&5
6776 cat conftest.$ac_ext >&5
6777 cf_have_ncuconfig=no
6778 fi
6779 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6780 fi
6781 else
6782   echo "$as_me: failed program was:" >&5
6783 cat conftest.$ac_ext >&5
6784 cf_have_ncuconfig=no
6785 fi
6786 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6787                 echo "$as_me:6787: result: $cf_have_ncuconfig" >&5
6788 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6789                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6790                 if test "$cf_have_ncuconfig" != "yes"
6791                 then
6792                         CPPFLAGS="$cf_save_CPPFLAGS"
6793                         LIBS="$cf_save_LIBS"
6794                         NCURSES_CONFIG_PKG=none
6795                 else
6796
6797 cat >>confdefs.h <<\EOF
6798 #define NCURSES 1
6799 EOF
6800
6801                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6802                 fi
6803
6804 echo "$as_me:6804: checking for terminfo header" >&5
6805 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6806 if test "${cf_cv_term_header+set}" = set; then
6807   echo $ECHO_N "(cached) $ECHO_C" >&6
6808 else
6809
6810 case ${cf_cv_ncurses_header} in
6811 (*/ncurses.h|*/ncursesw.h)
6812         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6813         ;;
6814 (*)
6815         cf_term_header=term.h
6816         ;;
6817 esac
6818
6819 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6820 do
6821 cat >conftest.$ac_ext <<_ACEOF
6822 #line 6822 "configure"
6823 #include "confdefs.h"
6824 #include <stdio.h>
6825 #include <${cf_cv_ncurses_header:-curses.h}>
6826 #include <$cf_test>
6827
6828 int
6829 main (void)
6830 {
6831 int x = auto_left_margin
6832   ;
6833   return 0;
6834 }
6835 _ACEOF
6836 rm -f conftest.$ac_objext
6837 if { (eval echo "$as_me:6837: \"$ac_compile\"") >&5
6838   (eval $ac_compile) 2>&5
6839   ac_status=$?
6840   echo "$as_me:6840: \$? = $ac_status" >&5
6841   (exit $ac_status); } &&
6842          { ac_try='test -s conftest.$ac_objext'
6843   { (eval echo "$as_me:6843: \"$ac_try\"") >&5
6844   (eval $ac_try) 2>&5
6845   ac_status=$?
6846   echo "$as_me:6846: \$? = $ac_status" >&5
6847   (exit $ac_status); }; }; then
6848
6849         cf_cv_term_header="$cf_test"
6850 else
6851   echo "$as_me: failed program was:" >&5
6852 cat conftest.$ac_ext >&5
6853
6854         cf_cv_term_header=unknown
6855
6856 fi
6857 rm -f conftest.$ac_objext conftest.$ac_ext
6858         test "$cf_cv_term_header" != unknown && break
6859 done
6860
6861 fi
6862 echo "$as_me:6862: result: $cf_cv_term_header" >&5
6863 echo "${ECHO_T}$cf_cv_term_header" >&6
6864
6865 # Set definitions to allow ifdef'ing to accommodate subdirectories
6866
6867 case $cf_cv_term_header in
6868 (*term.h)
6869
6870 cat >>confdefs.h <<\EOF
6871 #define HAVE_TERM_H 1
6872 EOF
6873
6874         ;;
6875 esac
6876
6877 case $cf_cv_term_header in
6878 (ncurses/term.h)
6879
6880 cat >>confdefs.h <<\EOF
6881 #define HAVE_NCURSES_TERM_H 1
6882 EOF
6883
6884         ;;
6885 (ncursesw/term.h)
6886
6887 cat >>confdefs.h <<\EOF
6888 #define HAVE_NCURSESW_TERM_H 1
6889 EOF
6890
6891         ;;
6892 esac
6893
6894         else
6895                 echo "$as_me:6895: result: no" >&5
6896 echo "${ECHO_T}no" >&6
6897                 NCURSES_CONFIG_PKG=none
6898         fi
6899 else
6900         NCURSES_CONFIG_PKG=none
6901 fi
6902
6903 if test "x$cf_have_ncuconfig" = "xno"; then
6904         echo "Looking for ${cf_ncuconfig_root}-config"
6905
6906 if test -n "$ac_tool_prefix"; then
6907   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6908   do
6909     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6910 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6911 echo "$as_me:6911: checking for $ac_word" >&5
6912 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6913 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6914   echo $ECHO_N "(cached) $ECHO_C" >&6
6915 else
6916   if test -n "$NCURSES_CONFIG"; then
6917   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6918 else
6919   ac_save_IFS=$IFS; IFS=$ac_path_separator
6920 ac_dummy="$PATH"
6921 for ac_dir in $ac_dummy; do
6922   IFS=$ac_save_IFS
6923   test -z "$ac_dir" && ac_dir=.
6924   $as_executable_p "$ac_dir/$ac_word" || continue
6925 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6926 echo "$as_me:6926: found $ac_dir/$ac_word" >&5
6927 break
6928 done
6929
6930 fi
6931 fi
6932 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6933 if test -n "$NCURSES_CONFIG"; then
6934   echo "$as_me:6934: result: $NCURSES_CONFIG" >&5
6935 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6936 else
6937   echo "$as_me:6937: result: no" >&5
6938 echo "${ECHO_T}no" >&6
6939 fi
6940
6941     test -n "$NCURSES_CONFIG" && break
6942   done
6943 fi
6944 if test -z "$NCURSES_CONFIG"; then
6945   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6946   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6947 do
6948   # Extract the first word of "$ac_prog", so it can be a program name with args.
6949 set dummy $ac_prog; ac_word=$2
6950 echo "$as_me:6950: checking for $ac_word" >&5
6951 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6952 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6953   echo $ECHO_N "(cached) $ECHO_C" >&6
6954 else
6955   if test -n "$ac_ct_NCURSES_CONFIG"; then
6956   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6957 else
6958   ac_save_IFS=$IFS; IFS=$ac_path_separator
6959 ac_dummy="$PATH"
6960 for ac_dir in $ac_dummy; do
6961   IFS=$ac_save_IFS
6962   test -z "$ac_dir" && ac_dir=.
6963   $as_executable_p "$ac_dir/$ac_word" || continue
6964 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6965 echo "$as_me:6965: found $ac_dir/$ac_word" >&5
6966 break
6967 done
6968
6969 fi
6970 fi
6971 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6972 if test -n "$ac_ct_NCURSES_CONFIG"; then
6973   echo "$as_me:6973: result: $ac_ct_NCURSES_CONFIG" >&5
6974 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6975 else
6976   echo "$as_me:6976: result: no" >&5
6977 echo "${ECHO_T}no" >&6
6978 fi
6979
6980   test -n "$ac_ct_NCURSES_CONFIG" && break
6981 done
6982 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6983
6984   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6985 fi
6986
6987         if test "$NCURSES_CONFIG" != none ; then
6988
6989                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6990
6991 cf_add_libs="`$NCURSES_CONFIG --libs`"
6992 # Filter out duplicates - this happens with badly-designed ".pc" files...
6993 for cf_add_1lib in $LIBS
6994 do
6995         for cf_add_2lib in $cf_add_libs
6996         do
6997                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6998                 then
6999                         cf_add_1lib=
7000                         break
7001                 fi
7002         done
7003         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7004 done
7005 LIBS="$cf_add_libs"
7006
7007                 # even with config script, some packages use no-override for curses.h
7008
7009 echo "$as_me:7009: checking if we have identified curses headers" >&5
7010 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7011 if test "${cf_cv_ncurses_header+set}" = set; then
7012   echo $ECHO_N "(cached) $ECHO_C" >&6
7013 else
7014
7015 cf_cv_ncurses_header=none
7016 for cf_header in \
7017         ncurses.h $cf_cv_screen/ncurses.h \
7018         curses.h $cf_cv_screen/curses.h
7019 do
7020 cat >conftest.$ac_ext <<_ACEOF
7021 #line 7021 "configure"
7022 #include "confdefs.h"
7023 #include <${cf_header}>
7024 int
7025 main (void)
7026 {
7027 initscr(); tgoto("?", 0,0)
7028   ;
7029   return 0;
7030 }
7031 _ACEOF
7032 rm -f conftest.$ac_objext
7033 if { (eval echo "$as_me:7033: \"$ac_compile\"") >&5
7034   (eval $ac_compile) 2>&5
7035   ac_status=$?
7036   echo "$as_me:7036: \$? = $ac_status" >&5
7037   (exit $ac_status); } &&
7038          { ac_try='test -s conftest.$ac_objext'
7039   { (eval echo "$as_me:7039: \"$ac_try\"") >&5
7040   (eval $ac_try) 2>&5
7041   ac_status=$?
7042   echo "$as_me:7042: \$? = $ac_status" >&5
7043   (exit $ac_status); }; }; then
7044   cf_cv_ncurses_header=$cf_header; break
7045 else
7046   echo "$as_me: failed program was:" >&5
7047 cat conftest.$ac_ext >&5
7048 fi
7049 rm -f conftest.$ac_objext conftest.$ac_ext
7050 done
7051
7052 fi
7053 echo "$as_me:7053: result: $cf_cv_ncurses_header" >&5
7054 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7055
7056 if test "$cf_cv_ncurses_header" = none ; then
7057         { { echo "$as_me:7057: error: No curses header-files found" >&5
7058 echo "$as_me: error: No curses header-files found" >&2;}
7059    { (exit 1); exit 1; }; }
7060 fi
7061
7062 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7063
7064 for ac_header in $cf_cv_ncurses_header
7065 do
7066 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7067 echo "$as_me:7067: checking for $ac_header" >&5
7068 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7069 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7070   echo $ECHO_N "(cached) $ECHO_C" >&6
7071 else
7072   cat >conftest.$ac_ext <<_ACEOF
7073 #line 7073 "configure"
7074 #include "confdefs.h"
7075 #include <$ac_header>
7076 _ACEOF
7077 if { (eval echo "$as_me:7077: \"$ac_cpp conftest.$ac_ext\"") >&5
7078   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7079   ac_status=$?
7080   egrep -v '^ *\+' conftest.er1 >conftest.err
7081   rm -f conftest.er1
7082   cat conftest.err >&5
7083   echo "$as_me:7083: \$? = $ac_status" >&5
7084   (exit $ac_status); } >/dev/null; then
7085   if test -s conftest.err; then
7086     ac_cpp_err=$ac_c_preproc_warn_flag
7087   else
7088     ac_cpp_err=
7089   fi
7090 else
7091   ac_cpp_err=yes
7092 fi
7093 if test -z "$ac_cpp_err"; then
7094   eval "$as_ac_Header=yes"
7095 else
7096   echo "$as_me: failed program was:" >&5
7097   cat conftest.$ac_ext >&5
7098   eval "$as_ac_Header=no"
7099 fi
7100 rm -f conftest.err conftest.$ac_ext
7101 fi
7102 echo "$as_me:7102: result: `eval echo '${'$as_ac_Header'}'`" >&5
7103 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7104 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7105   cat >>confdefs.h <<EOF
7106 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7107 EOF
7108
7109 fi
7110 done
7111
7112 cat >>confdefs.h <<\EOF
7113 #define NCURSES 1
7114 EOF
7115
7116 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7117
7118                 cat >>confdefs.h <<EOF
7119 #define $cf_nculib_ROOT 1
7120 EOF
7121
7122                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7123
7124         else
7125
7126 cf_ncuhdr_root=$cf_cv_screen
7127
7128 test -n "$cf_cv_curses_dir" && \
7129 test "$cf_cv_curses_dir" != "no" && { \
7130
7131 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7132   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7133   do
7134         while test $cf_add_incdir != /usr/include
7135         do
7136           if test -d $cf_add_incdir
7137           then
7138                 cf_have_incdir=no
7139                 if test -n "$CFLAGS$CPPFLAGS" ; then
7140                   # a loop is needed to ensure we can add subdirs of existing dirs
7141                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7142                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7143                           cf_have_incdir=yes; break
7144                         fi
7145                   done
7146                 fi
7147
7148                 if test "$cf_have_incdir" = no ; then
7149                   if test "$cf_add_incdir" = /usr/local/include ; then
7150                         if test "$GCC" = yes
7151                         then
7152                           cf_save_CPPFLAGS=$CPPFLAGS
7153                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7154                           cat >conftest.$ac_ext <<_ACEOF
7155 #line 7155 "configure"
7156 #include "confdefs.h"
7157 #include <stdio.h>
7158 int
7159 main (void)
7160 {
7161 printf("Hello")
7162   ;
7163   return 0;
7164 }
7165 _ACEOF
7166 rm -f conftest.$ac_objext
7167 if { (eval echo "$as_me:7167: \"$ac_compile\"") >&5
7168   (eval $ac_compile) 2>&5
7169   ac_status=$?
7170   echo "$as_me:7170: \$? = $ac_status" >&5
7171   (exit $ac_status); } &&
7172          { ac_try='test -s conftest.$ac_objext'
7173   { (eval echo "$as_me:7173: \"$ac_try\"") >&5
7174   (eval $ac_try) 2>&5
7175   ac_status=$?
7176   echo "$as_me:7176: \$? = $ac_status" >&5
7177   (exit $ac_status); }; }; then
7178   :
7179 else
7180   echo "$as_me: failed program was:" >&5
7181 cat conftest.$ac_ext >&5
7182 cf_have_incdir=yes
7183 fi
7184 rm -f conftest.$ac_objext conftest.$ac_ext
7185                           CPPFLAGS=$cf_save_CPPFLAGS
7186                         fi
7187                   fi
7188                 fi
7189
7190                 if test "$cf_have_incdir" = no ; then
7191                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7192
7193 echo "${as_me:-configure}:7193: testing adding $cf_add_incdir to include-path ..." 1>&5
7194
7195                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7196
7197                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7198                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7199                   cf_add_incdir="$cf_top_incdir"
7200                 else
7201                   break
7202                 fi
7203           else
7204                 break
7205           fi
7206         done
7207   done
7208 fi
7209
7210 }
7211
7212 echo "$as_me:7212: checking for $cf_ncuhdr_root header in include-path" >&5
7213 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7214 if test "${cf_cv_ncurses_h+set}" = set; then
7215   echo $ECHO_N "(cached) $ECHO_C" >&6
7216 else
7217
7218         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7219         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7220         for cf_header in $cf_header_list
7221         do
7222
7223         cat >conftest.$ac_ext <<_ACEOF
7224 #line 7224 "configure"
7225 #include "confdefs.h"
7226
7227 #include <$cf_header>
7228 int
7229 main (void)
7230 {
7231
7232 #ifdef NCURSES_VERSION
7233
7234 printf("%s\n", NCURSES_VERSION);
7235 #else
7236 #ifdef __NCURSES_H
7237 printf("old\n");
7238 #else
7239         make an error
7240 #endif
7241 #endif
7242
7243   ;
7244   return 0;
7245 }
7246 _ACEOF
7247 rm -f conftest.$ac_objext
7248 if { (eval echo "$as_me:7248: \"$ac_compile\"") >&5
7249   (eval $ac_compile) 2>&5
7250   ac_status=$?
7251   echo "$as_me:7251: \$? = $ac_status" >&5
7252   (exit $ac_status); } &&
7253          { ac_try='test -s conftest.$ac_objext'
7254   { (eval echo "$as_me:7254: \"$ac_try\"") >&5
7255   (eval $ac_try) 2>&5
7256   ac_status=$?
7257   echo "$as_me:7257: \$? = $ac_status" >&5
7258   (exit $ac_status); }; }; then
7259   cf_cv_ncurses_h=$cf_header
7260
7261 else
7262   echo "$as_me: failed program was:" >&5
7263 cat conftest.$ac_ext >&5
7264 cf_cv_ncurses_h=no
7265 fi
7266 rm -f conftest.$ac_objext conftest.$ac_ext
7267
7268                 test "$cf_cv_ncurses_h" != no && break
7269         done
7270
7271 fi
7272 echo "$as_me:7272: result: $cf_cv_ncurses_h" >&5
7273 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7274
7275 if test "$cf_cv_ncurses_h" != no ; then
7276         cf_cv_ncurses_header=$cf_cv_ncurses_h
7277 else
7278
7279 echo "$as_me:7279: checking for $cf_ncuhdr_root include-path" >&5
7280 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7281 if test "${cf_cv_ncurses_h2+set}" = set; then
7282   echo $ECHO_N "(cached) $ECHO_C" >&6
7283 else
7284
7285         test -n "$verbose" && echo
7286
7287 cf_search=
7288
7289 # collect the current set of include-directories from compiler flags
7290 cf_header_path_list=""
7291 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7292         for cf_header_path in $CPPFLAGS $CFLAGS
7293         do
7294                 case $cf_header_path in
7295                 (-I*)
7296                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7297
7298 test "x$cf_header_path" != "xNONE" && \
7299 test -d "$cf_header_path" && \
7300  {
7301         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7302         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7303         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7304         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7305         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7306         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"
7307 }
7308
7309                         cf_header_path_list="$cf_header_path_list $cf_search"
7310                         ;;
7311                 esac
7312         done
7313 fi
7314
7315 # add the variations for the package we are looking for
7316
7317 cf_search=
7318
7319 test "x$prefix" != "xNONE" && \
7320 test -d "$prefix" && \
7321  {
7322         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7323         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7324         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7325         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7326         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7327         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7328 }
7329
7330 for cf_subdir_prefix in \
7331         /usr \
7332         /usr/local \
7333         /usr/pkg \
7334         /opt \
7335         /opt/local \
7336         $HOME
7337 do
7338
7339 test "x$cf_subdir_prefix" != "x$prefix" && \
7340 test -d "$cf_subdir_prefix" && \
7341 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7342         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7343         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7344         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7345         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7346         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7347         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"
7348 }
7349
7350 done
7351
7352 test "$includedir" != NONE && \
7353 test "$includedir" != "/usr/include" && \
7354 test -d "$includedir" && {
7355         test -d $includedir &&    cf_search="$cf_search $includedir"
7356         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7357 }
7358
7359 test "$oldincludedir" != NONE && \
7360 test "$oldincludedir" != "/usr/include" && \
7361 test -d "$oldincludedir" && {
7362         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7363         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7364 }
7365
7366 cf_search="$cf_search $cf_header_path_list"
7367
7368         test -n "$verbose" && echo search path $cf_search
7369         cf_save2_CPPFLAGS="$CPPFLAGS"
7370         for cf_incdir in $cf_search
7371         do
7372
7373 if test -n "$cf_incdir" ; then
7374   for cf_add_incdir in $cf_incdir
7375   do
7376         while test $cf_add_incdir != /usr/include
7377         do
7378           if test -d $cf_add_incdir
7379           then
7380                 cf_have_incdir=no
7381                 if test -n "$CFLAGS$CPPFLAGS" ; then
7382                   # a loop is needed to ensure we can add subdirs of existing dirs
7383                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7384                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7385                           cf_have_incdir=yes; break
7386                         fi
7387                   done
7388                 fi
7389
7390                 if test "$cf_have_incdir" = no ; then
7391                   if test "$cf_add_incdir" = /usr/local/include ; then
7392                         if test "$GCC" = yes
7393                         then
7394                           cf_save_CPPFLAGS=$CPPFLAGS
7395                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7396                           cat >conftest.$ac_ext <<_ACEOF
7397 #line 7397 "configure"
7398 #include "confdefs.h"
7399 #include <stdio.h>
7400 int
7401 main (void)
7402 {
7403 printf("Hello")
7404   ;
7405   return 0;
7406 }
7407 _ACEOF
7408 rm -f conftest.$ac_objext
7409 if { (eval echo "$as_me:7409: \"$ac_compile\"") >&5
7410   (eval $ac_compile) 2>&5
7411   ac_status=$?
7412   echo "$as_me:7412: \$? = $ac_status" >&5
7413   (exit $ac_status); } &&
7414          { ac_try='test -s conftest.$ac_objext'
7415   { (eval echo "$as_me:7415: \"$ac_try\"") >&5
7416   (eval $ac_try) 2>&5
7417   ac_status=$?
7418   echo "$as_me:7418: \$? = $ac_status" >&5
7419   (exit $ac_status); }; }; then
7420   :
7421 else
7422   echo "$as_me: failed program was:" >&5
7423 cat conftest.$ac_ext >&5
7424 cf_have_incdir=yes
7425 fi
7426 rm -f conftest.$ac_objext conftest.$ac_ext
7427                           CPPFLAGS=$cf_save_CPPFLAGS
7428                         fi
7429                   fi
7430                 fi
7431
7432                 if test "$cf_have_incdir" = no ; then
7433                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7434
7435 echo "${as_me:-configure}:7435: testing adding $cf_add_incdir to include-path ..." 1>&5
7436
7437                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7438
7439                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7440                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7441                   cf_add_incdir="$cf_top_incdir"
7442                 else
7443                   break
7444                 fi
7445           else
7446                 break
7447           fi
7448         done
7449   done
7450 fi
7451
7452                 for cf_header in \
7453                         ncurses.h \
7454                         curses.h
7455                 do
7456
7457         cat >conftest.$ac_ext <<_ACEOF
7458 #line 7458 "configure"
7459 #include "confdefs.h"
7460
7461 #include <$cf_header>
7462 int
7463 main (void)
7464 {
7465
7466 #ifdef NCURSES_VERSION
7467
7468 printf("%s\n", NCURSES_VERSION);
7469 #else
7470 #ifdef __NCURSES_H
7471 printf("old\n");
7472 #else
7473         make an error
7474 #endif
7475 #endif
7476
7477   ;
7478   return 0;
7479 }
7480 _ACEOF
7481 rm -f conftest.$ac_objext
7482 if { (eval echo "$as_me:7482: \"$ac_compile\"") >&5
7483   (eval $ac_compile) 2>&5
7484   ac_status=$?
7485   echo "$as_me:7485: \$? = $ac_status" >&5
7486   (exit $ac_status); } &&
7487          { ac_try='test -s conftest.$ac_objext'
7488   { (eval echo "$as_me:7488: \"$ac_try\"") >&5
7489   (eval $ac_try) 2>&5
7490   ac_status=$?
7491   echo "$as_me:7491: \$? = $ac_status" >&5
7492   (exit $ac_status); }; }; then
7493   cf_cv_ncurses_h2=$cf_header
7494
7495 else
7496   echo "$as_me: failed program was:" >&5
7497 cat conftest.$ac_ext >&5
7498 cf_cv_ncurses_h2=no
7499 fi
7500 rm -f conftest.$ac_objext conftest.$ac_ext
7501
7502                         if test "$cf_cv_ncurses_h2" != no ; then
7503                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7504                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7505                                 break
7506                         fi
7507                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7508                 done
7509                 CPPFLAGS="$cf_save2_CPPFLAGS"
7510                 test "$cf_cv_ncurses_h2" != no && break
7511         done
7512         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7512: error: not found" >&5
7513 echo "$as_me: error: not found" >&2;}
7514    { (exit 1); exit 1; }; }
7515
7516 fi
7517 echo "$as_me:7517: result: $cf_cv_ncurses_h2" >&5
7518 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7519
7520         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7521         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7522         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7523                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7524         fi
7525
7526 if test -n "$cf_1st_incdir" ; then
7527   for cf_add_incdir in $cf_1st_incdir
7528   do
7529         while test $cf_add_incdir != /usr/include
7530         do
7531           if test -d $cf_add_incdir
7532           then
7533                 cf_have_incdir=no
7534                 if test -n "$CFLAGS$CPPFLAGS" ; then
7535                   # a loop is needed to ensure we can add subdirs of existing dirs
7536                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7537                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7538                           cf_have_incdir=yes; break
7539                         fi
7540                   done
7541                 fi
7542
7543                 if test "$cf_have_incdir" = no ; then
7544                   if test "$cf_add_incdir" = /usr/local/include ; then
7545                         if test "$GCC" = yes
7546                         then
7547                           cf_save_CPPFLAGS=$CPPFLAGS
7548                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7549                           cat >conftest.$ac_ext <<_ACEOF
7550 #line 7550 "configure"
7551 #include "confdefs.h"
7552 #include <stdio.h>
7553 int
7554 main (void)
7555 {
7556 printf("Hello")
7557   ;
7558   return 0;
7559 }
7560 _ACEOF
7561 rm -f conftest.$ac_objext
7562 if { (eval echo "$as_me:7562: \"$ac_compile\"") >&5
7563   (eval $ac_compile) 2>&5
7564   ac_status=$?
7565   echo "$as_me:7565: \$? = $ac_status" >&5
7566   (exit $ac_status); } &&
7567          { ac_try='test -s conftest.$ac_objext'
7568   { (eval echo "$as_me:7568: \"$ac_try\"") >&5
7569   (eval $ac_try) 2>&5
7570   ac_status=$?
7571   echo "$as_me:7571: \$? = $ac_status" >&5
7572   (exit $ac_status); }; }; then
7573   :
7574 else
7575   echo "$as_me: failed program was:" >&5
7576 cat conftest.$ac_ext >&5
7577 cf_have_incdir=yes
7578 fi
7579 rm -f conftest.$ac_objext conftest.$ac_ext
7580                           CPPFLAGS=$cf_save_CPPFLAGS
7581                         fi
7582                   fi
7583                 fi
7584
7585                 if test "$cf_have_incdir" = no ; then
7586                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7587
7588 echo "${as_me:-configure}:7588: testing adding $cf_add_incdir to include-path ..." 1>&5
7589
7590                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7591
7592                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7593                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7594                   cf_add_incdir="$cf_top_incdir"
7595                 else
7596                   break
7597                 fi
7598           else
7599                 break
7600           fi
7601         done
7602   done
7603 fi
7604
7605 fi
7606
7607 # Set definitions to allow ifdef'ing for ncurses.h
7608
7609 case $cf_cv_ncurses_header in
7610 (*ncurses.h)
7611
7612 cat >>confdefs.h <<\EOF
7613 #define HAVE_NCURSES_H 1
7614 EOF
7615
7616         ;;
7617 esac
7618
7619 case $cf_cv_ncurses_header in
7620 (ncurses/curses.h|ncurses/ncurses.h)
7621
7622 cat >>confdefs.h <<\EOF
7623 #define HAVE_NCURSES_NCURSES_H 1
7624 EOF
7625
7626         ;;
7627 (ncursesw/curses.h|ncursesw/ncurses.h)
7628
7629 cat >>confdefs.h <<\EOF
7630 #define HAVE_NCURSESW_NCURSES_H 1
7631 EOF
7632
7633         ;;
7634 esac
7635
7636 echo "$as_me:7636: checking for terminfo header" >&5
7637 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7638 if test "${cf_cv_term_header+set}" = set; then
7639   echo $ECHO_N "(cached) $ECHO_C" >&6
7640 else
7641
7642 case ${cf_cv_ncurses_header} in
7643 (*/ncurses.h|*/ncursesw.h)
7644         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7645         ;;
7646 (*)
7647         cf_term_header=term.h
7648         ;;
7649 esac
7650
7651 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7652 do
7653 cat >conftest.$ac_ext <<_ACEOF
7654 #line 7654 "configure"
7655 #include "confdefs.h"
7656 #include <stdio.h>
7657 #include <${cf_cv_ncurses_header:-curses.h}>
7658 #include <$cf_test>
7659
7660 int
7661 main (void)
7662 {
7663 int x = auto_left_margin
7664   ;
7665   return 0;
7666 }
7667 _ACEOF
7668 rm -f conftest.$ac_objext
7669 if { (eval echo "$as_me:7669: \"$ac_compile\"") >&5
7670   (eval $ac_compile) 2>&5
7671   ac_status=$?
7672   echo "$as_me:7672: \$? = $ac_status" >&5
7673   (exit $ac_status); } &&
7674          { ac_try='test -s conftest.$ac_objext'
7675   { (eval echo "$as_me:7675: \"$ac_try\"") >&5
7676   (eval $ac_try) 2>&5
7677   ac_status=$?
7678   echo "$as_me:7678: \$? = $ac_status" >&5
7679   (exit $ac_status); }; }; then
7680
7681         cf_cv_term_header="$cf_test"
7682 else
7683   echo "$as_me: failed program was:" >&5
7684 cat conftest.$ac_ext >&5
7685
7686         cf_cv_term_header=unknown
7687
7688 fi
7689 rm -f conftest.$ac_objext conftest.$ac_ext
7690         test "$cf_cv_term_header" != unknown && break
7691 done
7692
7693 fi
7694 echo "$as_me:7694: result: $cf_cv_term_header" >&5
7695 echo "${ECHO_T}$cf_cv_term_header" >&6
7696
7697 # Set definitions to allow ifdef'ing to accommodate subdirectories
7698
7699 case $cf_cv_term_header in
7700 (*term.h)
7701
7702 cat >>confdefs.h <<\EOF
7703 #define HAVE_TERM_H 1
7704 EOF
7705
7706         ;;
7707 esac
7708
7709 case $cf_cv_term_header in
7710 (ncurses/term.h)
7711
7712 cat >>confdefs.h <<\EOF
7713 #define HAVE_NCURSES_TERM_H 1
7714 EOF
7715
7716         ;;
7717 (ncursesw/term.h)
7718
7719 cat >>confdefs.h <<\EOF
7720 #define HAVE_NCURSESW_TERM_H 1
7721 EOF
7722
7723         ;;
7724 esac
7725
7726 # some applications need this, but should check for NCURSES_VERSION
7727
7728 cat >>confdefs.h <<\EOF
7729 #define NCURSES 1
7730 EOF
7731
7732 echo "$as_me:7732: checking for ncurses version" >&5
7733 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7734 if test "${cf_cv_ncurses_version+set}" = set; then
7735   echo $ECHO_N "(cached) $ECHO_C" >&6
7736 else
7737
7738         cf_cv_ncurses_version=no
7739         cf_tempfile=out$$
7740         rm -f $cf_tempfile
7741         if test "$cross_compiling" = yes; then
7742
7743         # This will not work if the preprocessor splits the line after the
7744         # Autoconf token.  The 'unproto' program does that.
7745         cat > conftest.$ac_ext <<EOF
7746 #include <${cf_cv_ncurses_header:-curses.h}>
7747 #undef Autoconf
7748 #ifdef NCURSES_VERSION
7749 Autoconf NCURSES_VERSION
7750 #else
7751 #ifdef __NCURSES_H
7752 Autoconf "old"
7753 #endif
7754 ;
7755 #endif
7756 EOF
7757         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7758         { (eval echo "$as_me:7758: \"$cf_try\"") >&5
7759   (eval $cf_try) 2>&5
7760   ac_status=$?
7761   echo "$as_me:7761: \$? = $ac_status" >&5
7762   (exit $ac_status); }
7763         if test -f conftest.out ; then
7764                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7765                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7766                 rm -f conftest.out
7767         fi
7768
7769 else
7770   cat >conftest.$ac_ext <<_ACEOF
7771 #line 7771 "configure"
7772 #include "confdefs.h"
7773
7774 #include <${cf_cv_ncurses_header:-curses.h}>
7775 #include <stdio.h>
7776 int main(void)
7777 {
7778         FILE *fp = fopen("$cf_tempfile", "w");
7779 #ifdef NCURSES_VERSION
7780 # ifdef NCURSES_VERSION_PATCH
7781         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7782 # else
7783         fprintf(fp, "%s\n", NCURSES_VERSION);
7784 # endif
7785 #else
7786 # ifdef __NCURSES_H
7787         fprintf(fp, "old\n");
7788 # else
7789         make an error
7790 # endif
7791 #endif
7792         ${cf_cv_main_return:-return}(0);
7793 }
7794 _ACEOF
7795 rm -f conftest$ac_exeext
7796 if { (eval echo "$as_me:7796: \"$ac_link\"") >&5
7797   (eval $ac_link) 2>&5
7798   ac_status=$?
7799   echo "$as_me:7799: \$? = $ac_status" >&5
7800   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7801   { (eval echo "$as_me:7801: \"$ac_try\"") >&5
7802   (eval $ac_try) 2>&5
7803   ac_status=$?
7804   echo "$as_me:7804: \$? = $ac_status" >&5
7805   (exit $ac_status); }; }; then
7806
7807         cf_cv_ncurses_version=`cat $cf_tempfile`
7808 else
7809   echo "$as_me: program exited with status $ac_status" >&5
7810 echo "$as_me: failed program was:" >&5
7811 cat conftest.$ac_ext >&5
7812 fi
7813 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7814 fi
7815         rm -f $cf_tempfile
7816
7817 fi
7818 echo "$as_me:7818: result: $cf_cv_ncurses_version" >&5
7819 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7820 test "$cf_cv_ncurses_version" = no ||
7821 cat >>confdefs.h <<\EOF
7822 #define NCURSES 1
7823 EOF
7824
7825 cf_nculib_root=$cf_cv_screen
7826         # This works, except for the special case where we find gpm, but
7827         # ncurses is in a nonstandard location via $LIBS, and we really want
7828         # to link gpm.
7829 cf_ncurses_LIBS=""
7830 cf_ncurses_SAVE="$LIBS"
7831 echo "$as_me:7831: checking for Gpm_Open in -lgpm" >&5
7832 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7833 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7834   echo $ECHO_N "(cached) $ECHO_C" >&6
7835 else
7836   ac_check_lib_save_LIBS=$LIBS
7837 LIBS="-lgpm  $LIBS"
7838 cat >conftest.$ac_ext <<_ACEOF
7839 #line 7839 "configure"
7840 #include "confdefs.h"
7841
7842 /* Override any gcc2 internal prototype to avoid an error.  */
7843 #ifdef __cplusplus
7844 extern "C"
7845 #endif
7846 /* We use char because int might match the return type of a gcc2
7847    builtin and then its argument prototype would still apply.  */
7848 char Gpm_Open ();
7849 int
7850 main (void)
7851 {
7852 Gpm_Open ();
7853   ;
7854   return 0;
7855 }
7856 _ACEOF
7857 rm -f conftest.$ac_objext conftest$ac_exeext
7858 if { (eval echo "$as_me:7858: \"$ac_link\"") >&5
7859   (eval $ac_link) 2>&5
7860   ac_status=$?
7861   echo "$as_me:7861: \$? = $ac_status" >&5
7862   (exit $ac_status); } &&
7863          { ac_try='test -s conftest$ac_exeext'
7864   { (eval echo "$as_me:7864: \"$ac_try\"") >&5
7865   (eval $ac_try) 2>&5
7866   ac_status=$?
7867   echo "$as_me:7867: \$? = $ac_status" >&5
7868   (exit $ac_status); }; }; then
7869   ac_cv_lib_gpm_Gpm_Open=yes
7870 else
7871   echo "$as_me: failed program was:" >&5
7872 cat conftest.$ac_ext >&5
7873 ac_cv_lib_gpm_Gpm_Open=no
7874 fi
7875 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7876 LIBS=$ac_check_lib_save_LIBS
7877 fi
7878 echo "$as_me:7878: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7879 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7880 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7881   echo "$as_me:7881: checking for initscr in -lgpm" >&5
7882 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7883 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7884   echo $ECHO_N "(cached) $ECHO_C" >&6
7885 else
7886   ac_check_lib_save_LIBS=$LIBS
7887 LIBS="-lgpm  $LIBS"
7888 cat >conftest.$ac_ext <<_ACEOF
7889 #line 7889 "configure"
7890 #include "confdefs.h"
7891
7892 /* Override any gcc2 internal prototype to avoid an error.  */
7893 #ifdef __cplusplus
7894 extern "C"
7895 #endif
7896 /* We use char because int might match the return type of a gcc2
7897    builtin and then its argument prototype would still apply.  */
7898 char initscr ();
7899 int
7900 main (void)
7901 {
7902 initscr ();
7903   ;
7904   return 0;
7905 }
7906 _ACEOF
7907 rm -f conftest.$ac_objext conftest$ac_exeext
7908 if { (eval echo "$as_me:7908: \"$ac_link\"") >&5
7909   (eval $ac_link) 2>&5
7910   ac_status=$?
7911   echo "$as_me:7911: \$? = $ac_status" >&5
7912   (exit $ac_status); } &&
7913          { ac_try='test -s conftest$ac_exeext'
7914   { (eval echo "$as_me:7914: \"$ac_try\"") >&5
7915   (eval $ac_try) 2>&5
7916   ac_status=$?
7917   echo "$as_me:7917: \$? = $ac_status" >&5
7918   (exit $ac_status); }; }; then
7919   ac_cv_lib_gpm_initscr=yes
7920 else
7921   echo "$as_me: failed program was:" >&5
7922 cat conftest.$ac_ext >&5
7923 ac_cv_lib_gpm_initscr=no
7924 fi
7925 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7926 LIBS=$ac_check_lib_save_LIBS
7927 fi
7928 echo "$as_me:7928: result: $ac_cv_lib_gpm_initscr" >&5
7929 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7930 if test $ac_cv_lib_gpm_initscr = yes; then
7931   LIBS="$cf_ncurses_SAVE"
7932 else
7933   cf_ncurses_LIBS="-lgpm"
7934 fi
7935
7936 fi
7937
7938 case $host_os in
7939 (freebsd*)
7940         # This is only necessary if you are linking against an obsolete
7941         # version of ncurses (but it should do no harm, since it's static).
7942         if test "$cf_nculib_root" = ncurses ; then
7943                 echo "$as_me:7943: checking for tgoto in -lmytinfo" >&5
7944 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7945 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7946   echo $ECHO_N "(cached) $ECHO_C" >&6
7947 else
7948   ac_check_lib_save_LIBS=$LIBS
7949 LIBS="-lmytinfo  $LIBS"
7950 cat >conftest.$ac_ext <<_ACEOF
7951 #line 7951 "configure"
7952 #include "confdefs.h"
7953
7954 /* Override any gcc2 internal prototype to avoid an error.  */
7955 #ifdef __cplusplus
7956 extern "C"
7957 #endif
7958 /* We use char because int might match the return type of a gcc2
7959    builtin and then its argument prototype would still apply.  */
7960 char tgoto ();
7961 int
7962 main (void)
7963 {
7964 tgoto ();
7965   ;
7966   return 0;
7967 }
7968 _ACEOF
7969 rm -f conftest.$ac_objext conftest$ac_exeext
7970 if { (eval echo "$as_me:7970: \"$ac_link\"") >&5
7971   (eval $ac_link) 2>&5
7972   ac_status=$?
7973   echo "$as_me:7973: \$? = $ac_status" >&5
7974   (exit $ac_status); } &&
7975          { ac_try='test -s conftest$ac_exeext'
7976   { (eval echo "$as_me:7976: \"$ac_try\"") >&5
7977   (eval $ac_try) 2>&5
7978   ac_status=$?
7979   echo "$as_me:7979: \$? = $ac_status" >&5
7980   (exit $ac_status); }; }; then
7981   ac_cv_lib_mytinfo_tgoto=yes
7982 else
7983   echo "$as_me: failed program was:" >&5
7984 cat conftest.$ac_ext >&5
7985 ac_cv_lib_mytinfo_tgoto=no
7986 fi
7987 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7988 LIBS=$ac_check_lib_save_LIBS
7989 fi
7990 echo "$as_me:7990: result: $ac_cv_lib_mytinfo_tgoto" >&5
7991 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7992 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7993   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7994 fi
7995
7996         fi
7997         ;;
7998 esac
7999
8000 cf_add_libs="$cf_ncurses_LIBS"
8001 # Filter out duplicates - this happens with badly-designed ".pc" files...
8002 for cf_add_1lib in $LIBS
8003 do
8004         for cf_add_2lib in $cf_add_libs
8005         do
8006                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8007                 then
8008                         cf_add_1lib=
8009                         break
8010                 fi
8011         done
8012         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8013 done
8014 LIBS="$cf_add_libs"
8015
8016 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8017 then
8018
8019 cf_add_libs="-l$cf_nculib_root"
8020 # Filter out duplicates - this happens with badly-designed ".pc" files...
8021 for cf_add_1lib in $LIBS
8022 do
8023         for cf_add_2lib in $cf_add_libs
8024         do
8025                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8026                 then
8027                         cf_add_1lib=
8028                         break
8029                 fi
8030         done
8031         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8032 done
8033 LIBS="$cf_add_libs"
8034
8035 else
8036
8037         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8038         cf_libdir=""
8039         echo "$as_me:8039: checking for initscr" >&5
8040 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8041 if test "${ac_cv_func_initscr+set}" = set; then
8042   echo $ECHO_N "(cached) $ECHO_C" >&6
8043 else
8044   cat >conftest.$ac_ext <<_ACEOF
8045 #line 8045 "configure"
8046 #include "confdefs.h"
8047 /* System header to define __stub macros and hopefully few prototypes,
8048     which can conflict with char initscr (); below.  */
8049 #include <assert.h>
8050 /* Override any gcc2 internal prototype to avoid an error.  */
8051 #ifdef __cplusplus
8052 extern "C"
8053 #endif
8054 /* We use char because int might match the return type of a gcc2
8055    builtin and then its argument prototype would still apply.  */
8056 char initscr ();
8057 char (*f) ();
8058
8059 int
8060 main (void)
8061 {
8062 /* The GNU C library defines this for functions which it implements
8063     to always fail with ENOSYS.  Some functions are actually named
8064     something starting with __ and the normal name is an alias.  */
8065 #if defined (__stub_initscr) || defined (__stub___initscr)
8066 choke me
8067 #else
8068 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8069 #endif
8070
8071   ;
8072   return 0;
8073 }
8074 _ACEOF
8075 rm -f conftest.$ac_objext conftest$ac_exeext
8076 if { (eval echo "$as_me:8076: \"$ac_link\"") >&5
8077   (eval $ac_link) 2>&5
8078   ac_status=$?
8079   echo "$as_me:8079: \$? = $ac_status" >&5
8080   (exit $ac_status); } &&
8081          { ac_try='test -s conftest$ac_exeext'
8082   { (eval echo "$as_me:8082: \"$ac_try\"") >&5
8083   (eval $ac_try) 2>&5
8084   ac_status=$?
8085   echo "$as_me:8085: \$? = $ac_status" >&5
8086   (exit $ac_status); }; }; then
8087   ac_cv_func_initscr=yes
8088 else
8089   echo "$as_me: failed program was:" >&5
8090 cat conftest.$ac_ext >&5
8091 ac_cv_func_initscr=no
8092 fi
8093 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8094 fi
8095 echo "$as_me:8095: result: $ac_cv_func_initscr" >&5
8096 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8097 if test $ac_cv_func_initscr = yes; then
8098   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8099 else
8100
8101                 cf_save_LIBS="$LIBS"
8102                 echo "$as_me:8102: checking for initscr in -l$cf_nculib_root" >&5
8103 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8104                 LIBS="-l$cf_nculib_root $LIBS"
8105                 cat >conftest.$ac_ext <<_ACEOF
8106 #line 8106 "configure"
8107 #include "confdefs.h"
8108 #include <${cf_cv_ncurses_header:-curses.h}>
8109 int
8110 main (void)
8111 {
8112 initscr()
8113   ;
8114   return 0;
8115 }
8116 _ACEOF
8117 rm -f conftest.$ac_objext conftest$ac_exeext
8118 if { (eval echo "$as_me:8118: \"$ac_link\"") >&5
8119   (eval $ac_link) 2>&5
8120   ac_status=$?
8121   echo "$as_me:8121: \$? = $ac_status" >&5
8122   (exit $ac_status); } &&
8123          { ac_try='test -s conftest$ac_exeext'
8124   { (eval echo "$as_me:8124: \"$ac_try\"") >&5
8125   (eval $ac_try) 2>&5
8126   ac_status=$?
8127   echo "$as_me:8127: \$? = $ac_status" >&5
8128   (exit $ac_status); }; }; then
8129   echo "$as_me:8129: result: yes" >&5
8130 echo "${ECHO_T}yes" >&6
8131                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8132
8133 else
8134   echo "$as_me: failed program was:" >&5
8135 cat conftest.$ac_ext >&5
8136 echo "$as_me:8136: result: no" >&5
8137 echo "${ECHO_T}no" >&6
8138
8139 cf_search=
8140 cf_library_path_list=""
8141 if test -n "${LDFLAGS}${LIBS}" ; then
8142         for cf_library_path in $LDFLAGS $LIBS
8143         do
8144                 case $cf_library_path in
8145                 (-L*)
8146                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8147
8148 test "x$cf_library_path" != "xNONE" && \
8149 test -d "$cf_library_path" && \
8150  {
8151         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8152         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8153         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8154         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8155         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8156         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"
8157 }
8158
8159                         cf_library_path_list="$cf_library_path_list $cf_search"
8160                         ;;
8161                 esac
8162         done
8163 fi
8164
8165 cf_search=
8166
8167 test "x$prefix" != "xNONE" && \
8168 test -d "$prefix" && \
8169  {
8170         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8171         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8172         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8173         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8174         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8175         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8176 }
8177
8178 for cf_subdir_prefix in \
8179         /usr \
8180         /usr/local \
8181         /usr/pkg \
8182         /opt \
8183         /opt/local \
8184         $HOME
8185 do
8186
8187 test "x$cf_subdir_prefix" != "x$prefix" && \
8188 test -d "$cf_subdir_prefix" && \
8189 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8190         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8191         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8192         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8193         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8194         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8195         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"
8196 }
8197
8198 done
8199
8200 cf_search="$cf_library_path_list $cf_search"
8201
8202                         for cf_libdir in $cf_search
8203                         do
8204                                 echo "$as_me:8204: checking for -l$cf_nculib_root in $cf_libdir" >&5
8205 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8206                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8207                                 cat >conftest.$ac_ext <<_ACEOF
8208 #line 8208 "configure"
8209 #include "confdefs.h"
8210 #include <${cf_cv_ncurses_header:-curses.h}>
8211 int
8212 main (void)
8213 {
8214 initscr()
8215   ;
8216   return 0;
8217 }
8218 _ACEOF
8219 rm -f conftest.$ac_objext conftest$ac_exeext
8220 if { (eval echo "$as_me:8220: \"$ac_link\"") >&5
8221   (eval $ac_link) 2>&5
8222   ac_status=$?
8223   echo "$as_me:8223: \$? = $ac_status" >&5
8224   (exit $ac_status); } &&
8225          { ac_try='test -s conftest$ac_exeext'
8226   { (eval echo "$as_me:8226: \"$ac_try\"") >&5
8227   (eval $ac_try) 2>&5
8228   ac_status=$?
8229   echo "$as_me:8229: \$? = $ac_status" >&5
8230   (exit $ac_status); }; }; then
8231   echo "$as_me:8231: result: yes" >&5
8232 echo "${ECHO_T}yes" >&6
8233                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8234                                          break
8235 else
8236   echo "$as_me: failed program was:" >&5
8237 cat conftest.$ac_ext >&5
8238 echo "$as_me:8238: result: no" >&5
8239 echo "${ECHO_T}no" >&6
8240                                          LIBS="$cf_save_LIBS"
8241 fi
8242 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8243                         done
8244
8245 fi
8246 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8247
8248 fi
8249
8250 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8251
8252 if test $cf_found_library = no ; then
8253         { { echo "$as_me:8253: error: Cannot link $cf_nculib_root library" >&5
8254 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8255    { (exit 1); exit 1; }; }
8256 fi
8257
8258 fi
8259
8260 if test -n "$cf_ncurses_LIBS" ; then
8261         echo "$as_me:8261: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8262 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8263         cf_ncurses_SAVE="$LIBS"
8264         for p in $cf_ncurses_LIBS ; do
8265                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8266                 if test "$q" != "$LIBS" ; then
8267                         LIBS="$q"
8268                 fi
8269         done
8270         cat >conftest.$ac_ext <<_ACEOF
8271 #line 8271 "configure"
8272 #include "confdefs.h"
8273 #include <${cf_cv_ncurses_header:-curses.h}>
8274 int
8275 main (void)
8276 {
8277 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8278   ;
8279   return 0;
8280 }
8281 _ACEOF
8282 rm -f conftest.$ac_objext conftest$ac_exeext
8283 if { (eval echo "$as_me:8283: \"$ac_link\"") >&5
8284   (eval $ac_link) 2>&5
8285   ac_status=$?
8286   echo "$as_me:8286: \$? = $ac_status" >&5
8287   (exit $ac_status); } &&
8288          { ac_try='test -s conftest$ac_exeext'
8289   { (eval echo "$as_me:8289: \"$ac_try\"") >&5
8290   (eval $ac_try) 2>&5
8291   ac_status=$?
8292   echo "$as_me:8292: \$? = $ac_status" >&5
8293   (exit $ac_status); }; }; then
8294   echo "$as_me:8294: result: yes" >&5
8295 echo "${ECHO_T}yes" >&6
8296 else
8297   echo "$as_me: failed program was:" >&5
8298 cat conftest.$ac_ext >&5
8299 echo "$as_me:8299: result: no" >&5
8300 echo "${ECHO_T}no" >&6
8301                  LIBS="$cf_ncurses_SAVE"
8302 fi
8303 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8304 fi
8305
8306 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8307
8308 cat >>confdefs.h <<EOF
8309 #define $cf_nculib_ROOT 1
8310 EOF
8311
8312         fi
8313 else
8314         NCURSES_CONFIG=none
8315 fi
8316
8317         ;;
8318 (ncurses*)
8319
8320 cf_ncuconfig_root=$cf_cv_screen
8321 cf_have_ncuconfig=no
8322
8323 if test "x${PKG_CONFIG:=none}" != xnone; then
8324         echo "$as_me:8324: checking pkg-config for $cf_ncuconfig_root" >&5
8325 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8326         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8327                 echo "$as_me:8327: result: yes" >&5
8328 echo "${ECHO_T}yes" >&6
8329
8330                 echo "$as_me:8330: checking if the $cf_ncuconfig_root package files work" >&5
8331 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8332                 cf_have_ncuconfig=unknown
8333
8334                 cf_save_CPPFLAGS="$CPPFLAGS"
8335                 cf_save_LIBS="$LIBS"
8336
8337                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8338
8339 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8340 # Filter out duplicates - this happens with badly-designed ".pc" files...
8341 for cf_add_1lib in $LIBS
8342 do
8343         for cf_add_2lib in $cf_add_libs
8344         do
8345                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8346                 then
8347                         cf_add_1lib=
8348                         break
8349                 fi
8350         done
8351         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8352 done
8353 LIBS="$cf_add_libs"
8354
8355                 cat >conftest.$ac_ext <<_ACEOF
8356 #line 8356 "configure"
8357 #include "confdefs.h"
8358 #include <${cf_cv_ncurses_header:-curses.h}>
8359 int
8360 main (void)
8361 {
8362 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8363   ;
8364   return 0;
8365 }
8366 _ACEOF
8367 rm -f conftest.$ac_objext conftest$ac_exeext
8368 if { (eval echo "$as_me:8368: \"$ac_link\"") >&5
8369   (eval $ac_link) 2>&5
8370   ac_status=$?
8371   echo "$as_me:8371: \$? = $ac_status" >&5
8372   (exit $ac_status); } &&
8373          { ac_try='test -s conftest$ac_exeext'
8374   { (eval echo "$as_me:8374: \"$ac_try\"") >&5
8375   (eval $ac_try) 2>&5
8376   ac_status=$?
8377   echo "$as_me:8377: \$? = $ac_status" >&5
8378   (exit $ac_status); }; }; then
8379   if test "$cross_compiling" = yes; then
8380   cf_have_ncuconfig=maybe
8381 else
8382   cat >conftest.$ac_ext <<_ACEOF
8383 #line 8383 "configure"
8384 #include "confdefs.h"
8385 #include <${cf_cv_ncurses_header:-curses.h}>
8386                                 int main(void)
8387                                 { char *xx = curses_version(); return (xx == 0); }
8388 _ACEOF
8389 rm -f conftest$ac_exeext
8390 if { (eval echo "$as_me:8390: \"$ac_link\"") >&5
8391   (eval $ac_link) 2>&5
8392   ac_status=$?
8393   echo "$as_me:8393: \$? = $ac_status" >&5
8394   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8395   { (eval echo "$as_me:8395: \"$ac_try\"") >&5
8396   (eval $ac_try) 2>&5
8397   ac_status=$?
8398   echo "$as_me:8398: \$? = $ac_status" >&5
8399   (exit $ac_status); }; }; then
8400   cf_have_ncuconfig=yes
8401 else
8402   echo "$as_me: program exited with status $ac_status" >&5
8403 echo "$as_me: failed program was:" >&5
8404 cat conftest.$ac_ext >&5
8405 cf_have_ncuconfig=no
8406 fi
8407 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8408 fi
8409 else
8410   echo "$as_me: failed program was:" >&5
8411 cat conftest.$ac_ext >&5
8412 cf_have_ncuconfig=no
8413 fi
8414 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8415                 echo "$as_me:8415: result: $cf_have_ncuconfig" >&5
8416 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8417                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8418                 if test "$cf_have_ncuconfig" != "yes"
8419                 then
8420                         CPPFLAGS="$cf_save_CPPFLAGS"
8421                         LIBS="$cf_save_LIBS"
8422                         NCURSES_CONFIG_PKG=none
8423                 else
8424
8425 cat >>confdefs.h <<\EOF
8426 #define NCURSES 1
8427 EOF
8428
8429                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8430                 fi
8431
8432 echo "$as_me:8432: checking for terminfo header" >&5
8433 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8434 if test "${cf_cv_term_header+set}" = set; then
8435   echo $ECHO_N "(cached) $ECHO_C" >&6
8436 else
8437
8438 case ${cf_cv_ncurses_header} in
8439 (*/ncurses.h|*/ncursesw.h)
8440         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8441         ;;
8442 (*)
8443         cf_term_header=term.h
8444         ;;
8445 esac
8446
8447 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8448 do
8449 cat >conftest.$ac_ext <<_ACEOF
8450 #line 8450 "configure"
8451 #include "confdefs.h"
8452 #include <stdio.h>
8453 #include <${cf_cv_ncurses_header:-curses.h}>
8454 #include <$cf_test>
8455
8456 int
8457 main (void)
8458 {
8459 int x = auto_left_margin
8460   ;
8461   return 0;
8462 }
8463 _ACEOF
8464 rm -f conftest.$ac_objext
8465 if { (eval echo "$as_me:8465: \"$ac_compile\"") >&5
8466   (eval $ac_compile) 2>&5
8467   ac_status=$?
8468   echo "$as_me:8468: \$? = $ac_status" >&5
8469   (exit $ac_status); } &&
8470          { ac_try='test -s conftest.$ac_objext'
8471   { (eval echo "$as_me:8471: \"$ac_try\"") >&5
8472   (eval $ac_try) 2>&5
8473   ac_status=$?
8474   echo "$as_me:8474: \$? = $ac_status" >&5
8475   (exit $ac_status); }; }; then
8476
8477         cf_cv_term_header="$cf_test"
8478 else
8479   echo "$as_me: failed program was:" >&5
8480 cat conftest.$ac_ext >&5
8481
8482         cf_cv_term_header=unknown
8483
8484 fi
8485 rm -f conftest.$ac_objext conftest.$ac_ext
8486         test "$cf_cv_term_header" != unknown && break
8487 done
8488
8489 fi
8490 echo "$as_me:8490: result: $cf_cv_term_header" >&5
8491 echo "${ECHO_T}$cf_cv_term_header" >&6
8492
8493 # Set definitions to allow ifdef'ing to accommodate subdirectories
8494
8495 case $cf_cv_term_header in
8496 (*term.h)
8497
8498 cat >>confdefs.h <<\EOF
8499 #define HAVE_TERM_H 1
8500 EOF
8501
8502         ;;
8503 esac
8504
8505 case $cf_cv_term_header in
8506 (ncurses/term.h)
8507
8508 cat >>confdefs.h <<\EOF
8509 #define HAVE_NCURSES_TERM_H 1
8510 EOF
8511
8512         ;;
8513 (ncursesw/term.h)
8514
8515 cat >>confdefs.h <<\EOF
8516 #define HAVE_NCURSESW_TERM_H 1
8517 EOF
8518
8519         ;;
8520 esac
8521
8522         else
8523                 echo "$as_me:8523: result: no" >&5
8524 echo "${ECHO_T}no" >&6
8525                 NCURSES_CONFIG_PKG=none
8526         fi
8527 else
8528         NCURSES_CONFIG_PKG=none
8529 fi
8530
8531 if test "x$cf_have_ncuconfig" = "xno"; then
8532         echo "Looking for ${cf_ncuconfig_root}-config"
8533
8534 if test -n "$ac_tool_prefix"; then
8535   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8536   do
8537     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8538 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8539 echo "$as_me:8539: checking for $ac_word" >&5
8540 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8541 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8542   echo $ECHO_N "(cached) $ECHO_C" >&6
8543 else
8544   if test -n "$NCURSES_CONFIG"; then
8545   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8546 else
8547   ac_save_IFS=$IFS; IFS=$ac_path_separator
8548 ac_dummy="$PATH"
8549 for ac_dir in $ac_dummy; do
8550   IFS=$ac_save_IFS
8551   test -z "$ac_dir" && ac_dir=.
8552   $as_executable_p "$ac_dir/$ac_word" || continue
8553 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8554 echo "$as_me:8554: found $ac_dir/$ac_word" >&5
8555 break
8556 done
8557
8558 fi
8559 fi
8560 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8561 if test -n "$NCURSES_CONFIG"; then
8562   echo "$as_me:8562: result: $NCURSES_CONFIG" >&5
8563 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8564 else
8565   echo "$as_me:8565: result: no" >&5
8566 echo "${ECHO_T}no" >&6
8567 fi
8568
8569     test -n "$NCURSES_CONFIG" && break
8570   done
8571 fi
8572 if test -z "$NCURSES_CONFIG"; then
8573   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8574   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8575 do
8576   # Extract the first word of "$ac_prog", so it can be a program name with args.
8577 set dummy $ac_prog; ac_word=$2
8578 echo "$as_me:8578: checking for $ac_word" >&5
8579 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8580 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8581   echo $ECHO_N "(cached) $ECHO_C" >&6
8582 else
8583   if test -n "$ac_ct_NCURSES_CONFIG"; then
8584   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8585 else
8586   ac_save_IFS=$IFS; IFS=$ac_path_separator
8587 ac_dummy="$PATH"
8588 for ac_dir in $ac_dummy; do
8589   IFS=$ac_save_IFS
8590   test -z "$ac_dir" && ac_dir=.
8591   $as_executable_p "$ac_dir/$ac_word" || continue
8592 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8593 echo "$as_me:8593: found $ac_dir/$ac_word" >&5
8594 break
8595 done
8596
8597 fi
8598 fi
8599 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8600 if test -n "$ac_ct_NCURSES_CONFIG"; then
8601   echo "$as_me:8601: result: $ac_ct_NCURSES_CONFIG" >&5
8602 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8603 else
8604   echo "$as_me:8604: result: no" >&5
8605 echo "${ECHO_T}no" >&6
8606 fi
8607
8608   test -n "$ac_ct_NCURSES_CONFIG" && break
8609 done
8610 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8611
8612   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8613 fi
8614
8615         if test "$NCURSES_CONFIG" != none ; then
8616
8617                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8618
8619 cf_add_libs="`$NCURSES_CONFIG --libs`"
8620 # Filter out duplicates - this happens with badly-designed ".pc" files...
8621 for cf_add_1lib in $LIBS
8622 do
8623         for cf_add_2lib in $cf_add_libs
8624         do
8625                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8626                 then
8627                         cf_add_1lib=
8628                         break
8629                 fi
8630         done
8631         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8632 done
8633 LIBS="$cf_add_libs"
8634
8635                 # even with config script, some packages use no-override for curses.h
8636
8637 echo "$as_me:8637: checking if we have identified curses headers" >&5
8638 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8639 if test "${cf_cv_ncurses_header+set}" = set; then
8640   echo $ECHO_N "(cached) $ECHO_C" >&6
8641 else
8642
8643 cf_cv_ncurses_header=none
8644 for cf_header in \
8645         ncurses.h $cf_cv_screen/ncurses.h \
8646         curses.h $cf_cv_screen/curses.h
8647 do
8648 cat >conftest.$ac_ext <<_ACEOF
8649 #line 8649 "configure"
8650 #include "confdefs.h"
8651 #include <${cf_header}>
8652 int
8653 main (void)
8654 {
8655 initscr(); tgoto("?", 0,0)
8656   ;
8657   return 0;
8658 }
8659 _ACEOF
8660 rm -f conftest.$ac_objext
8661 if { (eval echo "$as_me:8661: \"$ac_compile\"") >&5
8662   (eval $ac_compile) 2>&5
8663   ac_status=$?
8664   echo "$as_me:8664: \$? = $ac_status" >&5
8665   (exit $ac_status); } &&
8666          { ac_try='test -s conftest.$ac_objext'
8667   { (eval echo "$as_me:8667: \"$ac_try\"") >&5
8668   (eval $ac_try) 2>&5
8669   ac_status=$?
8670   echo "$as_me:8670: \$? = $ac_status" >&5
8671   (exit $ac_status); }; }; then
8672   cf_cv_ncurses_header=$cf_header; break
8673 else
8674   echo "$as_me: failed program was:" >&5
8675 cat conftest.$ac_ext >&5
8676 fi
8677 rm -f conftest.$ac_objext conftest.$ac_ext
8678 done
8679
8680 fi
8681 echo "$as_me:8681: result: $cf_cv_ncurses_header" >&5
8682 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8683
8684 if test "$cf_cv_ncurses_header" = none ; then
8685         { { echo "$as_me:8685: error: No curses header-files found" >&5
8686 echo "$as_me: error: No curses header-files found" >&2;}
8687    { (exit 1); exit 1; }; }
8688 fi
8689
8690 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8691
8692 for ac_header in $cf_cv_ncurses_header
8693 do
8694 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8695 echo "$as_me:8695: checking for $ac_header" >&5
8696 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8697 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8698   echo $ECHO_N "(cached) $ECHO_C" >&6
8699 else
8700   cat >conftest.$ac_ext <<_ACEOF
8701 #line 8701 "configure"
8702 #include "confdefs.h"
8703 #include <$ac_header>
8704 _ACEOF
8705 if { (eval echo "$as_me:8705: \"$ac_cpp conftest.$ac_ext\"") >&5
8706   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8707   ac_status=$?
8708   egrep -v '^ *\+' conftest.er1 >conftest.err
8709   rm -f conftest.er1
8710   cat conftest.err >&5
8711   echo "$as_me:8711: \$? = $ac_status" >&5
8712   (exit $ac_status); } >/dev/null; then
8713   if test -s conftest.err; then
8714     ac_cpp_err=$ac_c_preproc_warn_flag
8715   else
8716     ac_cpp_err=
8717   fi
8718 else
8719   ac_cpp_err=yes
8720 fi
8721 if test -z "$ac_cpp_err"; then
8722   eval "$as_ac_Header=yes"
8723 else
8724   echo "$as_me: failed program was:" >&5
8725   cat conftest.$ac_ext >&5
8726   eval "$as_ac_Header=no"
8727 fi
8728 rm -f conftest.err conftest.$ac_ext
8729 fi
8730 echo "$as_me:8730: result: `eval echo '${'$as_ac_Header'}'`" >&5
8731 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8732 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8733   cat >>confdefs.h <<EOF
8734 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8735 EOF
8736
8737 fi
8738 done
8739
8740 cat >>confdefs.h <<\EOF
8741 #define NCURSES 1
8742 EOF
8743
8744 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8745
8746                 cat >>confdefs.h <<EOF
8747 #define $cf_nculib_ROOT 1
8748 EOF
8749
8750                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8751
8752         else
8753
8754 cf_ncuhdr_root=$cf_cv_screen
8755
8756 test -n "$cf_cv_curses_dir" && \
8757 test "$cf_cv_curses_dir" != "no" && { \
8758
8759 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8760   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8761   do
8762         while test $cf_add_incdir != /usr/include
8763         do
8764           if test -d $cf_add_incdir
8765           then
8766                 cf_have_incdir=no
8767                 if test -n "$CFLAGS$CPPFLAGS" ; then
8768                   # a loop is needed to ensure we can add subdirs of existing dirs
8769                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8770                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8771                           cf_have_incdir=yes; break
8772                         fi
8773                   done
8774                 fi
8775
8776                 if test "$cf_have_incdir" = no ; then
8777                   if test "$cf_add_incdir" = /usr/local/include ; then
8778                         if test "$GCC" = yes
8779                         then
8780                           cf_save_CPPFLAGS=$CPPFLAGS
8781                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8782                           cat >conftest.$ac_ext <<_ACEOF
8783 #line 8783 "configure"
8784 #include "confdefs.h"
8785 #include <stdio.h>
8786 int
8787 main (void)
8788 {
8789 printf("Hello")
8790   ;
8791   return 0;
8792 }
8793 _ACEOF
8794 rm -f conftest.$ac_objext
8795 if { (eval echo "$as_me:8795: \"$ac_compile\"") >&5
8796   (eval $ac_compile) 2>&5
8797   ac_status=$?
8798   echo "$as_me:8798: \$? = $ac_status" >&5
8799   (exit $ac_status); } &&
8800          { ac_try='test -s conftest.$ac_objext'
8801   { (eval echo "$as_me:8801: \"$ac_try\"") >&5
8802   (eval $ac_try) 2>&5
8803   ac_status=$?
8804   echo "$as_me:8804: \$? = $ac_status" >&5
8805   (exit $ac_status); }; }; then
8806   :
8807 else
8808   echo "$as_me: failed program was:" >&5
8809 cat conftest.$ac_ext >&5
8810 cf_have_incdir=yes
8811 fi
8812 rm -f conftest.$ac_objext conftest.$ac_ext
8813                           CPPFLAGS=$cf_save_CPPFLAGS
8814                         fi
8815                   fi
8816                 fi
8817
8818                 if test "$cf_have_incdir" = no ; then
8819                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8820
8821 echo "${as_me:-configure}:8821: testing adding $cf_add_incdir to include-path ..." 1>&5
8822
8823                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8824
8825                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8826                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8827                   cf_add_incdir="$cf_top_incdir"
8828                 else
8829                   break
8830                 fi
8831           else
8832                 break
8833           fi
8834         done
8835   done
8836 fi
8837
8838 }
8839
8840 echo "$as_me:8840: checking for $cf_ncuhdr_root header in include-path" >&5
8841 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8842 if test "${cf_cv_ncurses_h+set}" = set; then
8843   echo $ECHO_N "(cached) $ECHO_C" >&6
8844 else
8845
8846         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8847         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8848         for cf_header in $cf_header_list
8849         do
8850
8851         cat >conftest.$ac_ext <<_ACEOF
8852 #line 8852 "configure"
8853 #include "confdefs.h"
8854
8855 #include <$cf_header>
8856 int
8857 main (void)
8858 {
8859
8860 #ifdef NCURSES_VERSION
8861
8862 printf("%s\n", NCURSES_VERSION);
8863 #else
8864 #ifdef __NCURSES_H
8865 printf("old\n");
8866 #else
8867         make an error
8868 #endif
8869 #endif
8870
8871   ;
8872   return 0;
8873 }
8874 _ACEOF
8875 rm -f conftest.$ac_objext
8876 if { (eval echo "$as_me:8876: \"$ac_compile\"") >&5
8877   (eval $ac_compile) 2>&5
8878   ac_status=$?
8879   echo "$as_me:8879: \$? = $ac_status" >&5
8880   (exit $ac_status); } &&
8881          { ac_try='test -s conftest.$ac_objext'
8882   { (eval echo "$as_me:8882: \"$ac_try\"") >&5
8883   (eval $ac_try) 2>&5
8884   ac_status=$?
8885   echo "$as_me:8885: \$? = $ac_status" >&5
8886   (exit $ac_status); }; }; then
8887   cf_cv_ncurses_h=$cf_header
8888
8889 else
8890   echo "$as_me: failed program was:" >&5
8891 cat conftest.$ac_ext >&5
8892 cf_cv_ncurses_h=no
8893 fi
8894 rm -f conftest.$ac_objext conftest.$ac_ext
8895
8896                 test "$cf_cv_ncurses_h" != no && break
8897         done
8898
8899 fi
8900 echo "$as_me:8900: result: $cf_cv_ncurses_h" >&5
8901 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8902
8903 if test "$cf_cv_ncurses_h" != no ; then
8904         cf_cv_ncurses_header=$cf_cv_ncurses_h
8905 else
8906
8907 echo "$as_me:8907: checking for $cf_ncuhdr_root include-path" >&5
8908 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8909 if test "${cf_cv_ncurses_h2+set}" = set; then
8910   echo $ECHO_N "(cached) $ECHO_C" >&6
8911 else
8912
8913         test -n "$verbose" && echo
8914
8915 cf_search=
8916
8917 # collect the current set of include-directories from compiler flags
8918 cf_header_path_list=""
8919 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8920         for cf_header_path in $CPPFLAGS $CFLAGS
8921         do
8922                 case $cf_header_path in
8923                 (-I*)
8924                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8925
8926 test "x$cf_header_path" != "xNONE" && \
8927 test -d "$cf_header_path" && \
8928  {
8929         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8930         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8931         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8932         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8933         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8934         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"
8935 }
8936
8937                         cf_header_path_list="$cf_header_path_list $cf_search"
8938                         ;;
8939                 esac
8940         done
8941 fi
8942
8943 # add the variations for the package we are looking for
8944
8945 cf_search=
8946
8947 test "x$prefix" != "xNONE" && \
8948 test -d "$prefix" && \
8949  {
8950         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8951         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8952         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8953         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8954         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8955         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8956 }
8957
8958 for cf_subdir_prefix in \
8959         /usr \
8960         /usr/local \
8961         /usr/pkg \
8962         /opt \
8963         /opt/local \
8964         $HOME
8965 do
8966
8967 test "x$cf_subdir_prefix" != "x$prefix" && \
8968 test -d "$cf_subdir_prefix" && \
8969 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8970         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8971         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8972         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8973         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8974         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8975         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"
8976 }
8977
8978 done
8979
8980 test "$includedir" != NONE && \
8981 test "$includedir" != "/usr/include" && \
8982 test -d "$includedir" && {
8983         test -d $includedir &&    cf_search="$cf_search $includedir"
8984         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8985 }
8986
8987 test "$oldincludedir" != NONE && \
8988 test "$oldincludedir" != "/usr/include" && \
8989 test -d "$oldincludedir" && {
8990         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8991         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8992 }
8993
8994 cf_search="$cf_search $cf_header_path_list"
8995
8996         test -n "$verbose" && echo search path $cf_search
8997         cf_save2_CPPFLAGS="$CPPFLAGS"
8998         for cf_incdir in $cf_search
8999         do
9000
9001 if test -n "$cf_incdir" ; then
9002   for cf_add_incdir in $cf_incdir
9003   do
9004         while test $cf_add_incdir != /usr/include
9005         do
9006           if test -d $cf_add_incdir
9007           then
9008                 cf_have_incdir=no
9009                 if test -n "$CFLAGS$CPPFLAGS" ; then
9010                   # a loop is needed to ensure we can add subdirs of existing dirs
9011                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9012                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9013                           cf_have_incdir=yes; break
9014                         fi
9015                   done
9016                 fi
9017
9018                 if test "$cf_have_incdir" = no ; then
9019                   if test "$cf_add_incdir" = /usr/local/include ; then
9020                         if test "$GCC" = yes
9021                         then
9022                           cf_save_CPPFLAGS=$CPPFLAGS
9023                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9024                           cat >conftest.$ac_ext <<_ACEOF
9025 #line 9025 "configure"
9026 #include "confdefs.h"
9027 #include <stdio.h>
9028 int
9029 main (void)
9030 {
9031 printf("Hello")
9032   ;
9033   return 0;
9034 }
9035 _ACEOF
9036 rm -f conftest.$ac_objext
9037 if { (eval echo "$as_me:9037: \"$ac_compile\"") >&5
9038   (eval $ac_compile) 2>&5
9039   ac_status=$?
9040   echo "$as_me:9040: \$? = $ac_status" >&5
9041   (exit $ac_status); } &&
9042          { ac_try='test -s conftest.$ac_objext'
9043   { (eval echo "$as_me:9043: \"$ac_try\"") >&5
9044   (eval $ac_try) 2>&5
9045   ac_status=$?
9046   echo "$as_me:9046: \$? = $ac_status" >&5
9047   (exit $ac_status); }; }; then
9048   :
9049 else
9050   echo "$as_me: failed program was:" >&5
9051 cat conftest.$ac_ext >&5
9052 cf_have_incdir=yes
9053 fi
9054 rm -f conftest.$ac_objext conftest.$ac_ext
9055                           CPPFLAGS=$cf_save_CPPFLAGS
9056                         fi
9057                   fi
9058                 fi
9059
9060                 if test "$cf_have_incdir" = no ; then
9061                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9062
9063 echo "${as_me:-configure}:9063: testing adding $cf_add_incdir to include-path ..." 1>&5
9064
9065                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9066
9067                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9068                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9069                   cf_add_incdir="$cf_top_incdir"
9070                 else
9071                   break
9072                 fi
9073           else
9074                 break
9075           fi
9076         done
9077   done
9078 fi
9079
9080                 for cf_header in \
9081                         ncurses.h \
9082                         curses.h
9083                 do
9084
9085         cat >conftest.$ac_ext <<_ACEOF
9086 #line 9086 "configure"
9087 #include "confdefs.h"
9088
9089 #include <$cf_header>
9090 int
9091 main (void)
9092 {
9093
9094 #ifdef NCURSES_VERSION
9095
9096 printf("%s\n", NCURSES_VERSION);
9097 #else
9098 #ifdef __NCURSES_H
9099 printf("old\n");
9100 #else
9101         make an error
9102 #endif
9103 #endif
9104
9105   ;
9106   return 0;
9107 }
9108 _ACEOF
9109 rm -f conftest.$ac_objext
9110 if { (eval echo "$as_me:9110: \"$ac_compile\"") >&5
9111   (eval $ac_compile) 2>&5
9112   ac_status=$?
9113   echo "$as_me:9113: \$? = $ac_status" >&5
9114   (exit $ac_status); } &&
9115          { ac_try='test -s conftest.$ac_objext'
9116   { (eval echo "$as_me:9116: \"$ac_try\"") >&5
9117   (eval $ac_try) 2>&5
9118   ac_status=$?
9119   echo "$as_me:9119: \$? = $ac_status" >&5
9120   (exit $ac_status); }; }; then
9121   cf_cv_ncurses_h2=$cf_header
9122
9123 else
9124   echo "$as_me: failed program was:" >&5
9125 cat conftest.$ac_ext >&5
9126 cf_cv_ncurses_h2=no
9127 fi
9128 rm -f conftest.$ac_objext conftest.$ac_ext
9129
9130                         if test "$cf_cv_ncurses_h2" != no ; then
9131                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9132                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9133                                 break
9134                         fi
9135                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9136                 done
9137                 CPPFLAGS="$cf_save2_CPPFLAGS"
9138                 test "$cf_cv_ncurses_h2" != no && break
9139         done
9140         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9140: error: not found" >&5
9141 echo "$as_me: error: not found" >&2;}
9142    { (exit 1); exit 1; }; }
9143
9144 fi
9145 echo "$as_me:9145: result: $cf_cv_ncurses_h2" >&5
9146 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9147
9148         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9149         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9150         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9151                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9152         fi
9153
9154 if test -n "$cf_1st_incdir" ; then
9155   for cf_add_incdir in $cf_1st_incdir
9156   do
9157         while test $cf_add_incdir != /usr/include
9158         do
9159           if test -d $cf_add_incdir
9160           then
9161                 cf_have_incdir=no
9162                 if test -n "$CFLAGS$CPPFLAGS" ; then
9163                   # a loop is needed to ensure we can add subdirs of existing dirs
9164                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9165                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9166                           cf_have_incdir=yes; break
9167                         fi
9168                   done
9169                 fi
9170
9171                 if test "$cf_have_incdir" = no ; then
9172                   if test "$cf_add_incdir" = /usr/local/include ; then
9173                         if test "$GCC" = yes
9174                         then
9175                           cf_save_CPPFLAGS=$CPPFLAGS
9176                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9177                           cat >conftest.$ac_ext <<_ACEOF
9178 #line 9178 "configure"
9179 #include "confdefs.h"
9180 #include <stdio.h>
9181 int
9182 main (void)
9183 {
9184 printf("Hello")
9185   ;
9186   return 0;
9187 }
9188 _ACEOF
9189 rm -f conftest.$ac_objext
9190 if { (eval echo "$as_me:9190: \"$ac_compile\"") >&5
9191   (eval $ac_compile) 2>&5
9192   ac_status=$?
9193   echo "$as_me:9193: \$? = $ac_status" >&5
9194   (exit $ac_status); } &&
9195          { ac_try='test -s conftest.$ac_objext'
9196   { (eval echo "$as_me:9196: \"$ac_try\"") >&5
9197   (eval $ac_try) 2>&5
9198   ac_status=$?
9199   echo "$as_me:9199: \$? = $ac_status" >&5
9200   (exit $ac_status); }; }; then
9201   :
9202 else
9203   echo "$as_me: failed program was:" >&5
9204 cat conftest.$ac_ext >&5
9205 cf_have_incdir=yes
9206 fi
9207 rm -f conftest.$ac_objext conftest.$ac_ext
9208                           CPPFLAGS=$cf_save_CPPFLAGS
9209                         fi
9210                   fi
9211                 fi
9212
9213                 if test "$cf_have_incdir" = no ; then
9214                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9215
9216 echo "${as_me:-configure}:9216: testing adding $cf_add_incdir to include-path ..." 1>&5
9217
9218                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9219
9220                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9221                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9222                   cf_add_incdir="$cf_top_incdir"
9223                 else
9224                   break
9225                 fi
9226           else
9227                 break
9228           fi
9229         done
9230   done
9231 fi
9232
9233 fi
9234
9235 # Set definitions to allow ifdef'ing for ncurses.h
9236
9237 case $cf_cv_ncurses_header in
9238 (*ncurses.h)
9239
9240 cat >>confdefs.h <<\EOF
9241 #define HAVE_NCURSES_H 1
9242 EOF
9243
9244         ;;
9245 esac
9246
9247 case $cf_cv_ncurses_header in
9248 (ncurses/curses.h|ncurses/ncurses.h)
9249
9250 cat >>confdefs.h <<\EOF
9251 #define HAVE_NCURSES_NCURSES_H 1
9252 EOF
9253
9254         ;;
9255 (ncursesw/curses.h|ncursesw/ncurses.h)
9256
9257 cat >>confdefs.h <<\EOF
9258 #define HAVE_NCURSESW_NCURSES_H 1
9259 EOF
9260
9261         ;;
9262 esac
9263
9264 echo "$as_me:9264: checking for terminfo header" >&5
9265 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9266 if test "${cf_cv_term_header+set}" = set; then
9267   echo $ECHO_N "(cached) $ECHO_C" >&6
9268 else
9269
9270 case ${cf_cv_ncurses_header} in
9271 (*/ncurses.h|*/ncursesw.h)
9272         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9273         ;;
9274 (*)
9275         cf_term_header=term.h
9276         ;;
9277 esac
9278
9279 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9280 do
9281 cat >conftest.$ac_ext <<_ACEOF
9282 #line 9282 "configure"
9283 #include "confdefs.h"
9284 #include <stdio.h>
9285 #include <${cf_cv_ncurses_header:-curses.h}>
9286 #include <$cf_test>
9287
9288 int
9289 main (void)
9290 {
9291 int x = auto_left_margin
9292   ;
9293   return 0;
9294 }
9295 _ACEOF
9296 rm -f conftest.$ac_objext
9297 if { (eval echo "$as_me:9297: \"$ac_compile\"") >&5
9298   (eval $ac_compile) 2>&5
9299   ac_status=$?
9300   echo "$as_me:9300: \$? = $ac_status" >&5
9301   (exit $ac_status); } &&
9302          { ac_try='test -s conftest.$ac_objext'
9303   { (eval echo "$as_me:9303: \"$ac_try\"") >&5
9304   (eval $ac_try) 2>&5
9305   ac_status=$?
9306   echo "$as_me:9306: \$? = $ac_status" >&5
9307   (exit $ac_status); }; }; then
9308
9309         cf_cv_term_header="$cf_test"
9310 else
9311   echo "$as_me: failed program was:" >&5
9312 cat conftest.$ac_ext >&5
9313
9314         cf_cv_term_header=unknown
9315
9316 fi
9317 rm -f conftest.$ac_objext conftest.$ac_ext
9318         test "$cf_cv_term_header" != unknown && break
9319 done
9320
9321 fi
9322 echo "$as_me:9322: result: $cf_cv_term_header" >&5
9323 echo "${ECHO_T}$cf_cv_term_header" >&6
9324
9325 # Set definitions to allow ifdef'ing to accommodate subdirectories
9326
9327 case $cf_cv_term_header in
9328 (*term.h)
9329
9330 cat >>confdefs.h <<\EOF
9331 #define HAVE_TERM_H 1
9332 EOF
9333
9334         ;;
9335 esac
9336
9337 case $cf_cv_term_header in
9338 (ncurses/term.h)
9339
9340 cat >>confdefs.h <<\EOF
9341 #define HAVE_NCURSES_TERM_H 1
9342 EOF
9343
9344         ;;
9345 (ncursesw/term.h)
9346
9347 cat >>confdefs.h <<\EOF
9348 #define HAVE_NCURSESW_TERM_H 1
9349 EOF
9350
9351         ;;
9352 esac
9353
9354 # some applications need this, but should check for NCURSES_VERSION
9355
9356 cat >>confdefs.h <<\EOF
9357 #define NCURSES 1
9358 EOF
9359
9360 echo "$as_me:9360: checking for ncurses version" >&5
9361 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9362 if test "${cf_cv_ncurses_version+set}" = set; then
9363   echo $ECHO_N "(cached) $ECHO_C" >&6
9364 else
9365
9366         cf_cv_ncurses_version=no
9367         cf_tempfile=out$$
9368         rm -f $cf_tempfile
9369         if test "$cross_compiling" = yes; then
9370
9371         # This will not work if the preprocessor splits the line after the
9372         # Autoconf token.  The 'unproto' program does that.
9373         cat > conftest.$ac_ext <<EOF
9374 #include <${cf_cv_ncurses_header:-curses.h}>
9375 #undef Autoconf
9376 #ifdef NCURSES_VERSION
9377 Autoconf NCURSES_VERSION
9378 #else
9379 #ifdef __NCURSES_H
9380 Autoconf "old"
9381 #endif
9382 ;
9383 #endif
9384 EOF
9385         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9386         { (eval echo "$as_me:9386: \"$cf_try\"") >&5
9387   (eval $cf_try) 2>&5
9388   ac_status=$?
9389   echo "$as_me:9389: \$? = $ac_status" >&5
9390   (exit $ac_status); }
9391         if test -f conftest.out ; then
9392                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9393                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9394                 rm -f conftest.out
9395         fi
9396
9397 else
9398   cat >conftest.$ac_ext <<_ACEOF
9399 #line 9399 "configure"
9400 #include "confdefs.h"
9401
9402 #include <${cf_cv_ncurses_header:-curses.h}>
9403 #include <stdio.h>
9404 int main(void)
9405 {
9406         FILE *fp = fopen("$cf_tempfile", "w");
9407 #ifdef NCURSES_VERSION
9408 # ifdef NCURSES_VERSION_PATCH
9409         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9410 # else
9411         fprintf(fp, "%s\n", NCURSES_VERSION);
9412 # endif
9413 #else
9414 # ifdef __NCURSES_H
9415         fprintf(fp, "old\n");
9416 # else
9417         make an error
9418 # endif
9419 #endif
9420         ${cf_cv_main_return:-return}(0);
9421 }
9422 _ACEOF
9423 rm -f conftest$ac_exeext
9424 if { (eval echo "$as_me:9424: \"$ac_link\"") >&5
9425   (eval $ac_link) 2>&5
9426   ac_status=$?
9427   echo "$as_me:9427: \$? = $ac_status" >&5
9428   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9429   { (eval echo "$as_me:9429: \"$ac_try\"") >&5
9430   (eval $ac_try) 2>&5
9431   ac_status=$?
9432   echo "$as_me:9432: \$? = $ac_status" >&5
9433   (exit $ac_status); }; }; then
9434
9435         cf_cv_ncurses_version=`cat $cf_tempfile`
9436 else
9437   echo "$as_me: program exited with status $ac_status" >&5
9438 echo "$as_me: failed program was:" >&5
9439 cat conftest.$ac_ext >&5
9440 fi
9441 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9442 fi
9443         rm -f $cf_tempfile
9444
9445 fi
9446 echo "$as_me:9446: result: $cf_cv_ncurses_version" >&5
9447 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9448 test "$cf_cv_ncurses_version" = no ||
9449 cat >>confdefs.h <<\EOF
9450 #define NCURSES 1
9451 EOF
9452
9453 cf_nculib_root=$cf_cv_screen
9454         # This works, except for the special case where we find gpm, but
9455         # ncurses is in a nonstandard location via $LIBS, and we really want
9456         # to link gpm.
9457 cf_ncurses_LIBS=""
9458 cf_ncurses_SAVE="$LIBS"
9459 echo "$as_me:9459: checking for Gpm_Open in -lgpm" >&5
9460 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9461 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9462   echo $ECHO_N "(cached) $ECHO_C" >&6
9463 else
9464   ac_check_lib_save_LIBS=$LIBS
9465 LIBS="-lgpm  $LIBS"
9466 cat >conftest.$ac_ext <<_ACEOF
9467 #line 9467 "configure"
9468 #include "confdefs.h"
9469
9470 /* Override any gcc2 internal prototype to avoid an error.  */
9471 #ifdef __cplusplus
9472 extern "C"
9473 #endif
9474 /* We use char because int might match the return type of a gcc2
9475    builtin and then its argument prototype would still apply.  */
9476 char Gpm_Open ();
9477 int
9478 main (void)
9479 {
9480 Gpm_Open ();
9481   ;
9482   return 0;
9483 }
9484 _ACEOF
9485 rm -f conftest.$ac_objext conftest$ac_exeext
9486 if { (eval echo "$as_me:9486: \"$ac_link\"") >&5
9487   (eval $ac_link) 2>&5
9488   ac_status=$?
9489   echo "$as_me:9489: \$? = $ac_status" >&5
9490   (exit $ac_status); } &&
9491          { ac_try='test -s conftest$ac_exeext'
9492   { (eval echo "$as_me:9492: \"$ac_try\"") >&5
9493   (eval $ac_try) 2>&5
9494   ac_status=$?
9495   echo "$as_me:9495: \$? = $ac_status" >&5
9496   (exit $ac_status); }; }; then
9497   ac_cv_lib_gpm_Gpm_Open=yes
9498 else
9499   echo "$as_me: failed program was:" >&5
9500 cat conftest.$ac_ext >&5
9501 ac_cv_lib_gpm_Gpm_Open=no
9502 fi
9503 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9504 LIBS=$ac_check_lib_save_LIBS
9505 fi
9506 echo "$as_me:9506: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9507 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9508 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9509   echo "$as_me:9509: checking for initscr in -lgpm" >&5
9510 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9511 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9512   echo $ECHO_N "(cached) $ECHO_C" >&6
9513 else
9514   ac_check_lib_save_LIBS=$LIBS
9515 LIBS="-lgpm  $LIBS"
9516 cat >conftest.$ac_ext <<_ACEOF
9517 #line 9517 "configure"
9518 #include "confdefs.h"
9519
9520 /* Override any gcc2 internal prototype to avoid an error.  */
9521 #ifdef __cplusplus
9522 extern "C"
9523 #endif
9524 /* We use char because int might match the return type of a gcc2
9525    builtin and then its argument prototype would still apply.  */
9526 char initscr ();
9527 int
9528 main (void)
9529 {
9530 initscr ();
9531   ;
9532   return 0;
9533 }
9534 _ACEOF
9535 rm -f conftest.$ac_objext conftest$ac_exeext
9536 if { (eval echo "$as_me:9536: \"$ac_link\"") >&5
9537   (eval $ac_link) 2>&5
9538   ac_status=$?
9539   echo "$as_me:9539: \$? = $ac_status" >&5
9540   (exit $ac_status); } &&
9541          { ac_try='test -s conftest$ac_exeext'
9542   { (eval echo "$as_me:9542: \"$ac_try\"") >&5
9543   (eval $ac_try) 2>&5
9544   ac_status=$?
9545   echo "$as_me:9545: \$? = $ac_status" >&5
9546   (exit $ac_status); }; }; then
9547   ac_cv_lib_gpm_initscr=yes
9548 else
9549   echo "$as_me: failed program was:" >&5
9550 cat conftest.$ac_ext >&5
9551 ac_cv_lib_gpm_initscr=no
9552 fi
9553 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9554 LIBS=$ac_check_lib_save_LIBS
9555 fi
9556 echo "$as_me:9556: result: $ac_cv_lib_gpm_initscr" >&5
9557 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9558 if test $ac_cv_lib_gpm_initscr = yes; then
9559   LIBS="$cf_ncurses_SAVE"
9560 else
9561   cf_ncurses_LIBS="-lgpm"
9562 fi
9563
9564 fi
9565
9566 case $host_os in
9567 (freebsd*)
9568         # This is only necessary if you are linking against an obsolete
9569         # version of ncurses (but it should do no harm, since it's static).
9570         if test "$cf_nculib_root" = ncurses ; then
9571                 echo "$as_me:9571: checking for tgoto in -lmytinfo" >&5
9572 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9573 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9574   echo $ECHO_N "(cached) $ECHO_C" >&6
9575 else
9576   ac_check_lib_save_LIBS=$LIBS
9577 LIBS="-lmytinfo  $LIBS"
9578 cat >conftest.$ac_ext <<_ACEOF
9579 #line 9579 "configure"
9580 #include "confdefs.h"
9581
9582 /* Override any gcc2 internal prototype to avoid an error.  */
9583 #ifdef __cplusplus
9584 extern "C"
9585 #endif
9586 /* We use char because int might match the return type of a gcc2
9587    builtin and then its argument prototype would still apply.  */
9588 char tgoto ();
9589 int
9590 main (void)
9591 {
9592 tgoto ();
9593   ;
9594   return 0;
9595 }
9596 _ACEOF
9597 rm -f conftest.$ac_objext conftest$ac_exeext
9598 if { (eval echo "$as_me:9598: \"$ac_link\"") >&5
9599   (eval $ac_link) 2>&5
9600   ac_status=$?
9601   echo "$as_me:9601: \$? = $ac_status" >&5
9602   (exit $ac_status); } &&
9603          { ac_try='test -s conftest$ac_exeext'
9604   { (eval echo "$as_me:9604: \"$ac_try\"") >&5
9605   (eval $ac_try) 2>&5
9606   ac_status=$?
9607   echo "$as_me:9607: \$? = $ac_status" >&5
9608   (exit $ac_status); }; }; then
9609   ac_cv_lib_mytinfo_tgoto=yes
9610 else
9611   echo "$as_me: failed program was:" >&5
9612 cat conftest.$ac_ext >&5
9613 ac_cv_lib_mytinfo_tgoto=no
9614 fi
9615 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9616 LIBS=$ac_check_lib_save_LIBS
9617 fi
9618 echo "$as_me:9618: result: $ac_cv_lib_mytinfo_tgoto" >&5
9619 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9620 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9621   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9622 fi
9623
9624         fi
9625         ;;
9626 esac
9627
9628 cf_add_libs="$cf_ncurses_LIBS"
9629 # Filter out duplicates - this happens with badly-designed ".pc" files...
9630 for cf_add_1lib in $LIBS
9631 do
9632         for cf_add_2lib in $cf_add_libs
9633         do
9634                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9635                 then
9636                         cf_add_1lib=
9637                         break
9638                 fi
9639         done
9640         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9641 done
9642 LIBS="$cf_add_libs"
9643
9644 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9645 then
9646
9647 cf_add_libs="-l$cf_nculib_root"
9648 # Filter out duplicates - this happens with badly-designed ".pc" files...
9649 for cf_add_1lib in $LIBS
9650 do
9651         for cf_add_2lib in $cf_add_libs
9652         do
9653                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9654                 then
9655                         cf_add_1lib=
9656                         break
9657                 fi
9658         done
9659         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9660 done
9661 LIBS="$cf_add_libs"
9662
9663 else
9664
9665         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9666         cf_libdir=""
9667         echo "$as_me:9667: checking for initscr" >&5
9668 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9669 if test "${ac_cv_func_initscr+set}" = set; then
9670   echo $ECHO_N "(cached) $ECHO_C" >&6
9671 else
9672   cat >conftest.$ac_ext <<_ACEOF
9673 #line 9673 "configure"
9674 #include "confdefs.h"
9675 /* System header to define __stub macros and hopefully few prototypes,
9676     which can conflict with char initscr (); below.  */
9677 #include <assert.h>
9678 /* Override any gcc2 internal prototype to avoid an error.  */
9679 #ifdef __cplusplus
9680 extern "C"
9681 #endif
9682 /* We use char because int might match the return type of a gcc2
9683    builtin and then its argument prototype would still apply.  */
9684 char initscr ();
9685 char (*f) ();
9686
9687 int
9688 main (void)
9689 {
9690 /* The GNU C library defines this for functions which it implements
9691     to always fail with ENOSYS.  Some functions are actually named
9692     something starting with __ and the normal name is an alias.  */
9693 #if defined (__stub_initscr) || defined (__stub___initscr)
9694 choke me
9695 #else
9696 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9697 #endif
9698
9699   ;
9700   return 0;
9701 }
9702 _ACEOF
9703 rm -f conftest.$ac_objext conftest$ac_exeext
9704 if { (eval echo "$as_me:9704: \"$ac_link\"") >&5
9705   (eval $ac_link) 2>&5
9706   ac_status=$?
9707   echo "$as_me:9707: \$? = $ac_status" >&5
9708   (exit $ac_status); } &&
9709          { ac_try='test -s conftest$ac_exeext'
9710   { (eval echo "$as_me:9710: \"$ac_try\"") >&5
9711   (eval $ac_try) 2>&5
9712   ac_status=$?
9713   echo "$as_me:9713: \$? = $ac_status" >&5
9714   (exit $ac_status); }; }; then
9715   ac_cv_func_initscr=yes
9716 else
9717   echo "$as_me: failed program was:" >&5
9718 cat conftest.$ac_ext >&5
9719 ac_cv_func_initscr=no
9720 fi
9721 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9722 fi
9723 echo "$as_me:9723: result: $ac_cv_func_initscr" >&5
9724 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9725 if test $ac_cv_func_initscr = yes; then
9726   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9727 else
9728
9729                 cf_save_LIBS="$LIBS"
9730                 echo "$as_me:9730: checking for initscr in -l$cf_nculib_root" >&5
9731 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9732                 LIBS="-l$cf_nculib_root $LIBS"
9733                 cat >conftest.$ac_ext <<_ACEOF
9734 #line 9734 "configure"
9735 #include "confdefs.h"
9736 #include <${cf_cv_ncurses_header:-curses.h}>
9737 int
9738 main (void)
9739 {
9740 initscr()
9741   ;
9742   return 0;
9743 }
9744 _ACEOF
9745 rm -f conftest.$ac_objext conftest$ac_exeext
9746 if { (eval echo "$as_me:9746: \"$ac_link\"") >&5
9747   (eval $ac_link) 2>&5
9748   ac_status=$?
9749   echo "$as_me:9749: \$? = $ac_status" >&5
9750   (exit $ac_status); } &&
9751          { ac_try='test -s conftest$ac_exeext'
9752   { (eval echo "$as_me:9752: \"$ac_try\"") >&5
9753   (eval $ac_try) 2>&5
9754   ac_status=$?
9755   echo "$as_me:9755: \$? = $ac_status" >&5
9756   (exit $ac_status); }; }; then
9757   echo "$as_me:9757: result: yes" >&5
9758 echo "${ECHO_T}yes" >&6
9759                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9760
9761 else
9762   echo "$as_me: failed program was:" >&5
9763 cat conftest.$ac_ext >&5
9764 echo "$as_me:9764: result: no" >&5
9765 echo "${ECHO_T}no" >&6
9766
9767 cf_search=
9768 cf_library_path_list=""
9769 if test -n "${LDFLAGS}${LIBS}" ; then
9770         for cf_library_path in $LDFLAGS $LIBS
9771         do
9772                 case $cf_library_path in
9773                 (-L*)
9774                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9775
9776 test "x$cf_library_path" != "xNONE" && \
9777 test -d "$cf_library_path" && \
9778  {
9779         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9780         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9781         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9782         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9783         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9784         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"
9785 }
9786
9787                         cf_library_path_list="$cf_library_path_list $cf_search"
9788                         ;;
9789                 esac
9790         done
9791 fi
9792
9793 cf_search=
9794
9795 test "x$prefix" != "xNONE" && \
9796 test -d "$prefix" && \
9797  {
9798         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9799         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9800         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9801         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9802         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9803         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9804 }
9805
9806 for cf_subdir_prefix in \
9807         /usr \
9808         /usr/local \
9809         /usr/pkg \
9810         /opt \
9811         /opt/local \
9812         $HOME
9813 do
9814
9815 test "x$cf_subdir_prefix" != "x$prefix" && \
9816 test -d "$cf_subdir_prefix" && \
9817 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9818         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9819         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9820         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9821         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9822         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9823         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"
9824 }
9825
9826 done
9827
9828 cf_search="$cf_library_path_list $cf_search"
9829
9830                         for cf_libdir in $cf_search
9831                         do
9832                                 echo "$as_me:9832: checking for -l$cf_nculib_root in $cf_libdir" >&5
9833 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9834                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9835                                 cat >conftest.$ac_ext <<_ACEOF
9836 #line 9836 "configure"
9837 #include "confdefs.h"
9838 #include <${cf_cv_ncurses_header:-curses.h}>
9839 int
9840 main (void)
9841 {
9842 initscr()
9843   ;
9844   return 0;
9845 }
9846 _ACEOF
9847 rm -f conftest.$ac_objext conftest$ac_exeext
9848 if { (eval echo "$as_me:9848: \"$ac_link\"") >&5
9849   (eval $ac_link) 2>&5
9850   ac_status=$?
9851   echo "$as_me:9851: \$? = $ac_status" >&5
9852   (exit $ac_status); } &&
9853          { ac_try='test -s conftest$ac_exeext'
9854   { (eval echo "$as_me:9854: \"$ac_try\"") >&5
9855   (eval $ac_try) 2>&5
9856   ac_status=$?
9857   echo "$as_me:9857: \$? = $ac_status" >&5
9858   (exit $ac_status); }; }; then
9859   echo "$as_me:9859: result: yes" >&5
9860 echo "${ECHO_T}yes" >&6
9861                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9862                                          break
9863 else
9864   echo "$as_me: failed program was:" >&5
9865 cat conftest.$ac_ext >&5
9866 echo "$as_me:9866: result: no" >&5
9867 echo "${ECHO_T}no" >&6
9868                                          LIBS="$cf_save_LIBS"
9869 fi
9870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9871                         done
9872
9873 fi
9874 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9875
9876 fi
9877
9878 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9879
9880 if test $cf_found_library = no ; then
9881         { { echo "$as_me:9881: error: Cannot link $cf_nculib_root library" >&5
9882 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9883    { (exit 1); exit 1; }; }
9884 fi
9885
9886 fi
9887
9888 if test -n "$cf_ncurses_LIBS" ; then
9889         echo "$as_me:9889: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9890 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9891         cf_ncurses_SAVE="$LIBS"
9892         for p in $cf_ncurses_LIBS ; do
9893                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9894                 if test "$q" != "$LIBS" ; then
9895                         LIBS="$q"
9896                 fi
9897         done
9898         cat >conftest.$ac_ext <<_ACEOF
9899 #line 9899 "configure"
9900 #include "confdefs.h"
9901 #include <${cf_cv_ncurses_header:-curses.h}>
9902 int
9903 main (void)
9904 {
9905 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9906   ;
9907   return 0;
9908 }
9909 _ACEOF
9910 rm -f conftest.$ac_objext conftest$ac_exeext
9911 if { (eval echo "$as_me:9911: \"$ac_link\"") >&5
9912   (eval $ac_link) 2>&5
9913   ac_status=$?
9914   echo "$as_me:9914: \$? = $ac_status" >&5
9915   (exit $ac_status); } &&
9916          { ac_try='test -s conftest$ac_exeext'
9917   { (eval echo "$as_me:9917: \"$ac_try\"") >&5
9918   (eval $ac_try) 2>&5
9919   ac_status=$?
9920   echo "$as_me:9920: \$? = $ac_status" >&5
9921   (exit $ac_status); }; }; then
9922   echo "$as_me:9922: result: yes" >&5
9923 echo "${ECHO_T}yes" >&6
9924 else
9925   echo "$as_me: failed program was:" >&5
9926 cat conftest.$ac_ext >&5
9927 echo "$as_me:9927: result: no" >&5
9928 echo "${ECHO_T}no" >&6
9929                  LIBS="$cf_ncurses_SAVE"
9930 fi
9931 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9932 fi
9933
9934 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9935
9936 cat >>confdefs.h <<EOF
9937 #define $cf_nculib_ROOT 1
9938 EOF
9939
9940         fi
9941 else
9942         NCURSES_CONFIG=none
9943 fi
9944
9945         ;;
9946 (pdcurses)
9947         echo "$as_me:9947: checking for X" >&5
9948 echo $ECHO_N "checking for X... $ECHO_C" >&6
9949
9950 # Check whether --with-x or --without-x was given.
9951 if test "${with_x+set}" = set; then
9952   withval="$with_x"
9953
9954 fi;
9955 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9956 if test "x$with_x" = xno; then
9957   # The user explicitly disabled X.
9958   have_x=disabled
9959 else
9960   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9961     # Both variables are already set.
9962     have_x=yes
9963   else
9964     if test "${ac_cv_have_x+set}" = set; then
9965   echo $ECHO_N "(cached) $ECHO_C" >&6
9966 else
9967   # One or both of the vars are not set, and there is no cached value.
9968 ac_x_includes=no ac_x_libraries=no
9969 rm -fr conftest.dir
9970 if mkdir conftest.dir; then
9971   cd conftest.dir
9972   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9973   cat >Imakefile <<'EOF'
9974 acfindx:
9975         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9976 EOF
9977   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9978     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9979     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9980     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9981     for ac_extension in a so sl dylib dll; do
9982       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9983          test -f $ac_im_libdir/libX11.$ac_extension; then
9984         ac_im_usrlibdir=$ac_im_libdir; break
9985       fi
9986     done
9987     # Screen out bogus values from the imake configuration.  They are
9988     # bogus both because they are the default anyway, and because
9989     # using them would break gcc on systems where it needs fixed includes.
9990     case $ac_im_incroot in
9991         /usr/include) ;;
9992         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9993     esac
9994     case $ac_im_usrlibdir in
9995         /usr/lib | /lib) ;;
9996         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9997     esac
9998   fi
9999   cd ..
10000   rm -fr conftest.dir
10001 fi
10002
10003 # Standard set of common directories for X headers.
10004 # Check X11 before X11Rn because it is often a symlink to the current release.
10005 ac_x_header_dirs='
10006 /usr/X11/include
10007 /usr/X11R6/include
10008 /usr/X11R5/include
10009 /usr/X11R4/include
10010
10011 /usr/include/X11
10012 /usr/include/X11R6
10013 /usr/include/X11R5
10014 /usr/include/X11R4
10015
10016 /usr/local/X11/include
10017 /usr/local/X11R6/include
10018 /usr/local/X11R5/include
10019 /usr/local/X11R4/include
10020
10021 /usr/local/include/X11
10022 /usr/local/include/X11R6
10023 /usr/local/include/X11R5
10024 /usr/local/include/X11R4
10025
10026 /usr/X386/include
10027 /usr/x386/include
10028 /usr/XFree86/include/X11
10029
10030 /usr/include
10031 /usr/local/include
10032 /usr/unsupported/include
10033 /usr/athena/include
10034 /usr/local/x11r5/include
10035 /usr/lpp/Xamples/include
10036
10037 /usr/openwin/include
10038 /usr/openwin/share/include'
10039
10040 if test "$ac_x_includes" = no; then
10041   # Guess where to find include files, by looking for Intrinsic.h.
10042   # First, try using that file with no special directory specified.
10043   cat >conftest.$ac_ext <<_ACEOF
10044 #line 10044 "configure"
10045 #include "confdefs.h"
10046 #include <X11/Intrinsic.h>
10047 _ACEOF
10048 if { (eval echo "$as_me:10048: \"$ac_cpp conftest.$ac_ext\"") >&5
10049   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10050   ac_status=$?
10051   egrep -v '^ *\+' conftest.er1 >conftest.err
10052   rm -f conftest.er1
10053   cat conftest.err >&5
10054   echo "$as_me:10054: \$? = $ac_status" >&5
10055   (exit $ac_status); } >/dev/null; then
10056   if test -s conftest.err; then
10057     ac_cpp_err=$ac_c_preproc_warn_flag
10058   else
10059     ac_cpp_err=
10060   fi
10061 else
10062   ac_cpp_err=yes
10063 fi
10064 if test -z "$ac_cpp_err"; then
10065   # We can compile using X headers with no special include directory.
10066 ac_x_includes=
10067 else
10068   echo "$as_me: failed program was:" >&5
10069   cat conftest.$ac_ext >&5
10070   for ac_dir in $ac_x_header_dirs; do
10071   if test -r "$ac_dir/X11/Intrinsic.h"; then
10072     ac_x_includes=$ac_dir
10073     break
10074   fi
10075 done
10076 fi
10077 rm -f conftest.err conftest.$ac_ext
10078 fi # $ac_x_includes = no
10079
10080 if test "$ac_x_libraries" = no; then
10081   # Check for the libraries.
10082   # See if we find them without any special options.
10083   # Don't add to $LIBS permanently.
10084   ac_save_LIBS=$LIBS
10085   LIBS="-lXt $LIBS"
10086   cat >conftest.$ac_ext <<_ACEOF
10087 #line 10087 "configure"
10088 #include "confdefs.h"
10089 #include <X11/Intrinsic.h>
10090 int
10091 main (void)
10092 {
10093 XtMalloc (0)
10094   ;
10095   return 0;
10096 }
10097 _ACEOF
10098 rm -f conftest.$ac_objext conftest$ac_exeext
10099 if { (eval echo "$as_me:10099: \"$ac_link\"") >&5
10100   (eval $ac_link) 2>&5
10101   ac_status=$?
10102   echo "$as_me:10102: \$? = $ac_status" >&5
10103   (exit $ac_status); } &&
10104          { ac_try='test -s conftest$ac_exeext'
10105   { (eval echo "$as_me:10105: \"$ac_try\"") >&5
10106   (eval $ac_try) 2>&5
10107   ac_status=$?
10108   echo "$as_me:10108: \$? = $ac_status" >&5
10109   (exit $ac_status); }; }; then
10110   LIBS=$ac_save_LIBS
10111 # We can link X programs with no special library path.
10112 ac_x_libraries=
10113 else
10114   echo "$as_me: failed program was:" >&5
10115 cat conftest.$ac_ext >&5
10116 LIBS=$ac_save_LIBS
10117 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10118 do
10119   # Don't even attempt the hair of trying to link an X program!
10120   for ac_extension in a so sl dylib dll; do
10121     if test -r $ac_dir/libXt.$ac_extension; then
10122       ac_x_libraries=$ac_dir
10123       break 2
10124     fi
10125   done
10126 done
10127 fi
10128 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10129 fi # $ac_x_libraries = no
10130
10131 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10132   # Didn't find X anywhere.  Cache the known absence of X.
10133   ac_cv_have_x="have_x=no"
10134 else
10135   # Record where we found X for the cache.
10136   ac_cv_have_x="have_x=yes \
10137                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10138 fi
10139 fi
10140
10141   fi
10142   eval "$ac_cv_have_x"
10143 fi # $with_x != no
10144
10145 if test "$have_x" != yes; then
10146   echo "$as_me:10146: result: $have_x" >&5
10147 echo "${ECHO_T}$have_x" >&6
10148   no_x=yes
10149 else
10150   # If each of the values was on the command line, it overrides each guess.
10151   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10152   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10153   # Update the cache value to reflect the command line values.
10154   ac_cv_have_x="have_x=yes \
10155                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10156   echo "$as_me:10156: result: libraries $x_libraries, headers $x_includes" >&5
10157 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10158 fi
10159
10160 if test "$no_x" = yes; then
10161   # Not all programs may use this symbol, but it does not hurt to define it.
10162
10163 cat >>confdefs.h <<\EOF
10164 #define X_DISPLAY_MISSING 1
10165 EOF
10166
10167   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10168 else
10169   if test -n "$x_includes"; then
10170     X_CFLAGS="$X_CFLAGS -I$x_includes"
10171   fi
10172
10173   # It would also be nice to do this for all -L options, not just this one.
10174   if test -n "$x_libraries"; then
10175     X_LIBS="$X_LIBS -L$x_libraries"
10176     # For Solaris; some versions of Sun CC require a space after -R and
10177     # others require no space.  Words are not sufficient . . . .
10178     case `(uname -sr) 2>/dev/null` in
10179     "SunOS 5"*)
10180       echo "$as_me:10180: checking whether -R must be followed by a space" >&5
10181 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10182       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10183       cat >conftest.$ac_ext <<_ACEOF
10184 #line 10184 "configure"
10185 #include "confdefs.h"
10186
10187 int
10188 main (void)
10189 {
10190
10191   ;
10192   return 0;
10193 }
10194 _ACEOF
10195 rm -f conftest.$ac_objext conftest$ac_exeext
10196 if { (eval echo "$as_me:10196: \"$ac_link\"") >&5
10197   (eval $ac_link) 2>&5
10198   ac_status=$?
10199   echo "$as_me:10199: \$? = $ac_status" >&5
10200   (exit $ac_status); } &&
10201          { ac_try='test -s conftest$ac_exeext'
10202   { (eval echo "$as_me:10202: \"$ac_try\"") >&5
10203   (eval $ac_try) 2>&5
10204   ac_status=$?
10205   echo "$as_me:10205: \$? = $ac_status" >&5
10206   (exit $ac_status); }; }; then
10207   ac_R_nospace=yes
10208 else
10209   echo "$as_me: failed program was:" >&5
10210 cat conftest.$ac_ext >&5
10211 ac_R_nospace=no
10212 fi
10213 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10214       if test $ac_R_nospace = yes; then
10215         echo "$as_me:10215: result: no" >&5
10216 echo "${ECHO_T}no" >&6
10217         X_LIBS="$X_LIBS -R$x_libraries"
10218       else
10219         LIBS="$ac_xsave_LIBS -R $x_libraries"
10220         cat >conftest.$ac_ext <<_ACEOF
10221 #line 10221 "configure"
10222 #include "confdefs.h"
10223
10224 int
10225 main (void)
10226 {
10227
10228   ;
10229   return 0;
10230 }
10231 _ACEOF
10232 rm -f conftest.$ac_objext conftest$ac_exeext
10233 if { (eval echo "$as_me:10233: \"$ac_link\"") >&5
10234   (eval $ac_link) 2>&5
10235   ac_status=$?
10236   echo "$as_me:10236: \$? = $ac_status" >&5
10237   (exit $ac_status); } &&
10238          { ac_try='test -s conftest$ac_exeext'
10239   { (eval echo "$as_me:10239: \"$ac_try\"") >&5
10240   (eval $ac_try) 2>&5
10241   ac_status=$?
10242   echo "$as_me:10242: \$? = $ac_status" >&5
10243   (exit $ac_status); }; }; then
10244   ac_R_space=yes
10245 else
10246   echo "$as_me: failed program was:" >&5
10247 cat conftest.$ac_ext >&5
10248 ac_R_space=no
10249 fi
10250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10251         if test $ac_R_space = yes; then
10252           echo "$as_me:10252: result: yes" >&5
10253 echo "${ECHO_T}yes" >&6
10254           X_LIBS="$X_LIBS -R $x_libraries"
10255         else
10256           echo "$as_me:10256: result: neither works" >&5
10257 echo "${ECHO_T}neither works" >&6
10258         fi
10259       fi
10260       LIBS=$ac_xsave_LIBS
10261     esac
10262   fi
10263
10264   # Check for system-dependent libraries X programs must link with.
10265   # Do this before checking for the system-independent R6 libraries
10266   # (-lICE), since we may need -lsocket or whatever for X linking.
10267
10268   if test "$ISC" = yes; then
10269     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10270   else
10271     # Martyn Johnson says this is needed for Ultrix, if the X
10272     # libraries were built with DECnet support.  And Karl Berry says
10273     # the Alpha needs dnet_stub (dnet does not exist).
10274     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10275     cat >conftest.$ac_ext <<_ACEOF
10276 #line 10276 "configure"
10277 #include "confdefs.h"
10278
10279 /* Override any gcc2 internal prototype to avoid an error.  */
10280 #ifdef __cplusplus
10281 extern "C"
10282 #endif
10283 /* We use char because int might match the return type of a gcc2
10284    builtin and then its argument prototype would still apply.  */
10285 char XOpenDisplay ();
10286 int
10287 main (void)
10288 {
10289 XOpenDisplay ();
10290   ;
10291   return 0;
10292 }
10293 _ACEOF
10294 rm -f conftest.$ac_objext conftest$ac_exeext
10295 if { (eval echo "$as_me:10295: \"$ac_link\"") >&5
10296   (eval $ac_link) 2>&5
10297   ac_status=$?
10298   echo "$as_me:10298: \$? = $ac_status" >&5
10299   (exit $ac_status); } &&
10300          { ac_try='test -s conftest$ac_exeext'
10301   { (eval echo "$as_me:10301: \"$ac_try\"") >&5
10302   (eval $ac_try) 2>&5
10303   ac_status=$?
10304   echo "$as_me:10304: \$? = $ac_status" >&5
10305   (exit $ac_status); }; }; then
10306   :
10307 else
10308   echo "$as_me: failed program was:" >&5
10309 cat conftest.$ac_ext >&5
10310 echo "$as_me:10310: checking for dnet_ntoa in -ldnet" >&5
10311 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10312 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10313   echo $ECHO_N "(cached) $ECHO_C" >&6
10314 else
10315   ac_check_lib_save_LIBS=$LIBS
10316 LIBS="-ldnet  $LIBS"
10317 cat >conftest.$ac_ext <<_ACEOF
10318 #line 10318 "configure"
10319 #include "confdefs.h"
10320
10321 /* Override any gcc2 internal prototype to avoid an error.  */
10322 #ifdef __cplusplus
10323 extern "C"
10324 #endif
10325 /* We use char because int might match the return type of a gcc2
10326    builtin and then its argument prototype would still apply.  */
10327 char dnet_ntoa ();
10328 int
10329 main (void)
10330 {
10331 dnet_ntoa ();
10332   ;
10333   return 0;
10334 }
10335 _ACEOF
10336 rm -f conftest.$ac_objext conftest$ac_exeext
10337 if { (eval echo "$as_me:10337: \"$ac_link\"") >&5
10338   (eval $ac_link) 2>&5
10339   ac_status=$?
10340   echo "$as_me:10340: \$? = $ac_status" >&5
10341   (exit $ac_status); } &&
10342          { ac_try='test -s conftest$ac_exeext'
10343   { (eval echo "$as_me:10343: \"$ac_try\"") >&5
10344   (eval $ac_try) 2>&5
10345   ac_status=$?
10346   echo "$as_me:10346: \$? = $ac_status" >&5
10347   (exit $ac_status); }; }; then
10348   ac_cv_lib_dnet_dnet_ntoa=yes
10349 else
10350   echo "$as_me: failed program was:" >&5
10351 cat conftest.$ac_ext >&5
10352 ac_cv_lib_dnet_dnet_ntoa=no
10353 fi
10354 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10355 LIBS=$ac_check_lib_save_LIBS
10356 fi
10357 echo "$as_me:10357: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10358 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10359 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10360   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10361 fi
10362
10363     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10364       echo "$as_me:10364: checking for dnet_ntoa in -ldnet_stub" >&5
10365 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10366 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10367   echo $ECHO_N "(cached) $ECHO_C" >&6
10368 else
10369   ac_check_lib_save_LIBS=$LIBS
10370 LIBS="-ldnet_stub  $LIBS"
10371 cat >conftest.$ac_ext <<_ACEOF
10372 #line 10372 "configure"
10373 #include "confdefs.h"
10374
10375 /* Override any gcc2 internal prototype to avoid an error.  */
10376 #ifdef __cplusplus
10377 extern "C"
10378 #endif
10379 /* We use char because int might match the return type of a gcc2
10380    builtin and then its argument prototype would still apply.  */
10381 char dnet_ntoa ();
10382 int
10383 main (void)
10384 {
10385 dnet_ntoa ();
10386   ;
10387   return 0;
10388 }
10389 _ACEOF
10390 rm -f conftest.$ac_objext conftest$ac_exeext
10391 if { (eval echo "$as_me:10391: \"$ac_link\"") >&5
10392   (eval $ac_link) 2>&5
10393   ac_status=$?
10394   echo "$as_me:10394: \$? = $ac_status" >&5
10395   (exit $ac_status); } &&
10396          { ac_try='test -s conftest$ac_exeext'
10397   { (eval echo "$as_me:10397: \"$ac_try\"") >&5
10398   (eval $ac_try) 2>&5
10399   ac_status=$?
10400   echo "$as_me:10400: \$? = $ac_status" >&5
10401   (exit $ac_status); }; }; then
10402   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10403 else
10404   echo "$as_me: failed program was:" >&5
10405 cat conftest.$ac_ext >&5
10406 ac_cv_lib_dnet_stub_dnet_ntoa=no
10407 fi
10408 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10409 LIBS=$ac_check_lib_save_LIBS
10410 fi
10411 echo "$as_me:10411: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10412 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10413 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10414   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10415 fi
10416
10417     fi
10418 fi
10419 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10420     LIBS="$ac_xsave_LIBS"
10421
10422     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10423     # to get the SysV transport functions.
10424     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10425     # needs -lnsl.
10426     # The nsl library prevents programs from opening the X display
10427     # on Irix 5.2, according to T.E. Dickey.
10428     # The functions gethostbyname, getservbyname, and inet_addr are
10429     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10430     echo "$as_me:10430: checking for gethostbyname" >&5
10431 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10432 if test "${ac_cv_func_gethostbyname+set}" = set; then
10433   echo $ECHO_N "(cached) $ECHO_C" >&6
10434 else
10435   cat >conftest.$ac_ext <<_ACEOF
10436 #line 10436 "configure"
10437 #include "confdefs.h"
10438 /* System header to define __stub macros and hopefully few prototypes,
10439     which can conflict with char gethostbyname (); below.  */
10440 #include <assert.h>
10441 /* Override any gcc2 internal prototype to avoid an error.  */
10442 #ifdef __cplusplus
10443 extern "C"
10444 #endif
10445 /* We use char because int might match the return type of a gcc2
10446    builtin and then its argument prototype would still apply.  */
10447 char gethostbyname ();
10448 char (*f) ();
10449
10450 int
10451 main (void)
10452 {
10453 /* The GNU C library defines this for functions which it implements
10454     to always fail with ENOSYS.  Some functions are actually named
10455     something starting with __ and the normal name is an alias.  */
10456 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10457 choke me
10458 #else
10459 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10460 #endif
10461
10462   ;
10463   return 0;
10464 }
10465 _ACEOF
10466 rm -f conftest.$ac_objext conftest$ac_exeext
10467 if { (eval echo "$as_me:10467: \"$ac_link\"") >&5
10468   (eval $ac_link) 2>&5
10469   ac_status=$?
10470   echo "$as_me:10470: \$? = $ac_status" >&5
10471   (exit $ac_status); } &&
10472          { ac_try='test -s conftest$ac_exeext'
10473   { (eval echo "$as_me:10473: \"$ac_try\"") >&5
10474   (eval $ac_try) 2>&5
10475   ac_status=$?
10476   echo "$as_me:10476: \$? = $ac_status" >&5
10477   (exit $ac_status); }; }; then
10478   ac_cv_func_gethostbyname=yes
10479 else
10480   echo "$as_me: failed program was:" >&5
10481 cat conftest.$ac_ext >&5
10482 ac_cv_func_gethostbyname=no
10483 fi
10484 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10485 fi
10486 echo "$as_me:10486: result: $ac_cv_func_gethostbyname" >&5
10487 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10488
10489     if test $ac_cv_func_gethostbyname = no; then
10490       echo "$as_me:10490: checking for gethostbyname in -lnsl" >&5
10491 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10492 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10493   echo $ECHO_N "(cached) $ECHO_C" >&6
10494 else
10495   ac_check_lib_save_LIBS=$LIBS
10496 LIBS="-lnsl  $LIBS"
10497 cat >conftest.$ac_ext <<_ACEOF
10498 #line 10498 "configure"
10499 #include "confdefs.h"
10500
10501 /* Override any gcc2 internal prototype to avoid an error.  */
10502 #ifdef __cplusplus
10503 extern "C"
10504 #endif
10505 /* We use char because int might match the return type of a gcc2
10506    builtin and then its argument prototype would still apply.  */
10507 char gethostbyname ();
10508 int
10509 main (void)
10510 {
10511 gethostbyname ();
10512   ;
10513   return 0;
10514 }
10515 _ACEOF
10516 rm -f conftest.$ac_objext conftest$ac_exeext
10517 if { (eval echo "$as_me:10517: \"$ac_link\"") >&5
10518   (eval $ac_link) 2>&5
10519   ac_status=$?
10520   echo "$as_me:10520: \$? = $ac_status" >&5
10521   (exit $ac_status); } &&
10522          { ac_try='test -s conftest$ac_exeext'
10523   { (eval echo "$as_me:10523: \"$ac_try\"") >&5
10524   (eval $ac_try) 2>&5
10525   ac_status=$?
10526   echo "$as_me:10526: \$? = $ac_status" >&5
10527   (exit $ac_status); }; }; then
10528   ac_cv_lib_nsl_gethostbyname=yes
10529 else
10530   echo "$as_me: failed program was:" >&5
10531 cat conftest.$ac_ext >&5
10532 ac_cv_lib_nsl_gethostbyname=no
10533 fi
10534 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10535 LIBS=$ac_check_lib_save_LIBS
10536 fi
10537 echo "$as_me:10537: result: $ac_cv_lib_nsl_gethostbyname" >&5
10538 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10539 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10540   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10541 fi
10542
10543       if test $ac_cv_lib_nsl_gethostbyname = no; then
10544         echo "$as_me:10544: checking for gethostbyname in -lbsd" >&5
10545 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10546 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10547   echo $ECHO_N "(cached) $ECHO_C" >&6
10548 else
10549   ac_check_lib_save_LIBS=$LIBS
10550 LIBS="-lbsd  $LIBS"
10551 cat >conftest.$ac_ext <<_ACEOF
10552 #line 10552 "configure"
10553 #include "confdefs.h"
10554
10555 /* Override any gcc2 internal prototype to avoid an error.  */
10556 #ifdef __cplusplus
10557 extern "C"
10558 #endif
10559 /* We use char because int might match the return type of a gcc2
10560    builtin and then its argument prototype would still apply.  */
10561 char gethostbyname ();
10562 int
10563 main (void)
10564 {
10565 gethostbyname ();
10566   ;
10567   return 0;
10568 }
10569 _ACEOF
10570 rm -f conftest.$ac_objext conftest$ac_exeext
10571 if { (eval echo "$as_me:10571: \"$ac_link\"") >&5
10572   (eval $ac_link) 2>&5
10573   ac_status=$?
10574   echo "$as_me:10574: \$? = $ac_status" >&5
10575   (exit $ac_status); } &&
10576          { ac_try='test -s conftest$ac_exeext'
10577   { (eval echo "$as_me:10577: \"$ac_try\"") >&5
10578   (eval $ac_try) 2>&5
10579   ac_status=$?
10580   echo "$as_me:10580: \$? = $ac_status" >&5
10581   (exit $ac_status); }; }; then
10582   ac_cv_lib_bsd_gethostbyname=yes
10583 else
10584   echo "$as_me: failed program was:" >&5
10585 cat conftest.$ac_ext >&5
10586 ac_cv_lib_bsd_gethostbyname=no
10587 fi
10588 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10589 LIBS=$ac_check_lib_save_LIBS
10590 fi
10591 echo "$as_me:10591: result: $ac_cv_lib_bsd_gethostbyname" >&5
10592 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10593 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10594   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10595 fi
10596
10597       fi
10598     fi
10599
10600     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10601     # socket/setsockopt and other routines are undefined under SCO ODT
10602     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10603     # on later versions), says Simon Leinen: it contains gethostby*
10604     # variants that don't use the nameserver (or something).  -lsocket
10605     # must be given before -lnsl if both are needed.  We assume that
10606     # if connect needs -lnsl, so does gethostbyname.
10607     echo "$as_me:10607: checking for connect" >&5
10608 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10609 if test "${ac_cv_func_connect+set}" = set; then
10610   echo $ECHO_N "(cached) $ECHO_C" >&6
10611 else
10612   cat >conftest.$ac_ext <<_ACEOF
10613 #line 10613 "configure"
10614 #include "confdefs.h"
10615 /* System header to define __stub macros and hopefully few prototypes,
10616     which can conflict with char connect (); below.  */
10617 #include <assert.h>
10618 /* Override any gcc2 internal prototype to avoid an error.  */
10619 #ifdef __cplusplus
10620 extern "C"
10621 #endif
10622 /* We use char because int might match the return type of a gcc2
10623    builtin and then its argument prototype would still apply.  */
10624 char connect ();
10625 char (*f) ();
10626
10627 int
10628 main (void)
10629 {
10630 /* The GNU C library defines this for functions which it implements
10631     to always fail with ENOSYS.  Some functions are actually named
10632     something starting with __ and the normal name is an alias.  */
10633 #if defined (__stub_connect) || defined (__stub___connect)
10634 choke me
10635 #else
10636 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10637 #endif
10638
10639   ;
10640   return 0;
10641 }
10642 _ACEOF
10643 rm -f conftest.$ac_objext conftest$ac_exeext
10644 if { (eval echo "$as_me:10644: \"$ac_link\"") >&5
10645   (eval $ac_link) 2>&5
10646   ac_status=$?
10647   echo "$as_me:10647: \$? = $ac_status" >&5
10648   (exit $ac_status); } &&
10649          { ac_try='test -s conftest$ac_exeext'
10650   { (eval echo "$as_me:10650: \"$ac_try\"") >&5
10651   (eval $ac_try) 2>&5
10652   ac_status=$?
10653   echo "$as_me:10653: \$? = $ac_status" >&5
10654   (exit $ac_status); }; }; then
10655   ac_cv_func_connect=yes
10656 else
10657   echo "$as_me: failed program was:" >&5
10658 cat conftest.$ac_ext >&5
10659 ac_cv_func_connect=no
10660 fi
10661 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10662 fi
10663 echo "$as_me:10663: result: $ac_cv_func_connect" >&5
10664 echo "${ECHO_T}$ac_cv_func_connect" >&6
10665
10666     if test $ac_cv_func_connect = no; then
10667       echo "$as_me:10667: checking for connect in -lsocket" >&5
10668 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10669 if test "${ac_cv_lib_socket_connect+set}" = set; then
10670   echo $ECHO_N "(cached) $ECHO_C" >&6
10671 else
10672   ac_check_lib_save_LIBS=$LIBS
10673 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10674 cat >conftest.$ac_ext <<_ACEOF
10675 #line 10675 "configure"
10676 #include "confdefs.h"
10677
10678 /* Override any gcc2 internal prototype to avoid an error.  */
10679 #ifdef __cplusplus
10680 extern "C"
10681 #endif
10682 /* We use char because int might match the return type of a gcc2
10683    builtin and then its argument prototype would still apply.  */
10684 char connect ();
10685 int
10686 main (void)
10687 {
10688 connect ();
10689   ;
10690   return 0;
10691 }
10692 _ACEOF
10693 rm -f conftest.$ac_objext conftest$ac_exeext
10694 if { (eval echo "$as_me:10694: \"$ac_link\"") >&5
10695   (eval $ac_link) 2>&5
10696   ac_status=$?
10697   echo "$as_me:10697: \$? = $ac_status" >&5
10698   (exit $ac_status); } &&
10699          { ac_try='test -s conftest$ac_exeext'
10700   { (eval echo "$as_me:10700: \"$ac_try\"") >&5
10701   (eval $ac_try) 2>&5
10702   ac_status=$?
10703   echo "$as_me:10703: \$? = $ac_status" >&5
10704   (exit $ac_status); }; }; then
10705   ac_cv_lib_socket_connect=yes
10706 else
10707   echo "$as_me: failed program was:" >&5
10708 cat conftest.$ac_ext >&5
10709 ac_cv_lib_socket_connect=no
10710 fi
10711 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10712 LIBS=$ac_check_lib_save_LIBS
10713 fi
10714 echo "$as_me:10714: result: $ac_cv_lib_socket_connect" >&5
10715 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10716 if test $ac_cv_lib_socket_connect = yes; then
10717   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10718 fi
10719
10720     fi
10721
10722     # Guillermo Gomez says -lposix is necessary on A/UX.
10723     echo "$as_me:10723: checking for remove" >&5
10724 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10725 if test "${ac_cv_func_remove+set}" = set; then
10726   echo $ECHO_N "(cached) $ECHO_C" >&6
10727 else
10728   cat >conftest.$ac_ext <<_ACEOF
10729 #line 10729 "configure"
10730 #include "confdefs.h"
10731 /* System header to define __stub macros and hopefully few prototypes,
10732     which can conflict with char remove (); below.  */
10733 #include <assert.h>
10734 /* Override any gcc2 internal prototype to avoid an error.  */
10735 #ifdef __cplusplus
10736 extern "C"
10737 #endif
10738 /* We use char because int might match the return type of a gcc2
10739    builtin and then its argument prototype would still apply.  */
10740 char remove ();
10741 char (*f) ();
10742
10743 int
10744 main (void)
10745 {
10746 /* The GNU C library defines this for functions which it implements
10747     to always fail with ENOSYS.  Some functions are actually named
10748     something starting with __ and the normal name is an alias.  */
10749 #if defined (__stub_remove) || defined (__stub___remove)
10750 choke me
10751 #else
10752 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10753 #endif
10754
10755   ;
10756   return 0;
10757 }
10758 _ACEOF
10759 rm -f conftest.$ac_objext conftest$ac_exeext
10760 if { (eval echo "$as_me:10760: \"$ac_link\"") >&5
10761   (eval $ac_link) 2>&5
10762   ac_status=$?
10763   echo "$as_me:10763: \$? = $ac_status" >&5
10764   (exit $ac_status); } &&
10765          { ac_try='test -s conftest$ac_exeext'
10766   { (eval echo "$as_me:10766: \"$ac_try\"") >&5
10767   (eval $ac_try) 2>&5
10768   ac_status=$?
10769   echo "$as_me:10769: \$? = $ac_status" >&5
10770   (exit $ac_status); }; }; then
10771   ac_cv_func_remove=yes
10772 else
10773   echo "$as_me: failed program was:" >&5
10774 cat conftest.$ac_ext >&5
10775 ac_cv_func_remove=no
10776 fi
10777 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10778 fi
10779 echo "$as_me:10779: result: $ac_cv_func_remove" >&5
10780 echo "${ECHO_T}$ac_cv_func_remove" >&6
10781
10782     if test $ac_cv_func_remove = no; then
10783       echo "$as_me:10783: checking for remove in -lposix" >&5
10784 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10785 if test "${ac_cv_lib_posix_remove+set}" = set; then
10786   echo $ECHO_N "(cached) $ECHO_C" >&6
10787 else
10788   ac_check_lib_save_LIBS=$LIBS
10789 LIBS="-lposix  $LIBS"
10790 cat >conftest.$ac_ext <<_ACEOF
10791 #line 10791 "configure"
10792 #include "confdefs.h"
10793
10794 /* Override any gcc2 internal prototype to avoid an error.  */
10795 #ifdef __cplusplus
10796 extern "C"
10797 #endif
10798 /* We use char because int might match the return type of a gcc2
10799    builtin and then its argument prototype would still apply.  */
10800 char remove ();
10801 int
10802 main (void)
10803 {
10804 remove ();
10805   ;
10806   return 0;
10807 }
10808 _ACEOF
10809 rm -f conftest.$ac_objext conftest$ac_exeext
10810 if { (eval echo "$as_me:10810: \"$ac_link\"") >&5
10811   (eval $ac_link) 2>&5
10812   ac_status=$?
10813   echo "$as_me:10813: \$? = $ac_status" >&5
10814   (exit $ac_status); } &&
10815          { ac_try='test -s conftest$ac_exeext'
10816   { (eval echo "$as_me:10816: \"$ac_try\"") >&5
10817   (eval $ac_try) 2>&5
10818   ac_status=$?
10819   echo "$as_me:10819: \$? = $ac_status" >&5
10820   (exit $ac_status); }; }; then
10821   ac_cv_lib_posix_remove=yes
10822 else
10823   echo "$as_me: failed program was:" >&5
10824 cat conftest.$ac_ext >&5
10825 ac_cv_lib_posix_remove=no
10826 fi
10827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10828 LIBS=$ac_check_lib_save_LIBS
10829 fi
10830 echo "$as_me:10830: result: $ac_cv_lib_posix_remove" >&5
10831 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10832 if test $ac_cv_lib_posix_remove = yes; then
10833   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10834 fi
10835
10836     fi
10837
10838     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10839     echo "$as_me:10839: checking for shmat" >&5
10840 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10841 if test "${ac_cv_func_shmat+set}" = set; then
10842   echo $ECHO_N "(cached) $ECHO_C" >&6
10843 else
10844   cat >conftest.$ac_ext <<_ACEOF
10845 #line 10845 "configure"
10846 #include "confdefs.h"
10847 /* System header to define __stub macros and hopefully few prototypes,
10848     which can conflict with char shmat (); below.  */
10849 #include <assert.h>
10850 /* Override any gcc2 internal prototype to avoid an error.  */
10851 #ifdef __cplusplus
10852 extern "C"
10853 #endif
10854 /* We use char because int might match the return type of a gcc2
10855    builtin and then its argument prototype would still apply.  */
10856 char shmat ();
10857 char (*f) ();
10858
10859 int
10860 main (void)
10861 {
10862 /* The GNU C library defines this for functions which it implements
10863     to always fail with ENOSYS.  Some functions are actually named
10864     something starting with __ and the normal name is an alias.  */
10865 #if defined (__stub_shmat) || defined (__stub___shmat)
10866 choke me
10867 #else
10868 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10869 #endif
10870
10871   ;
10872   return 0;
10873 }
10874 _ACEOF
10875 rm -f conftest.$ac_objext conftest$ac_exeext
10876 if { (eval echo "$as_me:10876: \"$ac_link\"") >&5
10877   (eval $ac_link) 2>&5
10878   ac_status=$?
10879   echo "$as_me:10879: \$? = $ac_status" >&5
10880   (exit $ac_status); } &&
10881          { ac_try='test -s conftest$ac_exeext'
10882   { (eval echo "$as_me:10882: \"$ac_try\"") >&5
10883   (eval $ac_try) 2>&5
10884   ac_status=$?
10885   echo "$as_me:10885: \$? = $ac_status" >&5
10886   (exit $ac_status); }; }; then
10887   ac_cv_func_shmat=yes
10888 else
10889   echo "$as_me: failed program was:" >&5
10890 cat conftest.$ac_ext >&5
10891 ac_cv_func_shmat=no
10892 fi
10893 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10894 fi
10895 echo "$as_me:10895: result: $ac_cv_func_shmat" >&5
10896 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10897
10898     if test $ac_cv_func_shmat = no; then
10899       echo "$as_me:10899: checking for shmat in -lipc" >&5
10900 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10901 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10902   echo $ECHO_N "(cached) $ECHO_C" >&6
10903 else
10904   ac_check_lib_save_LIBS=$LIBS
10905 LIBS="-lipc  $LIBS"
10906 cat >conftest.$ac_ext <<_ACEOF
10907 #line 10907 "configure"
10908 #include "confdefs.h"
10909
10910 /* Override any gcc2 internal prototype to avoid an error.  */
10911 #ifdef __cplusplus
10912 extern "C"
10913 #endif
10914 /* We use char because int might match the return type of a gcc2
10915    builtin and then its argument prototype would still apply.  */
10916 char shmat ();
10917 int
10918 main (void)
10919 {
10920 shmat ();
10921   ;
10922   return 0;
10923 }
10924 _ACEOF
10925 rm -f conftest.$ac_objext conftest$ac_exeext
10926 if { (eval echo "$as_me:10926: \"$ac_link\"") >&5
10927   (eval $ac_link) 2>&5
10928   ac_status=$?
10929   echo "$as_me:10929: \$? = $ac_status" >&5
10930   (exit $ac_status); } &&
10931          { ac_try='test -s conftest$ac_exeext'
10932   { (eval echo "$as_me:10932: \"$ac_try\"") >&5
10933   (eval $ac_try) 2>&5
10934   ac_status=$?
10935   echo "$as_me:10935: \$? = $ac_status" >&5
10936   (exit $ac_status); }; }; then
10937   ac_cv_lib_ipc_shmat=yes
10938 else
10939   echo "$as_me: failed program was:" >&5
10940 cat conftest.$ac_ext >&5
10941 ac_cv_lib_ipc_shmat=no
10942 fi
10943 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10944 LIBS=$ac_check_lib_save_LIBS
10945 fi
10946 echo "$as_me:10946: result: $ac_cv_lib_ipc_shmat" >&5
10947 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10948 if test $ac_cv_lib_ipc_shmat = yes; then
10949   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10950 fi
10951
10952     fi
10953   fi
10954
10955   # Check for libraries that X11R6 Xt/Xaw programs need.
10956   ac_save_LDFLAGS=$LDFLAGS
10957   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10958   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10959   # check for ICE first), but we must link in the order -lSM -lICE or
10960   # we get undefined symbols.  So assume we have SM if we have ICE.
10961   # These have to be linked with before -lX11, unlike the other
10962   # libraries we check for below, so use a different variable.
10963   # John Interrante, Karl Berry
10964   echo "$as_me:10964: checking for IceConnectionNumber in -lICE" >&5
10965 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10966 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10967   echo $ECHO_N "(cached) $ECHO_C" >&6
10968 else
10969   ac_check_lib_save_LIBS=$LIBS
10970 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10971 cat >conftest.$ac_ext <<_ACEOF
10972 #line 10972 "configure"
10973 #include "confdefs.h"
10974
10975 /* Override any gcc2 internal prototype to avoid an error.  */
10976 #ifdef __cplusplus
10977 extern "C"
10978 #endif
10979 /* We use char because int might match the return type of a gcc2
10980    builtin and then its argument prototype would still apply.  */
10981 char IceConnectionNumber ();
10982 int
10983 main (void)
10984 {
10985 IceConnectionNumber ();
10986   ;
10987   return 0;
10988 }
10989 _ACEOF
10990 rm -f conftest.$ac_objext conftest$ac_exeext
10991 if { (eval echo "$as_me:10991: \"$ac_link\"") >&5
10992   (eval $ac_link) 2>&5
10993   ac_status=$?
10994   echo "$as_me:10994: \$? = $ac_status" >&5
10995   (exit $ac_status); } &&
10996          { ac_try='test -s conftest$ac_exeext'
10997   { (eval echo "$as_me:10997: \"$ac_try\"") >&5
10998   (eval $ac_try) 2>&5
10999   ac_status=$?
11000   echo "$as_me:11000: \$? = $ac_status" >&5
11001   (exit $ac_status); }; }; then
11002   ac_cv_lib_ICE_IceConnectionNumber=yes
11003 else
11004   echo "$as_me: failed program was:" >&5
11005 cat conftest.$ac_ext >&5
11006 ac_cv_lib_ICE_IceConnectionNumber=no
11007 fi
11008 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11009 LIBS=$ac_check_lib_save_LIBS
11010 fi
11011 echo "$as_me:11011: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11012 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11013 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11014   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11015 fi
11016
11017   LDFLAGS=$ac_save_LDFLAGS
11018
11019 fi
11020
11021 cf_x_athena=${cf_x_athena:-Xaw}
11022
11023 echo "$as_me:11023: checking if you want to link with Xaw 3d library" >&5
11024 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11025 withval=
11026
11027 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11028 if test "${with_Xaw3d+set}" = set; then
11029   withval="$with_Xaw3d"
11030
11031 fi;
11032 if test "$withval" = yes ; then
11033         cf_x_athena=Xaw3d
11034         echo "$as_me:11034: result: yes" >&5
11035 echo "${ECHO_T}yes" >&6
11036 else
11037         echo "$as_me:11037: result: no" >&5
11038 echo "${ECHO_T}no" >&6
11039 fi
11040
11041 echo "$as_me:11041: checking if you want to link with Xaw 3d xft library" >&5
11042 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
11043 withval=
11044
11045 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
11046 if test "${with_Xaw3dxft+set}" = set; then
11047   withval="$with_Xaw3dxft"
11048
11049 fi;
11050 if test "$withval" = yes ; then
11051         cf_x_athena=Xaw3dxft
11052         echo "$as_me:11052: result: yes" >&5
11053 echo "${ECHO_T}yes" >&6
11054 else
11055         echo "$as_me:11055: result: no" >&5
11056 echo "${ECHO_T}no" >&6
11057 fi
11058
11059 echo "$as_me:11059: checking if you want to link with neXT Athena library" >&5
11060 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11061 withval=
11062
11063 # Check whether --with-neXtaw or --without-neXtaw was given.
11064 if test "${with_neXtaw+set}" = set; then
11065   withval="$with_neXtaw"
11066
11067 fi;
11068 if test "$withval" = yes ; then
11069         cf_x_athena=neXtaw
11070         echo "$as_me:11070: result: yes" >&5
11071 echo "${ECHO_T}yes" >&6
11072 else
11073         echo "$as_me:11073: result: no" >&5
11074 echo "${ECHO_T}no" >&6
11075 fi
11076
11077 echo "$as_me:11077: checking if you want to link with Athena-Plus library" >&5
11078 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11079 withval=
11080
11081 # Check whether --with-XawPlus or --without-XawPlus was given.
11082 if test "${with_XawPlus+set}" = set; then
11083   withval="$with_XawPlus"
11084
11085 fi;
11086 if test "$withval" = yes ; then
11087         cf_x_athena=XawPlus
11088         echo "$as_me:11088: result: yes" >&5
11089 echo "${ECHO_T}yes" >&6
11090 else
11091         echo "$as_me:11091: result: no" >&5
11092 echo "${ECHO_T}no" >&6
11093 fi
11094
11095 cf_x_athena_lib=""
11096
11097 if test "$PKG_CONFIG" != none ; then
11098         cf_athena_list=
11099         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11100         for cf_athena_pkg in \
11101                 $cf_athena_list \
11102                 ${cf_x_athena} \
11103                 ${cf_x_athena}-devel \
11104                 lib${cf_x_athena} \
11105                 lib${cf_x_athena}-devel
11106         do
11107
11108 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11109         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11110
11111 echo "${as_me:-configure}:11111: testing found package $cf_athena_pkg ..." 1>&5
11112
11113         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11114         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11115         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11116
11117 echo "${as_me:-configure}:11117: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11118
11119         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11120
11121 echo "${as_me:-configure}:11121: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11122
11123 cf_fix_cppflags=no
11124 cf_new_cflags=
11125 cf_new_cppflags=
11126 cf_new_extra_cppflags=
11127
11128 for cf_add_cflags in $cf_pkgconfig_incs
11129 do
11130 case $cf_fix_cppflags in
11131 (no)
11132         case $cf_add_cflags in
11133         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11134                 case $cf_add_cflags in
11135                 (-D*)
11136                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11137
11138                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11139                                 && test -z "${cf_tst_cflags}" \
11140                                 && cf_fix_cppflags=yes
11141
11142                         if test $cf_fix_cppflags = yes ; then
11143
11144         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11145         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11146
11147                                 continue
11148                         elif test "${cf_tst_cflags}" = "\"'" ; then
11149
11150         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11151         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11152
11153                                 continue
11154                         fi
11155                         ;;
11156                 esac
11157                 case "$CPPFLAGS" in
11158                 (*$cf_add_cflags)
11159                         ;;
11160                 (*)
11161                         case $cf_add_cflags in
11162                         (-D*)
11163                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11164
11165 CPPFLAGS=`echo "$CPPFLAGS" | \
11166         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11167                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11168
11169                                 ;;
11170                         esac
11171
11172         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11173         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11174
11175                         ;;
11176                 esac
11177                 ;;
11178         (*)
11179
11180         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11181         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11182
11183                 ;;
11184         esac
11185         ;;
11186 (yes)
11187
11188         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11189         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11190
11191         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11192
11193         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11194                 && test -z "${cf_tst_cflags}" \
11195                 && cf_fix_cppflags=no
11196         ;;
11197 esac
11198 done
11199
11200 if test -n "$cf_new_cflags" ; then
11201
11202         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11203         CFLAGS="${CFLAGS}$cf_new_cflags"
11204
11205 fi
11206
11207 if test -n "$cf_new_cppflags" ; then
11208
11209         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11210         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11211
11212 fi
11213
11214 if test -n "$cf_new_extra_cppflags" ; then
11215
11216         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11217         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11218
11219 fi
11220
11221 cf_add_libs="$cf_pkgconfig_libs"
11222 # Filter out duplicates - this happens with badly-designed ".pc" files...
11223 for cf_add_1lib in $LIBS
11224 do
11225         for cf_add_2lib in $cf_add_libs
11226         do
11227                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11228                 then
11229                         cf_add_1lib=
11230                         break
11231                 fi
11232         done
11233         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11234 done
11235 LIBS="$cf_add_libs"
11236
11237                         cf_x_athena_lib="$cf_pkgconfig_libs"
11238
11239 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11240
11241                         cat >>confdefs.h <<EOF
11242 #define $cf_x_athena_LIBS 1
11243 EOF
11244
11245         for cf_trim_lib in Xmu Xt X11
11246         do
11247                 case "$LIBS" in
11248                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11249                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11250                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11251
11252 echo "${as_me:-configure}:11252: testing ..trimmed $LIBS ..." 1>&5
11253
11254                         ;;
11255                 esac
11256         done
11257
11258 echo "$as_me:11258: checking for usable $cf_x_athena/Xmu package" >&5
11259 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11260 if test "${cf_cv_xaw_compat+set}" = set; then
11261   echo $ECHO_N "(cached) $ECHO_C" >&6
11262 else
11263
11264 cat >conftest.$ac_ext <<_ACEOF
11265 #line 11265 "configure"
11266 #include "confdefs.h"
11267
11268 #include <X11/Xmu/CharSet.h>
11269
11270 int
11271 main (void)
11272 {
11273
11274 int check = XmuCompareISOLatin1("big", "small")
11275
11276   ;
11277   return 0;
11278 }
11279 _ACEOF
11280 rm -f conftest.$ac_objext conftest$ac_exeext
11281 if { (eval echo "$as_me:11281: \"$ac_link\"") >&5
11282   (eval $ac_link) 2>&5
11283   ac_status=$?
11284   echo "$as_me:11284: \$? = $ac_status" >&5
11285   (exit $ac_status); } &&
11286          { ac_try='test -s conftest$ac_exeext'
11287   { (eval echo "$as_me:11287: \"$ac_try\"") >&5
11288   (eval $ac_try) 2>&5
11289   ac_status=$?
11290   echo "$as_me:11290: \$? = $ac_status" >&5
11291   (exit $ac_status); }; }; then
11292   cf_cv_xaw_compat=yes
11293 else
11294   echo "$as_me: failed program was:" >&5
11295 cat conftest.$ac_ext >&5
11296 cf_cv_xaw_compat=no
11297 fi
11298 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11299 fi
11300 echo "$as_me:11300: result: $cf_cv_xaw_compat" >&5
11301 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11302
11303                         if test "$cf_cv_xaw_compat" = no
11304                         then
11305                                 # workaround for broken ".pc" files...
11306                                 case "$cf_x_athena_lib" in
11307                                 (*-lXmu*)
11308                                         ;;
11309                                 (*)
11310                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11311
11312 echo "${as_me:-configure}:11312: testing work around broken package ..." 1>&5
11313
11314                                         cf_save_xmu="$LIBS"
11315                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11316
11317 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11318         test -n "$verbose" && echo "    found package xmu" 1>&6
11319
11320 echo "${as_me:-configure}:11320: testing found package xmu ..." 1>&5
11321
11322         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11323         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11324         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11325
11326 echo "${as_me:-configure}:11326: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11327
11328         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11329
11330 echo "${as_me:-configure}:11330: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11331
11332 cf_fix_cppflags=no
11333 cf_new_cflags=
11334 cf_new_cppflags=
11335 cf_new_extra_cppflags=
11336
11337 for cf_add_cflags in $cf_pkgconfig_incs
11338 do
11339 case $cf_fix_cppflags in
11340 (no)
11341         case $cf_add_cflags in
11342         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11343                 case $cf_add_cflags in
11344                 (-D*)
11345                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11346
11347                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11348                                 && test -z "${cf_tst_cflags}" \
11349                                 && cf_fix_cppflags=yes
11350
11351                         if test $cf_fix_cppflags = yes ; then
11352
11353         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11354         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11355
11356                                 continue
11357                         elif test "${cf_tst_cflags}" = "\"'" ; then
11358
11359         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11360         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11361
11362                                 continue
11363                         fi
11364                         ;;
11365                 esac
11366                 case "$CPPFLAGS" in
11367                 (*$cf_add_cflags)
11368                         ;;
11369                 (*)
11370                         case $cf_add_cflags in
11371                         (-D*)
11372                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11373
11374 CPPFLAGS=`echo "$CPPFLAGS" | \
11375         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11376                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11377
11378                                 ;;
11379                         esac
11380
11381         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11382         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11383
11384                         ;;
11385                 esac
11386                 ;;
11387         (*)
11388
11389         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11390         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11391
11392                 ;;
11393         esac
11394         ;;
11395 (yes)
11396
11397         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11398         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11399
11400         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11401
11402         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11403                 && test -z "${cf_tst_cflags}" \
11404                 && cf_fix_cppflags=no
11405         ;;
11406 esac
11407 done
11408
11409 if test -n "$cf_new_cflags" ; then
11410
11411         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11412         CFLAGS="${CFLAGS}$cf_new_cflags"
11413
11414 fi
11415
11416 if test -n "$cf_new_cppflags" ; then
11417
11418         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11419         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11420
11421 fi
11422
11423 if test -n "$cf_new_extra_cppflags" ; then
11424
11425         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11426         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11427
11428 fi
11429
11430 cf_add_libs="$cf_pkgconfig_libs"
11431 # Filter out duplicates - this happens with badly-designed ".pc" files...
11432 for cf_add_1lib in $LIBS
11433 do
11434         for cf_add_2lib in $cf_add_libs
11435         do
11436                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11437                 then
11438                         cf_add_1lib=
11439                         break
11440                 fi
11441         done
11442         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11443 done
11444 LIBS="$cf_add_libs"
11445
11446                                                         LIBS="$cf_save_xmu"
11447
11448 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11449
11450 echo "${as_me:-configure}:11450: testing ...before $LIBS ..." 1>&5
11451
11452 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11453 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11454
11455 echo "${as_me:-configure}:11455: testing ...after  $LIBS ..." 1>&5
11456
11457 else
11458         cf_pkgconfig_incs=
11459         cf_pkgconfig_libs=
11460
11461 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11462
11463 echo "${as_me:-configure}:11463: testing ...before $LIBS ..." 1>&5
11464
11465 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11466 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11467
11468 echo "${as_me:-configure}:11468: testing ...after  $LIBS ..." 1>&5
11469
11470 fi
11471
11472         for cf_trim_lib in Xmu Xt X11
11473         do
11474                 case "$LIBS" in
11475                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11476                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11477                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11478
11479 echo "${as_me:-configure}:11479: testing ..trimmed $LIBS ..." 1>&5
11480
11481                         ;;
11482                 esac
11483         done
11484
11485                                         ;;
11486                                 esac
11487                         fi
11488
11489                         break
11490 else
11491         cf_pkgconfig_incs=
11492         cf_pkgconfig_libs=
11493         :
11494 fi
11495
11496         done
11497 fi
11498
11499 if test -z "$cf_x_athena_lib" ; then
11500
11501 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11502         test -n "$verbose" && echo "    found package Xext" 1>&6
11503
11504 echo "${as_me:-configure}:11504: testing found package Xext ..." 1>&5
11505
11506         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11507         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11508         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11509
11510 echo "${as_me:-configure}:11510: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11511
11512         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11513
11514 echo "${as_me:-configure}:11514: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11515
11516 cf_fix_cppflags=no
11517 cf_new_cflags=
11518 cf_new_cppflags=
11519 cf_new_extra_cppflags=
11520
11521 for cf_add_cflags in $cf_pkgconfig_incs
11522 do
11523 case $cf_fix_cppflags in
11524 (no)
11525         case $cf_add_cflags in
11526         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11527                 case $cf_add_cflags in
11528                 (-D*)
11529                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11530
11531                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11532                                 && test -z "${cf_tst_cflags}" \
11533                                 && cf_fix_cppflags=yes
11534
11535                         if test $cf_fix_cppflags = yes ; then
11536
11537         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11538         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11539
11540                                 continue
11541                         elif test "${cf_tst_cflags}" = "\"'" ; then
11542
11543         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11544         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11545
11546                                 continue
11547                         fi
11548                         ;;
11549                 esac
11550                 case "$CPPFLAGS" in
11551                 (*$cf_add_cflags)
11552                         ;;
11553                 (*)
11554                         case $cf_add_cflags in
11555                         (-D*)
11556                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11557
11558 CPPFLAGS=`echo "$CPPFLAGS" | \
11559         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11560                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11561
11562                                 ;;
11563                         esac
11564
11565         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11566         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11567
11568                         ;;
11569                 esac
11570                 ;;
11571         (*)
11572
11573         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11574         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11575
11576                 ;;
11577         esac
11578         ;;
11579 (yes)
11580
11581         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11582         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11583
11584         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11585
11586         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11587                 && test -z "${cf_tst_cflags}" \
11588                 && cf_fix_cppflags=no
11589         ;;
11590 esac
11591 done
11592
11593 if test -n "$cf_new_cflags" ; then
11594
11595         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11596         CFLAGS="${CFLAGS}$cf_new_cflags"
11597
11598 fi
11599
11600 if test -n "$cf_new_cppflags" ; then
11601
11602         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11603         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11604
11605 fi
11606
11607 if test -n "$cf_new_extra_cppflags" ; then
11608
11609         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11610         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11611
11612 fi
11613
11614 cf_add_libs="$cf_pkgconfig_libs"
11615 # Filter out duplicates - this happens with badly-designed ".pc" files...
11616 for cf_add_1lib in $LIBS
11617 do
11618         for cf_add_2lib in $cf_add_libs
11619         do
11620                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11621                 then
11622                         cf_add_1lib=
11623                         break
11624                 fi
11625         done
11626         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11627 done
11628 LIBS="$cf_add_libs"
11629
11630         :
11631 else
11632         cf_pkgconfig_incs=
11633         cf_pkgconfig_libs=
11634
11635         echo "$as_me:11635: checking for XextCreateExtension in -lXext" >&5
11636 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11637 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11638   echo $ECHO_N "(cached) $ECHO_C" >&6
11639 else
11640   ac_check_lib_save_LIBS=$LIBS
11641 LIBS="-lXext  $LIBS"
11642 cat >conftest.$ac_ext <<_ACEOF
11643 #line 11643 "configure"
11644 #include "confdefs.h"
11645
11646 /* Override any gcc2 internal prototype to avoid an error.  */
11647 #ifdef __cplusplus
11648 extern "C"
11649 #endif
11650 /* We use char because int might match the return type of a gcc2
11651    builtin and then its argument prototype would still apply.  */
11652 char XextCreateExtension ();
11653 int
11654 main (void)
11655 {
11656 XextCreateExtension ();
11657   ;
11658   return 0;
11659 }
11660 _ACEOF
11661 rm -f conftest.$ac_objext conftest$ac_exeext
11662 if { (eval echo "$as_me:11662: \"$ac_link\"") >&5
11663   (eval $ac_link) 2>&5
11664   ac_status=$?
11665   echo "$as_me:11665: \$? = $ac_status" >&5
11666   (exit $ac_status); } &&
11667          { ac_try='test -s conftest$ac_exeext'
11668   { (eval echo "$as_me:11668: \"$ac_try\"") >&5
11669   (eval $ac_try) 2>&5
11670   ac_status=$?
11671   echo "$as_me:11671: \$? = $ac_status" >&5
11672   (exit $ac_status); }; }; then
11673   ac_cv_lib_Xext_XextCreateExtension=yes
11674 else
11675   echo "$as_me: failed program was:" >&5
11676 cat conftest.$ac_ext >&5
11677 ac_cv_lib_Xext_XextCreateExtension=no
11678 fi
11679 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11680 LIBS=$ac_check_lib_save_LIBS
11681 fi
11682 echo "$as_me:11682: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11683 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11684 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11685
11686 cf_add_libs="-lXext"
11687 # Filter out duplicates - this happens with badly-designed ".pc" files...
11688 for cf_add_1lib in $LIBS
11689 do
11690         for cf_add_2lib in $cf_add_libs
11691         do
11692                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11693                 then
11694                         cf_add_1lib=
11695                         break
11696                 fi
11697         done
11698         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11699 done
11700 LIBS="$cf_add_libs"
11701
11702 fi
11703
11704 fi
11705
11706 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11707 # in some cases has installed dummy files in the former, other cases replaced
11708 # it with a link to the new location).  This complicates the configure script.
11709 # Check for that pitfall, and recover using pkg-config
11710 #
11711 # If none of these are set, the configuration is almost certainly broken.
11712 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11713 then
11714
11715 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11716         test -n "$verbose" && echo "    found package x11" 1>&6
11717
11718 echo "${as_me:-configure}:11718: testing found package x11 ..." 1>&5
11719
11720         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11721         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11722         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11723
11724 echo "${as_me:-configure}:11724: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11725
11726         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11727
11728 echo "${as_me:-configure}:11728: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11729
11730 cf_fix_cppflags=no
11731 cf_new_cflags=
11732 cf_new_cppflags=
11733 cf_new_extra_cppflags=
11734
11735 for cf_add_cflags in $cf_pkgconfig_incs
11736 do
11737 case $cf_fix_cppflags in
11738 (no)
11739         case $cf_add_cflags in
11740         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11741                 case $cf_add_cflags in
11742                 (-D*)
11743                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11744
11745                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11746                                 && test -z "${cf_tst_cflags}" \
11747                                 && cf_fix_cppflags=yes
11748
11749                         if test $cf_fix_cppflags = yes ; then
11750
11751         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11752         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11753
11754                                 continue
11755                         elif test "${cf_tst_cflags}" = "\"'" ; then
11756
11757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11759
11760                                 continue
11761                         fi
11762                         ;;
11763                 esac
11764                 case "$CPPFLAGS" in
11765                 (*$cf_add_cflags)
11766                         ;;
11767                 (*)
11768                         case $cf_add_cflags in
11769                         (-D*)
11770                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11771
11772 CPPFLAGS=`echo "$CPPFLAGS" | \
11773         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11774                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11775
11776                                 ;;
11777                         esac
11778
11779         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11780         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11781
11782                         ;;
11783                 esac
11784                 ;;
11785         (*)
11786
11787         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11788         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11789
11790                 ;;
11791         esac
11792         ;;
11793 (yes)
11794
11795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11797
11798         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11799
11800         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11801                 && test -z "${cf_tst_cflags}" \
11802                 && cf_fix_cppflags=no
11803         ;;
11804 esac
11805 done
11806
11807 if test -n "$cf_new_cflags" ; then
11808
11809         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11810         CFLAGS="${CFLAGS}$cf_new_cflags"
11811
11812 fi
11813
11814 if test -n "$cf_new_cppflags" ; then
11815
11816         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11817         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11818
11819 fi
11820
11821 if test -n "$cf_new_extra_cppflags" ; then
11822
11823         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11824         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11825
11826 fi
11827
11828 cf_add_libs="$cf_pkgconfig_libs"
11829 # Filter out duplicates - this happens with badly-designed ".pc" files...
11830 for cf_add_1lib in $LIBS
11831 do
11832         for cf_add_2lib in $cf_add_libs
11833         do
11834                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11835                 then
11836                         cf_add_1lib=
11837                         break
11838                 fi
11839         done
11840         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11841 done
11842 LIBS="$cf_add_libs"
11843
11844         :
11845 else
11846         cf_pkgconfig_incs=
11847         cf_pkgconfig_libs=
11848         { echo "$as_me:11848: WARNING: unable to find X11 library" >&5
11849 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11850 fi
11851
11852 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11853         test -n "$verbose" && echo "    found package ice" 1>&6
11854
11855 echo "${as_me:-configure}:11855: testing found package ice ..." 1>&5
11856
11857         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11858         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11859         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11860
11861 echo "${as_me:-configure}:11861: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11862
11863         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11864
11865 echo "${as_me:-configure}:11865: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11866
11867 cf_fix_cppflags=no
11868 cf_new_cflags=
11869 cf_new_cppflags=
11870 cf_new_extra_cppflags=
11871
11872 for cf_add_cflags in $cf_pkgconfig_incs
11873 do
11874 case $cf_fix_cppflags in
11875 (no)
11876         case $cf_add_cflags in
11877         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11878                 case $cf_add_cflags in
11879                 (-D*)
11880                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11881
11882                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11883                                 && test -z "${cf_tst_cflags}" \
11884                                 && cf_fix_cppflags=yes
11885
11886                         if test $cf_fix_cppflags = yes ; then
11887
11888         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11889         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11890
11891                                 continue
11892                         elif test "${cf_tst_cflags}" = "\"'" ; then
11893
11894         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11895         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11896
11897                                 continue
11898                         fi
11899                         ;;
11900                 esac
11901                 case "$CPPFLAGS" in
11902                 (*$cf_add_cflags)
11903                         ;;
11904                 (*)
11905                         case $cf_add_cflags in
11906                         (-D*)
11907                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11908
11909 CPPFLAGS=`echo "$CPPFLAGS" | \
11910         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11911                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11912
11913                                 ;;
11914                         esac
11915
11916         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11917         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11918
11919                         ;;
11920                 esac
11921                 ;;
11922         (*)
11923
11924         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11925         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11926
11927                 ;;
11928         esac
11929         ;;
11930 (yes)
11931
11932         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11933         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11934
11935         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11936
11937         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11938                 && test -z "${cf_tst_cflags}" \
11939                 && cf_fix_cppflags=no
11940         ;;
11941 esac
11942 done
11943
11944 if test -n "$cf_new_cflags" ; then
11945
11946         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11947         CFLAGS="${CFLAGS}$cf_new_cflags"
11948
11949 fi
11950
11951 if test -n "$cf_new_cppflags" ; then
11952
11953         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11954         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11955
11956 fi
11957
11958 if test -n "$cf_new_extra_cppflags" ; then
11959
11960         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11961         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11962
11963 fi
11964
11965 cf_add_libs="$cf_pkgconfig_libs"
11966 # Filter out duplicates - this happens with badly-designed ".pc" files...
11967 for cf_add_1lib in $LIBS
11968 do
11969         for cf_add_2lib in $cf_add_libs
11970         do
11971                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11972                 then
11973                         cf_add_1lib=
11974                         break
11975                 fi
11976         done
11977         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11978 done
11979 LIBS="$cf_add_libs"
11980
11981         :
11982 else
11983         cf_pkgconfig_incs=
11984         cf_pkgconfig_libs=
11985         { echo "$as_me:11985: WARNING: unable to find ICE library" >&5
11986 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11987 fi
11988
11989 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11990         test -n "$verbose" && echo "    found package sm" 1>&6
11991
11992 echo "${as_me:-configure}:11992: testing found package sm ..." 1>&5
11993
11994         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11995         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11996         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11997
11998 echo "${as_me:-configure}:11998: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11999
12000         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12001
12002 echo "${as_me:-configure}:12002: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12003
12004 cf_fix_cppflags=no
12005 cf_new_cflags=
12006 cf_new_cppflags=
12007 cf_new_extra_cppflags=
12008
12009 for cf_add_cflags in $cf_pkgconfig_incs
12010 do
12011 case $cf_fix_cppflags in
12012 (no)
12013         case $cf_add_cflags in
12014         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12015                 case $cf_add_cflags in
12016                 (-D*)
12017                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12018
12019                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12020                                 && test -z "${cf_tst_cflags}" \
12021                                 && cf_fix_cppflags=yes
12022
12023                         if test $cf_fix_cppflags = yes ; then
12024
12025         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12026         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12027
12028                                 continue
12029                         elif test "${cf_tst_cflags}" = "\"'" ; then
12030
12031         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12032         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12033
12034                                 continue
12035                         fi
12036                         ;;
12037                 esac
12038                 case "$CPPFLAGS" in
12039                 (*$cf_add_cflags)
12040                         ;;
12041                 (*)
12042                         case $cf_add_cflags in
12043                         (-D*)
12044                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12045
12046 CPPFLAGS=`echo "$CPPFLAGS" | \
12047         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12048                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12049
12050                                 ;;
12051                         esac
12052
12053         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12054         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12055
12056                         ;;
12057                 esac
12058                 ;;
12059         (*)
12060
12061         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12062         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12063
12064                 ;;
12065         esac
12066         ;;
12067 (yes)
12068
12069         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12070         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12071
12072         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12073
12074         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12075                 && test -z "${cf_tst_cflags}" \
12076                 && cf_fix_cppflags=no
12077         ;;
12078 esac
12079 done
12080
12081 if test -n "$cf_new_cflags" ; then
12082
12083         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12084         CFLAGS="${CFLAGS}$cf_new_cflags"
12085
12086 fi
12087
12088 if test -n "$cf_new_cppflags" ; then
12089
12090         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12091         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12092
12093 fi
12094
12095 if test -n "$cf_new_extra_cppflags" ; then
12096
12097         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12098         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12099
12100 fi
12101
12102 cf_add_libs="$cf_pkgconfig_libs"
12103 # Filter out duplicates - this happens with badly-designed ".pc" files...
12104 for cf_add_1lib in $LIBS
12105 do
12106         for cf_add_2lib in $cf_add_libs
12107         do
12108                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12109                 then
12110                         cf_add_1lib=
12111                         break
12112                 fi
12113         done
12114         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12115 done
12116 LIBS="$cf_add_libs"
12117
12118         :
12119 else
12120         cf_pkgconfig_incs=
12121         cf_pkgconfig_libs=
12122         { echo "$as_me:12122: WARNING: unable to find SM library" >&5
12123 echo "$as_me: WARNING: unable to find SM library" >&2;}
12124 fi
12125
12126 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12127         test -n "$verbose" && echo "    found package xt" 1>&6
12128
12129 echo "${as_me:-configure}:12129: testing found package xt ..." 1>&5
12130
12131         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12132         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12133         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12134
12135 echo "${as_me:-configure}:12135: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12136
12137         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12138
12139 echo "${as_me:-configure}:12139: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12140
12141 cf_fix_cppflags=no
12142 cf_new_cflags=
12143 cf_new_cppflags=
12144 cf_new_extra_cppflags=
12145
12146 for cf_add_cflags in $cf_pkgconfig_incs
12147 do
12148 case $cf_fix_cppflags in
12149 (no)
12150         case $cf_add_cflags in
12151         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12152                 case $cf_add_cflags in
12153                 (-D*)
12154                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12155
12156                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12157                                 && test -z "${cf_tst_cflags}" \
12158                                 && cf_fix_cppflags=yes
12159
12160                         if test $cf_fix_cppflags = yes ; then
12161
12162         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12163         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12164
12165                                 continue
12166                         elif test "${cf_tst_cflags}" = "\"'" ; then
12167
12168         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12169         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12170
12171                                 continue
12172                         fi
12173                         ;;
12174                 esac
12175                 case "$CPPFLAGS" in
12176                 (*$cf_add_cflags)
12177                         ;;
12178                 (*)
12179                         case $cf_add_cflags in
12180                         (-D*)
12181                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12182
12183 CPPFLAGS=`echo "$CPPFLAGS" | \
12184         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12185                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12186
12187                                 ;;
12188                         esac
12189
12190         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12191         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12192
12193                         ;;
12194                 esac
12195                 ;;
12196         (*)
12197
12198         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12199         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12200
12201                 ;;
12202         esac
12203         ;;
12204 (yes)
12205
12206         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12207         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12208
12209         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12210
12211         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12212                 && test -z "${cf_tst_cflags}" \
12213                 && cf_fix_cppflags=no
12214         ;;
12215 esac
12216 done
12217
12218 if test -n "$cf_new_cflags" ; then
12219
12220         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12221         CFLAGS="${CFLAGS}$cf_new_cflags"
12222
12223 fi
12224
12225 if test -n "$cf_new_cppflags" ; then
12226
12227         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12228         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12229
12230 fi
12231
12232 if test -n "$cf_new_extra_cppflags" ; then
12233
12234         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12235         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12236
12237 fi
12238
12239 cf_add_libs="$cf_pkgconfig_libs"
12240 # Filter out duplicates - this happens with badly-designed ".pc" files...
12241 for cf_add_1lib in $LIBS
12242 do
12243         for cf_add_2lib in $cf_add_libs
12244         do
12245                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12246                 then
12247                         cf_add_1lib=
12248                         break
12249                 fi
12250         done
12251         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12252 done
12253 LIBS="$cf_add_libs"
12254
12255         :
12256 else
12257         cf_pkgconfig_incs=
12258         cf_pkgconfig_libs=
12259         { echo "$as_me:12259: WARNING: unable to find Xt library" >&5
12260 echo "$as_me: WARNING: unable to find Xt library" >&2;}
12261 fi
12262
12263 fi
12264
12265 cf_have_X_LIBS=no
12266
12267 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12268         test -n "$verbose" && echo "    found package xt" 1>&6
12269
12270 echo "${as_me:-configure}:12270: testing found package xt ..." 1>&5
12271
12272         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12273         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12274         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12275
12276 echo "${as_me:-configure}:12276: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12277
12278         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12279
12280 echo "${as_me:-configure}:12280: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12281
12282 cf_fix_cppflags=no
12283 cf_new_cflags=
12284 cf_new_cppflags=
12285 cf_new_extra_cppflags=
12286
12287 for cf_add_cflags in $cf_pkgconfig_incs
12288 do
12289 case $cf_fix_cppflags in
12290 (no)
12291         case $cf_add_cflags in
12292         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12293                 case $cf_add_cflags in
12294                 (-D*)
12295                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12296
12297                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12298                                 && test -z "${cf_tst_cflags}" \
12299                                 && cf_fix_cppflags=yes
12300
12301                         if test $cf_fix_cppflags = yes ; then
12302
12303         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12304         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12305
12306                                 continue
12307                         elif test "${cf_tst_cflags}" = "\"'" ; then
12308
12309         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12310         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12311
12312                                 continue
12313                         fi
12314                         ;;
12315                 esac
12316                 case "$CPPFLAGS" in
12317                 (*$cf_add_cflags)
12318                         ;;
12319                 (*)
12320                         case $cf_add_cflags in
12321                         (-D*)
12322                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12323
12324 CPPFLAGS=`echo "$CPPFLAGS" | \
12325         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12326                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12327
12328                                 ;;
12329                         esac
12330
12331         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12332         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12333
12334                         ;;
12335                 esac
12336                 ;;
12337         (*)
12338
12339         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12340         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12341
12342                 ;;
12343         esac
12344         ;;
12345 (yes)
12346
12347         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12348         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12349
12350         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12351
12352         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12353                 && test -z "${cf_tst_cflags}" \
12354                 && cf_fix_cppflags=no
12355         ;;
12356 esac
12357 done
12358
12359 if test -n "$cf_new_cflags" ; then
12360
12361         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12362         CFLAGS="${CFLAGS}$cf_new_cflags"
12363
12364 fi
12365
12366 if test -n "$cf_new_cppflags" ; then
12367
12368         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12369         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12370
12371 fi
12372
12373 if test -n "$cf_new_extra_cppflags" ; then
12374
12375         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12376         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12377
12378 fi
12379
12380 cf_add_libs="$cf_pkgconfig_libs"
12381 # Filter out duplicates - this happens with badly-designed ".pc" files...
12382 for cf_add_1lib in $LIBS
12383 do
12384         for cf_add_2lib in $cf_add_libs
12385         do
12386                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12387                 then
12388                         cf_add_1lib=
12389                         break
12390                 fi
12391         done
12392         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12393 done
12394 LIBS="$cf_add_libs"
12395
12396         case "x$LIBS" in
12397         (*-lX11*)
12398                 ;;
12399         (*)
12400 # we have an "xt" package, but it may omit Xt's dependency on X11
12401 echo "$as_me:12401: checking for usable X dependency" >&5
12402 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
12403 if test "${cf_cv_xt_x11_compat+set}" = set; then
12404   echo $ECHO_N "(cached) $ECHO_C" >&6
12405 else
12406
12407 cat >conftest.$ac_ext <<_ACEOF
12408 #line 12408 "configure"
12409 #include "confdefs.h"
12410
12411 #include <X11/Xlib.h>
12412
12413 int
12414 main (void)
12415 {
12416
12417         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12418         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12419         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12420         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12421
12422   ;
12423   return 0;
12424 }
12425 _ACEOF
12426 rm -f conftest.$ac_objext conftest$ac_exeext
12427 if { (eval echo "$as_me:12427: \"$ac_link\"") >&5
12428   (eval $ac_link) 2>&5
12429   ac_status=$?
12430   echo "$as_me:12430: \$? = $ac_status" >&5
12431   (exit $ac_status); } &&
12432          { ac_try='test -s conftest$ac_exeext'
12433   { (eval echo "$as_me:12433: \"$ac_try\"") >&5
12434   (eval $ac_try) 2>&5
12435   ac_status=$?
12436   echo "$as_me:12436: \$? = $ac_status" >&5
12437   (exit $ac_status); }; }; then
12438   cf_cv_xt_x11_compat=yes
12439 else
12440   echo "$as_me: failed program was:" >&5
12441 cat conftest.$ac_ext >&5
12442 cf_cv_xt_x11_compat=no
12443 fi
12444 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12445 fi
12446 echo "$as_me:12446: result: $cf_cv_xt_x11_compat" >&5
12447 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12448                 if test "$cf_cv_xt_x11_compat" = no
12449                 then
12450                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12451
12452 echo "${as_me:-configure}:12452: testing work around broken X11 dependency ..." 1>&5
12453
12454                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12455
12456 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12457         test -n "$verbose" && echo "    found package x11" 1>&6
12458
12459 echo "${as_me:-configure}:12459: testing found package x11 ..." 1>&5
12460
12461         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12462         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12463         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12464
12465 echo "${as_me:-configure}:12465: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12466
12467         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12468
12469 echo "${as_me:-configure}:12469: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12470
12471 cf_fix_cppflags=no
12472 cf_new_cflags=
12473 cf_new_cppflags=
12474 cf_new_extra_cppflags=
12475
12476 for cf_add_cflags in $cf_pkgconfig_incs
12477 do
12478 case $cf_fix_cppflags in
12479 (no)
12480         case $cf_add_cflags in
12481         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12482                 case $cf_add_cflags in
12483                 (-D*)
12484                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12485
12486                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12487                                 && test -z "${cf_tst_cflags}" \
12488                                 && cf_fix_cppflags=yes
12489
12490                         if test $cf_fix_cppflags = yes ; then
12491
12492         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12493         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12494
12495                                 continue
12496                         elif test "${cf_tst_cflags}" = "\"'" ; then
12497
12498         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12499         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12500
12501                                 continue
12502                         fi
12503                         ;;
12504                 esac
12505                 case "$CPPFLAGS" in
12506                 (*$cf_add_cflags)
12507                         ;;
12508                 (*)
12509                         case $cf_add_cflags in
12510                         (-D*)
12511                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12512
12513 CPPFLAGS=`echo "$CPPFLAGS" | \
12514         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12515                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12516
12517                                 ;;
12518                         esac
12519
12520         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12521         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12522
12523                         ;;
12524                 esac
12525                 ;;
12526         (*)
12527
12528         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12529         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12530
12531                 ;;
12532         esac
12533         ;;
12534 (yes)
12535
12536         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12537         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12538
12539         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12540
12541         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12542                 && test -z "${cf_tst_cflags}" \
12543                 && cf_fix_cppflags=no
12544         ;;
12545 esac
12546 done
12547
12548 if test -n "$cf_new_cflags" ; then
12549
12550         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12551         CFLAGS="${CFLAGS}$cf_new_cflags"
12552
12553 fi
12554
12555 if test -n "$cf_new_cppflags" ; then
12556
12557         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12558         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12559
12560 fi
12561
12562 if test -n "$cf_new_extra_cppflags" ; then
12563
12564         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12565         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12566
12567 fi
12568
12569 cf_add_libs="$cf_pkgconfig_libs"
12570 # Filter out duplicates - this happens with badly-designed ".pc" files...
12571 for cf_add_1lib in $LIBS
12572 do
12573         for cf_add_2lib in $cf_add_libs
12574         do
12575                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12576                 then
12577                         cf_add_1lib=
12578                         break
12579                 fi
12580         done
12581         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12582 done
12583 LIBS="$cf_add_libs"
12584
12585         :
12586 else
12587         cf_pkgconfig_incs=
12588         cf_pkgconfig_libs=
12589
12590 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12591
12592 echo "${as_me:-configure}:12592: testing ...before $LIBS ..." 1>&5
12593
12594 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12595 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12596
12597 echo "${as_me:-configure}:12597: testing ...after  $LIBS ..." 1>&5
12598
12599 fi
12600
12601                 fi
12602                 ;;
12603         esac
12604
12605 echo "$as_me:12605: checking for usable X Toolkit package" >&5
12606 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12607 if test "${cf_cv_xt_ice_compat+set}" = set; then
12608   echo $ECHO_N "(cached) $ECHO_C" >&6
12609 else
12610
12611 cat >conftest.$ac_ext <<_ACEOF
12612 #line 12612 "configure"
12613 #include "confdefs.h"
12614
12615 #include <X11/Shell.h>
12616
12617 int
12618 main (void)
12619 {
12620 int num = IceConnectionNumber(0)
12621
12622   ;
12623   return 0;
12624 }
12625 _ACEOF
12626 rm -f conftest.$ac_objext conftest$ac_exeext
12627 if { (eval echo "$as_me:12627: \"$ac_link\"") >&5
12628   (eval $ac_link) 2>&5
12629   ac_status=$?
12630   echo "$as_me:12630: \$? = $ac_status" >&5
12631   (exit $ac_status); } &&
12632          { ac_try='test -s conftest$ac_exeext'
12633   { (eval echo "$as_me:12633: \"$ac_try\"") >&5
12634   (eval $ac_try) 2>&5
12635   ac_status=$?
12636   echo "$as_me:12636: \$? = $ac_status" >&5
12637   (exit $ac_status); }; }; then
12638   cf_cv_xt_ice_compat=yes
12639 else
12640   echo "$as_me: failed program was:" >&5
12641 cat conftest.$ac_ext >&5
12642 cf_cv_xt_ice_compat=no
12643 fi
12644 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12645 fi
12646 echo "$as_me:12646: result: $cf_cv_xt_ice_compat" >&5
12647 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12648
12649         if test "$cf_cv_xt_ice_compat" = no
12650         then
12651                 # workaround for broken ".pc" files used for X Toolkit.
12652                 case "x$X_PRE_LIBS" in
12653                 (*-lICE*)
12654                         case "x$LIBS" in
12655                         (*-lICE*)
12656                                 ;;
12657                         (*)
12658                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12659
12660 echo "${as_me:-configure}:12660: testing work around broken ICE dependency ..." 1>&5
12661
12662 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12663         test -n "$verbose" && echo "    found package ice" 1>&6
12664
12665 echo "${as_me:-configure}:12665: testing found package ice ..." 1>&5
12666
12667         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12668         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12669         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12670
12671 echo "${as_me:-configure}:12671: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12672
12673         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12674
12675 echo "${as_me:-configure}:12675: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12676
12677 cf_fix_cppflags=no
12678 cf_new_cflags=
12679 cf_new_cppflags=
12680 cf_new_extra_cppflags=
12681
12682 for cf_add_cflags in $cf_pkgconfig_incs
12683 do
12684 case $cf_fix_cppflags in
12685 (no)
12686         case $cf_add_cflags in
12687         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12688                 case $cf_add_cflags in
12689                 (-D*)
12690                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12691
12692                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12693                                 && test -z "${cf_tst_cflags}" \
12694                                 && cf_fix_cppflags=yes
12695
12696                         if test $cf_fix_cppflags = yes ; then
12697
12698         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12699         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12700
12701                                 continue
12702                         elif test "${cf_tst_cflags}" = "\"'" ; then
12703
12704         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12705         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12706
12707                                 continue
12708                         fi
12709                         ;;
12710                 esac
12711                 case "$CPPFLAGS" in
12712                 (*$cf_add_cflags)
12713                         ;;
12714                 (*)
12715                         case $cf_add_cflags in
12716                         (-D*)
12717                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12718
12719 CPPFLAGS=`echo "$CPPFLAGS" | \
12720         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12721                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12722
12723                                 ;;
12724                         esac
12725
12726         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12727         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12728
12729                         ;;
12730                 esac
12731                 ;;
12732         (*)
12733
12734         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12735         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12736
12737                 ;;
12738         esac
12739         ;;
12740 (yes)
12741
12742         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12743         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12744
12745         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12746
12747         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12748                 && test -z "${cf_tst_cflags}" \
12749                 && cf_fix_cppflags=no
12750         ;;
12751 esac
12752 done
12753
12754 if test -n "$cf_new_cflags" ; then
12755
12756         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12757         CFLAGS="${CFLAGS}$cf_new_cflags"
12758
12759 fi
12760
12761 if test -n "$cf_new_cppflags" ; then
12762
12763         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12764         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12765
12766 fi
12767
12768 if test -n "$cf_new_extra_cppflags" ; then
12769
12770         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12771         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12772
12773 fi
12774
12775 cf_add_libs="$cf_pkgconfig_libs"
12776 # Filter out duplicates - this happens with badly-designed ".pc" files...
12777 for cf_add_1lib in $LIBS
12778 do
12779         for cf_add_2lib in $cf_add_libs
12780         do
12781                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12782                 then
12783                         cf_add_1lib=
12784                         break
12785                 fi
12786         done
12787         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12788 done
12789 LIBS="$cf_add_libs"
12790
12791 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12792         test -n "$verbose" && echo "    found package sm" 1>&6
12793
12794 echo "${as_me:-configure}:12794: testing found package sm ..." 1>&5
12795
12796         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12797         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12798         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12799
12800 echo "${as_me:-configure}:12800: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12801
12802         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12803
12804 echo "${as_me:-configure}:12804: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12805
12806 cf_fix_cppflags=no
12807 cf_new_cflags=
12808 cf_new_cppflags=
12809 cf_new_extra_cppflags=
12810
12811 for cf_add_cflags in $cf_pkgconfig_incs
12812 do
12813 case $cf_fix_cppflags in
12814 (no)
12815         case $cf_add_cflags in
12816         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12817                 case $cf_add_cflags in
12818                 (-D*)
12819                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12820
12821                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12822                                 && test -z "${cf_tst_cflags}" \
12823                                 && cf_fix_cppflags=yes
12824
12825                         if test $cf_fix_cppflags = yes ; then
12826
12827         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12828         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12829
12830                                 continue
12831                         elif test "${cf_tst_cflags}" = "\"'" ; then
12832
12833         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12834         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12835
12836                                 continue
12837                         fi
12838                         ;;
12839                 esac
12840                 case "$CPPFLAGS" in
12841                 (*$cf_add_cflags)
12842                         ;;
12843                 (*)
12844                         case $cf_add_cflags in
12845                         (-D*)
12846                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12847
12848 CPPFLAGS=`echo "$CPPFLAGS" | \
12849         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12850                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12851
12852                                 ;;
12853                         esac
12854
12855         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12856         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12857
12858                         ;;
12859                 esac
12860                 ;;
12861         (*)
12862
12863         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12864         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12865
12866                 ;;
12867         esac
12868         ;;
12869 (yes)
12870
12871         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12872         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12873
12874         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12875
12876         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12877                 && test -z "${cf_tst_cflags}" \
12878                 && cf_fix_cppflags=no
12879         ;;
12880 esac
12881 done
12882
12883 if test -n "$cf_new_cflags" ; then
12884
12885         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12886         CFLAGS="${CFLAGS}$cf_new_cflags"
12887
12888 fi
12889
12890 if test -n "$cf_new_cppflags" ; then
12891
12892         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12893         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12894
12895 fi
12896
12897 if test -n "$cf_new_extra_cppflags" ; then
12898
12899         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12900         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12901
12902 fi
12903
12904 cf_add_libs="$cf_pkgconfig_libs"
12905 # Filter out duplicates - this happens with badly-designed ".pc" files...
12906 for cf_add_1lib in $LIBS
12907 do
12908         for cf_add_2lib in $cf_add_libs
12909         do
12910                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12911                 then
12912                         cf_add_1lib=
12913                         break
12914                 fi
12915         done
12916         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12917 done
12918 LIBS="$cf_add_libs"
12919
12920         :
12921 else
12922         cf_pkgconfig_incs=
12923         cf_pkgconfig_libs=
12924         :
12925 fi
12926
12927 else
12928         cf_pkgconfig_incs=
12929         cf_pkgconfig_libs=
12930
12931 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12932
12933 echo "${as_me:-configure}:12933: testing ...before $LIBS ..." 1>&5
12934
12935 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12936 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12937
12938 echo "${as_me:-configure}:12938: testing ...after  $LIBS ..." 1>&5
12939
12940 fi
12941
12942                                 ;;
12943                         esac
12944                         ;;
12945                 esac
12946         fi
12947
12948         cf_have_X_LIBS=yes
12949
12950 else
12951         cf_pkgconfig_incs=
12952         cf_pkgconfig_libs=
12953
12954         LDFLAGS="$X_LIBS $LDFLAGS"
12955
12956 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12957
12958 echo "${as_me:-configure}:12958: testing checking additions to CFLAGS ..." 1>&5
12959
12960 cf_check_cflags="$CFLAGS"
12961 cf_check_cppflags="$CPPFLAGS"
12962
12963 cf_fix_cppflags=no
12964 cf_new_cflags=
12965 cf_new_cppflags=
12966 cf_new_extra_cppflags=
12967
12968 for cf_add_cflags in $X_CFLAGS
12969 do
12970 case $cf_fix_cppflags in
12971 (no)
12972         case $cf_add_cflags in
12973         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12974                 case $cf_add_cflags in
12975                 (-D*)
12976                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12977
12978                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12979                                 && test -z "${cf_tst_cflags}" \
12980                                 && cf_fix_cppflags=yes
12981
12982                         if test $cf_fix_cppflags = yes ; then
12983
12984         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12985         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12986
12987                                 continue
12988                         elif test "${cf_tst_cflags}" = "\"'" ; then
12989
12990         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12991         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12992
12993                                 continue
12994                         fi
12995                         ;;
12996                 esac
12997                 case "$CPPFLAGS" in
12998                 (*$cf_add_cflags)
12999                         ;;
13000                 (*)
13001                         case $cf_add_cflags in
13002                         (-D*)
13003                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13004
13005 CPPFLAGS=`echo "$CPPFLAGS" | \
13006         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13007                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13008
13009                                 ;;
13010                         esac
13011
13012         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13013         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13014
13015                         ;;
13016                 esac
13017                 ;;
13018         (*)
13019
13020         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13021         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13022
13023                 ;;
13024         esac
13025         ;;
13026 (yes)
13027
13028         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13029         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13030
13031         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13032
13033         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13034                 && test -z "${cf_tst_cflags}" \
13035                 && cf_fix_cppflags=no
13036         ;;
13037 esac
13038 done
13039
13040 if test -n "$cf_new_cflags" ; then
13041         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13042
13043 echo "${as_me:-configure}:13043: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13044
13045         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13046         CFLAGS="${CFLAGS}$cf_new_cflags"
13047
13048 fi
13049
13050 if test -n "$cf_new_cppflags" ; then
13051         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13052
13053 echo "${as_me:-configure}:13053: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13054
13055         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13056         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13057
13058 fi
13059
13060 if test -n "$cf_new_extra_cppflags" ; then
13061         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13062
13063 echo "${as_me:-configure}:13063: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13064
13065         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13066         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13067
13068 fi
13069
13070 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13071 cat >conftest.$ac_ext <<_ACEOF
13072 #line 13072 "configure"
13073 #include "confdefs.h"
13074 #include <stdio.h>
13075 int
13076 main (void)
13077 {
13078 printf("Hello world");
13079   ;
13080   return 0;
13081 }
13082 _ACEOF
13083 rm -f conftest.$ac_objext conftest$ac_exeext
13084 if { (eval echo "$as_me:13084: \"$ac_link\"") >&5
13085   (eval $ac_link) 2>&5
13086   ac_status=$?
13087   echo "$as_me:13087: \$? = $ac_status" >&5
13088   (exit $ac_status); } &&
13089          { ac_try='test -s conftest$ac_exeext'
13090   { (eval echo "$as_me:13090: \"$ac_try\"") >&5
13091   (eval $ac_try) 2>&5
13092   ac_status=$?
13093   echo "$as_me:13093: \$? = $ac_status" >&5
13094   (exit $ac_status); }; }; then
13095   :
13096 else
13097   echo "$as_me: failed program was:" >&5
13098 cat conftest.$ac_ext >&5
13099 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13100
13101 echo "${as_me:-configure}:13101: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13102
13103          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13104                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13105
13106 echo "${as_me:-configure}:13106: testing but keeping change to \$CPPFLAGS ..." 1>&5
13107
13108          fi
13109          CFLAGS="$cf_check_flags"
13110 fi
13111 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13112 fi
13113
13114         echo "$as_me:13114: checking for XOpenDisplay" >&5
13115 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
13116 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
13117   echo $ECHO_N "(cached) $ECHO_C" >&6
13118 else
13119   cat >conftest.$ac_ext <<_ACEOF
13120 #line 13120 "configure"
13121 #include "confdefs.h"
13122 /* System header to define __stub macros and hopefully few prototypes,
13123     which can conflict with char XOpenDisplay (); below.  */
13124 #include <assert.h>
13125 /* Override any gcc2 internal prototype to avoid an error.  */
13126 #ifdef __cplusplus
13127 extern "C"
13128 #endif
13129 /* We use char because int might match the return type of a gcc2
13130    builtin and then its argument prototype would still apply.  */
13131 char XOpenDisplay ();
13132 char (*f) ();
13133
13134 int
13135 main (void)
13136 {
13137 /* The GNU C library defines this for functions which it implements
13138     to always fail with ENOSYS.  Some functions are actually named
13139     something starting with __ and the normal name is an alias.  */
13140 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
13141 choke me
13142 #else
13143 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13144 #endif
13145
13146   ;
13147   return 0;
13148 }
13149 _ACEOF
13150 rm -f conftest.$ac_objext conftest$ac_exeext
13151 if { (eval echo "$as_me:13151: \"$ac_link\"") >&5
13152   (eval $ac_link) 2>&5
13153   ac_status=$?
13154   echo "$as_me:13154: \$? = $ac_status" >&5
13155   (exit $ac_status); } &&
13156          { ac_try='test -s conftest$ac_exeext'
13157   { (eval echo "$as_me:13157: \"$ac_try\"") >&5
13158   (eval $ac_try) 2>&5
13159   ac_status=$?
13160   echo "$as_me:13160: \$? = $ac_status" >&5
13161   (exit $ac_status); }; }; then
13162   ac_cv_func_XOpenDisplay=yes
13163 else
13164   echo "$as_me: failed program was:" >&5
13165 cat conftest.$ac_ext >&5
13166 ac_cv_func_XOpenDisplay=no
13167 fi
13168 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13169 fi
13170 echo "$as_me:13170: result: $ac_cv_func_XOpenDisplay" >&5
13171 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
13172 if test $ac_cv_func_XOpenDisplay = yes; then
13173   :
13174 else
13175
13176         echo "$as_me:13176: checking for XOpenDisplay in -lX11" >&5
13177 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13178 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13179   echo $ECHO_N "(cached) $ECHO_C" >&6
13180 else
13181   ac_check_lib_save_LIBS=$LIBS
13182 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13183 cat >conftest.$ac_ext <<_ACEOF
13184 #line 13184 "configure"
13185 #include "confdefs.h"
13186
13187 /* Override any gcc2 internal prototype to avoid an error.  */
13188 #ifdef __cplusplus
13189 extern "C"
13190 #endif
13191 /* We use char because int might match the return type of a gcc2
13192    builtin and then its argument prototype would still apply.  */
13193 char XOpenDisplay ();
13194 int
13195 main (void)
13196 {
13197 XOpenDisplay ();
13198   ;
13199   return 0;
13200 }
13201 _ACEOF
13202 rm -f conftest.$ac_objext conftest$ac_exeext
13203 if { (eval echo "$as_me:13203: \"$ac_link\"") >&5
13204   (eval $ac_link) 2>&5
13205   ac_status=$?
13206   echo "$as_me:13206: \$? = $ac_status" >&5
13207   (exit $ac_status); } &&
13208          { ac_try='test -s conftest$ac_exeext'
13209   { (eval echo "$as_me:13209: \"$ac_try\"") >&5
13210   (eval $ac_try) 2>&5
13211   ac_status=$?
13212   echo "$as_me:13212: \$? = $ac_status" >&5
13213   (exit $ac_status); }; }; then
13214   ac_cv_lib_X11_XOpenDisplay=yes
13215 else
13216   echo "$as_me: failed program was:" >&5
13217 cat conftest.$ac_ext >&5
13218 ac_cv_lib_X11_XOpenDisplay=no
13219 fi
13220 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13221 LIBS=$ac_check_lib_save_LIBS
13222 fi
13223 echo "$as_me:13223: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13224 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13225 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13226
13227 cf_add_libs="-lX11"
13228 # Filter out duplicates - this happens with badly-designed ".pc" files...
13229 for cf_add_1lib in $LIBS
13230 do
13231         for cf_add_2lib in $cf_add_libs
13232         do
13233                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13234                 then
13235                         cf_add_1lib=
13236                         break
13237                 fi
13238         done
13239         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13240 done
13241 LIBS="$cf_add_libs"
13242
13243 fi
13244
13245 fi
13246
13247         echo "$as_me:13247: checking for XtAppInitialize" >&5
13248 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
13249 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
13250   echo $ECHO_N "(cached) $ECHO_C" >&6
13251 else
13252   cat >conftest.$ac_ext <<_ACEOF
13253 #line 13253 "configure"
13254 #include "confdefs.h"
13255 /* System header to define __stub macros and hopefully few prototypes,
13256     which can conflict with char XtAppInitialize (); below.  */
13257 #include <assert.h>
13258 /* Override any gcc2 internal prototype to avoid an error.  */
13259 #ifdef __cplusplus
13260 extern "C"
13261 #endif
13262 /* We use char because int might match the return type of a gcc2
13263    builtin and then its argument prototype would still apply.  */
13264 char XtAppInitialize ();
13265 char (*f) ();
13266
13267 int
13268 main (void)
13269 {
13270 /* The GNU C library defines this for functions which it implements
13271     to always fail with ENOSYS.  Some functions are actually named
13272     something starting with __ and the normal name is an alias.  */
13273 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
13274 choke me
13275 #else
13276 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13277 #endif
13278
13279   ;
13280   return 0;
13281 }
13282 _ACEOF
13283 rm -f conftest.$ac_objext conftest$ac_exeext
13284 if { (eval echo "$as_me:13284: \"$ac_link\"") >&5
13285   (eval $ac_link) 2>&5
13286   ac_status=$?
13287   echo "$as_me:13287: \$? = $ac_status" >&5
13288   (exit $ac_status); } &&
13289          { ac_try='test -s conftest$ac_exeext'
13290   { (eval echo "$as_me:13290: \"$ac_try\"") >&5
13291   (eval $ac_try) 2>&5
13292   ac_status=$?
13293   echo "$as_me:13293: \$? = $ac_status" >&5
13294   (exit $ac_status); }; }; then
13295   ac_cv_func_XtAppInitialize=yes
13296 else
13297   echo "$as_me: failed program was:" >&5
13298 cat conftest.$ac_ext >&5
13299 ac_cv_func_XtAppInitialize=no
13300 fi
13301 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13302 fi
13303 echo "$as_me:13303: result: $ac_cv_func_XtAppInitialize" >&5
13304 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
13305 if test $ac_cv_func_XtAppInitialize = yes; then
13306   :
13307 else
13308
13309         echo "$as_me:13309: checking for XtAppInitialize in -lXt" >&5
13310 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
13311 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
13312   echo $ECHO_N "(cached) $ECHO_C" >&6
13313 else
13314   ac_check_lib_save_LIBS=$LIBS
13315 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13316 cat >conftest.$ac_ext <<_ACEOF
13317 #line 13317 "configure"
13318 #include "confdefs.h"
13319
13320 /* Override any gcc2 internal prototype to avoid an error.  */
13321 #ifdef __cplusplus
13322 extern "C"
13323 #endif
13324 /* We use char because int might match the return type of a gcc2
13325    builtin and then its argument prototype would still apply.  */
13326 char XtAppInitialize ();
13327 int
13328 main (void)
13329 {
13330 XtAppInitialize ();
13331   ;
13332   return 0;
13333 }
13334 _ACEOF
13335 rm -f conftest.$ac_objext conftest$ac_exeext
13336 if { (eval echo "$as_me:13336: \"$ac_link\"") >&5
13337   (eval $ac_link) 2>&5
13338   ac_status=$?
13339   echo "$as_me:13339: \$? = $ac_status" >&5
13340   (exit $ac_status); } &&
13341          { ac_try='test -s conftest$ac_exeext'
13342   { (eval echo "$as_me:13342: \"$ac_try\"") >&5
13343   (eval $ac_try) 2>&5
13344   ac_status=$?
13345   echo "$as_me:13345: \$? = $ac_status" >&5
13346   (exit $ac_status); }; }; then
13347   ac_cv_lib_Xt_XtAppInitialize=yes
13348 else
13349   echo "$as_me: failed program was:" >&5
13350 cat conftest.$ac_ext >&5
13351 ac_cv_lib_Xt_XtAppInitialize=no
13352 fi
13353 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13354 LIBS=$ac_check_lib_save_LIBS
13355 fi
13356 echo "$as_me:13356: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
13357 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
13358 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
13359
13360 cat >>confdefs.h <<\EOF
13361 #define HAVE_LIBXT 1
13362 EOF
13363
13364                  cf_have_X_LIBS=Xt
13365                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13366 fi
13367
13368 fi
13369
13370 fi
13371
13372 if test $cf_have_X_LIBS = no ; then
13373         { echo "$as_me:13373: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13374 test program.  You will have to check and add the proper libraries by hand
13375 to makefile." >&5
13376 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13377 test program.  You will have to check and add the proper libraries by hand
13378 to makefile." >&2;}
13379 fi
13380
13381 cf_x_athena_root=$cf_x_athena
13382 cf_x_athena_inc=""
13383
13384 for cf_path in default \
13385         /usr/contrib/X11R6 \
13386         /usr/contrib/X11R5 \
13387         /usr/lib/X11R5 \
13388         /usr/local
13389 do
13390         if test -z "$cf_x_athena_inc" ; then
13391                 cf_save="$CPPFLAGS"
13392                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
13393                 if test $cf_path != default ; then
13394                         CPPFLAGS="$cf_save -I$cf_path/include"
13395                         echo "$as_me:13395: checking for $cf_test in $cf_path" >&5
13396 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
13397                 else
13398                         echo "$as_me:13398: checking for $cf_test" >&5
13399 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
13400                 fi
13401                 cat >conftest.$ac_ext <<_ACEOF
13402 #line 13402 "configure"
13403 #include "confdefs.h"
13404
13405 #include <X11/Intrinsic.h>
13406 #include <$cf_test>
13407 int
13408 main (void)
13409 {
13410
13411   ;
13412   return 0;
13413 }
13414 _ACEOF
13415 rm -f conftest.$ac_objext
13416 if { (eval echo "$as_me:13416: \"$ac_compile\"") >&5
13417   (eval $ac_compile) 2>&5
13418   ac_status=$?
13419   echo "$as_me:13419: \$? = $ac_status" >&5
13420   (exit $ac_status); } &&
13421          { ac_try='test -s conftest.$ac_objext'
13422   { (eval echo "$as_me:13422: \"$ac_try\"") >&5
13423   (eval $ac_try) 2>&5
13424   ac_status=$?
13425   echo "$as_me:13425: \$? = $ac_status" >&5
13426   (exit $ac_status); }; }; then
13427   cf_result=yes
13428 else
13429   echo "$as_me: failed program was:" >&5
13430 cat conftest.$ac_ext >&5
13431 cf_result=no
13432 fi
13433 rm -f conftest.$ac_objext conftest.$ac_ext
13434                 echo "$as_me:13434: result: $cf_result" >&5
13435 echo "${ECHO_T}$cf_result" >&6
13436                 if test "$cf_result" = yes ; then
13437                         cf_x_athena_inc=$cf_path
13438                         break
13439                 else
13440                         CPPFLAGS="$cf_save"
13441                 fi
13442         fi
13443 done
13444
13445 if test -z "$cf_x_athena_inc" ; then
13446         { echo "$as_me:13446: WARNING: Unable to successfully find Athena header files with test program" >&5
13447 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
13448 elif test "$cf_x_athena_inc" != default ; then
13449         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
13450 fi
13451
13452 cf_x_athena_root=$cf_x_athena
13453 cf_x_athena_lib=""
13454
13455 for cf_path in default \
13456         /usr/contrib/X11R6 \
13457         /usr/contrib/X11R5 \
13458         /usr/lib/X11R5 \
13459         /usr/local
13460 do
13461         for cf_lib in \
13462                 ${cf_x_athena_root} \
13463                 ${cf_x_athena_root}7 \
13464                 ${cf_x_athena_root}6
13465         do
13466         for cf_libs in \
13467                 "-l$cf_lib -lXmu" \
13468                 "-l$cf_lib -lXpm -lXmu" \
13469                 "-l${cf_lib}_s -lXmu_s"
13470         do
13471                 if test -z "$cf_x_athena_lib" ; then
13472                         cf_save="$LIBS"
13473                         cf_test=XawSimpleMenuAddGlobalActions
13474                         if test $cf_path != default ; then
13475
13476 cf_add_libs="-L$cf_path/lib $cf_libs"
13477 # Filter out duplicates - this happens with badly-designed ".pc" files...
13478 for cf_add_1lib in $LIBS
13479 do
13480         for cf_add_2lib in $cf_add_libs
13481         do
13482                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13483                 then
13484                         cf_add_1lib=
13485                         break
13486                 fi
13487         done
13488         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13489 done
13490 LIBS="$cf_add_libs"
13491
13492                                 echo "$as_me:13492: checking for $cf_libs in $cf_path" >&5
13493 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13494                         else
13495
13496 cf_add_libs="$cf_libs"
13497 # Filter out duplicates - this happens with badly-designed ".pc" files...
13498 for cf_add_1lib in $LIBS
13499 do
13500         for cf_add_2lib in $cf_add_libs
13501         do
13502                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13503                 then
13504                         cf_add_1lib=
13505                         break
13506                 fi
13507         done
13508         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13509 done
13510 LIBS="$cf_add_libs"
13511
13512                                 echo "$as_me:13512: checking for $cf_test in $cf_libs" >&5
13513 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13514                         fi
13515                         cat >conftest.$ac_ext <<_ACEOF
13516 #line 13516 "configure"
13517 #include "confdefs.h"
13518
13519 #include <X11/Intrinsic.h>
13520 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13521
13522 int
13523 main (void)
13524 {
13525
13526 $cf_test((XtAppContext) 0)
13527   ;
13528   return 0;
13529 }
13530 _ACEOF
13531 rm -f conftest.$ac_objext conftest$ac_exeext
13532 if { (eval echo "$as_me:13532: \"$ac_link\"") >&5
13533   (eval $ac_link) 2>&5
13534   ac_status=$?
13535   echo "$as_me:13535: \$? = $ac_status" >&5
13536   (exit $ac_status); } &&
13537          { ac_try='test -s conftest$ac_exeext'
13538   { (eval echo "$as_me:13538: \"$ac_try\"") >&5
13539   (eval $ac_try) 2>&5
13540   ac_status=$?
13541   echo "$as_me:13541: \$? = $ac_status" >&5
13542   (exit $ac_status); }; }; then
13543   cf_result=yes
13544 else
13545   echo "$as_me: failed program was:" >&5
13546 cat conftest.$ac_ext >&5
13547 cf_result=no
13548 fi
13549 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13550                         echo "$as_me:13550: result: $cf_result" >&5
13551 echo "${ECHO_T}$cf_result" >&6
13552                         if test "$cf_result" = yes ; then
13553                                 cf_x_athena_lib="$cf_libs"
13554                                 break
13555                         fi
13556                         LIBS="$cf_save"
13557                 fi
13558         done # cf_libs
13559                 test -n "$cf_x_athena_lib" && break
13560         done # cf_lib
13561 done
13562
13563 if test -z "$cf_x_athena_lib" ; then
13564         { { echo "$as_me:13564: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13565 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13566    { (exit 1); exit 1; }; }
13567 fi
13568
13569 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13570
13571 cat >>confdefs.h <<EOF
13572 #define $cf_x_athena_LIBS 1
13573 EOF
13574
13575 fi
13576
13577 if test -n "$ac_tool_prefix"; then
13578   for ac_prog in xcurses-config
13579   do
13580     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13581 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13582 echo "$as_me:13582: checking for $ac_word" >&5
13583 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13584 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13585   echo $ECHO_N "(cached) $ECHO_C" >&6
13586 else
13587   if test -n "$XCURSES_CONFIG"; then
13588   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13589 else
13590   ac_save_IFS=$IFS; IFS=$ac_path_separator
13591 ac_dummy="$PATH"
13592 for ac_dir in $ac_dummy; do
13593   IFS=$ac_save_IFS
13594   test -z "$ac_dir" && ac_dir=.
13595   $as_executable_p "$ac_dir/$ac_word" || continue
13596 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13597 echo "$as_me:13597: found $ac_dir/$ac_word" >&5
13598 break
13599 done
13600
13601 fi
13602 fi
13603 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13604 if test -n "$XCURSES_CONFIG"; then
13605   echo "$as_me:13605: result: $XCURSES_CONFIG" >&5
13606 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13607 else
13608   echo "$as_me:13608: result: no" >&5
13609 echo "${ECHO_T}no" >&6
13610 fi
13611
13612     test -n "$XCURSES_CONFIG" && break
13613   done
13614 fi
13615 if test -z "$XCURSES_CONFIG"; then
13616   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13617   for ac_prog in xcurses-config
13618 do
13619   # Extract the first word of "$ac_prog", so it can be a program name with args.
13620 set dummy $ac_prog; ac_word=$2
13621 echo "$as_me:13621: checking for $ac_word" >&5
13622 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13623 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13624   echo $ECHO_N "(cached) $ECHO_C" >&6
13625 else
13626   if test -n "$ac_ct_XCURSES_CONFIG"; then
13627   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13628 else
13629   ac_save_IFS=$IFS; IFS=$ac_path_separator
13630 ac_dummy="$PATH"
13631 for ac_dir in $ac_dummy; do
13632   IFS=$ac_save_IFS
13633   test -z "$ac_dir" && ac_dir=.
13634   $as_executable_p "$ac_dir/$ac_word" || continue
13635 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13636 echo "$as_me:13636: found $ac_dir/$ac_word" >&5
13637 break
13638 done
13639
13640 fi
13641 fi
13642 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13643 if test -n "$ac_ct_XCURSES_CONFIG"; then
13644   echo "$as_me:13644: result: $ac_ct_XCURSES_CONFIG" >&5
13645 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13646 else
13647   echo "$as_me:13647: result: no" >&5
13648 echo "${ECHO_T}no" >&6
13649 fi
13650
13651   test -n "$ac_ct_XCURSES_CONFIG" && break
13652 done
13653 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13654
13655   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13656 fi
13657
13658 if test "$XCURSES_CONFIG" != none ; then
13659
13660 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13661
13662 cf_add_libs="`$XCURSES_CONFIG --libs`"
13663 # Filter out duplicates - this happens with badly-designed ".pc" files...
13664 for cf_add_1lib in $LIBS
13665 do
13666         for cf_add_2lib in $cf_add_libs
13667         do
13668                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13669                 then
13670                         cf_add_1lib=
13671                         break
13672                 fi
13673         done
13674         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13675 done
13676 LIBS="$cf_add_libs"
13677
13678 cf_cv_lib_XCurses=yes
13679
13680 else
13681
13682 LDFLAGS="$LDFLAGS $X_LIBS"
13683
13684 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13685
13686 echo "${as_me:-configure}:13686: testing checking additions to CFLAGS ..." 1>&5
13687
13688 cf_check_cflags="$CFLAGS"
13689 cf_check_cppflags="$CPPFLAGS"
13690
13691 cf_fix_cppflags=no
13692 cf_new_cflags=
13693 cf_new_cppflags=
13694 cf_new_extra_cppflags=
13695
13696 for cf_add_cflags in $X_CFLAGS
13697 do
13698 case $cf_fix_cppflags in
13699 (no)
13700         case $cf_add_cflags in
13701         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13702                 case $cf_add_cflags in
13703                 (-D*)
13704                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13705
13706                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13707                                 && test -z "${cf_tst_cflags}" \
13708                                 && cf_fix_cppflags=yes
13709
13710                         if test $cf_fix_cppflags = yes ; then
13711
13712         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13713         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13714
13715                                 continue
13716                         elif test "${cf_tst_cflags}" = "\"'" ; then
13717
13718         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13719         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13720
13721                                 continue
13722                         fi
13723                         ;;
13724                 esac
13725                 case "$CPPFLAGS" in
13726                 (*$cf_add_cflags)
13727                         ;;
13728                 (*)
13729                         case $cf_add_cflags in
13730                         (-D*)
13731                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13732
13733 CPPFLAGS=`echo "$CPPFLAGS" | \
13734         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13735                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13736
13737                                 ;;
13738                         esac
13739
13740         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13741         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13742
13743                         ;;
13744                 esac
13745                 ;;
13746         (*)
13747
13748         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13749         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13750
13751                 ;;
13752         esac
13753         ;;
13754 (yes)
13755
13756         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13757         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13758
13759         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13760
13761         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13762                 && test -z "${cf_tst_cflags}" \
13763                 && cf_fix_cppflags=no
13764         ;;
13765 esac
13766 done
13767
13768 if test -n "$cf_new_cflags" ; then
13769         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13770
13771 echo "${as_me:-configure}:13771: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13772
13773         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13774         CFLAGS="${CFLAGS}$cf_new_cflags"
13775
13776 fi
13777
13778 if test -n "$cf_new_cppflags" ; then
13779         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13780
13781 echo "${as_me:-configure}:13781: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13782
13783         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13784         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13785
13786 fi
13787
13788 if test -n "$cf_new_extra_cppflags" ; then
13789         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13790
13791 echo "${as_me:-configure}:13791: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13792
13793         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13794         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13795
13796 fi
13797
13798 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13799 cat >conftest.$ac_ext <<_ACEOF
13800 #line 13800 "configure"
13801 #include "confdefs.h"
13802 #include <stdio.h>
13803 int
13804 main (void)
13805 {
13806 printf("Hello world");
13807   ;
13808   return 0;
13809 }
13810 _ACEOF
13811 rm -f conftest.$ac_objext conftest$ac_exeext
13812 if { (eval echo "$as_me:13812: \"$ac_link\"") >&5
13813   (eval $ac_link) 2>&5
13814   ac_status=$?
13815   echo "$as_me:13815: \$? = $ac_status" >&5
13816   (exit $ac_status); } &&
13817          { ac_try='test -s conftest$ac_exeext'
13818   { (eval echo "$as_me:13818: \"$ac_try\"") >&5
13819   (eval $ac_try) 2>&5
13820   ac_status=$?
13821   echo "$as_me:13821: \$? = $ac_status" >&5
13822   (exit $ac_status); }; }; then
13823   :
13824 else
13825   echo "$as_me: failed program was:" >&5
13826 cat conftest.$ac_ext >&5
13827 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13828
13829 echo "${as_me:-configure}:13829: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13830
13831          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13832                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13833
13834 echo "${as_me:-configure}:13834: testing but keeping change to \$CPPFLAGS ..." 1>&5
13835
13836          fi
13837          CFLAGS="$cf_check_flags"
13838 fi
13839 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13840 fi
13841
13842 echo "$as_me:13842: checking for XOpenDisplay in -lX11" >&5
13843 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13844 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13845   echo $ECHO_N "(cached) $ECHO_C" >&6
13846 else
13847   ac_check_lib_save_LIBS=$LIBS
13848 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13849 cat >conftest.$ac_ext <<_ACEOF
13850 #line 13850 "configure"
13851 #include "confdefs.h"
13852
13853 /* Override any gcc2 internal prototype to avoid an error.  */
13854 #ifdef __cplusplus
13855 extern "C"
13856 #endif
13857 /* We use char because int might match the return type of a gcc2
13858    builtin and then its argument prototype would still apply.  */
13859 char XOpenDisplay ();
13860 int
13861 main (void)
13862 {
13863 XOpenDisplay ();
13864   ;
13865   return 0;
13866 }
13867 _ACEOF
13868 rm -f conftest.$ac_objext conftest$ac_exeext
13869 if { (eval echo "$as_me:13869: \"$ac_link\"") >&5
13870   (eval $ac_link) 2>&5
13871   ac_status=$?
13872   echo "$as_me:13872: \$? = $ac_status" >&5
13873   (exit $ac_status); } &&
13874          { ac_try='test -s conftest$ac_exeext'
13875   { (eval echo "$as_me:13875: \"$ac_try\"") >&5
13876   (eval $ac_try) 2>&5
13877   ac_status=$?
13878   echo "$as_me:13878: \$? = $ac_status" >&5
13879   (exit $ac_status); }; }; then
13880   ac_cv_lib_X11_XOpenDisplay=yes
13881 else
13882   echo "$as_me: failed program was:" >&5
13883 cat conftest.$ac_ext >&5
13884 ac_cv_lib_X11_XOpenDisplay=no
13885 fi
13886 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13887 LIBS=$ac_check_lib_save_LIBS
13888 fi
13889 echo "$as_me:13889: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13890 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13891 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13892
13893 cf_add_libs="-lX11"
13894 # Filter out duplicates - this happens with badly-designed ".pc" files...
13895 for cf_add_1lib in $LIBS
13896 do
13897         for cf_add_2lib in $cf_add_libs
13898         do
13899                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13900                 then
13901                         cf_add_1lib=
13902                         break
13903                 fi
13904         done
13905         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13906 done
13907 LIBS="$cf_add_libs"
13908
13909 fi
13910
13911 echo "$as_me:13911: checking for XCurses library" >&5
13912 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13913 if test "${cf_cv_lib_XCurses+set}" = set; then
13914   echo $ECHO_N "(cached) $ECHO_C" >&6
13915 else
13916
13917 cf_add_libs="-lXCurses"
13918 # Filter out duplicates - this happens with badly-designed ".pc" files...
13919 for cf_add_1lib in $LIBS
13920 do
13921         for cf_add_2lib in $cf_add_libs
13922         do
13923                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13924                 then
13925                         cf_add_1lib=
13926                         break
13927                 fi
13928         done
13929         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13930 done
13931 LIBS="$cf_add_libs"
13932
13933 cat >conftest.$ac_ext <<_ACEOF
13934 #line 13934 "configure"
13935 #include "confdefs.h"
13936
13937 #include <xcurses.h>
13938 char *XCursesProgramName = "test";
13939
13940 int
13941 main (void)
13942 {
13943 XCursesExit();
13944   ;
13945   return 0;
13946 }
13947 _ACEOF
13948 rm -f conftest.$ac_objext conftest$ac_exeext
13949 if { (eval echo "$as_me:13949: \"$ac_link\"") >&5
13950   (eval $ac_link) 2>&5
13951   ac_status=$?
13952   echo "$as_me:13952: \$? = $ac_status" >&5
13953   (exit $ac_status); } &&
13954          { ac_try='test -s conftest$ac_exeext'
13955   { (eval echo "$as_me:13955: \"$ac_try\"") >&5
13956   (eval $ac_try) 2>&5
13957   ac_status=$?
13958   echo "$as_me:13958: \$? = $ac_status" >&5
13959   (exit $ac_status); }; }; then
13960   cf_cv_lib_XCurses=yes
13961 else
13962   echo "$as_me: failed program was:" >&5
13963 cat conftest.$ac_ext >&5
13964 cf_cv_lib_XCurses=no
13965 fi
13966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13967
13968 fi
13969 echo "$as_me:13969: result: $cf_cv_lib_XCurses" >&5
13970 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13971
13972 fi
13973
13974 if test $cf_cv_lib_XCurses = yes ; then
13975
13976 cat >>confdefs.h <<\EOF
13977 #define UNIX 1
13978 EOF
13979
13980 cat >>confdefs.h <<\EOF
13981 #define XCURSES 1
13982 EOF
13983
13984         echo "$as_me:13984: checking for xcurses.h" >&5
13985 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13986 if test "${ac_cv_header_xcurses_h+set}" = set; then
13987   echo $ECHO_N "(cached) $ECHO_C" >&6
13988 else
13989   cat >conftest.$ac_ext <<_ACEOF
13990 #line 13990 "configure"
13991 #include "confdefs.h"
13992 #include <xcurses.h>
13993 _ACEOF
13994 if { (eval echo "$as_me:13994: \"$ac_cpp conftest.$ac_ext\"") >&5
13995   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13996   ac_status=$?
13997   egrep -v '^ *\+' conftest.er1 >conftest.err
13998   rm -f conftest.er1
13999   cat conftest.err >&5
14000   echo "$as_me:14000: \$? = $ac_status" >&5
14001   (exit $ac_status); } >/dev/null; then
14002   if test -s conftest.err; then
14003     ac_cpp_err=$ac_c_preproc_warn_flag
14004   else
14005     ac_cpp_err=
14006   fi
14007 else
14008   ac_cpp_err=yes
14009 fi
14010 if test -z "$ac_cpp_err"; then
14011   ac_cv_header_xcurses_h=yes
14012 else
14013   echo "$as_me: failed program was:" >&5
14014   cat conftest.$ac_ext >&5
14015   ac_cv_header_xcurses_h=no
14016 fi
14017 rm -f conftest.err conftest.$ac_ext
14018 fi
14019 echo "$as_me:14019: result: $ac_cv_header_xcurses_h" >&5
14020 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
14021 if test $ac_cv_header_xcurses_h = yes; then
14022
14023 cat >>confdefs.h <<\EOF
14024 #define HAVE_XCURSES 1
14025 EOF
14026
14027 fi
14028
14029 else
14030         { { echo "$as_me:14030: error: Cannot link with XCurses" >&5
14031 echo "$as_me: error: Cannot link with XCurses" >&2;}
14032    { (exit 1); exit 1; }; }
14033 fi
14034
14035         ;;
14036 (*)
14037         { { echo "$as_me:14037: error: unexpected screen-value: $cf_cv_screen" >&5
14038 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
14039    { (exit 1); exit 1; }; }
14040         ;;
14041 esac
14042
14043 : ${cf_nculib_root:=$cf_cv_screen}
14044 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
14045 echo "$as_me:14045: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
14046 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
14047 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14048   echo $ECHO_N "(cached) $ECHO_C" >&6
14049 else
14050   ac_check_lib_save_LIBS=$LIBS
14051 LIBS="-l$cf_nculib_root  $LIBS"
14052 cat >conftest.$ac_ext <<_ACEOF
14053 #line 14053 "configure"
14054 #include "confdefs.h"
14055
14056 /* Override any gcc2 internal prototype to avoid an error.  */
14057 #ifdef __cplusplus
14058 extern "C"
14059 #endif
14060 /* We use char because int might match the return type of a gcc2
14061    builtin and then its argument prototype would still apply.  */
14062 char _nc_init_pthreads ();
14063 int
14064 main (void)
14065 {
14066 _nc_init_pthreads ();
14067   ;
14068   return 0;
14069 }
14070 _ACEOF
14071 rm -f conftest.$ac_objext conftest$ac_exeext
14072 if { (eval echo "$as_me:14072: \"$ac_link\"") >&5
14073   (eval $ac_link) 2>&5
14074   ac_status=$?
14075   echo "$as_me:14075: \$? = $ac_status" >&5
14076   (exit $ac_status); } &&
14077          { ac_try='test -s conftest$ac_exeext'
14078   { (eval echo "$as_me:14078: \"$ac_try\"") >&5
14079   (eval $ac_try) 2>&5
14080   ac_status=$?
14081   echo "$as_me:14081: \$? = $ac_status" >&5
14082   (exit $ac_status); }; }; then
14083   eval "$as_ac_Lib=yes"
14084 else
14085   echo "$as_me: failed program was:" >&5
14086 cat conftest.$ac_ext >&5
14087 eval "$as_ac_Lib=no"
14088 fi
14089 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14090 LIBS=$ac_check_lib_save_LIBS
14091 fi
14092 echo "$as_me:14092: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14093 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14094 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14095   cf_cv_ncurses_pthreads=yes
14096 else
14097   cf_cv_ncurses_pthreads=no
14098 fi
14099
14100 if test "$cf_cv_ncurses_pthreads" = yes
14101 then
14102
14103 cf_add_libs="-lpthread"
14104 # Filter out duplicates - this happens with badly-designed ".pc" files...
14105 for cf_add_1lib in $LIBS
14106 do
14107         for cf_add_2lib in $cf_add_libs
14108         do
14109                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14110                 then
14111                         cf_add_1lib=
14112                         break
14113                 fi
14114         done
14115         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14116 done
14117 LIBS="$cf_add_libs"
14118
14119 fi
14120
14121 case $cf_cv_screen in
14122 (ncurses*)
14123         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
14124         ;;
14125 esac
14126
14127 cf_curses_headers=
14128
14129 case $cf_cv_screen in
14130 (pdcurses)
14131         cf_default_panel=no
14132         cf_default_form=no
14133         cf_default_menu=no
14134         cf_default_tinfo=no
14135         ;;
14136 (xcurses|bsdcurses)
14137         cf_default_panel=no
14138         cf_default_form=no
14139         cf_default_menu=no
14140         cf_default_tinfo=yes
14141         ;;
14142 (*)
14143         cf_default_panel=yes
14144         cf_default_form=yes
14145         cf_default_menu=yes
14146         cf_default_tinfo=yes
14147         case $cf_cv_screen in
14148         (ncurses*)
14149                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
14150                 ;;
14151         esac
14152         ;;
14153 esac
14154
14155 echo "$as_me:14155: checking if you want to check for panel functions" >&5
14156 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
14157
14158 # Check whether --enable-panel or --disable-panel was given.
14159 if test "${enable_panel+set}" = set; then
14160   enableval="$enable_panel"
14161   test "$enableval" != no && enableval=yes
14162         if test "$enableval" != "yes" ; then
14163     cf_enable_panel=no
14164         else
14165                 cf_enable_panel=$cf_default_panel
14166         fi
14167 else
14168   enableval=yes
14169         cf_enable_panel=$cf_default_panel
14170
14171 fi;
14172 echo "$as_me:14172: result: $cf_enable_panel" >&5
14173 echo "${ECHO_T}$cf_enable_panel" >&6
14174 if test $cf_enable_panel = yes
14175 then
14176
14177 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
14178 echo "$as_me:14178: checking for new_panel in -lpanel$cf_cv_libtype" >&5
14179 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
14180 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14181   echo $ECHO_N "(cached) $ECHO_C" >&6
14182 else
14183   ac_check_lib_save_LIBS=$LIBS
14184 LIBS="-lpanel$cf_cv_libtype  $LIBS"
14185 cat >conftest.$ac_ext <<_ACEOF
14186 #line 14186 "configure"
14187 #include "confdefs.h"
14188
14189 /* Override any gcc2 internal prototype to avoid an error.  */
14190 #ifdef __cplusplus
14191 extern "C"
14192 #endif
14193 /* We use char because int might match the return type of a gcc2
14194    builtin and then its argument prototype would still apply.  */
14195 char new_panel ();
14196 int
14197 main (void)
14198 {
14199 new_panel ();
14200   ;
14201   return 0;
14202 }
14203 _ACEOF
14204 rm -f conftest.$ac_objext conftest$ac_exeext
14205 if { (eval echo "$as_me:14205: \"$ac_link\"") >&5
14206   (eval $ac_link) 2>&5
14207   ac_status=$?
14208   echo "$as_me:14208: \$? = $ac_status" >&5
14209   (exit $ac_status); } &&
14210          { ac_try='test -s conftest$ac_exeext'
14211   { (eval echo "$as_me:14211: \"$ac_try\"") >&5
14212   (eval $ac_try) 2>&5
14213   ac_status=$?
14214   echo "$as_me:14214: \$? = $ac_status" >&5
14215   (exit $ac_status); }; }; then
14216   eval "$as_ac_Lib=yes"
14217 else
14218   echo "$as_me: failed program was:" >&5
14219 cat conftest.$ac_ext >&5
14220 eval "$as_ac_Lib=no"
14221 fi
14222 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14223 LIBS=$ac_check_lib_save_LIBS
14224 fi
14225 echo "$as_me:14225: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14226 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14227 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14228
14229 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14230
14231 cf_add_libs="-lpanel$cf_cv_libtype"
14232 # Filter out duplicates - this happens with badly-designed ".pc" files...
14233 for cf_add_1lib in $LIBS
14234 do
14235         for cf_add_2lib in $cf_add_libs
14236         do
14237                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14238                 then
14239                         cf_add_1lib=
14240                         break
14241                 fi
14242         done
14243         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14244 done
14245 LIBS="$cf_add_libs"
14246
14247 cat >>confdefs.h <<EOF
14248 #define $cf_upper 1
14249 EOF
14250
14251 fi
14252
14253         cf_curses_headers="$cf_curses_headers panel.h"
14254 fi
14255
14256 echo "$as_me:14256: checking if you want to check for menu functions" >&5
14257 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
14258
14259 # Check whether --enable-menu or --disable-menu was given.
14260 if test "${enable_menu+set}" = set; then
14261   enableval="$enable_menu"
14262   test "$enableval" != no && enableval=yes
14263         if test "$enableval" != "yes" ; then
14264     cf_enable_menu=no
14265         else
14266                 cf_enable_menu=$cf_default_menu
14267         fi
14268 else
14269   enableval=yes
14270         cf_enable_menu=$cf_default_menu
14271
14272 fi;
14273 echo "$as_me:14273: result: $cf_enable_menu" >&5
14274 echo "${ECHO_T}$cf_enable_menu" >&6
14275 if test $cf_enable_menu = yes
14276 then
14277         case $cf_cv_screen in
14278         (ncurses*)
14279                 ;;
14280         (curses*)
14281
14282 echo "$as_me:14282: checking for NetBSD menu.h" >&5
14283 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
14284 if test "${cf_cv_netbsd_menu_h+set}" = set; then
14285   echo $ECHO_N "(cached) $ECHO_C" >&6
14286 else
14287
14288 cat >conftest.$ac_ext <<_ACEOF
14289 #line 14289 "configure"
14290 #include "confdefs.h"
14291
14292 #include <${cf_cv_ncurses_header:-curses.h}>
14293 #include <menu.h>
14294
14295 int
14296 main (void)
14297 {
14298
14299         MENU *menu;
14300         int y = menu->max_item_width;
14301
14302   ;
14303   return 0;
14304 }
14305 _ACEOF
14306 rm -f conftest.$ac_objext
14307 if { (eval echo "$as_me:14307: \"$ac_compile\"") >&5
14308   (eval $ac_compile) 2>&5
14309   ac_status=$?
14310   echo "$as_me:14310: \$? = $ac_status" >&5
14311   (exit $ac_status); } &&
14312          { ac_try='test -s conftest.$ac_objext'
14313   { (eval echo "$as_me:14313: \"$ac_try\"") >&5
14314   (eval $ac_try) 2>&5
14315   ac_status=$?
14316   echo "$as_me:14316: \$? = $ac_status" >&5
14317   (exit $ac_status); }; }; then
14318   cf_cv_netbsd_menu_h=yes
14319
14320 else
14321   echo "$as_me: failed program was:" >&5
14322 cat conftest.$ac_ext >&5
14323 cf_cv_netbsd_menu_h=no
14324 fi
14325 rm -f conftest.$ac_objext conftest.$ac_ext
14326
14327 fi
14328 echo "$as_me:14328: result: $cf_cv_netbsd_menu_h" >&5
14329 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
14330
14331 test "$cf_cv_netbsd_menu_h" = yes &&
14332 cat >>confdefs.h <<\EOF
14333 #define HAVE_NETBSD_MENU_H 1
14334 EOF
14335
14336                 ;;
14337         esac
14338
14339 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
14340 echo "$as_me:14340: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
14341 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
14342 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14343   echo $ECHO_N "(cached) $ECHO_C" >&6
14344 else
14345   ac_check_lib_save_LIBS=$LIBS
14346 LIBS="-lmenu$cf_cv_libtype  $LIBS"
14347 cat >conftest.$ac_ext <<_ACEOF
14348 #line 14348 "configure"
14349 #include "confdefs.h"
14350
14351 /* Override any gcc2 internal prototype to avoid an error.  */
14352 #ifdef __cplusplus
14353 extern "C"
14354 #endif
14355 /* We use char because int might match the return type of a gcc2
14356    builtin and then its argument prototype would still apply.  */
14357 char menu_driver ();
14358 int
14359 main (void)
14360 {
14361 menu_driver ();
14362   ;
14363   return 0;
14364 }
14365 _ACEOF
14366 rm -f conftest.$ac_objext conftest$ac_exeext
14367 if { (eval echo "$as_me:14367: \"$ac_link\"") >&5
14368   (eval $ac_link) 2>&5
14369   ac_status=$?
14370   echo "$as_me:14370: \$? = $ac_status" >&5
14371   (exit $ac_status); } &&
14372          { ac_try='test -s conftest$ac_exeext'
14373   { (eval echo "$as_me:14373: \"$ac_try\"") >&5
14374   (eval $ac_try) 2>&5
14375   ac_status=$?
14376   echo "$as_me:14376: \$? = $ac_status" >&5
14377   (exit $ac_status); }; }; then
14378   eval "$as_ac_Lib=yes"
14379 else
14380   echo "$as_me: failed program was:" >&5
14381 cat conftest.$ac_ext >&5
14382 eval "$as_ac_Lib=no"
14383 fi
14384 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14385 LIBS=$ac_check_lib_save_LIBS
14386 fi
14387 echo "$as_me:14387: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14388 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14389 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14390
14391 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14392
14393 cf_add_libs="-lmenu$cf_cv_libtype"
14394 # Filter out duplicates - this happens with badly-designed ".pc" files...
14395 for cf_add_1lib in $LIBS
14396 do
14397         for cf_add_2lib in $cf_add_libs
14398         do
14399                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14400                 then
14401                         cf_add_1lib=
14402                         break
14403                 fi
14404         done
14405         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14406 done
14407 LIBS="$cf_add_libs"
14408
14409 cat >>confdefs.h <<EOF
14410 #define $cf_upper 1
14411 EOF
14412
14413 fi
14414
14415         cf_curses_headers="$cf_curses_headers menu.h"
14416 fi
14417
14418 echo "$as_me:14418: checking if you want to check for form functions" >&5
14419 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
14420
14421 # Check whether --enable-form or --disable-form was given.
14422 if test "${enable_form+set}" = set; then
14423   enableval="$enable_form"
14424   test "$enableval" != no && enableval=yes
14425         if test "$enableval" != "yes" ; then
14426     cf_enable_form=no
14427         else
14428                 cf_enable_form=$cf_default_form
14429         fi
14430 else
14431   enableval=yes
14432         cf_enable_form=$cf_default_form
14433
14434 fi;
14435 echo "$as_me:14435: result: $cf_enable_form" >&5
14436 echo "${ECHO_T}$cf_enable_form" >&6
14437 if test $cf_enable_form = yes
14438 then
14439         case $cf_cv_screen in
14440         (ncurses*)
14441                 ;;
14442         (curses*)
14443
14444 echo "$as_me:14444: checking for NetBSD form.h" >&5
14445 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
14446 if test "${cf_cv_netbsd_form_h+set}" = set; then
14447   echo $ECHO_N "(cached) $ECHO_C" >&6
14448 else
14449
14450 cat >conftest.$ac_ext <<_ACEOF
14451 #line 14451 "configure"
14452 #include "confdefs.h"
14453
14454 #include <${cf_cv_ncurses_header:-curses.h}>
14455 #include <form.h>
14456
14457 int
14458 main (void)
14459 {
14460
14461         FORM *form;
14462         int y = current_field(form)->cursor_ypos;
14463         int x = current_field(form)->cursor_xpos;
14464
14465   ;
14466   return 0;
14467 }
14468 _ACEOF
14469 rm -f conftest.$ac_objext
14470 if { (eval echo "$as_me:14470: \"$ac_compile\"") >&5
14471   (eval $ac_compile) 2>&5
14472   ac_status=$?
14473   echo "$as_me:14473: \$? = $ac_status" >&5
14474   (exit $ac_status); } &&
14475          { ac_try='test -s conftest.$ac_objext'
14476   { (eval echo "$as_me:14476: \"$ac_try\"") >&5
14477   (eval $ac_try) 2>&5
14478   ac_status=$?
14479   echo "$as_me:14479: \$? = $ac_status" >&5
14480   (exit $ac_status); }; }; then
14481   cf_cv_netbsd_form_h=yes
14482
14483 else
14484   echo "$as_me: failed program was:" >&5
14485 cat conftest.$ac_ext >&5
14486 cf_cv_netbsd_form_h=no
14487 fi
14488 rm -f conftest.$ac_objext conftest.$ac_ext
14489
14490 fi
14491 echo "$as_me:14491: result: $cf_cv_netbsd_form_h" >&5
14492 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
14493
14494 test "$cf_cv_netbsd_form_h" = yes &&
14495 cat >>confdefs.h <<\EOF
14496 #define HAVE_NETBSD_FORM_H 1
14497 EOF
14498
14499                 ;;
14500         esac
14501
14502 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
14503 echo "$as_me:14503: checking for form_driver in -lform$cf_cv_libtype" >&5
14504 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
14505 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14506   echo $ECHO_N "(cached) $ECHO_C" >&6
14507 else
14508   ac_check_lib_save_LIBS=$LIBS
14509 LIBS="-lform$cf_cv_libtype  $LIBS"
14510 cat >conftest.$ac_ext <<_ACEOF
14511 #line 14511 "configure"
14512 #include "confdefs.h"
14513
14514 /* Override any gcc2 internal prototype to avoid an error.  */
14515 #ifdef __cplusplus
14516 extern "C"
14517 #endif
14518 /* We use char because int might match the return type of a gcc2
14519    builtin and then its argument prototype would still apply.  */
14520 char form_driver ();
14521 int
14522 main (void)
14523 {
14524 form_driver ();
14525   ;
14526   return 0;
14527 }
14528 _ACEOF
14529 rm -f conftest.$ac_objext conftest$ac_exeext
14530 if { (eval echo "$as_me:14530: \"$ac_link\"") >&5
14531   (eval $ac_link) 2>&5
14532   ac_status=$?
14533   echo "$as_me:14533: \$? = $ac_status" >&5
14534   (exit $ac_status); } &&
14535          { ac_try='test -s conftest$ac_exeext'
14536   { (eval echo "$as_me:14536: \"$ac_try\"") >&5
14537   (eval $ac_try) 2>&5
14538   ac_status=$?
14539   echo "$as_me:14539: \$? = $ac_status" >&5
14540   (exit $ac_status); }; }; then
14541   eval "$as_ac_Lib=yes"
14542 else
14543   echo "$as_me: failed program was:" >&5
14544 cat conftest.$ac_ext >&5
14545 eval "$as_ac_Lib=no"
14546 fi
14547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14548 LIBS=$ac_check_lib_save_LIBS
14549 fi
14550 echo "$as_me:14550: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14551 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14552 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14553
14554 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14555
14556 cf_add_libs="-lform$cf_cv_libtype"
14557 # Filter out duplicates - this happens with badly-designed ".pc" files...
14558 for cf_add_1lib in $LIBS
14559 do
14560         for cf_add_2lib in $cf_add_libs
14561         do
14562                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14563                 then
14564                         cf_add_1lib=
14565                         break
14566                 fi
14567         done
14568         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14569 done
14570 LIBS="$cf_add_libs"
14571
14572 cat >>confdefs.h <<EOF
14573 #define $cf_upper 1
14574 EOF
14575
14576 fi
14577
14578         cf_curses_headers="$cf_curses_headers form.h"
14579 fi
14580
14581 # look for curses-related headers
14582
14583 for ac_header in $cf_curses_headers
14584 do
14585 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14586 echo "$as_me:14586: checking for $ac_header" >&5
14587 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14588 if eval "test \"\${$as_ac_Header+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 <$ac_header>
14595 _ACEOF
14596 if { (eval echo "$as_me:14596: \"$ac_cpp conftest.$ac_ext\"") >&5
14597   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14598   ac_status=$?
14599   egrep -v '^ *\+' conftest.er1 >conftest.err
14600   rm -f conftest.er1
14601   cat conftest.err >&5
14602   echo "$as_me:14602: \$? = $ac_status" >&5
14603   (exit $ac_status); } >/dev/null; then
14604   if test -s conftest.err; then
14605     ac_cpp_err=$ac_c_preproc_warn_flag
14606   else
14607     ac_cpp_err=
14608   fi
14609 else
14610   ac_cpp_err=yes
14611 fi
14612 if test -z "$ac_cpp_err"; then
14613   eval "$as_ac_Header=yes"
14614 else
14615   echo "$as_me: failed program was:" >&5
14616   cat conftest.$ac_ext >&5
14617   eval "$as_ac_Header=no"
14618 fi
14619 rm -f conftest.err conftest.$ac_ext
14620 fi
14621 echo "$as_me:14621: result: `eval echo '${'$as_ac_Header'}'`" >&5
14622 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14623 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14624   cat >>confdefs.h <<EOF
14625 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14626 EOF
14627
14628 fi
14629 done
14630
14631 echo "$as_me:14631: checking for ANSI C header files" >&5
14632 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14633 if test "${ac_cv_header_stdc+set}" = set; then
14634   echo $ECHO_N "(cached) $ECHO_C" >&6
14635 else
14636   cat >conftest.$ac_ext <<_ACEOF
14637 #line 14637 "configure"
14638 #include "confdefs.h"
14639 #include <stdlib.h>
14640 #include <stdarg.h>
14641 #include <string.h>
14642 #include <float.h>
14643
14644 _ACEOF
14645 if { (eval echo "$as_me:14645: \"$ac_cpp conftest.$ac_ext\"") >&5
14646   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14647   ac_status=$?
14648   egrep -v '^ *\+' conftest.er1 >conftest.err
14649   rm -f conftest.er1
14650   cat conftest.err >&5
14651   echo "$as_me:14651: \$? = $ac_status" >&5
14652   (exit $ac_status); } >/dev/null; then
14653   if test -s conftest.err; then
14654     ac_cpp_err=$ac_c_preproc_warn_flag
14655   else
14656     ac_cpp_err=
14657   fi
14658 else
14659   ac_cpp_err=yes
14660 fi
14661 if test -z "$ac_cpp_err"; then
14662   ac_cv_header_stdc=yes
14663 else
14664   echo "$as_me: failed program was:" >&5
14665   cat conftest.$ac_ext >&5
14666   ac_cv_header_stdc=no
14667 fi
14668 rm -f conftest.err conftest.$ac_ext
14669
14670 if test $ac_cv_header_stdc = yes; then
14671   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14672   cat >conftest.$ac_ext <<_ACEOF
14673 #line 14673 "configure"
14674 #include "confdefs.h"
14675 #include <string.h>
14676
14677 _ACEOF
14678 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14679   egrep "memchr" >/dev/null 2>&1; then
14680   :
14681 else
14682   ac_cv_header_stdc=no
14683 fi
14684 rm -rf conftest*
14685
14686 fi
14687
14688 if test $ac_cv_header_stdc = yes; then
14689   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14690   cat >conftest.$ac_ext <<_ACEOF
14691 #line 14691 "configure"
14692 #include "confdefs.h"
14693 #include <stdlib.h>
14694
14695 _ACEOF
14696 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14697   egrep "free" >/dev/null 2>&1; then
14698   :
14699 else
14700   ac_cv_header_stdc=no
14701 fi
14702 rm -rf conftest*
14703
14704 fi
14705
14706 if test $ac_cv_header_stdc = yes; then
14707   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14708   if test "$cross_compiling" = yes; then
14709   :
14710 else
14711   cat >conftest.$ac_ext <<_ACEOF
14712 #line 14712 "configure"
14713 #include "confdefs.h"
14714 #include <ctype.h>
14715 #if ((' ' & 0x0FF) == 0x020)
14716 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14717 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14718 #else
14719 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14720                      || ('j' <= (c) && (c) <= 'r') \
14721                      || ('s' <= (c) && (c) <= 'z'))
14722 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14723 #endif
14724
14725 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14726 int
14727 main (void)
14728 {
14729   int i;
14730   for (i = 0; i < 256; i++)
14731     if (XOR (islower (i), ISLOWER (i))
14732         || toupper (i) != TOUPPER (i))
14733       $ac_main_return(2);
14734   $ac_main_return (0);
14735 }
14736 _ACEOF
14737 rm -f conftest$ac_exeext
14738 if { (eval echo "$as_me:14738: \"$ac_link\"") >&5
14739   (eval $ac_link) 2>&5
14740   ac_status=$?
14741   echo "$as_me:14741: \$? = $ac_status" >&5
14742   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14743   { (eval echo "$as_me:14743: \"$ac_try\"") >&5
14744   (eval $ac_try) 2>&5
14745   ac_status=$?
14746   echo "$as_me:14746: \$? = $ac_status" >&5
14747   (exit $ac_status); }; }; then
14748   :
14749 else
14750   echo "$as_me: program exited with status $ac_status" >&5
14751 echo "$as_me: failed program was:" >&5
14752 cat conftest.$ac_ext >&5
14753 ac_cv_header_stdc=no
14754 fi
14755 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14756 fi
14757 fi
14758 fi
14759 echo "$as_me:14759: result: $ac_cv_header_stdc" >&5
14760 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14761 if test $ac_cv_header_stdc = yes; then
14762
14763 cat >>confdefs.h <<\EOF
14764 #define STDC_HEADERS 1
14765 EOF
14766
14767 fi
14768
14769 echo "$as_me:14769: checking whether time.h and sys/time.h may both be included" >&5
14770 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
14771 if test "${ac_cv_header_time+set}" = set; then
14772   echo $ECHO_N "(cached) $ECHO_C" >&6
14773 else
14774   cat >conftest.$ac_ext <<_ACEOF
14775 #line 14775 "configure"
14776 #include "confdefs.h"
14777 #include <sys/types.h>
14778 #include <sys/time.h>
14779 #include <time.h>
14780
14781 int
14782 main (void)
14783 {
14784 if ((struct tm *) 0)
14785 return 0;
14786   ;
14787   return 0;
14788 }
14789 _ACEOF
14790 rm -f conftest.$ac_objext
14791 if { (eval echo "$as_me:14791: \"$ac_compile\"") >&5
14792   (eval $ac_compile) 2>&5
14793   ac_status=$?
14794   echo "$as_me:14794: \$? = $ac_status" >&5
14795   (exit $ac_status); } &&
14796          { ac_try='test -s conftest.$ac_objext'
14797   { (eval echo "$as_me:14797: \"$ac_try\"") >&5
14798   (eval $ac_try) 2>&5
14799   ac_status=$?
14800   echo "$as_me:14800: \$? = $ac_status" >&5
14801   (exit $ac_status); }; }; then
14802   ac_cv_header_time=yes
14803 else
14804   echo "$as_me: failed program was:" >&5
14805 cat conftest.$ac_ext >&5
14806 ac_cv_header_time=no
14807 fi
14808 rm -f conftest.$ac_objext conftest.$ac_ext
14809 fi
14810 echo "$as_me:14810: result: $ac_cv_header_time" >&5
14811 echo "${ECHO_T}$ac_cv_header_time" >&6
14812 if test $ac_cv_header_time = yes; then
14813
14814 cat >>confdefs.h <<\EOF
14815 #define TIME_WITH_SYS_TIME 1
14816 EOF
14817
14818 fi
14819
14820 for ac_header in \
14821 getopt.h \
14822 locale.h \
14823 math.h \
14824 stdarg.h \
14825 stdint.h \
14826 sys/ioctl.h \
14827 sys/select.h \
14828 sys/time.h \
14829 termios.h \
14830 unistd.h \
14831
14832 do
14833 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14834 echo "$as_me:14834: checking for $ac_header" >&5
14835 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14836 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14837   echo $ECHO_N "(cached) $ECHO_C" >&6
14838 else
14839   cat >conftest.$ac_ext <<_ACEOF
14840 #line 14840 "configure"
14841 #include "confdefs.h"
14842 #include <$ac_header>
14843 _ACEOF
14844 if { (eval echo "$as_me:14844: \"$ac_cpp conftest.$ac_ext\"") >&5
14845   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14846   ac_status=$?
14847   egrep -v '^ *\+' conftest.er1 >conftest.err
14848   rm -f conftest.er1
14849   cat conftest.err >&5
14850   echo "$as_me:14850: \$? = $ac_status" >&5
14851   (exit $ac_status); } >/dev/null; then
14852   if test -s conftest.err; then
14853     ac_cpp_err=$ac_c_preproc_warn_flag
14854   else
14855     ac_cpp_err=
14856   fi
14857 else
14858   ac_cpp_err=yes
14859 fi
14860 if test -z "$ac_cpp_err"; then
14861   eval "$as_ac_Header=yes"
14862 else
14863   echo "$as_me: failed program was:" >&5
14864   cat conftest.$ac_ext >&5
14865   eval "$as_ac_Header=no"
14866 fi
14867 rm -f conftest.err conftest.$ac_ext
14868 fi
14869 echo "$as_me:14869: result: `eval echo '${'$as_ac_Header'}'`" >&5
14870 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14871 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14872   cat >>confdefs.h <<EOF
14873 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14874 EOF
14875
14876 fi
14877 done
14878
14879 for ac_header in unistd.h getopt.h
14880 do
14881 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14882 echo "$as_me:14882: checking for $ac_header" >&5
14883 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14884 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14885   echo $ECHO_N "(cached) $ECHO_C" >&6
14886 else
14887   cat >conftest.$ac_ext <<_ACEOF
14888 #line 14888 "configure"
14889 #include "confdefs.h"
14890 #include <$ac_header>
14891 _ACEOF
14892 if { (eval echo "$as_me:14892: \"$ac_cpp conftest.$ac_ext\"") >&5
14893   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14894   ac_status=$?
14895   egrep -v '^ *\+' conftest.er1 >conftest.err
14896   rm -f conftest.er1
14897   cat conftest.err >&5
14898   echo "$as_me:14898: \$? = $ac_status" >&5
14899   (exit $ac_status); } >/dev/null; then
14900   if test -s conftest.err; then
14901     ac_cpp_err=$ac_c_preproc_warn_flag
14902   else
14903     ac_cpp_err=
14904   fi
14905 else
14906   ac_cpp_err=yes
14907 fi
14908 if test -z "$ac_cpp_err"; then
14909   eval "$as_ac_Header=yes"
14910 else
14911   echo "$as_me: failed program was:" >&5
14912   cat conftest.$ac_ext >&5
14913   eval "$as_ac_Header=no"
14914 fi
14915 rm -f conftest.err conftest.$ac_ext
14916 fi
14917 echo "$as_me:14917: result: `eval echo '${'$as_ac_Header'}'`" >&5
14918 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14919 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14920   cat >>confdefs.h <<EOF
14921 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14922 EOF
14923
14924 fi
14925 done
14926
14927 echo "$as_me:14927: checking for header declaring getopt variables" >&5
14928 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
14929 if test "${cf_cv_getopt_header+set}" = set; then
14930   echo $ECHO_N "(cached) $ECHO_C" >&6
14931 else
14932
14933 cf_cv_getopt_header=none
14934 for cf_header in stdio.h stdlib.h unistd.h getopt.h
14935 do
14936 cat >conftest.$ac_ext <<_ACEOF
14937 #line 14937 "configure"
14938 #include "confdefs.h"
14939
14940 #include <$cf_header>
14941 int
14942 main (void)
14943 {
14944 int x = optind; char *y = optarg
14945   ;
14946   return 0;
14947 }
14948 _ACEOF
14949 rm -f conftest.$ac_objext
14950 if { (eval echo "$as_me:14950: \"$ac_compile\"") >&5
14951   (eval $ac_compile) 2>&5
14952   ac_status=$?
14953   echo "$as_me:14953: \$? = $ac_status" >&5
14954   (exit $ac_status); } &&
14955          { ac_try='test -s conftest.$ac_objext'
14956   { (eval echo "$as_me:14956: \"$ac_try\"") >&5
14957   (eval $ac_try) 2>&5
14958   ac_status=$?
14959   echo "$as_me:14959: \$? = $ac_status" >&5
14960   (exit $ac_status); }; }; then
14961   cf_cv_getopt_header=$cf_header
14962  break
14963 else
14964   echo "$as_me: failed program was:" >&5
14965 cat conftest.$ac_ext >&5
14966 fi
14967 rm -f conftest.$ac_objext conftest.$ac_ext
14968 done
14969
14970 fi
14971 echo "$as_me:14971: result: $cf_cv_getopt_header" >&5
14972 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14973 if test $cf_cv_getopt_header != none ; then
14974
14975 cat >>confdefs.h <<\EOF
14976 #define HAVE_GETOPT_HEADER 1
14977 EOF
14978
14979 fi
14980 if test $cf_cv_getopt_header = getopt.h ; then
14981
14982 cat >>confdefs.h <<\EOF
14983 #define NEED_GETOPT_H 1
14984 EOF
14985
14986 fi
14987
14988 for ac_func in \
14989 getopt \
14990 gettimeofday \
14991 tdestroy \
14992 tsearch \
14993
14994 do
14995 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14996 echo "$as_me:14996: checking for $ac_func" >&5
14997 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14998 if eval "test \"\${$as_ac_var+set}\" = set"; then
14999   echo $ECHO_N "(cached) $ECHO_C" >&6
15000 else
15001   cat >conftest.$ac_ext <<_ACEOF
15002 #line 15002 "configure"
15003 #include "confdefs.h"
15004 /* System header to define __stub macros and hopefully few prototypes,
15005     which can conflict with char $ac_func (); below.  */
15006 #include <assert.h>
15007 /* Override any gcc2 internal prototype to avoid an error.  */
15008 #ifdef __cplusplus
15009 extern "C"
15010 #endif
15011 /* We use char because int might match the return type of a gcc2
15012    builtin and then its argument prototype would still apply.  */
15013 char $ac_func ();
15014 char (*f) ();
15015
15016 int
15017 main (void)
15018 {
15019 /* The GNU C library defines this for functions which it implements
15020     to always fail with ENOSYS.  Some functions are actually named
15021     something starting with __ and the normal name is an alias.  */
15022 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15023 choke me
15024 #else
15025 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15026 #endif
15027
15028   ;
15029   return 0;
15030 }
15031 _ACEOF
15032 rm -f conftest.$ac_objext conftest$ac_exeext
15033 if { (eval echo "$as_me:15033: \"$ac_link\"") >&5
15034   (eval $ac_link) 2>&5
15035   ac_status=$?
15036   echo "$as_me:15036: \$? = $ac_status" >&5
15037   (exit $ac_status); } &&
15038          { ac_try='test -s conftest$ac_exeext'
15039   { (eval echo "$as_me:15039: \"$ac_try\"") >&5
15040   (eval $ac_try) 2>&5
15041   ac_status=$?
15042   echo "$as_me:15042: \$? = $ac_status" >&5
15043   (exit $ac_status); }; }; then
15044   eval "$as_ac_var=yes"
15045 else
15046   echo "$as_me: failed program was:" >&5
15047 cat conftest.$ac_ext >&5
15048 eval "$as_ac_var=no"
15049 fi
15050 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15051 fi
15052 echo "$as_me:15052: result: `eval echo '${'$as_ac_var'}'`" >&5
15053 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15054 if test `eval echo '${'$as_ac_var'}'` = yes; then
15055   cat >>confdefs.h <<EOF
15056 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15057 EOF
15058
15059 fi
15060 done
15061
15062 if test "x$ac_cv_func_getopt" = xno; then
15063         { { echo "$as_me:15063: error: getopt is required for building programs" >&5
15064 echo "$as_me: error: getopt is required for building programs" >&2;}
15065    { (exit 1); exit 1; }; }
15066 fi
15067
15068 if test "$cf_enable_widec" = yes; then
15069
15070 for ac_func in \
15071 mblen \
15072 mbrlen \
15073 mbrtowc \
15074 mbsrtowcs \
15075 mbstowcs \
15076 mbtowc \
15077 wcsrtombs \
15078 wcstombs \
15079
15080 do
15081 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15082 echo "$as_me:15082: checking for $ac_func" >&5
15083 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15084 if eval "test \"\${$as_ac_var+set}\" = set"; then
15085   echo $ECHO_N "(cached) $ECHO_C" >&6
15086 else
15087   cat >conftest.$ac_ext <<_ACEOF
15088 #line 15088 "configure"
15089 #include "confdefs.h"
15090 /* System header to define __stub macros and hopefully few prototypes,
15091     which can conflict with char $ac_func (); below.  */
15092 #include <assert.h>
15093 /* Override any gcc2 internal prototype to avoid an error.  */
15094 #ifdef __cplusplus
15095 extern "C"
15096 #endif
15097 /* We use char because int might match the return type of a gcc2
15098    builtin and then its argument prototype would still apply.  */
15099 char $ac_func ();
15100 char (*f) ();
15101
15102 int
15103 main (void)
15104 {
15105 /* The GNU C library defines this for functions which it implements
15106     to always fail with ENOSYS.  Some functions are actually named
15107     something starting with __ and the normal name is an alias.  */
15108 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15109 choke me
15110 #else
15111 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15112 #endif
15113
15114   ;
15115   return 0;
15116 }
15117 _ACEOF
15118 rm -f conftest.$ac_objext conftest$ac_exeext
15119 if { (eval echo "$as_me:15119: \"$ac_link\"") >&5
15120   (eval $ac_link) 2>&5
15121   ac_status=$?
15122   echo "$as_me:15122: \$? = $ac_status" >&5
15123   (exit $ac_status); } &&
15124          { ac_try='test -s conftest$ac_exeext'
15125   { (eval echo "$as_me:15125: \"$ac_try\"") >&5
15126   (eval $ac_try) 2>&5
15127   ac_status=$?
15128   echo "$as_me:15128: \$? = $ac_status" >&5
15129   (exit $ac_status); }; }; then
15130   eval "$as_ac_var=yes"
15131 else
15132   echo "$as_me: failed program was:" >&5
15133 cat conftest.$ac_ext >&5
15134 eval "$as_ac_var=no"
15135 fi
15136 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15137 fi
15138 echo "$as_me:15138: result: `eval echo '${'$as_ac_var'}'`" >&5
15139 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15140 if test `eval echo '${'$as_ac_var'}'` = yes; then
15141   cat >>confdefs.h <<EOF
15142 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15143 EOF
15144
15145 fi
15146 done
15147
15148 fi
15149
15150 echo "$as_me:15150: checking definition to turn on extended curses functions" >&5
15151 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
15152 if test "${cf_cv_need_xopen_extension+set}" = set; then
15153   echo $ECHO_N "(cached) $ECHO_C" >&6
15154 else
15155
15156 cf_cv_need_xopen_extension=unknown
15157 cat >conftest.$ac_ext <<_ACEOF
15158 #line 15158 "configure"
15159 #include "confdefs.h"
15160
15161 #include <stdlib.h>
15162 #include <${cf_cv_ncurses_header:-curses.h}>
15163 int
15164 main (void)
15165 {
15166
15167 #if defined(NCURSES_VERSION_PATCH)
15168 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
15169         make an error
15170 #endif
15171 #endif
15172 #ifdef NCURSES_VERSION
15173         cchar_t check;
15174         int check2 = curs_set((int)sizeof(check));
15175 #endif
15176         long x = winnstr(stdscr, "", 0);
15177         int x1, y1;
15178         getbegyx(stdscr, y1, x1)
15179   ;
15180   return 0;
15181 }
15182 _ACEOF
15183 rm -f conftest.$ac_objext conftest$ac_exeext
15184 if { (eval echo "$as_me:15184: \"$ac_link\"") >&5
15185   (eval $ac_link) 2>&5
15186   ac_status=$?
15187   echo "$as_me:15187: \$? = $ac_status" >&5
15188   (exit $ac_status); } &&
15189          { ac_try='test -s conftest$ac_exeext'
15190   { (eval echo "$as_me:15190: \"$ac_try\"") >&5
15191   (eval $ac_try) 2>&5
15192   ac_status=$?
15193   echo "$as_me:15193: \$? = $ac_status" >&5
15194   (exit $ac_status); }; }; then
15195   cf_cv_need_xopen_extension=none
15196 else
15197   echo "$as_me: failed program was:" >&5
15198 cat conftest.$ac_ext >&5
15199
15200         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
15201         do
15202                 cat >conftest.$ac_ext <<_ACEOF
15203 #line 15203 "configure"
15204 #include "confdefs.h"
15205
15206 #define $cf_try_xopen_extension 1
15207 #include <stdlib.h>
15208 #include <${cf_cv_ncurses_header:-curses.h}>
15209 int
15210 main (void)
15211 {
15212
15213 #ifdef NCURSES_VERSION
15214                 cchar_t check;
15215                 int check2 = curs_set((int)sizeof(check));
15216 #endif
15217                 long x = winnstr(stdscr, "", 0);
15218                 int x1, y1;
15219                 getbegyx(stdscr, y1, x1)
15220   ;
15221   return 0;
15222 }
15223 _ACEOF
15224 rm -f conftest.$ac_objext conftest$ac_exeext
15225 if { (eval echo "$as_me:15225: \"$ac_link\"") >&5
15226   (eval $ac_link) 2>&5
15227   ac_status=$?
15228   echo "$as_me:15228: \$? = $ac_status" >&5
15229   (exit $ac_status); } &&
15230          { ac_try='test -s conftest$ac_exeext'
15231   { (eval echo "$as_me:15231: \"$ac_try\"") >&5
15232   (eval $ac_try) 2>&5
15233   ac_status=$?
15234   echo "$as_me:15234: \$? = $ac_status" >&5
15235   (exit $ac_status); }; }; then
15236   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
15237 else
15238   echo "$as_me: failed program was:" >&5
15239 cat conftest.$ac_ext >&5
15240 fi
15241 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15242         done
15243
15244 fi
15245 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15246
15247 fi
15248 echo "$as_me:15248: result: $cf_cv_need_xopen_extension" >&5
15249 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
15250
15251 case $cf_cv_need_xopen_extension in
15252 (*_*)
15253         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
15254         ;;
15255 esac
15256
15257 echo "$as_me:15257: checking for term.h" >&5
15258 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
15259 if test "${cf_cv_term_header+set}" = set; then
15260   echo $ECHO_N "(cached) $ECHO_C" >&6
15261 else
15262
15263 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
15264 # for <term.h> if we do not find the variant.
15265
15266 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
15267
15268 case ${cf_cv_ncurses_header:-curses.h} in
15269 (*/*)
15270         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
15271         cf_header_list="$cf_header_item $cf_header_list"
15272         ;;
15273 esac
15274
15275 for cf_header in $cf_header_list
15276 do
15277         cat >conftest.$ac_ext <<_ACEOF
15278 #line 15278 "configure"
15279 #include "confdefs.h"
15280
15281 #include <${cf_cv_ncurses_header:-curses.h}>
15282 #include <${cf_header}>
15283 int
15284 main (void)
15285 {
15286 WINDOW *x
15287   ;
15288   return 0;
15289 }
15290 _ACEOF
15291 rm -f conftest.$ac_objext
15292 if { (eval echo "$as_me:15292: \"$ac_compile\"") >&5
15293   (eval $ac_compile) 2>&5
15294   ac_status=$?
15295   echo "$as_me:15295: \$? = $ac_status" >&5
15296   (exit $ac_status); } &&
15297          { ac_try='test -s conftest.$ac_objext'
15298   { (eval echo "$as_me:15298: \"$ac_try\"") >&5
15299   (eval $ac_try) 2>&5
15300   ac_status=$?
15301   echo "$as_me:15301: \$? = $ac_status" >&5
15302   (exit $ac_status); }; }; then
15303   cf_cv_term_header=$cf_header
15304          break
15305 else
15306   echo "$as_me: failed program was:" >&5
15307 cat conftest.$ac_ext >&5
15308 cf_cv_term_header=no
15309 fi
15310 rm -f conftest.$ac_objext conftest.$ac_ext
15311 done
15312
15313 case $cf_cv_term_header in
15314 (no)
15315         # If curses is ncurses, some packagers still mess it up by trying to make
15316         # us use GNU termcap.  This handles the most common case.
15317         for cf_header in ncurses/term.h ncursesw/term.h
15318         do
15319                 cat >conftest.$ac_ext <<_ACEOF
15320 #line 15320 "configure"
15321 #include "confdefs.h"
15322
15323 #include <${cf_cv_ncurses_header:-curses.h}>
15324 #ifdef NCURSES_VERSION
15325 #include <${cf_header}>
15326 #else
15327 make an error
15328 #endif
15329 int
15330 main (void)
15331 {
15332 WINDOW *x
15333   ;
15334   return 0;
15335 }
15336 _ACEOF
15337 rm -f conftest.$ac_objext
15338 if { (eval echo "$as_me:15338: \"$ac_compile\"") >&5
15339   (eval $ac_compile) 2>&5
15340   ac_status=$?
15341   echo "$as_me:15341: \$? = $ac_status" >&5
15342   (exit $ac_status); } &&
15343          { ac_try='test -s conftest.$ac_objext'
15344   { (eval echo "$as_me:15344: \"$ac_try\"") >&5
15345   (eval $ac_try) 2>&5
15346   ac_status=$?
15347   echo "$as_me:15347: \$? = $ac_status" >&5
15348   (exit $ac_status); }; }; then
15349   cf_cv_term_header=$cf_header
15350                          break
15351 else
15352   echo "$as_me: failed program was:" >&5
15353 cat conftest.$ac_ext >&5
15354 cf_cv_term_header=no
15355 fi
15356 rm -f conftest.$ac_objext conftest.$ac_ext
15357         done
15358         ;;
15359 esac
15360
15361 fi
15362 echo "$as_me:15362: result: $cf_cv_term_header" >&5
15363 echo "${ECHO_T}$cf_cv_term_header" >&6
15364
15365 case $cf_cv_term_header in
15366 (term.h)
15367
15368 cat >>confdefs.h <<\EOF
15369 #define HAVE_TERM_H 1
15370 EOF
15371
15372         ;;
15373 (ncurses/term.h)
15374
15375 cat >>confdefs.h <<\EOF
15376 #define HAVE_NCURSES_TERM_H 1
15377 EOF
15378
15379         ;;
15380 (ncursesw/term.h)
15381
15382 cat >>confdefs.h <<\EOF
15383 #define HAVE_NCURSESW_TERM_H 1
15384 EOF
15385
15386         ;;
15387 esac
15388
15389 echo "$as_me:15389: checking for unctrl.h" >&5
15390 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
15391 if test "${cf_cv_unctrl_header+set}" = set; then
15392   echo $ECHO_N "(cached) $ECHO_C" >&6
15393 else
15394
15395 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
15396 # for <unctrl.h> if we do not find the variant.
15397
15398 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
15399
15400 case ${cf_cv_ncurses_header:-curses.h} in
15401 (*/*)
15402         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
15403         cf_header_list="$cf_header_item $cf_header_list"
15404         ;;
15405 esac
15406
15407 for cf_header in $cf_header_list
15408 do
15409         cat >conftest.$ac_ext <<_ACEOF
15410 #line 15410 "configure"
15411 #include "confdefs.h"
15412
15413 #include <${cf_cv_ncurses_header:-curses.h}>
15414 #include <${cf_header}>
15415 int
15416 main (void)
15417 {
15418 WINDOW *x
15419   ;
15420   return 0;
15421 }
15422 _ACEOF
15423 rm -f conftest.$ac_objext
15424 if { (eval echo "$as_me:15424: \"$ac_compile\"") >&5
15425   (eval $ac_compile) 2>&5
15426   ac_status=$?
15427   echo "$as_me:15427: \$? = $ac_status" >&5
15428   (exit $ac_status); } &&
15429          { ac_try='test -s conftest.$ac_objext'
15430   { (eval echo "$as_me:15430: \"$ac_try\"") >&5
15431   (eval $ac_try) 2>&5
15432   ac_status=$?
15433   echo "$as_me:15433: \$? = $ac_status" >&5
15434   (exit $ac_status); }; }; then
15435   cf_cv_unctrl_header=$cf_header
15436          break
15437 else
15438   echo "$as_me: failed program was:" >&5
15439 cat conftest.$ac_ext >&5
15440 cf_cv_unctrl_header=no
15441 fi
15442 rm -f conftest.$ac_objext conftest.$ac_ext
15443 done
15444
15445 fi
15446 echo "$as_me:15446: result: $cf_cv_unctrl_header" >&5
15447 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
15448
15449 case $cf_cv_unctrl_header in
15450 (no)
15451         { echo "$as_me:15451: WARNING: unctrl.h header not found" >&5
15452 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
15453         ;;
15454 esac
15455
15456 case $cf_cv_unctrl_header in
15457 (unctrl.h)
15458
15459 cat >>confdefs.h <<\EOF
15460 #define HAVE_UNCTRL_H 1
15461 EOF
15462
15463         ;;
15464 (ncurses/unctrl.h)
15465
15466 cat >>confdefs.h <<\EOF
15467 #define HAVE_NCURSES_UNCTRL_H 1
15468 EOF
15469
15470         ;;
15471 (ncursesw/unctrl.h)
15472
15473 cat >>confdefs.h <<\EOF
15474 #define HAVE_NCURSESW_UNCTRL_H 1
15475 EOF
15476
15477         ;;
15478 esac
15479
15480 for cf_func in \
15481 alloc_pair \
15482 assume_default_colors \
15483 chgat \
15484 color_content \
15485 color_set \
15486 filter \
15487 getbegx \
15488 getcurx \
15489 getmaxx \
15490 getnstr \
15491 getparx \
15492 getwin \
15493 init_extended_color \
15494 mvvline \
15495 mvwvline \
15496 napms \
15497 putwin \
15498 resize_term \
15499 resizeterm \
15500 restartterm \
15501 ripoffline \
15502 scr_dump \
15503 setupterm \
15504 slk_color \
15505 slk_init \
15506 termattrs \
15507 tgetent \
15508 tigetnum \
15509 tigetstr \
15510 tputs_sp \
15511 typeahead \
15512 use_default_colors \
15513 use_env \
15514 use_extended_names \
15515 use_screen \
15516 use_window \
15517 vid_puts \
15518 vidputs \
15519 vsscanf \
15520 vw_printw \
15521 wchgat \
15522 winsstr \
15523 wresize \
15524 wsyncdown \
15525 _tracef \
15526
15527 do
15528
15529 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15530
15531         echo "$as_me:15531: checking for ${cf_func}" >&5
15532 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15533
15534 echo "${as_me:-configure}:15534: testing ${cf_func} ..." 1>&5
15535
15536         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15537   echo $ECHO_N "(cached) $ECHO_C" >&6
15538 else
15539
15540                 eval cf_result='$ac_cv_func_'$cf_func
15541                 if test ".$cf_result" != ".no"; then
15542                         cat >conftest.$ac_ext <<_ACEOF
15543 #line 15543 "configure"
15544 #include "confdefs.h"
15545
15546 #ifdef HAVE_XCURSES
15547 #include <xcurses.h>
15548 char * XCursesProgramName = "test";
15549 #else
15550 #include <${cf_cv_ncurses_header:-curses.h}>
15551 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15552 #include <ncursesw/term.h>
15553 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15554 #include <ncurses/term.h>
15555 #elif defined(HAVE_TERM_H)
15556 #include <term.h>
15557 #endif
15558 #endif
15559
15560 int
15561 main (void)
15562 {
15563
15564 #ifndef ${cf_func}
15565 long foo = (long)(&${cf_func});
15566 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15567 if (foo + 1234 > 5678)
15568         ${cf_cv_main_return:-return}(foo);
15569 #endif
15570
15571   ;
15572   return 0;
15573 }
15574 _ACEOF
15575 rm -f conftest.$ac_objext conftest$ac_exeext
15576 if { (eval echo "$as_me:15576: \"$ac_link\"") >&5
15577   (eval $ac_link) 2>&5
15578   ac_status=$?
15579   echo "$as_me:15579: \$? = $ac_status" >&5
15580   (exit $ac_status); } &&
15581          { ac_try='test -s conftest$ac_exeext'
15582   { (eval echo "$as_me:15582: \"$ac_try\"") >&5
15583   (eval $ac_try) 2>&5
15584   ac_status=$?
15585   echo "$as_me:15585: \$? = $ac_status" >&5
15586   (exit $ac_status); }; }; then
15587   cf_result=yes
15588 else
15589   echo "$as_me: failed program was:" >&5
15590 cat conftest.$ac_ext >&5
15591 cf_result=no
15592 fi
15593 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15594                 fi
15595                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15596
15597 fi
15598
15599         # use the computed/retrieved cache-value:
15600         eval 'cf_result=$cf_cv_func_'$cf_func
15601         echo "$as_me:15601: result: $cf_result" >&5
15602 echo "${ECHO_T}$cf_result" >&6
15603         if test $cf_result != no; then
15604                 cat >>confdefs.h <<EOF
15605 #define HAVE_${cf_tr_func} 1
15606 EOF
15607
15608         fi
15609 done
15610
15611 for cf_func in tputs
15612 do
15613
15614 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15615
15616         echo "$as_me:15616: checking for ${cf_func}" >&5
15617 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15618
15619 echo "${as_me:-configure}:15619: testing ${cf_func} ..." 1>&5
15620
15621         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15622   echo $ECHO_N "(cached) $ECHO_C" >&6
15623 else
15624
15625                 eval cf_result='$ac_cv_func_'$cf_func
15626                 if test ".$cf_result" != ".no"; then
15627                         cat >conftest.$ac_ext <<_ACEOF
15628 #line 15628 "configure"
15629 #include "confdefs.h"
15630
15631 #ifdef HAVE_XCURSES
15632 #include <xcurses.h>
15633 char * XCursesProgramName = "test";
15634 #else
15635 #include <${cf_cv_ncurses_header:-curses.h}>
15636 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15637 #include <ncursesw/term.h>
15638 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15639 #include <ncurses/term.h>
15640 #elif defined(HAVE_TERM_H)
15641 #include <term.h>
15642 #endif
15643 #endif
15644
15645 int
15646 main (void)
15647 {
15648
15649 #ifndef ${cf_func}
15650 long foo = (long)(&${cf_func});
15651 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15652 if (foo + 1234 > 5678)
15653         ${cf_cv_main_return:-return}(foo);
15654 #endif
15655
15656   ;
15657   return 0;
15658 }
15659 _ACEOF
15660 rm -f conftest.$ac_objext conftest$ac_exeext
15661 if { (eval echo "$as_me:15661: \"$ac_link\"") >&5
15662   (eval $ac_link) 2>&5
15663   ac_status=$?
15664   echo "$as_me:15664: \$? = $ac_status" >&5
15665   (exit $ac_status); } &&
15666          { ac_try='test -s conftest$ac_exeext'
15667   { (eval echo "$as_me:15667: \"$ac_try\"") >&5
15668   (eval $ac_try) 2>&5
15669   ac_status=$?
15670   echo "$as_me:15670: \$? = $ac_status" >&5
15671   (exit $ac_status); }; }; then
15672   cf_result=yes
15673 else
15674   echo "$as_me: failed program was:" >&5
15675 cat conftest.$ac_ext >&5
15676 cf_result=no
15677 fi
15678 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15679                 fi
15680                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15681
15682 fi
15683
15684         # use the computed/retrieved cache-value:
15685         eval 'cf_result=$cf_cv_func_'$cf_func
15686         echo "$as_me:15686: result: $cf_result" >&5
15687 echo "${ECHO_T}$cf_result" >&6
15688         if test $cf_result != no; then
15689                 cat >>confdefs.h <<EOF
15690 #define HAVE_${cf_tr_func} 1
15691 EOF
15692
15693         fi
15694 done
15695
15696 if test x$cf_cv_func_tputs = xyes
15697 then
15698         cf_done=no
15699         for cf_arg in int char
15700         do
15701                 for cf_ret in int void
15702                 do
15703                         if test $cf_ret = void
15704                         then
15705                                 cf_return="/* nothing */"
15706                         else
15707                                 cf_return="return value"
15708                         fi
15709                         cat >conftest.$ac_ext <<_ACEOF
15710 #line 15710 "configure"
15711 #include "confdefs.h"
15712
15713 #include <${cf_cv_ncurses_header:-curses.h}>
15714 #include <$cf_cv_term_header>
15715
15716 static $cf_ret outc($cf_arg value) { $cf_return; }
15717
15718 int
15719 main (void)
15720 {
15721
15722         tputs("hello", 0, outc);
15723         ${cf_cv_main_return:-return}(0);
15724
15725   ;
15726   return 0;
15727 }
15728 _ACEOF
15729 rm -f conftest.$ac_objext
15730 if { (eval echo "$as_me:15730: \"$ac_compile\"") >&5
15731   (eval $ac_compile) 2>&5
15732   ac_status=$?
15733   echo "$as_me:15733: \$? = $ac_status" >&5
15734   (exit $ac_status); } &&
15735          { ac_try='test -s conftest.$ac_objext'
15736   { (eval echo "$as_me:15736: \"$ac_try\"") >&5
15737   (eval $ac_try) 2>&5
15738   ac_status=$?
15739   echo "$as_me:15739: \$? = $ac_status" >&5
15740   (exit $ac_status); }; }; then
15741
15742                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
15743
15744 echo "${as_me:-configure}:15744: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
15745
15746                 cat >>confdefs.h <<EOF
15747 #define TPUTS_ARG               $cf_arg
15748 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
15749 #define TPUTS_RETURN(value)     $cf_return
15750 EOF
15751                 cf_done=yes
15752                 break
15753
15754 else
15755   echo "$as_me: failed program was:" >&5
15756 cat conftest.$ac_ext >&5
15757 fi
15758 rm -f conftest.$ac_objext conftest.$ac_ext
15759                 done
15760                 test $cf_done = yes && break
15761         done
15762 fi
15763
15764 echo "$as_me:15764: checking for ncurses extended functions" >&5
15765 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
15766 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
15767   echo $ECHO_N "(cached) $ECHO_C" >&6
15768 else
15769
15770 cat >conftest.$ac_ext <<_ACEOF
15771 #line 15771 "configure"
15772 #include "confdefs.h"
15773
15774 #include <${cf_cv_ncurses_header:-curses.h}>
15775 int
15776 main (void)
15777 {
15778
15779 int x = NCURSES_EXT_FUNCS
15780
15781   ;
15782   return 0;
15783 }
15784 _ACEOF
15785 rm -f conftest.$ac_objext
15786 if { (eval echo "$as_me:15786: \"$ac_compile\"") >&5
15787   (eval $ac_compile) 2>&5
15788   ac_status=$?
15789   echo "$as_me:15789: \$? = $ac_status" >&5
15790   (exit $ac_status); } &&
15791          { ac_try='test -s conftest.$ac_objext'
15792   { (eval echo "$as_me:15792: \"$ac_try\"") >&5
15793   (eval $ac_try) 2>&5
15794   ac_status=$?
15795   echo "$as_me:15795: \$? = $ac_status" >&5
15796   (exit $ac_status); }; }; then
15797   cf_cv_ncurses_ext_funcs=defined
15798 else
15799   echo "$as_me: failed program was:" >&5
15800 cat conftest.$ac_ext >&5
15801
15802 cat >conftest.$ac_ext <<_ACEOF
15803 #line 15803 "configure"
15804 #include "confdefs.h"
15805
15806 #include <${cf_cv_ncurses_header:-curses.h}>
15807 int
15808 main (void)
15809 {
15810
15811         (void) assume_default_colors (0, 0);
15812         (void) curses_version ();
15813         (void) define_key (0, 0);
15814         (void) is_term_resized (0, 0);
15815         (void) key_defined (0);
15816         (void) keybound (0, 0);
15817         (void) keyok (0, 0);
15818         (void) resize_term (0, 0);
15819         (void) resizeterm (0, 0);
15820         (void) use_default_colors ();
15821         (void) use_extended_names (0);
15822         (void) wresize (0, 0, 0);
15823   ;
15824   return 0;
15825 }
15826 _ACEOF
15827 rm -f conftest.$ac_objext conftest$ac_exeext
15828 if { (eval echo "$as_me:15828: \"$ac_link\"") >&5
15829   (eval $ac_link) 2>&5
15830   ac_status=$?
15831   echo "$as_me:15831: \$? = $ac_status" >&5
15832   (exit $ac_status); } &&
15833          { ac_try='test -s conftest$ac_exeext'
15834   { (eval echo "$as_me:15834: \"$ac_try\"") >&5
15835   (eval $ac_try) 2>&5
15836   ac_status=$?
15837   echo "$as_me:15837: \$? = $ac_status" >&5
15838   (exit $ac_status); }; }; then
15839   cf_cv_ncurses_ext_funcs=yes
15840 else
15841   echo "$as_me: failed program was:" >&5
15842 cat conftest.$ac_ext >&5
15843 cf_cv_ncurses_ext_funcs=no
15844 fi
15845 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15846
15847 fi
15848 rm -f conftest.$ac_objext conftest.$ac_ext
15849
15850 fi
15851 echo "$as_me:15851: result: $cf_cv_ncurses_ext_funcs" >&5
15852 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
15853 test "$cf_cv_ncurses_ext_funcs" = yes &&
15854 cat >>confdefs.h <<\EOF
15855 #define NCURSES_EXT_FUNCS 1
15856 EOF
15857
15858 if test "$cf_enable_widec" = yes
15859 then
15860         # workaround for systems with ncurses before 20111029, due to change of
15861         # feature test macro from _XPG5 to _XOPEN_SOURCE
15862         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
15863         then
15864                 cf_define_xpg5=no
15865                 echo "$as_me:15865: checking if _XPG5 should be defined to enable wide-characters" >&5
15866 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
15867
15868                 cat >conftest.$ac_ext <<_ACEOF
15869 #line 15869 "configure"
15870 #include "confdefs.h"
15871
15872 #include <${cf_cv_ncurses_header:-curses.h}>
15873 int
15874 main (void)
15875 {
15876 int x = _XPG5
15877   ;
15878   return 0;
15879 }
15880 _ACEOF
15881 rm -f conftest.$ac_objext
15882 if { (eval echo "$as_me:15882: \"$ac_compile\"") >&5
15883   (eval $ac_compile) 2>&5
15884   ac_status=$?
15885   echo "$as_me:15885: \$? = $ac_status" >&5
15886   (exit $ac_status); } &&
15887          { ac_try='test -s conftest.$ac_objext'
15888   { (eval echo "$as_me:15888: \"$ac_try\"") >&5
15889   (eval $ac_try) 2>&5
15890   ac_status=$?
15891   echo "$as_me:15891: \$? = $ac_status" >&5
15892   (exit $ac_status); }; }; then
15893   :
15894 else
15895   echo "$as_me: failed program was:" >&5
15896 cat conftest.$ac_ext >&5
15897 cf_save_cppflags="$CPPFLAGS"
15898                          CPPFLAGS="$CPPFLAGS -D_XPG5"
15899                          cat >conftest.$ac_ext <<_ACEOF
15900 #line 15900 "configure"
15901 #include "confdefs.h"
15902
15903 #include <${cf_cv_ncurses_header:-curses.h}>
15904 int
15905 main (void)
15906 {
15907 int x = _XPG5
15908   ;
15909   return 0;
15910 }
15911 _ACEOF
15912 rm -f conftest.$ac_objext
15913 if { (eval echo "$as_me:15913: \"$ac_compile\"") >&5
15914   (eval $ac_compile) 2>&5
15915   ac_status=$?
15916   echo "$as_me:15916: \$? = $ac_status" >&5
15917   (exit $ac_status); } &&
15918          { ac_try='test -s conftest.$ac_objext'
15919   { (eval echo "$as_me:15919: \"$ac_try\"") >&5
15920   (eval $ac_try) 2>&5
15921   ac_status=$?
15922   echo "$as_me:15922: \$? = $ac_status" >&5
15923   (exit $ac_status); }; }; then
15924   cf_define_xpg5=yes
15925 else
15926   echo "$as_me: failed program was:" >&5
15927 cat conftest.$ac_ext >&5
15928 fi
15929 rm -f conftest.$ac_objext conftest.$ac_ext
15930                          CPPFLAGS="$cf_save_cppflags"
15931 fi
15932 rm -f conftest.$ac_objext conftest.$ac_ext
15933                 echo "$as_me:15933: result: $cf_define_xpg5" >&5
15934 echo "${ECHO_T}$cf_define_xpg5" >&6
15935
15936                 if test "$cf_define_xpg5" = yes
15937                 then
15938                         CPPFLAGS="$CPPFLAGS -D_XPG5"
15939                 fi
15940         fi
15941
15942         echo "$as_me:15942: checking for wide-character functions" >&5
15943 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
15944 if test "${cf_cv_widechar_funcs+set}" = set; then
15945   echo $ECHO_N "(cached) $ECHO_C" >&6
15946 else
15947
15948         cat >conftest.$ac_ext <<_ACEOF
15949 #line 15949 "configure"
15950 #include "confdefs.h"
15951
15952 #include <${cf_cv_ncurses_header:-curses.h}>
15953 int
15954 main (void)
15955 {
15956
15957                 static wchar_t src_wchar[2];
15958                 static cchar_t dst_cchar;
15959                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15960
15961   ;
15962   return 0;
15963 }
15964 _ACEOF
15965 rm -f conftest.$ac_objext conftest$ac_exeext
15966 if { (eval echo "$as_me:15966: \"$ac_link\"") >&5
15967   (eval $ac_link) 2>&5
15968   ac_status=$?
15969   echo "$as_me:15969: \$? = $ac_status" >&5
15970   (exit $ac_status); } &&
15971          { ac_try='test -s conftest$ac_exeext'
15972   { (eval echo "$as_me:15972: \"$ac_try\"") >&5
15973   (eval $ac_try) 2>&5
15974   ac_status=$?
15975   echo "$as_me:15975: \$? = $ac_status" >&5
15976   (exit $ac_status); }; }; then
15977   cf_cv_widechar_funcs=yes
15978 else
15979   echo "$as_me: failed program was:" >&5
15980 cat conftest.$ac_ext >&5
15981 cf_cv_widechar_funcs=no
15982 fi
15983 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15984
15985 fi
15986 echo "$as_me:15986: result: $cf_cv_widechar_funcs" >&5
15987 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15988         if test "$cf_cv_widechar_funcs" != no ; then
15989
15990 cat >>confdefs.h <<\EOF
15991 #define USE_WIDEC_SUPPORT 1
15992 EOF
15993
15994         else
15995                 cat >>confdefs.h <<\EOF
15996 #define USE_WIDEC_SUPPORT 0
15997 EOF
15998
15999         fi
16000 else
16001         cat >>confdefs.h <<\EOF
16002 #define USE_WIDEC_SUPPORT 0
16003 EOF
16004
16005 fi
16006
16007 echo "$as_me:16007: checking if $cf_cv_screen library uses pthreads" >&5
16008 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
16009 if test "${cf_cv_use_pthreads+set}" = set; then
16010   echo $ECHO_N "(cached) $ECHO_C" >&6
16011 else
16012
16013 cat >conftest.$ac_ext <<_ACEOF
16014 #line 16014 "configure"
16015 #include "confdefs.h"
16016
16017 #include <${cf_cv_ncurses_header:-curses.h}>
16018 extern void _nc_init_pthreads(void);
16019
16020 int
16021 main (void)
16022 {
16023
16024         initscr();
16025         _nc_init_pthreads();
16026
16027   ;
16028   return 0;
16029 }
16030 _ACEOF
16031 rm -f conftest.$ac_objext conftest$ac_exeext
16032 if { (eval echo "$as_me:16032: \"$ac_link\"") >&5
16033   (eval $ac_link) 2>&5
16034   ac_status=$?
16035   echo "$as_me:16035: \$? = $ac_status" >&5
16036   (exit $ac_status); } &&
16037          { ac_try='test -s conftest$ac_exeext'
16038   { (eval echo "$as_me:16038: \"$ac_try\"") >&5
16039   (eval $ac_try) 2>&5
16040   ac_status=$?
16041   echo "$as_me:16041: \$? = $ac_status" >&5
16042   (exit $ac_status); }; }; then
16043   cf_cv_use_pthreads=yes
16044 else
16045   echo "$as_me: failed program was:" >&5
16046 cat conftest.$ac_ext >&5
16047 cf_cv_use_pthreads=no
16048 fi
16049 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16050
16051 fi
16052 echo "$as_me:16052: result: $cf_cv_use_pthreads" >&5
16053 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
16054 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
16055 #define USE_PTHREADS 1
16056 EOF
16057
16058 echo "$as_me:16058: checking if sys/time.h works with sys/select.h" >&5
16059 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
16060 if test "${cf_cv_sys_time_select+set}" = set; then
16061   echo $ECHO_N "(cached) $ECHO_C" >&6
16062 else
16063
16064 cat >conftest.$ac_ext <<_ACEOF
16065 #line 16065 "configure"
16066 #include "confdefs.h"
16067
16068 #include <sys/types.h>
16069 #ifdef HAVE_SYS_TIME_H
16070 #include <sys/time.h>
16071 #endif
16072 #ifdef HAVE_SYS_SELECT_H
16073 #include <sys/select.h>
16074 #endif
16075
16076 int
16077 main (void)
16078 {
16079
16080   ;
16081   return 0;
16082 }
16083 _ACEOF
16084 rm -f conftest.$ac_objext
16085 if { (eval echo "$as_me:16085: \"$ac_compile\"") >&5
16086   (eval $ac_compile) 2>&5
16087   ac_status=$?
16088   echo "$as_me:16088: \$? = $ac_status" >&5
16089   (exit $ac_status); } &&
16090          { ac_try='test -s conftest.$ac_objext'
16091   { (eval echo "$as_me:16091: \"$ac_try\"") >&5
16092   (eval $ac_try) 2>&5
16093   ac_status=$?
16094   echo "$as_me:16094: \$? = $ac_status" >&5
16095   (exit $ac_status); }; }; then
16096   cf_cv_sys_time_select=yes
16097 else
16098   echo "$as_me: failed program was:" >&5
16099 cat conftest.$ac_ext >&5
16100 cf_cv_sys_time_select=no
16101 fi
16102 rm -f conftest.$ac_objext conftest.$ac_ext
16103
16104 fi
16105
16106 echo "$as_me:16106: result: $cf_cv_sys_time_select" >&5
16107 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
16108 test "$cf_cv_sys_time_select" = yes &&
16109 cat >>confdefs.h <<\EOF
16110 #define HAVE_SYS_TIME_SELECT 1
16111 EOF
16112
16113 # special check for test/ditto.c
16114
16115 echo "$as_me:16115: checking for openpty in -lutil" >&5
16116 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
16117 if test "${ac_cv_lib_util_openpty+set}" = set; then
16118   echo $ECHO_N "(cached) $ECHO_C" >&6
16119 else
16120   ac_check_lib_save_LIBS=$LIBS
16121 LIBS="-lutil  $LIBS"
16122 cat >conftest.$ac_ext <<_ACEOF
16123 #line 16123 "configure"
16124 #include "confdefs.h"
16125
16126 /* Override any gcc2 internal prototype to avoid an error.  */
16127 #ifdef __cplusplus
16128 extern "C"
16129 #endif
16130 /* We use char because int might match the return type of a gcc2
16131    builtin and then its argument prototype would still apply.  */
16132 char openpty ();
16133 int
16134 main (void)
16135 {
16136 openpty ();
16137   ;
16138   return 0;
16139 }
16140 _ACEOF
16141 rm -f conftest.$ac_objext conftest$ac_exeext
16142 if { (eval echo "$as_me:16142: \"$ac_link\"") >&5
16143   (eval $ac_link) 2>&5
16144   ac_status=$?
16145   echo "$as_me:16145: \$? = $ac_status" >&5
16146   (exit $ac_status); } &&
16147          { ac_try='test -s conftest$ac_exeext'
16148   { (eval echo "$as_me:16148: \"$ac_try\"") >&5
16149   (eval $ac_try) 2>&5
16150   ac_status=$?
16151   echo "$as_me:16151: \$? = $ac_status" >&5
16152   (exit $ac_status); }; }; then
16153   ac_cv_lib_util_openpty=yes
16154 else
16155   echo "$as_me: failed program was:" >&5
16156 cat conftest.$ac_ext >&5
16157 ac_cv_lib_util_openpty=no
16158 fi
16159 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16160 LIBS=$ac_check_lib_save_LIBS
16161 fi
16162 echo "$as_me:16162: result: $ac_cv_lib_util_openpty" >&5
16163 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
16164 if test $ac_cv_lib_util_openpty = yes; then
16165   cf_cv_lib_util=yes
16166 else
16167   cf_cv_lib_util=no
16168 fi
16169
16170 echo "$as_me:16170: checking for openpty header" >&5
16171 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
16172 if test "${cf_cv_func_openpty+set}" = set; then
16173   echo $ECHO_N "(cached) $ECHO_C" >&6
16174 else
16175
16176         cf_save_LIBS="$LIBS"
16177         test $cf_cv_lib_util = yes && {
16178 cf_add_libs="-lutil"
16179 # Filter out duplicates - this happens with badly-designed ".pc" files...
16180 for cf_add_1lib in $LIBS
16181 do
16182         for cf_add_2lib in $cf_add_libs
16183         do
16184                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16185                 then
16186                         cf_add_1lib=
16187                         break
16188                 fi
16189         done
16190         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16191 done
16192 LIBS="$cf_add_libs"
16193  }
16194         for cf_header in pty.h libutil.h util.h
16195         do
16196         cat >conftest.$ac_ext <<_ACEOF
16197 #line 16197 "configure"
16198 #include "confdefs.h"
16199
16200 #include <$cf_header>
16201
16202 int
16203 main (void)
16204 {
16205
16206         int x = openpty((int *)0, (int *)0, (char *)0,
16207                                    (struct termios *)0, (struct winsize *)0);
16208
16209   ;
16210   return 0;
16211 }
16212 _ACEOF
16213 rm -f conftest.$ac_objext conftest$ac_exeext
16214 if { (eval echo "$as_me:16214: \"$ac_link\"") >&5
16215   (eval $ac_link) 2>&5
16216   ac_status=$?
16217   echo "$as_me:16217: \$? = $ac_status" >&5
16218   (exit $ac_status); } &&
16219          { ac_try='test -s conftest$ac_exeext'
16220   { (eval echo "$as_me:16220: \"$ac_try\"") >&5
16221   (eval $ac_try) 2>&5
16222   ac_status=$?
16223   echo "$as_me:16223: \$? = $ac_status" >&5
16224   (exit $ac_status); }; }; then
16225
16226                 cf_cv_func_openpty=$cf_header
16227                 break
16228
16229 else
16230   echo "$as_me: failed program was:" >&5
16231 cat conftest.$ac_ext >&5
16232
16233                 cf_cv_func_openpty=no
16234
16235 fi
16236 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16237         done
16238         LIBS="$cf_save_LIBS"
16239
16240 fi
16241 echo "$as_me:16241: result: $cf_cv_func_openpty" >&5
16242 echo "${ECHO_T}$cf_cv_func_openpty" >&6
16243
16244 if test "$cf_cv_func_openpty" != no ; then
16245
16246 cat >>confdefs.h <<EOF
16247 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
16248 EOF
16249
16250 cat >>confdefs.h <<\EOF
16251 #define USE_XTERM_PTY 1
16252 EOF
16253
16254         if test "x$cf_cv_lib_util" = xyes ; then
16255
16256 cf_add_libs="-lutil"
16257 # Filter out duplicates - this happens with badly-designed ".pc" files...
16258 for cf_add_1lib in $TEST_LIBS
16259 do
16260         for cf_add_2lib in $cf_add_libs
16261         do
16262                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16263                 then
16264                         cf_add_1lib=
16265                         break
16266                 fi
16267         done
16268         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16269 done
16270 TEST_LIBS="$cf_add_libs"
16271
16272         fi
16273 fi
16274
16275 echo "$as_me:16275: checking for function curses_version" >&5
16276 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
16277 if test "${cf_cv_func_curses_version+set}" = set; then
16278   echo $ECHO_N "(cached) $ECHO_C" >&6
16279 else
16280
16281 if test "$cross_compiling" = yes; then
16282   cf_cv_func_curses_version=unknown
16283 else
16284   cat >conftest.$ac_ext <<_ACEOF
16285 #line 16285 "configure"
16286 #include "confdefs.h"
16287
16288 #include <${cf_cv_ncurses_header:-curses.h}>
16289 int main(void)
16290 {
16291         char temp[1024];
16292         sprintf(temp, "%s\n", curses_version());
16293         ${cf_cv_main_return:-return}(0);
16294 }
16295
16296 _ACEOF
16297 rm -f conftest$ac_exeext
16298 if { (eval echo "$as_me:16298: \"$ac_link\"") >&5
16299   (eval $ac_link) 2>&5
16300   ac_status=$?
16301   echo "$as_me:16301: \$? = $ac_status" >&5
16302   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16303   { (eval echo "$as_me:16303: \"$ac_try\"") >&5
16304   (eval $ac_try) 2>&5
16305   ac_status=$?
16306   echo "$as_me:16306: \$? = $ac_status" >&5
16307   (exit $ac_status); }; }; then
16308   cf_cv_func_curses_version=yes
16309
16310 else
16311   echo "$as_me: program exited with status $ac_status" >&5
16312 echo "$as_me: failed program was:" >&5
16313 cat conftest.$ac_ext >&5
16314 cf_cv_func_curses_version=no
16315
16316 fi
16317 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16318 fi
16319 rm -f core
16320 fi
16321 echo "$as_me:16321: result: $cf_cv_func_curses_version" >&5
16322 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
16323 test "$cf_cv_func_curses_version" = yes &&
16324 cat >>confdefs.h <<\EOF
16325 #define HAVE_CURSES_VERSION 1
16326 EOF
16327
16328 echo "$as_me:16328: checking for alternate character set array" >&5
16329 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
16330 if test "${cf_cv_curses_acs_map+set}" = set; then
16331   echo $ECHO_N "(cached) $ECHO_C" >&6
16332 else
16333
16334 cf_cv_curses_acs_map=unknown
16335 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
16336 do
16337 cat >conftest.$ac_ext <<_ACEOF
16338 #line 16338 "configure"
16339 #include "confdefs.h"
16340
16341 #include <${cf_cv_ncurses_header:-curses.h}>
16342
16343 int
16344 main (void)
16345 {
16346
16347 $name['k'] = ACS_PLUS
16348
16349   ;
16350   return 0;
16351 }
16352 _ACEOF
16353 rm -f conftest.$ac_objext conftest$ac_exeext
16354 if { (eval echo "$as_me:16354: \"$ac_link\"") >&5
16355   (eval $ac_link) 2>&5
16356   ac_status=$?
16357   echo "$as_me:16357: \$? = $ac_status" >&5
16358   (exit $ac_status); } &&
16359          { ac_try='test -s conftest$ac_exeext'
16360   { (eval echo "$as_me:16360: \"$ac_try\"") >&5
16361   (eval $ac_try) 2>&5
16362   ac_status=$?
16363   echo "$as_me:16363: \$? = $ac_status" >&5
16364   (exit $ac_status); }; }; then
16365   cf_cv_curses_acs_map=$name; break
16366 else
16367   echo "$as_me: failed program was:" >&5
16368 cat conftest.$ac_ext >&5
16369 fi
16370 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16371 done
16372
16373 fi
16374 echo "$as_me:16374: result: $cf_cv_curses_acs_map" >&5
16375 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
16376
16377 test "$cf_cv_curses_acs_map" != unknown &&
16378 cat >>confdefs.h <<EOF
16379 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
16380 EOF
16381
16382 if test "$cf_enable_widec" = yes; then
16383
16384 echo "$as_me:16384: checking for wide alternate character set array" >&5
16385 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
16386 if test "${cf_cv_curses_wacs_map+set}" = set; then
16387   echo $ECHO_N "(cached) $ECHO_C" >&6
16388 else
16389
16390         cf_cv_curses_wacs_map=unknown
16391         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
16392         do
16393         cat >conftest.$ac_ext <<_ACEOF
16394 #line 16394 "configure"
16395 #include "confdefs.h"
16396
16397 #ifndef _XOPEN_SOURCE_EXTENDED
16398 #define _XOPEN_SOURCE_EXTENDED
16399 #endif
16400 #include <${cf_cv_ncurses_header:-curses.h}>
16401 int
16402 main (void)
16403 {
16404 void *foo = &($name['k'])
16405   ;
16406   return 0;
16407 }
16408 _ACEOF
16409 rm -f conftest.$ac_objext conftest$ac_exeext
16410 if { (eval echo "$as_me:16410: \"$ac_link\"") >&5
16411   (eval $ac_link) 2>&5
16412   ac_status=$?
16413   echo "$as_me:16413: \$? = $ac_status" >&5
16414   (exit $ac_status); } &&
16415          { ac_try='test -s conftest$ac_exeext'
16416   { (eval echo "$as_me:16416: \"$ac_try\"") >&5
16417   (eval $ac_try) 2>&5
16418   ac_status=$?
16419   echo "$as_me:16419: \$? = $ac_status" >&5
16420   (exit $ac_status); }; }; then
16421   cf_cv_curses_wacs_map=$name
16422          break
16423 else
16424   echo "$as_me: failed program was:" >&5
16425 cat conftest.$ac_ext >&5
16426 fi
16427 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16428         done
16429 fi
16430 echo "$as_me:16430: result: $cf_cv_curses_wacs_map" >&5
16431 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
16432
16433 test "$cf_cv_curses_wacs_map" != unknown &&
16434 cat >>confdefs.h <<EOF
16435 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
16436 EOF
16437
16438 echo "$as_me:16438: checking for wide alternate character constants" >&5
16439 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
16440 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
16441   echo $ECHO_N "(cached) $ECHO_C" >&6
16442 else
16443
16444 cf_cv_curses_wacs_symbols=no
16445 if test "$cf_cv_curses_wacs_map" != unknown
16446 then
16447         cat >conftest.$ac_ext <<_ACEOF
16448 #line 16448 "configure"
16449 #include "confdefs.h"
16450
16451 #ifndef _XOPEN_SOURCE_EXTENDED
16452 #define _XOPEN_SOURCE_EXTENDED
16453 #endif
16454 #include <${cf_cv_ncurses_header:-curses.h}>
16455 int
16456 main (void)
16457 {
16458 cchar_t *foo = WACS_PLUS;
16459          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
16460   ;
16461   return 0;
16462 }
16463 _ACEOF
16464 rm -f conftest.$ac_objext conftest$ac_exeext
16465 if { (eval echo "$as_me:16465: \"$ac_link\"") >&5
16466   (eval $ac_link) 2>&5
16467   ac_status=$?
16468   echo "$as_me:16468: \$? = $ac_status" >&5
16469   (exit $ac_status); } &&
16470          { ac_try='test -s conftest$ac_exeext'
16471   { (eval echo "$as_me:16471: \"$ac_try\"") >&5
16472   (eval $ac_try) 2>&5
16473   ac_status=$?
16474   echo "$as_me:16474: \$? = $ac_status" >&5
16475   (exit $ac_status); }; }; then
16476   cf_cv_curses_wacs_symbols=yes
16477 else
16478   echo "$as_me: failed program was:" >&5
16479 cat conftest.$ac_ext >&5
16480 fi
16481 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16482 else
16483         cat >conftest.$ac_ext <<_ACEOF
16484 #line 16484 "configure"
16485 #include "confdefs.h"
16486
16487 #ifndef _XOPEN_SOURCE_EXTENDED
16488 #define _XOPEN_SOURCE_EXTENDED
16489 #endif
16490 #include <${cf_cv_ncurses_header:-curses.h}>
16491 int
16492 main (void)
16493 {
16494 cchar_t *foo = WACS_PLUS
16495   ;
16496   return 0;
16497 }
16498 _ACEOF
16499 rm -f conftest.$ac_objext conftest$ac_exeext
16500 if { (eval echo "$as_me:16500: \"$ac_link\"") >&5
16501   (eval $ac_link) 2>&5
16502   ac_status=$?
16503   echo "$as_me:16503: \$? = $ac_status" >&5
16504   (exit $ac_status); } &&
16505          { ac_try='test -s conftest$ac_exeext'
16506   { (eval echo "$as_me:16506: \"$ac_try\"") >&5
16507   (eval $ac_try) 2>&5
16508   ac_status=$?
16509   echo "$as_me:16509: \$? = $ac_status" >&5
16510   (exit $ac_status); }; }; then
16511   cf_cv_curses_wacs_symbols=yes
16512 else
16513   echo "$as_me: failed program was:" >&5
16514 cat conftest.$ac_ext >&5
16515 fi
16516 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16517 fi
16518
16519 fi
16520 echo "$as_me:16520: result: $cf_cv_curses_wacs_symbols" >&5
16521 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
16522
16523 test "$cf_cv_curses_wacs_symbols" != no &&
16524 cat >>confdefs.h <<\EOF
16525 #define CURSES_WACS_SYMBOLS 1
16526 EOF
16527
16528 fi
16529
16530 echo "$as_me:16530: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16531 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16532 cat >conftest.$ac_ext <<_ACEOF
16533 #line 16533 "configure"
16534 #include "confdefs.h"
16535
16536 #ifndef _XOPEN_SOURCE_EXTENDED
16537 #define _XOPEN_SOURCE_EXTENDED
16538 #endif
16539 #include <${cf_cv_ncurses_header:-curses.h}>
16540 int
16541 main (void)
16542 {
16543
16544 attr_t foo
16545
16546   ;
16547   return 0;
16548 }
16549 _ACEOF
16550 rm -f conftest.$ac_objext
16551 if { (eval echo "$as_me:16551: \"$ac_compile\"") >&5
16552   (eval $ac_compile) 2>&5
16553   ac_status=$?
16554   echo "$as_me:16554: \$? = $ac_status" >&5
16555   (exit $ac_status); } &&
16556          { ac_try='test -s conftest.$ac_objext'
16557   { (eval echo "$as_me:16557: \"$ac_try\"") >&5
16558   (eval $ac_try) 2>&5
16559   ac_status=$?
16560   echo "$as_me:16560: \$? = $ac_status" >&5
16561   (exit $ac_status); }; }; then
16562   cf_result=yes
16563 else
16564   echo "$as_me: failed program was:" >&5
16565 cat conftest.$ac_ext >&5
16566 cf_result=no
16567 fi
16568 rm -f conftest.$ac_objext conftest.$ac_ext
16569 echo "$as_me:16569: result: $cf_result" >&5
16570 echo "${ECHO_T}$cf_result" >&6
16571 if test $cf_result = yes ; then
16572
16573 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16574
16575 cat >>confdefs.h <<EOF
16576 #define $cf_result 1
16577 EOF
16578
16579 else
16580
16581 cat >>confdefs.h <<EOF
16582 #define attr_t long
16583 EOF
16584
16585 fi
16586
16587 if test "$cf_enable_widec" = yes; then
16588
16589 # This is needed on Tru64 5.0 to declare mbstate_t
16590 echo "$as_me:16590: checking if we must include wchar.h to declare mbstate_t" >&5
16591 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
16592 if test "${cf_cv_mbstate_t+set}" = set; then
16593   echo $ECHO_N "(cached) $ECHO_C" >&6
16594 else
16595
16596 cat >conftest.$ac_ext <<_ACEOF
16597 #line 16597 "configure"
16598 #include "confdefs.h"
16599
16600 #include <stdlib.h>
16601 #include <stdarg.h>
16602 #include <stdio.h>
16603 #ifdef HAVE_LIBUTF8_H
16604 #include <libutf8.h>
16605 #endif
16606 int
16607 main (void)
16608 {
16609 mbstate_t state
16610   ;
16611   return 0;
16612 }
16613 _ACEOF
16614 rm -f conftest.$ac_objext
16615 if { (eval echo "$as_me:16615: \"$ac_compile\"") >&5
16616   (eval $ac_compile) 2>&5
16617   ac_status=$?
16618   echo "$as_me:16618: \$? = $ac_status" >&5
16619   (exit $ac_status); } &&
16620          { ac_try='test -s conftest.$ac_objext'
16621   { (eval echo "$as_me:16621: \"$ac_try\"") >&5
16622   (eval $ac_try) 2>&5
16623   ac_status=$?
16624   echo "$as_me:16624: \$? = $ac_status" >&5
16625   (exit $ac_status); }; }; then
16626   cf_cv_mbstate_t=no
16627 else
16628   echo "$as_me: failed program was:" >&5
16629 cat conftest.$ac_ext >&5
16630 cat >conftest.$ac_ext <<_ACEOF
16631 #line 16631 "configure"
16632 #include "confdefs.h"
16633
16634 #include <stdlib.h>
16635 #include <stdarg.h>
16636 #include <stdio.h>
16637 #include <wchar.h>
16638 #ifdef HAVE_LIBUTF8_H
16639 #include <libutf8.h>
16640 #endif
16641 int
16642 main (void)
16643 {
16644 mbstate_t value
16645   ;
16646   return 0;
16647 }
16648 _ACEOF
16649 rm -f conftest.$ac_objext
16650 if { (eval echo "$as_me:16650: \"$ac_compile\"") >&5
16651   (eval $ac_compile) 2>&5
16652   ac_status=$?
16653   echo "$as_me:16653: \$? = $ac_status" >&5
16654   (exit $ac_status); } &&
16655          { ac_try='test -s conftest.$ac_objext'
16656   { (eval echo "$as_me:16656: \"$ac_try\"") >&5
16657   (eval $ac_try) 2>&5
16658   ac_status=$?
16659   echo "$as_me:16659: \$? = $ac_status" >&5
16660   (exit $ac_status); }; }; then
16661   cf_cv_mbstate_t=yes
16662 else
16663   echo "$as_me: failed program was:" >&5
16664 cat conftest.$ac_ext >&5
16665 cf_cv_mbstate_t=unknown
16666 fi
16667 rm -f conftest.$ac_objext conftest.$ac_ext
16668 fi
16669 rm -f conftest.$ac_objext conftest.$ac_ext
16670 fi
16671 echo "$as_me:16671: result: $cf_cv_mbstate_t" >&5
16672 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
16673
16674 if test "$cf_cv_mbstate_t" = yes ; then
16675
16676 cat >>confdefs.h <<\EOF
16677 #define NEED_WCHAR_H 1
16678 EOF
16679
16680         NEED_WCHAR_H=1
16681 fi
16682
16683 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
16684 if test "$cf_cv_mbstate_t" = unknown ; then
16685         NCURSES_MBSTATE_T=1
16686 fi
16687
16688 # if we find mbstate_t in either place, use substitution to provide a fallback.
16689 if test "$cf_cv_mbstate_t" != unknown ; then
16690         NCURSES_OK_MBSTATE_T=1
16691 fi
16692
16693 # This is needed on Tru64 5.0 to declare wchar_t
16694 echo "$as_me:16694: checking if we must include wchar.h to declare wchar_t" >&5
16695 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
16696 if test "${cf_cv_wchar_t+set}" = set; then
16697   echo $ECHO_N "(cached) $ECHO_C" >&6
16698 else
16699
16700 cat >conftest.$ac_ext <<_ACEOF
16701 #line 16701 "configure"
16702 #include "confdefs.h"
16703
16704 #include <stdlib.h>
16705 #include <stdarg.h>
16706 #include <stdio.h>
16707 #ifdef HAVE_LIBUTF8_H
16708 #include <libutf8.h>
16709 #endif
16710 int
16711 main (void)
16712 {
16713 wchar_t state
16714   ;
16715   return 0;
16716 }
16717 _ACEOF
16718 rm -f conftest.$ac_objext
16719 if { (eval echo "$as_me:16719: \"$ac_compile\"") >&5
16720   (eval $ac_compile) 2>&5
16721   ac_status=$?
16722   echo "$as_me:16722: \$? = $ac_status" >&5
16723   (exit $ac_status); } &&
16724          { ac_try='test -s conftest.$ac_objext'
16725   { (eval echo "$as_me:16725: \"$ac_try\"") >&5
16726   (eval $ac_try) 2>&5
16727   ac_status=$?
16728   echo "$as_me:16728: \$? = $ac_status" >&5
16729   (exit $ac_status); }; }; then
16730   cf_cv_wchar_t=no
16731 else
16732   echo "$as_me: failed program was:" >&5
16733 cat conftest.$ac_ext >&5
16734 cat >conftest.$ac_ext <<_ACEOF
16735 #line 16735 "configure"
16736 #include "confdefs.h"
16737
16738 #include <stdlib.h>
16739 #include <stdarg.h>
16740 #include <stdio.h>
16741 #include <wchar.h>
16742 #ifdef HAVE_LIBUTF8_H
16743 #include <libutf8.h>
16744 #endif
16745 int
16746 main (void)
16747 {
16748 wchar_t value
16749   ;
16750   return 0;
16751 }
16752 _ACEOF
16753 rm -f conftest.$ac_objext
16754 if { (eval echo "$as_me:16754: \"$ac_compile\"") >&5
16755   (eval $ac_compile) 2>&5
16756   ac_status=$?
16757   echo "$as_me:16757: \$? = $ac_status" >&5
16758   (exit $ac_status); } &&
16759          { ac_try='test -s conftest.$ac_objext'
16760   { (eval echo "$as_me:16760: \"$ac_try\"") >&5
16761   (eval $ac_try) 2>&5
16762   ac_status=$?
16763   echo "$as_me:16763: \$? = $ac_status" >&5
16764   (exit $ac_status); }; }; then
16765   cf_cv_wchar_t=yes
16766 else
16767   echo "$as_me: failed program was:" >&5
16768 cat conftest.$ac_ext >&5
16769 cf_cv_wchar_t=unknown
16770 fi
16771 rm -f conftest.$ac_objext conftest.$ac_ext
16772 fi
16773 rm -f conftest.$ac_objext conftest.$ac_ext
16774 fi
16775 echo "$as_me:16775: result: $cf_cv_wchar_t" >&5
16776 echo "${ECHO_T}$cf_cv_wchar_t" >&6
16777
16778 if test "$cf_cv_wchar_t" = yes ; then
16779
16780 cat >>confdefs.h <<\EOF
16781 #define NEED_WCHAR_H 1
16782 EOF
16783
16784         NEED_WCHAR_H=1
16785 fi
16786
16787 # if we do not find wchar_t in either place, use substitution to provide a fallback.
16788 if test "$cf_cv_wchar_t" = unknown ; then
16789         NCURSES_WCHAR_T=1
16790 fi
16791
16792 # if we find wchar_t in either place, use substitution to provide a fallback.
16793 if test "$cf_cv_wchar_t" != unknown ; then
16794         NCURSES_OK_WCHAR_T=1
16795 fi
16796
16797 # This is needed on Tru64 5.0 to declare wint_t
16798 echo "$as_me:16798: checking if we must include wchar.h to declare wint_t" >&5
16799 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
16800 if test "${cf_cv_wint_t+set}" = set; then
16801   echo $ECHO_N "(cached) $ECHO_C" >&6
16802 else
16803
16804 cat >conftest.$ac_ext <<_ACEOF
16805 #line 16805 "configure"
16806 #include "confdefs.h"
16807
16808 #include <stdlib.h>
16809 #include <stdarg.h>
16810 #include <stdio.h>
16811 #ifdef HAVE_LIBUTF8_H
16812 #include <libutf8.h>
16813 #endif
16814 int
16815 main (void)
16816 {
16817 wint_t state
16818   ;
16819   return 0;
16820 }
16821 _ACEOF
16822 rm -f conftest.$ac_objext
16823 if { (eval echo "$as_me:16823: \"$ac_compile\"") >&5
16824   (eval $ac_compile) 2>&5
16825   ac_status=$?
16826   echo "$as_me:16826: \$? = $ac_status" >&5
16827   (exit $ac_status); } &&
16828          { ac_try='test -s conftest.$ac_objext'
16829   { (eval echo "$as_me:16829: \"$ac_try\"") >&5
16830   (eval $ac_try) 2>&5
16831   ac_status=$?
16832   echo "$as_me:16832: \$? = $ac_status" >&5
16833   (exit $ac_status); }; }; then
16834   cf_cv_wint_t=no
16835 else
16836   echo "$as_me: failed program was:" >&5
16837 cat conftest.$ac_ext >&5
16838 cat >conftest.$ac_ext <<_ACEOF
16839 #line 16839 "configure"
16840 #include "confdefs.h"
16841
16842 #include <stdlib.h>
16843 #include <stdarg.h>
16844 #include <stdio.h>
16845 #include <wchar.h>
16846 #ifdef HAVE_LIBUTF8_H
16847 #include <libutf8.h>
16848 #endif
16849 int
16850 main (void)
16851 {
16852 wint_t value
16853   ;
16854   return 0;
16855 }
16856 _ACEOF
16857 rm -f conftest.$ac_objext
16858 if { (eval echo "$as_me:16858: \"$ac_compile\"") >&5
16859   (eval $ac_compile) 2>&5
16860   ac_status=$?
16861   echo "$as_me:16861: \$? = $ac_status" >&5
16862   (exit $ac_status); } &&
16863          { ac_try='test -s conftest.$ac_objext'
16864   { (eval echo "$as_me:16864: \"$ac_try\"") >&5
16865   (eval $ac_try) 2>&5
16866   ac_status=$?
16867   echo "$as_me:16867: \$? = $ac_status" >&5
16868   (exit $ac_status); }; }; then
16869   cf_cv_wint_t=yes
16870 else
16871   echo "$as_me: failed program was:" >&5
16872 cat conftest.$ac_ext >&5
16873 cf_cv_wint_t=unknown
16874 fi
16875 rm -f conftest.$ac_objext conftest.$ac_ext
16876 fi
16877 rm -f conftest.$ac_objext conftest.$ac_ext
16878 fi
16879 echo "$as_me:16879: result: $cf_cv_wint_t" >&5
16880 echo "${ECHO_T}$cf_cv_wint_t" >&6
16881
16882 if test "$cf_cv_wint_t" = yes ; then
16883
16884 cat >>confdefs.h <<\EOF
16885 #define NEED_WCHAR_H 1
16886 EOF
16887
16888         NEED_WCHAR_H=1
16889 fi
16890
16891 # if we do not find wint_t in either place, use substitution to provide a fallback.
16892 if test "$cf_cv_wint_t" = unknown ; then
16893         NCURSES_WINT_T=1
16894 fi
16895
16896 # if we find wint_t in either place, use substitution to provide a fallback.
16897 if test "$cf_cv_wint_t" != unknown ; then
16898         NCURSES_OK_WINT_T=1
16899 fi
16900
16901         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
16902
16903 echo "$as_me:16903: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16904 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16905 cat >conftest.$ac_ext <<_ACEOF
16906 #line 16906 "configure"
16907 #include "confdefs.h"
16908
16909 #ifndef _XOPEN_SOURCE_EXTENDED
16910 #define _XOPEN_SOURCE_EXTENDED
16911 #endif
16912 #include <${cf_cv_ncurses_header:-curses.h}>
16913 int
16914 main (void)
16915 {
16916
16917 mbstate_t foo
16918
16919   ;
16920   return 0;
16921 }
16922 _ACEOF
16923 rm -f conftest.$ac_objext
16924 if { (eval echo "$as_me:16924: \"$ac_compile\"") >&5
16925   (eval $ac_compile) 2>&5
16926   ac_status=$?
16927   echo "$as_me:16927: \$? = $ac_status" >&5
16928   (exit $ac_status); } &&
16929          { ac_try='test -s conftest.$ac_objext'
16930   { (eval echo "$as_me:16930: \"$ac_try\"") >&5
16931   (eval $ac_try) 2>&5
16932   ac_status=$?
16933   echo "$as_me:16933: \$? = $ac_status" >&5
16934   (exit $ac_status); }; }; then
16935   cf_result=yes
16936 else
16937   echo "$as_me: failed program was:" >&5
16938 cat conftest.$ac_ext >&5
16939 cf_result=no
16940 fi
16941 rm -f conftest.$ac_objext conftest.$ac_ext
16942 echo "$as_me:16942: result: $cf_result" >&5
16943 echo "${ECHO_T}$cf_result" >&6
16944 if test $cf_result = yes ; then
16945
16946 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16947
16948 cat >>confdefs.h <<EOF
16949 #define $cf_result 1
16950 EOF
16951
16952 else
16953
16954 cat >>confdefs.h <<EOF
16955 #define mbstate_t long
16956 EOF
16957
16958 fi
16959
16960         fi
16961
16962         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16963
16964 echo "$as_me:16964: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16965 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16966 cat >conftest.$ac_ext <<_ACEOF
16967 #line 16967 "configure"
16968 #include "confdefs.h"
16969
16970 #ifndef _XOPEN_SOURCE_EXTENDED
16971 #define _XOPEN_SOURCE_EXTENDED
16972 #endif
16973 #include <${cf_cv_ncurses_header:-curses.h}>
16974 int
16975 main (void)
16976 {
16977
16978 wchar_t foo
16979
16980   ;
16981   return 0;
16982 }
16983 _ACEOF
16984 rm -f conftest.$ac_objext
16985 if { (eval echo "$as_me:16985: \"$ac_compile\"") >&5
16986   (eval $ac_compile) 2>&5
16987   ac_status=$?
16988   echo "$as_me:16988: \$? = $ac_status" >&5
16989   (exit $ac_status); } &&
16990          { ac_try='test -s conftest.$ac_objext'
16991   { (eval echo "$as_me:16991: \"$ac_try\"") >&5
16992   (eval $ac_try) 2>&5
16993   ac_status=$?
16994   echo "$as_me:16994: \$? = $ac_status" >&5
16995   (exit $ac_status); }; }; then
16996   cf_result=yes
16997 else
16998   echo "$as_me: failed program was:" >&5
16999 cat conftest.$ac_ext >&5
17000 cf_result=no
17001 fi
17002 rm -f conftest.$ac_objext conftest.$ac_ext
17003 echo "$as_me:17003: result: $cf_result" >&5
17004 echo "${ECHO_T}$cf_result" >&6
17005 if test $cf_result = yes ; then
17006
17007 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17008
17009 cat >>confdefs.h <<EOF
17010 #define $cf_result 1
17011 EOF
17012
17013 else
17014
17015 cat >>confdefs.h <<EOF
17016 #define wchar_t long
17017 EOF
17018
17019 fi
17020
17021         fi
17022
17023         if test "$NCURSES_OK_WINT_T" = 0 ; then
17024
17025 echo "$as_me:17025: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17026 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17027 cat >conftest.$ac_ext <<_ACEOF
17028 #line 17028 "configure"
17029 #include "confdefs.h"
17030
17031 #ifndef _XOPEN_SOURCE_EXTENDED
17032 #define _XOPEN_SOURCE_EXTENDED
17033 #endif
17034 #include <${cf_cv_ncurses_header:-curses.h}>
17035 int
17036 main (void)
17037 {
17038
17039 wint_t foo
17040
17041   ;
17042   return 0;
17043 }
17044 _ACEOF
17045 rm -f conftest.$ac_objext
17046 if { (eval echo "$as_me:17046: \"$ac_compile\"") >&5
17047   (eval $ac_compile) 2>&5
17048   ac_status=$?
17049   echo "$as_me:17049: \$? = $ac_status" >&5
17050   (exit $ac_status); } &&
17051          { ac_try='test -s conftest.$ac_objext'
17052   { (eval echo "$as_me:17052: \"$ac_try\"") >&5
17053   (eval $ac_try) 2>&5
17054   ac_status=$?
17055   echo "$as_me:17055: \$? = $ac_status" >&5
17056   (exit $ac_status); }; }; then
17057   cf_result=yes
17058 else
17059   echo "$as_me: failed program was:" >&5
17060 cat conftest.$ac_ext >&5
17061 cf_result=no
17062 fi
17063 rm -f conftest.$ac_objext conftest.$ac_ext
17064 echo "$as_me:17064: result: $cf_result" >&5
17065 echo "${ECHO_T}$cf_result" >&6
17066 if test $cf_result = yes ; then
17067
17068 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17069
17070 cat >>confdefs.h <<EOF
17071 #define $cf_result 1
17072 EOF
17073
17074 else
17075
17076 cat >>confdefs.h <<EOF
17077 #define wint_t long
17078 EOF
17079
17080 fi
17081
17082         fi
17083 fi
17084
17085 for cf_data in curscr
17086 do
17087 echo "$as_me:17087: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17088 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17089
17090 cat >conftest.$ac_ext <<_ACEOF
17091 #line 17091 "configure"
17092 #include "confdefs.h"
17093
17094 #ifdef HAVE_XCURSES
17095 #include <xcurses.h>
17096 char * XCursesProgramName = "test";
17097 #else
17098 #include <${cf_cv_ncurses_header:-curses.h}>
17099 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17100 #include <ncursesw/term.h>
17101 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17102 #include <ncurses/term.h>
17103 #elif defined(HAVE_TERM_H)
17104 #include <term.h>
17105 #endif
17106 #endif
17107
17108 int
17109 main (void)
17110 {
17111
17112 void *foo = &($cf_data)
17113
17114   ;
17115   return 0;
17116 }
17117 _ACEOF
17118 rm -f conftest.$ac_objext
17119 if { (eval echo "$as_me:17119: \"$ac_compile\"") >&5
17120   (eval $ac_compile) 2>&5
17121   ac_status=$?
17122   echo "$as_me:17122: \$? = $ac_status" >&5
17123   (exit $ac_status); } &&
17124          { ac_try='test -s conftest.$ac_objext'
17125   { (eval echo "$as_me:17125: \"$ac_try\"") >&5
17126   (eval $ac_try) 2>&5
17127   ac_status=$?
17128   echo "$as_me:17128: \$? = $ac_status" >&5
17129   (exit $ac_status); }; }; then
17130   cf_result=yes
17131
17132 else
17133   echo "$as_me: failed program was:" >&5
17134 cat conftest.$ac_ext >&5
17135 cf_result=no
17136 fi
17137 rm -f conftest.$ac_objext conftest.$ac_ext
17138 echo "$as_me:17138: result: $cf_result" >&5
17139 echo "${ECHO_T}$cf_result" >&6
17140
17141 if test $cf_result = yes ; then
17142
17143 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17144
17145         cat >>confdefs.h <<EOF
17146 #define $cf_result 1
17147 EOF
17148
17149 else
17150         echo "$as_me:17150: checking for data $cf_data in library" >&5
17151 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17152         # BSD linkers insist on making weak linkage, but resolve at runtime.
17153         if test "$cross_compiling" = yes; then
17154
17155         # cross-compiling
17156         cat >conftest.$ac_ext <<_ACEOF
17157 #line 17157 "configure"
17158 #include "confdefs.h"
17159
17160 #ifdef HAVE_XCURSES
17161 #include <xcurses.h>
17162 char * XCursesProgramName = "test";
17163 #else
17164 #include <${cf_cv_ncurses_header:-curses.h}>
17165 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17166 #include <ncursesw/term.h>
17167 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17168 #include <ncurses/term.h>
17169 #elif defined(HAVE_TERM_H)
17170 #include <term.h>
17171 #endif
17172 #endif
17173
17174 extern char $cf_data;
17175 int
17176 main (void)
17177 {
17178
17179         do {
17180                 void *foo = &($cf_data);
17181                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17182                 ${cf_cv_main_return:-return}(foo == 0);
17183         } while (0)
17184
17185   ;
17186   return 0;
17187 }
17188 _ACEOF
17189 rm -f conftest.$ac_objext conftest$ac_exeext
17190 if { (eval echo "$as_me:17190: \"$ac_link\"") >&5
17191   (eval $ac_link) 2>&5
17192   ac_status=$?
17193   echo "$as_me:17193: \$? = $ac_status" >&5
17194   (exit $ac_status); } &&
17195          { ac_try='test -s 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 else
17203   echo "$as_me: failed program was:" >&5
17204 cat conftest.$ac_ext >&5
17205 cf_result=no
17206 fi
17207 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17208
17209 else
17210   cat >conftest.$ac_ext <<_ACEOF
17211 #line 17211 "configure"
17212 #include "confdefs.h"
17213
17214 #ifdef HAVE_XCURSES
17215 #include <xcurses.h>
17216 char * XCursesProgramName = "test";
17217 #else
17218 #include <${cf_cv_ncurses_header:-curses.h}>
17219 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17220 #include <ncursesw/term.h>
17221 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17222 #include <ncurses/term.h>
17223 #elif defined(HAVE_TERM_H)
17224 #include <term.h>
17225 #endif
17226 #endif
17227
17228 extern char $cf_data;
17229 int main(void)
17230 {
17231         void *foo = &($cf_data);
17232         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17233         ${cf_cv_main_return:-return}(foo == 0);
17234 }
17235 _ACEOF
17236 rm -f conftest$ac_exeext
17237 if { (eval echo "$as_me:17237: \"$ac_link\"") >&5
17238   (eval $ac_link) 2>&5
17239   ac_status=$?
17240   echo "$as_me:17240: \$? = $ac_status" >&5
17241   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17242   { (eval echo "$as_me:17242: \"$ac_try\"") >&5
17243   (eval $ac_try) 2>&5
17244   ac_status=$?
17245   echo "$as_me:17245: \$? = $ac_status" >&5
17246   (exit $ac_status); }; }; then
17247   cf_result=yes
17248
17249 else
17250   echo "$as_me: program exited with status $ac_status" >&5
17251 echo "$as_me: failed program was:" >&5
17252 cat conftest.$ac_ext >&5
17253 cf_result=no
17254 fi
17255 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17256 fi
17257         echo "$as_me:17257: result: $cf_result" >&5
17258 echo "${ECHO_T}$cf_result" >&6
17259         if test $cf_result = yes ; then
17260
17261 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17262
17263                 cat >>confdefs.h <<EOF
17264 #define $cf_result 1
17265 EOF
17266
17267                 # do not exit loop here, since we prefer system's declarations
17268         fi
17269 fi
17270 done
17271
17272 for cf_data in ospeed
17273 do
17274 echo "$as_me:17274: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17275 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17276
17277 cat >conftest.$ac_ext <<_ACEOF
17278 #line 17278 "configure"
17279 #include "confdefs.h"
17280
17281 #ifdef HAVE_XCURSES
17282 #include <xcurses.h>
17283 char * XCursesProgramName = "test";
17284 #else
17285 #include <${cf_cv_ncurses_header:-curses.h}>
17286 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17287 #include <ncursesw/term.h>
17288 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17289 #include <ncurses/term.h>
17290 #elif defined(HAVE_TERM_H)
17291 #include <term.h>
17292 #endif
17293 #endif
17294
17295 int
17296 main (void)
17297 {
17298
17299 void *foo = &($cf_data)
17300
17301   ;
17302   return 0;
17303 }
17304 _ACEOF
17305 rm -f conftest.$ac_objext
17306 if { (eval echo "$as_me:17306: \"$ac_compile\"") >&5
17307   (eval $ac_compile) 2>&5
17308   ac_status=$?
17309   echo "$as_me:17309: \$? = $ac_status" >&5
17310   (exit $ac_status); } &&
17311          { ac_try='test -s conftest.$ac_objext'
17312   { (eval echo "$as_me:17312: \"$ac_try\"") >&5
17313   (eval $ac_try) 2>&5
17314   ac_status=$?
17315   echo "$as_me:17315: \$? = $ac_status" >&5
17316   (exit $ac_status); }; }; then
17317   cf_result=yes
17318
17319 else
17320   echo "$as_me: failed program was:" >&5
17321 cat conftest.$ac_ext >&5
17322 cf_result=no
17323 fi
17324 rm -f conftest.$ac_objext conftest.$ac_ext
17325 echo "$as_me:17325: result: $cf_result" >&5
17326 echo "${ECHO_T}$cf_result" >&6
17327
17328 if test $cf_result = yes ; then
17329
17330 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17331
17332         cat >>confdefs.h <<EOF
17333 #define $cf_result 1
17334 EOF
17335
17336 else
17337         echo "$as_me:17337: checking for data $cf_data in library" >&5
17338 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17339         # BSD linkers insist on making weak linkage, but resolve at runtime.
17340         if test "$cross_compiling" = yes; then
17341
17342         # cross-compiling
17343         cat >conftest.$ac_ext <<_ACEOF
17344 #line 17344 "configure"
17345 #include "confdefs.h"
17346
17347 #ifdef HAVE_XCURSES
17348 #include <xcurses.h>
17349 char * XCursesProgramName = "test";
17350 #else
17351 #include <${cf_cv_ncurses_header:-curses.h}>
17352 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17353 #include <ncursesw/term.h>
17354 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17355 #include <ncurses/term.h>
17356 #elif defined(HAVE_TERM_H)
17357 #include <term.h>
17358 #endif
17359 #endif
17360
17361 extern char $cf_data;
17362 int
17363 main (void)
17364 {
17365
17366         do {
17367                 void *foo = &($cf_data);
17368                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17369                 ${cf_cv_main_return:-return}(foo == 0);
17370         } while (0)
17371
17372   ;
17373   return 0;
17374 }
17375 _ACEOF
17376 rm -f conftest.$ac_objext conftest$ac_exeext
17377 if { (eval echo "$as_me:17377: \"$ac_link\"") >&5
17378   (eval $ac_link) 2>&5
17379   ac_status=$?
17380   echo "$as_me:17380: \$? = $ac_status" >&5
17381   (exit $ac_status); } &&
17382          { ac_try='test -s 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 else
17390   echo "$as_me: failed program was:" >&5
17391 cat conftest.$ac_ext >&5
17392 cf_result=no
17393 fi
17394 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17395
17396 else
17397   cat >conftest.$ac_ext <<_ACEOF
17398 #line 17398 "configure"
17399 #include "confdefs.h"
17400
17401 #ifdef HAVE_XCURSES
17402 #include <xcurses.h>
17403 char * XCursesProgramName = "test";
17404 #else
17405 #include <${cf_cv_ncurses_header:-curses.h}>
17406 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17407 #include <ncursesw/term.h>
17408 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17409 #include <ncurses/term.h>
17410 #elif defined(HAVE_TERM_H)
17411 #include <term.h>
17412 #endif
17413 #endif
17414
17415 extern char $cf_data;
17416 int main(void)
17417 {
17418         void *foo = &($cf_data);
17419         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17420         ${cf_cv_main_return:-return}(foo == 0);
17421 }
17422 _ACEOF
17423 rm -f conftest$ac_exeext
17424 if { (eval echo "$as_me:17424: \"$ac_link\"") >&5
17425   (eval $ac_link) 2>&5
17426   ac_status=$?
17427   echo "$as_me:17427: \$? = $ac_status" >&5
17428   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17429   { (eval echo "$as_me:17429: \"$ac_try\"") >&5
17430   (eval $ac_try) 2>&5
17431   ac_status=$?
17432   echo "$as_me:17432: \$? = $ac_status" >&5
17433   (exit $ac_status); }; }; then
17434   cf_result=yes
17435
17436 else
17437   echo "$as_me: program exited with status $ac_status" >&5
17438 echo "$as_me: failed program was:" >&5
17439 cat conftest.$ac_ext >&5
17440 cf_result=no
17441 fi
17442 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17443 fi
17444         echo "$as_me:17444: result: $cf_result" >&5
17445 echo "${ECHO_T}$cf_result" >&6
17446         if test $cf_result = yes ; then
17447
17448 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17449
17450                 cat >>confdefs.h <<EOF
17451 #define $cf_result 1
17452 EOF
17453
17454                 # do not exit loop here, since we prefer system's declarations
17455         fi
17456 fi
17457 done
17458
17459 for cf_data in boolnames
17460 do
17461 echo "$as_me:17461: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17462 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17463
17464 cat >conftest.$ac_ext <<_ACEOF
17465 #line 17465 "configure"
17466 #include "confdefs.h"
17467
17468 #ifdef HAVE_XCURSES
17469 #include <xcurses.h>
17470 char * XCursesProgramName = "test";
17471 #else
17472 #include <${cf_cv_ncurses_header:-curses.h}>
17473 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17474 #include <ncursesw/term.h>
17475 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17476 #include <ncurses/term.h>
17477 #elif defined(HAVE_TERM_H)
17478 #include <term.h>
17479 #endif
17480 #endif
17481
17482 int
17483 main (void)
17484 {
17485
17486 void *foo = &($cf_data)
17487
17488   ;
17489   return 0;
17490 }
17491 _ACEOF
17492 rm -f conftest.$ac_objext
17493 if { (eval echo "$as_me:17493: \"$ac_compile\"") >&5
17494   (eval $ac_compile) 2>&5
17495   ac_status=$?
17496   echo "$as_me:17496: \$? = $ac_status" >&5
17497   (exit $ac_status); } &&
17498          { ac_try='test -s conftest.$ac_objext'
17499   { (eval echo "$as_me:17499: \"$ac_try\"") >&5
17500   (eval $ac_try) 2>&5
17501   ac_status=$?
17502   echo "$as_me:17502: \$? = $ac_status" >&5
17503   (exit $ac_status); }; }; then
17504   cf_result=yes
17505
17506 else
17507   echo "$as_me: failed program was:" >&5
17508 cat conftest.$ac_ext >&5
17509 cf_result=no
17510 fi
17511 rm -f conftest.$ac_objext conftest.$ac_ext
17512 echo "$as_me:17512: result: $cf_result" >&5
17513 echo "${ECHO_T}$cf_result" >&6
17514
17515 if test $cf_result = yes ; then
17516
17517 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17518
17519         cat >>confdefs.h <<EOF
17520 #define $cf_result 1
17521 EOF
17522
17523 else
17524         echo "$as_me:17524: checking for data $cf_data in library" >&5
17525 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17526         # BSD linkers insist on making weak linkage, but resolve at runtime.
17527         if test "$cross_compiling" = yes; then
17528
17529         # cross-compiling
17530         cat >conftest.$ac_ext <<_ACEOF
17531 #line 17531 "configure"
17532 #include "confdefs.h"
17533
17534 #ifdef HAVE_XCURSES
17535 #include <xcurses.h>
17536 char * XCursesProgramName = "test";
17537 #else
17538 #include <${cf_cv_ncurses_header:-curses.h}>
17539 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17540 #include <ncursesw/term.h>
17541 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17542 #include <ncurses/term.h>
17543 #elif defined(HAVE_TERM_H)
17544 #include <term.h>
17545 #endif
17546 #endif
17547
17548 extern char $cf_data;
17549 int
17550 main (void)
17551 {
17552
17553         do {
17554                 void *foo = &($cf_data);
17555                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17556                 ${cf_cv_main_return:-return}(foo == 0);
17557         } while (0)
17558
17559   ;
17560   return 0;
17561 }
17562 _ACEOF
17563 rm -f conftest.$ac_objext conftest$ac_exeext
17564 if { (eval echo "$as_me:17564: \"$ac_link\"") >&5
17565   (eval $ac_link) 2>&5
17566   ac_status=$?
17567   echo "$as_me:17567: \$? = $ac_status" >&5
17568   (exit $ac_status); } &&
17569          { ac_try='test -s 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 else
17577   echo "$as_me: failed program was:" >&5
17578 cat conftest.$ac_ext >&5
17579 cf_result=no
17580 fi
17581 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17582
17583 else
17584   cat >conftest.$ac_ext <<_ACEOF
17585 #line 17585 "configure"
17586 #include "confdefs.h"
17587
17588 #ifdef HAVE_XCURSES
17589 #include <xcurses.h>
17590 char * XCursesProgramName = "test";
17591 #else
17592 #include <${cf_cv_ncurses_header:-curses.h}>
17593 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17594 #include <ncursesw/term.h>
17595 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17596 #include <ncurses/term.h>
17597 #elif defined(HAVE_TERM_H)
17598 #include <term.h>
17599 #endif
17600 #endif
17601
17602 extern char $cf_data;
17603 int main(void)
17604 {
17605         void *foo = &($cf_data);
17606         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17607         ${cf_cv_main_return:-return}(foo == 0);
17608 }
17609 _ACEOF
17610 rm -f conftest$ac_exeext
17611 if { (eval echo "$as_me:17611: \"$ac_link\"") >&5
17612   (eval $ac_link) 2>&5
17613   ac_status=$?
17614   echo "$as_me:17614: \$? = $ac_status" >&5
17615   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17616   { (eval echo "$as_me:17616: \"$ac_try\"") >&5
17617   (eval $ac_try) 2>&5
17618   ac_status=$?
17619   echo "$as_me:17619: \$? = $ac_status" >&5
17620   (exit $ac_status); }; }; then
17621   cf_result=yes
17622
17623 else
17624   echo "$as_me: program exited with status $ac_status" >&5
17625 echo "$as_me: failed program was:" >&5
17626 cat conftest.$ac_ext >&5
17627 cf_result=no
17628 fi
17629 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17630 fi
17631         echo "$as_me:17631: result: $cf_result" >&5
17632 echo "${ECHO_T}$cf_result" >&6
17633         if test $cf_result = yes ; then
17634
17635 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17636
17637                 cat >>confdefs.h <<EOF
17638 #define $cf_result 1
17639 EOF
17640
17641                 # do not exit loop here, since we prefer system's declarations
17642         fi
17643 fi
17644 done
17645
17646 for cf_data in boolfnames
17647 do
17648 echo "$as_me:17648: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17649 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17650
17651 cat >conftest.$ac_ext <<_ACEOF
17652 #line 17652 "configure"
17653 #include "confdefs.h"
17654
17655 #ifdef HAVE_XCURSES
17656 #include <xcurses.h>
17657 char * XCursesProgramName = "test";
17658 #else
17659 #include <${cf_cv_ncurses_header:-curses.h}>
17660 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17661 #include <ncursesw/term.h>
17662 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17663 #include <ncurses/term.h>
17664 #elif defined(HAVE_TERM_H)
17665 #include <term.h>
17666 #endif
17667 #endif
17668
17669 int
17670 main (void)
17671 {
17672
17673 void *foo = &($cf_data)
17674
17675   ;
17676   return 0;
17677 }
17678 _ACEOF
17679 rm -f conftest.$ac_objext
17680 if { (eval echo "$as_me:17680: \"$ac_compile\"") >&5
17681   (eval $ac_compile) 2>&5
17682   ac_status=$?
17683   echo "$as_me:17683: \$? = $ac_status" >&5
17684   (exit $ac_status); } &&
17685          { ac_try='test -s conftest.$ac_objext'
17686   { (eval echo "$as_me:17686: \"$ac_try\"") >&5
17687   (eval $ac_try) 2>&5
17688   ac_status=$?
17689   echo "$as_me:17689: \$? = $ac_status" >&5
17690   (exit $ac_status); }; }; then
17691   cf_result=yes
17692
17693 else
17694   echo "$as_me: failed program was:" >&5
17695 cat conftest.$ac_ext >&5
17696 cf_result=no
17697 fi
17698 rm -f conftest.$ac_objext conftest.$ac_ext
17699 echo "$as_me:17699: result: $cf_result" >&5
17700 echo "${ECHO_T}$cf_result" >&6
17701
17702 if test $cf_result = yes ; then
17703
17704 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17705
17706         cat >>confdefs.h <<EOF
17707 #define $cf_result 1
17708 EOF
17709
17710 else
17711         echo "$as_me:17711: checking for data $cf_data in library" >&5
17712 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17713         # BSD linkers insist on making weak linkage, but resolve at runtime.
17714         if test "$cross_compiling" = yes; then
17715
17716         # cross-compiling
17717         cat >conftest.$ac_ext <<_ACEOF
17718 #line 17718 "configure"
17719 #include "confdefs.h"
17720
17721 #ifdef HAVE_XCURSES
17722 #include <xcurses.h>
17723 char * XCursesProgramName = "test";
17724 #else
17725 #include <${cf_cv_ncurses_header:-curses.h}>
17726 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17727 #include <ncursesw/term.h>
17728 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17729 #include <ncurses/term.h>
17730 #elif defined(HAVE_TERM_H)
17731 #include <term.h>
17732 #endif
17733 #endif
17734
17735 extern char $cf_data;
17736 int
17737 main (void)
17738 {
17739
17740         do {
17741                 void *foo = &($cf_data);
17742                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17743                 ${cf_cv_main_return:-return}(foo == 0);
17744         } while (0)
17745
17746   ;
17747   return 0;
17748 }
17749 _ACEOF
17750 rm -f conftest.$ac_objext conftest$ac_exeext
17751 if { (eval echo "$as_me:17751: \"$ac_link\"") >&5
17752   (eval $ac_link) 2>&5
17753   ac_status=$?
17754   echo "$as_me:17754: \$? = $ac_status" >&5
17755   (exit $ac_status); } &&
17756          { ac_try='test -s 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 else
17764   echo "$as_me: failed program was:" >&5
17765 cat conftest.$ac_ext >&5
17766 cf_result=no
17767 fi
17768 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17769
17770 else
17771   cat >conftest.$ac_ext <<_ACEOF
17772 #line 17772 "configure"
17773 #include "confdefs.h"
17774
17775 #ifdef HAVE_XCURSES
17776 #include <xcurses.h>
17777 char * XCursesProgramName = "test";
17778 #else
17779 #include <${cf_cv_ncurses_header:-curses.h}>
17780 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17781 #include <ncursesw/term.h>
17782 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17783 #include <ncurses/term.h>
17784 #elif defined(HAVE_TERM_H)
17785 #include <term.h>
17786 #endif
17787 #endif
17788
17789 extern char $cf_data;
17790 int main(void)
17791 {
17792         void *foo = &($cf_data);
17793         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17794         ${cf_cv_main_return:-return}(foo == 0);
17795 }
17796 _ACEOF
17797 rm -f conftest$ac_exeext
17798 if { (eval echo "$as_me:17798: \"$ac_link\"") >&5
17799   (eval $ac_link) 2>&5
17800   ac_status=$?
17801   echo "$as_me:17801: \$? = $ac_status" >&5
17802   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17803   { (eval echo "$as_me:17803: \"$ac_try\"") >&5
17804   (eval $ac_try) 2>&5
17805   ac_status=$?
17806   echo "$as_me:17806: \$? = $ac_status" >&5
17807   (exit $ac_status); }; }; then
17808   cf_result=yes
17809
17810 else
17811   echo "$as_me: program exited with status $ac_status" >&5
17812 echo "$as_me: failed program was:" >&5
17813 cat conftest.$ac_ext >&5
17814 cf_result=no
17815 fi
17816 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17817 fi
17818         echo "$as_me:17818: result: $cf_result" >&5
17819 echo "${ECHO_T}$cf_result" >&6
17820         if test $cf_result = yes ; then
17821
17822 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17823
17824                 cat >>confdefs.h <<EOF
17825 #define $cf_result 1
17826 EOF
17827
17828                 # do not exit loop here, since we prefer system's declarations
17829         fi
17830 fi
17831 done
17832
17833 for cf_data in ttytype
17834 do
17835 echo "$as_me:17835: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17836 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17837
17838 cat >conftest.$ac_ext <<_ACEOF
17839 #line 17839 "configure"
17840 #include "confdefs.h"
17841
17842 #ifdef HAVE_XCURSES
17843 #include <xcurses.h>
17844 char * XCursesProgramName = "test";
17845 #else
17846 #include <${cf_cv_ncurses_header:-curses.h}>
17847 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17848 #include <ncursesw/term.h>
17849 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17850 #include <ncurses/term.h>
17851 #elif defined(HAVE_TERM_H)
17852 #include <term.h>
17853 #endif
17854 #endif
17855
17856 int
17857 main (void)
17858 {
17859
17860 void *foo = &($cf_data)
17861
17862   ;
17863   return 0;
17864 }
17865 _ACEOF
17866 rm -f conftest.$ac_objext
17867 if { (eval echo "$as_me:17867: \"$ac_compile\"") >&5
17868   (eval $ac_compile) 2>&5
17869   ac_status=$?
17870   echo "$as_me:17870: \$? = $ac_status" >&5
17871   (exit $ac_status); } &&
17872          { ac_try='test -s conftest.$ac_objext'
17873   { (eval echo "$as_me:17873: \"$ac_try\"") >&5
17874   (eval $ac_try) 2>&5
17875   ac_status=$?
17876   echo "$as_me:17876: \$? = $ac_status" >&5
17877   (exit $ac_status); }; }; then
17878   cf_result=yes
17879
17880 else
17881   echo "$as_me: failed program was:" >&5
17882 cat conftest.$ac_ext >&5
17883 cf_result=no
17884 fi
17885 rm -f conftest.$ac_objext conftest.$ac_ext
17886 echo "$as_me:17886: result: $cf_result" >&5
17887 echo "${ECHO_T}$cf_result" >&6
17888
17889 if test $cf_result = yes ; then
17890
17891 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17892
17893         cat >>confdefs.h <<EOF
17894 #define $cf_result 1
17895 EOF
17896
17897 else
17898         echo "$as_me:17898: checking for data $cf_data in library" >&5
17899 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17900         # BSD linkers insist on making weak linkage, but resolve at runtime.
17901         if test "$cross_compiling" = yes; then
17902
17903         # cross-compiling
17904         cat >conftest.$ac_ext <<_ACEOF
17905 #line 17905 "configure"
17906 #include "confdefs.h"
17907
17908 #ifdef HAVE_XCURSES
17909 #include <xcurses.h>
17910 char * XCursesProgramName = "test";
17911 #else
17912 #include <${cf_cv_ncurses_header:-curses.h}>
17913 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17914 #include <ncursesw/term.h>
17915 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17916 #include <ncurses/term.h>
17917 #elif defined(HAVE_TERM_H)
17918 #include <term.h>
17919 #endif
17920 #endif
17921
17922 extern char $cf_data;
17923 int
17924 main (void)
17925 {
17926
17927         do {
17928                 void *foo = &($cf_data);
17929                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17930                 ${cf_cv_main_return:-return}(foo == 0);
17931         } while (0)
17932
17933   ;
17934   return 0;
17935 }
17936 _ACEOF
17937 rm -f conftest.$ac_objext conftest$ac_exeext
17938 if { (eval echo "$as_me:17938: \"$ac_link\"") >&5
17939   (eval $ac_link) 2>&5
17940   ac_status=$?
17941   echo "$as_me:17941: \$? = $ac_status" >&5
17942   (exit $ac_status); } &&
17943          { ac_try='test -s conftest$ac_exeext'
17944   { (eval echo "$as_me:17944: \"$ac_try\"") >&5
17945   (eval $ac_try) 2>&5
17946   ac_status=$?
17947   echo "$as_me:17947: \$? = $ac_status" >&5
17948   (exit $ac_status); }; }; then
17949   cf_result=yes
17950 else
17951   echo "$as_me: failed program was:" >&5
17952 cat conftest.$ac_ext >&5
17953 cf_result=no
17954 fi
17955 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17956
17957 else
17958   cat >conftest.$ac_ext <<_ACEOF
17959 #line 17959 "configure"
17960 #include "confdefs.h"
17961
17962 #ifdef HAVE_XCURSES
17963 #include <xcurses.h>
17964 char * XCursesProgramName = "test";
17965 #else
17966 #include <${cf_cv_ncurses_header:-curses.h}>
17967 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17968 #include <ncursesw/term.h>
17969 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17970 #include <ncurses/term.h>
17971 #elif defined(HAVE_TERM_H)
17972 #include <term.h>
17973 #endif
17974 #endif
17975
17976 extern char $cf_data;
17977 int main(void)
17978 {
17979         void *foo = &($cf_data);
17980         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17981         ${cf_cv_main_return:-return}(foo == 0);
17982 }
17983 _ACEOF
17984 rm -f conftest$ac_exeext
17985 if { (eval echo "$as_me:17985: \"$ac_link\"") >&5
17986   (eval $ac_link) 2>&5
17987   ac_status=$?
17988   echo "$as_me:17988: \$? = $ac_status" >&5
17989   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17990   { (eval echo "$as_me:17990: \"$ac_try\"") >&5
17991   (eval $ac_try) 2>&5
17992   ac_status=$?
17993   echo "$as_me:17993: \$? = $ac_status" >&5
17994   (exit $ac_status); }; }; then
17995   cf_result=yes
17996
17997 else
17998   echo "$as_me: program exited with status $ac_status" >&5
17999 echo "$as_me: failed program was:" >&5
18000 cat conftest.$ac_ext >&5
18001 cf_result=no
18002 fi
18003 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18004 fi
18005         echo "$as_me:18005: result: $cf_result" >&5
18006 echo "${ECHO_T}$cf_result" >&6
18007         if test $cf_result = yes ; then
18008
18009 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18010
18011                 cat >>confdefs.h <<EOF
18012 #define $cf_result 1
18013 EOF
18014
18015                 # do not exit loop here, since we prefer system's declarations
18016         fi
18017 fi
18018 done
18019
18020 if ( test "$GCC" = yes || test "$GXX" = yes )
18021 then
18022 echo "$as_me:18022: checking if you want to turn on gcc warnings" >&5
18023 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
18024
18025 # Check whether --enable-warnings or --disable-warnings was given.
18026 if test "${enable_warnings+set}" = set; then
18027   enableval="$enable_warnings"
18028   test "$enableval" != yes && enableval=no
18029         if test "$enableval" != "no" ; then
18030     with_warnings=yes
18031         else
18032                 with_warnings=no
18033         fi
18034 else
18035   enableval=no
18036         with_warnings=no
18037
18038 fi;
18039 echo "$as_me:18039: result: $with_warnings" >&5
18040 echo "${ECHO_T}$with_warnings" >&6
18041 if test "$with_warnings" = "yes"
18042 then
18043
18044 if test "$GCC" = yes
18045 then
18046 cat > conftest.i <<EOF
18047 #ifndef GCC_PRINTF
18048 #define GCC_PRINTF 0
18049 #endif
18050 #ifndef GCC_SCANF
18051 #define GCC_SCANF 0
18052 #endif
18053 #ifndef GCC_NORETURN
18054 #define GCC_NORETURN /* nothing */
18055 #endif
18056 #ifndef GCC_UNUSED
18057 #define GCC_UNUSED /* nothing */
18058 #endif
18059 EOF
18060 if test "$GCC" = yes
18061 then
18062         { echo "$as_me:18062: checking for $CC __attribute__ directives..." >&5
18063 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
18064 cat > conftest.$ac_ext <<EOF
18065 #line 18065 "${as_me:-configure}"
18066 #include "confdefs.h"
18067 #include "conftest.h"
18068 #include "conftest.i"
18069 #if     GCC_PRINTF
18070 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
18071 #else
18072 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
18073 #endif
18074 #if     GCC_SCANF
18075 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
18076 #else
18077 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
18078 #endif
18079 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
18080 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
18081 extern void foo(void) GCC_NORETURN;
18082 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
18083 EOF
18084         cf_printf_attribute=no
18085         cf_scanf_attribute=no
18086         for cf_attribute in scanf printf unused noreturn
18087         do
18088
18089 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18090
18091                 cf_directive="__attribute__(($cf_attribute))"
18092                 echo "checking for $CC $cf_directive" 1>&5
18093
18094                 case $cf_attribute in
18095                 (printf)
18096                         cf_printf_attribute=yes
18097                         cat >conftest.h <<EOF
18098 #define GCC_$cf_ATTRIBUTE 1
18099 EOF
18100                         ;;
18101                 (scanf)
18102                         cf_scanf_attribute=yes
18103                         cat >conftest.h <<EOF
18104 #define GCC_$cf_ATTRIBUTE 1
18105 EOF
18106                         ;;
18107                 (*)
18108                         cat >conftest.h <<EOF
18109 #define GCC_$cf_ATTRIBUTE $cf_directive
18110 EOF
18111                         ;;
18112                 esac
18113
18114                 if { (eval echo "$as_me:18114: \"$ac_compile\"") >&5
18115   (eval $ac_compile) 2>&5
18116   ac_status=$?
18117   echo "$as_me:18117: \$? = $ac_status" >&5
18118   (exit $ac_status); }; then
18119                         test -n "$verbose" && echo "$as_me:18119: result: ... $cf_attribute" >&5
18120 echo "${ECHO_T}... $cf_attribute" >&6
18121                         cat conftest.h >>confdefs.h
18122                         case $cf_attribute in
18123                         (noreturn)
18124
18125 cat >>confdefs.h <<EOF
18126 #define GCC_NORETURN $cf_directive
18127 EOF
18128
18129                                 ;;
18130                         (printf)
18131                                 cf_value='/* nothing */'
18132                                 if test "$cf_printf_attribute" != no ; then
18133                                         cf_value='__attribute__((format(printf,fmt,var)))'
18134
18135 cat >>confdefs.h <<\EOF
18136 #define GCC_PRINTF 1
18137 EOF
18138
18139                                 fi
18140
18141 cat >>confdefs.h <<EOF
18142 #define GCC_PRINTFLIKE(fmt,var) $cf_value
18143 EOF
18144
18145                                 ;;
18146                         (scanf)
18147                                 cf_value='/* nothing */'
18148                                 if test "$cf_scanf_attribute" != no ; then
18149                                         cf_value='__attribute__((format(scanf,fmt,var)))'
18150
18151 cat >>confdefs.h <<\EOF
18152 #define GCC_SCANF 1
18153 EOF
18154
18155                                 fi
18156
18157 cat >>confdefs.h <<EOF
18158 #define GCC_SCANFLIKE(fmt,var) $cf_value
18159 EOF
18160
18161                                 ;;
18162                         (unused)
18163
18164 cat >>confdefs.h <<EOF
18165 #define GCC_UNUSED $cf_directive
18166 EOF
18167
18168                                 ;;
18169                         esac
18170                 fi
18171         done
18172 else
18173         fgrep define conftest.i >>confdefs.h
18174 fi
18175 rm -rf conftest*
18176 fi
18177
18178 INTEL_COMPILER=no
18179
18180 if test "$GCC" = yes ; then
18181         case $host_os in
18182         (linux*|gnu*)
18183                 echo "$as_me:18183: checking if this is really Intel C compiler" >&5
18184 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
18185                 cf_save_CFLAGS="$CFLAGS"
18186                 CFLAGS="$CFLAGS -no-gcc"
18187                 cat >conftest.$ac_ext <<_ACEOF
18188 #line 18188 "configure"
18189 #include "confdefs.h"
18190
18191 int
18192 main (void)
18193 {
18194
18195 #ifdef __INTEL_COMPILER
18196 #else
18197 make an error
18198 #endif
18199
18200   ;
18201   return 0;
18202 }
18203 _ACEOF
18204 rm -f conftest.$ac_objext
18205 if { (eval echo "$as_me:18205: \"$ac_compile\"") >&5
18206   (eval $ac_compile) 2>&5
18207   ac_status=$?
18208   echo "$as_me:18208: \$? = $ac_status" >&5
18209   (exit $ac_status); } &&
18210          { ac_try='test -s conftest.$ac_objext'
18211   { (eval echo "$as_me:18211: \"$ac_try\"") >&5
18212   (eval $ac_try) 2>&5
18213   ac_status=$?
18214   echo "$as_me:18214: \$? = $ac_status" >&5
18215   (exit $ac_status); }; }; then
18216   INTEL_COMPILER=yes
18217 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
18218
18219 else
18220   echo "$as_me: failed program was:" >&5
18221 cat conftest.$ac_ext >&5
18222 fi
18223 rm -f conftest.$ac_objext conftest.$ac_ext
18224                 CFLAGS="$cf_save_CFLAGS"
18225                 echo "$as_me:18225: result: $INTEL_COMPILER" >&5
18226 echo "${ECHO_T}$INTEL_COMPILER" >&6
18227                 ;;
18228         esac
18229 fi
18230
18231 CLANG_COMPILER=no
18232
18233 if test "$GCC" = yes ; then
18234         echo "$as_me:18234: checking if this is really Clang C compiler" >&5
18235 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
18236         cf_save_CFLAGS="$CFLAGS"
18237         CFLAGS="$CFLAGS -Qunused-arguments"
18238         cat >conftest.$ac_ext <<_ACEOF
18239 #line 18239 "configure"
18240 #include "confdefs.h"
18241
18242 int
18243 main (void)
18244 {
18245
18246 #ifdef __clang__
18247 #else
18248 make an error
18249 #endif
18250
18251   ;
18252   return 0;
18253 }
18254 _ACEOF
18255 rm -f conftest.$ac_objext
18256 if { (eval echo "$as_me:18256: \"$ac_compile\"") >&5
18257   (eval $ac_compile) 2>&5
18258   ac_status=$?
18259   echo "$as_me:18259: \$? = $ac_status" >&5
18260   (exit $ac_status); } &&
18261          { ac_try='test -s conftest.$ac_objext'
18262   { (eval echo "$as_me:18262: \"$ac_try\"") >&5
18263   (eval $ac_try) 2>&5
18264   ac_status=$?
18265   echo "$as_me:18265: \$? = $ac_status" >&5
18266   (exit $ac_status); }; }; then
18267   CLANG_COMPILER=yes
18268 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
18269
18270 else
18271   echo "$as_me: failed program was:" >&5
18272 cat conftest.$ac_ext >&5
18273 fi
18274 rm -f conftest.$ac_objext conftest.$ac_ext
18275         CFLAGS="$cf_save_CFLAGS"
18276         echo "$as_me:18276: result: $CLANG_COMPILER" >&5
18277 echo "${ECHO_T}$CLANG_COMPILER" >&6
18278 fi
18279
18280 cat > conftest.$ac_ext <<EOF
18281 #line 18281 "${as_me:-configure}"
18282 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
18283 EOF
18284
18285 if test "$INTEL_COMPILER" = yes
18286 then
18287 # The "-wdXXX" options suppress warnings:
18288 # remark #1419: external declaration in primary source file
18289 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
18290 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
18291 # remark #193: zero used for undefined preprocessing identifier
18292 # remark #593: variable "curs_sb_left_arrow" was set but never used
18293 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
18294 # remark #869: parameter "tw" was never referenced
18295 # remark #981: operands are evaluated in unspecified order
18296 # warning #279: controlling expression is constant
18297
18298         { echo "$as_me:18298: checking for $CC warning options..." >&5
18299 echo "$as_me: checking for $CC warning options..." >&6;}
18300         cf_save_CFLAGS="$CFLAGS"
18301         EXTRA_CFLAGS="-Wall"
18302         for cf_opt in \
18303                 wd1419 \
18304                 wd1683 \
18305                 wd1684 \
18306                 wd193 \
18307                 wd593 \
18308                 wd279 \
18309                 wd810 \
18310                 wd869 \
18311                 wd981
18312         do
18313                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
18314                 if { (eval echo "$as_me:18314: \"$ac_compile\"") >&5
18315   (eval $ac_compile) 2>&5
18316   ac_status=$?
18317   echo "$as_me:18317: \$? = $ac_status" >&5
18318   (exit $ac_status); }; then
18319                         test -n "$verbose" && echo "$as_me:18319: result: ... -$cf_opt" >&5
18320 echo "${ECHO_T}... -$cf_opt" >&6
18321                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
18322                 fi
18323         done
18324         CFLAGS="$cf_save_CFLAGS"
18325
18326 elif test "$GCC" = yes
18327 then
18328         { echo "$as_me:18328: checking for $CC warning options..." >&5
18329 echo "$as_me: checking for $CC warning options..." >&6;}
18330         cf_save_CFLAGS="$CFLAGS"
18331         EXTRA_CFLAGS=
18332         cf_warn_CONST=""
18333         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
18334         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
18335         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
18336         for cf_opt in W Wall \
18337                 Wbad-function-cast \
18338                 Wcast-align \
18339                 Wcast-qual \
18340                 Wdeclaration-after-statement \
18341                 Wextra \
18342                 Winline \
18343                 Wmissing-declarations \
18344                 Wmissing-prototypes \
18345                 Wnested-externs \
18346                 Wpointer-arith \
18347                 Wshadow \
18348                 Wstrict-prototypes \
18349                 Wundef $cf_gcc_warnings $cf_warn_CONST
18350         do
18351                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
18352                 if { (eval echo "$as_me:18352: \"$ac_compile\"") >&5
18353   (eval $ac_compile) 2>&5
18354   ac_status=$?
18355   echo "$as_me:18355: \$? = $ac_status" >&5
18356   (exit $ac_status); }; then
18357                         test -n "$verbose" && echo "$as_me:18357: result: ... -$cf_opt" >&5
18358 echo "${ECHO_T}... -$cf_opt" >&6
18359                         case $cf_opt in
18360                         (Wcast-qual)
18361                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
18362                                 ;;
18363                         (Winline)
18364                                 case $GCC_VERSION in
18365                                 ([34].*)
18366                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
18367
18368 echo "${as_me:-configure}:18368: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
18369
18370                                         continue;;
18371                                 esac
18372                                 ;;
18373                         (Wpointer-arith)
18374                                 case $GCC_VERSION in
18375                                 ([12].*)
18376                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
18377
18378 echo "${as_me:-configure}:18378: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
18379
18380                                         continue;;
18381                                 esac
18382                                 ;;
18383                         esac
18384                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
18385                 fi
18386         done
18387         CFLAGS="$cf_save_CFLAGS"
18388 fi
18389 rm -rf conftest*
18390
18391 fi
18392 fi
18393
18394 echo "$as_me:18394: checking if you want to use dmalloc for testing" >&5
18395 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
18396
18397 # Check whether --with-dmalloc or --without-dmalloc was given.
18398 if test "${with_dmalloc+set}" = set; then
18399   withval="$with_dmalloc"
18400
18401 cat >>confdefs.h <<EOF
18402 #define USE_DMALLOC 1
18403 EOF
18404
18405         : ${with_cflags:=-g}
18406         : ${with_no_leaks:=yes}
18407          with_dmalloc=yes
18408 else
18409   with_dmalloc=
18410 fi;
18411 echo "$as_me:18411: result: ${with_dmalloc:-no}" >&5
18412 echo "${ECHO_T}${with_dmalloc:-no}" >&6
18413
18414 case .$with_cflags in
18415 (.*-g*)
18416         case .$CFLAGS in
18417         (.*-g*)
18418                 ;;
18419         (*)
18420
18421 cf_fix_cppflags=no
18422 cf_new_cflags=
18423 cf_new_cppflags=
18424 cf_new_extra_cppflags=
18425
18426 for cf_add_cflags in -g
18427 do
18428 case $cf_fix_cppflags in
18429 (no)
18430         case $cf_add_cflags in
18431         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18432                 case $cf_add_cflags in
18433                 (-D*)
18434                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18435
18436                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18437                                 && test -z "${cf_tst_cflags}" \
18438                                 && cf_fix_cppflags=yes
18439
18440                         if test $cf_fix_cppflags = yes ; then
18441
18442         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18443         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18444
18445                                 continue
18446                         elif test "${cf_tst_cflags}" = "\"'" ; then
18447
18448         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18449         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18450
18451                                 continue
18452                         fi
18453                         ;;
18454                 esac
18455                 case "$CPPFLAGS" in
18456                 (*$cf_add_cflags)
18457                         ;;
18458                 (*)
18459                         case $cf_add_cflags in
18460                         (-D*)
18461                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18462
18463 CPPFLAGS=`echo "$CPPFLAGS" | \
18464         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18465                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18466
18467                                 ;;
18468                         esac
18469
18470         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18471         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18472
18473                         ;;
18474                 esac
18475                 ;;
18476         (*)
18477
18478         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18479         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18480
18481                 ;;
18482         esac
18483         ;;
18484 (yes)
18485
18486         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18487         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18488
18489         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18490
18491         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18492                 && test -z "${cf_tst_cflags}" \
18493                 && cf_fix_cppflags=no
18494         ;;
18495 esac
18496 done
18497
18498 if test -n "$cf_new_cflags" ; then
18499
18500         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18501         CFLAGS="${CFLAGS}$cf_new_cflags"
18502
18503 fi
18504
18505 if test -n "$cf_new_cppflags" ; then
18506
18507         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18508         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18509
18510 fi
18511
18512 if test -n "$cf_new_extra_cppflags" ; then
18513
18514         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18515         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18516
18517 fi
18518
18519                 ;;
18520         esac
18521         ;;
18522 esac
18523
18524 if test "$with_dmalloc" = yes ; then
18525         echo "$as_me:18525: checking for dmalloc.h" >&5
18526 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
18527 if test "${ac_cv_header_dmalloc_h+set}" = set; then
18528   echo $ECHO_N "(cached) $ECHO_C" >&6
18529 else
18530   cat >conftest.$ac_ext <<_ACEOF
18531 #line 18531 "configure"
18532 #include "confdefs.h"
18533 #include <dmalloc.h>
18534 _ACEOF
18535 if { (eval echo "$as_me:18535: \"$ac_cpp conftest.$ac_ext\"") >&5
18536   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18537   ac_status=$?
18538   egrep -v '^ *\+' conftest.er1 >conftest.err
18539   rm -f conftest.er1
18540   cat conftest.err >&5
18541   echo "$as_me:18541: \$? = $ac_status" >&5
18542   (exit $ac_status); } >/dev/null; then
18543   if test -s conftest.err; then
18544     ac_cpp_err=$ac_c_preproc_warn_flag
18545   else
18546     ac_cpp_err=
18547   fi
18548 else
18549   ac_cpp_err=yes
18550 fi
18551 if test -z "$ac_cpp_err"; then
18552   ac_cv_header_dmalloc_h=yes
18553 else
18554   echo "$as_me: failed program was:" >&5
18555   cat conftest.$ac_ext >&5
18556   ac_cv_header_dmalloc_h=no
18557 fi
18558 rm -f conftest.err conftest.$ac_ext
18559 fi
18560 echo "$as_me:18560: result: $ac_cv_header_dmalloc_h" >&5
18561 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
18562 if test $ac_cv_header_dmalloc_h = yes; then
18563
18564 echo "$as_me:18564: checking for dmalloc_debug in -ldmalloc" >&5
18565 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
18566 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
18567   echo $ECHO_N "(cached) $ECHO_C" >&6
18568 else
18569   ac_check_lib_save_LIBS=$LIBS
18570 LIBS="-ldmalloc  $LIBS"
18571 cat >conftest.$ac_ext <<_ACEOF
18572 #line 18572 "configure"
18573 #include "confdefs.h"
18574
18575 /* Override any gcc2 internal prototype to avoid an error.  */
18576 #ifdef __cplusplus
18577 extern "C"
18578 #endif
18579 /* We use char because int might match the return type of a gcc2
18580    builtin and then its argument prototype would still apply.  */
18581 char dmalloc_debug ();
18582 int
18583 main (void)
18584 {
18585 dmalloc_debug ();
18586   ;
18587   return 0;
18588 }
18589 _ACEOF
18590 rm -f conftest.$ac_objext conftest$ac_exeext
18591 if { (eval echo "$as_me:18591: \"$ac_link\"") >&5
18592   (eval $ac_link) 2>&5
18593   ac_status=$?
18594   echo "$as_me:18594: \$? = $ac_status" >&5
18595   (exit $ac_status); } &&
18596          { ac_try='test -s conftest$ac_exeext'
18597   { (eval echo "$as_me:18597: \"$ac_try\"") >&5
18598   (eval $ac_try) 2>&5
18599   ac_status=$?
18600   echo "$as_me:18600: \$? = $ac_status" >&5
18601   (exit $ac_status); }; }; then
18602   ac_cv_lib_dmalloc_dmalloc_debug=yes
18603 else
18604   echo "$as_me: failed program was:" >&5
18605 cat conftest.$ac_ext >&5
18606 ac_cv_lib_dmalloc_dmalloc_debug=no
18607 fi
18608 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18609 LIBS=$ac_check_lib_save_LIBS
18610 fi
18611 echo "$as_me:18611: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
18612 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
18613 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
18614   cat >>confdefs.h <<EOF
18615 #define HAVE_LIBDMALLOC 1
18616 EOF
18617
18618   LIBS="-ldmalloc $LIBS"
18619
18620 fi
18621
18622 fi
18623
18624 fi
18625
18626 echo "$as_me:18626: checking if you want to use dbmalloc for testing" >&5
18627 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
18628
18629 # Check whether --with-dbmalloc or --without-dbmalloc was given.
18630 if test "${with_dbmalloc+set}" = set; then
18631   withval="$with_dbmalloc"
18632
18633 cat >>confdefs.h <<EOF
18634 #define USE_DBMALLOC 1
18635 EOF
18636
18637         : ${with_cflags:=-g}
18638         : ${with_no_leaks:=yes}
18639          with_dbmalloc=yes
18640 else
18641   with_dbmalloc=
18642 fi;
18643 echo "$as_me:18643: result: ${with_dbmalloc:-no}" >&5
18644 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
18645
18646 case .$with_cflags in
18647 (.*-g*)
18648         case .$CFLAGS in
18649         (.*-g*)
18650                 ;;
18651         (*)
18652
18653 cf_fix_cppflags=no
18654 cf_new_cflags=
18655 cf_new_cppflags=
18656 cf_new_extra_cppflags=
18657
18658 for cf_add_cflags in -g
18659 do
18660 case $cf_fix_cppflags in
18661 (no)
18662         case $cf_add_cflags in
18663         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18664                 case $cf_add_cflags in
18665                 (-D*)
18666                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18667
18668                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18669                                 && test -z "${cf_tst_cflags}" \
18670                                 && cf_fix_cppflags=yes
18671
18672                         if test $cf_fix_cppflags = yes ; then
18673
18674         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18675         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18676
18677                                 continue
18678                         elif test "${cf_tst_cflags}" = "\"'" ; then
18679
18680         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18681         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18682
18683                                 continue
18684                         fi
18685                         ;;
18686                 esac
18687                 case "$CPPFLAGS" in
18688                 (*$cf_add_cflags)
18689                         ;;
18690                 (*)
18691                         case $cf_add_cflags in
18692                         (-D*)
18693                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18694
18695 CPPFLAGS=`echo "$CPPFLAGS" | \
18696         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18697                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18698
18699                                 ;;
18700                         esac
18701
18702         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18703         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18704
18705                         ;;
18706                 esac
18707                 ;;
18708         (*)
18709
18710         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18711         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18712
18713                 ;;
18714         esac
18715         ;;
18716 (yes)
18717
18718         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18719         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18720
18721         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18722
18723         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18724                 && test -z "${cf_tst_cflags}" \
18725                 && cf_fix_cppflags=no
18726         ;;
18727 esac
18728 done
18729
18730 if test -n "$cf_new_cflags" ; then
18731
18732         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18733         CFLAGS="${CFLAGS}$cf_new_cflags"
18734
18735 fi
18736
18737 if test -n "$cf_new_cppflags" ; then
18738
18739         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18740         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18741
18742 fi
18743
18744 if test -n "$cf_new_extra_cppflags" ; then
18745
18746         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18747         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18748
18749 fi
18750
18751                 ;;
18752         esac
18753         ;;
18754 esac
18755
18756 if test "$with_dbmalloc" = yes ; then
18757         echo "$as_me:18757: checking for dbmalloc.h" >&5
18758 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
18759 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
18760   echo $ECHO_N "(cached) $ECHO_C" >&6
18761 else
18762   cat >conftest.$ac_ext <<_ACEOF
18763 #line 18763 "configure"
18764 #include "confdefs.h"
18765 #include <dbmalloc.h>
18766 _ACEOF
18767 if { (eval echo "$as_me:18767: \"$ac_cpp conftest.$ac_ext\"") >&5
18768   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18769   ac_status=$?
18770   egrep -v '^ *\+' conftest.er1 >conftest.err
18771   rm -f conftest.er1
18772   cat conftest.err >&5
18773   echo "$as_me:18773: \$? = $ac_status" >&5
18774   (exit $ac_status); } >/dev/null; then
18775   if test -s conftest.err; then
18776     ac_cpp_err=$ac_c_preproc_warn_flag
18777   else
18778     ac_cpp_err=
18779   fi
18780 else
18781   ac_cpp_err=yes
18782 fi
18783 if test -z "$ac_cpp_err"; then
18784   ac_cv_header_dbmalloc_h=yes
18785 else
18786   echo "$as_me: failed program was:" >&5
18787   cat conftest.$ac_ext >&5
18788   ac_cv_header_dbmalloc_h=no
18789 fi
18790 rm -f conftest.err conftest.$ac_ext
18791 fi
18792 echo "$as_me:18792: result: $ac_cv_header_dbmalloc_h" >&5
18793 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
18794 if test $ac_cv_header_dbmalloc_h = yes; then
18795
18796 echo "$as_me:18796: checking for debug_malloc in -ldbmalloc" >&5
18797 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
18798 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
18799   echo $ECHO_N "(cached) $ECHO_C" >&6
18800 else
18801   ac_check_lib_save_LIBS=$LIBS
18802 LIBS="-ldbmalloc  $LIBS"
18803 cat >conftest.$ac_ext <<_ACEOF
18804 #line 18804 "configure"
18805 #include "confdefs.h"
18806
18807 /* Override any gcc2 internal prototype to avoid an error.  */
18808 #ifdef __cplusplus
18809 extern "C"
18810 #endif
18811 /* We use char because int might match the return type of a gcc2
18812    builtin and then its argument prototype would still apply.  */
18813 char debug_malloc ();
18814 int
18815 main (void)
18816 {
18817 debug_malloc ();
18818   ;
18819   return 0;
18820 }
18821 _ACEOF
18822 rm -f conftest.$ac_objext conftest$ac_exeext
18823 if { (eval echo "$as_me:18823: \"$ac_link\"") >&5
18824   (eval $ac_link) 2>&5
18825   ac_status=$?
18826   echo "$as_me:18826: \$? = $ac_status" >&5
18827   (exit $ac_status); } &&
18828          { ac_try='test -s conftest$ac_exeext'
18829   { (eval echo "$as_me:18829: \"$ac_try\"") >&5
18830   (eval $ac_try) 2>&5
18831   ac_status=$?
18832   echo "$as_me:18832: \$? = $ac_status" >&5
18833   (exit $ac_status); }; }; then
18834   ac_cv_lib_dbmalloc_debug_malloc=yes
18835 else
18836   echo "$as_me: failed program was:" >&5
18837 cat conftest.$ac_ext >&5
18838 ac_cv_lib_dbmalloc_debug_malloc=no
18839 fi
18840 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18841 LIBS=$ac_check_lib_save_LIBS
18842 fi
18843 echo "$as_me:18843: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
18844 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
18845 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
18846   cat >>confdefs.h <<EOF
18847 #define HAVE_LIBDBMALLOC 1
18848 EOF
18849
18850   LIBS="-ldbmalloc $LIBS"
18851
18852 fi
18853
18854 fi
18855
18856 fi
18857
18858 echo "$as_me:18858: checking if you want to use valgrind for testing" >&5
18859 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
18860
18861 # Check whether --with-valgrind or --without-valgrind was given.
18862 if test "${with_valgrind+set}" = set; then
18863   withval="$with_valgrind"
18864
18865 cat >>confdefs.h <<EOF
18866 #define USE_VALGRIND 1
18867 EOF
18868
18869         : ${with_cflags:=-g}
18870         : ${with_no_leaks:=yes}
18871          with_valgrind=yes
18872 else
18873   with_valgrind=
18874 fi;
18875 echo "$as_me:18875: result: ${with_valgrind:-no}" >&5
18876 echo "${ECHO_T}${with_valgrind:-no}" >&6
18877
18878 case .$with_cflags in
18879 (.*-g*)
18880         case .$CFLAGS in
18881         (.*-g*)
18882                 ;;
18883         (*)
18884
18885 cf_fix_cppflags=no
18886 cf_new_cflags=
18887 cf_new_cppflags=
18888 cf_new_extra_cppflags=
18889
18890 for cf_add_cflags in -g
18891 do
18892 case $cf_fix_cppflags in
18893 (no)
18894         case $cf_add_cflags in
18895         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18896                 case $cf_add_cflags in
18897                 (-D*)
18898                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18899
18900                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18901                                 && test -z "${cf_tst_cflags}" \
18902                                 && cf_fix_cppflags=yes
18903
18904                         if test $cf_fix_cppflags = yes ; then
18905
18906         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18907         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18908
18909                                 continue
18910                         elif test "${cf_tst_cflags}" = "\"'" ; then
18911
18912         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18913         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18914
18915                                 continue
18916                         fi
18917                         ;;
18918                 esac
18919                 case "$CPPFLAGS" in
18920                 (*$cf_add_cflags)
18921                         ;;
18922                 (*)
18923                         case $cf_add_cflags in
18924                         (-D*)
18925                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18926
18927 CPPFLAGS=`echo "$CPPFLAGS" | \
18928         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18929                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18930
18931                                 ;;
18932                         esac
18933
18934         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18935         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18936
18937                         ;;
18938                 esac
18939                 ;;
18940         (*)
18941
18942         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18943         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18944
18945                 ;;
18946         esac
18947         ;;
18948 (yes)
18949
18950         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18951         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18952
18953         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18954
18955         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18956                 && test -z "${cf_tst_cflags}" \
18957                 && cf_fix_cppflags=no
18958         ;;
18959 esac
18960 done
18961
18962 if test -n "$cf_new_cflags" ; then
18963
18964         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18965         CFLAGS="${CFLAGS}$cf_new_cflags"
18966
18967 fi
18968
18969 if test -n "$cf_new_cppflags" ; then
18970
18971         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18972         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18973
18974 fi
18975
18976 if test -n "$cf_new_extra_cppflags" ; then
18977
18978         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18979         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18980
18981 fi
18982
18983                 ;;
18984         esac
18985         ;;
18986 esac
18987
18988 echo "$as_me:18988: checking if you want to perform memory-leak testing" >&5
18989 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
18990
18991 # Check whether --enable-leaks or --disable-leaks was given.
18992 if test "${enable_leaks+set}" = set; then
18993   enableval="$enable_leaks"
18994   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
18995 else
18996   : ${with_no_leaks:=no}
18997 fi;
18998 echo "$as_me:18998: result: $with_no_leaks" >&5
18999 echo "${ECHO_T}$with_no_leaks" >&6
19000
19001 if test "$with_no_leaks" = yes ; then
19002
19003 cat >>confdefs.h <<\EOF
19004 #define NO_LEAKS 1
19005 EOF
19006
19007 cat >>confdefs.h <<\EOF
19008 #define YY_NO_LEAKS 1
19009 EOF
19010
19011 fi
19012
19013 LD_RPATH_OPT=
19014 echo "$as_me:19014: checking for an rpath option" >&5
19015 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
19016 case $cf_cv_system_name in
19017 (irix*)
19018         if test "$GCC" = yes; then
19019                 LD_RPATH_OPT="-Wl,-rpath,"
19020         else
19021                 LD_RPATH_OPT="-rpath "
19022         fi
19023         ;;
19024 (linux*|gnu*|k*bsd*-gnu|freebsd*)
19025         LD_RPATH_OPT="-Wl,-rpath,"
19026         ;;
19027 (openbsd[2-9].*|mirbsd*)
19028         LD_RPATH_OPT="-Wl,-rpath,"
19029         ;;
19030 (dragonfly*)
19031         LD_RPATH_OPT="-rpath "
19032         ;;
19033 (netbsd*)
19034         LD_RPATH_OPT="-Wl,-rpath,"
19035         ;;
19036 (osf*|mls+*)
19037         LD_RPATH_OPT="-rpath "
19038         ;;
19039 (solaris2*)
19040         LD_RPATH_OPT="-R"
19041         ;;
19042 (*)
19043         ;;
19044 esac
19045 echo "$as_me:19045: result: $LD_RPATH_OPT" >&5
19046 echo "${ECHO_T}$LD_RPATH_OPT" >&6
19047
19048 case "x$LD_RPATH_OPT" in
19049 (x-R*)
19050         echo "$as_me:19050: checking if we need a space after rpath option" >&5
19051 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
19052         cf_save_LIBS="$LIBS"
19053
19054 cf_add_libs="${LD_RPATH_OPT}$libdir"
19055 # Filter out duplicates - this happens with badly-designed ".pc" files...
19056 for cf_add_1lib in $LIBS
19057 do
19058         for cf_add_2lib in $cf_add_libs
19059         do
19060                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
19061                 then
19062                         cf_add_1lib=
19063                         break
19064                 fi
19065         done
19066         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
19067 done
19068 LIBS="$cf_add_libs"
19069
19070         cat >conftest.$ac_ext <<_ACEOF
19071 #line 19071 "configure"
19072 #include "confdefs.h"
19073
19074 int
19075 main (void)
19076 {
19077
19078   ;
19079   return 0;
19080 }
19081 _ACEOF
19082 rm -f conftest.$ac_objext conftest$ac_exeext
19083 if { (eval echo "$as_me:19083: \"$ac_link\"") >&5
19084   (eval $ac_link) 2>&5
19085   ac_status=$?
19086   echo "$as_me:19086: \$? = $ac_status" >&5
19087   (exit $ac_status); } &&
19088          { ac_try='test -s conftest$ac_exeext'
19089   { (eval echo "$as_me:19089: \"$ac_try\"") >&5
19090   (eval $ac_try) 2>&5
19091   ac_status=$?
19092   echo "$as_me:19092: \$? = $ac_status" >&5
19093   (exit $ac_status); }; }; then
19094   cf_rpath_space=no
19095 else
19096   echo "$as_me: failed program was:" >&5
19097 cat conftest.$ac_ext >&5
19098 cf_rpath_space=yes
19099 fi
19100 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19101         LIBS="$cf_save_LIBS"
19102         echo "$as_me:19102: result: $cf_rpath_space" >&5
19103 echo "${ECHO_T}$cf_rpath_space" >&6
19104         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
19105         ;;
19106 esac
19107
19108 echo "$as_me:19108: checking if rpath-hack should be disabled" >&5
19109 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
19110
19111 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
19112 if test "${enable_rpath_hack+set}" = set; then
19113   enableval="$enable_rpath_hack"
19114   test "$enableval" != no && enableval=yes
19115         if test "$enableval" != "yes" ; then
19116     cf_disable_rpath_hack=yes
19117         else
19118                 cf_disable_rpath_hack=no
19119         fi
19120 else
19121   enableval=yes
19122         cf_disable_rpath_hack=no
19123
19124 fi;
19125 echo "$as_me:19125: result: $cf_disable_rpath_hack" >&5
19126 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
19127 if test "$cf_disable_rpath_hack" = no ; then
19128
19129 echo "$as_me:19129: checking for updated LDFLAGS" >&5
19130 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
19131 if test -n "$LD_RPATH_OPT" ; then
19132         echo "$as_me:19132: result: maybe" >&5
19133 echo "${ECHO_T}maybe" >&6
19134
19135         for ac_prog in ldd
19136 do
19137   # Extract the first word of "$ac_prog", so it can be a program name with args.
19138 set dummy $ac_prog; ac_word=$2
19139 echo "$as_me:19139: checking for $ac_word" >&5
19140 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
19141 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
19142   echo $ECHO_N "(cached) $ECHO_C" >&6
19143 else
19144   if test -n "$cf_ldd_prog"; then
19145   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
19146 else
19147   ac_save_IFS=$IFS; IFS=$ac_path_separator
19148 ac_dummy="$PATH"
19149 for ac_dir in $ac_dummy; do
19150   IFS=$ac_save_IFS
19151   test -z "$ac_dir" && ac_dir=.
19152   $as_executable_p "$ac_dir/$ac_word" || continue
19153 ac_cv_prog_cf_ldd_prog="$ac_prog"
19154 echo "$as_me:19154: found $ac_dir/$ac_word" >&5
19155 break
19156 done
19157
19158 fi
19159 fi
19160 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
19161 if test -n "$cf_ldd_prog"; then
19162   echo "$as_me:19162: result: $cf_ldd_prog" >&5
19163 echo "${ECHO_T}$cf_ldd_prog" >&6
19164 else
19165   echo "$as_me:19165: result: no" >&5
19166 echo "${ECHO_T}no" >&6
19167 fi
19168
19169   test -n "$cf_ldd_prog" && break
19170 done
19171 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
19172
19173         cf_rpath_list="/usr/lib /lib"
19174         if test "$cf_ldd_prog" != no
19175         then
19176                 cf_rpath_oops=
19177
19178 cat >conftest.$ac_ext <<_ACEOF
19179 #line 19179 "configure"
19180 #include "confdefs.h"
19181 #include <stdio.h>
19182 int
19183 main (void)
19184 {
19185 printf("Hello");
19186   ;
19187   return 0;
19188 }
19189 _ACEOF
19190 rm -f conftest.$ac_objext conftest$ac_exeext
19191 if { (eval echo "$as_me:19191: \"$ac_link\"") >&5
19192   (eval $ac_link) 2>&5
19193   ac_status=$?
19194   echo "$as_me:19194: \$? = $ac_status" >&5
19195   (exit $ac_status); } &&
19196          { ac_try='test -s conftest$ac_exeext'
19197   { (eval echo "$as_me:19197: \"$ac_try\"") >&5
19198   (eval $ac_try) 2>&5
19199   ac_status=$?
19200   echo "$as_me:19200: \$? = $ac_status" >&5
19201   (exit $ac_status); }; }; then
19202   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
19203                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
19204 else
19205   echo "$as_me: failed program was:" >&5
19206 cat conftest.$ac_ext >&5
19207 fi
19208 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19209
19210                 # If we passed the link-test, but get a "not found" on a given library,
19211                 # this could be due to inept reconfiguration of gcc to make it only
19212                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
19213                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
19214                 # /usr/local libraries.
19215                 if test -n "$cf_rpath_oops"
19216                 then
19217                         for cf_rpath_src in $cf_rpath_oops
19218                         do
19219                                 for cf_rpath_dir in \
19220                                         /usr/local \
19221                                         /usr/pkg \
19222                                         /opt/sfw
19223                                 do
19224                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
19225                                         then
19226                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
19227
19228 echo "${as_me:-configure}:19228: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
19229
19230                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
19231                                                 break
19232                                         fi
19233                                 done
19234                         done
19235                 fi
19236         fi
19237
19238         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
19239
19240 echo "${as_me:-configure}:19240: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
19241
19242 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
19243
19244 echo "${as_me:-configure}:19244: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
19245
19246 cf_rpath_dst=
19247 for cf_rpath_src in $LDFLAGS
19248 do
19249         case $cf_rpath_src in
19250         (-L*)
19251
19252                 # check if this refers to a directory which we will ignore
19253                 cf_rpath_skip=no
19254                 if test -n "$cf_rpath_list"
19255                 then
19256                         for cf_rpath_item in $cf_rpath_list
19257                         do
19258                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
19259                                 then
19260                                         cf_rpath_skip=yes
19261                                         break
19262                                 fi
19263                         done
19264                 fi
19265
19266                 if test "$cf_rpath_skip" = no
19267                 then
19268                         # transform the option
19269                         if test "$LD_RPATH_OPT" = "-R " ; then
19270                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
19271                         else
19272                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
19273                         fi
19274
19275                         # if we have not already added this, add it now
19276                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
19277                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
19278                         then
19279                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
19280
19281 echo "${as_me:-configure}:19281: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
19282
19283                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
19284                         fi
19285                 fi
19286                 ;;
19287         esac
19288         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
19289 done
19290 LDFLAGS=$cf_rpath_dst
19291
19292 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
19293
19294 echo "${as_me:-configure}:19294: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
19295
19296 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
19297
19298 echo "${as_me:-configure}:19298: testing ...checking LIBS $LIBS ..." 1>&5
19299
19300 cf_rpath_dst=
19301 for cf_rpath_src in $LIBS
19302 do
19303         case $cf_rpath_src in
19304         (-L*)
19305
19306                 # check if this refers to a directory which we will ignore
19307                 cf_rpath_skip=no
19308                 if test -n "$cf_rpath_list"
19309                 then
19310                         for cf_rpath_item in $cf_rpath_list
19311                         do
19312                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
19313                                 then
19314                                         cf_rpath_skip=yes
19315                                         break
19316                                 fi
19317                         done
19318                 fi
19319
19320                 if test "$cf_rpath_skip" = no
19321                 then
19322                         # transform the option
19323                         if test "$LD_RPATH_OPT" = "-R " ; then
19324                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
19325                         else
19326                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
19327                         fi
19328
19329                         # if we have not already added this, add it now
19330                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
19331                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
19332                         then
19333                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
19334
19335 echo "${as_me:-configure}:19335: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
19336
19337                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
19338                         fi
19339                 fi
19340                 ;;
19341         esac
19342         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
19343 done
19344 LIBS=$cf_rpath_dst
19345
19346 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
19347
19348 echo "${as_me:-configure}:19348: testing ...checked LIBS $LIBS ..." 1>&5
19349
19350         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
19351
19352 echo "${as_me:-configure}:19352: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
19353
19354 else
19355         echo "$as_me:19355: result: no" >&5
19356 echo "${ECHO_T}no" >&6
19357 fi
19358
19359 fi
19360
19361 TEST_ARGS="$LIBS"
19362 LIBS=
19363
19364 ac_config_files="$ac_config_files Makefile"
19365 ac_config_commands="$ac_config_commands default"
19366 cat >confcache <<\_ACEOF
19367 # This file is a shell script that caches the results of configure
19368 # tests run on this system so they can be shared between configure
19369 # scripts and configure runs, see configure's option --config-cache.
19370 # It is not useful on other systems.  If it contains results you don't
19371 # want to keep, you may remove or edit it.
19372 #
19373 # config.status only pays attention to the cache file if you give it
19374 # the --recheck option to rerun configure.
19375 #
19376 # `ac_cv_env_foo' variables (set or unset) will be overriden when
19377 # loading this file, other *unset* `ac_cv_foo' will be assigned the
19378 # following values.
19379
19380 _ACEOF
19381
19382 # The following way of writing the cache mishandles newlines in values,
19383 # but we know of no workaround that is simple, portable, and efficient.
19384 # So, don't put newlines in cache variables' values.
19385 # Ultrix sh set writes to stderr and can't be redirected directly,
19386 # and sets the high bit in the cache file unless we assign to the vars.
19387 {
19388   (set) 2>&1 |
19389     case `(ac_space=' '; set | grep ac_space) 2>&1` in
19390     *ac_space=\ *)
19391       # `set' does not quote correctly, so add quotes (double-quote
19392       # substitution turns \\\\ into \\, and sed turns \\ into \).
19393       sed -n \
19394         "s/'/'\\\\''/g;
19395           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
19396       ;;
19397     *)
19398       # `set' quotes correctly as required by POSIX, so do not add quotes.
19399       sed -n \
19400         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
19401       ;;
19402     esac;
19403 } |
19404   sed '
19405      t clear
19406      : clear
19407      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
19408      t end
19409      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
19410      : end' >>confcache
19411 if cmp -s $cache_file confcache; then :; else
19412   if test -w $cache_file; then
19413     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
19414     cat confcache >$cache_file
19415   else
19416     echo "not updating unwritable cache $cache_file"
19417   fi
19418 fi
19419 rm -f confcache
19420
19421 test "x$prefix" = xNONE && prefix=$ac_default_prefix
19422 # Let make expand exec_prefix.
19423 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
19424
19425 # VPATH may cause trouble with some makes, so we remove $(srcdir),
19426 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
19427 # trailing colons and then remove the whole line if VPATH becomes empty
19428 # (actually we leave an empty line to preserve line numbers).
19429 if test "x$srcdir" = x.; then
19430   ac_vpsub='/^[         ]*VPATH[        ]*=/{
19431 s/:*\$(srcdir):*/:/;
19432 s/:*\${srcdir}:*/:/;
19433 s/:*@srcdir@:*/:/;
19434 s/^\([^=]*=[    ]*\):*/\1/;
19435 s/:*$//;
19436 s/^[^=]*=[      ]*$//;
19437 }'
19438 fi
19439
19440 DEFS=-DHAVE_CONFIG_H
19441
19442 : ${CONFIG_STATUS=./config.status}
19443 ac_clean_files_save=$ac_clean_files
19444 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
19445 { echo "$as_me:19445: creating $CONFIG_STATUS" >&5
19446 echo "$as_me: creating $CONFIG_STATUS" >&6;}
19447 cat >$CONFIG_STATUS <<_ACEOF
19448 #! $SHELL
19449 # Generated automatically by configure.
19450 # Run this file to recreate the current configuration.
19451 # Compiler output produced by configure, useful for debugging
19452 # configure, is in config.log if it exists.
19453
19454 debug=false
19455 SHELL=\${CONFIG_SHELL-$SHELL}
19456 ac_cs_invocation="\$0 \$@"
19457
19458 _ACEOF
19459
19460 cat >>$CONFIG_STATUS <<\_ACEOF
19461 # Be Bourne compatible
19462 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
19463   emulate sh
19464   NULLCMD=:
19465 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
19466   set -o posix
19467 fi
19468
19469 # Name of the executable.
19470 as_me=`echo "$0" |sed 's,.*[\\/],,'`
19471
19472 if expr a : '\(a\)' >/dev/null 2>&1; then
19473   as_expr=expr
19474 else
19475   as_expr=false
19476 fi
19477
19478 rm -f conf$$ conf$$.exe conf$$.file
19479 echo >conf$$.file
19480 if ln -s conf$$.file conf$$ 2>/dev/null; then
19481   # We could just check for DJGPP; but this test a) works b) is more generic
19482   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
19483   if test -f conf$$.exe; then
19484     # Don't use ln at all; we don't have any links
19485     as_ln_s='cp -p'
19486   else
19487     as_ln_s='ln -s'
19488   fi
19489 elif ln conf$$.file conf$$ 2>/dev/null; then
19490   as_ln_s=ln
19491 else
19492   as_ln_s='cp -p'
19493 fi
19494 rm -f conf$$ conf$$.exe conf$$.file
19495
19496 as_executable_p="test -f"
19497
19498 # Support unset when possible.
19499 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
19500   as_unset=unset
19501 else
19502   as_unset=false
19503 fi
19504
19505 # NLS nuisances.
19506 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
19507 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
19508 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
19509 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
19510 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
19511 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
19512 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
19513 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
19514
19515 # IFS
19516 # We need space, tab and new line, in precisely that order.
19517 as_nl='
19518 '
19519 IFS="   $as_nl"
19520
19521 # CDPATH.
19522 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
19523
19524 exec 6>&1
19525
19526 _ACEOF
19527
19528 # Files that config.status was made for.
19529 if test -n "$ac_config_files"; then
19530   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
19531 fi
19532
19533 if test -n "$ac_config_headers"; then
19534   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
19535 fi
19536
19537 if test -n "$ac_config_links"; then
19538   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
19539 fi
19540
19541 if test -n "$ac_config_commands"; then
19542   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
19543 fi
19544
19545 cat >>$CONFIG_STATUS <<\EOF
19546
19547 ac_cs_usage="\
19548 \`$as_me' instantiates files from templates according to the
19549 current configuration.
19550
19551 Usage: $0 [OPTIONS] [FILE]...
19552
19553   -h, --help       print this help, then exit
19554   -V, --version    print version number, then exit
19555   -d, --debug      don't remove temporary files
19556       --recheck    update $as_me by reconfiguring in the same conditions
19557   --file=FILE[:TEMPLATE]
19558                    instantiate the configuration file FILE
19559   --header=FILE[:TEMPLATE]
19560                    instantiate the configuration header FILE
19561
19562 Configuration files:
19563 $config_files
19564
19565 Configuration headers:
19566 $config_headers
19567
19568 Configuration commands:
19569 $config_commands
19570
19571 Report bugs to <dickey@invisible-island.net>."
19572 EOF
19573
19574 cat >>$CONFIG_STATUS <<EOF
19575 ac_cs_version="\\
19576 config.status
19577 configured by $0, generated by GNU Autoconf 2.52.20170501,
19578   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
19579
19580 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
19581 Free Software Foundation, Inc.
19582 This config.status script is free software; the Free Software Foundation
19583 gives unlimited permission to copy, distribute and modify it."
19584 srcdir=$srcdir
19585 INSTALL="$INSTALL"
19586 EOF
19587
19588 cat >>$CONFIG_STATUS <<\EOF
19589 # If no file are specified by the user, then we need to provide default
19590 # value.  By we need to know if files were specified by the user.
19591 ac_need_defaults=:
19592 while test $# != 0
19593 do
19594   case $1 in
19595   --*=*)
19596     ac_option=`expr "x$1" : 'x\([^=]*\)='`
19597     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
19598     shift
19599     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
19600     shift
19601     ;;
19602   -*);;
19603   *) # This is not an option, so the user has probably given explicit
19604      # arguments.
19605      ac_need_defaults=false;;
19606   esac
19607
19608   case $1 in
19609   # Handling of the options.
19610 EOF
19611 cat >>$CONFIG_STATUS <<EOF
19612   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
19613     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
19614     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
19615 EOF
19616 cat >>$CONFIG_STATUS <<\EOF
19617   --version | --vers* | -V )
19618     echo "$ac_cs_version"; exit 0 ;;
19619   --he | --h)
19620     # Conflict between --help and --header
19621     { { echo "$as_me:19621: error: ambiguous option: $1
19622 Try \`$0 --help' for more information." >&5
19623 echo "$as_me: error: ambiguous option: $1
19624 Try \`$0 --help' for more information." >&2;}
19625    { (exit 1); exit 1; }; };;
19626   --help | --hel | -h )
19627     echo "$ac_cs_usage"; exit 0 ;;
19628   --debug | --d* | -d )
19629     debug=: ;;
19630   --file | --fil | --fi | --f )
19631     shift
19632     CONFIG_FILES="$CONFIG_FILES $1"
19633     ac_need_defaults=false;;
19634   --header | --heade | --head | --hea )
19635     shift
19636     CONFIG_HEADERS="$CONFIG_HEADERS $1"
19637     ac_need_defaults=false;;
19638
19639   # This is an error.
19640   -*) { { echo "$as_me:19640: error: unrecognized option: $1
19641 Try \`$0 --help' for more information." >&5
19642 echo "$as_me: error: unrecognized option: $1
19643 Try \`$0 --help' for more information." >&2;}
19644    { (exit 1); exit 1; }; } ;;
19645
19646   *) ac_config_targets="$ac_config_targets $1" ;;
19647
19648   esac
19649   shift
19650 done
19651
19652 exec 5>>config.log
19653 cat >&5 << _ACEOF
19654
19655 ## ----------------------- ##
19656 ## Running config.status.  ##
19657 ## ----------------------- ##
19658
19659 This file was extended by $as_me 2.52.20170501, executed with
19660   CONFIG_FILES    = $CONFIG_FILES
19661   CONFIG_HEADERS  = $CONFIG_HEADERS
19662   CONFIG_LINKS    = $CONFIG_LINKS
19663   CONFIG_COMMANDS = $CONFIG_COMMANDS
19664   > $ac_cs_invocation
19665 on `(hostname || uname -n) 2>/dev/null | sed 1q`
19666
19667 _ACEOF
19668 EOF
19669
19670 cat >>$CONFIG_STATUS <<EOF
19671 #
19672 # INIT-COMMANDS section.
19673 #
19674
19675 AWK="$AWK"
19676 ECHO_CC="$ECHO_CC"
19677 ECHO_LD="$ECHO_LD"
19678 SHOW_CC="$SHOW_LD"
19679
19680 EOF
19681
19682 cat >>$CONFIG_STATUS <<\EOF
19683 for ac_config_target in $ac_config_targets
19684 do
19685   case "$ac_config_target" in
19686   # Handling of arguments.
19687   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
19688   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
19689   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
19690   *) { { echo "$as_me:19690: error: invalid argument: $ac_config_target" >&5
19691 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
19692    { (exit 1); exit 1; }; };;
19693   esac
19694 done
19695
19696 # If the user did not use the arguments to specify the items to instantiate,
19697 # then the envvar interface is used.  Set only those that are not.
19698 # We use the long form for the default assignment because of an extremely
19699 # bizarre bug on SunOS 4.1.3.
19700 if $ac_need_defaults; then
19701   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
19702   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
19703   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
19704 fi
19705
19706 # Create a temporary directory, and hook for its removal unless debugging.
19707 $debug ||
19708 {
19709   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
19710   trap '{ (exit 1); exit 1; }' 1 2 13 15
19711 }
19712
19713 # Create a (secure) tmp directory for tmp files.
19714 : ${TMPDIR=/tmp}
19715 {
19716   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
19717   test -n "$tmp" && test -d "$tmp"
19718 }  ||
19719 {
19720   tmp=$TMPDIR/cs$$-$RANDOM
19721   (umask 077 && mkdir $tmp)
19722 } ||
19723 {
19724    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
19725    { (exit 1); exit 1; }
19726 }
19727
19728 EOF
19729
19730 cat >>$CONFIG_STATUS <<EOF
19731
19732 #
19733 # CONFIG_FILES section.
19734 #
19735
19736 # No need to generate the scripts if there are no CONFIG_FILES.
19737 # This happens for instance when ./config.status config.h
19738 if test -n "\$CONFIG_FILES"; then
19739   # Protect against being on the right side of a sed subst in config.status.
19740   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
19741    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
19742 s,@SHELL@,$SHELL,;t t
19743 s,@exec_prefix@,$exec_prefix,;t t
19744 s,@prefix@,$prefix,;t t
19745 s,@program_transform_name@,$program_transform_name,;t t
19746 s,@bindir@,$bindir,;t t
19747 s,@sbindir@,$sbindir,;t t
19748 s,@libexecdir@,$libexecdir,;t t
19749 s,@datarootdir@,$datarootdir,;t t
19750 s,@datadir@,$datadir,;t t
19751 s,@sysconfdir@,$sysconfdir,;t t
19752 s,@sharedstatedir@,$sharedstatedir,;t t
19753 s,@localstatedir@,$localstatedir,;t t
19754 s,@libdir@,$libdir,;t t
19755 s,@includedir@,$includedir,;t t
19756 s,@oldincludedir@,$oldincludedir,;t t
19757 s,@infodir@,$infodir,;t t
19758 s,@mandir@,$mandir,;t t
19759 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
19760 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
19761 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
19762 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
19763 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
19764 s,@build_alias@,$build_alias,;t t
19765 s,@host_alias@,$host_alias,;t t
19766 s,@target_alias@,$target_alias,;t t
19767 s,@ECHO_C@,$ECHO_C,;t t
19768 s,@ECHO_N@,$ECHO_N,;t t
19769 s,@ECHO_T@,$ECHO_T,;t t
19770 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
19771 s,@DEFS@,$DEFS,;t t
19772 s,@LIBS@,$LIBS,;t t
19773 s,@build@,$build,;t t
19774 s,@build_cpu@,$build_cpu,;t t
19775 s,@build_vendor@,$build_vendor,;t t
19776 s,@build_os@,$build_os,;t t
19777 s,@host@,$host,;t t
19778 s,@host_cpu@,$host_cpu,;t t
19779 s,@host_vendor@,$host_vendor,;t t
19780 s,@host_os@,$host_os,;t t
19781 s,@SET_MAKE@,$SET_MAKE,;t t
19782 s,@CC@,$CC,;t t
19783 s,@CFLAGS@,$CFLAGS,;t t
19784 s,@LDFLAGS@,$LDFLAGS,;t t
19785 s,@CPPFLAGS@,$CPPFLAGS,;t t
19786 s,@ac_ct_CC@,$ac_ct_CC,;t t
19787 s,@EXEEXT@,$EXEEXT,;t t
19788 s,@OBJEXT@,$OBJEXT,;t t
19789 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
19790 s,@CPP@,$CPP,;t t
19791 s,@AWK@,$AWK,;t t
19792 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
19793 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
19794 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
19795 s,@LINT@,$LINT,;t t
19796 s,@LINT_OPTS@,$LINT_OPTS,;t t
19797 s,@CTAGS@,$CTAGS,;t t
19798 s,@ETAGS@,$ETAGS,;t t
19799 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
19800 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
19801 s,@MATH_LIB@,$MATH_LIB,;t t
19802 s,@top_builddir@,$top_builddir,;t t
19803 s,@CC_G_OPT@,$CC_G_OPT,;t t
19804 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
19805 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
19806 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
19807 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
19808 s,@LD@,$LD,;t t
19809 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
19810 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
19811 s,@LD_MODEL@,$LD_MODEL,;t t
19812 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
19813 s,@LIBTOOL@,$LIBTOOL,;t t
19814 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
19815 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
19816 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
19817 s,@LIB_LINK@,$LIB_LINK,;t t
19818 s,@LINK_TESTS@,$LINK_TESTS,;t t
19819 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
19820 s,@PACKAGE@,$PACKAGE,;t t
19821 s,@PTHREAD@,$PTHREAD,;t t
19822 s,@TEST_ARGS@,$TEST_ARGS,;t t
19823 s,@TEST_DEPS@,$TEST_DEPS,;t t
19824 s,@TEST_LIBS@,$TEST_LIBS,;t t
19825 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
19826 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
19827 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
19828 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
19829 s,@includesubdir@,$includesubdir,;t t
19830 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
19831 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
19832 s,@ECHO_LT@,$ECHO_LT,;t t
19833 s,@ECHO_LD@,$ECHO_LD,;t t
19834 s,@RULE_CC@,$RULE_CC,;t t
19835 s,@SHOW_CC@,$SHOW_CC,;t t
19836 s,@ECHO_CC@,$ECHO_CC,;t t
19837 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
19838 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
19839 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
19840 s,@X_CFLAGS@,$X_CFLAGS,;t t
19841 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
19842 s,@X_LIBS@,$X_LIBS,;t t
19843 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
19844 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
19845 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
19846 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
19847 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
19848 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
19849 CEOF
19850
19851 EOF
19852
19853   cat >>$CONFIG_STATUS <<\EOF
19854   # Split the substitutions into bite-sized pieces for seds with
19855   # small command number limits, like on Digital OSF/1 and HP-UX.
19856   ac_max_sed_lines=48
19857   ac_sed_frag=1 # Number of current file.
19858   ac_beg=1 # First line for current file.
19859   ac_end=$ac_max_sed_lines # Line after last line for current file.
19860   ac_more_lines=:
19861   ac_sed_cmds=
19862   while $ac_more_lines; do
19863     if test $ac_beg -gt 1; then
19864       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19865     else
19866       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19867     fi
19868     if test ! -s $tmp/subs.frag; then
19869       ac_more_lines=false
19870     else
19871       # The purpose of the label and of the branching condition is to
19872       # speed up the sed processing (if there are no `@' at all, there
19873       # is no need to browse any of the substitutions).
19874       # These are the two extra sed commands mentioned above.
19875       (echo ':t
19876   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
19877       # It is possible to make a multiline substitution using escaped newlines.
19878       # Ensure that we do not split the substitution between script fragments.
19879       ac_BEG=$ac_end
19880       ac_END=`expr $ac_end + $ac_max_sed_lines`
19881       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
19882       if test -s $tmp/subs.next; then
19883         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
19884         if test ! -s $tmp/subs.edit; then
19885           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
19886           if test ! -s $tmp/subs.edit; then
19887             if test $ac_beg -gt 1; then
19888               ac_end=`expr $ac_end - 1`
19889               continue
19890             fi
19891           fi
19892         fi
19893       fi
19894
19895       if test -z "$ac_sed_cmds"; then
19896         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
19897       else
19898         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
19899       fi
19900       ac_sed_frag=`expr $ac_sed_frag + 1`
19901       ac_beg=$ac_end
19902       ac_end=`expr $ac_end + $ac_max_sed_lines`
19903     fi
19904   done
19905   if test -z "$ac_sed_cmds"; then
19906     ac_sed_cmds=cat
19907   fi
19908 fi # test -n "$CONFIG_FILES"
19909
19910 EOF
19911 cat >>$CONFIG_STATUS <<\EOF
19912 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19913   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19914   case $ac_file in
19915   - | *:- | *:-:* ) # input from stdin
19916         cat >$tmp/stdin
19917         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19918         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19919   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19920         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19921   * )   ac_file_in=$ac_file.in ;;
19922   esac
19923
19924   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19925   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19926          X"$ac_file" : 'X\(//\)[^/]' \| \
19927          X"$ac_file" : 'X\(//\)$' \| \
19928          X"$ac_file" : 'X\(/\)' \| \
19929          .     : '\(.\)' 2>/dev/null ||
19930 echo X"$ac_file" |
19931     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19932           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19933           /^X\(\/\/\)$/{ s//\1/; q; }
19934           /^X\(\/\).*/{ s//\1/; q; }
19935           s/.*/./; q'`
19936   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19937     { case "$ac_dir" in
19938   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19939   *)                      as_incr_dir=.;;
19940 esac
19941 as_dummy="$ac_dir"
19942 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19943   case $as_mkdir_dir in
19944     # Skip DOS drivespec
19945     ?:) as_incr_dir=$as_mkdir_dir ;;
19946     *)
19947       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19948       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19949     ;;
19950   esac
19951 done; }
19952
19953     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
19954     # A "../" for each directory in $ac_dir_suffix.
19955     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19956   else
19957     ac_dir_suffix= ac_dots=
19958   fi
19959
19960   case $srcdir in
19961   .)  ac_srcdir=.
19962       if test -z "$ac_dots"; then
19963          ac_top_srcdir=.
19964       else
19965          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
19966       fi ;;
19967   [\\/]* | ?:[\\/]* )
19968       ac_srcdir=$srcdir$ac_dir_suffix;
19969       ac_top_srcdir=$srcdir ;;
19970   *) # Relative path.
19971     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
19972     ac_top_srcdir=$ac_dots$srcdir ;;
19973   esac
19974
19975   case $INSTALL in
19976   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19977   *) ac_INSTALL=$ac_dots$INSTALL ;;
19978   esac
19979
19980   if test x"$ac_file" != x-; then
19981     { echo "$as_me:19981: creating $ac_file" >&5
19982 echo "$as_me: creating $ac_file" >&6;}
19983     rm -f "$ac_file"
19984   fi
19985   # Let's still pretend it is `configure' which instantiates (i.e., don't
19986   # use $as_me), people would be surprised to read:
19987   #    /* config.h.  Generated automatically by config.status.  */
19988   configure_input="Generated automatically from `echo $ac_file_in |
19989                                                  sed 's,.*/,,'` by configure."
19990
19991   # First look for the input files in the build tree, otherwise in the
19992   # src tree.
19993   ac_file_inputs=`IFS=:
19994     for f in $ac_file_in; do
19995       case $f in
19996       -) echo $tmp/stdin ;;
19997       [\\/$]*)
19998          # Absolute (can't be DOS-style, as IFS=:)
19999          test -f "$f" || { { echo "$as_me:19999: error: cannot find input file: $f" >&5
20000 echo "$as_me: error: cannot find input file: $f" >&2;}
20001    { (exit 1); exit 1; }; }
20002          echo $f;;
20003       *) # Relative
20004          if test -f "$f"; then
20005            # Build tree
20006            echo $f
20007          elif test -f "$srcdir/$f"; then
20008            # Source tree
20009            echo $srcdir/$f
20010          else
20011            # /dev/null tree
20012            { { echo "$as_me:20012: error: cannot find input file: $f" >&5
20013 echo "$as_me: error: cannot find input file: $f" >&2;}
20014    { (exit 1); exit 1; }; }
20015          fi;;
20016       esac
20017     done` || { (exit 1); exit 1; }
20018 EOF
20019 cat >>$CONFIG_STATUS <<\EOF
20020   ac_warn_datarootdir=no
20021   if test x"$ac_file" != x-; then
20022     for ac_item in $ac_file_inputs
20023     do
20024       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
20025       if test -n "$ac_seen"; then
20026         ac_used=`grep '@datarootdir@' $ac_item`
20027         if test -z "$ac_used"; then
20028           { echo "$as_me:20028: WARNING: datarootdir was used implicitly but not set:
20029 $ac_seen" >&5
20030 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
20031 $ac_seen" >&2;}
20032           ac_warn_datarootdir=yes
20033         fi
20034       fi
20035       ac_seen=`grep '${datarootdir}' $ac_item`
20036       if test -n "$ac_seen"; then
20037         { echo "$as_me:20037: WARNING: datarootdir was used explicitly but not set:
20038 $ac_seen" >&5
20039 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
20040 $ac_seen" >&2;}
20041         ac_warn_datarootdir=yes
20042       fi
20043     done
20044   fi
20045
20046 if test "x$ac_warn_datarootdir" = xyes; then
20047   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
20048 fi
20049
20050 EOF
20051 cat >>$CONFIG_STATUS <<EOF
20052   sed "$ac_vpsub
20053 $extrasub
20054 EOF
20055 cat >>$CONFIG_STATUS <<\EOF
20056 :t
20057 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
20058 s,@configure_input@,$configure_input,;t t
20059 s,@srcdir@,$ac_srcdir,;t t
20060 s,@top_srcdir@,$ac_top_srcdir,;t t
20061 s,@INSTALL@,$ac_INSTALL,;t t
20062 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
20063   rm -f $tmp/stdin
20064   if test x"$ac_file" != x-; then
20065     cp $tmp/out $ac_file
20066
20067     for ac_name in prefix exec_prefix datarootdir
20068     do
20069         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
20070         if test -n "$ac_seen"; then
20071             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
20072             if test -z "$ac_init"; then
20073               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
20074               { echo "$as_me:20074: WARNING: Variable $ac_name is used but was not set:
20075 $ac_seen" >&5
20076 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
20077 $ac_seen" >&2;}
20078             fi
20079         fi
20080     done
20081     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
20082     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
20083     if test -s $tmp/out; then
20084       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
20085       { echo "$as_me:20085: WARNING: Some variables may not be substituted:
20086 $ac_seen" >&5
20087 echo "$as_me: WARNING: Some variables may not be substituted:
20088 $ac_seen" >&2;}
20089     fi
20090   else
20091     cat $tmp/out
20092   fi
20093   rm -f $tmp/out
20094
20095 done
20096 EOF
20097 cat >>$CONFIG_STATUS <<\EOF
20098
20099 #
20100 # CONFIG_HEADER section.
20101 #
20102
20103 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
20104 # NAME is the cpp macro being defined and VALUE is the value it is being given.
20105 #
20106 # ac_d sets the value in "#define NAME VALUE" lines.
20107 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
20108 ac_dB='[        ].*$,\1#\2'
20109 ac_dC=' '
20110 ac_dD=',;t'
20111 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
20112 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
20113 ac_iB='\([      ]\),\1#\2define\3'
20114 ac_iC=' '
20115 ac_iD='\4,;t'
20116 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
20117 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
20118 ac_uB='$,\1#\2define\3'
20119 ac_uC=' '
20120 ac_uD=',;t'
20121
20122 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
20123   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
20124   case $ac_file in
20125   - | *:- | *:-:* ) # input from stdin
20126         cat >$tmp/stdin
20127         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20128         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20129   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20130         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20131   * )   ac_file_in=$ac_file.in ;;
20132   esac
20133
20134   test x"$ac_file" != x- && { echo "$as_me:20134: creating $ac_file" >&5
20135 echo "$as_me: creating $ac_file" >&6;}
20136
20137   # First look for the input files in the build tree, otherwise in the
20138   # src tree.
20139   ac_file_inputs=`IFS=:
20140     for f in $ac_file_in; do
20141       case $f in
20142       -) echo $tmp/stdin ;;
20143       [\\/$]*)
20144          # Absolute (can't be DOS-style, as IFS=:)
20145          test -f "$f" || { { echo "$as_me:20145: error: cannot find input file: $f" >&5
20146 echo "$as_me: error: cannot find input file: $f" >&2;}
20147    { (exit 1); exit 1; }; }
20148          echo $f;;
20149       *) # Relative
20150          if test -f "$f"; then
20151            # Build tree
20152            echo $f
20153          elif test -f "$srcdir/$f"; then
20154            # Source tree
20155            echo $srcdir/$f
20156          else
20157            # /dev/null tree
20158            { { echo "$as_me:20158: error: cannot find input file: $f" >&5
20159 echo "$as_me: error: cannot find input file: $f" >&2;}
20160    { (exit 1); exit 1; }; }
20161          fi;;
20162       esac
20163     done` || { (exit 1); exit 1; }
20164   # Remove the trailing spaces.
20165   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
20166
20167 EOF
20168
20169 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
20170 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
20171 # be either 'cat' or 'sort'.
20172 cat confdefs.h | uniq >conftest.vals
20173
20174 # Break up conftest.vals because some shells have a limit on
20175 # the size of here documents, and old seds have small limits too.
20176
20177 rm -f conftest.tail
20178 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
20179 while grep . conftest.vals >/dev/null
20180 do
20181   # Write chunks of a limited-size here document to conftest.frag.
20182   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
20183   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
20184   echo 'CEOF' >> $CONFIG_STATUS
20185   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
20186   rm -f conftest.vals
20187   mv conftest.tail conftest.vals
20188 done
20189 rm -f conftest.vals
20190
20191 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
20192 # marker @DEFS@.
20193 echo '  cat >> conftest.edit <<CEOF
20194 /@DEFS@/r conftest.frag
20195 /@DEFS@/d
20196 CEOF
20197 sed -f conftest.edit $tmp/in > $tmp/out
20198 rm -f $tmp/in
20199 mv $tmp/out $tmp/in
20200 rm -f conftest.edit conftest.frag
20201 ' >> $CONFIG_STATUS
20202
20203 cat >>$CONFIG_STATUS <<\EOF
20204   # Let's still pretend it is `configure' which instantiates (i.e., don't
20205   # use $as_me), people would be surprised to read:
20206   #    /* config.h.  Generated automatically by config.status.  */
20207   if test x"$ac_file" = x-; then
20208     echo "/* Generated automatically by configure.  */" >$tmp/config.h
20209   else
20210     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
20211   fi
20212   cat $tmp/in >>$tmp/config.h
20213   rm -f $tmp/in
20214   if test x"$ac_file" != x-; then
20215     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
20216       { echo "$as_me:20216: $ac_file is unchanged" >&5
20217 echo "$as_me: $ac_file is unchanged" >&6;}
20218     else
20219       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20220          X"$ac_file" : 'X\(//\)[^/]' \| \
20221          X"$ac_file" : 'X\(//\)$' \| \
20222          X"$ac_file" : 'X\(/\)' \| \
20223          .     : '\(.\)' 2>/dev/null ||
20224 echo X"$ac_file" |
20225     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20226           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20227           /^X\(\/\/\)$/{ s//\1/; q; }
20228           /^X\(\/\).*/{ s//\1/; q; }
20229           s/.*/./; q'`
20230       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
20231         { case "$ac_dir" in
20232   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
20233   *)                      as_incr_dir=.;;
20234 esac
20235 as_dummy="$ac_dir"
20236 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
20237   case $as_mkdir_dir in
20238     # Skip DOS drivespec
20239     ?:) as_incr_dir=$as_mkdir_dir ;;
20240     *)
20241       as_incr_dir=$as_incr_dir/$as_mkdir_dir
20242       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
20243     ;;
20244   esac
20245 done; }
20246
20247       fi
20248       rm -f $ac_file
20249       mv $tmp/config.h $ac_file
20250     fi
20251   else
20252     cat $tmp/config.h
20253     rm -f $tmp/config.h
20254   fi
20255 done
20256 EOF
20257 cat >>$CONFIG_STATUS <<\EOF
20258 #
20259 # CONFIG_COMMANDS section.
20260 #
20261 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
20262   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
20263   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
20264
20265   case $ac_dest in
20266     default )
20267
20268 for cf_dir in .
20269 do
20270         if test ! -d $srcdir/$cf_dir; then
20271                 continue
20272         elif test -f $srcdir/$cf_dir/programs; then
20273                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
20274         fi
20275 done
20276
20277         cat >>Makefile <<TEST_EOF
20278
20279 # These rules are generated so we do not rely on suffix rules, which do not
20280 # work consistently for different make-programs (the '\$(MODEL)/' confuses
20281 # some, and the '\$x' confuses others).
20282 TEST_EOF
20283
20284 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
20285 for N in $LIST
20286 do
20287         cat >>Makefile <<TEST_EOF
20288
20289 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
20290         \$(srcdir)/test.priv.h \\
20291         ncurses_cfg.h
20292         $SHOW_CC
20293         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
20294 TEST_EOF
20295 done
20296
20297 if test -f ../config.guess && test -f ../config.sub
20298 then
20299         cat >>Makefile <<TEST_EOF
20300
20301 # if we used CF_INHERIT for getting these files, we can remove them
20302 distclean::
20303         rm -f config.guess config.sub
20304 TEST_EOF
20305 fi
20306  ;;
20307   esac
20308 done
20309 EOF
20310
20311 cat >>$CONFIG_STATUS <<\EOF
20312
20313 { (exit 0); exit 0; }
20314 EOF
20315 chmod +x $CONFIG_STATUS
20316 ac_clean_files=$ac_clean_files_save
20317
20318 # configure is writing to config.log, and then calls config.status.
20319 # config.status does its own redirection, appending to config.log.
20320 # Unfortunately, on DOS this fails, as config.log is still kept open
20321 # by configure, so config.status won't be able to write to it; its
20322 # output is simply discarded.  So we exec the FD to /dev/null,
20323 # effectively closing config.log, so it can be properly (re)opened and
20324 # appended to by config.status.  When coming back to configure, we
20325 # need to make the FD available again.
20326 if test "$no_create" != yes; then
20327   ac_cs_success=:
20328   exec 5>/dev/null
20329   $SHELL $CONFIG_STATUS || ac_cs_success=false
20330   exec 5>>config.log
20331   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
20332   # would make configure fail if this is the last instruction.
20333   $ac_cs_success || { (exit 1); exit 1; }
20334 fi
20335