]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
1383c2f7cacef59d2d09f498291f7b82e61278c7
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20150926.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Packages:
650   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
651   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
652
653 Optional Features:
654   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
655   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
656
657 General Options:
658   --with-pkg-config{=path} enable/disable use of pkg-config
659   --disable-echo          do not display "compiling" commands
660 Curses Version-dependent Options:
661   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
662   --disable-widec         disable checks for wide-character functions
663   --with-curses-dir=DIR   directory in which (n)curses is installed
664   --with-screen=XXX       use specified curses-libraries
665   --with-ncursesw         use wide ncurses-libraries
666   --with-ncurses          use ncurses-libraries
667   --with-pdcurses         compile/link with pdcurses X11 library
668   --with-curses-colr      compile/link with HPUX 10.x color-curses
669   --with-curses-5lib      compile/link with SunOS 5lib curses
670   --with-Xaw3d            link with Xaw 3d library
671   --with-Xaw3dxft         link with Xaw 3d xft library
672   --with-neXtaw           link with neXT Athena library
673   --with-XawPlus          link with Athena-Plus library
674   --with-x                use the X Window System
675 Testing/development Options:
676   --enable-warnings       test: turn on gcc compiler warnings
677   --with-dmalloc          test: use Gray Watson's dmalloc library
678   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
679   --with-valgrind         test: use valgrind
680   --disable-leaks         test: free permanent memory, analyze leaks
681   --disable-rpath-hack    don't add rpath options for additional libraries
682
683 Some influential environment variables:
684   CC          C compiler command
685   CFLAGS      C compiler flags
686   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
687               nonstandard directory <lib dir>
688   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
689               headers in a nonstandard directory <include dir>
690   CPP         C preprocessor
691
692 Use these variables to override the choices made by `configure' or to help
693 it to find libraries and programs with nonstandard names/locations.
694
695 EOF
696 fi
697
698 if test "$ac_init_help" = "recursive"; then
699   # If there are subdirs, report their specific --help.
700   ac_popdir=`pwd`
701   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
702     cd $ac_subdir
703     # A "../" for each directory in /$ac_subdir.
704     ac_dots=`echo $ac_subdir |
705              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
706
707     case $srcdir in
708     .) # No --srcdir option.  We are building in place.
709       ac_sub_srcdir=$srcdir ;;
710     [\\/]* | ?:[\\/]* ) # Absolute path.
711       ac_sub_srcdir=$srcdir/$ac_subdir ;;
712     *) # Relative path.
713       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
714     esac
715
716     # Check for guested configure; otherwise get Cygnus style configure.
717     if test -f $ac_sub_srcdir/configure.gnu; then
718       echo
719       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
720     elif test -f $ac_sub_srcdir/configure; then
721       echo
722       $SHELL $ac_sub_srcdir/configure  --help=recursive
723     elif test -f $ac_sub_srcdir/configure.ac ||
724            test -f $ac_sub_srcdir/configure.in; then
725       echo
726       $ac_configure --help
727     else
728       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
729     fi
730     cd $ac_popdir
731   done
732 fi
733
734 test -n "$ac_init_help" && exit 0
735 if $ac_init_version; then
736   cat <<\EOF
737
738 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
739 Free Software Foundation, Inc.
740 This configure script is free software; the Free Software Foundation
741 gives unlimited permission to copy, distribute and modify it.
742 EOF
743   exit 0
744 fi
745 exec 5>config.log
746 cat >&5 <<EOF
747 This file contains any messages produced by compilers while
748 running configure, to aid debugging if configure makes a mistake.
749
750 It was created by $as_me, which was
751 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
752
753   $ $0 $@
754
755 EOF
756 {
757 cat <<_ASUNAME
758 ## ---------- ##
759 ## Platform.  ##
760 ## ---------- ##
761
762 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
763 uname -m = `(uname -m) 2>/dev/null || echo unknown`
764 uname -r = `(uname -r) 2>/dev/null || echo unknown`
765 uname -s = `(uname -s) 2>/dev/null || echo unknown`
766 uname -v = `(uname -v) 2>/dev/null || echo unknown`
767
768 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
769 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
770
771 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
772 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
773 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
774 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
775 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
776 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
777 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
778
779 PATH = $PATH
780
781 _ASUNAME
782 } >&5
783
784 cat >&5 <<EOF
785 ## ------------ ##
786 ## Core tests.  ##
787 ## ------------ ##
788
789 EOF
790
791 # Keep a trace of the command line.
792 # Strip out --no-create and --no-recursion so they do not pile up.
793 # Also quote any args containing shell meta-characters.
794 ac_configure_args=
795 ac_sep=
796 for ac_arg
797 do
798   case $ac_arg in
799   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
800   | --no-cr | --no-c) ;;
801   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
802   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
803   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
804     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
805     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
806     ac_sep=" " ;;
807   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
808      ac_sep=" " ;;
809   esac
810   # Get rid of the leading space.
811 done
812
813 # When interrupted or exit'd, cleanup temporary files, and complete
814 # config.log.  We remove comments because anyway the quotes in there
815 # would cause problems or look ugly.
816 trap 'exit_status=$?
817   # Save into config.log some information that might help in debugging.
818   echo >&5
819   echo "## ----------------- ##" >&5
820   echo "## Cache variables.  ##" >&5
821   echo "## ----------------- ##" >&5
822   echo >&5
823   # The following way of writing the cache mishandles newlines in values,
824 {
825   (set) 2>&1 |
826     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
827     *ac_space=\ *)
828       sed -n \
829         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
830           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
831       ;;
832     *)
833       sed -n \
834         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
835       ;;
836     esac;
837 } >&5
838   sed "/^$/d" confdefs.h >conftest.log
839   if test -s conftest.log; then
840     echo >&5
841     echo "## ------------ ##" >&5
842     echo "## confdefs.h.  ##" >&5
843     echo "## ------------ ##" >&5
844     echo >&5
845     cat conftest.log >&5
846   fi
847   (echo; echo) >&5
848   test "$ac_signal" != 0 &&
849     echo "$as_me: caught signal $ac_signal" >&5
850   echo "$as_me: exit $exit_status" >&5
851   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
852     exit $exit_status
853      ' 0
854 for ac_signal in 1 2 13 15; do
855   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
856 done
857 ac_signal=0
858
859 # confdefs.h avoids OS command line length limits that DEFS can exceed.
860 rm -rf conftest* confdefs.h
861 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
862 echo >confdefs.h
863
864 # Let the site file select an alternate cache file if it wants to.
865 # Prefer explicitly selected file to automatically selected ones.
866 if test -z "$CONFIG_SITE"; then
867   if test "x$prefix" != xNONE; then
868     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
869   else
870     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
871   fi
872 fi
873 for ac_site_file in $CONFIG_SITE; do
874   if test -r "$ac_site_file"; then
875     { echo "$as_me:875: loading site script $ac_site_file" >&5
876 echo "$as_me: loading site script $ac_site_file" >&6;}
877     cat "$ac_site_file" >&5
878     . "$ac_site_file"
879   fi
880 done
881
882 if test -r "$cache_file"; then
883   # Some versions of bash will fail to source /dev/null (special
884   # files actually), so we avoid doing that.
885   if test -f "$cache_file"; then
886     { echo "$as_me:886: loading cache $cache_file" >&5
887 echo "$as_me: loading cache $cache_file" >&6;}
888     case $cache_file in
889       [\\/]* | ?:[\\/]* ) . $cache_file;;
890       *)                      . ./$cache_file;;
891     esac
892   fi
893 else
894   { echo "$as_me:894: creating cache $cache_file" >&5
895 echo "$as_me: creating cache $cache_file" >&6;}
896   >$cache_file
897 fi
898
899 # Check that the precious variables saved in the cache have kept the same
900 # value.
901 ac_cache_corrupted=false
902 for ac_var in `(set) 2>&1 |
903                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
904   eval ac_old_set=\$ac_cv_env_${ac_var}_set
905   eval ac_new_set=\$ac_env_${ac_var}_set
906   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
907   eval ac_new_val="\$ac_env_${ac_var}_value"
908   case $ac_old_set,$ac_new_set in
909     set,)
910       { echo "$as_me:910: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
911 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
912       ac_cache_corrupted=: ;;
913     ,set)
914       { echo "$as_me:914: error: \`$ac_var' was not set in the previous run" >&5
915 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
916       ac_cache_corrupted=: ;;
917     ,);;
918     *)
919       if test "x$ac_old_val" != "x$ac_new_val"; then
920         { echo "$as_me:920: error: \`$ac_var' has changed since the previous run:" >&5
921 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
922         { echo "$as_me:922:   former value:  $ac_old_val" >&5
923 echo "$as_me:   former value:  $ac_old_val" >&2;}
924         { echo "$as_me:924:   current value: $ac_new_val" >&5
925 echo "$as_me:   current value: $ac_new_val" >&2;}
926         ac_cache_corrupted=:
927       fi;;
928   esac
929   # Pass precious variables to config.status.  It doesn't matter if
930   # we pass some twice (in addition to the command line arguments).
931   if test "$ac_new_set" = set; then
932     case $ac_new_val in
933     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
934       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
935       ac_configure_args="$ac_configure_args '$ac_arg'"
936       ;;
937     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
938        ;;
939     esac
940   fi
941 done
942 if $ac_cache_corrupted; then
943   { echo "$as_me:943: error: changes in the environment can compromise the build" >&5
944 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
945   { { echo "$as_me:945: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
946 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
947    { (exit 1); exit 1; }; }
948 fi
949
950 ac_ext=c
951 ac_cpp='$CPP $CPPFLAGS'
952 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
953 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
954 ac_compiler_gnu=$ac_cv_c_compiler_gnu
955 ac_main_return=return
956
957 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
958   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
959                    ECHO_T='     ' ;;
960   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
961   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
962 esac
963 echo "#! $SHELL" >conftest.sh
964 echo  "exit 0"   >>conftest.sh
965 chmod +x conftest.sh
966 if { (echo "$as_me:966: PATH=\".;.\"; conftest.sh") >&5
967   (PATH=".;."; conftest.sh) 2>&5
968   ac_status=$?
969   echo "$as_me:969: \$? = $ac_status" >&5
970   (exit $ac_status); }; then
971   ac_path_separator=';'
972 else
973   ac_path_separator=:
974 fi
975 PATH_SEPARATOR="$ac_path_separator"
976 rm -f conftest.sh
977
978 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
979
980 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
981
982 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
983
984 ac_aux_dir=
985 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
986   if test -f $ac_dir/install-sh; then
987     ac_aux_dir=$ac_dir
988     ac_install_sh="$ac_aux_dir/install-sh -c"
989     break
990   elif test -f $ac_dir/install.sh; then
991     ac_aux_dir=$ac_dir
992     ac_install_sh="$ac_aux_dir/install.sh -c"
993     break
994   elif test -f $ac_dir/shtool; then
995     ac_aux_dir=$ac_dir
996     ac_install_sh="$ac_aux_dir/shtool install -c"
997     break
998   fi
999 done
1000 if test -z "$ac_aux_dir"; then
1001   { { echo "$as_me:1001: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1002 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1003    { (exit 1); exit 1; }; }
1004 fi
1005 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1006 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1007 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1008
1009 # Make sure we can run config.sub.
1010 $ac_config_sub sun4 >/dev/null 2>&1 ||
1011   { { echo "$as_me:1011: error: cannot run $ac_config_sub" >&5
1012 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1013    { (exit 1); exit 1; }; }
1014
1015 echo "$as_me:1015: checking build system type" >&5
1016 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1017 if test "${ac_cv_build+set}" = set; then
1018   echo $ECHO_N "(cached) $ECHO_C" >&6
1019 else
1020   ac_cv_build_alias=$build_alias
1021 test -z "$ac_cv_build_alias" &&
1022   ac_cv_build_alias=`$ac_config_guess`
1023 test -z "$ac_cv_build_alias" &&
1024   { { echo "$as_me:1024: error: cannot guess build type; you must specify one" >&5
1025 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1026    { (exit 1); exit 1; }; }
1027 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1028   { { echo "$as_me:1028: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1029 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 fi
1033 echo "$as_me:1033: result: $ac_cv_build" >&5
1034 echo "${ECHO_T}$ac_cv_build" >&6
1035 build=$ac_cv_build
1036 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1037 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1038 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1039
1040 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1041         echo "$as_me:1041: checking host system type" >&5
1042 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1043 if test "${ac_cv_host+set}" = set; then
1044   echo $ECHO_N "(cached) $ECHO_C" >&6
1045 else
1046   ac_cv_host_alias=$host_alias
1047 test -z "$ac_cv_host_alias" &&
1048   ac_cv_host_alias=$ac_cv_build_alias
1049 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1050   { { echo "$as_me:1050: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1051 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1052    { (exit 1); exit 1; }; }
1053
1054 fi
1055 echo "$as_me:1055: result: $ac_cv_host" >&5
1056 echo "${ECHO_T}$ac_cv_host" >&6
1057 host=$ac_cv_host
1058 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1059 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1060 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1061
1062         system_name="$host_os"
1063 else
1064         system_name="`(uname -s -r) 2>/dev/null`"
1065         if test -z "$system_name" ; then
1066                 system_name="`(hostname) 2>/dev/null`"
1067         fi
1068 fi
1069 test -n "$system_name" &&
1070 cat >>confdefs.h <<EOF
1071 #define SYSTEM_NAME "$system_name"
1072 EOF
1073
1074 if test "${cf_cv_system_name+set}" = set; then
1075   echo $ECHO_N "(cached) $ECHO_C" >&6
1076 else
1077   cf_cv_system_name="$system_name"
1078 fi
1079
1080 test -z "$system_name" && system_name="$cf_cv_system_name"
1081 test -n "$cf_cv_system_name" && echo "$as_me:1081: result: Configuring for $cf_cv_system_name" >&5
1082 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1083
1084 if test ".$system_name" != ".$cf_cv_system_name" ; then
1085         echo "$as_me:1085: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1086 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1087         { { echo "$as_me:1087: error: \"Please remove config.cache and try again.\"" >&5
1088 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1089    { (exit 1); exit 1; }; }
1090 fi
1091
1092 test "$program_prefix" != NONE &&
1093   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1094 # Use a double $ so make ignores it.
1095 test "$program_suffix" != NONE &&
1096   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1097 # Double any \ or $.  echo might interpret backslashes.
1098 # By default was `s,x,x', remove it if useless.
1099 cat <<\_ACEOF >conftest.sed
1100 s/[\\$]/&&/g;s/;s,x,x,$//
1101 _ACEOF
1102 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1103 rm conftest.sed
1104
1105 echo "$as_me:1105: checking whether ${MAKE-make} sets \${MAKE}" >&5
1106 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1107 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1108 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1109   echo $ECHO_N "(cached) $ECHO_C" >&6
1110 else
1111   cat >conftest.make <<\EOF
1112 all:
1113         @echo 'ac_maketemp="${MAKE}"'
1114 EOF
1115 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1116 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1117 if test -n "$ac_maketemp"; then
1118   eval ac_cv_prog_make_${ac_make}_set=yes
1119 else
1120   eval ac_cv_prog_make_${ac_make}_set=no
1121 fi
1122 rm -f conftest.make
1123 fi
1124 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1125   echo "$as_me:1125: result: yes" >&5
1126 echo "${ECHO_T}yes" >&6
1127   SET_MAKE=
1128 else
1129   echo "$as_me:1129: result: no" >&5
1130 echo "${ECHO_T}no" >&6
1131   SET_MAKE="MAKE=${MAKE-make}"
1132 fi
1133
1134 ac_ext=c
1135 ac_cpp='$CPP $CPPFLAGS'
1136 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1137 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1138 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1139 ac_main_return=return
1140 if test -n "$ac_tool_prefix"; then
1141   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1142 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1143 echo "$as_me:1143: checking for $ac_word" >&5
1144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1145 if test "${ac_cv_prog_CC+set}" = set; then
1146   echo $ECHO_N "(cached) $ECHO_C" >&6
1147 else
1148   if test -n "$CC"; then
1149   ac_cv_prog_CC="$CC" # Let the user override the test.
1150 else
1151   ac_save_IFS=$IFS; IFS=$ac_path_separator
1152 ac_dummy="$PATH"
1153 for ac_dir in $ac_dummy; do
1154   IFS=$ac_save_IFS
1155   test -z "$ac_dir" && ac_dir=.
1156   $as_executable_p "$ac_dir/$ac_word" || continue
1157 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1158 echo "$as_me:1158: found $ac_dir/$ac_word" >&5
1159 break
1160 done
1161
1162 fi
1163 fi
1164 CC=$ac_cv_prog_CC
1165 if test -n "$CC"; then
1166   echo "$as_me:1166: result: $CC" >&5
1167 echo "${ECHO_T}$CC" >&6
1168 else
1169   echo "$as_me:1169: result: no" >&5
1170 echo "${ECHO_T}no" >&6
1171 fi
1172
1173 fi
1174 if test -z "$ac_cv_prog_CC"; then
1175   ac_ct_CC=$CC
1176   # Extract the first word of "gcc", so it can be a program name with args.
1177 set dummy gcc; ac_word=$2
1178 echo "$as_me:1178: checking for $ac_word" >&5
1179 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1180 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1181   echo $ECHO_N "(cached) $ECHO_C" >&6
1182 else
1183   if test -n "$ac_ct_CC"; then
1184   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1185 else
1186   ac_save_IFS=$IFS; IFS=$ac_path_separator
1187 ac_dummy="$PATH"
1188 for ac_dir in $ac_dummy; do
1189   IFS=$ac_save_IFS
1190   test -z "$ac_dir" && ac_dir=.
1191   $as_executable_p "$ac_dir/$ac_word" || continue
1192 ac_cv_prog_ac_ct_CC="gcc"
1193 echo "$as_me:1193: found $ac_dir/$ac_word" >&5
1194 break
1195 done
1196
1197 fi
1198 fi
1199 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1200 if test -n "$ac_ct_CC"; then
1201   echo "$as_me:1201: result: $ac_ct_CC" >&5
1202 echo "${ECHO_T}$ac_ct_CC" >&6
1203 else
1204   echo "$as_me:1204: result: no" >&5
1205 echo "${ECHO_T}no" >&6
1206 fi
1207
1208   CC=$ac_ct_CC
1209 else
1210   CC="$ac_cv_prog_CC"
1211 fi
1212
1213 if test -z "$CC"; then
1214   if test -n "$ac_tool_prefix"; then
1215   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1216 set dummy ${ac_tool_prefix}cc; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_CC+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$CC"; then
1223   ac_cv_prog_CC="$CC" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_CC="${ac_tool_prefix}cc"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 CC=$ac_cv_prog_CC
1239 if test -n "$CC"; then
1240   echo "$as_me:1240: result: $CC" >&5
1241 echo "${ECHO_T}$CC" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247 fi
1248 if test -z "$ac_cv_prog_CC"; then
1249   ac_ct_CC=$CC
1250   # Extract the first word of "cc", so it can be a program name with args.
1251 set dummy cc; ac_word=$2
1252 echo "$as_me:1252: checking for $ac_word" >&5
1253 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1254 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1255   echo $ECHO_N "(cached) $ECHO_C" >&6
1256 else
1257   if test -n "$ac_ct_CC"; then
1258   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1259 else
1260   ac_save_IFS=$IFS; IFS=$ac_path_separator
1261 ac_dummy="$PATH"
1262 for ac_dir in $ac_dummy; do
1263   IFS=$ac_save_IFS
1264   test -z "$ac_dir" && ac_dir=.
1265   $as_executable_p "$ac_dir/$ac_word" || continue
1266 ac_cv_prog_ac_ct_CC="cc"
1267 echo "$as_me:1267: found $ac_dir/$ac_word" >&5
1268 break
1269 done
1270
1271 fi
1272 fi
1273 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1274 if test -n "$ac_ct_CC"; then
1275   echo "$as_me:1275: result: $ac_ct_CC" >&5
1276 echo "${ECHO_T}$ac_ct_CC" >&6
1277 else
1278   echo "$as_me:1278: result: no" >&5
1279 echo "${ECHO_T}no" >&6
1280 fi
1281
1282   CC=$ac_ct_CC
1283 else
1284   CC="$ac_cv_prog_CC"
1285 fi
1286
1287 fi
1288 if test -z "$CC"; then
1289   # Extract the first word of "cc", so it can be a program name with args.
1290 set dummy cc; ac_word=$2
1291 echo "$as_me:1291: checking for $ac_word" >&5
1292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1293 if test "${ac_cv_prog_CC+set}" = set; then
1294   echo $ECHO_N "(cached) $ECHO_C" >&6
1295 else
1296   if test -n "$CC"; then
1297   ac_cv_prog_CC="$CC" # Let the user override the test.
1298 else
1299   ac_prog_rejected=no
1300   ac_save_IFS=$IFS; IFS=$ac_path_separator
1301 ac_dummy="$PATH"
1302 for ac_dir in $ac_dummy; do
1303   IFS=$ac_save_IFS
1304   test -z "$ac_dir" && ac_dir=.
1305   $as_executable_p "$ac_dir/$ac_word" || continue
1306 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1307   ac_prog_rejected=yes
1308   continue
1309 fi
1310 ac_cv_prog_CC="cc"
1311 echo "$as_me:1311: found $ac_dir/$ac_word" >&5
1312 break
1313 done
1314
1315 if test $ac_prog_rejected = yes; then
1316   # We found a bogon in the path, so make sure we never use it.
1317   set dummy $ac_cv_prog_CC
1318   shift
1319   if test $# != 0; then
1320     # We chose a different compiler from the bogus one.
1321     # However, it has the same basename, so the bogon will be chosen
1322     # first if we set CC to just the basename; use the full file name.
1323     shift
1324     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1325     shift
1326     ac_cv_prog_CC="$@"
1327   fi
1328 fi
1329 fi
1330 fi
1331 CC=$ac_cv_prog_CC
1332 if test -n "$CC"; then
1333   echo "$as_me:1333: result: $CC" >&5
1334 echo "${ECHO_T}$CC" >&6
1335 else
1336   echo "$as_me:1336: result: no" >&5
1337 echo "${ECHO_T}no" >&6
1338 fi
1339
1340 fi
1341 if test -z "$CC"; then
1342   if test -n "$ac_tool_prefix"; then
1343   for ac_prog in cl
1344   do
1345     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1346 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1347 echo "$as_me:1347: checking for $ac_word" >&5
1348 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1349 if test "${ac_cv_prog_CC+set}" = set; then
1350   echo $ECHO_N "(cached) $ECHO_C" >&6
1351 else
1352   if test -n "$CC"; then
1353   ac_cv_prog_CC="$CC" # Let the user override the test.
1354 else
1355   ac_save_IFS=$IFS; IFS=$ac_path_separator
1356 ac_dummy="$PATH"
1357 for ac_dir in $ac_dummy; do
1358   IFS=$ac_save_IFS
1359   test -z "$ac_dir" && ac_dir=.
1360   $as_executable_p "$ac_dir/$ac_word" || continue
1361 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1362 echo "$as_me:1362: found $ac_dir/$ac_word" >&5
1363 break
1364 done
1365
1366 fi
1367 fi
1368 CC=$ac_cv_prog_CC
1369 if test -n "$CC"; then
1370   echo "$as_me:1370: result: $CC" >&5
1371 echo "${ECHO_T}$CC" >&6
1372 else
1373   echo "$as_me:1373: result: no" >&5
1374 echo "${ECHO_T}no" >&6
1375 fi
1376
1377     test -n "$CC" && break
1378   done
1379 fi
1380 if test -z "$CC"; then
1381   ac_ct_CC=$CC
1382   for ac_prog in cl
1383 do
1384   # Extract the first word of "$ac_prog", so it can be a program name with args.
1385 set dummy $ac_prog; ac_word=$2
1386 echo "$as_me:1386: checking for $ac_word" >&5
1387 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1388 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1389   echo $ECHO_N "(cached) $ECHO_C" >&6
1390 else
1391   if test -n "$ac_ct_CC"; then
1392   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1393 else
1394   ac_save_IFS=$IFS; IFS=$ac_path_separator
1395 ac_dummy="$PATH"
1396 for ac_dir in $ac_dummy; do
1397   IFS=$ac_save_IFS
1398   test -z "$ac_dir" && ac_dir=.
1399   $as_executable_p "$ac_dir/$ac_word" || continue
1400 ac_cv_prog_ac_ct_CC="$ac_prog"
1401 echo "$as_me:1401: found $ac_dir/$ac_word" >&5
1402 break
1403 done
1404
1405 fi
1406 fi
1407 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1408 if test -n "$ac_ct_CC"; then
1409   echo "$as_me:1409: result: $ac_ct_CC" >&5
1410 echo "${ECHO_T}$ac_ct_CC" >&6
1411 else
1412   echo "$as_me:1412: result: no" >&5
1413 echo "${ECHO_T}no" >&6
1414 fi
1415
1416   test -n "$ac_ct_CC" && break
1417 done
1418
1419   CC=$ac_ct_CC
1420 fi
1421
1422 fi
1423
1424 test -z "$CC" && { { echo "$as_me:1424: error: no acceptable cc found in \$PATH" >&5
1425 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1426    { (exit 1); exit 1; }; }
1427
1428 # Provide some information about the compiler.
1429 echo "$as_me:1429:" \
1430      "checking for C compiler version" >&5
1431 ac_compiler=`set X $ac_compile; echo $2`
1432 { (eval echo "$as_me:1432: \"$ac_compiler --version </dev/null >&5\"") >&5
1433   (eval $ac_compiler --version </dev/null >&5) 2>&5
1434   ac_status=$?
1435   echo "$as_me:1435: \$? = $ac_status" >&5
1436   (exit $ac_status); }
1437 { (eval echo "$as_me:1437: \"$ac_compiler -v </dev/null >&5\"") >&5
1438   (eval $ac_compiler -v </dev/null >&5) 2>&5
1439   ac_status=$?
1440   echo "$as_me:1440: \$? = $ac_status" >&5
1441   (exit $ac_status); }
1442 { (eval echo "$as_me:1442: \"$ac_compiler -V </dev/null >&5\"") >&5
1443   (eval $ac_compiler -V </dev/null >&5) 2>&5
1444   ac_status=$?
1445   echo "$as_me:1445: \$? = $ac_status" >&5
1446   (exit $ac_status); }
1447
1448 cat >conftest.$ac_ext <<_ACEOF
1449 #line 1449 "configure"
1450 #include "confdefs.h"
1451
1452 int
1453 main ()
1454 {
1455
1456   ;
1457   return 0;
1458 }
1459 _ACEOF
1460 ac_clean_files_save=$ac_clean_files
1461 ac_clean_files="$ac_clean_files a.out a.exe"
1462 # Try to create an executable without -o first, disregard a.out.
1463 # It will help us diagnose broken compilers, and finding out an intuition
1464 # of exeext.
1465 echo "$as_me:1465: checking for C compiler default output" >&5
1466 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1467 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1468 if { (eval echo "$as_me:1468: \"$ac_link_default\"") >&5
1469   (eval $ac_link_default) 2>&5
1470   ac_status=$?
1471   echo "$as_me:1471: \$? = $ac_status" >&5
1472   (exit $ac_status); }; then
1473   # Find the output, starting from the most likely.  This scheme is
1474 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1475 # resort.
1476 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1477                 ls a.out conftest 2>/dev/null;
1478                 ls a.* conftest.* 2>/dev/null`; do
1479   case $ac_file in
1480     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1481     a.out ) # We found the default executable, but exeext='' is most
1482             # certainly right.
1483             break;;
1484     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1485           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1486           export ac_cv_exeext
1487           break;;
1488     * ) break;;
1489   esac
1490 done
1491 else
1492   echo "$as_me: failed program was:" >&5
1493 cat conftest.$ac_ext >&5
1494 { { echo "$as_me:1494: error: C compiler cannot create executables" >&5
1495 echo "$as_me: error: C compiler cannot create executables" >&2;}
1496    { (exit 77); exit 77; }; }
1497 fi
1498
1499 ac_exeext=$ac_cv_exeext
1500 echo "$as_me:1500: result: $ac_file" >&5
1501 echo "${ECHO_T}$ac_file" >&6
1502
1503 # Check the compiler produces executables we can run.  If not, either
1504 # the compiler is broken, or we cross compile.
1505 echo "$as_me:1505: checking whether the C compiler works" >&5
1506 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1507 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1508 # If not cross compiling, check that we can run a simple program.
1509 if test "$cross_compiling" != yes; then
1510   if { ac_try='./$ac_file'
1511   { (eval echo "$as_me:1511: \"$ac_try\"") >&5
1512   (eval $ac_try) 2>&5
1513   ac_status=$?
1514   echo "$as_me:1514: \$? = $ac_status" >&5
1515   (exit $ac_status); }; }; then
1516     cross_compiling=no
1517   else
1518     if test "$cross_compiling" = maybe; then
1519         cross_compiling=yes
1520     else
1521         { { echo "$as_me:1521: error: cannot run C compiled programs.
1522 If you meant to cross compile, use \`--host'." >&5
1523 echo "$as_me: error: cannot run C compiled programs.
1524 If you meant to cross compile, use \`--host'." >&2;}
1525    { (exit 1); exit 1; }; }
1526     fi
1527   fi
1528 fi
1529 echo "$as_me:1529: result: yes" >&5
1530 echo "${ECHO_T}yes" >&6
1531
1532 rm -f a.out a.exe conftest$ac_cv_exeext
1533 ac_clean_files=$ac_clean_files_save
1534 # Check the compiler produces executables we can run.  If not, either
1535 # the compiler is broken, or we cross compile.
1536 echo "$as_me:1536: checking whether we are cross compiling" >&5
1537 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1538 echo "$as_me:1538: result: $cross_compiling" >&5
1539 echo "${ECHO_T}$cross_compiling" >&6
1540
1541 echo "$as_me:1541: checking for executable suffix" >&5
1542 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1543 if { (eval echo "$as_me:1543: \"$ac_link\"") >&5
1544   (eval $ac_link) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit $ac_status); }; then
1548   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1549 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1550 # work properly (i.e., refer to `conftest.exe'), while it won't with
1551 # `rm'.
1552 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1553   case $ac_file in
1554     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1555     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1556           export ac_cv_exeext
1557           break;;
1558     * ) break;;
1559   esac
1560 done
1561 else
1562   { { echo "$as_me:1562: error: cannot compute EXEEXT: cannot compile and link" >&5
1563 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1564    { (exit 1); exit 1; }; }
1565 fi
1566
1567 rm -f conftest$ac_cv_exeext
1568 echo "$as_me:1568: result: $ac_cv_exeext" >&5
1569 echo "${ECHO_T}$ac_cv_exeext" >&6
1570
1571 rm -f conftest.$ac_ext
1572 EXEEXT=$ac_cv_exeext
1573 ac_exeext=$EXEEXT
1574 echo "$as_me:1574: checking for object suffix" >&5
1575 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1576 if test "${ac_cv_objext+set}" = set; then
1577   echo $ECHO_N "(cached) $ECHO_C" >&6
1578 else
1579   cat >conftest.$ac_ext <<_ACEOF
1580 #line 1580 "configure"
1581 #include "confdefs.h"
1582
1583 int
1584 main ()
1585 {
1586
1587   ;
1588   return 0;
1589 }
1590 _ACEOF
1591 rm -f conftest.o conftest.obj
1592 if { (eval echo "$as_me:1592: \"$ac_compile\"") >&5
1593   (eval $ac_compile) 2>&5
1594   ac_status=$?
1595   echo "$as_me:1595: \$? = $ac_status" >&5
1596   (exit $ac_status); }; then
1597   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1598   case $ac_file in
1599     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1600     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1601        break;;
1602   esac
1603 done
1604 else
1605   echo "$as_me: failed program was:" >&5
1606 cat conftest.$ac_ext >&5
1607 { { echo "$as_me:1607: error: cannot compute OBJEXT: cannot compile" >&5
1608 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1609    { (exit 1); exit 1; }; }
1610 fi
1611
1612 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1613 fi
1614 echo "$as_me:1614: result: $ac_cv_objext" >&5
1615 echo "${ECHO_T}$ac_cv_objext" >&6
1616 OBJEXT=$ac_cv_objext
1617 ac_objext=$OBJEXT
1618 echo "$as_me:1618: checking whether we are using the GNU C compiler" >&5
1619 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1620 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1621   echo $ECHO_N "(cached) $ECHO_C" >&6
1622 else
1623   cat >conftest.$ac_ext <<_ACEOF
1624 #line 1624 "configure"
1625 #include "confdefs.h"
1626
1627 int
1628 main ()
1629 {
1630 #ifndef __GNUC__
1631        choke me
1632 #endif
1633
1634   ;
1635   return 0;
1636 }
1637 _ACEOF
1638 rm -f conftest.$ac_objext
1639 if { (eval echo "$as_me:1639: \"$ac_compile\"") >&5
1640   (eval $ac_compile) 2>&5
1641   ac_status=$?
1642   echo "$as_me:1642: \$? = $ac_status" >&5
1643   (exit $ac_status); } &&
1644          { ac_try='test -s conftest.$ac_objext'
1645   { (eval echo "$as_me:1645: \"$ac_try\"") >&5
1646   (eval $ac_try) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); }; }; then
1650   ac_compiler_gnu=yes
1651 else
1652   echo "$as_me: failed program was:" >&5
1653 cat conftest.$ac_ext >&5
1654 ac_compiler_gnu=no
1655 fi
1656 rm -f conftest.$ac_objext conftest.$ac_ext
1657 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1658
1659 fi
1660 echo "$as_me:1660: result: $ac_cv_c_compiler_gnu" >&5
1661 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1662 GCC=`test $ac_compiler_gnu = yes && echo yes`
1663 ac_test_CFLAGS=${CFLAGS+set}
1664 ac_save_CFLAGS=$CFLAGS
1665 CFLAGS="-g"
1666 echo "$as_me:1666: checking whether $CC accepts -g" >&5
1667 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1668 if test "${ac_cv_prog_cc_g+set}" = set; then
1669   echo $ECHO_N "(cached) $ECHO_C" >&6
1670 else
1671   cat >conftest.$ac_ext <<_ACEOF
1672 #line 1672 "configure"
1673 #include "confdefs.h"
1674
1675 int
1676 main ()
1677 {
1678
1679   ;
1680   return 0;
1681 }
1682 _ACEOF
1683 rm -f conftest.$ac_objext
1684 if { (eval echo "$as_me:1684: \"$ac_compile\"") >&5
1685   (eval $ac_compile) 2>&5
1686   ac_status=$?
1687   echo "$as_me:1687: \$? = $ac_status" >&5
1688   (exit $ac_status); } &&
1689          { ac_try='test -s conftest.$ac_objext'
1690   { (eval echo "$as_me:1690: \"$ac_try\"") >&5
1691   (eval $ac_try) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); }; }; then
1695   ac_cv_prog_cc_g=yes
1696 else
1697   echo "$as_me: failed program was:" >&5
1698 cat conftest.$ac_ext >&5
1699 ac_cv_prog_cc_g=no
1700 fi
1701 rm -f conftest.$ac_objext conftest.$ac_ext
1702 fi
1703 echo "$as_me:1703: result: $ac_cv_prog_cc_g" >&5
1704 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1705 if test "$ac_test_CFLAGS" = set; then
1706   CFLAGS=$ac_save_CFLAGS
1707 elif test $ac_cv_prog_cc_g = yes; then
1708   if test "$GCC" = yes; then
1709     CFLAGS="-g -O2"
1710   else
1711     CFLAGS="-g"
1712   fi
1713 else
1714   if test "$GCC" = yes; then
1715     CFLAGS="-O2"
1716   else
1717     CFLAGS=
1718   fi
1719 fi
1720 # Some people use a C++ compiler to compile C.  Since we use `exit',
1721 # in C++ we need to declare it.  In case someone uses the same compiler
1722 # for both compiling C and C++ we need to have the C++ compiler decide
1723 # the declaration of exit, since it's the most demanding environment.
1724 cat >conftest.$ac_ext <<_ACEOF
1725 #ifndef __cplusplus
1726   choke me
1727 #endif
1728 _ACEOF
1729 rm -f conftest.$ac_objext
1730 if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5
1731   (eval $ac_compile) 2>&5
1732   ac_status=$?
1733   echo "$as_me:1733: \$? = $ac_status" >&5
1734   (exit $ac_status); } &&
1735          { ac_try='test -s conftest.$ac_objext'
1736   { (eval echo "$as_me:1736: \"$ac_try\"") >&5
1737   (eval $ac_try) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); }; }; then
1741   for ac_declaration in \
1742    ''\
1743    '#include <stdlib.h>' \
1744    'extern "C" void std::exit (int) throw (); using std::exit;' \
1745    'extern "C" void std::exit (int); using std::exit;' \
1746    'extern "C" void exit (int) throw ();' \
1747    'extern "C" void exit (int);' \
1748    'void exit (int);'
1749 do
1750   cat >conftest.$ac_ext <<_ACEOF
1751 #line 1751 "configure"
1752 #include "confdefs.h"
1753 #include <stdlib.h>
1754 $ac_declaration
1755 int
1756 main ()
1757 {
1758 exit (42);
1759   ;
1760   return 0;
1761 }
1762 _ACEOF
1763 rm -f conftest.$ac_objext
1764 if { (eval echo "$as_me:1764: \"$ac_compile\"") >&5
1765   (eval $ac_compile) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); } &&
1769          { ac_try='test -s conftest.$ac_objext'
1770   { (eval echo "$as_me:1770: \"$ac_try\"") >&5
1771   (eval $ac_try) 2>&5
1772   ac_status=$?
1773   echo "$as_me:1773: \$? = $ac_status" >&5
1774   (exit $ac_status); }; }; then
1775   :
1776 else
1777   echo "$as_me: failed program was:" >&5
1778 cat conftest.$ac_ext >&5
1779 continue
1780 fi
1781 rm -f conftest.$ac_objext conftest.$ac_ext
1782   cat >conftest.$ac_ext <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 $ac_declaration
1786 int
1787 main ()
1788 {
1789 exit (42);
1790   ;
1791   return 0;
1792 }
1793 _ACEOF
1794 rm -f conftest.$ac_objext
1795 if { (eval echo "$as_me:1795: \"$ac_compile\"") >&5
1796   (eval $ac_compile) 2>&5
1797   ac_status=$?
1798   echo "$as_me:1798: \$? = $ac_status" >&5
1799   (exit $ac_status); } &&
1800          { ac_try='test -s conftest.$ac_objext'
1801   { (eval echo "$as_me:1801: \"$ac_try\"") >&5
1802   (eval $ac_try) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit $ac_status); }; }; then
1806   break
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat conftest.$ac_ext >&5
1810 fi
1811 rm -f conftest.$ac_objext conftest.$ac_ext
1812 done
1813 rm -rf conftest*
1814 if test -n "$ac_declaration"; then
1815   echo '#ifdef __cplusplus' >>confdefs.h
1816   echo $ac_declaration      >>confdefs.h
1817   echo '#endif'             >>confdefs.h
1818 fi
1819
1820 else
1821   echo "$as_me: failed program was:" >&5
1822 cat conftest.$ac_ext >&5
1823 fi
1824 rm -f conftest.$ac_objext conftest.$ac_ext
1825 ac_ext=c
1826 ac_cpp='$CPP $CPPFLAGS'
1827 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1828 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1829 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1830 ac_main_return=return
1831
1832 GCC_VERSION=none
1833 if test "$GCC" = yes ; then
1834         echo "$as_me:1834: checking version of $CC" >&5
1835 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1836         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1837         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1838         echo "$as_me:1838: result: $GCC_VERSION" >&5
1839 echo "${ECHO_T}$GCC_VERSION" >&6
1840 fi
1841
1842 echo "$as_me:1842: checking for $CC option to accept ANSI C" >&5
1843 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1844 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1845   echo $ECHO_N "(cached) $ECHO_C" >&6
1846 else
1847   ac_cv_prog_cc_stdc=no
1848 ac_save_CC=$CC
1849 cat >conftest.$ac_ext <<_ACEOF
1850 #line 1850 "configure"
1851 #include "confdefs.h"
1852 #include <stdarg.h>
1853 #include <stdio.h>
1854 #include <sys/types.h>
1855 #include <sys/stat.h>
1856 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1857 struct buf { int x; };
1858 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1859 static char *e (p, i)
1860      char **p;
1861      int i;
1862 {
1863   return p[i];
1864 }
1865 static char *f (char * (*g) (char **, int), char **p, ...)
1866 {
1867   char *s;
1868   va_list v;
1869   va_start (v,p);
1870   s = g (p, va_arg (v,int));
1871   va_end (v);
1872   return s;
1873 }
1874 int test (int i, double x);
1875 struct s1 {int (*f) (int a);};
1876 struct s2 {int (*f) (double a);};
1877 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1878 int argc;
1879 char **argv;
1880 int
1881 main ()
1882 {
1883 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 # Don't try gcc -ansi; that turns off useful extensions and
1889 # breaks some systems' header files.
1890 # AIX                   -qlanglvl=ansi
1891 # Ultrix and OSF/1      -std1
1892 # HP-UX 10.20 and later -Ae
1893 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1894 # SVR4                  -Xc -D__EXTENSIONS__
1895 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1896 do
1897   CC="$ac_save_CC $ac_arg"
1898   rm -f conftest.$ac_objext
1899 if { (eval echo "$as_me:1899: \"$ac_compile\"") >&5
1900   (eval $ac_compile) 2>&5
1901   ac_status=$?
1902   echo "$as_me:1902: \$? = $ac_status" >&5
1903   (exit $ac_status); } &&
1904          { ac_try='test -s conftest.$ac_objext'
1905   { (eval echo "$as_me:1905: \"$ac_try\"") >&5
1906   (eval $ac_try) 2>&5
1907   ac_status=$?
1908   echo "$as_me:1908: \$? = $ac_status" >&5
1909   (exit $ac_status); }; }; then
1910   ac_cv_prog_cc_stdc=$ac_arg
1911 break
1912 else
1913   echo "$as_me: failed program was:" >&5
1914 cat conftest.$ac_ext >&5
1915 fi
1916 rm -f conftest.$ac_objext
1917 done
1918 rm -f conftest.$ac_ext conftest.$ac_objext
1919 CC=$ac_save_CC
1920
1921 fi
1922
1923 case "x$ac_cv_prog_cc_stdc" in
1924   x|xno)
1925     echo "$as_me:1925: result: none needed" >&5
1926 echo "${ECHO_T}none needed" >&6 ;;
1927   *)
1928     echo "$as_me:1928: result: $ac_cv_prog_cc_stdc" >&5
1929 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1930     CC="$CC $ac_cv_prog_cc_stdc" ;;
1931 esac
1932
1933 # This should have been defined by AC_PROG_CC
1934 : ${CC:=cc}
1935
1936 echo "$as_me:1936: checking \$CC variable" >&5
1937 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1938 case "$CC" in
1939 (*[\ \  ]-*)
1940         echo "$as_me:1940: result: broken" >&5
1941 echo "${ECHO_T}broken" >&6
1942         { echo "$as_me:1942: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1943 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1944         # humor him...
1945         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ][      ]*//'`
1946         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1947
1948 cf_fix_cppflags=no
1949 cf_new_cflags=
1950 cf_new_cppflags=
1951 cf_new_extra_cppflags=
1952
1953 for cf_add_cflags in $cf_flags
1954 do
1955 case $cf_fix_cppflags in
1956 (no)
1957         case $cf_add_cflags in
1958         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1959                 case $cf_add_cflags in
1960                 (-D*)
1961                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1962
1963                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1964                                 && test -z "${cf_tst_cflags}" \
1965                                 && cf_fix_cppflags=yes
1966
1967                         if test $cf_fix_cppflags = yes ; then
1968                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1969                                 continue
1970                         elif test "${cf_tst_cflags}" = "\"'" ; then
1971                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1972                                 continue
1973                         fi
1974                         ;;
1975                 esac
1976                 case "$CPPFLAGS" in
1977                 (*$cf_add_cflags)
1978                         ;;
1979                 (*)
1980                         case $cf_add_cflags in
1981                         (-D*)
1982                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1983
1984 CPPFLAGS=`echo "$CPPFLAGS" | \
1985         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1986                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1987
1988                                 ;;
1989                         esac
1990                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1991                         ;;
1992                 esac
1993                 ;;
1994         (*)
1995                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1996                 ;;
1997         esac
1998         ;;
1999 (yes)
2000         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2001
2002         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2003
2004         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2005                 && test -z "${cf_tst_cflags}" \
2006                 && cf_fix_cppflags=no
2007         ;;
2008 esac
2009 done
2010
2011 if test -n "$cf_new_cflags" ; then
2012
2013         CFLAGS="$CFLAGS $cf_new_cflags"
2014 fi
2015
2016 if test -n "$cf_new_cppflags" ; then
2017
2018         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2019 fi
2020
2021 if test -n "$cf_new_extra_cppflags" ; then
2022
2023         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2024 fi
2025
2026         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2027
2028 echo "${as_me:-configure}:2028: testing resulting CC: '$CC' ..." 1>&5
2029
2030         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2031
2032 echo "${as_me:-configure}:2032: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2033
2034         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2035
2036 echo "${as_me:-configure}:2036: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2037
2038         ;;
2039 (*)
2040         echo "$as_me:2040: result: ok" >&5
2041 echo "${ECHO_T}ok" >&6
2042         ;;
2043 esac
2044
2045 ac_ext=c
2046 ac_cpp='$CPP $CPPFLAGS'
2047 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2048 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2049 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2050 ac_main_return=return
2051 echo "$as_me:2051: checking how to run the C preprocessor" >&5
2052 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2053 # On Suns, sometimes $CPP names a directory.
2054 if test -n "$CPP" && test -d "$CPP"; then
2055   CPP=
2056 fi
2057 if test -z "$CPP"; then
2058   if test "${ac_cv_prog_CPP+set}" = set; then
2059   echo $ECHO_N "(cached) $ECHO_C" >&6
2060 else
2061       # Double quotes because CPP needs to be expanded
2062     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2063     do
2064       ac_preproc_ok=false
2065 for ac_c_preproc_warn_flag in '' yes
2066 do
2067   # Use a header file that comes with gcc, so configuring glibc
2068   # with a fresh cross-compiler works.
2069   # On the NeXT, cc -E runs the code through the compiler's parser,
2070   # not just through cpp. "Syntax error" is here to catch this case.
2071   cat >conftest.$ac_ext <<_ACEOF
2072 #line 2072 "configure"
2073 #include "confdefs.h"
2074 #include <assert.h>
2075                      Syntax error
2076 _ACEOF
2077 if { (eval echo "$as_me:2077: \"$ac_cpp conftest.$ac_ext\"") >&5
2078   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2079   ac_status=$?
2080   egrep -v '^ *\+' conftest.er1 >conftest.err
2081   rm -f conftest.er1
2082   cat conftest.err >&5
2083   echo "$as_me:2083: \$? = $ac_status" >&5
2084   (exit $ac_status); } >/dev/null; then
2085   if test -s conftest.err; then
2086     ac_cpp_err=$ac_c_preproc_warn_flag
2087   else
2088     ac_cpp_err=
2089   fi
2090 else
2091   ac_cpp_err=yes
2092 fi
2093 if test -z "$ac_cpp_err"; then
2094   :
2095 else
2096   echo "$as_me: failed program was:" >&5
2097   cat conftest.$ac_ext >&5
2098   # Broken: fails on valid input.
2099 continue
2100 fi
2101 rm -f conftest.err conftest.$ac_ext
2102
2103   # OK, works on sane cases.  Now check whether non-existent headers
2104   # can be detected and how.
2105   cat >conftest.$ac_ext <<_ACEOF
2106 #line 2106 "configure"
2107 #include "confdefs.h"
2108 #include <ac_nonexistent.h>
2109 _ACEOF
2110 if { (eval echo "$as_me:2110: \"$ac_cpp conftest.$ac_ext\"") >&5
2111   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2112   ac_status=$?
2113   egrep -v '^ *\+' conftest.er1 >conftest.err
2114   rm -f conftest.er1
2115   cat conftest.err >&5
2116   echo "$as_me:2116: \$? = $ac_status" >&5
2117   (exit $ac_status); } >/dev/null; then
2118   if test -s conftest.err; then
2119     ac_cpp_err=$ac_c_preproc_warn_flag
2120   else
2121     ac_cpp_err=
2122   fi
2123 else
2124   ac_cpp_err=yes
2125 fi
2126 if test -z "$ac_cpp_err"; then
2127   # Broken: success on invalid input.
2128 continue
2129 else
2130   echo "$as_me: failed program was:" >&5
2131   cat conftest.$ac_ext >&5
2132   # Passes both tests.
2133 ac_preproc_ok=:
2134 break
2135 fi
2136 rm -f conftest.err conftest.$ac_ext
2137
2138 done
2139 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2140 rm -f conftest.err conftest.$ac_ext
2141 if $ac_preproc_ok; then
2142   break
2143 fi
2144
2145     done
2146     ac_cv_prog_CPP=$CPP
2147
2148 fi
2149   CPP=$ac_cv_prog_CPP
2150 else
2151   ac_cv_prog_CPP=$CPP
2152 fi
2153 echo "$as_me:2153: result: $CPP" >&5
2154 echo "${ECHO_T}$CPP" >&6
2155 ac_preproc_ok=false
2156 for ac_c_preproc_warn_flag in '' yes
2157 do
2158   # Use a header file that comes with gcc, so configuring glibc
2159   # with a fresh cross-compiler works.
2160   # On the NeXT, cc -E runs the code through the compiler's parser,
2161   # not just through cpp. "Syntax error" is here to catch this case.
2162   cat >conftest.$ac_ext <<_ACEOF
2163 #line 2163 "configure"
2164 #include "confdefs.h"
2165 #include <assert.h>
2166                      Syntax error
2167 _ACEOF
2168 if { (eval echo "$as_me:2168: \"$ac_cpp conftest.$ac_ext\"") >&5
2169   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2170   ac_status=$?
2171   egrep -v '^ *\+' conftest.er1 >conftest.err
2172   rm -f conftest.er1
2173   cat conftest.err >&5
2174   echo "$as_me:2174: \$? = $ac_status" >&5
2175   (exit $ac_status); } >/dev/null; then
2176   if test -s conftest.err; then
2177     ac_cpp_err=$ac_c_preproc_warn_flag
2178   else
2179     ac_cpp_err=
2180   fi
2181 else
2182   ac_cpp_err=yes
2183 fi
2184 if test -z "$ac_cpp_err"; then
2185   :
2186 else
2187   echo "$as_me: failed program was:" >&5
2188   cat conftest.$ac_ext >&5
2189   # Broken: fails on valid input.
2190 continue
2191 fi
2192 rm -f conftest.err conftest.$ac_ext
2193
2194   # OK, works on sane cases.  Now check whether non-existent headers
2195   # can be detected and how.
2196   cat >conftest.$ac_ext <<_ACEOF
2197 #line 2197 "configure"
2198 #include "confdefs.h"
2199 #include <ac_nonexistent.h>
2200 _ACEOF
2201 if { (eval echo "$as_me:2201: \"$ac_cpp conftest.$ac_ext\"") >&5
2202   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2203   ac_status=$?
2204   egrep -v '^ *\+' conftest.er1 >conftest.err
2205   rm -f conftest.er1
2206   cat conftest.err >&5
2207   echo "$as_me:2207: \$? = $ac_status" >&5
2208   (exit $ac_status); } >/dev/null; then
2209   if test -s conftest.err; then
2210     ac_cpp_err=$ac_c_preproc_warn_flag
2211   else
2212     ac_cpp_err=
2213   fi
2214 else
2215   ac_cpp_err=yes
2216 fi
2217 if test -z "$ac_cpp_err"; then
2218   # Broken: success on invalid input.
2219 continue
2220 else
2221   echo "$as_me: failed program was:" >&5
2222   cat conftest.$ac_ext >&5
2223   # Passes both tests.
2224 ac_preproc_ok=:
2225 break
2226 fi
2227 rm -f conftest.err conftest.$ac_ext
2228
2229 done
2230 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2231 rm -f conftest.err conftest.$ac_ext
2232 if $ac_preproc_ok; then
2233   :
2234 else
2235   { { echo "$as_me:2235: error: C preprocessor \"$CPP\" fails sanity check" >&5
2236 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2237    { (exit 1); exit 1; }; }
2238 fi
2239
2240 ac_ext=c
2241 ac_cpp='$CPP $CPPFLAGS'
2242 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2243 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2244 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2245 ac_main_return=return
2246
2247 for ac_prog in mawk gawk nawk awk
2248 do
2249   # Extract the first word of "$ac_prog", so it can be a program name with args.
2250 set dummy $ac_prog; ac_word=$2
2251 echo "$as_me:2251: checking for $ac_word" >&5
2252 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2253 if test "${ac_cv_prog_AWK+set}" = set; then
2254   echo $ECHO_N "(cached) $ECHO_C" >&6
2255 else
2256   if test -n "$AWK"; then
2257   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2258 else
2259   ac_save_IFS=$IFS; IFS=$ac_path_separator
2260 ac_dummy="$PATH"
2261 for ac_dir in $ac_dummy; do
2262   IFS=$ac_save_IFS
2263   test -z "$ac_dir" && ac_dir=.
2264   $as_executable_p "$ac_dir/$ac_word" || continue
2265 ac_cv_prog_AWK="$ac_prog"
2266 echo "$as_me:2266: found $ac_dir/$ac_word" >&5
2267 break
2268 done
2269
2270 fi
2271 fi
2272 AWK=$ac_cv_prog_AWK
2273 if test -n "$AWK"; then
2274   echo "$as_me:2274: result: $AWK" >&5
2275 echo "${ECHO_T}$AWK" >&6
2276 else
2277   echo "$as_me:2277: result: no" >&5
2278 echo "${ECHO_T}no" >&6
2279 fi
2280
2281   test -n "$AWK" && break
2282 done
2283
2284 # Find a good install program.  We prefer a C program (faster),
2285 # so one script is as good as another.  But avoid the broken or
2286 # incompatible versions:
2287 # SysV /etc/install, /usr/sbin/install
2288 # SunOS /usr/etc/install
2289 # IRIX /sbin/install
2290 # AIX /bin/install
2291 # AmigaOS /C/install, which installs bootblocks on floppy discs
2292 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2293 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2294 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2295 # ./install, which can be erroneously created by make from ./install.sh.
2296 echo "$as_me:2296: checking for a BSD compatible install" >&5
2297 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2298 if test -z "$INSTALL"; then
2299 if test "${ac_cv_path_install+set}" = set; then
2300   echo $ECHO_N "(cached) $ECHO_C" >&6
2301 else
2302     ac_save_IFS=$IFS; IFS=$ac_path_separator
2303   for ac_dir in $PATH; do
2304     IFS=$ac_save_IFS
2305     # Account for people who put trailing slashes in PATH elements.
2306     case $ac_dir/ in
2307     / | ./ | .// | /cC/* \
2308     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2309     | /usr/ucb/* ) ;;
2310     *)
2311       # OSF1 and SCO ODT 3.0 have their own names for install.
2312       # Don't use installbsd from OSF since it installs stuff as root
2313       # by default.
2314       for ac_prog in ginstall scoinst install; do
2315         if $as_executable_p "$ac_dir/$ac_prog"; then
2316           if test $ac_prog = install &&
2317             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2318             # AIX install.  It has an incompatible calling convention.
2319             :
2320           elif test $ac_prog = install &&
2321             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2322             # program-specific install script used by HP pwplus--don't use.
2323             :
2324           else
2325             ac_cv_path_install="$ac_dir/$ac_prog -c"
2326             break 2
2327           fi
2328         fi
2329       done
2330       ;;
2331     esac
2332   done
2333
2334 fi
2335   if test "${ac_cv_path_install+set}" = set; then
2336     INSTALL=$ac_cv_path_install
2337   else
2338     # As a last resort, use the slow shell script.  We don't cache a
2339     # path for INSTALL within a source directory, because that will
2340     # break other packages using the cache if that directory is
2341     # removed, or if the path is relative.
2342     INSTALL=$ac_install_sh
2343   fi
2344 fi
2345 echo "$as_me:2345: result: $INSTALL" >&5
2346 echo "${ECHO_T}$INSTALL" >&6
2347
2348 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2349 # It thinks the first close brace ends the variable substitution.
2350 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2351
2352 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2353
2354 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2355
2356 case $INSTALL in
2357 (/*)
2358         ;;
2359 (*)
2360         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2361         test -z "$cf_dir" && cf_dir=.
2362         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2363         ;;
2364 esac
2365
2366 for ac_prog in lint cppcheck splint
2367 do
2368   # Extract the first word of "$ac_prog", so it can be a program name with args.
2369 set dummy $ac_prog; ac_word=$2
2370 echo "$as_me:2370: checking for $ac_word" >&5
2371 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2372 if test "${ac_cv_prog_LINT+set}" = set; then
2373   echo $ECHO_N "(cached) $ECHO_C" >&6
2374 else
2375   if test -n "$LINT"; then
2376   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2377 else
2378   ac_save_IFS=$IFS; IFS=$ac_path_separator
2379 ac_dummy="$PATH"
2380 for ac_dir in $ac_dummy; do
2381   IFS=$ac_save_IFS
2382   test -z "$ac_dir" && ac_dir=.
2383   $as_executable_p "$ac_dir/$ac_word" || continue
2384 ac_cv_prog_LINT="$ac_prog"
2385 echo "$as_me:2385: found $ac_dir/$ac_word" >&5
2386 break
2387 done
2388
2389 fi
2390 fi
2391 LINT=$ac_cv_prog_LINT
2392 if test -n "$LINT"; then
2393   echo "$as_me:2393: result: $LINT" >&5
2394 echo "${ECHO_T}$LINT" >&6
2395 else
2396   echo "$as_me:2396: result: no" >&5
2397 echo "${ECHO_T}no" >&6
2398 fi
2399
2400   test -n "$LINT" && break
2401 done
2402
2403 echo "$as_me:2403: checking if filesystem supports mixed-case filenames" >&5
2404 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2405 if test "${cf_cv_mixedcase+set}" = set; then
2406   echo $ECHO_N "(cached) $ECHO_C" >&6
2407 else
2408
2409 if test "$cross_compiling" = yes ; then
2410         case $target_alias in
2411         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2412                 cf_cv_mixedcase=no
2413                 ;;
2414         (*)
2415                 cf_cv_mixedcase=yes
2416                 ;;
2417         esac
2418 else
2419         rm -f conftest CONFTEST
2420         echo test >conftest
2421         if test -f CONFTEST ; then
2422                 cf_cv_mixedcase=no
2423         else
2424                 cf_cv_mixedcase=yes
2425         fi
2426         rm -f conftest CONFTEST
2427 fi
2428
2429 fi
2430 echo "$as_me:2430: result: $cf_cv_mixedcase" >&5
2431 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2432 test "$cf_cv_mixedcase" = yes &&
2433 cat >>confdefs.h <<\EOF
2434 #define MIXEDCASE_FILENAMES 1
2435 EOF
2436
2437 for ac_prog in exctags ctags
2438 do
2439   # Extract the first word of "$ac_prog", so it can be a program name with args.
2440 set dummy $ac_prog; ac_word=$2
2441 echo "$as_me:2441: checking for $ac_word" >&5
2442 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2443 if test "${ac_cv_prog_CTAGS+set}" = set; then
2444   echo $ECHO_N "(cached) $ECHO_C" >&6
2445 else
2446   if test -n "$CTAGS"; then
2447   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2448 else
2449   ac_save_IFS=$IFS; IFS=$ac_path_separator
2450 ac_dummy="$PATH"
2451 for ac_dir in $ac_dummy; do
2452   IFS=$ac_save_IFS
2453   test -z "$ac_dir" && ac_dir=.
2454   $as_executable_p "$ac_dir/$ac_word" || continue
2455 ac_cv_prog_CTAGS="$ac_prog"
2456 echo "$as_me:2456: found $ac_dir/$ac_word" >&5
2457 break
2458 done
2459
2460 fi
2461 fi
2462 CTAGS=$ac_cv_prog_CTAGS
2463 if test -n "$CTAGS"; then
2464   echo "$as_me:2464: result: $CTAGS" >&5
2465 echo "${ECHO_T}$CTAGS" >&6
2466 else
2467   echo "$as_me:2467: result: no" >&5
2468 echo "${ECHO_T}no" >&6
2469 fi
2470
2471   test -n "$CTAGS" && break
2472 done
2473
2474 for ac_prog in exetags etags
2475 do
2476   # Extract the first word of "$ac_prog", so it can be a program name with args.
2477 set dummy $ac_prog; ac_word=$2
2478 echo "$as_me:2478: checking for $ac_word" >&5
2479 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2480 if test "${ac_cv_prog_ETAGS+set}" = set; then
2481   echo $ECHO_N "(cached) $ECHO_C" >&6
2482 else
2483   if test -n "$ETAGS"; then
2484   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2485 else
2486   ac_save_IFS=$IFS; IFS=$ac_path_separator
2487 ac_dummy="$PATH"
2488 for ac_dir in $ac_dummy; do
2489   IFS=$ac_save_IFS
2490   test -z "$ac_dir" && ac_dir=.
2491   $as_executable_p "$ac_dir/$ac_word" || continue
2492 ac_cv_prog_ETAGS="$ac_prog"
2493 echo "$as_me:2493: found $ac_dir/$ac_word" >&5
2494 break
2495 done
2496
2497 fi
2498 fi
2499 ETAGS=$ac_cv_prog_ETAGS
2500 if test -n "$ETAGS"; then
2501   echo "$as_me:2501: result: $ETAGS" >&5
2502 echo "${ECHO_T}$ETAGS" >&6
2503 else
2504   echo "$as_me:2504: result: no" >&5
2505 echo "${ECHO_T}no" >&6
2506 fi
2507
2508   test -n "$ETAGS" && break
2509 done
2510
2511 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2512 set dummy ${CTAGS:-ctags}; ac_word=$2
2513 echo "$as_me:2513: checking for $ac_word" >&5
2514 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2515 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2516   echo $ECHO_N "(cached) $ECHO_C" >&6
2517 else
2518   if test -n "$MAKE_LOWER_TAGS"; then
2519   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2520 else
2521   ac_save_IFS=$IFS; IFS=$ac_path_separator
2522 ac_dummy="$PATH"
2523 for ac_dir in $ac_dummy; do
2524   IFS=$ac_save_IFS
2525   test -z "$ac_dir" && ac_dir=.
2526   $as_executable_p "$ac_dir/$ac_word" || continue
2527 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2528 echo "$as_me:2528: found $ac_dir/$ac_word" >&5
2529 break
2530 done
2531
2532   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2533 fi
2534 fi
2535 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2536 if test -n "$MAKE_LOWER_TAGS"; then
2537   echo "$as_me:2537: result: $MAKE_LOWER_TAGS" >&5
2538 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2539 else
2540   echo "$as_me:2540: result: no" >&5
2541 echo "${ECHO_T}no" >&6
2542 fi
2543
2544 if test "$cf_cv_mixedcase" = yes ; then
2545         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2546 set dummy ${ETAGS:-etags}; ac_word=$2
2547 echo "$as_me:2547: checking for $ac_word" >&5
2548 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2549 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2550   echo $ECHO_N "(cached) $ECHO_C" >&6
2551 else
2552   if test -n "$MAKE_UPPER_TAGS"; then
2553   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2554 else
2555   ac_save_IFS=$IFS; IFS=$ac_path_separator
2556 ac_dummy="$PATH"
2557 for ac_dir in $ac_dummy; do
2558   IFS=$ac_save_IFS
2559   test -z "$ac_dir" && ac_dir=.
2560   $as_executable_p "$ac_dir/$ac_word" || continue
2561 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2562 echo "$as_me:2562: found $ac_dir/$ac_word" >&5
2563 break
2564 done
2565
2566   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2567 fi
2568 fi
2569 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2570 if test -n "$MAKE_UPPER_TAGS"; then
2571   echo "$as_me:2571: result: $MAKE_UPPER_TAGS" >&5
2572 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2573 else
2574   echo "$as_me:2574: result: no" >&5
2575 echo "${ECHO_T}no" >&6
2576 fi
2577
2578 else
2579         MAKE_UPPER_TAGS=no
2580 fi
2581
2582 if test "$MAKE_UPPER_TAGS" = yes ; then
2583         MAKE_UPPER_TAGS=
2584 else
2585         MAKE_UPPER_TAGS="#"
2586 fi
2587
2588 if test "$MAKE_LOWER_TAGS" = yes ; then
2589         MAKE_LOWER_TAGS=
2590 else
2591         MAKE_LOWER_TAGS="#"
2592 fi
2593
2594 echo "$as_me:2594: checking if -lm needed for math functions" >&5
2595 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2596 if test "${cf_cv_need_libm+set}" = set; then
2597   echo $ECHO_N "(cached) $ECHO_C" >&6
2598 else
2599
2600         cat >conftest.$ac_ext <<_ACEOF
2601 #line 2601 "configure"
2602 #include "confdefs.h"
2603
2604         #include <stdio.h>
2605         #include <math.h>
2606
2607 int
2608 main ()
2609 {
2610 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2611   ;
2612   return 0;
2613 }
2614 _ACEOF
2615 rm -f conftest.$ac_objext conftest$ac_exeext
2616 if { (eval echo "$as_me:2616: \"$ac_link\"") >&5
2617   (eval $ac_link) 2>&5
2618   ac_status=$?
2619   echo "$as_me:2619: \$? = $ac_status" >&5
2620   (exit $ac_status); } &&
2621          { ac_try='test -s conftest$ac_exeext'
2622   { (eval echo "$as_me:2622: \"$ac_try\"") >&5
2623   (eval $ac_try) 2>&5
2624   ac_status=$?
2625   echo "$as_me:2625: \$? = $ac_status" >&5
2626   (exit $ac_status); }; }; then
2627   cf_cv_need_libm=no
2628 else
2629   echo "$as_me: failed program was:" >&5
2630 cat conftest.$ac_ext >&5
2631 cf_cv_need_libm=yes
2632 fi
2633 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2634 fi
2635 echo "$as_me:2635: result: $cf_cv_need_libm" >&5
2636 echo "${ECHO_T}$cf_cv_need_libm" >&6
2637 if test "$cf_cv_need_libm" = yes
2638 then
2639 MATH_LIB=-lm
2640 fi
2641
2642 top_builddir=`pwd`
2643
2644 CC_G_OPT="-g"
2645 CC_SHARED_OPTS=unknown
2646 CPPFLAGS="$CPPFLAGS"
2647 DFT_DEP_SUFFIX=""
2648 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2649 DFT_UPR_MODEL="NORMAL"
2650 LD="ld"
2651 LDFLAGS_SHARED=""
2652 LDFLAGS_STATIC=""
2653 LD_MODEL=""
2654 LD_SHARED_OPTS=""
2655 LIBTOOL=""
2656 LIBTOOL_OPTS=""
2657 LIB_CLEAN=""
2658 LIB_COMPILE=""
2659 LIB_LINK='${CC}'
2660 LINK_TESTS=""
2661 LOCAL_LDFLAGS=""
2662 PACKAGE="ncurses-examples"
2663 PTHREAD="-lm"
2664 TEST_ARGS=""
2665 TEST_DEPS=""
2666 TEST_LIBS=""
2667 TINFO_LDFLAGS=''
2668 TINFO_LIBS='$(LIBS_CURSES)'
2669 cf_cv_abi_version=""
2670 cf_cv_rel_version=""
2671 includesubdir=""
2672
2673 cf_cv_screen=curses
2674 cf_cv_libtype=
2675
2676 if test "$GCC" = yes
2677 then
2678 cat > conftest.i <<EOF
2679 #ifndef GCC_PRINTF
2680 #define GCC_PRINTF 0
2681 #endif
2682 #ifndef GCC_SCANF
2683 #define GCC_SCANF 0
2684 #endif
2685 #ifndef GCC_NORETURN
2686 #define GCC_NORETURN /* nothing */
2687 #endif
2688 #ifndef GCC_UNUSED
2689 #define GCC_UNUSED /* nothing */
2690 #endif
2691 EOF
2692 if test "$GCC" = yes
2693 then
2694         { echo "$as_me:2694: checking for $CC __attribute__ directives..." >&5
2695 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2696 cat > conftest.$ac_ext <<EOF
2697 #line 2697 "${as_me:-configure}"
2698 #include "confdefs.h"
2699 #include "conftest.h"
2700 #include "conftest.i"
2701 #if     GCC_PRINTF
2702 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2703 #else
2704 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2705 #endif
2706 #if     GCC_SCANF
2707 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2708 #else
2709 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2710 #endif
2711 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2712 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2713 extern void foo(void) GCC_NORETURN;
2714 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2715 EOF
2716         cf_printf_attribute=no
2717         cf_scanf_attribute=no
2718         for cf_attribute in scanf printf unused noreturn
2719         do
2720
2721 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2722
2723                 cf_directive="__attribute__(($cf_attribute))"
2724                 echo "checking for $CC $cf_directive" 1>&5
2725
2726                 case $cf_attribute in
2727                 (printf)
2728                         cf_printf_attribute=yes
2729                         cat >conftest.h <<EOF
2730 #define GCC_$cf_ATTRIBUTE 1
2731 EOF
2732                         ;;
2733                 (scanf)
2734                         cf_scanf_attribute=yes
2735                         cat >conftest.h <<EOF
2736 #define GCC_$cf_ATTRIBUTE 1
2737 EOF
2738                         ;;
2739                 (*)
2740                         cat >conftest.h <<EOF
2741 #define GCC_$cf_ATTRIBUTE $cf_directive
2742 EOF
2743                         ;;
2744                 esac
2745
2746                 if { (eval echo "$as_me:2746: \"$ac_compile\"") >&5
2747   (eval $ac_compile) 2>&5
2748   ac_status=$?
2749   echo "$as_me:2749: \$? = $ac_status" >&5
2750   (exit $ac_status); }; then
2751                         test -n "$verbose" && echo "$as_me:2751: result: ... $cf_attribute" >&5
2752 echo "${ECHO_T}... $cf_attribute" >&6
2753                         cat conftest.h >>confdefs.h
2754                         case $cf_attribute in
2755                         (noreturn)
2756
2757 cat >>confdefs.h <<EOF
2758 #define GCC_NORETURN $cf_directive
2759 EOF
2760
2761                                 ;;
2762                         (printf)
2763                                 cf_value='/* nothing */'
2764                                 if test "$cf_printf_attribute" != no ; then
2765                                         cf_value='__attribute__((format(printf,fmt,var)))'
2766
2767 cat >>confdefs.h <<\EOF
2768 #define GCC_PRINTF 1
2769 EOF
2770
2771                                 fi
2772
2773 cat >>confdefs.h <<EOF
2774 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2775 EOF
2776
2777                                 ;;
2778                         (scanf)
2779                                 cf_value='/* nothing */'
2780                                 if test "$cf_scanf_attribute" != no ; then
2781                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2782
2783 cat >>confdefs.h <<\EOF
2784 #define GCC_SCANF 1
2785 EOF
2786
2787                                 fi
2788
2789 cat >>confdefs.h <<EOF
2790 #define GCC_SCANFLIKE(fmt,var) $cf_value
2791 EOF
2792
2793                                 ;;
2794                         (unused)
2795
2796 cat >>confdefs.h <<EOF
2797 #define GCC_UNUSED $cf_directive
2798 EOF
2799
2800                                 ;;
2801                         esac
2802                 fi
2803         done
2804 else
2805         fgrep define conftest.i >>confdefs.h
2806 fi
2807 rm -rf conftest*
2808 fi
2809
2810 cf_XOPEN_SOURCE=500
2811 cf_POSIX_C_SOURCE=199506L
2812 cf_xopen_source=
2813
2814 case $host_os in
2815 (aix[4-7]*)
2816         cf_xopen_source="-D_ALL_SOURCE"
2817         ;;
2818 (cygwin|msys)
2819         cf_XOPEN_SOURCE=600
2820         ;;
2821 (darwin[0-8].*)
2822         cf_xopen_source="-D_APPLE_C_SOURCE"
2823         ;;
2824 (darwin*)
2825         cf_xopen_source="-D_DARWIN_C_SOURCE"
2826         cf_XOPEN_SOURCE=
2827         ;;
2828 (freebsd*|dragonfly*)
2829         # 5.x headers associate
2830         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2831         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2832         cf_POSIX_C_SOURCE=200112L
2833         cf_XOPEN_SOURCE=600
2834         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2835         ;;
2836 (hpux11*)
2837         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2838         ;;
2839 (hpux*)
2840         cf_xopen_source="-D_HPUX_SOURCE"
2841         ;;
2842 (irix[56].*)
2843         cf_xopen_source="-D_SGI_SOURCE"
2844         cf_XOPEN_SOURCE=
2845         ;;
2846 (linux*|gnu*|mint*|k*bsd*-gnu)
2847
2848 echo "$as_me:2848: checking if we must define _GNU_SOURCE" >&5
2849 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2850 if test "${cf_cv_gnu_source+set}" = set; then
2851   echo $ECHO_N "(cached) $ECHO_C" >&6
2852 else
2853
2854 cat >conftest.$ac_ext <<_ACEOF
2855 #line 2855 "configure"
2856 #include "confdefs.h"
2857 #include <sys/types.h>
2858 int
2859 main ()
2860 {
2861
2862 #ifndef _XOPEN_SOURCE
2863 make an error
2864 #endif
2865   ;
2866   return 0;
2867 }
2868 _ACEOF
2869 rm -f conftest.$ac_objext
2870 if { (eval echo "$as_me:2870: \"$ac_compile\"") >&5
2871   (eval $ac_compile) 2>&5
2872   ac_status=$?
2873   echo "$as_me:2873: \$? = $ac_status" >&5
2874   (exit $ac_status); } &&
2875          { ac_try='test -s conftest.$ac_objext'
2876   { (eval echo "$as_me:2876: \"$ac_try\"") >&5
2877   (eval $ac_try) 2>&5
2878   ac_status=$?
2879   echo "$as_me:2879: \$? = $ac_status" >&5
2880   (exit $ac_status); }; }; then
2881   cf_cv_gnu_source=no
2882 else
2883   echo "$as_me: failed program was:" >&5
2884 cat conftest.$ac_ext >&5
2885 cf_save="$CPPFLAGS"
2886          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2887          cat >conftest.$ac_ext <<_ACEOF
2888 #line 2888 "configure"
2889 #include "confdefs.h"
2890 #include <sys/types.h>
2891 int
2892 main ()
2893 {
2894
2895 #ifdef _XOPEN_SOURCE
2896 make an error
2897 #endif
2898   ;
2899   return 0;
2900 }
2901 _ACEOF
2902 rm -f conftest.$ac_objext
2903 if { (eval echo "$as_me:2903: \"$ac_compile\"") >&5
2904   (eval $ac_compile) 2>&5
2905   ac_status=$?
2906   echo "$as_me:2906: \$? = $ac_status" >&5
2907   (exit $ac_status); } &&
2908          { ac_try='test -s conftest.$ac_objext'
2909   { (eval echo "$as_me:2909: \"$ac_try\"") >&5
2910   (eval $ac_try) 2>&5
2911   ac_status=$?
2912   echo "$as_me:2912: \$? = $ac_status" >&5
2913   (exit $ac_status); }; }; then
2914   cf_cv_gnu_source=no
2915 else
2916   echo "$as_me: failed program was:" >&5
2917 cat conftest.$ac_ext >&5
2918 cf_cv_gnu_source=yes
2919 fi
2920 rm -f conftest.$ac_objext conftest.$ac_ext
2921         CPPFLAGS="$cf_save"
2922
2923 fi
2924 rm -f conftest.$ac_objext conftest.$ac_ext
2925
2926 fi
2927 echo "$as_me:2927: result: $cf_cv_gnu_source" >&5
2928 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2929 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2930
2931         ;;
2932 (minix*)
2933         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2934         ;;
2935 (mirbsd*)
2936         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2937         cf_XOPEN_SOURCE=
2938
2939 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2940
2941 cf_save_CFLAGS="$CFLAGS"
2942 cf_save_CPPFLAGS="$CPPFLAGS"
2943
2944 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2945         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2946                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2947
2948 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2949         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2950                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2951
2952 echo "$as_me:2952: checking if we should define _POSIX_C_SOURCE" >&5
2953 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2954 if test "${cf_cv_posix_c_source+set}" = set; then
2955   echo $ECHO_N "(cached) $ECHO_C" >&6
2956 else
2957
2958 echo "${as_me:-configure}:2958: testing if the symbol is already defined go no further ..." 1>&5
2959
2960         cat >conftest.$ac_ext <<_ACEOF
2961 #line 2961 "configure"
2962 #include "confdefs.h"
2963 #include <sys/types.h>
2964 int
2965 main ()
2966 {
2967
2968 #ifndef _POSIX_C_SOURCE
2969 make an error
2970 #endif
2971   ;
2972   return 0;
2973 }
2974 _ACEOF
2975 rm -f conftest.$ac_objext
2976 if { (eval echo "$as_me:2976: \"$ac_compile\"") >&5
2977   (eval $ac_compile) 2>&5
2978   ac_status=$?
2979   echo "$as_me:2979: \$? = $ac_status" >&5
2980   (exit $ac_status); } &&
2981          { ac_try='test -s conftest.$ac_objext'
2982   { (eval echo "$as_me:2982: \"$ac_try\"") >&5
2983   (eval $ac_try) 2>&5
2984   ac_status=$?
2985   echo "$as_me:2985: \$? = $ac_status" >&5
2986   (exit $ac_status); }; }; then
2987   cf_cv_posix_c_source=no
2988 else
2989   echo "$as_me: failed program was:" >&5
2990 cat conftest.$ac_ext >&5
2991 cf_want_posix_source=no
2992          case .$cf_POSIX_C_SOURCE in
2993          (.[12]??*)
2994                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2995                 ;;
2996          (.2)
2997                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2998                 cf_want_posix_source=yes
2999                 ;;
3000          (.*)
3001                 cf_want_posix_source=yes
3002                 ;;
3003          esac
3004          if test "$cf_want_posix_source" = yes ; then
3005                 cat >conftest.$ac_ext <<_ACEOF
3006 #line 3006 "configure"
3007 #include "confdefs.h"
3008 #include <sys/types.h>
3009 int
3010 main ()
3011 {
3012
3013 #ifdef _POSIX_SOURCE
3014 make an error
3015 #endif
3016   ;
3017   return 0;
3018 }
3019 _ACEOF
3020 rm -f conftest.$ac_objext
3021 if { (eval echo "$as_me:3021: \"$ac_compile\"") >&5
3022   (eval $ac_compile) 2>&5
3023   ac_status=$?
3024   echo "$as_me:3024: \$? = $ac_status" >&5
3025   (exit $ac_status); } &&
3026          { ac_try='test -s conftest.$ac_objext'
3027   { (eval echo "$as_me:3027: \"$ac_try\"") >&5
3028   (eval $ac_try) 2>&5
3029   ac_status=$?
3030   echo "$as_me:3030: \$? = $ac_status" >&5
3031   (exit $ac_status); }; }; then
3032   :
3033 else
3034   echo "$as_me: failed program was:" >&5
3035 cat conftest.$ac_ext >&5
3036 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3037 fi
3038 rm -f conftest.$ac_objext conftest.$ac_ext
3039          fi
3040
3041 echo "${as_me:-configure}:3041: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3042
3043          CFLAGS="$cf_trim_CFLAGS"
3044          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3045
3046 echo "${as_me:-configure}:3046: testing if the second compile does not leave our definition intact error ..." 1>&5
3047
3048          cat >conftest.$ac_ext <<_ACEOF
3049 #line 3049 "configure"
3050 #include "confdefs.h"
3051 #include <sys/types.h>
3052 int
3053 main ()
3054 {
3055
3056 #ifndef _POSIX_C_SOURCE
3057 make an error
3058 #endif
3059   ;
3060   return 0;
3061 }
3062 _ACEOF
3063 rm -f conftest.$ac_objext
3064 if { (eval echo "$as_me:3064: \"$ac_compile\"") >&5
3065   (eval $ac_compile) 2>&5
3066   ac_status=$?
3067   echo "$as_me:3067: \$? = $ac_status" >&5
3068   (exit $ac_status); } &&
3069          { ac_try='test -s conftest.$ac_objext'
3070   { (eval echo "$as_me:3070: \"$ac_try\"") >&5
3071   (eval $ac_try) 2>&5
3072   ac_status=$?
3073   echo "$as_me:3073: \$? = $ac_status" >&5
3074   (exit $ac_status); }; }; then
3075   :
3076 else
3077   echo "$as_me: failed program was:" >&5
3078 cat conftest.$ac_ext >&5
3079 cf_cv_posix_c_source=no
3080 fi
3081 rm -f conftest.$ac_objext conftest.$ac_ext
3082          CFLAGS="$cf_save_CFLAGS"
3083          CPPFLAGS="$cf_save_CPPFLAGS"
3084
3085 fi
3086 rm -f conftest.$ac_objext conftest.$ac_ext
3087
3088 fi
3089 echo "$as_me:3089: result: $cf_cv_posix_c_source" >&5
3090 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3091
3092 if test "$cf_cv_posix_c_source" != no ; then
3093         CFLAGS="$cf_trim_CFLAGS"
3094         CPPFLAGS="$cf_trim_CPPFLAGS"
3095
3096 cf_fix_cppflags=no
3097 cf_new_cflags=
3098 cf_new_cppflags=
3099 cf_new_extra_cppflags=
3100
3101 for cf_add_cflags in $cf_cv_posix_c_source
3102 do
3103 case $cf_fix_cppflags in
3104 (no)
3105         case $cf_add_cflags in
3106         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3107                 case $cf_add_cflags in
3108                 (-D*)
3109                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3110
3111                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3112                                 && test -z "${cf_tst_cflags}" \
3113                                 && cf_fix_cppflags=yes
3114
3115                         if test $cf_fix_cppflags = yes ; then
3116                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3117                                 continue
3118                         elif test "${cf_tst_cflags}" = "\"'" ; then
3119                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3120                                 continue
3121                         fi
3122                         ;;
3123                 esac
3124                 case "$CPPFLAGS" in
3125                 (*$cf_add_cflags)
3126                         ;;
3127                 (*)
3128                         case $cf_add_cflags in
3129                         (-D*)
3130                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3131
3132 CPPFLAGS=`echo "$CPPFLAGS" | \
3133         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3134                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3135
3136                                 ;;
3137                         esac
3138                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3139                         ;;
3140                 esac
3141                 ;;
3142         (*)
3143                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3144                 ;;
3145         esac
3146         ;;
3147 (yes)
3148         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3149
3150         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3151
3152         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3153                 && test -z "${cf_tst_cflags}" \
3154                 && cf_fix_cppflags=no
3155         ;;
3156 esac
3157 done
3158
3159 if test -n "$cf_new_cflags" ; then
3160
3161         CFLAGS="$CFLAGS $cf_new_cflags"
3162 fi
3163
3164 if test -n "$cf_new_cppflags" ; then
3165
3166         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3167 fi
3168
3169 if test -n "$cf_new_extra_cppflags" ; then
3170
3171         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3172 fi
3173
3174 fi
3175
3176         ;;
3177 (netbsd*)
3178         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3179         ;;
3180 (openbsd[4-9]*)
3181         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3182         cf_xopen_source="-D_BSD_SOURCE"
3183         cf_XOPEN_SOURCE=600
3184         ;;
3185 (openbsd*)
3186         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3187         ;;
3188 (os2*)
3189         cf_XOPEN_SOURCE=
3190         ;;
3191 (osf[45]*)
3192         cf_xopen_source="-D_OSF_SOURCE"
3193         ;;
3194 (nto-qnx*)
3195         cf_xopen_source="-D_QNX_SOURCE"
3196         ;;
3197 (sco*)
3198         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3199         ;;
3200 (solaris2.*)
3201         cf_xopen_source="-D__EXTENSIONS__"
3202         cf_cv_xopen_source=broken
3203         ;;
3204 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3205         cf_XOPEN_SOURCE=
3206         cf_POSIX_C_SOURCE=
3207         ;;
3208 (*)
3209
3210 echo "$as_me:3210: checking if we should define _XOPEN_SOURCE" >&5
3211 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3212 if test "${cf_cv_xopen_source+set}" = set; then
3213   echo $ECHO_N "(cached) $ECHO_C" >&6
3214 else
3215
3216         cat >conftest.$ac_ext <<_ACEOF
3217 #line 3217 "configure"
3218 #include "confdefs.h"
3219
3220 #include <stdlib.h>
3221 #include <string.h>
3222 #include <sys/types.h>
3223
3224 int
3225 main ()
3226 {
3227
3228 #ifndef _XOPEN_SOURCE
3229 make an error
3230 #endif
3231   ;
3232   return 0;
3233 }
3234 _ACEOF
3235 rm -f conftest.$ac_objext
3236 if { (eval echo "$as_me:3236: \"$ac_compile\"") >&5
3237   (eval $ac_compile) 2>&5
3238   ac_status=$?
3239   echo "$as_me:3239: \$? = $ac_status" >&5
3240   (exit $ac_status); } &&
3241          { ac_try='test -s conftest.$ac_objext'
3242   { (eval echo "$as_me:3242: \"$ac_try\"") >&5
3243   (eval $ac_try) 2>&5
3244   ac_status=$?
3245   echo "$as_me:3245: \$? = $ac_status" >&5
3246   (exit $ac_status); }; }; then
3247   cf_cv_xopen_source=no
3248 else
3249   echo "$as_me: failed program was:" >&5
3250 cat conftest.$ac_ext >&5
3251 cf_save="$CPPFLAGS"
3252          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3253          cat >conftest.$ac_ext <<_ACEOF
3254 #line 3254 "configure"
3255 #include "confdefs.h"
3256
3257 #include <stdlib.h>
3258 #include <string.h>
3259 #include <sys/types.h>
3260
3261 int
3262 main ()
3263 {
3264
3265 #ifdef _XOPEN_SOURCE
3266 make an error
3267 #endif
3268   ;
3269   return 0;
3270 }
3271 _ACEOF
3272 rm -f conftest.$ac_objext
3273 if { (eval echo "$as_me:3273: \"$ac_compile\"") >&5
3274   (eval $ac_compile) 2>&5
3275   ac_status=$?
3276   echo "$as_me:3276: \$? = $ac_status" >&5
3277   (exit $ac_status); } &&
3278          { ac_try='test -s conftest.$ac_objext'
3279   { (eval echo "$as_me:3279: \"$ac_try\"") >&5
3280   (eval $ac_try) 2>&5
3281   ac_status=$?
3282   echo "$as_me:3282: \$? = $ac_status" >&5
3283   (exit $ac_status); }; }; then
3284   cf_cv_xopen_source=no
3285 else
3286   echo "$as_me: failed program was:" >&5
3287 cat conftest.$ac_ext >&5
3288 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3289 fi
3290 rm -f conftest.$ac_objext conftest.$ac_ext
3291         CPPFLAGS="$cf_save"
3292
3293 fi
3294 rm -f conftest.$ac_objext conftest.$ac_ext
3295
3296 fi
3297 echo "$as_me:3297: result: $cf_cv_xopen_source" >&5
3298 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3299
3300 if test "$cf_cv_xopen_source" != no ; then
3301
3302 CFLAGS=`echo "$CFLAGS" | \
3303         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3304                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3305
3306 CPPFLAGS=`echo "$CPPFLAGS" | \
3307         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3308                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3309
3310         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3311
3312 cf_fix_cppflags=no
3313 cf_new_cflags=
3314 cf_new_cppflags=
3315 cf_new_extra_cppflags=
3316
3317 for cf_add_cflags in $cf_temp_xopen_source
3318 do
3319 case $cf_fix_cppflags in
3320 (no)
3321         case $cf_add_cflags in
3322         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3323                 case $cf_add_cflags in
3324                 (-D*)
3325                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3326
3327                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3328                                 && test -z "${cf_tst_cflags}" \
3329                                 && cf_fix_cppflags=yes
3330
3331                         if test $cf_fix_cppflags = yes ; then
3332                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3333                                 continue
3334                         elif test "${cf_tst_cflags}" = "\"'" ; then
3335                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3336                                 continue
3337                         fi
3338                         ;;
3339                 esac
3340                 case "$CPPFLAGS" in
3341                 (*$cf_add_cflags)
3342                         ;;
3343                 (*)
3344                         case $cf_add_cflags in
3345                         (-D*)
3346                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3347
3348 CPPFLAGS=`echo "$CPPFLAGS" | \
3349         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3350                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3351
3352                                 ;;
3353                         esac
3354                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3355                         ;;
3356                 esac
3357                 ;;
3358         (*)
3359                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3360                 ;;
3361         esac
3362         ;;
3363 (yes)
3364         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3365
3366         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3367
3368         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3369                 && test -z "${cf_tst_cflags}" \
3370                 && cf_fix_cppflags=no
3371         ;;
3372 esac
3373 done
3374
3375 if test -n "$cf_new_cflags" ; then
3376
3377         CFLAGS="$CFLAGS $cf_new_cflags"
3378 fi
3379
3380 if test -n "$cf_new_cppflags" ; then
3381
3382         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3383 fi
3384
3385 if test -n "$cf_new_extra_cppflags" ; then
3386
3387         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3388 fi
3389
3390 fi
3391
3392 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3393
3394 cf_save_CFLAGS="$CFLAGS"
3395 cf_save_CPPFLAGS="$CPPFLAGS"
3396
3397 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3398         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3399                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3400
3401 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3402         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3403                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3404
3405 echo "$as_me:3405: checking if we should define _POSIX_C_SOURCE" >&5
3406 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3407 if test "${cf_cv_posix_c_source+set}" = set; then
3408   echo $ECHO_N "(cached) $ECHO_C" >&6
3409 else
3410
3411 echo "${as_me:-configure}:3411: testing if the symbol is already defined go no further ..." 1>&5
3412
3413         cat >conftest.$ac_ext <<_ACEOF
3414 #line 3414 "configure"
3415 #include "confdefs.h"
3416 #include <sys/types.h>
3417 int
3418 main ()
3419 {
3420
3421 #ifndef _POSIX_C_SOURCE
3422 make an error
3423 #endif
3424   ;
3425   return 0;
3426 }
3427 _ACEOF
3428 rm -f conftest.$ac_objext
3429 if { (eval echo "$as_me:3429: \"$ac_compile\"") >&5
3430   (eval $ac_compile) 2>&5
3431   ac_status=$?
3432   echo "$as_me:3432: \$? = $ac_status" >&5
3433   (exit $ac_status); } &&
3434          { ac_try='test -s conftest.$ac_objext'
3435   { (eval echo "$as_me:3435: \"$ac_try\"") >&5
3436   (eval $ac_try) 2>&5
3437   ac_status=$?
3438   echo "$as_me:3438: \$? = $ac_status" >&5
3439   (exit $ac_status); }; }; then
3440   cf_cv_posix_c_source=no
3441 else
3442   echo "$as_me: failed program was:" >&5
3443 cat conftest.$ac_ext >&5
3444 cf_want_posix_source=no
3445          case .$cf_POSIX_C_SOURCE in
3446          (.[12]??*)
3447                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3448                 ;;
3449          (.2)
3450                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3451                 cf_want_posix_source=yes
3452                 ;;
3453          (.*)
3454                 cf_want_posix_source=yes
3455                 ;;
3456          esac
3457          if test "$cf_want_posix_source" = yes ; then
3458                 cat >conftest.$ac_ext <<_ACEOF
3459 #line 3459 "configure"
3460 #include "confdefs.h"
3461 #include <sys/types.h>
3462 int
3463 main ()
3464 {
3465
3466 #ifdef _POSIX_SOURCE
3467 make an error
3468 #endif
3469   ;
3470   return 0;
3471 }
3472 _ACEOF
3473 rm -f conftest.$ac_objext
3474 if { (eval echo "$as_me:3474: \"$ac_compile\"") >&5
3475   (eval $ac_compile) 2>&5
3476   ac_status=$?
3477   echo "$as_me:3477: \$? = $ac_status" >&5
3478   (exit $ac_status); } &&
3479          { ac_try='test -s conftest.$ac_objext'
3480   { (eval echo "$as_me:3480: \"$ac_try\"") >&5
3481   (eval $ac_try) 2>&5
3482   ac_status=$?
3483   echo "$as_me:3483: \$? = $ac_status" >&5
3484   (exit $ac_status); }; }; then
3485   :
3486 else
3487   echo "$as_me: failed program was:" >&5
3488 cat conftest.$ac_ext >&5
3489 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3490 fi
3491 rm -f conftest.$ac_objext conftest.$ac_ext
3492          fi
3493
3494 echo "${as_me:-configure}:3494: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3495
3496          CFLAGS="$cf_trim_CFLAGS"
3497          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3498
3499 echo "${as_me:-configure}:3499: testing if the second compile does not leave our definition intact error ..." 1>&5
3500
3501          cat >conftest.$ac_ext <<_ACEOF
3502 #line 3502 "configure"
3503 #include "confdefs.h"
3504 #include <sys/types.h>
3505 int
3506 main ()
3507 {
3508
3509 #ifndef _POSIX_C_SOURCE
3510 make an error
3511 #endif
3512   ;
3513   return 0;
3514 }
3515 _ACEOF
3516 rm -f conftest.$ac_objext
3517 if { (eval echo "$as_me:3517: \"$ac_compile\"") >&5
3518   (eval $ac_compile) 2>&5
3519   ac_status=$?
3520   echo "$as_me:3520: \$? = $ac_status" >&5
3521   (exit $ac_status); } &&
3522          { ac_try='test -s conftest.$ac_objext'
3523   { (eval echo "$as_me:3523: \"$ac_try\"") >&5
3524   (eval $ac_try) 2>&5
3525   ac_status=$?
3526   echo "$as_me:3526: \$? = $ac_status" >&5
3527   (exit $ac_status); }; }; then
3528   :
3529 else
3530   echo "$as_me: failed program was:" >&5
3531 cat conftest.$ac_ext >&5
3532 cf_cv_posix_c_source=no
3533 fi
3534 rm -f conftest.$ac_objext conftest.$ac_ext
3535          CFLAGS="$cf_save_CFLAGS"
3536          CPPFLAGS="$cf_save_CPPFLAGS"
3537
3538 fi
3539 rm -f conftest.$ac_objext conftest.$ac_ext
3540
3541 fi
3542 echo "$as_me:3542: result: $cf_cv_posix_c_source" >&5
3543 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3544
3545 if test "$cf_cv_posix_c_source" != no ; then
3546         CFLAGS="$cf_trim_CFLAGS"
3547         CPPFLAGS="$cf_trim_CPPFLAGS"
3548
3549 cf_fix_cppflags=no
3550 cf_new_cflags=
3551 cf_new_cppflags=
3552 cf_new_extra_cppflags=
3553
3554 for cf_add_cflags in $cf_cv_posix_c_source
3555 do
3556 case $cf_fix_cppflags in
3557 (no)
3558         case $cf_add_cflags in
3559         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3560                 case $cf_add_cflags in
3561                 (-D*)
3562                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3563
3564                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3565                                 && test -z "${cf_tst_cflags}" \
3566                                 && cf_fix_cppflags=yes
3567
3568                         if test $cf_fix_cppflags = yes ; then
3569                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3570                                 continue
3571                         elif test "${cf_tst_cflags}" = "\"'" ; then
3572                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3573                                 continue
3574                         fi
3575                         ;;
3576                 esac
3577                 case "$CPPFLAGS" in
3578                 (*$cf_add_cflags)
3579                         ;;
3580                 (*)
3581                         case $cf_add_cflags in
3582                         (-D*)
3583                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3584
3585 CPPFLAGS=`echo "$CPPFLAGS" | \
3586         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3587                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3588
3589                                 ;;
3590                         esac
3591                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3592                         ;;
3593                 esac
3594                 ;;
3595         (*)
3596                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3597                 ;;
3598         esac
3599         ;;
3600 (yes)
3601         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3602
3603         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3604
3605         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3606                 && test -z "${cf_tst_cflags}" \
3607                 && cf_fix_cppflags=no
3608         ;;
3609 esac
3610 done
3611
3612 if test -n "$cf_new_cflags" ; then
3613
3614         CFLAGS="$CFLAGS $cf_new_cflags"
3615 fi
3616
3617 if test -n "$cf_new_cppflags" ; then
3618
3619         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3620 fi
3621
3622 if test -n "$cf_new_extra_cppflags" ; then
3623
3624         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3625 fi
3626
3627 fi
3628
3629         ;;
3630 esac
3631
3632 if test -n "$cf_xopen_source" ; then
3633
3634 cf_fix_cppflags=no
3635 cf_new_cflags=
3636 cf_new_cppflags=
3637 cf_new_extra_cppflags=
3638
3639 for cf_add_cflags in $cf_xopen_source
3640 do
3641 case $cf_fix_cppflags in
3642 (no)
3643         case $cf_add_cflags in
3644         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3645                 case $cf_add_cflags in
3646                 (-D*)
3647                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3648
3649                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3650                                 && test -z "${cf_tst_cflags}" \
3651                                 && cf_fix_cppflags=yes
3652
3653                         if test $cf_fix_cppflags = yes ; then
3654                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3655                                 continue
3656                         elif test "${cf_tst_cflags}" = "\"'" ; then
3657                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3658                                 continue
3659                         fi
3660                         ;;
3661                 esac
3662                 case "$CPPFLAGS" in
3663                 (*$cf_add_cflags)
3664                         ;;
3665                 (*)
3666                         case $cf_add_cflags in
3667                         (-D*)
3668                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3669
3670 CPPFLAGS=`echo "$CPPFLAGS" | \
3671         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3672                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3673
3674                                 ;;
3675                         esac
3676                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3677                         ;;
3678                 esac
3679                 ;;
3680         (*)
3681                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3682                 ;;
3683         esac
3684         ;;
3685 (yes)
3686         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3687
3688         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3689
3690         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3691                 && test -z "${cf_tst_cflags}" \
3692                 && cf_fix_cppflags=no
3693         ;;
3694 esac
3695 done
3696
3697 if test -n "$cf_new_cflags" ; then
3698         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3699
3700 echo "${as_me:-configure}:3700: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3701
3702         CFLAGS="$CFLAGS $cf_new_cflags"
3703 fi
3704
3705 if test -n "$cf_new_cppflags" ; then
3706         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3707
3708 echo "${as_me:-configure}:3708: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3709
3710         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3711 fi
3712
3713 if test -n "$cf_new_extra_cppflags" ; then
3714         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3715
3716 echo "${as_me:-configure}:3716: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3717
3718         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3719 fi
3720
3721 fi
3722
3723 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3724         echo "$as_me:3724: checking if _XOPEN_SOURCE really is set" >&5
3725 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3726         cat >conftest.$ac_ext <<_ACEOF
3727 #line 3727 "configure"
3728 #include "confdefs.h"
3729 #include <stdlib.h>
3730 int
3731 main ()
3732 {
3733
3734 #ifndef _XOPEN_SOURCE
3735 make an error
3736 #endif
3737   ;
3738   return 0;
3739 }
3740 _ACEOF
3741 rm -f conftest.$ac_objext
3742 if { (eval echo "$as_me:3742: \"$ac_compile\"") >&5
3743   (eval $ac_compile) 2>&5
3744   ac_status=$?
3745   echo "$as_me:3745: \$? = $ac_status" >&5
3746   (exit $ac_status); } &&
3747          { ac_try='test -s conftest.$ac_objext'
3748   { (eval echo "$as_me:3748: \"$ac_try\"") >&5
3749   (eval $ac_try) 2>&5
3750   ac_status=$?
3751   echo "$as_me:3751: \$? = $ac_status" >&5
3752   (exit $ac_status); }; }; then
3753   cf_XOPEN_SOURCE_set=yes
3754 else
3755   echo "$as_me: failed program was:" >&5
3756 cat conftest.$ac_ext >&5
3757 cf_XOPEN_SOURCE_set=no
3758 fi
3759 rm -f conftest.$ac_objext conftest.$ac_ext
3760         echo "$as_me:3760: result: $cf_XOPEN_SOURCE_set" >&5
3761 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3762         if test $cf_XOPEN_SOURCE_set = yes
3763         then
3764                 cat >conftest.$ac_ext <<_ACEOF
3765 #line 3765 "configure"
3766 #include "confdefs.h"
3767 #include <stdlib.h>
3768 int
3769 main ()
3770 {
3771
3772 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3773 make an error
3774 #endif
3775   ;
3776   return 0;
3777 }
3778 _ACEOF
3779 rm -f conftest.$ac_objext
3780 if { (eval echo "$as_me:3780: \"$ac_compile\"") >&5
3781   (eval $ac_compile) 2>&5
3782   ac_status=$?
3783   echo "$as_me:3783: \$? = $ac_status" >&5
3784   (exit $ac_status); } &&
3785          { ac_try='test -s conftest.$ac_objext'
3786   { (eval echo "$as_me:3786: \"$ac_try\"") >&5
3787   (eval $ac_try) 2>&5
3788   ac_status=$?
3789   echo "$as_me:3789: \$? = $ac_status" >&5
3790   (exit $ac_status); }; }; then
3791   cf_XOPEN_SOURCE_set_ok=yes
3792 else
3793   echo "$as_me: failed program was:" >&5
3794 cat conftest.$ac_ext >&5
3795 cf_XOPEN_SOURCE_set_ok=no
3796 fi
3797 rm -f conftest.$ac_objext conftest.$ac_ext
3798                 if test $cf_XOPEN_SOURCE_set_ok = no
3799                 then
3800                         { echo "$as_me:3800: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3801 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3802                 fi
3803         else
3804
3805 echo "$as_me:3805: checking if we should define _XOPEN_SOURCE" >&5
3806 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3807 if test "${cf_cv_xopen_source+set}" = set; then
3808   echo $ECHO_N "(cached) $ECHO_C" >&6
3809 else
3810
3811         cat >conftest.$ac_ext <<_ACEOF
3812 #line 3812 "configure"
3813 #include "confdefs.h"
3814
3815 #include <stdlib.h>
3816 #include <string.h>
3817 #include <sys/types.h>
3818
3819 int
3820 main ()
3821 {
3822
3823 #ifndef _XOPEN_SOURCE
3824 make an error
3825 #endif
3826   ;
3827   return 0;
3828 }
3829 _ACEOF
3830 rm -f conftest.$ac_objext
3831 if { (eval echo "$as_me:3831: \"$ac_compile\"") >&5
3832   (eval $ac_compile) 2>&5
3833   ac_status=$?
3834   echo "$as_me:3834: \$? = $ac_status" >&5
3835   (exit $ac_status); } &&
3836          { ac_try='test -s conftest.$ac_objext'
3837   { (eval echo "$as_me:3837: \"$ac_try\"") >&5
3838   (eval $ac_try) 2>&5
3839   ac_status=$?
3840   echo "$as_me:3840: \$? = $ac_status" >&5
3841   (exit $ac_status); }; }; then
3842   cf_cv_xopen_source=no
3843 else
3844   echo "$as_me: failed program was:" >&5
3845 cat conftest.$ac_ext >&5
3846 cf_save="$CPPFLAGS"
3847          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3848          cat >conftest.$ac_ext <<_ACEOF
3849 #line 3849 "configure"
3850 #include "confdefs.h"
3851
3852 #include <stdlib.h>
3853 #include <string.h>
3854 #include <sys/types.h>
3855
3856 int
3857 main ()
3858 {
3859
3860 #ifdef _XOPEN_SOURCE
3861 make an error
3862 #endif
3863   ;
3864   return 0;
3865 }
3866 _ACEOF
3867 rm -f conftest.$ac_objext
3868 if { (eval echo "$as_me:3868: \"$ac_compile\"") >&5
3869   (eval $ac_compile) 2>&5
3870   ac_status=$?
3871   echo "$as_me:3871: \$? = $ac_status" >&5
3872   (exit $ac_status); } &&
3873          { ac_try='test -s conftest.$ac_objext'
3874   { (eval echo "$as_me:3874: \"$ac_try\"") >&5
3875   (eval $ac_try) 2>&5
3876   ac_status=$?
3877   echo "$as_me:3877: \$? = $ac_status" >&5
3878   (exit $ac_status); }; }; then
3879   cf_cv_xopen_source=no
3880 else
3881   echo "$as_me: failed program was:" >&5
3882 cat conftest.$ac_ext >&5
3883 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3884 fi
3885 rm -f conftest.$ac_objext conftest.$ac_ext
3886         CPPFLAGS="$cf_save"
3887
3888 fi
3889 rm -f conftest.$ac_objext conftest.$ac_ext
3890
3891 fi
3892 echo "$as_me:3892: result: $cf_cv_xopen_source" >&5
3893 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3894
3895 if test "$cf_cv_xopen_source" != no ; then
3896
3897 CFLAGS=`echo "$CFLAGS" | \
3898         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3899                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3900
3901 CPPFLAGS=`echo "$CPPFLAGS" | \
3902         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3903                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3904
3905         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3906
3907 cf_fix_cppflags=no
3908 cf_new_cflags=
3909 cf_new_cppflags=
3910 cf_new_extra_cppflags=
3911
3912 for cf_add_cflags in $cf_temp_xopen_source
3913 do
3914 case $cf_fix_cppflags in
3915 (no)
3916         case $cf_add_cflags in
3917         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3918                 case $cf_add_cflags in
3919                 (-D*)
3920                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3921
3922                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3923                                 && test -z "${cf_tst_cflags}" \
3924                                 && cf_fix_cppflags=yes
3925
3926                         if test $cf_fix_cppflags = yes ; then
3927                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3928                                 continue
3929                         elif test "${cf_tst_cflags}" = "\"'" ; then
3930                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3931                                 continue
3932                         fi
3933                         ;;
3934                 esac
3935                 case "$CPPFLAGS" in
3936                 (*$cf_add_cflags)
3937                         ;;
3938                 (*)
3939                         case $cf_add_cflags in
3940                         (-D*)
3941                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3942
3943 CPPFLAGS=`echo "$CPPFLAGS" | \
3944         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3945                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3946
3947                                 ;;
3948                         esac
3949                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3950                         ;;
3951                 esac
3952                 ;;
3953         (*)
3954                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3955                 ;;
3956         esac
3957         ;;
3958 (yes)
3959         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3960
3961         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3962
3963         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3964                 && test -z "${cf_tst_cflags}" \
3965                 && cf_fix_cppflags=no
3966         ;;
3967 esac
3968 done
3969
3970 if test -n "$cf_new_cflags" ; then
3971
3972         CFLAGS="$CFLAGS $cf_new_cflags"
3973 fi
3974
3975 if test -n "$cf_new_cppflags" ; then
3976
3977         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3978 fi
3979
3980 if test -n "$cf_new_extra_cppflags" ; then
3981
3982         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3983 fi
3984
3985 fi
3986
3987         fi
3988 fi
3989
3990 echo "$as_me:3990: checking for signal global datatype" >&5
3991 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3992 if test "${cf_cv_sig_atomic_t+set}" = set; then
3993   echo $ECHO_N "(cached) $ECHO_C" >&6
3994 else
3995
3996         for cf_type in \
3997                 "volatile sig_atomic_t" \
3998                 "sig_atomic_t" \
3999                 "int"
4000         do
4001         cat >conftest.$ac_ext <<_ACEOF
4002 #line 4002 "configure"
4003 #include "confdefs.h"
4004
4005 #include <sys/types.h>
4006 #include <signal.h>
4007 #include <stdio.h>
4008
4009 extern $cf_type x;
4010 $cf_type x;
4011 static void handler(int sig)
4012 {
4013         x = 5;
4014 }
4015 int
4016 main ()
4017 {
4018 signal(SIGINT, handler);
4019                  x = 1
4020   ;
4021   return 0;
4022 }
4023 _ACEOF
4024 rm -f conftest.$ac_objext
4025 if { (eval echo "$as_me:4025: \"$ac_compile\"") >&5
4026   (eval $ac_compile) 2>&5
4027   ac_status=$?
4028   echo "$as_me:4028: \$? = $ac_status" >&5
4029   (exit $ac_status); } &&
4030          { ac_try='test -s conftest.$ac_objext'
4031   { (eval echo "$as_me:4031: \"$ac_try\"") >&5
4032   (eval $ac_try) 2>&5
4033   ac_status=$?
4034   echo "$as_me:4034: \$? = $ac_status" >&5
4035   (exit $ac_status); }; }; then
4036   cf_cv_sig_atomic_t=$cf_type
4037 else
4038   echo "$as_me: failed program was:" >&5
4039 cat conftest.$ac_ext >&5
4040 cf_cv_sig_atomic_t=no
4041 fi
4042 rm -f conftest.$ac_objext conftest.$ac_ext
4043                 test "$cf_cv_sig_atomic_t" != no && break
4044         done
4045
4046 fi
4047
4048 echo "$as_me:4048: result: $cf_cv_sig_atomic_t" >&5
4049 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4050 test "$cf_cv_sig_atomic_t" != no &&
4051 cat >>confdefs.h <<EOF
4052 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4053 EOF
4054
4055 # Work around breakage on OS X
4056
4057 echo "$as_me:4057: checking if SIGWINCH is defined" >&5
4058 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4059 if test "${cf_cv_define_sigwinch+set}" = set; then
4060   echo $ECHO_N "(cached) $ECHO_C" >&6
4061 else
4062
4063         cat >conftest.$ac_ext <<_ACEOF
4064 #line 4064 "configure"
4065 #include "confdefs.h"
4066
4067 #include <sys/types.h>
4068 #include <sys/signal.h>
4069
4070 int
4071 main ()
4072 {
4073 int x = SIGWINCH
4074   ;
4075   return 0;
4076 }
4077 _ACEOF
4078 rm -f conftest.$ac_objext
4079 if { (eval echo "$as_me:4079: \"$ac_compile\"") >&5
4080   (eval $ac_compile) 2>&5
4081   ac_status=$?
4082   echo "$as_me:4082: \$? = $ac_status" >&5
4083   (exit $ac_status); } &&
4084          { ac_try='test -s conftest.$ac_objext'
4085   { (eval echo "$as_me:4085: \"$ac_try\"") >&5
4086   (eval $ac_try) 2>&5
4087   ac_status=$?
4088   echo "$as_me:4088: \$? = $ac_status" >&5
4089   (exit $ac_status); }; }; then
4090   cf_cv_define_sigwinch=yes
4091 else
4092   echo "$as_me: failed program was:" >&5
4093 cat conftest.$ac_ext >&5
4094 cat >conftest.$ac_ext <<_ACEOF
4095 #line 4095 "configure"
4096 #include "confdefs.h"
4097
4098 #undef _XOPEN_SOURCE
4099 #undef _POSIX_SOURCE
4100 #undef _POSIX_C_SOURCE
4101 #include <sys/types.h>
4102 #include <sys/signal.h>
4103
4104 int
4105 main ()
4106 {
4107 int x = SIGWINCH
4108   ;
4109   return 0;
4110 }
4111 _ACEOF
4112 rm -f conftest.$ac_objext
4113 if { (eval echo "$as_me:4113: \"$ac_compile\"") >&5
4114   (eval $ac_compile) 2>&5
4115   ac_status=$?
4116   echo "$as_me:4116: \$? = $ac_status" >&5
4117   (exit $ac_status); } &&
4118          { ac_try='test -s conftest.$ac_objext'
4119   { (eval echo "$as_me:4119: \"$ac_try\"") >&5
4120   (eval $ac_try) 2>&5
4121   ac_status=$?
4122   echo "$as_me:4122: \$? = $ac_status" >&5
4123   (exit $ac_status); }; }; then
4124   cf_cv_define_sigwinch=maybe
4125 else
4126   echo "$as_me: failed program was:" >&5
4127 cat conftest.$ac_ext >&5
4128 cf_cv_define_sigwinch=no
4129 fi
4130 rm -f conftest.$ac_objext conftest.$ac_ext
4131
4132 fi
4133 rm -f conftest.$ac_objext conftest.$ac_ext
4134
4135 fi
4136 echo "$as_me:4136: result: $cf_cv_define_sigwinch" >&5
4137 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4138
4139 if test "$cf_cv_define_sigwinch" = maybe ; then
4140 echo "$as_me:4140: checking for actual SIGWINCH definition" >&5
4141 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4142 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4143   echo $ECHO_N "(cached) $ECHO_C" >&6
4144 else
4145
4146 cf_cv_fixup_sigwinch=unknown
4147 cf_sigwinch=32
4148 while test $cf_sigwinch != 1
4149 do
4150         cat >conftest.$ac_ext <<_ACEOF
4151 #line 4151 "configure"
4152 #include "confdefs.h"
4153
4154 #undef _XOPEN_SOURCE
4155 #undef _POSIX_SOURCE
4156 #undef _POSIX_C_SOURCE
4157 #include <sys/types.h>
4158 #include <sys/signal.h>
4159
4160 int
4161 main ()
4162 {
4163
4164 #if SIGWINCH != $cf_sigwinch
4165 make an error
4166 #endif
4167 int x = SIGWINCH
4168   ;
4169   return 0;
4170 }
4171 _ACEOF
4172 rm -f conftest.$ac_objext
4173 if { (eval echo "$as_me:4173: \"$ac_compile\"") >&5
4174   (eval $ac_compile) 2>&5
4175   ac_status=$?
4176   echo "$as_me:4176: \$? = $ac_status" >&5
4177   (exit $ac_status); } &&
4178          { ac_try='test -s conftest.$ac_objext'
4179   { (eval echo "$as_me:4179: \"$ac_try\"") >&5
4180   (eval $ac_try) 2>&5
4181   ac_status=$?
4182   echo "$as_me:4182: \$? = $ac_status" >&5
4183   (exit $ac_status); }; }; then
4184   cf_cv_fixup_sigwinch=$cf_sigwinch
4185          break
4186 else
4187   echo "$as_me: failed program was:" >&5
4188 cat conftest.$ac_ext >&5
4189 fi
4190 rm -f conftest.$ac_objext conftest.$ac_ext
4191
4192 cf_sigwinch=`expr $cf_sigwinch - 1`
4193 done
4194
4195 fi
4196 echo "$as_me:4196: result: $cf_cv_fixup_sigwinch" >&5
4197 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4198
4199         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4200                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4201         fi
4202 fi
4203
4204 # Checks for CODESET support.
4205
4206 echo "$as_me:4206: checking for nl_langinfo and CODESET" >&5
4207 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4208 if test "${am_cv_langinfo_codeset+set}" = set; then
4209   echo $ECHO_N "(cached) $ECHO_C" >&6
4210 else
4211   cat >conftest.$ac_ext <<_ACEOF
4212 #line 4212 "configure"
4213 #include "confdefs.h"
4214 #include <langinfo.h>
4215 int
4216 main ()
4217 {
4218 char* cs = nl_langinfo(CODESET);
4219   ;
4220   return 0;
4221 }
4222 _ACEOF
4223 rm -f conftest.$ac_objext conftest$ac_exeext
4224 if { (eval echo "$as_me:4224: \"$ac_link\"") >&5
4225   (eval $ac_link) 2>&5
4226   ac_status=$?
4227   echo "$as_me:4227: \$? = $ac_status" >&5
4228   (exit $ac_status); } &&
4229          { ac_try='test -s conftest$ac_exeext'
4230   { (eval echo "$as_me:4230: \"$ac_try\"") >&5
4231   (eval $ac_try) 2>&5
4232   ac_status=$?
4233   echo "$as_me:4233: \$? = $ac_status" >&5
4234   (exit $ac_status); }; }; then
4235   am_cv_langinfo_codeset=yes
4236 else
4237   echo "$as_me: failed program was:" >&5
4238 cat conftest.$ac_ext >&5
4239 am_cv_langinfo_codeset=no
4240 fi
4241 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4242
4243 fi
4244 echo "$as_me:4244: result: $am_cv_langinfo_codeset" >&5
4245 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4246         if test $am_cv_langinfo_codeset = yes; then
4247
4248 cat >>confdefs.h <<\EOF
4249 #define HAVE_LANGINFO_CODESET 1
4250 EOF
4251
4252         fi
4253
4254 echo "$as_me:4254: checking if you want to use pkg-config" >&5
4255 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4256
4257 # Check whether --with-pkg-config or --without-pkg-config was given.
4258 if test "${with_pkg_config+set}" = set; then
4259   withval="$with_pkg_config"
4260   cf_pkg_config=$withval
4261 else
4262   cf_pkg_config=yes
4263 fi;
4264 echo "$as_me:4264: result: $cf_pkg_config" >&5
4265 echo "${ECHO_T}$cf_pkg_config" >&6
4266
4267 case $cf_pkg_config in
4268 (no)
4269         PKG_CONFIG=none
4270         ;;
4271 (yes)
4272
4273 if test -n "$ac_tool_prefix"; then
4274   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4275 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4276 echo "$as_me:4276: checking for $ac_word" >&5
4277 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4278 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4279   echo $ECHO_N "(cached) $ECHO_C" >&6
4280 else
4281   case $PKG_CONFIG in
4282   [\\/]* | ?:[\\/]*)
4283   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4284   ;;
4285   *)
4286   ac_save_IFS=$IFS; IFS=$ac_path_separator
4287 ac_dummy="$PATH"
4288 for ac_dir in $ac_dummy; do
4289   IFS=$ac_save_IFS
4290   test -z "$ac_dir" && ac_dir=.
4291   if $as_executable_p "$ac_dir/$ac_word"; then
4292    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4293    echo "$as_me:4293: found $ac_dir/$ac_word" >&5
4294    break
4295 fi
4296 done
4297
4298   ;;
4299 esac
4300 fi
4301 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4302
4303 if test -n "$PKG_CONFIG"; then
4304   echo "$as_me:4304: result: $PKG_CONFIG" >&5
4305 echo "${ECHO_T}$PKG_CONFIG" >&6
4306 else
4307   echo "$as_me:4307: result: no" >&5
4308 echo "${ECHO_T}no" >&6
4309 fi
4310
4311 fi
4312 if test -z "$ac_cv_path_PKG_CONFIG"; then
4313   ac_pt_PKG_CONFIG=$PKG_CONFIG
4314   # Extract the first word of "pkg-config", so it can be a program name with args.
4315 set dummy pkg-config; ac_word=$2
4316 echo "$as_me:4316: checking for $ac_word" >&5
4317 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4318 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4319   echo $ECHO_N "(cached) $ECHO_C" >&6
4320 else
4321   case $ac_pt_PKG_CONFIG in
4322   [\\/]* | ?:[\\/]*)
4323   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4324   ;;
4325   *)
4326   ac_save_IFS=$IFS; IFS=$ac_path_separator
4327 ac_dummy="$PATH"
4328 for ac_dir in $ac_dummy; do
4329   IFS=$ac_save_IFS
4330   test -z "$ac_dir" && ac_dir=.
4331   if $as_executable_p "$ac_dir/$ac_word"; then
4332    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4333    echo "$as_me:4333: found $ac_dir/$ac_word" >&5
4334    break
4335 fi
4336 done
4337
4338   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4339   ;;
4340 esac
4341 fi
4342 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4343
4344 if test -n "$ac_pt_PKG_CONFIG"; then
4345   echo "$as_me:4345: result: $ac_pt_PKG_CONFIG" >&5
4346 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4347 else
4348   echo "$as_me:4348: result: no" >&5
4349 echo "${ECHO_T}no" >&6
4350 fi
4351
4352   PKG_CONFIG=$ac_pt_PKG_CONFIG
4353 else
4354   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4355 fi
4356
4357         ;;
4358 (*)
4359         PKG_CONFIG=$withval
4360         ;;
4361 esac
4362
4363 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4364 if test "$PKG_CONFIG" != none ; then
4365
4366 if test "x$prefix" != xNONE; then
4367         cf_path_syntax="$prefix"
4368 else
4369         cf_path_syntax="$ac_default_prefix"
4370 fi
4371
4372 case ".$PKG_CONFIG" in
4373 (.\$\(*\)*|.\'*\'*)
4374         ;;
4375 (..|./*|.\\*)
4376         ;;
4377 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4378         ;;
4379 (.\${*prefix}*|.\${*dir}*)
4380         eval PKG_CONFIG="$PKG_CONFIG"
4381         case ".$PKG_CONFIG" in
4382         (.NONE/*)
4383                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4384                 ;;
4385         esac
4386         ;;
4387 (.no|.NONE/*)
4388         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4389         ;;
4390 (*)
4391         { { echo "$as_me:4391: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4392 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4393    { (exit 1); exit 1; }; }
4394         ;;
4395 esac
4396
4397 elif test "x$cf_pkg_config" != xno ; then
4398         { echo "$as_me:4398: WARNING: pkg-config is not installed" >&5
4399 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4400 fi
4401
4402 echo "$as_me:4402: checking if you want to see long compiling messages" >&5
4403 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4404
4405 # Check whether --enable-echo or --disable-echo was given.
4406 if test "${enable_echo+set}" = set; then
4407   enableval="$enable_echo"
4408   test "$enableval" != no && enableval=yes
4409         if test "$enableval" != "yes" ; then
4410
4411         ECHO_LT='--silent'
4412         ECHO_LD='@echo linking $@;'
4413         RULE_CC='@echo compiling $<'
4414         SHOW_CC='@echo compiling $@'
4415         ECHO_CC='@'
4416
4417         else
4418
4419         ECHO_LT=''
4420         ECHO_LD=''
4421         RULE_CC=''
4422         SHOW_CC=''
4423         ECHO_CC=''
4424
4425         fi
4426 else
4427   enableval=yes
4428
4429         ECHO_LT=''
4430         ECHO_LD=''
4431         RULE_CC=''
4432         SHOW_CC=''
4433         ECHO_CC=''
4434
4435 fi;
4436 echo "$as_me:4436: result: $enableval" >&5
4437 echo "${ECHO_T}$enableval" >&6
4438
4439 echo "$as_me:4439: checking for ncurses wrap-prefix" >&5
4440 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4441
4442 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4443 if test "${with_ncurses_wrap_prefix+set}" = set; then
4444   withval="$with_ncurses_wrap_prefix"
4445   NCURSES_WRAP_PREFIX=$withval
4446 else
4447   NCURSES_WRAP_PREFIX=_nc_
4448 fi;
4449 echo "$as_me:4449: result: $NCURSES_WRAP_PREFIX" >&5
4450 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4451
4452 echo "$as_me:4452: checking if you want to check for wide-character functions" >&5
4453 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4454
4455 # Check whether --enable-widec or --disable-widec was given.
4456 if test "${enable_widec+set}" = set; then
4457   enableval="$enable_widec"
4458   test "$enableval" != no && enableval=yes
4459         if test "$enableval" != "yes" ; then
4460     cf_enable_widec=no
4461         else
4462                 cf_enable_widec=yes
4463         fi
4464 else
4465   enableval=yes
4466         cf_enable_widec=yes
4467
4468 fi;
4469 echo "$as_me:4469: result: $cf_enable_widec" >&5
4470 echo "${ECHO_T}$cf_enable_widec" >&6
4471
4472 echo "$as_me:4472: checking for specific curses-directory" >&5
4473 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4474
4475 # Check whether --with-curses-dir or --without-curses-dir was given.
4476 if test "${with_curses_dir+set}" = set; then
4477   withval="$with_curses_dir"
4478   cf_cv_curses_dir=$withval
4479 else
4480   cf_cv_curses_dir=no
4481 fi;
4482 echo "$as_me:4482: result: $cf_cv_curses_dir" >&5
4483 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4484
4485 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4486 then
4487
4488 if test "x$prefix" != xNONE; then
4489         cf_path_syntax="$prefix"
4490 else
4491         cf_path_syntax="$ac_default_prefix"
4492 fi
4493
4494 case ".$withval" in
4495 (.\$\(*\)*|.\'*\'*)
4496         ;;
4497 (..|./*|.\\*)
4498         ;;
4499 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4500         ;;
4501 (.\${*prefix}*|.\${*dir}*)
4502         eval withval="$withval"
4503         case ".$withval" in
4504         (.NONE/*)
4505                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4506                 ;;
4507         esac
4508         ;;
4509 (.no|.NONE/*)
4510         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4511         ;;
4512 (*)
4513         { { echo "$as_me:4513: error: expected a pathname, not \"$withval\"" >&5
4514 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4515    { (exit 1); exit 1; }; }
4516         ;;
4517 esac
4518
4519         if test -d "$cf_cv_curses_dir"
4520         then
4521
4522 if test -n "$cf_cv_curses_dir/include" ; then
4523   for cf_add_incdir in $cf_cv_curses_dir/include
4524   do
4525         while test $cf_add_incdir != /usr/include
4526         do
4527           if test -d $cf_add_incdir
4528           then
4529                 cf_have_incdir=no
4530                 if test -n "$CFLAGS$CPPFLAGS" ; then
4531                   # a loop is needed to ensure we can add subdirs of existing dirs
4532                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4533                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4534                           cf_have_incdir=yes; break
4535                         fi
4536                   done
4537                 fi
4538
4539                 if test "$cf_have_incdir" = no ; then
4540                   if test "$cf_add_incdir" = /usr/local/include ; then
4541                         if test "$GCC" = yes
4542                         then
4543                           cf_save_CPPFLAGS=$CPPFLAGS
4544                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4545                           cat >conftest.$ac_ext <<_ACEOF
4546 #line 4546 "configure"
4547 #include "confdefs.h"
4548 #include <stdio.h>
4549 int
4550 main ()
4551 {
4552 printf("Hello")
4553   ;
4554   return 0;
4555 }
4556 _ACEOF
4557 rm -f conftest.$ac_objext
4558 if { (eval echo "$as_me:4558: \"$ac_compile\"") >&5
4559   (eval $ac_compile) 2>&5
4560   ac_status=$?
4561   echo "$as_me:4561: \$? = $ac_status" >&5
4562   (exit $ac_status); } &&
4563          { ac_try='test -s conftest.$ac_objext'
4564   { (eval echo "$as_me:4564: \"$ac_try\"") >&5
4565   (eval $ac_try) 2>&5
4566   ac_status=$?
4567   echo "$as_me:4567: \$? = $ac_status" >&5
4568   (exit $ac_status); }; }; then
4569   :
4570 else
4571   echo "$as_me: failed program was:" >&5
4572 cat conftest.$ac_ext >&5
4573 cf_have_incdir=yes
4574 fi
4575 rm -f conftest.$ac_objext conftest.$ac_ext
4576                           CPPFLAGS=$cf_save_CPPFLAGS
4577                         fi
4578                   fi
4579                 fi
4580
4581                 if test "$cf_have_incdir" = no ; then
4582                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4583
4584 echo "${as_me:-configure}:4584: testing adding $cf_add_incdir to include-path ..." 1>&5
4585
4586                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4587
4588                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4589                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4590                   cf_add_incdir="$cf_top_incdir"
4591                 else
4592                   break
4593                 fi
4594           else
4595                 break
4596           fi
4597         done
4598   done
4599 fi
4600
4601 if test -n "$cf_cv_curses_dir/lib" ; then
4602         for cf_add_libdir in $cf_cv_curses_dir/lib
4603         do
4604                 if test $cf_add_libdir = /usr/lib ; then
4605                         :
4606                 elif test -d $cf_add_libdir
4607                 then
4608                         cf_have_libdir=no
4609                         if test -n "$LDFLAGS$LIBS" ; then
4610                                 # a loop is needed to ensure we can add subdirs of existing dirs
4611                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4612                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4613                                                 cf_have_libdir=yes; break
4614                                         fi
4615                                 done
4616                         fi
4617                         if test "$cf_have_libdir" = no ; then
4618                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4619
4620 echo "${as_me:-configure}:4620: testing adding $cf_add_libdir to library-path ..." 1>&5
4621
4622                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4623                         fi
4624                 fi
4625         done
4626 fi
4627
4628         fi
4629 fi
4630
4631 cf_cv_screen=curses
4632
4633 echo "$as_me:4633: checking for specified curses library type" >&5
4634 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4635
4636 # Check whether --with-screen or --without-screen was given.
4637 if test "${with_screen+set}" = set; then
4638   withval="$with_screen"
4639   cf_cv_screen=$withval
4640 else
4641
4642 # Check whether --with-ncursesw or --without-ncursesw was given.
4643 if test "${with_ncursesw+set}" = set; then
4644   withval="$with_ncursesw"
4645   cf_cv_screen=ncursesw
4646 else
4647
4648 # Check whether --with-ncurses or --without-ncurses was given.
4649 if test "${with_ncurses+set}" = set; then
4650   withval="$with_ncurses"
4651   cf_cv_screen=ncurses
4652 else
4653
4654 # Check whether --with-pdcurses or --without-pdcurses was given.
4655 if test "${with_pdcurses+set}" = set; then
4656   withval="$with_pdcurses"
4657   cf_cv_screen=pdcurses
4658 else
4659
4660 # Check whether --with-curses-colr or --without-curses-colr was given.
4661 if test "${with_curses_colr+set}" = set; then
4662   withval="$with_curses_colr"
4663   cf_cv_screen=curses_colr
4664 else
4665
4666 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4667 if test "${with_curses_5lib+set}" = set; then
4668   withval="$with_curses_5lib"
4669   cf_cv_screen=curses_5lib
4670 fi;
4671 fi;
4672 fi;
4673 fi;
4674 fi;
4675 fi;
4676
4677 echo "$as_me:4677: result: $cf_cv_screen" >&5
4678 echo "${ECHO_T}$cf_cv_screen" >&6
4679
4680 case $cf_cv_screen in
4681 (curses|curses_*)
4682
4683 echo "$as_me:4683: checking for extra include directories" >&5
4684 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4685 if test "${cf_cv_curses_incdir+set}" = set; then
4686   echo $ECHO_N "(cached) $ECHO_C" >&6
4687 else
4688
4689 cf_cv_curses_incdir=no
4690 case $host_os in
4691 (hpux10.*)
4692         if test "x$cf_cv_screen" = "xcurses_colr"
4693         then
4694                 test -d /usr/include/curses_colr && \
4695                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4696         fi
4697         ;;
4698 (sunos3*|sunos4*)
4699         if test "x$cf_cv_screen" = "xcurses_5lib"
4700         then
4701                 test -d /usr/5lib && \
4702                 test -d /usr/5include && \
4703                 cf_cv_curses_incdir="-I/usr/5include"
4704         fi
4705         ;;
4706 esac
4707
4708 fi
4709 echo "$as_me:4709: result: $cf_cv_curses_incdir" >&5
4710 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4711 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4712
4713 echo "$as_me:4713: checking if we have identified curses headers" >&5
4714 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4715 if test "${cf_cv_ncurses_header+set}" = set; then
4716   echo $ECHO_N "(cached) $ECHO_C" >&6
4717 else
4718
4719 cf_cv_ncurses_header=none
4720 for cf_header in \
4721         ncurses.h  \
4722         curses.h  ncurses/ncurses.h ncurses/curses.h
4723 do
4724 cat >conftest.$ac_ext <<_ACEOF
4725 #line 4725 "configure"
4726 #include "confdefs.h"
4727 #include <${cf_header}>
4728 int
4729 main ()
4730 {
4731 initscr(); tgoto("?", 0,0)
4732   ;
4733   return 0;
4734 }
4735 _ACEOF
4736 rm -f conftest.$ac_objext
4737 if { (eval echo "$as_me:4737: \"$ac_compile\"") >&5
4738   (eval $ac_compile) 2>&5
4739   ac_status=$?
4740   echo "$as_me:4740: \$? = $ac_status" >&5
4741   (exit $ac_status); } &&
4742          { ac_try='test -s conftest.$ac_objext'
4743   { (eval echo "$as_me:4743: \"$ac_try\"") >&5
4744   (eval $ac_try) 2>&5
4745   ac_status=$?
4746   echo "$as_me:4746: \$? = $ac_status" >&5
4747   (exit $ac_status); }; }; then
4748   cf_cv_ncurses_header=$cf_header; break
4749 else
4750   echo "$as_me: failed program was:" >&5
4751 cat conftest.$ac_ext >&5
4752 fi
4753 rm -f conftest.$ac_objext conftest.$ac_ext
4754 done
4755
4756 fi
4757 echo "$as_me:4757: result: $cf_cv_ncurses_header" >&5
4758 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4759
4760 if test "$cf_cv_ncurses_header" = none ; then
4761         { { echo "$as_me:4761: error: No curses header-files found" >&5
4762 echo "$as_me: error: No curses header-files found" >&2;}
4763    { (exit 1); exit 1; }; }
4764 fi
4765
4766 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4767
4768 for ac_header in $cf_cv_ncurses_header
4769 do
4770 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4771 echo "$as_me:4771: checking for $ac_header" >&5
4772 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4773 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4774   echo $ECHO_N "(cached) $ECHO_C" >&6
4775 else
4776   cat >conftest.$ac_ext <<_ACEOF
4777 #line 4777 "configure"
4778 #include "confdefs.h"
4779 #include <$ac_header>
4780 _ACEOF
4781 if { (eval echo "$as_me:4781: \"$ac_cpp conftest.$ac_ext\"") >&5
4782   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4783   ac_status=$?
4784   egrep -v '^ *\+' conftest.er1 >conftest.err
4785   rm -f conftest.er1
4786   cat conftest.err >&5
4787   echo "$as_me:4787: \$? = $ac_status" >&5
4788   (exit $ac_status); } >/dev/null; then
4789   if test -s conftest.err; then
4790     ac_cpp_err=$ac_c_preproc_warn_flag
4791   else
4792     ac_cpp_err=
4793   fi
4794 else
4795   ac_cpp_err=yes
4796 fi
4797 if test -z "$ac_cpp_err"; then
4798   eval "$as_ac_Header=yes"
4799 else
4800   echo "$as_me: failed program was:" >&5
4801   cat conftest.$ac_ext >&5
4802   eval "$as_ac_Header=no"
4803 fi
4804 rm -f conftest.err conftest.$ac_ext
4805 fi
4806 echo "$as_me:4806: result: `eval echo '${'$as_ac_Header'}'`" >&5
4807 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4808 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4809   cat >>confdefs.h <<EOF
4810 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4811 EOF
4812
4813 fi
4814 done
4815
4816 echo "$as_me:4816: checking for terminfo header" >&5
4817 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4818 if test "${cf_cv_term_header+set}" = set; then
4819   echo $ECHO_N "(cached) $ECHO_C" >&6
4820 else
4821
4822 case ${cf_cv_ncurses_header} in
4823 (*/ncurses.h|*/ncursesw.h)
4824         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4825         ;;
4826 (*)
4827         cf_term_header=term.h
4828         ;;
4829 esac
4830
4831 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4832 do
4833 cat >conftest.$ac_ext <<_ACEOF
4834 #line 4834 "configure"
4835 #include "confdefs.h"
4836 #include <stdio.h>
4837 #include <${cf_cv_ncurses_header:-curses.h}>
4838 #include <$cf_test>
4839
4840 int
4841 main ()
4842 {
4843 int x = auto_left_margin
4844   ;
4845   return 0;
4846 }
4847 _ACEOF
4848 rm -f conftest.$ac_objext
4849 if { (eval echo "$as_me:4849: \"$ac_compile\"") >&5
4850   (eval $ac_compile) 2>&5
4851   ac_status=$?
4852   echo "$as_me:4852: \$? = $ac_status" >&5
4853   (exit $ac_status); } &&
4854          { ac_try='test -s conftest.$ac_objext'
4855   { (eval echo "$as_me:4855: \"$ac_try\"") >&5
4856   (eval $ac_try) 2>&5
4857   ac_status=$?
4858   echo "$as_me:4858: \$? = $ac_status" >&5
4859   (exit $ac_status); }; }; then
4860
4861         cf_cv_term_header="$cf_test"
4862 else
4863   echo "$as_me: failed program was:" >&5
4864 cat conftest.$ac_ext >&5
4865
4866         cf_cv_term_header=unknown
4867
4868 fi
4869 rm -f conftest.$ac_objext conftest.$ac_ext
4870         test "$cf_cv_term_header" != unknown && break
4871 done
4872
4873 fi
4874 echo "$as_me:4874: result: $cf_cv_term_header" >&5
4875 echo "${ECHO_T}$cf_cv_term_header" >&6
4876
4877 # Set definitions to allow ifdef'ing to accommodate subdirectories
4878
4879 case $cf_cv_term_header in
4880 (*term.h)
4881
4882 cat >>confdefs.h <<\EOF
4883 #define HAVE_TERM_H 1
4884 EOF
4885
4886         ;;
4887 esac
4888
4889 case $cf_cv_term_header in
4890 (ncurses/term.h)
4891
4892 cat >>confdefs.h <<\EOF
4893 #define HAVE_NCURSES_TERM_H 1
4894 EOF
4895
4896         ;;
4897 (ncursesw/term.h)
4898
4899 cat >>confdefs.h <<\EOF
4900 #define HAVE_NCURSESW_TERM_H 1
4901 EOF
4902
4903         ;;
4904 esac
4905
4906 echo "$as_me:4906: checking for ncurses version" >&5
4907 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4908 if test "${cf_cv_ncurses_version+set}" = set; then
4909   echo $ECHO_N "(cached) $ECHO_C" >&6
4910 else
4911
4912         cf_cv_ncurses_version=no
4913         cf_tempfile=out$$
4914         rm -f $cf_tempfile
4915         if test "$cross_compiling" = yes; then
4916
4917         # This will not work if the preprocessor splits the line after the
4918         # Autoconf token.  The 'unproto' program does that.
4919         cat > conftest.$ac_ext <<EOF
4920 #include <${cf_cv_ncurses_header:-curses.h}>
4921 #undef Autoconf
4922 #ifdef NCURSES_VERSION
4923 Autoconf NCURSES_VERSION
4924 #else
4925 #ifdef __NCURSES_H
4926 Autoconf "old"
4927 #endif
4928 ;
4929 #endif
4930 EOF
4931         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4932         { (eval echo "$as_me:4932: \"$cf_try\"") >&5
4933   (eval $cf_try) 2>&5
4934   ac_status=$?
4935   echo "$as_me:4935: \$? = $ac_status" >&5
4936   (exit $ac_status); }
4937         if test -f conftest.out ; then
4938                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4939                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4940                 rm -f conftest.out
4941         fi
4942
4943 else
4944   cat >conftest.$ac_ext <<_ACEOF
4945 #line 4945 "configure"
4946 #include "confdefs.h"
4947
4948 #include <${cf_cv_ncurses_header:-curses.h}>
4949 #include <stdio.h>
4950 int main()
4951 {
4952         FILE *fp = fopen("$cf_tempfile", "w");
4953 #ifdef NCURSES_VERSION
4954 # ifdef NCURSES_VERSION_PATCH
4955         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4956 # else
4957         fprintf(fp, "%s\n", NCURSES_VERSION);
4958 # endif
4959 #else
4960 # ifdef __NCURSES_H
4961         fprintf(fp, "old\n");
4962 # else
4963         make an error
4964 # endif
4965 #endif
4966         ${cf_cv_main_return:-return}(0);
4967 }
4968 _ACEOF
4969 rm -f conftest$ac_exeext
4970 if { (eval echo "$as_me:4970: \"$ac_link\"") >&5
4971   (eval $ac_link) 2>&5
4972   ac_status=$?
4973   echo "$as_me:4973: \$? = $ac_status" >&5
4974   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4975   { (eval echo "$as_me:4975: \"$ac_try\"") >&5
4976   (eval $ac_try) 2>&5
4977   ac_status=$?
4978   echo "$as_me:4978: \$? = $ac_status" >&5
4979   (exit $ac_status); }; }; then
4980
4981         cf_cv_ncurses_version=`cat $cf_tempfile`
4982 else
4983   echo "$as_me: program exited with status $ac_status" >&5
4984 echo "$as_me: failed program was:" >&5
4985 cat conftest.$ac_ext >&5
4986 fi
4987 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4988 fi
4989         rm -f $cf_tempfile
4990
4991 fi
4992 echo "$as_me:4992: result: $cf_cv_ncurses_version" >&5
4993 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4994 test "$cf_cv_ncurses_version" = no ||
4995 cat >>confdefs.h <<\EOF
4996 #define NCURSES 1
4997 EOF
4998
4999 echo "$as_me:4999: checking if we have identified curses libraries" >&5
5000 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5001 cat >conftest.$ac_ext <<_ACEOF
5002 #line 5002 "configure"
5003 #include "confdefs.h"
5004 #include <${cf_cv_ncurses_header:-curses.h}>
5005 int
5006 main ()
5007 {
5008 initscr(); tgoto("?", 0,0)
5009   ;
5010   return 0;
5011 }
5012 _ACEOF
5013 rm -f conftest.$ac_objext conftest$ac_exeext
5014 if { (eval echo "$as_me:5014: \"$ac_link\"") >&5
5015   (eval $ac_link) 2>&5
5016   ac_status=$?
5017   echo "$as_me:5017: \$? = $ac_status" >&5
5018   (exit $ac_status); } &&
5019          { ac_try='test -s conftest$ac_exeext'
5020   { (eval echo "$as_me:5020: \"$ac_try\"") >&5
5021   (eval $ac_try) 2>&5
5022   ac_status=$?
5023   echo "$as_me:5023: \$? = $ac_status" >&5
5024   (exit $ac_status); }; }; then
5025   cf_result=yes
5026 else
5027   echo "$as_me: failed program was:" >&5
5028 cat conftest.$ac_ext >&5
5029 cf_result=no
5030 fi
5031 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5032 echo "$as_me:5032: result: $cf_result" >&5
5033 echo "${ECHO_T}$cf_result" >&6
5034
5035 if test "$cf_result" = no ; then
5036 case $host_os in
5037 (freebsd*)
5038         echo "$as_me:5038: checking for tgoto in -lmytinfo" >&5
5039 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5040 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5041   echo $ECHO_N "(cached) $ECHO_C" >&6
5042 else
5043   ac_check_lib_save_LIBS=$LIBS
5044 LIBS="-lmytinfo  $LIBS"
5045 cat >conftest.$ac_ext <<_ACEOF
5046 #line 5046 "configure"
5047 #include "confdefs.h"
5048
5049 /* Override any gcc2 internal prototype to avoid an error.  */
5050 #ifdef __cplusplus
5051 extern "C"
5052 #endif
5053 /* We use char because int might match the return type of a gcc2
5054    builtin and then its argument prototype would still apply.  */
5055 char tgoto ();
5056 int
5057 main ()
5058 {
5059 tgoto ();
5060   ;
5061   return 0;
5062 }
5063 _ACEOF
5064 rm -f conftest.$ac_objext conftest$ac_exeext
5065 if { (eval echo "$as_me:5065: \"$ac_link\"") >&5
5066   (eval $ac_link) 2>&5
5067   ac_status=$?
5068   echo "$as_me:5068: \$? = $ac_status" >&5
5069   (exit $ac_status); } &&
5070          { ac_try='test -s conftest$ac_exeext'
5071   { (eval echo "$as_me:5071: \"$ac_try\"") >&5
5072   (eval $ac_try) 2>&5
5073   ac_status=$?
5074   echo "$as_me:5074: \$? = $ac_status" >&5
5075   (exit $ac_status); }; }; then
5076   ac_cv_lib_mytinfo_tgoto=yes
5077 else
5078   echo "$as_me: failed program was:" >&5
5079 cat conftest.$ac_ext >&5
5080 ac_cv_lib_mytinfo_tgoto=no
5081 fi
5082 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5083 LIBS=$ac_check_lib_save_LIBS
5084 fi
5085 echo "$as_me:5085: result: $ac_cv_lib_mytinfo_tgoto" >&5
5086 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5087 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5088
5089 cf_add_libs="-lmytinfo"
5090 # Filter out duplicates - this happens with badly-designed ".pc" files...
5091 for cf_add_1lib in $LIBS
5092 do
5093         for cf_add_2lib in $cf_add_libs
5094         do
5095                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5096                 then
5097                         cf_add_1lib=
5098                         break
5099                 fi
5100         done
5101         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5102 done
5103 LIBS="$cf_add_libs"
5104
5105 fi
5106
5107         ;;
5108 (hpux10.*)
5109         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5110         # next (1998), and xcurses "newer" (2000).  There is no header file for
5111         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5112         # term.h) for cur_colr
5113         if test "x$cf_cv_screen" = "xcurses_colr"
5114         then
5115                 echo "$as_me:5115: checking for initscr in -lcur_colr" >&5
5116 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5117 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5118   echo $ECHO_N "(cached) $ECHO_C" >&6
5119 else
5120   ac_check_lib_save_LIBS=$LIBS
5121 LIBS="-lcur_colr  $LIBS"
5122 cat >conftest.$ac_ext <<_ACEOF
5123 #line 5123 "configure"
5124 #include "confdefs.h"
5125
5126 /* Override any gcc2 internal prototype to avoid an error.  */
5127 #ifdef __cplusplus
5128 extern "C"
5129 #endif
5130 /* We use char because int might match the return type of a gcc2
5131    builtin and then its argument prototype would still apply.  */
5132 char initscr ();
5133 int
5134 main ()
5135 {
5136 initscr ();
5137   ;
5138   return 0;
5139 }
5140 _ACEOF
5141 rm -f conftest.$ac_objext conftest$ac_exeext
5142 if { (eval echo "$as_me:5142: \"$ac_link\"") >&5
5143   (eval $ac_link) 2>&5
5144   ac_status=$?
5145   echo "$as_me:5145: \$? = $ac_status" >&5
5146   (exit $ac_status); } &&
5147          { ac_try='test -s conftest$ac_exeext'
5148   { (eval echo "$as_me:5148: \"$ac_try\"") >&5
5149   (eval $ac_try) 2>&5
5150   ac_status=$?
5151   echo "$as_me:5151: \$? = $ac_status" >&5
5152   (exit $ac_status); }; }; then
5153   ac_cv_lib_cur_colr_initscr=yes
5154 else
5155   echo "$as_me: failed program was:" >&5
5156 cat conftest.$ac_ext >&5
5157 ac_cv_lib_cur_colr_initscr=no
5158 fi
5159 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5160 LIBS=$ac_check_lib_save_LIBS
5161 fi
5162 echo "$as_me:5162: result: $ac_cv_lib_cur_colr_initscr" >&5
5163 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5164 if test $ac_cv_lib_cur_colr_initscr = yes; then
5165
5166 cf_add_libs="-lcur_colr"
5167 # Filter out duplicates - this happens with badly-designed ".pc" files...
5168 for cf_add_1lib in $LIBS
5169 do
5170         for cf_add_2lib in $cf_add_libs
5171         do
5172                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5173                 then
5174                         cf_add_1lib=
5175                         break
5176                 fi
5177         done
5178         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5179 done
5180 LIBS="$cf_add_libs"
5181
5182                         ac_cv_func_initscr=yes
5183
5184 else
5185
5186                 echo "$as_me:5186: checking for initscr in -lHcurses" >&5
5187 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5188 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5189   echo $ECHO_N "(cached) $ECHO_C" >&6
5190 else
5191   ac_check_lib_save_LIBS=$LIBS
5192 LIBS="-lHcurses  $LIBS"
5193 cat >conftest.$ac_ext <<_ACEOF
5194 #line 5194 "configure"
5195 #include "confdefs.h"
5196
5197 /* Override any gcc2 internal prototype to avoid an error.  */
5198 #ifdef __cplusplus
5199 extern "C"
5200 #endif
5201 /* We use char because int might match the return type of a gcc2
5202    builtin and then its argument prototype would still apply.  */
5203 char initscr ();
5204 int
5205 main ()
5206 {
5207 initscr ();
5208   ;
5209   return 0;
5210 }
5211 _ACEOF
5212 rm -f conftest.$ac_objext conftest$ac_exeext
5213 if { (eval echo "$as_me:5213: \"$ac_link\"") >&5
5214   (eval $ac_link) 2>&5
5215   ac_status=$?
5216   echo "$as_me:5216: \$? = $ac_status" >&5
5217   (exit $ac_status); } &&
5218          { ac_try='test -s conftest$ac_exeext'
5219   { (eval echo "$as_me:5219: \"$ac_try\"") >&5
5220   (eval $ac_try) 2>&5
5221   ac_status=$?
5222   echo "$as_me:5222: \$? = $ac_status" >&5
5223   (exit $ac_status); }; }; then
5224   ac_cv_lib_Hcurses_initscr=yes
5225 else
5226   echo "$as_me: failed program was:" >&5
5227 cat conftest.$ac_ext >&5
5228 ac_cv_lib_Hcurses_initscr=no
5229 fi
5230 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5231 LIBS=$ac_check_lib_save_LIBS
5232 fi
5233 echo "$as_me:5233: result: $ac_cv_lib_Hcurses_initscr" >&5
5234 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5235 if test $ac_cv_lib_Hcurses_initscr = yes; then
5236
5237                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5238
5239 cf_add_libs="-lHcurses"
5240 # Filter out duplicates - this happens with badly-designed ".pc" files...
5241 for cf_add_1lib in $LIBS
5242 do
5243         for cf_add_2lib in $cf_add_libs
5244         do
5245                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5246                 then
5247                         cf_add_1lib=
5248                         break
5249                 fi
5250         done
5251         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5252 done
5253 LIBS="$cf_add_libs"
5254
5255                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5256                         ac_cv_func_initscr=yes
5257
5258 fi
5259
5260 fi
5261
5262         fi
5263         ;;
5264 (linux*)
5265         case `arch 2>/dev/null` in
5266         (x86_64)
5267                 if test -d /lib64
5268                 then
5269
5270 if test -n "/lib64" ; then
5271         for cf_add_libdir in /lib64
5272         do
5273                 if test $cf_add_libdir = /usr/lib ; then
5274                         :
5275                 elif test -d $cf_add_libdir
5276                 then
5277                         cf_have_libdir=no
5278                         if test -n "$LDFLAGS$LIBS" ; then
5279                                 # a loop is needed to ensure we can add subdirs of existing dirs
5280                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5281                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5282                                                 cf_have_libdir=yes; break
5283                                         fi
5284                                 done
5285                         fi
5286                         if test "$cf_have_libdir" = no ; then
5287                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5288
5289 echo "${as_me:-configure}:5289: testing adding $cf_add_libdir to library-path ..." 1>&5
5290
5291                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5292                         fi
5293                 fi
5294         done
5295 fi
5296
5297                 else
5298
5299 if test -n "/lib" ; then
5300         for cf_add_libdir in /lib
5301         do
5302                 if test $cf_add_libdir = /usr/lib ; then
5303                         :
5304                 elif test -d $cf_add_libdir
5305                 then
5306                         cf_have_libdir=no
5307                         if test -n "$LDFLAGS$LIBS" ; then
5308                                 # a loop is needed to ensure we can add subdirs of existing dirs
5309                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5310                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5311                                                 cf_have_libdir=yes; break
5312                                         fi
5313                                 done
5314                         fi
5315                         if test "$cf_have_libdir" = no ; then
5316                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5317
5318 echo "${as_me:-configure}:5318: testing adding $cf_add_libdir to library-path ..." 1>&5
5319
5320                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5321                         fi
5322                 fi
5323         done
5324 fi
5325
5326                 fi
5327                 ;;
5328         (*)
5329
5330 if test -n "/lib" ; then
5331         for cf_add_libdir in /lib
5332         do
5333                 if test $cf_add_libdir = /usr/lib ; then
5334                         :
5335                 elif test -d $cf_add_libdir
5336                 then
5337                         cf_have_libdir=no
5338                         if test -n "$LDFLAGS$LIBS" ; then
5339                                 # a loop is needed to ensure we can add subdirs of existing dirs
5340                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5341                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5342                                                 cf_have_libdir=yes; break
5343                                         fi
5344                                 done
5345                         fi
5346                         if test "$cf_have_libdir" = no ; then
5347                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5348
5349 echo "${as_me:-configure}:5349: testing adding $cf_add_libdir to library-path ..." 1>&5
5350
5351                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5352                         fi
5353                 fi
5354         done
5355 fi
5356
5357                 ;;
5358         esac
5359         ;;
5360 (sunos3*|sunos4*)
5361         if test "x$cf_cv_screen" = "xcurses_5lib"
5362         then
5363                 if test -d /usr/5lib ; then
5364
5365 if test -n "/usr/5lib" ; then
5366         for cf_add_libdir in /usr/5lib
5367         do
5368                 if test $cf_add_libdir = /usr/lib ; then
5369                         :
5370                 elif test -d $cf_add_libdir
5371                 then
5372                         cf_have_libdir=no
5373                         if test -n "$LDFLAGS$LIBS" ; then
5374                                 # a loop is needed to ensure we can add subdirs of existing dirs
5375                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5376                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5377                                                 cf_have_libdir=yes; break
5378                                         fi
5379                                 done
5380                         fi
5381                         if test "$cf_have_libdir" = no ; then
5382                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5383
5384 echo "${as_me:-configure}:5384: testing adding $cf_add_libdir to library-path ..." 1>&5
5385
5386                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5387                         fi
5388                 fi
5389         done
5390 fi
5391
5392 cf_add_libs="-lcurses -ltermcap"
5393 # Filter out duplicates - this happens with badly-designed ".pc" files...
5394 for cf_add_1lib in $LIBS
5395 do
5396         for cf_add_2lib in $cf_add_libs
5397         do
5398                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5399                 then
5400                         cf_add_1lib=
5401                         break
5402                 fi
5403         done
5404         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5405 done
5406 LIBS="$cf_add_libs"
5407
5408                 fi
5409         fi
5410         ac_cv_func_initscr=yes
5411         ;;
5412 esac
5413
5414 if test ".$ac_cv_func_initscr" != .yes ; then
5415         cf_save_LIBS="$LIBS"
5416
5417         if test ".${cf_cv_ncurses_version:-no}" != .no
5418         then
5419                 cf_check_list="ncurses curses cursesX"
5420         else
5421                 cf_check_list="cursesX curses ncurses"
5422         fi
5423
5424         # Check for library containing tgoto.  Do this before curses library
5425         # because it may be needed to link the test-case for initscr.
5426         if test "x$cf_term_lib" = x
5427         then
5428                 echo "$as_me:5428: checking for tgoto" >&5
5429 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5430 if test "${ac_cv_func_tgoto+set}" = set; then
5431   echo $ECHO_N "(cached) $ECHO_C" >&6
5432 else
5433   cat >conftest.$ac_ext <<_ACEOF
5434 #line 5434 "configure"
5435 #include "confdefs.h"
5436 /* System header to define __stub macros and hopefully few prototypes,
5437     which can conflict with char tgoto (); below.  */
5438 #include <assert.h>
5439 /* Override any gcc2 internal prototype to avoid an error.  */
5440 #ifdef __cplusplus
5441 extern "C"
5442 #endif
5443 /* We use char because int might match the return type of a gcc2
5444    builtin and then its argument prototype would still apply.  */
5445 char tgoto ();
5446 char (*f) ();
5447
5448 int
5449 main ()
5450 {
5451 /* The GNU C library defines this for functions which it implements
5452     to always fail with ENOSYS.  Some functions are actually named
5453     something starting with __ and the normal name is an alias.  */
5454 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5455 choke me
5456 #else
5457 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5458 #endif
5459
5460   ;
5461   return 0;
5462 }
5463 _ACEOF
5464 rm -f conftest.$ac_objext conftest$ac_exeext
5465 if { (eval echo "$as_me:5465: \"$ac_link\"") >&5
5466   (eval $ac_link) 2>&5
5467   ac_status=$?
5468   echo "$as_me:5468: \$? = $ac_status" >&5
5469   (exit $ac_status); } &&
5470          { ac_try='test -s conftest$ac_exeext'
5471   { (eval echo "$as_me:5471: \"$ac_try\"") >&5
5472   (eval $ac_try) 2>&5
5473   ac_status=$?
5474   echo "$as_me:5474: \$? = $ac_status" >&5
5475   (exit $ac_status); }; }; then
5476   ac_cv_func_tgoto=yes
5477 else
5478   echo "$as_me: failed program was:" >&5
5479 cat conftest.$ac_ext >&5
5480 ac_cv_func_tgoto=no
5481 fi
5482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5483 fi
5484 echo "$as_me:5484: result: $ac_cv_func_tgoto" >&5
5485 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5486 if test $ac_cv_func_tgoto = yes; then
5487   cf_term_lib=predefined
5488 else
5489
5490                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5491                         do
5492                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5493 echo "$as_me:5493: checking for tgoto in -l$cf_term_lib" >&5
5494 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5495 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5496   echo $ECHO_N "(cached) $ECHO_C" >&6
5497 else
5498   ac_check_lib_save_LIBS=$LIBS
5499 LIBS="-l$cf_term_lib  $LIBS"
5500 cat >conftest.$ac_ext <<_ACEOF
5501 #line 5501 "configure"
5502 #include "confdefs.h"
5503
5504 /* Override any gcc2 internal prototype to avoid an error.  */
5505 #ifdef __cplusplus
5506 extern "C"
5507 #endif
5508 /* We use char because int might match the return type of a gcc2
5509    builtin and then its argument prototype would still apply.  */
5510 char tgoto ();
5511 int
5512 main ()
5513 {
5514 tgoto ();
5515   ;
5516   return 0;
5517 }
5518 _ACEOF
5519 rm -f conftest.$ac_objext conftest$ac_exeext
5520 if { (eval echo "$as_me:5520: \"$ac_link\"") >&5
5521   (eval $ac_link) 2>&5
5522   ac_status=$?
5523   echo "$as_me:5523: \$? = $ac_status" >&5
5524   (exit $ac_status); } &&
5525          { ac_try='test -s conftest$ac_exeext'
5526   { (eval echo "$as_me:5526: \"$ac_try\"") >&5
5527   (eval $ac_try) 2>&5
5528   ac_status=$?
5529   echo "$as_me:5529: \$? = $ac_status" >&5
5530   (exit $ac_status); }; }; then
5531   eval "$as_ac_Lib=yes"
5532 else
5533   echo "$as_me: failed program was:" >&5
5534 cat conftest.$ac_ext >&5
5535 eval "$as_ac_Lib=no"
5536 fi
5537 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5538 LIBS=$ac_check_lib_save_LIBS
5539 fi
5540 echo "$as_me:5540: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5541 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5542 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5543   break
5544 fi
5545
5546                         done
5547
5548 fi
5549
5550         fi
5551
5552         # Check for library containing initscr
5553         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5554         if test "x$cf_curs_lib" = x
5555         then
5556                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5557                 do
5558                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5559 echo "$as_me:5559: checking for initscr in -l$cf_curs_lib" >&5
5560 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5561 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5562   echo $ECHO_N "(cached) $ECHO_C" >&6
5563 else
5564   ac_check_lib_save_LIBS=$LIBS
5565 LIBS="-l$cf_curs_lib  $LIBS"
5566 cat >conftest.$ac_ext <<_ACEOF
5567 #line 5567 "configure"
5568 #include "confdefs.h"
5569
5570 /* Override any gcc2 internal prototype to avoid an error.  */
5571 #ifdef __cplusplus
5572 extern "C"
5573 #endif
5574 /* We use char because int might match the return type of a gcc2
5575    builtin and then its argument prototype would still apply.  */
5576 char initscr ();
5577 int
5578 main ()
5579 {
5580 initscr ();
5581   ;
5582   return 0;
5583 }
5584 _ACEOF
5585 rm -f conftest.$ac_objext conftest$ac_exeext
5586 if { (eval echo "$as_me:5586: \"$ac_link\"") >&5
5587   (eval $ac_link) 2>&5
5588   ac_status=$?
5589   echo "$as_me:5589: \$? = $ac_status" >&5
5590   (exit $ac_status); } &&
5591          { ac_try='test -s conftest$ac_exeext'
5592   { (eval echo "$as_me:5592: \"$ac_try\"") >&5
5593   (eval $ac_try) 2>&5
5594   ac_status=$?
5595   echo "$as_me:5595: \$? = $ac_status" >&5
5596   (exit $ac_status); }; }; then
5597   eval "$as_ac_Lib=yes"
5598 else
5599   echo "$as_me: failed program was:" >&5
5600 cat conftest.$ac_ext >&5
5601 eval "$as_ac_Lib=no"
5602 fi
5603 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5604 LIBS=$ac_check_lib_save_LIBS
5605 fi
5606 echo "$as_me:5606: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5607 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5608 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5609   break
5610 fi
5611
5612                 done
5613         fi
5614         test $cf_curs_lib = unknown && { { echo "$as_me:5614: error: no curses library found" >&5
5615 echo "$as_me: error: no curses library found" >&2;}
5616    { (exit 1); exit 1; }; }
5617
5618         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5619         if test "$cf_term_lib" = unknown ; then
5620                 echo "$as_me:5620: checking if we can link with $cf_curs_lib library" >&5
5621 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5622                 cat >conftest.$ac_ext <<_ACEOF
5623 #line 5623 "configure"
5624 #include "confdefs.h"
5625 #include <${cf_cv_ncurses_header:-curses.h}>
5626 int
5627 main ()
5628 {
5629 initscr()
5630   ;
5631   return 0;
5632 }
5633 _ACEOF
5634 rm -f conftest.$ac_objext conftest$ac_exeext
5635 if { (eval echo "$as_me:5635: \"$ac_link\"") >&5
5636   (eval $ac_link) 2>&5
5637   ac_status=$?
5638   echo "$as_me:5638: \$? = $ac_status" >&5
5639   (exit $ac_status); } &&
5640          { ac_try='test -s conftest$ac_exeext'
5641   { (eval echo "$as_me:5641: \"$ac_try\"") >&5
5642   (eval $ac_try) 2>&5
5643   ac_status=$?
5644   echo "$as_me:5644: \$? = $ac_status" >&5
5645   (exit $ac_status); }; }; then
5646   cf_result=yes
5647 else
5648   echo "$as_me: failed program was:" >&5
5649 cat conftest.$ac_ext >&5
5650 cf_result=no
5651 fi
5652 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5653                 echo "$as_me:5653: result: $cf_result" >&5
5654 echo "${ECHO_T}$cf_result" >&6
5655                 test $cf_result = no && { { echo "$as_me:5655: error: Cannot link curses library" >&5
5656 echo "$as_me: error: Cannot link curses library" >&2;}
5657    { (exit 1); exit 1; }; }
5658         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5659                 :
5660         elif test "$cf_term_lib" != predefined ; then
5661                 echo "$as_me:5661: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5662 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5663                 cat >conftest.$ac_ext <<_ACEOF
5664 #line 5664 "configure"
5665 #include "confdefs.h"
5666 #include <${cf_cv_ncurses_header:-curses.h}>
5667 int
5668 main ()
5669 {
5670 initscr(); tgoto((char *)0, 0, 0);
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   cf_result=no
5688 else
5689   echo "$as_me: failed program was:" >&5
5690 cat conftest.$ac_ext >&5
5691
5692                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5693                         cat >conftest.$ac_ext <<_ACEOF
5694 #line 5694 "configure"
5695 #include "confdefs.h"
5696 #include <${cf_cv_ncurses_header:-curses.h}>
5697 int
5698 main ()
5699 {
5700 initscr()
5701   ;
5702   return 0;
5703 }
5704 _ACEOF
5705 rm -f conftest.$ac_objext conftest$ac_exeext
5706 if { (eval echo "$as_me:5706: \"$ac_link\"") >&5
5707   (eval $ac_link) 2>&5
5708   ac_status=$?
5709   echo "$as_me:5709: \$? = $ac_status" >&5
5710   (exit $ac_status); } &&
5711          { ac_try='test -s conftest$ac_exeext'
5712   { (eval echo "$as_me:5712: \"$ac_try\"") >&5
5713   (eval $ac_try) 2>&5
5714   ac_status=$?
5715   echo "$as_me:5715: \$? = $ac_status" >&5
5716   (exit $ac_status); }; }; then
5717   cf_result=yes
5718 else
5719   echo "$as_me: failed program was:" >&5
5720 cat conftest.$ac_ext >&5
5721 cf_result=error
5722 fi
5723 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5724
5725 fi
5726 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5727                 echo "$as_me:5727: result: $cf_result" >&5
5728 echo "${ECHO_T}$cf_result" >&6
5729         fi
5730 fi
5731 fi
5732
5733         ;;
5734 (ncursesw*)
5735
5736 echo "$as_me:5736: checking for multibyte character support" >&5
5737 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5738 if test "${cf_cv_utf8_lib+set}" = set; then
5739   echo $ECHO_N "(cached) $ECHO_C" >&6
5740 else
5741
5742         cf_save_LIBS="$LIBS"
5743         cat >conftest.$ac_ext <<_ACEOF
5744 #line 5744 "configure"
5745 #include "confdefs.h"
5746
5747 #include <stdlib.h>
5748 int
5749 main ()
5750 {
5751 putwc(0,0);
5752   ;
5753   return 0;
5754 }
5755 _ACEOF
5756 rm -f conftest.$ac_objext conftest$ac_exeext
5757 if { (eval echo "$as_me:5757: \"$ac_link\"") >&5
5758   (eval $ac_link) 2>&5
5759   ac_status=$?
5760   echo "$as_me:5760: \$? = $ac_status" >&5
5761   (exit $ac_status); } &&
5762          { ac_try='test -s conftest$ac_exeext'
5763   { (eval echo "$as_me:5763: \"$ac_try\"") >&5
5764   (eval $ac_try) 2>&5
5765   ac_status=$?
5766   echo "$as_me:5766: \$? = $ac_status" >&5
5767   (exit $ac_status); }; }; then
5768   cf_cv_utf8_lib=yes
5769 else
5770   echo "$as_me: failed program was:" >&5
5771 cat conftest.$ac_ext >&5
5772
5773 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5774 # will be set on completion of the AC_TRY_LINK below.
5775 cf_cv_header_path_utf8=
5776 cf_cv_library_path_utf8=
5777
5778 echo "${as_me:-configure}:5778: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5779
5780 cf_save_LIBS="$LIBS"
5781
5782 cat >conftest.$ac_ext <<_ACEOF
5783 #line 5783 "configure"
5784 #include "confdefs.h"
5785
5786 #include <libutf8.h>
5787 int
5788 main ()
5789 {
5790 putwc(0,0);
5791   ;
5792   return 0;
5793 }
5794 _ACEOF
5795 rm -f conftest.$ac_objext conftest$ac_exeext
5796 if { (eval echo "$as_me:5796: \"$ac_link\"") >&5
5797   (eval $ac_link) 2>&5
5798   ac_status=$?
5799   echo "$as_me:5799: \$? = $ac_status" >&5
5800   (exit $ac_status); } &&
5801          { ac_try='test -s conftest$ac_exeext'
5802   { (eval echo "$as_me:5802: \"$ac_try\"") >&5
5803   (eval $ac_try) 2>&5
5804   ac_status=$?
5805   echo "$as_me:5805: \$? = $ac_status" >&5
5806   (exit $ac_status); }; }; then
5807
5808         cf_cv_find_linkage_utf8=yes
5809         cf_cv_header_path_utf8=/usr/include
5810         cf_cv_library_path_utf8=/usr/lib
5811
5812 else
5813   echo "$as_me: failed program was:" >&5
5814 cat conftest.$ac_ext >&5
5815
5816 LIBS="-lutf8  $cf_save_LIBS"
5817
5818 cat >conftest.$ac_ext <<_ACEOF
5819 #line 5819 "configure"
5820 #include "confdefs.h"
5821
5822 #include <libutf8.h>
5823 int
5824 main ()
5825 {
5826 putwc(0,0);
5827   ;
5828   return 0;
5829 }
5830 _ACEOF
5831 rm -f conftest.$ac_objext conftest$ac_exeext
5832 if { (eval echo "$as_me:5832: \"$ac_link\"") >&5
5833   (eval $ac_link) 2>&5
5834   ac_status=$?
5835   echo "$as_me:5835: \$? = $ac_status" >&5
5836   (exit $ac_status); } &&
5837          { ac_try='test -s conftest$ac_exeext'
5838   { (eval echo "$as_me:5838: \"$ac_try\"") >&5
5839   (eval $ac_try) 2>&5
5840   ac_status=$?
5841   echo "$as_me:5841: \$? = $ac_status" >&5
5842   (exit $ac_status); }; }; then
5843
5844         cf_cv_find_linkage_utf8=yes
5845         cf_cv_header_path_utf8=/usr/include
5846         cf_cv_library_path_utf8=/usr/lib
5847         cf_cv_library_file_utf8="-lutf8"
5848
5849 else
5850   echo "$as_me: failed program was:" >&5
5851 cat conftest.$ac_ext >&5
5852
5853         cf_cv_find_linkage_utf8=no
5854         LIBS="$cf_save_LIBS"
5855
5856         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5857
5858 echo "${as_me:-configure}:5858: testing find linkage for utf8 library ..." 1>&5
5859
5860 echo "${as_me:-configure}:5860: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5861
5862         cf_save_CPPFLAGS="$CPPFLAGS"
5863         cf_test_CPPFLAGS="$CPPFLAGS"
5864
5865 cf_search=
5866
5867 # collect the current set of include-directories from compiler flags
5868 cf_header_path_list=""
5869 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5870         for cf_header_path in $CPPFLAGS $CFLAGS
5871         do
5872                 case $cf_header_path in
5873                 (-I*)
5874                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5875
5876 test "x$cf_header_path" != "xNONE" && \
5877 test -d "$cf_header_path" && \
5878  {
5879         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5880         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5881         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5882         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5883         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5884         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5885 }
5886
5887                         cf_header_path_list="$cf_header_path_list $cf_search"
5888                         ;;
5889                 esac
5890         done
5891 fi
5892
5893 # add the variations for the package we are looking for
5894
5895 cf_search=
5896
5897 test "x$prefix" != "xNONE" && \
5898 test -d "$prefix" && \
5899  {
5900         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5901         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5902         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5903         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5904         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5905         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5906 }
5907
5908 for cf_subdir_prefix in \
5909         /usr \
5910         /usr/local \
5911         /usr/pkg \
5912         /opt \
5913         /opt/local \
5914         $HOME
5915 do
5916
5917 test "x$cf_subdir_prefix" != "x$prefix" && \
5918 test -d "$cf_subdir_prefix" && \
5919 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5920         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5921         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5922         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5923         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5924         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5925         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5926 }
5927
5928 done
5929
5930 test "$includedir" != NONE && \
5931 test "$includedir" != "/usr/include" && \
5932 test -d "$includedir" && {
5933         test -d $includedir &&    cf_search="$cf_search $includedir"
5934         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5935 }
5936
5937 test "$oldincludedir" != NONE && \
5938 test "$oldincludedir" != "/usr/include" && \
5939 test -d "$oldincludedir" && {
5940         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5941         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5942 }
5943
5944 cf_search="$cf_search $cf_header_path_list"
5945
5946         for cf_cv_header_path_utf8 in $cf_search
5947         do
5948                 if test -d $cf_cv_header_path_utf8 ; then
5949                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5950
5951 echo "${as_me:-configure}:5951: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5952
5953                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5954                         cat >conftest.$ac_ext <<_ACEOF
5955 #line 5955 "configure"
5956 #include "confdefs.h"
5957
5958 #include <libutf8.h>
5959 int
5960 main ()
5961 {
5962 putwc(0,0);
5963   ;
5964   return 0;
5965 }
5966 _ACEOF
5967 rm -f conftest.$ac_objext
5968 if { (eval echo "$as_me:5968: \"$ac_compile\"") >&5
5969   (eval $ac_compile) 2>&5
5970   ac_status=$?
5971   echo "$as_me:5971: \$? = $ac_status" >&5
5972   (exit $ac_status); } &&
5973          { ac_try='test -s conftest.$ac_objext'
5974   { (eval echo "$as_me:5974: \"$ac_try\"") >&5
5975   (eval $ac_try) 2>&5
5976   ac_status=$?
5977   echo "$as_me:5977: \$? = $ac_status" >&5
5978   (exit $ac_status); }; }; then
5979
5980                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5981
5982 echo "${as_me:-configure}:5982: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5983
5984                                 cf_cv_find_linkage_utf8=maybe
5985                                 cf_test_CPPFLAGS="$CPPFLAGS"
5986                                 break
5987 else
5988   echo "$as_me: failed program was:" >&5
5989 cat conftest.$ac_ext >&5
5990
5991                                 CPPFLAGS="$cf_save_CPPFLAGS"
5992
5993 fi
5994 rm -f conftest.$ac_objext conftest.$ac_ext
5995                 fi
5996         done
5997
5998         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5999
6000 echo "${as_me:-configure}:6000: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6001
6002                 cf_save_LIBS="$LIBS"
6003                 cf_save_LDFLAGS="$LDFLAGS"
6004
6005                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6006
6007 cf_search=
6008 cf_library_path_list=""
6009 if test -n "${LDFLAGS}${LIBS}" ; then
6010         for cf_library_path in $LDFLAGS $LIBS
6011         do
6012                 case $cf_library_path in
6013                 (-L*)
6014                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6015
6016 test "x$cf_library_path" != "xNONE" && \
6017 test -d "$cf_library_path" && \
6018  {
6019         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6020         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6021         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6022         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6023         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6024         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6025 }
6026
6027                         cf_library_path_list="$cf_library_path_list $cf_search"
6028                         ;;
6029                 esac
6030         done
6031 fi
6032
6033 cf_search=
6034
6035 test "x$prefix" != "xNONE" && \
6036 test -d "$prefix" && \
6037  {
6038         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6039         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6040         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6041         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6042         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6043         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6044 }
6045
6046 for cf_subdir_prefix in \
6047         /usr \
6048         /usr/local \
6049         /usr/pkg \
6050         /opt \
6051         /opt/local \
6052         $HOME
6053 do
6054
6055 test "x$cf_subdir_prefix" != "x$prefix" && \
6056 test -d "$cf_subdir_prefix" && \
6057 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6058         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6059         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6060         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6061         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6062         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6063         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6064 }
6065
6066 done
6067
6068 cf_search="$cf_library_path_list $cf_search"
6069
6070                         for cf_cv_library_path_utf8 in $cf_search
6071                         do
6072                                 if test -d $cf_cv_library_path_utf8 ; then
6073                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6074
6075 echo "${as_me:-configure}:6075: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6076
6077                                         CPPFLAGS="$cf_test_CPPFLAGS"
6078                                         LIBS="-lutf8  $cf_save_LIBS"
6079                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6080                                         cat >conftest.$ac_ext <<_ACEOF
6081 #line 6081 "configure"
6082 #include "confdefs.h"
6083
6084 #include <libutf8.h>
6085 int
6086 main ()
6087 {
6088 putwc(0,0);
6089   ;
6090   return 0;
6091 }
6092 _ACEOF
6093 rm -f conftest.$ac_objext conftest$ac_exeext
6094 if { (eval echo "$as_me:6094: \"$ac_link\"") >&5
6095   (eval $ac_link) 2>&5
6096   ac_status=$?
6097   echo "$as_me:6097: \$? = $ac_status" >&5
6098   (exit $ac_status); } &&
6099          { ac_try='test -s conftest$ac_exeext'
6100   { (eval echo "$as_me:6100: \"$ac_try\"") >&5
6101   (eval $ac_try) 2>&5
6102   ac_status=$?
6103   echo "$as_me:6103: \$? = $ac_status" >&5
6104   (exit $ac_status); }; }; then
6105
6106                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6107
6108 echo "${as_me:-configure}:6108: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6109
6110                                         cf_cv_find_linkage_utf8=yes
6111                                         cf_cv_library_file_utf8="-lutf8"
6112                                         break
6113 else
6114   echo "$as_me: failed program was:" >&5
6115 cat conftest.$ac_ext >&5
6116
6117                                         CPPFLAGS="$cf_save_CPPFLAGS"
6118                                         LIBS="$cf_save_LIBS"
6119                                         LDFLAGS="$cf_save_LDFLAGS"
6120
6121 fi
6122 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6123                                 fi
6124                         done
6125                         CPPFLAGS="$cf_save_CPPFLAGS"
6126                         LDFLAGS="$cf_save_LDFLAGS"
6127                 fi
6128
6129         else
6130                 cf_cv_find_linkage_utf8=no
6131         fi
6132
6133 fi
6134 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6135
6136 fi
6137 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6138
6139 LIBS="$cf_save_LIBS"
6140
6141 if test "$cf_cv_find_linkage_utf8" = yes ; then
6142 cf_cv_utf8_lib=add-on
6143 else
6144 cf_cv_utf8_lib=no
6145 fi
6146
6147 fi
6148 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6149 fi
6150 echo "$as_me:6150: result: $cf_cv_utf8_lib" >&5
6151 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6152
6153 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6154 # ncurses/ncursesw:
6155 if test "$cf_cv_utf8_lib" = "add-on" ; then
6156
6157 cat >>confdefs.h <<\EOF
6158 #define HAVE_LIBUTF8_H 1
6159 EOF
6160
6161 if test -n "$cf_cv_header_path_utf8" ; then
6162   for cf_add_incdir in $cf_cv_header_path_utf8
6163   do
6164         while test $cf_add_incdir != /usr/include
6165         do
6166           if test -d $cf_add_incdir
6167           then
6168                 cf_have_incdir=no
6169                 if test -n "$CFLAGS$CPPFLAGS" ; then
6170                   # a loop is needed to ensure we can add subdirs of existing dirs
6171                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6172                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6173                           cf_have_incdir=yes; break
6174                         fi
6175                   done
6176                 fi
6177
6178                 if test "$cf_have_incdir" = no ; then
6179                   if test "$cf_add_incdir" = /usr/local/include ; then
6180                         if test "$GCC" = yes
6181                         then
6182                           cf_save_CPPFLAGS=$CPPFLAGS
6183                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6184                           cat >conftest.$ac_ext <<_ACEOF
6185 #line 6185 "configure"
6186 #include "confdefs.h"
6187 #include <stdio.h>
6188 int
6189 main ()
6190 {
6191 printf("Hello")
6192   ;
6193   return 0;
6194 }
6195 _ACEOF
6196 rm -f conftest.$ac_objext
6197 if { (eval echo "$as_me:6197: \"$ac_compile\"") >&5
6198   (eval $ac_compile) 2>&5
6199   ac_status=$?
6200   echo "$as_me:6200: \$? = $ac_status" >&5
6201   (exit $ac_status); } &&
6202          { ac_try='test -s conftest.$ac_objext'
6203   { (eval echo "$as_me:6203: \"$ac_try\"") >&5
6204   (eval $ac_try) 2>&5
6205   ac_status=$?
6206   echo "$as_me:6206: \$? = $ac_status" >&5
6207   (exit $ac_status); }; }; then
6208   :
6209 else
6210   echo "$as_me: failed program was:" >&5
6211 cat conftest.$ac_ext >&5
6212 cf_have_incdir=yes
6213 fi
6214 rm -f conftest.$ac_objext conftest.$ac_ext
6215                           CPPFLAGS=$cf_save_CPPFLAGS
6216                         fi
6217                   fi
6218                 fi
6219
6220                 if test "$cf_have_incdir" = no ; then
6221                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6222
6223 echo "${as_me:-configure}:6223: testing adding $cf_add_incdir to include-path ..." 1>&5
6224
6225                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6226
6227                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6228                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6229                   cf_add_incdir="$cf_top_incdir"
6230                 else
6231                   break
6232                 fi
6233           else
6234                 break
6235           fi
6236         done
6237   done
6238 fi
6239
6240 if test -n "$cf_cv_library_path_utf8" ; then
6241         for cf_add_libdir in $cf_cv_library_path_utf8
6242         do
6243                 if test $cf_add_libdir = /usr/lib ; then
6244                         :
6245                 elif test -d $cf_add_libdir
6246                 then
6247                         cf_have_libdir=no
6248                         if test -n "$LDFLAGS$LIBS" ; then
6249                                 # a loop is needed to ensure we can add subdirs of existing dirs
6250                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6251                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6252                                                 cf_have_libdir=yes; break
6253                                         fi
6254                                 done
6255                         fi
6256                         if test "$cf_have_libdir" = no ; then
6257                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6258
6259 echo "${as_me:-configure}:6259: testing adding $cf_add_libdir to library-path ..." 1>&5
6260
6261                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6262                         fi
6263                 fi
6264         done
6265 fi
6266
6267 cf_add_libs="$cf_cv_library_file_utf8"
6268 # Filter out duplicates - this happens with badly-designed ".pc" files...
6269 for cf_add_1lib in $LIBS
6270 do
6271         for cf_add_2lib in $cf_add_libs
6272         do
6273                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6274                 then
6275                         cf_add_1lib=
6276                         break
6277                 fi
6278         done
6279         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6280 done
6281 LIBS="$cf_add_libs"
6282
6283 fi
6284
6285 cf_ncuconfig_root=$cf_cv_screen
6286 cf_have_ncuconfig=no
6287
6288 if test "x${PKG_CONFIG:=none}" != xnone; then
6289         echo "$as_me:6289: checking pkg-config for $cf_ncuconfig_root" >&5
6290 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6291         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6292                 echo "$as_me:6292: result: yes" >&5
6293 echo "${ECHO_T}yes" >&6
6294
6295                 echo "$as_me:6295: checking if the $cf_ncuconfig_root package files work" >&5
6296 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6297                 cf_have_ncuconfig=unknown
6298
6299                 cf_save_CPPFLAGS="$CPPFLAGS"
6300                 cf_save_LIBS="$LIBS"
6301
6302                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6303
6304 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6305 # Filter out duplicates - this happens with badly-designed ".pc" files...
6306 for cf_add_1lib in $LIBS
6307 do
6308         for cf_add_2lib in $cf_add_libs
6309         do
6310                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6311                 then
6312                         cf_add_1lib=
6313                         break
6314                 fi
6315         done
6316         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6317 done
6318 LIBS="$cf_add_libs"
6319
6320                 cat >conftest.$ac_ext <<_ACEOF
6321 #line 6321 "configure"
6322 #include "confdefs.h"
6323 #include <${cf_cv_ncurses_header:-curses.h}>
6324 int
6325 main ()
6326 {
6327 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6328   ;
6329   return 0;
6330 }
6331 _ACEOF
6332 rm -f conftest.$ac_objext conftest$ac_exeext
6333 if { (eval echo "$as_me:6333: \"$ac_link\"") >&5
6334   (eval $ac_link) 2>&5
6335   ac_status=$?
6336   echo "$as_me:6336: \$? = $ac_status" >&5
6337   (exit $ac_status); } &&
6338          { ac_try='test -s conftest$ac_exeext'
6339   { (eval echo "$as_me:6339: \"$ac_try\"") >&5
6340   (eval $ac_try) 2>&5
6341   ac_status=$?
6342   echo "$as_me:6342: \$? = $ac_status" >&5
6343   (exit $ac_status); }; }; then
6344   if test "$cross_compiling" = yes; then
6345   cf_have_ncuconfig=maybe
6346 else
6347   cat >conftest.$ac_ext <<_ACEOF
6348 #line 6348 "configure"
6349 #include "confdefs.h"
6350 #include <${cf_cv_ncurses_header:-curses.h}>
6351                                 int main(void)
6352                                 { char *xx = curses_version(); return (xx == 0); }
6353 _ACEOF
6354 rm -f conftest$ac_exeext
6355 if { (eval echo "$as_me:6355: \"$ac_link\"") >&5
6356   (eval $ac_link) 2>&5
6357   ac_status=$?
6358   echo "$as_me:6358: \$? = $ac_status" >&5
6359   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6360   { (eval echo "$as_me:6360: \"$ac_try\"") >&5
6361   (eval $ac_try) 2>&5
6362   ac_status=$?
6363   echo "$as_me:6363: \$? = $ac_status" >&5
6364   (exit $ac_status); }; }; then
6365   cf_have_ncuconfig=yes
6366 else
6367   echo "$as_me: program exited with status $ac_status" >&5
6368 echo "$as_me: failed program was:" >&5
6369 cat conftest.$ac_ext >&5
6370 cf_have_ncuconfig=no
6371 fi
6372 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6373 fi
6374 else
6375   echo "$as_me: failed program was:" >&5
6376 cat conftest.$ac_ext >&5
6377 cf_have_ncuconfig=no
6378 fi
6379 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6380                 echo "$as_me:6380: result: $cf_have_ncuconfig" >&5
6381 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6382                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6383                 if test "$cf_have_ncuconfig" != "yes"
6384                 then
6385                         CPPFLAGS="$cf_save_CPPFLAGS"
6386                         LIBS="$cf_save_LIBS"
6387                         NCURSES_CONFIG_PKG=none
6388                 else
6389
6390 cat >>confdefs.h <<\EOF
6391 #define NCURSES 1
6392 EOF
6393
6394                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6395                 fi
6396
6397         else
6398                 echo "$as_me:6398: result: no" >&5
6399 echo "${ECHO_T}no" >&6
6400                 NCURSES_CONFIG_PKG=none
6401         fi
6402 else
6403         NCURSES_CONFIG_PKG=none
6404 fi
6405
6406 if test "x$cf_have_ncuconfig" = "xno"; then
6407         echo "Looking for ${cf_ncuconfig_root}-config"
6408
6409 if test -n "$ac_tool_prefix"; then
6410   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6411   do
6412     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6413 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6414 echo "$as_me:6414: checking for $ac_word" >&5
6415 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6416 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6417   echo $ECHO_N "(cached) $ECHO_C" >&6
6418 else
6419   if test -n "$NCURSES_CONFIG"; then
6420   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6421 else
6422   ac_save_IFS=$IFS; IFS=$ac_path_separator
6423 ac_dummy="$PATH"
6424 for ac_dir in $ac_dummy; do
6425   IFS=$ac_save_IFS
6426   test -z "$ac_dir" && ac_dir=.
6427   $as_executable_p "$ac_dir/$ac_word" || continue
6428 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6429 echo "$as_me:6429: found $ac_dir/$ac_word" >&5
6430 break
6431 done
6432
6433 fi
6434 fi
6435 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6436 if test -n "$NCURSES_CONFIG"; then
6437   echo "$as_me:6437: result: $NCURSES_CONFIG" >&5
6438 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6439 else
6440   echo "$as_me:6440: result: no" >&5
6441 echo "${ECHO_T}no" >&6
6442 fi
6443
6444     test -n "$NCURSES_CONFIG" && break
6445   done
6446 fi
6447 if test -z "$NCURSES_CONFIG"; then
6448   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6449   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6450 do
6451   # Extract the first word of "$ac_prog", so it can be a program name with args.
6452 set dummy $ac_prog; ac_word=$2
6453 echo "$as_me:6453: checking for $ac_word" >&5
6454 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6455 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6456   echo $ECHO_N "(cached) $ECHO_C" >&6
6457 else
6458   if test -n "$ac_ct_NCURSES_CONFIG"; then
6459   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6460 else
6461   ac_save_IFS=$IFS; IFS=$ac_path_separator
6462 ac_dummy="$PATH"
6463 for ac_dir in $ac_dummy; do
6464   IFS=$ac_save_IFS
6465   test -z "$ac_dir" && ac_dir=.
6466   $as_executable_p "$ac_dir/$ac_word" || continue
6467 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6468 echo "$as_me:6468: found $ac_dir/$ac_word" >&5
6469 break
6470 done
6471
6472 fi
6473 fi
6474 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6475 if test -n "$ac_ct_NCURSES_CONFIG"; then
6476   echo "$as_me:6476: result: $ac_ct_NCURSES_CONFIG" >&5
6477 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6478 else
6479   echo "$as_me:6479: result: no" >&5
6480 echo "${ECHO_T}no" >&6
6481 fi
6482
6483   test -n "$ac_ct_NCURSES_CONFIG" && break
6484 done
6485 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6486
6487   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6488 fi
6489
6490         if test "$NCURSES_CONFIG" != none ; then
6491
6492                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6493
6494 cf_add_libs="`$NCURSES_CONFIG --libs`"
6495 # Filter out duplicates - this happens with badly-designed ".pc" files...
6496 for cf_add_1lib in $LIBS
6497 do
6498         for cf_add_2lib in $cf_add_libs
6499         do
6500                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6501                 then
6502                         cf_add_1lib=
6503                         break
6504                 fi
6505         done
6506         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6507 done
6508 LIBS="$cf_add_libs"
6509
6510                 # even with config script, some packages use no-override for curses.h
6511
6512 echo "$as_me:6512: checking if we have identified curses headers" >&5
6513 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6514 if test "${cf_cv_ncurses_header+set}" = set; then
6515   echo $ECHO_N "(cached) $ECHO_C" >&6
6516 else
6517
6518 cf_cv_ncurses_header=none
6519 for cf_header in \
6520         ncurses.h $cf_cv_screen/ncurses.h \
6521         curses.h $cf_cv_screen/curses.h
6522 do
6523 cat >conftest.$ac_ext <<_ACEOF
6524 #line 6524 "configure"
6525 #include "confdefs.h"
6526 #include <${cf_header}>
6527 int
6528 main ()
6529 {
6530 initscr(); tgoto("?", 0,0)
6531   ;
6532   return 0;
6533 }
6534 _ACEOF
6535 rm -f conftest.$ac_objext
6536 if { (eval echo "$as_me:6536: \"$ac_compile\"") >&5
6537   (eval $ac_compile) 2>&5
6538   ac_status=$?
6539   echo "$as_me:6539: \$? = $ac_status" >&5
6540   (exit $ac_status); } &&
6541          { ac_try='test -s conftest.$ac_objext'
6542   { (eval echo "$as_me:6542: \"$ac_try\"") >&5
6543   (eval $ac_try) 2>&5
6544   ac_status=$?
6545   echo "$as_me:6545: \$? = $ac_status" >&5
6546   (exit $ac_status); }; }; then
6547   cf_cv_ncurses_header=$cf_header; break
6548 else
6549   echo "$as_me: failed program was:" >&5
6550 cat conftest.$ac_ext >&5
6551 fi
6552 rm -f conftest.$ac_objext conftest.$ac_ext
6553 done
6554
6555 fi
6556 echo "$as_me:6556: result: $cf_cv_ncurses_header" >&5
6557 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6558
6559 if test "$cf_cv_ncurses_header" = none ; then
6560         { { echo "$as_me:6560: error: No curses header-files found" >&5
6561 echo "$as_me: error: No curses header-files found" >&2;}
6562    { (exit 1); exit 1; }; }
6563 fi
6564
6565 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6566
6567 for ac_header in $cf_cv_ncurses_header
6568 do
6569 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6570 echo "$as_me:6570: checking for $ac_header" >&5
6571 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6572 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6573   echo $ECHO_N "(cached) $ECHO_C" >&6
6574 else
6575   cat >conftest.$ac_ext <<_ACEOF
6576 #line 6576 "configure"
6577 #include "confdefs.h"
6578 #include <$ac_header>
6579 _ACEOF
6580 if { (eval echo "$as_me:6580: \"$ac_cpp conftest.$ac_ext\"") >&5
6581   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6582   ac_status=$?
6583   egrep -v '^ *\+' conftest.er1 >conftest.err
6584   rm -f conftest.er1
6585   cat conftest.err >&5
6586   echo "$as_me:6586: \$? = $ac_status" >&5
6587   (exit $ac_status); } >/dev/null; then
6588   if test -s conftest.err; then
6589     ac_cpp_err=$ac_c_preproc_warn_flag
6590   else
6591     ac_cpp_err=
6592   fi
6593 else
6594   ac_cpp_err=yes
6595 fi
6596 if test -z "$ac_cpp_err"; then
6597   eval "$as_ac_Header=yes"
6598 else
6599   echo "$as_me: failed program was:" >&5
6600   cat conftest.$ac_ext >&5
6601   eval "$as_ac_Header=no"
6602 fi
6603 rm -f conftest.err conftest.$ac_ext
6604 fi
6605 echo "$as_me:6605: result: `eval echo '${'$as_ac_Header'}'`" >&5
6606 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6607 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6608   cat >>confdefs.h <<EOF
6609 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6610 EOF
6611
6612 fi
6613 done
6614
6615 cat >>confdefs.h <<\EOF
6616 #define NCURSES 1
6617 EOF
6618
6619 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6620
6621                 cat >>confdefs.h <<EOF
6622 #define $cf_nculib_ROOT 1
6623 EOF
6624
6625                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6626
6627         else
6628
6629 cf_ncuhdr_root=$cf_cv_screen
6630
6631 test -n "$cf_cv_curses_dir" && \
6632 test "$cf_cv_curses_dir" != "no" && { \
6633
6634 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6635   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6636   do
6637         while test $cf_add_incdir != /usr/include
6638         do
6639           if test -d $cf_add_incdir
6640           then
6641                 cf_have_incdir=no
6642                 if test -n "$CFLAGS$CPPFLAGS" ; then
6643                   # a loop is needed to ensure we can add subdirs of existing dirs
6644                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6645                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6646                           cf_have_incdir=yes; break
6647                         fi
6648                   done
6649                 fi
6650
6651                 if test "$cf_have_incdir" = no ; then
6652                   if test "$cf_add_incdir" = /usr/local/include ; then
6653                         if test "$GCC" = yes
6654                         then
6655                           cf_save_CPPFLAGS=$CPPFLAGS
6656                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6657                           cat >conftest.$ac_ext <<_ACEOF
6658 #line 6658 "configure"
6659 #include "confdefs.h"
6660 #include <stdio.h>
6661 int
6662 main ()
6663 {
6664 printf("Hello")
6665   ;
6666   return 0;
6667 }
6668 _ACEOF
6669 rm -f conftest.$ac_objext
6670 if { (eval echo "$as_me:6670: \"$ac_compile\"") >&5
6671   (eval $ac_compile) 2>&5
6672   ac_status=$?
6673   echo "$as_me:6673: \$? = $ac_status" >&5
6674   (exit $ac_status); } &&
6675          { ac_try='test -s conftest.$ac_objext'
6676   { (eval echo "$as_me:6676: \"$ac_try\"") >&5
6677   (eval $ac_try) 2>&5
6678   ac_status=$?
6679   echo "$as_me:6679: \$? = $ac_status" >&5
6680   (exit $ac_status); }; }; then
6681   :
6682 else
6683   echo "$as_me: failed program was:" >&5
6684 cat conftest.$ac_ext >&5
6685 cf_have_incdir=yes
6686 fi
6687 rm -f conftest.$ac_objext conftest.$ac_ext
6688                           CPPFLAGS=$cf_save_CPPFLAGS
6689                         fi
6690                   fi
6691                 fi
6692
6693                 if test "$cf_have_incdir" = no ; then
6694                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6695
6696 echo "${as_me:-configure}:6696: testing adding $cf_add_incdir to include-path ..." 1>&5
6697
6698                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6699
6700                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6701                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6702                   cf_add_incdir="$cf_top_incdir"
6703                 else
6704                   break
6705                 fi
6706           else
6707                 break
6708           fi
6709         done
6710   done
6711 fi
6712
6713 }
6714
6715 echo "$as_me:6715: checking for $cf_ncuhdr_root header in include-path" >&5
6716 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6717 if test "${cf_cv_ncurses_h+set}" = set; then
6718   echo $ECHO_N "(cached) $ECHO_C" >&6
6719 else
6720
6721         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6722         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6723         for cf_header in $cf_header_list
6724         do
6725
6726         cat >conftest.$ac_ext <<_ACEOF
6727 #line 6727 "configure"
6728 #include "confdefs.h"
6729
6730 #include <$cf_header>
6731 int
6732 main ()
6733 {
6734
6735 #ifdef NCURSES_VERSION
6736
6737 printf("%s\n", NCURSES_VERSION);
6738 #else
6739 #ifdef __NCURSES_H
6740 printf("old\n");
6741 #else
6742         make an error
6743 #endif
6744 #endif
6745
6746   ;
6747   return 0;
6748 }
6749 _ACEOF
6750 rm -f conftest.$ac_objext
6751 if { (eval echo "$as_me:6751: \"$ac_compile\"") >&5
6752   (eval $ac_compile) 2>&5
6753   ac_status=$?
6754   echo "$as_me:6754: \$? = $ac_status" >&5
6755   (exit $ac_status); } &&
6756          { ac_try='test -s conftest.$ac_objext'
6757   { (eval echo "$as_me:6757: \"$ac_try\"") >&5
6758   (eval $ac_try) 2>&5
6759   ac_status=$?
6760   echo "$as_me:6760: \$? = $ac_status" >&5
6761   (exit $ac_status); }; }; then
6762   cf_cv_ncurses_h=$cf_header
6763
6764 else
6765   echo "$as_me: failed program was:" >&5
6766 cat conftest.$ac_ext >&5
6767 cf_cv_ncurses_h=no
6768 fi
6769 rm -f conftest.$ac_objext conftest.$ac_ext
6770
6771                 test "$cf_cv_ncurses_h" != no && break
6772         done
6773
6774 fi
6775 echo "$as_me:6775: result: $cf_cv_ncurses_h" >&5
6776 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6777
6778 if test "$cf_cv_ncurses_h" != no ; then
6779         cf_cv_ncurses_header=$cf_cv_ncurses_h
6780 else
6781
6782 echo "$as_me:6782: checking for $cf_ncuhdr_root include-path" >&5
6783 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6784 if test "${cf_cv_ncurses_h2+set}" = set; then
6785   echo $ECHO_N "(cached) $ECHO_C" >&6
6786 else
6787
6788         test -n "$verbose" && echo
6789
6790 cf_search=
6791
6792 # collect the current set of include-directories from compiler flags
6793 cf_header_path_list=""
6794 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6795         for cf_header_path in $CPPFLAGS $CFLAGS
6796         do
6797                 case $cf_header_path in
6798                 (-I*)
6799                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6800
6801 test "x$cf_header_path" != "xNONE" && \
6802 test -d "$cf_header_path" && \
6803  {
6804         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6805         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6806         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6807         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6808         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6809         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"
6810 }
6811
6812                         cf_header_path_list="$cf_header_path_list $cf_search"
6813                         ;;
6814                 esac
6815         done
6816 fi
6817
6818 # add the variations for the package we are looking for
6819
6820 cf_search=
6821
6822 test "x$prefix" != "xNONE" && \
6823 test -d "$prefix" && \
6824  {
6825         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6826         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6827         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6828         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6829         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6830         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6831 }
6832
6833 for cf_subdir_prefix in \
6834         /usr \
6835         /usr/local \
6836         /usr/pkg \
6837         /opt \
6838         /opt/local \
6839         $HOME
6840 do
6841
6842 test "x$cf_subdir_prefix" != "x$prefix" && \
6843 test -d "$cf_subdir_prefix" && \
6844 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6845         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6846         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6847         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6848         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6849         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6850         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"
6851 }
6852
6853 done
6854
6855 test "$includedir" != NONE && \
6856 test "$includedir" != "/usr/include" && \
6857 test -d "$includedir" && {
6858         test -d $includedir &&    cf_search="$cf_search $includedir"
6859         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6860 }
6861
6862 test "$oldincludedir" != NONE && \
6863 test "$oldincludedir" != "/usr/include" && \
6864 test -d "$oldincludedir" && {
6865         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6866         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6867 }
6868
6869 cf_search="$cf_search $cf_header_path_list"
6870
6871         test -n "$verbose" && echo search path $cf_search
6872         cf_save2_CPPFLAGS="$CPPFLAGS"
6873         for cf_incdir in $cf_search
6874         do
6875
6876 if test -n "$cf_incdir" ; then
6877   for cf_add_incdir in $cf_incdir
6878   do
6879         while test $cf_add_incdir != /usr/include
6880         do
6881           if test -d $cf_add_incdir
6882           then
6883                 cf_have_incdir=no
6884                 if test -n "$CFLAGS$CPPFLAGS" ; then
6885                   # a loop is needed to ensure we can add subdirs of existing dirs
6886                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6887                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6888                           cf_have_incdir=yes; break
6889                         fi
6890                   done
6891                 fi
6892
6893                 if test "$cf_have_incdir" = no ; then
6894                   if test "$cf_add_incdir" = /usr/local/include ; then
6895                         if test "$GCC" = yes
6896                         then
6897                           cf_save_CPPFLAGS=$CPPFLAGS
6898                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6899                           cat >conftest.$ac_ext <<_ACEOF
6900 #line 6900 "configure"
6901 #include "confdefs.h"
6902 #include <stdio.h>
6903 int
6904 main ()
6905 {
6906 printf("Hello")
6907   ;
6908   return 0;
6909 }
6910 _ACEOF
6911 rm -f conftest.$ac_objext
6912 if { (eval echo "$as_me:6912: \"$ac_compile\"") >&5
6913   (eval $ac_compile) 2>&5
6914   ac_status=$?
6915   echo "$as_me:6915: \$? = $ac_status" >&5
6916   (exit $ac_status); } &&
6917          { ac_try='test -s conftest.$ac_objext'
6918   { (eval echo "$as_me:6918: \"$ac_try\"") >&5
6919   (eval $ac_try) 2>&5
6920   ac_status=$?
6921   echo "$as_me:6921: \$? = $ac_status" >&5
6922   (exit $ac_status); }; }; then
6923   :
6924 else
6925   echo "$as_me: failed program was:" >&5
6926 cat conftest.$ac_ext >&5
6927 cf_have_incdir=yes
6928 fi
6929 rm -f conftest.$ac_objext conftest.$ac_ext
6930                           CPPFLAGS=$cf_save_CPPFLAGS
6931                         fi
6932                   fi
6933                 fi
6934
6935                 if test "$cf_have_incdir" = no ; then
6936                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6937
6938 echo "${as_me:-configure}:6938: testing adding $cf_add_incdir to include-path ..." 1>&5
6939
6940                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6941
6942                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6943                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6944                   cf_add_incdir="$cf_top_incdir"
6945                 else
6946                   break
6947                 fi
6948           else
6949                 break
6950           fi
6951         done
6952   done
6953 fi
6954
6955                 for cf_header in \
6956                         ncurses.h \
6957                         curses.h
6958                 do
6959
6960         cat >conftest.$ac_ext <<_ACEOF
6961 #line 6961 "configure"
6962 #include "confdefs.h"
6963
6964 #include <$cf_header>
6965 int
6966 main ()
6967 {
6968
6969 #ifdef NCURSES_VERSION
6970
6971 printf("%s\n", NCURSES_VERSION);
6972 #else
6973 #ifdef __NCURSES_H
6974 printf("old\n");
6975 #else
6976         make an error
6977 #endif
6978 #endif
6979
6980   ;
6981   return 0;
6982 }
6983 _ACEOF
6984 rm -f conftest.$ac_objext
6985 if { (eval echo "$as_me:6985: \"$ac_compile\"") >&5
6986   (eval $ac_compile) 2>&5
6987   ac_status=$?
6988   echo "$as_me:6988: \$? = $ac_status" >&5
6989   (exit $ac_status); } &&
6990          { ac_try='test -s conftest.$ac_objext'
6991   { (eval echo "$as_me:6991: \"$ac_try\"") >&5
6992   (eval $ac_try) 2>&5
6993   ac_status=$?
6994   echo "$as_me:6994: \$? = $ac_status" >&5
6995   (exit $ac_status); }; }; then
6996   cf_cv_ncurses_h2=$cf_header
6997
6998 else
6999   echo "$as_me: failed program was:" >&5
7000 cat conftest.$ac_ext >&5
7001 cf_cv_ncurses_h2=no
7002 fi
7003 rm -f conftest.$ac_objext conftest.$ac_ext
7004
7005                         if test "$cf_cv_ncurses_h2" != no ; then
7006                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7007                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7008                                 break
7009                         fi
7010                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7011                 done
7012                 CPPFLAGS="$cf_save2_CPPFLAGS"
7013                 test "$cf_cv_ncurses_h2" != no && break
7014         done
7015         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7015: error: not found" >&5
7016 echo "$as_me: error: not found" >&2;}
7017    { (exit 1); exit 1; }; }
7018
7019 fi
7020 echo "$as_me:7020: result: $cf_cv_ncurses_h2" >&5
7021 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7022
7023         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7024         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7025         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7026                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7027         fi
7028
7029 if test -n "$cf_1st_incdir" ; then
7030   for cf_add_incdir in $cf_1st_incdir
7031   do
7032         while test $cf_add_incdir != /usr/include
7033         do
7034           if test -d $cf_add_incdir
7035           then
7036                 cf_have_incdir=no
7037                 if test -n "$CFLAGS$CPPFLAGS" ; then
7038                   # a loop is needed to ensure we can add subdirs of existing dirs
7039                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7040                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7041                           cf_have_incdir=yes; break
7042                         fi
7043                   done
7044                 fi
7045
7046                 if test "$cf_have_incdir" = no ; then
7047                   if test "$cf_add_incdir" = /usr/local/include ; then
7048                         if test "$GCC" = yes
7049                         then
7050                           cf_save_CPPFLAGS=$CPPFLAGS
7051                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7052                           cat >conftest.$ac_ext <<_ACEOF
7053 #line 7053 "configure"
7054 #include "confdefs.h"
7055 #include <stdio.h>
7056 int
7057 main ()
7058 {
7059 printf("Hello")
7060   ;
7061   return 0;
7062 }
7063 _ACEOF
7064 rm -f conftest.$ac_objext
7065 if { (eval echo "$as_me:7065: \"$ac_compile\"") >&5
7066   (eval $ac_compile) 2>&5
7067   ac_status=$?
7068   echo "$as_me:7068: \$? = $ac_status" >&5
7069   (exit $ac_status); } &&
7070          { ac_try='test -s conftest.$ac_objext'
7071   { (eval echo "$as_me:7071: \"$ac_try\"") >&5
7072   (eval $ac_try) 2>&5
7073   ac_status=$?
7074   echo "$as_me:7074: \$? = $ac_status" >&5
7075   (exit $ac_status); }; }; then
7076   :
7077 else
7078   echo "$as_me: failed program was:" >&5
7079 cat conftest.$ac_ext >&5
7080 cf_have_incdir=yes
7081 fi
7082 rm -f conftest.$ac_objext conftest.$ac_ext
7083                           CPPFLAGS=$cf_save_CPPFLAGS
7084                         fi
7085                   fi
7086                 fi
7087
7088                 if test "$cf_have_incdir" = no ; then
7089                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7090
7091 echo "${as_me:-configure}:7091: testing adding $cf_add_incdir to include-path ..." 1>&5
7092
7093                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7094
7095                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7096                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7097                   cf_add_incdir="$cf_top_incdir"
7098                 else
7099                   break
7100                 fi
7101           else
7102                 break
7103           fi
7104         done
7105   done
7106 fi
7107
7108 fi
7109
7110 # Set definitions to allow ifdef'ing for ncurses.h
7111
7112 case $cf_cv_ncurses_header in
7113 (*ncurses.h)
7114
7115 cat >>confdefs.h <<\EOF
7116 #define HAVE_NCURSES_H 1
7117 EOF
7118
7119         ;;
7120 esac
7121
7122 case $cf_cv_ncurses_header in
7123 (ncurses/curses.h|ncurses/ncurses.h)
7124
7125 cat >>confdefs.h <<\EOF
7126 #define HAVE_NCURSES_NCURSES_H 1
7127 EOF
7128
7129         ;;
7130 (ncursesw/curses.h|ncursesw/ncurses.h)
7131
7132 cat >>confdefs.h <<\EOF
7133 #define HAVE_NCURSESW_NCURSES_H 1
7134 EOF
7135
7136         ;;
7137 esac
7138
7139 echo "$as_me:7139: checking for terminfo header" >&5
7140 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7141 if test "${cf_cv_term_header+set}" = set; then
7142   echo $ECHO_N "(cached) $ECHO_C" >&6
7143 else
7144
7145 case ${cf_cv_ncurses_header} in
7146 (*/ncurses.h|*/ncursesw.h)
7147         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7148         ;;
7149 (*)
7150         cf_term_header=term.h
7151         ;;
7152 esac
7153
7154 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7155 do
7156 cat >conftest.$ac_ext <<_ACEOF
7157 #line 7157 "configure"
7158 #include "confdefs.h"
7159 #include <stdio.h>
7160 #include <${cf_cv_ncurses_header:-curses.h}>
7161 #include <$cf_test>
7162
7163 int
7164 main ()
7165 {
7166 int x = auto_left_margin
7167   ;
7168   return 0;
7169 }
7170 _ACEOF
7171 rm -f conftest.$ac_objext
7172 if { (eval echo "$as_me:7172: \"$ac_compile\"") >&5
7173   (eval $ac_compile) 2>&5
7174   ac_status=$?
7175   echo "$as_me:7175: \$? = $ac_status" >&5
7176   (exit $ac_status); } &&
7177          { ac_try='test -s conftest.$ac_objext'
7178   { (eval echo "$as_me:7178: \"$ac_try\"") >&5
7179   (eval $ac_try) 2>&5
7180   ac_status=$?
7181   echo "$as_me:7181: \$? = $ac_status" >&5
7182   (exit $ac_status); }; }; then
7183
7184         cf_cv_term_header="$cf_test"
7185 else
7186   echo "$as_me: failed program was:" >&5
7187 cat conftest.$ac_ext >&5
7188
7189         cf_cv_term_header=unknown
7190
7191 fi
7192 rm -f conftest.$ac_objext conftest.$ac_ext
7193         test "$cf_cv_term_header" != unknown && break
7194 done
7195
7196 fi
7197 echo "$as_me:7197: result: $cf_cv_term_header" >&5
7198 echo "${ECHO_T}$cf_cv_term_header" >&6
7199
7200 # Set definitions to allow ifdef'ing to accommodate subdirectories
7201
7202 case $cf_cv_term_header in
7203 (*term.h)
7204
7205 cat >>confdefs.h <<\EOF
7206 #define HAVE_TERM_H 1
7207 EOF
7208
7209         ;;
7210 esac
7211
7212 case $cf_cv_term_header in
7213 (ncurses/term.h)
7214
7215 cat >>confdefs.h <<\EOF
7216 #define HAVE_NCURSES_TERM_H 1
7217 EOF
7218
7219         ;;
7220 (ncursesw/term.h)
7221
7222 cat >>confdefs.h <<\EOF
7223 #define HAVE_NCURSESW_TERM_H 1
7224 EOF
7225
7226         ;;
7227 esac
7228
7229 # some applications need this, but should check for NCURSES_VERSION
7230
7231 cat >>confdefs.h <<\EOF
7232 #define NCURSES 1
7233 EOF
7234
7235 echo "$as_me:7235: checking for ncurses version" >&5
7236 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7237 if test "${cf_cv_ncurses_version+set}" = set; then
7238   echo $ECHO_N "(cached) $ECHO_C" >&6
7239 else
7240
7241         cf_cv_ncurses_version=no
7242         cf_tempfile=out$$
7243         rm -f $cf_tempfile
7244         if test "$cross_compiling" = yes; then
7245
7246         # This will not work if the preprocessor splits the line after the
7247         # Autoconf token.  The 'unproto' program does that.
7248         cat > conftest.$ac_ext <<EOF
7249 #include <${cf_cv_ncurses_header:-curses.h}>
7250 #undef Autoconf
7251 #ifdef NCURSES_VERSION
7252 Autoconf NCURSES_VERSION
7253 #else
7254 #ifdef __NCURSES_H
7255 Autoconf "old"
7256 #endif
7257 ;
7258 #endif
7259 EOF
7260         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7261         { (eval echo "$as_me:7261: \"$cf_try\"") >&5
7262   (eval $cf_try) 2>&5
7263   ac_status=$?
7264   echo "$as_me:7264: \$? = $ac_status" >&5
7265   (exit $ac_status); }
7266         if test -f conftest.out ; then
7267                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7268                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7269                 rm -f conftest.out
7270         fi
7271
7272 else
7273   cat >conftest.$ac_ext <<_ACEOF
7274 #line 7274 "configure"
7275 #include "confdefs.h"
7276
7277 #include <${cf_cv_ncurses_header:-curses.h}>
7278 #include <stdio.h>
7279 int main()
7280 {
7281         FILE *fp = fopen("$cf_tempfile", "w");
7282 #ifdef NCURSES_VERSION
7283 # ifdef NCURSES_VERSION_PATCH
7284         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7285 # else
7286         fprintf(fp, "%s\n", NCURSES_VERSION);
7287 # endif
7288 #else
7289 # ifdef __NCURSES_H
7290         fprintf(fp, "old\n");
7291 # else
7292         make an error
7293 # endif
7294 #endif
7295         ${cf_cv_main_return:-return}(0);
7296 }
7297 _ACEOF
7298 rm -f conftest$ac_exeext
7299 if { (eval echo "$as_me:7299: \"$ac_link\"") >&5
7300   (eval $ac_link) 2>&5
7301   ac_status=$?
7302   echo "$as_me:7302: \$? = $ac_status" >&5
7303   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7304   { (eval echo "$as_me:7304: \"$ac_try\"") >&5
7305   (eval $ac_try) 2>&5
7306   ac_status=$?
7307   echo "$as_me:7307: \$? = $ac_status" >&5
7308   (exit $ac_status); }; }; then
7309
7310         cf_cv_ncurses_version=`cat $cf_tempfile`
7311 else
7312   echo "$as_me: program exited with status $ac_status" >&5
7313 echo "$as_me: failed program was:" >&5
7314 cat conftest.$ac_ext >&5
7315 fi
7316 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7317 fi
7318         rm -f $cf_tempfile
7319
7320 fi
7321 echo "$as_me:7321: result: $cf_cv_ncurses_version" >&5
7322 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7323 test "$cf_cv_ncurses_version" = no ||
7324 cat >>confdefs.h <<\EOF
7325 #define NCURSES 1
7326 EOF
7327
7328 cf_nculib_root=$cf_cv_screen
7329         # This works, except for the special case where we find gpm, but
7330         # ncurses is in a nonstandard location via $LIBS, and we really want
7331         # to link gpm.
7332 cf_ncurses_LIBS=""
7333 cf_ncurses_SAVE="$LIBS"
7334 echo "$as_me:7334: checking for Gpm_Open in -lgpm" >&5
7335 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7336 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7337   echo $ECHO_N "(cached) $ECHO_C" >&6
7338 else
7339   ac_check_lib_save_LIBS=$LIBS
7340 LIBS="-lgpm  $LIBS"
7341 cat >conftest.$ac_ext <<_ACEOF
7342 #line 7342 "configure"
7343 #include "confdefs.h"
7344
7345 /* Override any gcc2 internal prototype to avoid an error.  */
7346 #ifdef __cplusplus
7347 extern "C"
7348 #endif
7349 /* We use char because int might match the return type of a gcc2
7350    builtin and then its argument prototype would still apply.  */
7351 char Gpm_Open ();
7352 int
7353 main ()
7354 {
7355 Gpm_Open ();
7356   ;
7357   return 0;
7358 }
7359 _ACEOF
7360 rm -f conftest.$ac_objext conftest$ac_exeext
7361 if { (eval echo "$as_me:7361: \"$ac_link\"") >&5
7362   (eval $ac_link) 2>&5
7363   ac_status=$?
7364   echo "$as_me:7364: \$? = $ac_status" >&5
7365   (exit $ac_status); } &&
7366          { ac_try='test -s conftest$ac_exeext'
7367   { (eval echo "$as_me:7367: \"$ac_try\"") >&5
7368   (eval $ac_try) 2>&5
7369   ac_status=$?
7370   echo "$as_me:7370: \$? = $ac_status" >&5
7371   (exit $ac_status); }; }; then
7372   ac_cv_lib_gpm_Gpm_Open=yes
7373 else
7374   echo "$as_me: failed program was:" >&5
7375 cat conftest.$ac_ext >&5
7376 ac_cv_lib_gpm_Gpm_Open=no
7377 fi
7378 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7379 LIBS=$ac_check_lib_save_LIBS
7380 fi
7381 echo "$as_me:7381: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7382 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7383 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7384   echo "$as_me:7384: checking for initscr in -lgpm" >&5
7385 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7386 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7387   echo $ECHO_N "(cached) $ECHO_C" >&6
7388 else
7389   ac_check_lib_save_LIBS=$LIBS
7390 LIBS="-lgpm  $LIBS"
7391 cat >conftest.$ac_ext <<_ACEOF
7392 #line 7392 "configure"
7393 #include "confdefs.h"
7394
7395 /* Override any gcc2 internal prototype to avoid an error.  */
7396 #ifdef __cplusplus
7397 extern "C"
7398 #endif
7399 /* We use char because int might match the return type of a gcc2
7400    builtin and then its argument prototype would still apply.  */
7401 char initscr ();
7402 int
7403 main ()
7404 {
7405 initscr ();
7406   ;
7407   return 0;
7408 }
7409 _ACEOF
7410 rm -f conftest.$ac_objext conftest$ac_exeext
7411 if { (eval echo "$as_me:7411: \"$ac_link\"") >&5
7412   (eval $ac_link) 2>&5
7413   ac_status=$?
7414   echo "$as_me:7414: \$? = $ac_status" >&5
7415   (exit $ac_status); } &&
7416          { ac_try='test -s conftest$ac_exeext'
7417   { (eval echo "$as_me:7417: \"$ac_try\"") >&5
7418   (eval $ac_try) 2>&5
7419   ac_status=$?
7420   echo "$as_me:7420: \$? = $ac_status" >&5
7421   (exit $ac_status); }; }; then
7422   ac_cv_lib_gpm_initscr=yes
7423 else
7424   echo "$as_me: failed program was:" >&5
7425 cat conftest.$ac_ext >&5
7426 ac_cv_lib_gpm_initscr=no
7427 fi
7428 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7429 LIBS=$ac_check_lib_save_LIBS
7430 fi
7431 echo "$as_me:7431: result: $ac_cv_lib_gpm_initscr" >&5
7432 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7433 if test $ac_cv_lib_gpm_initscr = yes; then
7434   LIBS="$cf_ncurses_SAVE"
7435 else
7436   cf_ncurses_LIBS="-lgpm"
7437 fi
7438
7439 fi
7440
7441 case $host_os in
7442 (freebsd*)
7443         # This is only necessary if you are linking against an obsolete
7444         # version of ncurses (but it should do no harm, since it's static).
7445         if test "$cf_nculib_root" = ncurses ; then
7446                 echo "$as_me:7446: checking for tgoto in -lmytinfo" >&5
7447 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7448 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7449   echo $ECHO_N "(cached) $ECHO_C" >&6
7450 else
7451   ac_check_lib_save_LIBS=$LIBS
7452 LIBS="-lmytinfo  $LIBS"
7453 cat >conftest.$ac_ext <<_ACEOF
7454 #line 7454 "configure"
7455 #include "confdefs.h"
7456
7457 /* Override any gcc2 internal prototype to avoid an error.  */
7458 #ifdef __cplusplus
7459 extern "C"
7460 #endif
7461 /* We use char because int might match the return type of a gcc2
7462    builtin and then its argument prototype would still apply.  */
7463 char tgoto ();
7464 int
7465 main ()
7466 {
7467 tgoto ();
7468   ;
7469   return 0;
7470 }
7471 _ACEOF
7472 rm -f conftest.$ac_objext conftest$ac_exeext
7473 if { (eval echo "$as_me:7473: \"$ac_link\"") >&5
7474   (eval $ac_link) 2>&5
7475   ac_status=$?
7476   echo "$as_me:7476: \$? = $ac_status" >&5
7477   (exit $ac_status); } &&
7478          { ac_try='test -s conftest$ac_exeext'
7479   { (eval echo "$as_me:7479: \"$ac_try\"") >&5
7480   (eval $ac_try) 2>&5
7481   ac_status=$?
7482   echo "$as_me:7482: \$? = $ac_status" >&5
7483   (exit $ac_status); }; }; then
7484   ac_cv_lib_mytinfo_tgoto=yes
7485 else
7486   echo "$as_me: failed program was:" >&5
7487 cat conftest.$ac_ext >&5
7488 ac_cv_lib_mytinfo_tgoto=no
7489 fi
7490 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7491 LIBS=$ac_check_lib_save_LIBS
7492 fi
7493 echo "$as_me:7493: result: $ac_cv_lib_mytinfo_tgoto" >&5
7494 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7495 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7496   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7497 fi
7498
7499         fi
7500         ;;
7501 esac
7502
7503 cf_add_libs="$cf_ncurses_LIBS"
7504 # Filter out duplicates - this happens with badly-designed ".pc" files...
7505 for cf_add_1lib in $LIBS
7506 do
7507         for cf_add_2lib in $cf_add_libs
7508         do
7509                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7510                 then
7511                         cf_add_1lib=
7512                         break
7513                 fi
7514         done
7515         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7516 done
7517 LIBS="$cf_add_libs"
7518
7519 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7520 then
7521
7522 cf_add_libs="-l$cf_nculib_root"
7523 # Filter out duplicates - this happens with badly-designed ".pc" files...
7524 for cf_add_1lib in $LIBS
7525 do
7526         for cf_add_2lib in $cf_add_libs
7527         do
7528                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7529                 then
7530                         cf_add_1lib=
7531                         break
7532                 fi
7533         done
7534         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7535 done
7536 LIBS="$cf_add_libs"
7537
7538 else
7539
7540         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7541         cf_libdir=""
7542         echo "$as_me:7542: checking for initscr" >&5
7543 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7544 if test "${ac_cv_func_initscr+set}" = set; then
7545   echo $ECHO_N "(cached) $ECHO_C" >&6
7546 else
7547   cat >conftest.$ac_ext <<_ACEOF
7548 #line 7548 "configure"
7549 #include "confdefs.h"
7550 /* System header to define __stub macros and hopefully few prototypes,
7551     which can conflict with char initscr (); below.  */
7552 #include <assert.h>
7553 /* Override any gcc2 internal prototype to avoid an error.  */
7554 #ifdef __cplusplus
7555 extern "C"
7556 #endif
7557 /* We use char because int might match the return type of a gcc2
7558    builtin and then its argument prototype would still apply.  */
7559 char initscr ();
7560 char (*f) ();
7561
7562 int
7563 main ()
7564 {
7565 /* The GNU C library defines this for functions which it implements
7566     to always fail with ENOSYS.  Some functions are actually named
7567     something starting with __ and the normal name is an alias.  */
7568 #if defined (__stub_initscr) || defined (__stub___initscr)
7569 choke me
7570 #else
7571 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7572 #endif
7573
7574   ;
7575   return 0;
7576 }
7577 _ACEOF
7578 rm -f conftest.$ac_objext conftest$ac_exeext
7579 if { (eval echo "$as_me:7579: \"$ac_link\"") >&5
7580   (eval $ac_link) 2>&5
7581   ac_status=$?
7582   echo "$as_me:7582: \$? = $ac_status" >&5
7583   (exit $ac_status); } &&
7584          { ac_try='test -s conftest$ac_exeext'
7585   { (eval echo "$as_me:7585: \"$ac_try\"") >&5
7586   (eval $ac_try) 2>&5
7587   ac_status=$?
7588   echo "$as_me:7588: \$? = $ac_status" >&5
7589   (exit $ac_status); }; }; then
7590   ac_cv_func_initscr=yes
7591 else
7592   echo "$as_me: failed program was:" >&5
7593 cat conftest.$ac_ext >&5
7594 ac_cv_func_initscr=no
7595 fi
7596 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7597 fi
7598 echo "$as_me:7598: result: $ac_cv_func_initscr" >&5
7599 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7600 if test $ac_cv_func_initscr = yes; then
7601   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7602 else
7603
7604                 cf_save_LIBS="$LIBS"
7605                 echo "$as_me:7605: checking for initscr in -l$cf_nculib_root" >&5
7606 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7607                 LIBS="-l$cf_nculib_root $LIBS"
7608                 cat >conftest.$ac_ext <<_ACEOF
7609 #line 7609 "configure"
7610 #include "confdefs.h"
7611 #include <${cf_cv_ncurses_header:-curses.h}>
7612 int
7613 main ()
7614 {
7615 initscr()
7616   ;
7617   return 0;
7618 }
7619 _ACEOF
7620 rm -f conftest.$ac_objext conftest$ac_exeext
7621 if { (eval echo "$as_me:7621: \"$ac_link\"") >&5
7622   (eval $ac_link) 2>&5
7623   ac_status=$?
7624   echo "$as_me:7624: \$? = $ac_status" >&5
7625   (exit $ac_status); } &&
7626          { ac_try='test -s conftest$ac_exeext'
7627   { (eval echo "$as_me:7627: \"$ac_try\"") >&5
7628   (eval $ac_try) 2>&5
7629   ac_status=$?
7630   echo "$as_me:7630: \$? = $ac_status" >&5
7631   (exit $ac_status); }; }; then
7632   echo "$as_me:7632: result: yes" >&5
7633 echo "${ECHO_T}yes" >&6
7634                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7635
7636 else
7637   echo "$as_me: failed program was:" >&5
7638 cat conftest.$ac_ext >&5
7639 echo "$as_me:7639: result: no" >&5
7640 echo "${ECHO_T}no" >&6
7641
7642 cf_search=
7643 cf_library_path_list=""
7644 if test -n "${LDFLAGS}${LIBS}" ; then
7645         for cf_library_path in $LDFLAGS $LIBS
7646         do
7647                 case $cf_library_path in
7648                 (-L*)
7649                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7650
7651 test "x$cf_library_path" != "xNONE" && \
7652 test -d "$cf_library_path" && \
7653  {
7654         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7655         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7656         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7657         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7658         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7659         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"
7660 }
7661
7662                         cf_library_path_list="$cf_library_path_list $cf_search"
7663                         ;;
7664                 esac
7665         done
7666 fi
7667
7668 cf_search=
7669
7670 test "x$prefix" != "xNONE" && \
7671 test -d "$prefix" && \
7672  {
7673         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7674         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7675         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7676         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7677         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7678         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7679 }
7680
7681 for cf_subdir_prefix in \
7682         /usr \
7683         /usr/local \
7684         /usr/pkg \
7685         /opt \
7686         /opt/local \
7687         $HOME
7688 do
7689
7690 test "x$cf_subdir_prefix" != "x$prefix" && \
7691 test -d "$cf_subdir_prefix" && \
7692 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7693         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7694         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7695         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7696         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7697         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7698         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"
7699 }
7700
7701 done
7702
7703 cf_search="$cf_library_path_list $cf_search"
7704
7705                         for cf_libdir in $cf_search
7706                         do
7707                                 echo "$as_me:7707: checking for -l$cf_nculib_root in $cf_libdir" >&5
7708 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7709                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7710                                 cat >conftest.$ac_ext <<_ACEOF
7711 #line 7711 "configure"
7712 #include "confdefs.h"
7713 #include <${cf_cv_ncurses_header:-curses.h}>
7714 int
7715 main ()
7716 {
7717 initscr()
7718   ;
7719   return 0;
7720 }
7721 _ACEOF
7722 rm -f conftest.$ac_objext conftest$ac_exeext
7723 if { (eval echo "$as_me:7723: \"$ac_link\"") >&5
7724   (eval $ac_link) 2>&5
7725   ac_status=$?
7726   echo "$as_me:7726: \$? = $ac_status" >&5
7727   (exit $ac_status); } &&
7728          { ac_try='test -s conftest$ac_exeext'
7729   { (eval echo "$as_me:7729: \"$ac_try\"") >&5
7730   (eval $ac_try) 2>&5
7731   ac_status=$?
7732   echo "$as_me:7732: \$? = $ac_status" >&5
7733   (exit $ac_status); }; }; then
7734   echo "$as_me:7734: result: yes" >&5
7735 echo "${ECHO_T}yes" >&6
7736                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7737                                          break
7738 else
7739   echo "$as_me: failed program was:" >&5
7740 cat conftest.$ac_ext >&5
7741 echo "$as_me:7741: result: no" >&5
7742 echo "${ECHO_T}no" >&6
7743                                          LIBS="$cf_save_LIBS"
7744 fi
7745 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7746                         done
7747
7748 fi
7749 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7750
7751 fi
7752
7753 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7754
7755 if test $cf_found_library = no ; then
7756         { { echo "$as_me:7756: error: Cannot link $cf_nculib_root library" >&5
7757 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7758    { (exit 1); exit 1; }; }
7759 fi
7760
7761 fi
7762
7763 if test -n "$cf_ncurses_LIBS" ; then
7764         echo "$as_me:7764: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7765 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7766         cf_ncurses_SAVE="$LIBS"
7767         for p in $cf_ncurses_LIBS ; do
7768                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7769                 if test "$q" != "$LIBS" ; then
7770                         LIBS="$q"
7771                 fi
7772         done
7773         cat >conftest.$ac_ext <<_ACEOF
7774 #line 7774 "configure"
7775 #include "confdefs.h"
7776 #include <${cf_cv_ncurses_header:-curses.h}>
7777 int
7778 main ()
7779 {
7780 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7781   ;
7782   return 0;
7783 }
7784 _ACEOF
7785 rm -f conftest.$ac_objext conftest$ac_exeext
7786 if { (eval echo "$as_me:7786: \"$ac_link\"") >&5
7787   (eval $ac_link) 2>&5
7788   ac_status=$?
7789   echo "$as_me:7789: \$? = $ac_status" >&5
7790   (exit $ac_status); } &&
7791          { ac_try='test -s conftest$ac_exeext'
7792   { (eval echo "$as_me:7792: \"$ac_try\"") >&5
7793   (eval $ac_try) 2>&5
7794   ac_status=$?
7795   echo "$as_me:7795: \$? = $ac_status" >&5
7796   (exit $ac_status); }; }; then
7797   echo "$as_me:7797: result: yes" >&5
7798 echo "${ECHO_T}yes" >&6
7799 else
7800   echo "$as_me: failed program was:" >&5
7801 cat conftest.$ac_ext >&5
7802 echo "$as_me:7802: result: no" >&5
7803 echo "${ECHO_T}no" >&6
7804                  LIBS="$cf_ncurses_SAVE"
7805 fi
7806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7807 fi
7808
7809 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7810
7811 cat >>confdefs.h <<EOF
7812 #define $cf_nculib_ROOT 1
7813 EOF
7814
7815         fi
7816 else
7817         NCURSES_CONFIG=none
7818 fi
7819
7820         ;;
7821 (ncurses*)
7822
7823 cf_ncuconfig_root=$cf_cv_screen
7824 cf_have_ncuconfig=no
7825
7826 if test "x${PKG_CONFIG:=none}" != xnone; then
7827         echo "$as_me:7827: checking pkg-config for $cf_ncuconfig_root" >&5
7828 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7829         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7830                 echo "$as_me:7830: result: yes" >&5
7831 echo "${ECHO_T}yes" >&6
7832
7833                 echo "$as_me:7833: checking if the $cf_ncuconfig_root package files work" >&5
7834 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7835                 cf_have_ncuconfig=unknown
7836
7837                 cf_save_CPPFLAGS="$CPPFLAGS"
7838                 cf_save_LIBS="$LIBS"
7839
7840                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7841
7842 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7843 # Filter out duplicates - this happens with badly-designed ".pc" files...
7844 for cf_add_1lib in $LIBS
7845 do
7846         for cf_add_2lib in $cf_add_libs
7847         do
7848                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7849                 then
7850                         cf_add_1lib=
7851                         break
7852                 fi
7853         done
7854         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7855 done
7856 LIBS="$cf_add_libs"
7857
7858                 cat >conftest.$ac_ext <<_ACEOF
7859 #line 7859 "configure"
7860 #include "confdefs.h"
7861 #include <${cf_cv_ncurses_header:-curses.h}>
7862 int
7863 main ()
7864 {
7865 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7866   ;
7867   return 0;
7868 }
7869 _ACEOF
7870 rm -f conftest.$ac_objext conftest$ac_exeext
7871 if { (eval echo "$as_me:7871: \"$ac_link\"") >&5
7872   (eval $ac_link) 2>&5
7873   ac_status=$?
7874   echo "$as_me:7874: \$? = $ac_status" >&5
7875   (exit $ac_status); } &&
7876          { ac_try='test -s conftest$ac_exeext'
7877   { (eval echo "$as_me:7877: \"$ac_try\"") >&5
7878   (eval $ac_try) 2>&5
7879   ac_status=$?
7880   echo "$as_me:7880: \$? = $ac_status" >&5
7881   (exit $ac_status); }; }; then
7882   if test "$cross_compiling" = yes; then
7883   cf_have_ncuconfig=maybe
7884 else
7885   cat >conftest.$ac_ext <<_ACEOF
7886 #line 7886 "configure"
7887 #include "confdefs.h"
7888 #include <${cf_cv_ncurses_header:-curses.h}>
7889                                 int main(void)
7890                                 { char *xx = curses_version(); return (xx == 0); }
7891 _ACEOF
7892 rm -f conftest$ac_exeext
7893 if { (eval echo "$as_me:7893: \"$ac_link\"") >&5
7894   (eval $ac_link) 2>&5
7895   ac_status=$?
7896   echo "$as_me:7896: \$? = $ac_status" >&5
7897   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7898   { (eval echo "$as_me:7898: \"$ac_try\"") >&5
7899   (eval $ac_try) 2>&5
7900   ac_status=$?
7901   echo "$as_me:7901: \$? = $ac_status" >&5
7902   (exit $ac_status); }; }; then
7903   cf_have_ncuconfig=yes
7904 else
7905   echo "$as_me: program exited with status $ac_status" >&5
7906 echo "$as_me: failed program was:" >&5
7907 cat conftest.$ac_ext >&5
7908 cf_have_ncuconfig=no
7909 fi
7910 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7911 fi
7912 else
7913   echo "$as_me: failed program was:" >&5
7914 cat conftest.$ac_ext >&5
7915 cf_have_ncuconfig=no
7916 fi
7917 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7918                 echo "$as_me:7918: result: $cf_have_ncuconfig" >&5
7919 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7920                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7921                 if test "$cf_have_ncuconfig" != "yes"
7922                 then
7923                         CPPFLAGS="$cf_save_CPPFLAGS"
7924                         LIBS="$cf_save_LIBS"
7925                         NCURSES_CONFIG_PKG=none
7926                 else
7927
7928 cat >>confdefs.h <<\EOF
7929 #define NCURSES 1
7930 EOF
7931
7932                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7933                 fi
7934
7935         else
7936                 echo "$as_me:7936: result: no" >&5
7937 echo "${ECHO_T}no" >&6
7938                 NCURSES_CONFIG_PKG=none
7939         fi
7940 else
7941         NCURSES_CONFIG_PKG=none
7942 fi
7943
7944 if test "x$cf_have_ncuconfig" = "xno"; then
7945         echo "Looking for ${cf_ncuconfig_root}-config"
7946
7947 if test -n "$ac_tool_prefix"; then
7948   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7949   do
7950     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7951 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7952 echo "$as_me:7952: checking for $ac_word" >&5
7953 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7954 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7955   echo $ECHO_N "(cached) $ECHO_C" >&6
7956 else
7957   if test -n "$NCURSES_CONFIG"; then
7958   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7959 else
7960   ac_save_IFS=$IFS; IFS=$ac_path_separator
7961 ac_dummy="$PATH"
7962 for ac_dir in $ac_dummy; do
7963   IFS=$ac_save_IFS
7964   test -z "$ac_dir" && ac_dir=.
7965   $as_executable_p "$ac_dir/$ac_word" || continue
7966 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7967 echo "$as_me:7967: found $ac_dir/$ac_word" >&5
7968 break
7969 done
7970
7971 fi
7972 fi
7973 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7974 if test -n "$NCURSES_CONFIG"; then
7975   echo "$as_me:7975: result: $NCURSES_CONFIG" >&5
7976 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7977 else
7978   echo "$as_me:7978: result: no" >&5
7979 echo "${ECHO_T}no" >&6
7980 fi
7981
7982     test -n "$NCURSES_CONFIG" && break
7983   done
7984 fi
7985 if test -z "$NCURSES_CONFIG"; then
7986   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7987   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7988 do
7989   # Extract the first word of "$ac_prog", so it can be a program name with args.
7990 set dummy $ac_prog; ac_word=$2
7991 echo "$as_me:7991: checking for $ac_word" >&5
7992 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7993 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7994   echo $ECHO_N "(cached) $ECHO_C" >&6
7995 else
7996   if test -n "$ac_ct_NCURSES_CONFIG"; then
7997   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7998 else
7999   ac_save_IFS=$IFS; IFS=$ac_path_separator
8000 ac_dummy="$PATH"
8001 for ac_dir in $ac_dummy; do
8002   IFS=$ac_save_IFS
8003   test -z "$ac_dir" && ac_dir=.
8004   $as_executable_p "$ac_dir/$ac_word" || continue
8005 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8006 echo "$as_me:8006: found $ac_dir/$ac_word" >&5
8007 break
8008 done
8009
8010 fi
8011 fi
8012 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8013 if test -n "$ac_ct_NCURSES_CONFIG"; then
8014   echo "$as_me:8014: result: $ac_ct_NCURSES_CONFIG" >&5
8015 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8016 else
8017   echo "$as_me:8017: result: no" >&5
8018 echo "${ECHO_T}no" >&6
8019 fi
8020
8021   test -n "$ac_ct_NCURSES_CONFIG" && break
8022 done
8023 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8024
8025   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8026 fi
8027
8028         if test "$NCURSES_CONFIG" != none ; then
8029
8030                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8031
8032 cf_add_libs="`$NCURSES_CONFIG --libs`"
8033 # Filter out duplicates - this happens with badly-designed ".pc" files...
8034 for cf_add_1lib in $LIBS
8035 do
8036         for cf_add_2lib in $cf_add_libs
8037         do
8038                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8039                 then
8040                         cf_add_1lib=
8041                         break
8042                 fi
8043         done
8044         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8045 done
8046 LIBS="$cf_add_libs"
8047
8048                 # even with config script, some packages use no-override for curses.h
8049
8050 echo "$as_me:8050: checking if we have identified curses headers" >&5
8051 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8052 if test "${cf_cv_ncurses_header+set}" = set; then
8053   echo $ECHO_N "(cached) $ECHO_C" >&6
8054 else
8055
8056 cf_cv_ncurses_header=none
8057 for cf_header in \
8058         ncurses.h $cf_cv_screen/ncurses.h \
8059         curses.h $cf_cv_screen/curses.h
8060 do
8061 cat >conftest.$ac_ext <<_ACEOF
8062 #line 8062 "configure"
8063 #include "confdefs.h"
8064 #include <${cf_header}>
8065 int
8066 main ()
8067 {
8068 initscr(); tgoto("?", 0,0)
8069   ;
8070   return 0;
8071 }
8072 _ACEOF
8073 rm -f conftest.$ac_objext
8074 if { (eval echo "$as_me:8074: \"$ac_compile\"") >&5
8075   (eval $ac_compile) 2>&5
8076   ac_status=$?
8077   echo "$as_me:8077: \$? = $ac_status" >&5
8078   (exit $ac_status); } &&
8079          { ac_try='test -s conftest.$ac_objext'
8080   { (eval echo "$as_me:8080: \"$ac_try\"") >&5
8081   (eval $ac_try) 2>&5
8082   ac_status=$?
8083   echo "$as_me:8083: \$? = $ac_status" >&5
8084   (exit $ac_status); }; }; then
8085   cf_cv_ncurses_header=$cf_header; break
8086 else
8087   echo "$as_me: failed program was:" >&5
8088 cat conftest.$ac_ext >&5
8089 fi
8090 rm -f conftest.$ac_objext conftest.$ac_ext
8091 done
8092
8093 fi
8094 echo "$as_me:8094: result: $cf_cv_ncurses_header" >&5
8095 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8096
8097 if test "$cf_cv_ncurses_header" = none ; then
8098         { { echo "$as_me:8098: error: No curses header-files found" >&5
8099 echo "$as_me: error: No curses header-files found" >&2;}
8100    { (exit 1); exit 1; }; }
8101 fi
8102
8103 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8104
8105 for ac_header in $cf_cv_ncurses_header
8106 do
8107 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8108 echo "$as_me:8108: checking for $ac_header" >&5
8109 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8110 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8111   echo $ECHO_N "(cached) $ECHO_C" >&6
8112 else
8113   cat >conftest.$ac_ext <<_ACEOF
8114 #line 8114 "configure"
8115 #include "confdefs.h"
8116 #include <$ac_header>
8117 _ACEOF
8118 if { (eval echo "$as_me:8118: \"$ac_cpp conftest.$ac_ext\"") >&5
8119   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8120   ac_status=$?
8121   egrep -v '^ *\+' conftest.er1 >conftest.err
8122   rm -f conftest.er1
8123   cat conftest.err >&5
8124   echo "$as_me:8124: \$? = $ac_status" >&5
8125   (exit $ac_status); } >/dev/null; then
8126   if test -s conftest.err; then
8127     ac_cpp_err=$ac_c_preproc_warn_flag
8128   else
8129     ac_cpp_err=
8130   fi
8131 else
8132   ac_cpp_err=yes
8133 fi
8134 if test -z "$ac_cpp_err"; then
8135   eval "$as_ac_Header=yes"
8136 else
8137   echo "$as_me: failed program was:" >&5
8138   cat conftest.$ac_ext >&5
8139   eval "$as_ac_Header=no"
8140 fi
8141 rm -f conftest.err conftest.$ac_ext
8142 fi
8143 echo "$as_me:8143: result: `eval echo '${'$as_ac_Header'}'`" >&5
8144 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8145 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8146   cat >>confdefs.h <<EOF
8147 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8148 EOF
8149
8150 fi
8151 done
8152
8153 cat >>confdefs.h <<\EOF
8154 #define NCURSES 1
8155 EOF
8156
8157 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8158
8159                 cat >>confdefs.h <<EOF
8160 #define $cf_nculib_ROOT 1
8161 EOF
8162
8163                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8164
8165         else
8166
8167 cf_ncuhdr_root=$cf_cv_screen
8168
8169 test -n "$cf_cv_curses_dir" && \
8170 test "$cf_cv_curses_dir" != "no" && { \
8171
8172 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8173   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8174   do
8175         while test $cf_add_incdir != /usr/include
8176         do
8177           if test -d $cf_add_incdir
8178           then
8179                 cf_have_incdir=no
8180                 if test -n "$CFLAGS$CPPFLAGS" ; then
8181                   # a loop is needed to ensure we can add subdirs of existing dirs
8182                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8183                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8184                           cf_have_incdir=yes; break
8185                         fi
8186                   done
8187                 fi
8188
8189                 if test "$cf_have_incdir" = no ; then
8190                   if test "$cf_add_incdir" = /usr/local/include ; then
8191                         if test "$GCC" = yes
8192                         then
8193                           cf_save_CPPFLAGS=$CPPFLAGS
8194                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8195                           cat >conftest.$ac_ext <<_ACEOF
8196 #line 8196 "configure"
8197 #include "confdefs.h"
8198 #include <stdio.h>
8199 int
8200 main ()
8201 {
8202 printf("Hello")
8203   ;
8204   return 0;
8205 }
8206 _ACEOF
8207 rm -f conftest.$ac_objext
8208 if { (eval echo "$as_me:8208: \"$ac_compile\"") >&5
8209   (eval $ac_compile) 2>&5
8210   ac_status=$?
8211   echo "$as_me:8211: \$? = $ac_status" >&5
8212   (exit $ac_status); } &&
8213          { ac_try='test -s conftest.$ac_objext'
8214   { (eval echo "$as_me:8214: \"$ac_try\"") >&5
8215   (eval $ac_try) 2>&5
8216   ac_status=$?
8217   echo "$as_me:8217: \$? = $ac_status" >&5
8218   (exit $ac_status); }; }; then
8219   :
8220 else
8221   echo "$as_me: failed program was:" >&5
8222 cat conftest.$ac_ext >&5
8223 cf_have_incdir=yes
8224 fi
8225 rm -f conftest.$ac_objext conftest.$ac_ext
8226                           CPPFLAGS=$cf_save_CPPFLAGS
8227                         fi
8228                   fi
8229                 fi
8230
8231                 if test "$cf_have_incdir" = no ; then
8232                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8233
8234 echo "${as_me:-configure}:8234: testing adding $cf_add_incdir to include-path ..." 1>&5
8235
8236                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8237
8238                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8239                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8240                   cf_add_incdir="$cf_top_incdir"
8241                 else
8242                   break
8243                 fi
8244           else
8245                 break
8246           fi
8247         done
8248   done
8249 fi
8250
8251 }
8252
8253 echo "$as_me:8253: checking for $cf_ncuhdr_root header in include-path" >&5
8254 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8255 if test "${cf_cv_ncurses_h+set}" = set; then
8256   echo $ECHO_N "(cached) $ECHO_C" >&6
8257 else
8258
8259         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8260         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8261         for cf_header in $cf_header_list
8262         do
8263
8264         cat >conftest.$ac_ext <<_ACEOF
8265 #line 8265 "configure"
8266 #include "confdefs.h"
8267
8268 #include <$cf_header>
8269 int
8270 main ()
8271 {
8272
8273 #ifdef NCURSES_VERSION
8274
8275 printf("%s\n", NCURSES_VERSION);
8276 #else
8277 #ifdef __NCURSES_H
8278 printf("old\n");
8279 #else
8280         make an error
8281 #endif
8282 #endif
8283
8284   ;
8285   return 0;
8286 }
8287 _ACEOF
8288 rm -f conftest.$ac_objext
8289 if { (eval echo "$as_me:8289: \"$ac_compile\"") >&5
8290   (eval $ac_compile) 2>&5
8291   ac_status=$?
8292   echo "$as_me:8292: \$? = $ac_status" >&5
8293   (exit $ac_status); } &&
8294          { ac_try='test -s conftest.$ac_objext'
8295   { (eval echo "$as_me:8295: \"$ac_try\"") >&5
8296   (eval $ac_try) 2>&5
8297   ac_status=$?
8298   echo "$as_me:8298: \$? = $ac_status" >&5
8299   (exit $ac_status); }; }; then
8300   cf_cv_ncurses_h=$cf_header
8301
8302 else
8303   echo "$as_me: failed program was:" >&5
8304 cat conftest.$ac_ext >&5
8305 cf_cv_ncurses_h=no
8306 fi
8307 rm -f conftest.$ac_objext conftest.$ac_ext
8308
8309                 test "$cf_cv_ncurses_h" != no && break
8310         done
8311
8312 fi
8313 echo "$as_me:8313: result: $cf_cv_ncurses_h" >&5
8314 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8315
8316 if test "$cf_cv_ncurses_h" != no ; then
8317         cf_cv_ncurses_header=$cf_cv_ncurses_h
8318 else
8319
8320 echo "$as_me:8320: checking for $cf_ncuhdr_root include-path" >&5
8321 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8322 if test "${cf_cv_ncurses_h2+set}" = set; then
8323   echo $ECHO_N "(cached) $ECHO_C" >&6
8324 else
8325
8326         test -n "$verbose" && echo
8327
8328 cf_search=
8329
8330 # collect the current set of include-directories from compiler flags
8331 cf_header_path_list=""
8332 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8333         for cf_header_path in $CPPFLAGS $CFLAGS
8334         do
8335                 case $cf_header_path in
8336                 (-I*)
8337                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8338
8339 test "x$cf_header_path" != "xNONE" && \
8340 test -d "$cf_header_path" && \
8341  {
8342         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8343         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8344         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8345         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8346         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8347         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"
8348 }
8349
8350                         cf_header_path_list="$cf_header_path_list $cf_search"
8351                         ;;
8352                 esac
8353         done
8354 fi
8355
8356 # add the variations for the package we are looking for
8357
8358 cf_search=
8359
8360 test "x$prefix" != "xNONE" && \
8361 test -d "$prefix" && \
8362  {
8363         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8364         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8365         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8366         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8367         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8368         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8369 }
8370
8371 for cf_subdir_prefix in \
8372         /usr \
8373         /usr/local \
8374         /usr/pkg \
8375         /opt \
8376         /opt/local \
8377         $HOME
8378 do
8379
8380 test "x$cf_subdir_prefix" != "x$prefix" && \
8381 test -d "$cf_subdir_prefix" && \
8382 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8383         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8384         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8385         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8386         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8387         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8388         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"
8389 }
8390
8391 done
8392
8393 test "$includedir" != NONE && \
8394 test "$includedir" != "/usr/include" && \
8395 test -d "$includedir" && {
8396         test -d $includedir &&    cf_search="$cf_search $includedir"
8397         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8398 }
8399
8400 test "$oldincludedir" != NONE && \
8401 test "$oldincludedir" != "/usr/include" && \
8402 test -d "$oldincludedir" && {
8403         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8404         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8405 }
8406
8407 cf_search="$cf_search $cf_header_path_list"
8408
8409         test -n "$verbose" && echo search path $cf_search
8410         cf_save2_CPPFLAGS="$CPPFLAGS"
8411         for cf_incdir in $cf_search
8412         do
8413
8414 if test -n "$cf_incdir" ; then
8415   for cf_add_incdir in $cf_incdir
8416   do
8417         while test $cf_add_incdir != /usr/include
8418         do
8419           if test -d $cf_add_incdir
8420           then
8421                 cf_have_incdir=no
8422                 if test -n "$CFLAGS$CPPFLAGS" ; then
8423                   # a loop is needed to ensure we can add subdirs of existing dirs
8424                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8425                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8426                           cf_have_incdir=yes; break
8427                         fi
8428                   done
8429                 fi
8430
8431                 if test "$cf_have_incdir" = no ; then
8432                   if test "$cf_add_incdir" = /usr/local/include ; then
8433                         if test "$GCC" = yes
8434                         then
8435                           cf_save_CPPFLAGS=$CPPFLAGS
8436                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8437                           cat >conftest.$ac_ext <<_ACEOF
8438 #line 8438 "configure"
8439 #include "confdefs.h"
8440 #include <stdio.h>
8441 int
8442 main ()
8443 {
8444 printf("Hello")
8445   ;
8446   return 0;
8447 }
8448 _ACEOF
8449 rm -f conftest.$ac_objext
8450 if { (eval echo "$as_me:8450: \"$ac_compile\"") >&5
8451   (eval $ac_compile) 2>&5
8452   ac_status=$?
8453   echo "$as_me:8453: \$? = $ac_status" >&5
8454   (exit $ac_status); } &&
8455          { ac_try='test -s conftest.$ac_objext'
8456   { (eval echo "$as_me:8456: \"$ac_try\"") >&5
8457   (eval $ac_try) 2>&5
8458   ac_status=$?
8459   echo "$as_me:8459: \$? = $ac_status" >&5
8460   (exit $ac_status); }; }; then
8461   :
8462 else
8463   echo "$as_me: failed program was:" >&5
8464 cat conftest.$ac_ext >&5
8465 cf_have_incdir=yes
8466 fi
8467 rm -f conftest.$ac_objext conftest.$ac_ext
8468                           CPPFLAGS=$cf_save_CPPFLAGS
8469                         fi
8470                   fi
8471                 fi
8472
8473                 if test "$cf_have_incdir" = no ; then
8474                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8475
8476 echo "${as_me:-configure}:8476: testing adding $cf_add_incdir to include-path ..." 1>&5
8477
8478                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8479
8480                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8481                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8482                   cf_add_incdir="$cf_top_incdir"
8483                 else
8484                   break
8485                 fi
8486           else
8487                 break
8488           fi
8489         done
8490   done
8491 fi
8492
8493                 for cf_header in \
8494                         ncurses.h \
8495                         curses.h
8496                 do
8497
8498         cat >conftest.$ac_ext <<_ACEOF
8499 #line 8499 "configure"
8500 #include "confdefs.h"
8501
8502 #include <$cf_header>
8503 int
8504 main ()
8505 {
8506
8507 #ifdef NCURSES_VERSION
8508
8509 printf("%s\n", NCURSES_VERSION);
8510 #else
8511 #ifdef __NCURSES_H
8512 printf("old\n");
8513 #else
8514         make an error
8515 #endif
8516 #endif
8517
8518   ;
8519   return 0;
8520 }
8521 _ACEOF
8522 rm -f conftest.$ac_objext
8523 if { (eval echo "$as_me:8523: \"$ac_compile\"") >&5
8524   (eval $ac_compile) 2>&5
8525   ac_status=$?
8526   echo "$as_me:8526: \$? = $ac_status" >&5
8527   (exit $ac_status); } &&
8528          { ac_try='test -s conftest.$ac_objext'
8529   { (eval echo "$as_me:8529: \"$ac_try\"") >&5
8530   (eval $ac_try) 2>&5
8531   ac_status=$?
8532   echo "$as_me:8532: \$? = $ac_status" >&5
8533   (exit $ac_status); }; }; then
8534   cf_cv_ncurses_h2=$cf_header
8535
8536 else
8537   echo "$as_me: failed program was:" >&5
8538 cat conftest.$ac_ext >&5
8539 cf_cv_ncurses_h2=no
8540 fi
8541 rm -f conftest.$ac_objext conftest.$ac_ext
8542
8543                         if test "$cf_cv_ncurses_h2" != no ; then
8544                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8545                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8546                                 break
8547                         fi
8548                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8549                 done
8550                 CPPFLAGS="$cf_save2_CPPFLAGS"
8551                 test "$cf_cv_ncurses_h2" != no && break
8552         done
8553         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8553: error: not found" >&5
8554 echo "$as_me: error: not found" >&2;}
8555    { (exit 1); exit 1; }; }
8556
8557 fi
8558 echo "$as_me:8558: result: $cf_cv_ncurses_h2" >&5
8559 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8560
8561         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8562         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8563         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8564                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8565         fi
8566
8567 if test -n "$cf_1st_incdir" ; then
8568   for cf_add_incdir in $cf_1st_incdir
8569   do
8570         while test $cf_add_incdir != /usr/include
8571         do
8572           if test -d $cf_add_incdir
8573           then
8574                 cf_have_incdir=no
8575                 if test -n "$CFLAGS$CPPFLAGS" ; then
8576                   # a loop is needed to ensure we can add subdirs of existing dirs
8577                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8578                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8579                           cf_have_incdir=yes; break
8580                         fi
8581                   done
8582                 fi
8583
8584                 if test "$cf_have_incdir" = no ; then
8585                   if test "$cf_add_incdir" = /usr/local/include ; then
8586                         if test "$GCC" = yes
8587                         then
8588                           cf_save_CPPFLAGS=$CPPFLAGS
8589                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8590                           cat >conftest.$ac_ext <<_ACEOF
8591 #line 8591 "configure"
8592 #include "confdefs.h"
8593 #include <stdio.h>
8594 int
8595 main ()
8596 {
8597 printf("Hello")
8598   ;
8599   return 0;
8600 }
8601 _ACEOF
8602 rm -f conftest.$ac_objext
8603 if { (eval echo "$as_me:8603: \"$ac_compile\"") >&5
8604   (eval $ac_compile) 2>&5
8605   ac_status=$?
8606   echo "$as_me:8606: \$? = $ac_status" >&5
8607   (exit $ac_status); } &&
8608          { ac_try='test -s conftest.$ac_objext'
8609   { (eval echo "$as_me:8609: \"$ac_try\"") >&5
8610   (eval $ac_try) 2>&5
8611   ac_status=$?
8612   echo "$as_me:8612: \$? = $ac_status" >&5
8613   (exit $ac_status); }; }; then
8614   :
8615 else
8616   echo "$as_me: failed program was:" >&5
8617 cat conftest.$ac_ext >&5
8618 cf_have_incdir=yes
8619 fi
8620 rm -f conftest.$ac_objext conftest.$ac_ext
8621                           CPPFLAGS=$cf_save_CPPFLAGS
8622                         fi
8623                   fi
8624                 fi
8625
8626                 if test "$cf_have_incdir" = no ; then
8627                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8628
8629 echo "${as_me:-configure}:8629: testing adding $cf_add_incdir to include-path ..." 1>&5
8630
8631                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8632
8633                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8634                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8635                   cf_add_incdir="$cf_top_incdir"
8636                 else
8637                   break
8638                 fi
8639           else
8640                 break
8641           fi
8642         done
8643   done
8644 fi
8645
8646 fi
8647
8648 # Set definitions to allow ifdef'ing for ncurses.h
8649
8650 case $cf_cv_ncurses_header in
8651 (*ncurses.h)
8652
8653 cat >>confdefs.h <<\EOF
8654 #define HAVE_NCURSES_H 1
8655 EOF
8656
8657         ;;
8658 esac
8659
8660 case $cf_cv_ncurses_header in
8661 (ncurses/curses.h|ncurses/ncurses.h)
8662
8663 cat >>confdefs.h <<\EOF
8664 #define HAVE_NCURSES_NCURSES_H 1
8665 EOF
8666
8667         ;;
8668 (ncursesw/curses.h|ncursesw/ncurses.h)
8669
8670 cat >>confdefs.h <<\EOF
8671 #define HAVE_NCURSESW_NCURSES_H 1
8672 EOF
8673
8674         ;;
8675 esac
8676
8677 echo "$as_me:8677: checking for terminfo header" >&5
8678 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8679 if test "${cf_cv_term_header+set}" = set; then
8680   echo $ECHO_N "(cached) $ECHO_C" >&6
8681 else
8682
8683 case ${cf_cv_ncurses_header} in
8684 (*/ncurses.h|*/ncursesw.h)
8685         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8686         ;;
8687 (*)
8688         cf_term_header=term.h
8689         ;;
8690 esac
8691
8692 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8693 do
8694 cat >conftest.$ac_ext <<_ACEOF
8695 #line 8695 "configure"
8696 #include "confdefs.h"
8697 #include <stdio.h>
8698 #include <${cf_cv_ncurses_header:-curses.h}>
8699 #include <$cf_test>
8700
8701 int
8702 main ()
8703 {
8704 int x = auto_left_margin
8705   ;
8706   return 0;
8707 }
8708 _ACEOF
8709 rm -f conftest.$ac_objext
8710 if { (eval echo "$as_me:8710: \"$ac_compile\"") >&5
8711   (eval $ac_compile) 2>&5
8712   ac_status=$?
8713   echo "$as_me:8713: \$? = $ac_status" >&5
8714   (exit $ac_status); } &&
8715          { ac_try='test -s conftest.$ac_objext'
8716   { (eval echo "$as_me:8716: \"$ac_try\"") >&5
8717   (eval $ac_try) 2>&5
8718   ac_status=$?
8719   echo "$as_me:8719: \$? = $ac_status" >&5
8720   (exit $ac_status); }; }; then
8721
8722         cf_cv_term_header="$cf_test"
8723 else
8724   echo "$as_me: failed program was:" >&5
8725 cat conftest.$ac_ext >&5
8726
8727         cf_cv_term_header=unknown
8728
8729 fi
8730 rm -f conftest.$ac_objext conftest.$ac_ext
8731         test "$cf_cv_term_header" != unknown && break
8732 done
8733
8734 fi
8735 echo "$as_me:8735: result: $cf_cv_term_header" >&5
8736 echo "${ECHO_T}$cf_cv_term_header" >&6
8737
8738 # Set definitions to allow ifdef'ing to accommodate subdirectories
8739
8740 case $cf_cv_term_header in
8741 (*term.h)
8742
8743 cat >>confdefs.h <<\EOF
8744 #define HAVE_TERM_H 1
8745 EOF
8746
8747         ;;
8748 esac
8749
8750 case $cf_cv_term_header in
8751 (ncurses/term.h)
8752
8753 cat >>confdefs.h <<\EOF
8754 #define HAVE_NCURSES_TERM_H 1
8755 EOF
8756
8757         ;;
8758 (ncursesw/term.h)
8759
8760 cat >>confdefs.h <<\EOF
8761 #define HAVE_NCURSESW_TERM_H 1
8762 EOF
8763
8764         ;;
8765 esac
8766
8767 # some applications need this, but should check for NCURSES_VERSION
8768
8769 cat >>confdefs.h <<\EOF
8770 #define NCURSES 1
8771 EOF
8772
8773 echo "$as_me:8773: checking for ncurses version" >&5
8774 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8775 if test "${cf_cv_ncurses_version+set}" = set; then
8776   echo $ECHO_N "(cached) $ECHO_C" >&6
8777 else
8778
8779         cf_cv_ncurses_version=no
8780         cf_tempfile=out$$
8781         rm -f $cf_tempfile
8782         if test "$cross_compiling" = yes; then
8783
8784         # This will not work if the preprocessor splits the line after the
8785         # Autoconf token.  The 'unproto' program does that.
8786         cat > conftest.$ac_ext <<EOF
8787 #include <${cf_cv_ncurses_header:-curses.h}>
8788 #undef Autoconf
8789 #ifdef NCURSES_VERSION
8790 Autoconf NCURSES_VERSION
8791 #else
8792 #ifdef __NCURSES_H
8793 Autoconf "old"
8794 #endif
8795 ;
8796 #endif
8797 EOF
8798         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8799         { (eval echo "$as_me:8799: \"$cf_try\"") >&5
8800   (eval $cf_try) 2>&5
8801   ac_status=$?
8802   echo "$as_me:8802: \$? = $ac_status" >&5
8803   (exit $ac_status); }
8804         if test -f conftest.out ; then
8805                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8806                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8807                 rm -f conftest.out
8808         fi
8809
8810 else
8811   cat >conftest.$ac_ext <<_ACEOF
8812 #line 8812 "configure"
8813 #include "confdefs.h"
8814
8815 #include <${cf_cv_ncurses_header:-curses.h}>
8816 #include <stdio.h>
8817 int main()
8818 {
8819         FILE *fp = fopen("$cf_tempfile", "w");
8820 #ifdef NCURSES_VERSION
8821 # ifdef NCURSES_VERSION_PATCH
8822         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8823 # else
8824         fprintf(fp, "%s\n", NCURSES_VERSION);
8825 # endif
8826 #else
8827 # ifdef __NCURSES_H
8828         fprintf(fp, "old\n");
8829 # else
8830         make an error
8831 # endif
8832 #endif
8833         ${cf_cv_main_return:-return}(0);
8834 }
8835 _ACEOF
8836 rm -f conftest$ac_exeext
8837 if { (eval echo "$as_me:8837: \"$ac_link\"") >&5
8838   (eval $ac_link) 2>&5
8839   ac_status=$?
8840   echo "$as_me:8840: \$? = $ac_status" >&5
8841   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8842   { (eval echo "$as_me:8842: \"$ac_try\"") >&5
8843   (eval $ac_try) 2>&5
8844   ac_status=$?
8845   echo "$as_me:8845: \$? = $ac_status" >&5
8846   (exit $ac_status); }; }; then
8847
8848         cf_cv_ncurses_version=`cat $cf_tempfile`
8849 else
8850   echo "$as_me: program exited with status $ac_status" >&5
8851 echo "$as_me: failed program was:" >&5
8852 cat conftest.$ac_ext >&5
8853 fi
8854 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8855 fi
8856         rm -f $cf_tempfile
8857
8858 fi
8859 echo "$as_me:8859: result: $cf_cv_ncurses_version" >&5
8860 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8861 test "$cf_cv_ncurses_version" = no ||
8862 cat >>confdefs.h <<\EOF
8863 #define NCURSES 1
8864 EOF
8865
8866 cf_nculib_root=$cf_cv_screen
8867         # This works, except for the special case where we find gpm, but
8868         # ncurses is in a nonstandard location via $LIBS, and we really want
8869         # to link gpm.
8870 cf_ncurses_LIBS=""
8871 cf_ncurses_SAVE="$LIBS"
8872 echo "$as_me:8872: checking for Gpm_Open in -lgpm" >&5
8873 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8874 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8875   echo $ECHO_N "(cached) $ECHO_C" >&6
8876 else
8877   ac_check_lib_save_LIBS=$LIBS
8878 LIBS="-lgpm  $LIBS"
8879 cat >conftest.$ac_ext <<_ACEOF
8880 #line 8880 "configure"
8881 #include "confdefs.h"
8882
8883 /* Override any gcc2 internal prototype to avoid an error.  */
8884 #ifdef __cplusplus
8885 extern "C"
8886 #endif
8887 /* We use char because int might match the return type of a gcc2
8888    builtin and then its argument prototype would still apply.  */
8889 char Gpm_Open ();
8890 int
8891 main ()
8892 {
8893 Gpm_Open ();
8894   ;
8895   return 0;
8896 }
8897 _ACEOF
8898 rm -f conftest.$ac_objext conftest$ac_exeext
8899 if { (eval echo "$as_me:8899: \"$ac_link\"") >&5
8900   (eval $ac_link) 2>&5
8901   ac_status=$?
8902   echo "$as_me:8902: \$? = $ac_status" >&5
8903   (exit $ac_status); } &&
8904          { ac_try='test -s conftest$ac_exeext'
8905   { (eval echo "$as_me:8905: \"$ac_try\"") >&5
8906   (eval $ac_try) 2>&5
8907   ac_status=$?
8908   echo "$as_me:8908: \$? = $ac_status" >&5
8909   (exit $ac_status); }; }; then
8910   ac_cv_lib_gpm_Gpm_Open=yes
8911 else
8912   echo "$as_me: failed program was:" >&5
8913 cat conftest.$ac_ext >&5
8914 ac_cv_lib_gpm_Gpm_Open=no
8915 fi
8916 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8917 LIBS=$ac_check_lib_save_LIBS
8918 fi
8919 echo "$as_me:8919: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8920 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8921 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8922   echo "$as_me:8922: checking for initscr in -lgpm" >&5
8923 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8924 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8925   echo $ECHO_N "(cached) $ECHO_C" >&6
8926 else
8927   ac_check_lib_save_LIBS=$LIBS
8928 LIBS="-lgpm  $LIBS"
8929 cat >conftest.$ac_ext <<_ACEOF
8930 #line 8930 "configure"
8931 #include "confdefs.h"
8932
8933 /* Override any gcc2 internal prototype to avoid an error.  */
8934 #ifdef __cplusplus
8935 extern "C"
8936 #endif
8937 /* We use char because int might match the return type of a gcc2
8938    builtin and then its argument prototype would still apply.  */
8939 char initscr ();
8940 int
8941 main ()
8942 {
8943 initscr ();
8944   ;
8945   return 0;
8946 }
8947 _ACEOF
8948 rm -f conftest.$ac_objext conftest$ac_exeext
8949 if { (eval echo "$as_me:8949: \"$ac_link\"") >&5
8950   (eval $ac_link) 2>&5
8951   ac_status=$?
8952   echo "$as_me:8952: \$? = $ac_status" >&5
8953   (exit $ac_status); } &&
8954          { ac_try='test -s conftest$ac_exeext'
8955   { (eval echo "$as_me:8955: \"$ac_try\"") >&5
8956   (eval $ac_try) 2>&5
8957   ac_status=$?
8958   echo "$as_me:8958: \$? = $ac_status" >&5
8959   (exit $ac_status); }; }; then
8960   ac_cv_lib_gpm_initscr=yes
8961 else
8962   echo "$as_me: failed program was:" >&5
8963 cat conftest.$ac_ext >&5
8964 ac_cv_lib_gpm_initscr=no
8965 fi
8966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8967 LIBS=$ac_check_lib_save_LIBS
8968 fi
8969 echo "$as_me:8969: result: $ac_cv_lib_gpm_initscr" >&5
8970 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8971 if test $ac_cv_lib_gpm_initscr = yes; then
8972   LIBS="$cf_ncurses_SAVE"
8973 else
8974   cf_ncurses_LIBS="-lgpm"
8975 fi
8976
8977 fi
8978
8979 case $host_os in
8980 (freebsd*)
8981         # This is only necessary if you are linking against an obsolete
8982         # version of ncurses (but it should do no harm, since it's static).
8983         if test "$cf_nculib_root" = ncurses ; then
8984                 echo "$as_me:8984: checking for tgoto in -lmytinfo" >&5
8985 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8986 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8987   echo $ECHO_N "(cached) $ECHO_C" >&6
8988 else
8989   ac_check_lib_save_LIBS=$LIBS
8990 LIBS="-lmytinfo  $LIBS"
8991 cat >conftest.$ac_ext <<_ACEOF
8992 #line 8992 "configure"
8993 #include "confdefs.h"
8994
8995 /* Override any gcc2 internal prototype to avoid an error.  */
8996 #ifdef __cplusplus
8997 extern "C"
8998 #endif
8999 /* We use char because int might match the return type of a gcc2
9000    builtin and then its argument prototype would still apply.  */
9001 char tgoto ();
9002 int
9003 main ()
9004 {
9005 tgoto ();
9006   ;
9007   return 0;
9008 }
9009 _ACEOF
9010 rm -f conftest.$ac_objext conftest$ac_exeext
9011 if { (eval echo "$as_me:9011: \"$ac_link\"") >&5
9012   (eval $ac_link) 2>&5
9013   ac_status=$?
9014   echo "$as_me:9014: \$? = $ac_status" >&5
9015   (exit $ac_status); } &&
9016          { ac_try='test -s conftest$ac_exeext'
9017   { (eval echo "$as_me:9017: \"$ac_try\"") >&5
9018   (eval $ac_try) 2>&5
9019   ac_status=$?
9020   echo "$as_me:9020: \$? = $ac_status" >&5
9021   (exit $ac_status); }; }; then
9022   ac_cv_lib_mytinfo_tgoto=yes
9023 else
9024   echo "$as_me: failed program was:" >&5
9025 cat conftest.$ac_ext >&5
9026 ac_cv_lib_mytinfo_tgoto=no
9027 fi
9028 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9029 LIBS=$ac_check_lib_save_LIBS
9030 fi
9031 echo "$as_me:9031: result: $ac_cv_lib_mytinfo_tgoto" >&5
9032 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9033 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9034   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9035 fi
9036
9037         fi
9038         ;;
9039 esac
9040
9041 cf_add_libs="$cf_ncurses_LIBS"
9042 # Filter out duplicates - this happens with badly-designed ".pc" files...
9043 for cf_add_1lib in $LIBS
9044 do
9045         for cf_add_2lib in $cf_add_libs
9046         do
9047                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9048                 then
9049                         cf_add_1lib=
9050                         break
9051                 fi
9052         done
9053         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9054 done
9055 LIBS="$cf_add_libs"
9056
9057 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9058 then
9059
9060 cf_add_libs="-l$cf_nculib_root"
9061 # Filter out duplicates - this happens with badly-designed ".pc" files...
9062 for cf_add_1lib in $LIBS
9063 do
9064         for cf_add_2lib in $cf_add_libs
9065         do
9066                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9067                 then
9068                         cf_add_1lib=
9069                         break
9070                 fi
9071         done
9072         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9073 done
9074 LIBS="$cf_add_libs"
9075
9076 else
9077
9078         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9079         cf_libdir=""
9080         echo "$as_me:9080: checking for initscr" >&5
9081 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9082 if test "${ac_cv_func_initscr+set}" = set; then
9083   echo $ECHO_N "(cached) $ECHO_C" >&6
9084 else
9085   cat >conftest.$ac_ext <<_ACEOF
9086 #line 9086 "configure"
9087 #include "confdefs.h"
9088 /* System header to define __stub macros and hopefully few prototypes,
9089     which can conflict with char initscr (); below.  */
9090 #include <assert.h>
9091 /* Override any gcc2 internal prototype to avoid an error.  */
9092 #ifdef __cplusplus
9093 extern "C"
9094 #endif
9095 /* We use char because int might match the return type of a gcc2
9096    builtin and then its argument prototype would still apply.  */
9097 char initscr ();
9098 char (*f) ();
9099
9100 int
9101 main ()
9102 {
9103 /* The GNU C library defines this for functions which it implements
9104     to always fail with ENOSYS.  Some functions are actually named
9105     something starting with __ and the normal name is an alias.  */
9106 #if defined (__stub_initscr) || defined (__stub___initscr)
9107 choke me
9108 #else
9109 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9110 #endif
9111
9112   ;
9113   return 0;
9114 }
9115 _ACEOF
9116 rm -f conftest.$ac_objext conftest$ac_exeext
9117 if { (eval echo "$as_me:9117: \"$ac_link\"") >&5
9118   (eval $ac_link) 2>&5
9119   ac_status=$?
9120   echo "$as_me:9120: \$? = $ac_status" >&5
9121   (exit $ac_status); } &&
9122          { ac_try='test -s conftest$ac_exeext'
9123   { (eval echo "$as_me:9123: \"$ac_try\"") >&5
9124   (eval $ac_try) 2>&5
9125   ac_status=$?
9126   echo "$as_me:9126: \$? = $ac_status" >&5
9127   (exit $ac_status); }; }; then
9128   ac_cv_func_initscr=yes
9129 else
9130   echo "$as_me: failed program was:" >&5
9131 cat conftest.$ac_ext >&5
9132 ac_cv_func_initscr=no
9133 fi
9134 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9135 fi
9136 echo "$as_me:9136: result: $ac_cv_func_initscr" >&5
9137 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9138 if test $ac_cv_func_initscr = yes; then
9139   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9140 else
9141
9142                 cf_save_LIBS="$LIBS"
9143                 echo "$as_me:9143: checking for initscr in -l$cf_nculib_root" >&5
9144 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9145                 LIBS="-l$cf_nculib_root $LIBS"
9146                 cat >conftest.$ac_ext <<_ACEOF
9147 #line 9147 "configure"
9148 #include "confdefs.h"
9149 #include <${cf_cv_ncurses_header:-curses.h}>
9150 int
9151 main ()
9152 {
9153 initscr()
9154   ;
9155   return 0;
9156 }
9157 _ACEOF
9158 rm -f conftest.$ac_objext conftest$ac_exeext
9159 if { (eval echo "$as_me:9159: \"$ac_link\"") >&5
9160   (eval $ac_link) 2>&5
9161   ac_status=$?
9162   echo "$as_me:9162: \$? = $ac_status" >&5
9163   (exit $ac_status); } &&
9164          { ac_try='test -s conftest$ac_exeext'
9165   { (eval echo "$as_me:9165: \"$ac_try\"") >&5
9166   (eval $ac_try) 2>&5
9167   ac_status=$?
9168   echo "$as_me:9168: \$? = $ac_status" >&5
9169   (exit $ac_status); }; }; then
9170   echo "$as_me:9170: result: yes" >&5
9171 echo "${ECHO_T}yes" >&6
9172                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9173
9174 else
9175   echo "$as_me: failed program was:" >&5
9176 cat conftest.$ac_ext >&5
9177 echo "$as_me:9177: result: no" >&5
9178 echo "${ECHO_T}no" >&6
9179
9180 cf_search=
9181 cf_library_path_list=""
9182 if test -n "${LDFLAGS}${LIBS}" ; then
9183         for cf_library_path in $LDFLAGS $LIBS
9184         do
9185                 case $cf_library_path in
9186                 (-L*)
9187                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9188
9189 test "x$cf_library_path" != "xNONE" && \
9190 test -d "$cf_library_path" && \
9191  {
9192         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9193         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9194         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9195         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9196         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9197         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"
9198 }
9199
9200                         cf_library_path_list="$cf_library_path_list $cf_search"
9201                         ;;
9202                 esac
9203         done
9204 fi
9205
9206 cf_search=
9207
9208 test "x$prefix" != "xNONE" && \
9209 test -d "$prefix" && \
9210  {
9211         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9212         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9213         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9214         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9215         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9216         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9217 }
9218
9219 for cf_subdir_prefix in \
9220         /usr \
9221         /usr/local \
9222         /usr/pkg \
9223         /opt \
9224         /opt/local \
9225         $HOME
9226 do
9227
9228 test "x$cf_subdir_prefix" != "x$prefix" && \
9229 test -d "$cf_subdir_prefix" && \
9230 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9231         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9232         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9233         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9234         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9235         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9236         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"
9237 }
9238
9239 done
9240
9241 cf_search="$cf_library_path_list $cf_search"
9242
9243                         for cf_libdir in $cf_search
9244                         do
9245                                 echo "$as_me:9245: checking for -l$cf_nculib_root in $cf_libdir" >&5
9246 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9247                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9248                                 cat >conftest.$ac_ext <<_ACEOF
9249 #line 9249 "configure"
9250 #include "confdefs.h"
9251 #include <${cf_cv_ncurses_header:-curses.h}>
9252 int
9253 main ()
9254 {
9255 initscr()
9256   ;
9257   return 0;
9258 }
9259 _ACEOF
9260 rm -f conftest.$ac_objext conftest$ac_exeext
9261 if { (eval echo "$as_me:9261: \"$ac_link\"") >&5
9262   (eval $ac_link) 2>&5
9263   ac_status=$?
9264   echo "$as_me:9264: \$? = $ac_status" >&5
9265   (exit $ac_status); } &&
9266          { ac_try='test -s conftest$ac_exeext'
9267   { (eval echo "$as_me:9267: \"$ac_try\"") >&5
9268   (eval $ac_try) 2>&5
9269   ac_status=$?
9270   echo "$as_me:9270: \$? = $ac_status" >&5
9271   (exit $ac_status); }; }; then
9272   echo "$as_me:9272: result: yes" >&5
9273 echo "${ECHO_T}yes" >&6
9274                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9275                                          break
9276 else
9277   echo "$as_me: failed program was:" >&5
9278 cat conftest.$ac_ext >&5
9279 echo "$as_me:9279: result: no" >&5
9280 echo "${ECHO_T}no" >&6
9281                                          LIBS="$cf_save_LIBS"
9282 fi
9283 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9284                         done
9285
9286 fi
9287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9288
9289 fi
9290
9291 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9292
9293 if test $cf_found_library = no ; then
9294         { { echo "$as_me:9294: error: Cannot link $cf_nculib_root library" >&5
9295 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9296    { (exit 1); exit 1; }; }
9297 fi
9298
9299 fi
9300
9301 if test -n "$cf_ncurses_LIBS" ; then
9302         echo "$as_me:9302: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9303 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9304         cf_ncurses_SAVE="$LIBS"
9305         for p in $cf_ncurses_LIBS ; do
9306                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9307                 if test "$q" != "$LIBS" ; then
9308                         LIBS="$q"
9309                 fi
9310         done
9311         cat >conftest.$ac_ext <<_ACEOF
9312 #line 9312 "configure"
9313 #include "confdefs.h"
9314 #include <${cf_cv_ncurses_header:-curses.h}>
9315 int
9316 main ()
9317 {
9318 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9319   ;
9320   return 0;
9321 }
9322 _ACEOF
9323 rm -f conftest.$ac_objext conftest$ac_exeext
9324 if { (eval echo "$as_me:9324: \"$ac_link\"") >&5
9325   (eval $ac_link) 2>&5
9326   ac_status=$?
9327   echo "$as_me:9327: \$? = $ac_status" >&5
9328   (exit $ac_status); } &&
9329          { ac_try='test -s conftest$ac_exeext'
9330   { (eval echo "$as_me:9330: \"$ac_try\"") >&5
9331   (eval $ac_try) 2>&5
9332   ac_status=$?
9333   echo "$as_me:9333: \$? = $ac_status" >&5
9334   (exit $ac_status); }; }; then
9335   echo "$as_me:9335: result: yes" >&5
9336 echo "${ECHO_T}yes" >&6
9337 else
9338   echo "$as_me: failed program was:" >&5
9339 cat conftest.$ac_ext >&5
9340 echo "$as_me:9340: result: no" >&5
9341 echo "${ECHO_T}no" >&6
9342                  LIBS="$cf_ncurses_SAVE"
9343 fi
9344 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9345 fi
9346
9347 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9348
9349 cat >>confdefs.h <<EOF
9350 #define $cf_nculib_ROOT 1
9351 EOF
9352
9353         fi
9354 else
9355         NCURSES_CONFIG=none
9356 fi
9357
9358         ;;
9359 (pdcurses)
9360         echo "$as_me:9360: checking for X" >&5
9361 echo $ECHO_N "checking for X... $ECHO_C" >&6
9362
9363 # Check whether --with-x or --without-x was given.
9364 if test "${with_x+set}" = set; then
9365   withval="$with_x"
9366
9367 fi;
9368 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9369 if test "x$with_x" = xno; then
9370   # The user explicitly disabled X.
9371   have_x=disabled
9372 else
9373   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9374     # Both variables are already set.
9375     have_x=yes
9376   else
9377     if test "${ac_cv_have_x+set}" = set; then
9378   echo $ECHO_N "(cached) $ECHO_C" >&6
9379 else
9380   # One or both of the vars are not set, and there is no cached value.
9381 ac_x_includes=no ac_x_libraries=no
9382 rm -fr conftest.dir
9383 if mkdir conftest.dir; then
9384   cd conftest.dir
9385   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9386   cat >Imakefile <<'EOF'
9387 acfindx:
9388         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9389 EOF
9390   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9391     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9392     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9393     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9394     for ac_extension in a so sl dylib dll; do
9395       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9396          test -f $ac_im_libdir/libX11.$ac_extension; then
9397         ac_im_usrlibdir=$ac_im_libdir; break
9398       fi
9399     done
9400     # Screen out bogus values from the imake configuration.  They are
9401     # bogus both because they are the default anyway, and because
9402     # using them would break gcc on systems where it needs fixed includes.
9403     case $ac_im_incroot in
9404         /usr/include) ;;
9405         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9406     esac
9407     case $ac_im_usrlibdir in
9408         /usr/lib | /lib) ;;
9409         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9410     esac
9411   fi
9412   cd ..
9413   rm -fr conftest.dir
9414 fi
9415
9416 # Standard set of common directories for X headers.
9417 # Check X11 before X11Rn because it is often a symlink to the current release.
9418 ac_x_header_dirs='
9419 /usr/X11/include
9420 /usr/X11R6/include
9421 /usr/X11R5/include
9422 /usr/X11R4/include
9423
9424 /usr/include/X11
9425 /usr/include/X11R6
9426 /usr/include/X11R5
9427 /usr/include/X11R4
9428
9429 /usr/local/X11/include
9430 /usr/local/X11R6/include
9431 /usr/local/X11R5/include
9432 /usr/local/X11R4/include
9433
9434 /usr/local/include/X11
9435 /usr/local/include/X11R6
9436 /usr/local/include/X11R5
9437 /usr/local/include/X11R4
9438
9439 /usr/X386/include
9440 /usr/x386/include
9441 /usr/XFree86/include/X11
9442
9443 /usr/include
9444 /usr/local/include
9445 /usr/unsupported/include
9446 /usr/athena/include
9447 /usr/local/x11r5/include
9448 /usr/lpp/Xamples/include
9449
9450 /usr/openwin/include
9451 /usr/openwin/share/include'
9452
9453 if test "$ac_x_includes" = no; then
9454   # Guess where to find include files, by looking for Intrinsic.h.
9455   # First, try using that file with no special directory specified.
9456   cat >conftest.$ac_ext <<_ACEOF
9457 #line 9457 "configure"
9458 #include "confdefs.h"
9459 #include <X11/Intrinsic.h>
9460 _ACEOF
9461 if { (eval echo "$as_me:9461: \"$ac_cpp conftest.$ac_ext\"") >&5
9462   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9463   ac_status=$?
9464   egrep -v '^ *\+' conftest.er1 >conftest.err
9465   rm -f conftest.er1
9466   cat conftest.err >&5
9467   echo "$as_me:9467: \$? = $ac_status" >&5
9468   (exit $ac_status); } >/dev/null; then
9469   if test -s conftest.err; then
9470     ac_cpp_err=$ac_c_preproc_warn_flag
9471   else
9472     ac_cpp_err=
9473   fi
9474 else
9475   ac_cpp_err=yes
9476 fi
9477 if test -z "$ac_cpp_err"; then
9478   # We can compile using X headers with no special include directory.
9479 ac_x_includes=
9480 else
9481   echo "$as_me: failed program was:" >&5
9482   cat conftest.$ac_ext >&5
9483   for ac_dir in $ac_x_header_dirs; do
9484   if test -r "$ac_dir/X11/Intrinsic.h"; then
9485     ac_x_includes=$ac_dir
9486     break
9487   fi
9488 done
9489 fi
9490 rm -f conftest.err conftest.$ac_ext
9491 fi # $ac_x_includes = no
9492
9493 if test "$ac_x_libraries" = no; then
9494   # Check for the libraries.
9495   # See if we find them without any special options.
9496   # Don't add to $LIBS permanently.
9497   ac_save_LIBS=$LIBS
9498   LIBS="-lXt $LIBS"
9499   cat >conftest.$ac_ext <<_ACEOF
9500 #line 9500 "configure"
9501 #include "confdefs.h"
9502 #include <X11/Intrinsic.h>
9503 int
9504 main ()
9505 {
9506 XtMalloc (0)
9507   ;
9508   return 0;
9509 }
9510 _ACEOF
9511 rm -f conftest.$ac_objext conftest$ac_exeext
9512 if { (eval echo "$as_me:9512: \"$ac_link\"") >&5
9513   (eval $ac_link) 2>&5
9514   ac_status=$?
9515   echo "$as_me:9515: \$? = $ac_status" >&5
9516   (exit $ac_status); } &&
9517          { ac_try='test -s conftest$ac_exeext'
9518   { (eval echo "$as_me:9518: \"$ac_try\"") >&5
9519   (eval $ac_try) 2>&5
9520   ac_status=$?
9521   echo "$as_me:9521: \$? = $ac_status" >&5
9522   (exit $ac_status); }; }; then
9523   LIBS=$ac_save_LIBS
9524 # We can link X programs with no special library path.
9525 ac_x_libraries=
9526 else
9527   echo "$as_me: failed program was:" >&5
9528 cat conftest.$ac_ext >&5
9529 LIBS=$ac_save_LIBS
9530 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9531 do
9532   # Don't even attempt the hair of trying to link an X program!
9533   for ac_extension in a so sl dylib dll; do
9534     if test -r $ac_dir/libXt.$ac_extension; then
9535       ac_x_libraries=$ac_dir
9536       break 2
9537     fi
9538   done
9539 done
9540 fi
9541 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9542 fi # $ac_x_libraries = no
9543
9544 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9545   # Didn't find X anywhere.  Cache the known absence of X.
9546   ac_cv_have_x="have_x=no"
9547 else
9548   # Record where we found X for the cache.
9549   ac_cv_have_x="have_x=yes \
9550                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9551 fi
9552 fi
9553
9554   fi
9555   eval "$ac_cv_have_x"
9556 fi # $with_x != no
9557
9558 if test "$have_x" != yes; then
9559   echo "$as_me:9559: result: $have_x" >&5
9560 echo "${ECHO_T}$have_x" >&6
9561   no_x=yes
9562 else
9563   # If each of the values was on the command line, it overrides each guess.
9564   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9565   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9566   # Update the cache value to reflect the command line values.
9567   ac_cv_have_x="have_x=yes \
9568                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9569   echo "$as_me:9569: result: libraries $x_libraries, headers $x_includes" >&5
9570 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9571 fi
9572
9573 if test "$no_x" = yes; then
9574   # Not all programs may use this symbol, but it does not hurt to define it.
9575
9576 cat >>confdefs.h <<\EOF
9577 #define X_DISPLAY_MISSING 1
9578 EOF
9579
9580   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9581 else
9582   if test -n "$x_includes"; then
9583     X_CFLAGS="$X_CFLAGS -I$x_includes"
9584   fi
9585
9586   # It would also be nice to do this for all -L options, not just this one.
9587   if test -n "$x_libraries"; then
9588     X_LIBS="$X_LIBS -L$x_libraries"
9589     # For Solaris; some versions of Sun CC require a space after -R and
9590     # others require no space.  Words are not sufficient . . . .
9591     case `(uname -sr) 2>/dev/null` in
9592     "SunOS 5"*)
9593       echo "$as_me:9593: checking whether -R must be followed by a space" >&5
9594 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9595       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9596       cat >conftest.$ac_ext <<_ACEOF
9597 #line 9597 "configure"
9598 #include "confdefs.h"
9599
9600 int
9601 main ()
9602 {
9603
9604   ;
9605   return 0;
9606 }
9607 _ACEOF
9608 rm -f conftest.$ac_objext conftest$ac_exeext
9609 if { (eval echo "$as_me:9609: \"$ac_link\"") >&5
9610   (eval $ac_link) 2>&5
9611   ac_status=$?
9612   echo "$as_me:9612: \$? = $ac_status" >&5
9613   (exit $ac_status); } &&
9614          { ac_try='test -s conftest$ac_exeext'
9615   { (eval echo "$as_me:9615: \"$ac_try\"") >&5
9616   (eval $ac_try) 2>&5
9617   ac_status=$?
9618   echo "$as_me:9618: \$? = $ac_status" >&5
9619   (exit $ac_status); }; }; then
9620   ac_R_nospace=yes
9621 else
9622   echo "$as_me: failed program was:" >&5
9623 cat conftest.$ac_ext >&5
9624 ac_R_nospace=no
9625 fi
9626 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9627       if test $ac_R_nospace = yes; then
9628         echo "$as_me:9628: result: no" >&5
9629 echo "${ECHO_T}no" >&6
9630         X_LIBS="$X_LIBS -R$x_libraries"
9631       else
9632         LIBS="$ac_xsave_LIBS -R $x_libraries"
9633         cat >conftest.$ac_ext <<_ACEOF
9634 #line 9634 "configure"
9635 #include "confdefs.h"
9636
9637 int
9638 main ()
9639 {
9640
9641   ;
9642   return 0;
9643 }
9644 _ACEOF
9645 rm -f conftest.$ac_objext conftest$ac_exeext
9646 if { (eval echo "$as_me:9646: \"$ac_link\"") >&5
9647   (eval $ac_link) 2>&5
9648   ac_status=$?
9649   echo "$as_me:9649: \$? = $ac_status" >&5
9650   (exit $ac_status); } &&
9651          { ac_try='test -s conftest$ac_exeext'
9652   { (eval echo "$as_me:9652: \"$ac_try\"") >&5
9653   (eval $ac_try) 2>&5
9654   ac_status=$?
9655   echo "$as_me:9655: \$? = $ac_status" >&5
9656   (exit $ac_status); }; }; then
9657   ac_R_space=yes
9658 else
9659   echo "$as_me: failed program was:" >&5
9660 cat conftest.$ac_ext >&5
9661 ac_R_space=no
9662 fi
9663 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9664         if test $ac_R_space = yes; then
9665           echo "$as_me:9665: result: yes" >&5
9666 echo "${ECHO_T}yes" >&6
9667           X_LIBS="$X_LIBS -R $x_libraries"
9668         else
9669           echo "$as_me:9669: result: neither works" >&5
9670 echo "${ECHO_T}neither works" >&6
9671         fi
9672       fi
9673       LIBS=$ac_xsave_LIBS
9674     esac
9675   fi
9676
9677   # Check for system-dependent libraries X programs must link with.
9678   # Do this before checking for the system-independent R6 libraries
9679   # (-lICE), since we may need -lsocket or whatever for X linking.
9680
9681   if test "$ISC" = yes; then
9682     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9683   else
9684     # Martyn Johnson says this is needed for Ultrix, if the X
9685     # libraries were built with DECnet support.  And Karl Berry says
9686     # the Alpha needs dnet_stub (dnet does not exist).
9687     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9688     cat >conftest.$ac_ext <<_ACEOF
9689 #line 9689 "configure"
9690 #include "confdefs.h"
9691
9692 /* Override any gcc2 internal prototype to avoid an error.  */
9693 #ifdef __cplusplus
9694 extern "C"
9695 #endif
9696 /* We use char because int might match the return type of a gcc2
9697    builtin and then its argument prototype would still apply.  */
9698 char XOpenDisplay ();
9699 int
9700 main ()
9701 {
9702 XOpenDisplay ();
9703   ;
9704   return 0;
9705 }
9706 _ACEOF
9707 rm -f conftest.$ac_objext conftest$ac_exeext
9708 if { (eval echo "$as_me:9708: \"$ac_link\"") >&5
9709   (eval $ac_link) 2>&5
9710   ac_status=$?
9711   echo "$as_me:9711: \$? = $ac_status" >&5
9712   (exit $ac_status); } &&
9713          { ac_try='test -s conftest$ac_exeext'
9714   { (eval echo "$as_me:9714: \"$ac_try\"") >&5
9715   (eval $ac_try) 2>&5
9716   ac_status=$?
9717   echo "$as_me:9717: \$? = $ac_status" >&5
9718   (exit $ac_status); }; }; then
9719   :
9720 else
9721   echo "$as_me: failed program was:" >&5
9722 cat conftest.$ac_ext >&5
9723 echo "$as_me:9723: checking for dnet_ntoa in -ldnet" >&5
9724 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9725 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9726   echo $ECHO_N "(cached) $ECHO_C" >&6
9727 else
9728   ac_check_lib_save_LIBS=$LIBS
9729 LIBS="-ldnet  $LIBS"
9730 cat >conftest.$ac_ext <<_ACEOF
9731 #line 9731 "configure"
9732 #include "confdefs.h"
9733
9734 /* Override any gcc2 internal prototype to avoid an error.  */
9735 #ifdef __cplusplus
9736 extern "C"
9737 #endif
9738 /* We use char because int might match the return type of a gcc2
9739    builtin and then its argument prototype would still apply.  */
9740 char dnet_ntoa ();
9741 int
9742 main ()
9743 {
9744 dnet_ntoa ();
9745   ;
9746   return 0;
9747 }
9748 _ACEOF
9749 rm -f conftest.$ac_objext conftest$ac_exeext
9750 if { (eval echo "$as_me:9750: \"$ac_link\"") >&5
9751   (eval $ac_link) 2>&5
9752   ac_status=$?
9753   echo "$as_me:9753: \$? = $ac_status" >&5
9754   (exit $ac_status); } &&
9755          { ac_try='test -s conftest$ac_exeext'
9756   { (eval echo "$as_me:9756: \"$ac_try\"") >&5
9757   (eval $ac_try) 2>&5
9758   ac_status=$?
9759   echo "$as_me:9759: \$? = $ac_status" >&5
9760   (exit $ac_status); }; }; then
9761   ac_cv_lib_dnet_dnet_ntoa=yes
9762 else
9763   echo "$as_me: failed program was:" >&5
9764 cat conftest.$ac_ext >&5
9765 ac_cv_lib_dnet_dnet_ntoa=no
9766 fi
9767 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9768 LIBS=$ac_check_lib_save_LIBS
9769 fi
9770 echo "$as_me:9770: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9771 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9772 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9773   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9774 fi
9775
9776     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9777       echo "$as_me:9777: checking for dnet_ntoa in -ldnet_stub" >&5
9778 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9779 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9780   echo $ECHO_N "(cached) $ECHO_C" >&6
9781 else
9782   ac_check_lib_save_LIBS=$LIBS
9783 LIBS="-ldnet_stub  $LIBS"
9784 cat >conftest.$ac_ext <<_ACEOF
9785 #line 9785 "configure"
9786 #include "confdefs.h"
9787
9788 /* Override any gcc2 internal prototype to avoid an error.  */
9789 #ifdef __cplusplus
9790 extern "C"
9791 #endif
9792 /* We use char because int might match the return type of a gcc2
9793    builtin and then its argument prototype would still apply.  */
9794 char dnet_ntoa ();
9795 int
9796 main ()
9797 {
9798 dnet_ntoa ();
9799   ;
9800   return 0;
9801 }
9802 _ACEOF
9803 rm -f conftest.$ac_objext conftest$ac_exeext
9804 if { (eval echo "$as_me:9804: \"$ac_link\"") >&5
9805   (eval $ac_link) 2>&5
9806   ac_status=$?
9807   echo "$as_me:9807: \$? = $ac_status" >&5
9808   (exit $ac_status); } &&
9809          { ac_try='test -s conftest$ac_exeext'
9810   { (eval echo "$as_me:9810: \"$ac_try\"") >&5
9811   (eval $ac_try) 2>&5
9812   ac_status=$?
9813   echo "$as_me:9813: \$? = $ac_status" >&5
9814   (exit $ac_status); }; }; then
9815   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9816 else
9817   echo "$as_me: failed program was:" >&5
9818 cat conftest.$ac_ext >&5
9819 ac_cv_lib_dnet_stub_dnet_ntoa=no
9820 fi
9821 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9822 LIBS=$ac_check_lib_save_LIBS
9823 fi
9824 echo "$as_me:9824: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9825 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9826 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9827   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9828 fi
9829
9830     fi
9831 fi
9832 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9833     LIBS="$ac_xsave_LIBS"
9834
9835     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9836     # to get the SysV transport functions.
9837     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9838     # needs -lnsl.
9839     # The nsl library prevents programs from opening the X display
9840     # on Irix 5.2, according to T.E. Dickey.
9841     # The functions gethostbyname, getservbyname, and inet_addr are
9842     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9843     echo "$as_me:9843: checking for gethostbyname" >&5
9844 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9845 if test "${ac_cv_func_gethostbyname+set}" = set; then
9846   echo $ECHO_N "(cached) $ECHO_C" >&6
9847 else
9848   cat >conftest.$ac_ext <<_ACEOF
9849 #line 9849 "configure"
9850 #include "confdefs.h"
9851 /* System header to define __stub macros and hopefully few prototypes,
9852     which can conflict with char gethostbyname (); below.  */
9853 #include <assert.h>
9854 /* Override any gcc2 internal prototype to avoid an error.  */
9855 #ifdef __cplusplus
9856 extern "C"
9857 #endif
9858 /* We use char because int might match the return type of a gcc2
9859    builtin and then its argument prototype would still apply.  */
9860 char gethostbyname ();
9861 char (*f) ();
9862
9863 int
9864 main ()
9865 {
9866 /* The GNU C library defines this for functions which it implements
9867     to always fail with ENOSYS.  Some functions are actually named
9868     something starting with __ and the normal name is an alias.  */
9869 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9870 choke me
9871 #else
9872 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9873 #endif
9874
9875   ;
9876   return 0;
9877 }
9878 _ACEOF
9879 rm -f conftest.$ac_objext conftest$ac_exeext
9880 if { (eval echo "$as_me:9880: \"$ac_link\"") >&5
9881   (eval $ac_link) 2>&5
9882   ac_status=$?
9883   echo "$as_me:9883: \$? = $ac_status" >&5
9884   (exit $ac_status); } &&
9885          { ac_try='test -s conftest$ac_exeext'
9886   { (eval echo "$as_me:9886: \"$ac_try\"") >&5
9887   (eval $ac_try) 2>&5
9888   ac_status=$?
9889   echo "$as_me:9889: \$? = $ac_status" >&5
9890   (exit $ac_status); }; }; then
9891   ac_cv_func_gethostbyname=yes
9892 else
9893   echo "$as_me: failed program was:" >&5
9894 cat conftest.$ac_ext >&5
9895 ac_cv_func_gethostbyname=no
9896 fi
9897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9898 fi
9899 echo "$as_me:9899: result: $ac_cv_func_gethostbyname" >&5
9900 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9901
9902     if test $ac_cv_func_gethostbyname = no; then
9903       echo "$as_me:9903: checking for gethostbyname in -lnsl" >&5
9904 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9905 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9906   echo $ECHO_N "(cached) $ECHO_C" >&6
9907 else
9908   ac_check_lib_save_LIBS=$LIBS
9909 LIBS="-lnsl  $LIBS"
9910 cat >conftest.$ac_ext <<_ACEOF
9911 #line 9911 "configure"
9912 #include "confdefs.h"
9913
9914 /* Override any gcc2 internal prototype to avoid an error.  */
9915 #ifdef __cplusplus
9916 extern "C"
9917 #endif
9918 /* We use char because int might match the return type of a gcc2
9919    builtin and then its argument prototype would still apply.  */
9920 char gethostbyname ();
9921 int
9922 main ()
9923 {
9924 gethostbyname ();
9925   ;
9926   return 0;
9927 }
9928 _ACEOF
9929 rm -f conftest.$ac_objext conftest$ac_exeext
9930 if { (eval echo "$as_me:9930: \"$ac_link\"") >&5
9931   (eval $ac_link) 2>&5
9932   ac_status=$?
9933   echo "$as_me:9933: \$? = $ac_status" >&5
9934   (exit $ac_status); } &&
9935          { ac_try='test -s conftest$ac_exeext'
9936   { (eval echo "$as_me:9936: \"$ac_try\"") >&5
9937   (eval $ac_try) 2>&5
9938   ac_status=$?
9939   echo "$as_me:9939: \$? = $ac_status" >&5
9940   (exit $ac_status); }; }; then
9941   ac_cv_lib_nsl_gethostbyname=yes
9942 else
9943   echo "$as_me: failed program was:" >&5
9944 cat conftest.$ac_ext >&5
9945 ac_cv_lib_nsl_gethostbyname=no
9946 fi
9947 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9948 LIBS=$ac_check_lib_save_LIBS
9949 fi
9950 echo "$as_me:9950: result: $ac_cv_lib_nsl_gethostbyname" >&5
9951 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9952 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9953   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9954 fi
9955
9956       if test $ac_cv_lib_nsl_gethostbyname = no; then
9957         echo "$as_me:9957: checking for gethostbyname in -lbsd" >&5
9958 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9959 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9960   echo $ECHO_N "(cached) $ECHO_C" >&6
9961 else
9962   ac_check_lib_save_LIBS=$LIBS
9963 LIBS="-lbsd  $LIBS"
9964 cat >conftest.$ac_ext <<_ACEOF
9965 #line 9965 "configure"
9966 #include "confdefs.h"
9967
9968 /* Override any gcc2 internal prototype to avoid an error.  */
9969 #ifdef __cplusplus
9970 extern "C"
9971 #endif
9972 /* We use char because int might match the return type of a gcc2
9973    builtin and then its argument prototype would still apply.  */
9974 char gethostbyname ();
9975 int
9976 main ()
9977 {
9978 gethostbyname ();
9979   ;
9980   return 0;
9981 }
9982 _ACEOF
9983 rm -f conftest.$ac_objext conftest$ac_exeext
9984 if { (eval echo "$as_me:9984: \"$ac_link\"") >&5
9985   (eval $ac_link) 2>&5
9986   ac_status=$?
9987   echo "$as_me:9987: \$? = $ac_status" >&5
9988   (exit $ac_status); } &&
9989          { ac_try='test -s conftest$ac_exeext'
9990   { (eval echo "$as_me:9990: \"$ac_try\"") >&5
9991   (eval $ac_try) 2>&5
9992   ac_status=$?
9993   echo "$as_me:9993: \$? = $ac_status" >&5
9994   (exit $ac_status); }; }; then
9995   ac_cv_lib_bsd_gethostbyname=yes
9996 else
9997   echo "$as_me: failed program was:" >&5
9998 cat conftest.$ac_ext >&5
9999 ac_cv_lib_bsd_gethostbyname=no
10000 fi
10001 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10002 LIBS=$ac_check_lib_save_LIBS
10003 fi
10004 echo "$as_me:10004: result: $ac_cv_lib_bsd_gethostbyname" >&5
10005 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10006 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10007   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10008 fi
10009
10010       fi
10011     fi
10012
10013     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10014     # socket/setsockopt and other routines are undefined under SCO ODT
10015     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10016     # on later versions), says Simon Leinen: it contains gethostby*
10017     # variants that don't use the nameserver (or something).  -lsocket
10018     # must be given before -lnsl if both are needed.  We assume that
10019     # if connect needs -lnsl, so does gethostbyname.
10020     echo "$as_me:10020: checking for connect" >&5
10021 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10022 if test "${ac_cv_func_connect+set}" = set; then
10023   echo $ECHO_N "(cached) $ECHO_C" >&6
10024 else
10025   cat >conftest.$ac_ext <<_ACEOF
10026 #line 10026 "configure"
10027 #include "confdefs.h"
10028 /* System header to define __stub macros and hopefully few prototypes,
10029     which can conflict with char connect (); below.  */
10030 #include <assert.h>
10031 /* Override any gcc2 internal prototype to avoid an error.  */
10032 #ifdef __cplusplus
10033 extern "C"
10034 #endif
10035 /* We use char because int might match the return type of a gcc2
10036    builtin and then its argument prototype would still apply.  */
10037 char connect ();
10038 char (*f) ();
10039
10040 int
10041 main ()
10042 {
10043 /* The GNU C library defines this for functions which it implements
10044     to always fail with ENOSYS.  Some functions are actually named
10045     something starting with __ and the normal name is an alias.  */
10046 #if defined (__stub_connect) || defined (__stub___connect)
10047 choke me
10048 #else
10049 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10050 #endif
10051
10052   ;
10053   return 0;
10054 }
10055 _ACEOF
10056 rm -f conftest.$ac_objext conftest$ac_exeext
10057 if { (eval echo "$as_me:10057: \"$ac_link\"") >&5
10058   (eval $ac_link) 2>&5
10059   ac_status=$?
10060   echo "$as_me:10060: \$? = $ac_status" >&5
10061   (exit $ac_status); } &&
10062          { ac_try='test -s conftest$ac_exeext'
10063   { (eval echo "$as_me:10063: \"$ac_try\"") >&5
10064   (eval $ac_try) 2>&5
10065   ac_status=$?
10066   echo "$as_me:10066: \$? = $ac_status" >&5
10067   (exit $ac_status); }; }; then
10068   ac_cv_func_connect=yes
10069 else
10070   echo "$as_me: failed program was:" >&5
10071 cat conftest.$ac_ext >&5
10072 ac_cv_func_connect=no
10073 fi
10074 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10075 fi
10076 echo "$as_me:10076: result: $ac_cv_func_connect" >&5
10077 echo "${ECHO_T}$ac_cv_func_connect" >&6
10078
10079     if test $ac_cv_func_connect = no; then
10080       echo "$as_me:10080: checking for connect in -lsocket" >&5
10081 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10082 if test "${ac_cv_lib_socket_connect+set}" = set; then
10083   echo $ECHO_N "(cached) $ECHO_C" >&6
10084 else
10085   ac_check_lib_save_LIBS=$LIBS
10086 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10087 cat >conftest.$ac_ext <<_ACEOF
10088 #line 10088 "configure"
10089 #include "confdefs.h"
10090
10091 /* Override any gcc2 internal prototype to avoid an error.  */
10092 #ifdef __cplusplus
10093 extern "C"
10094 #endif
10095 /* We use char because int might match the return type of a gcc2
10096    builtin and then its argument prototype would still apply.  */
10097 char connect ();
10098 int
10099 main ()
10100 {
10101 connect ();
10102   ;
10103   return 0;
10104 }
10105 _ACEOF
10106 rm -f conftest.$ac_objext conftest$ac_exeext
10107 if { (eval echo "$as_me:10107: \"$ac_link\"") >&5
10108   (eval $ac_link) 2>&5
10109   ac_status=$?
10110   echo "$as_me:10110: \$? = $ac_status" >&5
10111   (exit $ac_status); } &&
10112          { ac_try='test -s conftest$ac_exeext'
10113   { (eval echo "$as_me:10113: \"$ac_try\"") >&5
10114   (eval $ac_try) 2>&5
10115   ac_status=$?
10116   echo "$as_me:10116: \$? = $ac_status" >&5
10117   (exit $ac_status); }; }; then
10118   ac_cv_lib_socket_connect=yes
10119 else
10120   echo "$as_me: failed program was:" >&5
10121 cat conftest.$ac_ext >&5
10122 ac_cv_lib_socket_connect=no
10123 fi
10124 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10125 LIBS=$ac_check_lib_save_LIBS
10126 fi
10127 echo "$as_me:10127: result: $ac_cv_lib_socket_connect" >&5
10128 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10129 if test $ac_cv_lib_socket_connect = yes; then
10130   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10131 fi
10132
10133     fi
10134
10135     # Guillermo Gomez says -lposix is necessary on A/UX.
10136     echo "$as_me:10136: checking for remove" >&5
10137 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10138 if test "${ac_cv_func_remove+set}" = set; then
10139   echo $ECHO_N "(cached) $ECHO_C" >&6
10140 else
10141   cat >conftest.$ac_ext <<_ACEOF
10142 #line 10142 "configure"
10143 #include "confdefs.h"
10144 /* System header to define __stub macros and hopefully few prototypes,
10145     which can conflict with char remove (); below.  */
10146 #include <assert.h>
10147 /* Override any gcc2 internal prototype to avoid an error.  */
10148 #ifdef __cplusplus
10149 extern "C"
10150 #endif
10151 /* We use char because int might match the return type of a gcc2
10152    builtin and then its argument prototype would still apply.  */
10153 char remove ();
10154 char (*f) ();
10155
10156 int
10157 main ()
10158 {
10159 /* The GNU C library defines this for functions which it implements
10160     to always fail with ENOSYS.  Some functions are actually named
10161     something starting with __ and the normal name is an alias.  */
10162 #if defined (__stub_remove) || defined (__stub___remove)
10163 choke me
10164 #else
10165 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10166 #endif
10167
10168   ;
10169   return 0;
10170 }
10171 _ACEOF
10172 rm -f conftest.$ac_objext conftest$ac_exeext
10173 if { (eval echo "$as_me:10173: \"$ac_link\"") >&5
10174   (eval $ac_link) 2>&5
10175   ac_status=$?
10176   echo "$as_me:10176: \$? = $ac_status" >&5
10177   (exit $ac_status); } &&
10178          { ac_try='test -s conftest$ac_exeext'
10179   { (eval echo "$as_me:10179: \"$ac_try\"") >&5
10180   (eval $ac_try) 2>&5
10181   ac_status=$?
10182   echo "$as_me:10182: \$? = $ac_status" >&5
10183   (exit $ac_status); }; }; then
10184   ac_cv_func_remove=yes
10185 else
10186   echo "$as_me: failed program was:" >&5
10187 cat conftest.$ac_ext >&5
10188 ac_cv_func_remove=no
10189 fi
10190 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10191 fi
10192 echo "$as_me:10192: result: $ac_cv_func_remove" >&5
10193 echo "${ECHO_T}$ac_cv_func_remove" >&6
10194
10195     if test $ac_cv_func_remove = no; then
10196       echo "$as_me:10196: checking for remove in -lposix" >&5
10197 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10198 if test "${ac_cv_lib_posix_remove+set}" = set; then
10199   echo $ECHO_N "(cached) $ECHO_C" >&6
10200 else
10201   ac_check_lib_save_LIBS=$LIBS
10202 LIBS="-lposix  $LIBS"
10203 cat >conftest.$ac_ext <<_ACEOF
10204 #line 10204 "configure"
10205 #include "confdefs.h"
10206
10207 /* Override any gcc2 internal prototype to avoid an error.  */
10208 #ifdef __cplusplus
10209 extern "C"
10210 #endif
10211 /* We use char because int might match the return type of a gcc2
10212    builtin and then its argument prototype would still apply.  */
10213 char remove ();
10214 int
10215 main ()
10216 {
10217 remove ();
10218   ;
10219   return 0;
10220 }
10221 _ACEOF
10222 rm -f conftest.$ac_objext conftest$ac_exeext
10223 if { (eval echo "$as_me:10223: \"$ac_link\"") >&5
10224   (eval $ac_link) 2>&5
10225   ac_status=$?
10226   echo "$as_me:10226: \$? = $ac_status" >&5
10227   (exit $ac_status); } &&
10228          { ac_try='test -s conftest$ac_exeext'
10229   { (eval echo "$as_me:10229: \"$ac_try\"") >&5
10230   (eval $ac_try) 2>&5
10231   ac_status=$?
10232   echo "$as_me:10232: \$? = $ac_status" >&5
10233   (exit $ac_status); }; }; then
10234   ac_cv_lib_posix_remove=yes
10235 else
10236   echo "$as_me: failed program was:" >&5
10237 cat conftest.$ac_ext >&5
10238 ac_cv_lib_posix_remove=no
10239 fi
10240 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10241 LIBS=$ac_check_lib_save_LIBS
10242 fi
10243 echo "$as_me:10243: result: $ac_cv_lib_posix_remove" >&5
10244 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10245 if test $ac_cv_lib_posix_remove = yes; then
10246   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10247 fi
10248
10249     fi
10250
10251     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10252     echo "$as_me:10252: checking for shmat" >&5
10253 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10254 if test "${ac_cv_func_shmat+set}" = set; then
10255   echo $ECHO_N "(cached) $ECHO_C" >&6
10256 else
10257   cat >conftest.$ac_ext <<_ACEOF
10258 #line 10258 "configure"
10259 #include "confdefs.h"
10260 /* System header to define __stub macros and hopefully few prototypes,
10261     which can conflict with char shmat (); below.  */
10262 #include <assert.h>
10263 /* Override any gcc2 internal prototype to avoid an error.  */
10264 #ifdef __cplusplus
10265 extern "C"
10266 #endif
10267 /* We use char because int might match the return type of a gcc2
10268    builtin and then its argument prototype would still apply.  */
10269 char shmat ();
10270 char (*f) ();
10271
10272 int
10273 main ()
10274 {
10275 /* The GNU C library defines this for functions which it implements
10276     to always fail with ENOSYS.  Some functions are actually named
10277     something starting with __ and the normal name is an alias.  */
10278 #if defined (__stub_shmat) || defined (__stub___shmat)
10279 choke me
10280 #else
10281 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10282 #endif
10283
10284   ;
10285   return 0;
10286 }
10287 _ACEOF
10288 rm -f conftest.$ac_objext conftest$ac_exeext
10289 if { (eval echo "$as_me:10289: \"$ac_link\"") >&5
10290   (eval $ac_link) 2>&5
10291   ac_status=$?
10292   echo "$as_me:10292: \$? = $ac_status" >&5
10293   (exit $ac_status); } &&
10294          { ac_try='test -s conftest$ac_exeext'
10295   { (eval echo "$as_me:10295: \"$ac_try\"") >&5
10296   (eval $ac_try) 2>&5
10297   ac_status=$?
10298   echo "$as_me:10298: \$? = $ac_status" >&5
10299   (exit $ac_status); }; }; then
10300   ac_cv_func_shmat=yes
10301 else
10302   echo "$as_me: failed program was:" >&5
10303 cat conftest.$ac_ext >&5
10304 ac_cv_func_shmat=no
10305 fi
10306 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10307 fi
10308 echo "$as_me:10308: result: $ac_cv_func_shmat" >&5
10309 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10310
10311     if test $ac_cv_func_shmat = no; then
10312       echo "$as_me:10312: checking for shmat in -lipc" >&5
10313 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10314 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10315   echo $ECHO_N "(cached) $ECHO_C" >&6
10316 else
10317   ac_check_lib_save_LIBS=$LIBS
10318 LIBS="-lipc  $LIBS"
10319 cat >conftest.$ac_ext <<_ACEOF
10320 #line 10320 "configure"
10321 #include "confdefs.h"
10322
10323 /* Override any gcc2 internal prototype to avoid an error.  */
10324 #ifdef __cplusplus
10325 extern "C"
10326 #endif
10327 /* We use char because int might match the return type of a gcc2
10328    builtin and then its argument prototype would still apply.  */
10329 char shmat ();
10330 int
10331 main ()
10332 {
10333 shmat ();
10334   ;
10335   return 0;
10336 }
10337 _ACEOF
10338 rm -f conftest.$ac_objext conftest$ac_exeext
10339 if { (eval echo "$as_me:10339: \"$ac_link\"") >&5
10340   (eval $ac_link) 2>&5
10341   ac_status=$?
10342   echo "$as_me:10342: \$? = $ac_status" >&5
10343   (exit $ac_status); } &&
10344          { ac_try='test -s conftest$ac_exeext'
10345   { (eval echo "$as_me:10345: \"$ac_try\"") >&5
10346   (eval $ac_try) 2>&5
10347   ac_status=$?
10348   echo "$as_me:10348: \$? = $ac_status" >&5
10349   (exit $ac_status); }; }; then
10350   ac_cv_lib_ipc_shmat=yes
10351 else
10352   echo "$as_me: failed program was:" >&5
10353 cat conftest.$ac_ext >&5
10354 ac_cv_lib_ipc_shmat=no
10355 fi
10356 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10357 LIBS=$ac_check_lib_save_LIBS
10358 fi
10359 echo "$as_me:10359: result: $ac_cv_lib_ipc_shmat" >&5
10360 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10361 if test $ac_cv_lib_ipc_shmat = yes; then
10362   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10363 fi
10364
10365     fi
10366   fi
10367
10368   # Check for libraries that X11R6 Xt/Xaw programs need.
10369   ac_save_LDFLAGS=$LDFLAGS
10370   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10371   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10372   # check for ICE first), but we must link in the order -lSM -lICE or
10373   # we get undefined symbols.  So assume we have SM if we have ICE.
10374   # These have to be linked with before -lX11, unlike the other
10375   # libraries we check for below, so use a different variable.
10376   # John Interrante, Karl Berry
10377   echo "$as_me:10377: checking for IceConnectionNumber in -lICE" >&5
10378 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10379 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10380   echo $ECHO_N "(cached) $ECHO_C" >&6
10381 else
10382   ac_check_lib_save_LIBS=$LIBS
10383 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10384 cat >conftest.$ac_ext <<_ACEOF
10385 #line 10385 "configure"
10386 #include "confdefs.h"
10387
10388 /* Override any gcc2 internal prototype to avoid an error.  */
10389 #ifdef __cplusplus
10390 extern "C"
10391 #endif
10392 /* We use char because int might match the return type of a gcc2
10393    builtin and then its argument prototype would still apply.  */
10394 char IceConnectionNumber ();
10395 int
10396 main ()
10397 {
10398 IceConnectionNumber ();
10399   ;
10400   return 0;
10401 }
10402 _ACEOF
10403 rm -f conftest.$ac_objext conftest$ac_exeext
10404 if { (eval echo "$as_me:10404: \"$ac_link\"") >&5
10405   (eval $ac_link) 2>&5
10406   ac_status=$?
10407   echo "$as_me:10407: \$? = $ac_status" >&5
10408   (exit $ac_status); } &&
10409          { ac_try='test -s conftest$ac_exeext'
10410   { (eval echo "$as_me:10410: \"$ac_try\"") >&5
10411   (eval $ac_try) 2>&5
10412   ac_status=$?
10413   echo "$as_me:10413: \$? = $ac_status" >&5
10414   (exit $ac_status); }; }; then
10415   ac_cv_lib_ICE_IceConnectionNumber=yes
10416 else
10417   echo "$as_me: failed program was:" >&5
10418 cat conftest.$ac_ext >&5
10419 ac_cv_lib_ICE_IceConnectionNumber=no
10420 fi
10421 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10422 LIBS=$ac_check_lib_save_LIBS
10423 fi
10424 echo "$as_me:10424: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10425 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10426 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10427   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10428 fi
10429
10430   LDFLAGS=$ac_save_LDFLAGS
10431
10432 fi
10433
10434 cf_x_athena=${cf_x_athena:-Xaw}
10435
10436 echo "$as_me:10436: checking if you want to link with Xaw 3d library" >&5
10437 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10438 withval=
10439
10440 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10441 if test "${with_Xaw3d+set}" = set; then
10442   withval="$with_Xaw3d"
10443
10444 fi;
10445 if test "$withval" = yes ; then
10446         cf_x_athena=Xaw3d
10447         echo "$as_me:10447: result: yes" >&5
10448 echo "${ECHO_T}yes" >&6
10449 else
10450         echo "$as_me:10450: result: no" >&5
10451 echo "${ECHO_T}no" >&6
10452 fi
10453
10454 echo "$as_me:10454: checking if you want to link with Xaw 3d xft library" >&5
10455 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10456 withval=
10457
10458 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10459 if test "${with_Xaw3dxft+set}" = set; then
10460   withval="$with_Xaw3dxft"
10461
10462 fi;
10463 if test "$withval" = yes ; then
10464         cf_x_athena=Xaw3dxft
10465         echo "$as_me:10465: result: yes" >&5
10466 echo "${ECHO_T}yes" >&6
10467 else
10468         echo "$as_me:10468: result: no" >&5
10469 echo "${ECHO_T}no" >&6
10470 fi
10471
10472 echo "$as_me:10472: checking if you want to link with neXT Athena library" >&5
10473 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10474 withval=
10475
10476 # Check whether --with-neXtaw or --without-neXtaw was given.
10477 if test "${with_neXtaw+set}" = set; then
10478   withval="$with_neXtaw"
10479
10480 fi;
10481 if test "$withval" = yes ; then
10482         cf_x_athena=neXtaw
10483         echo "$as_me:10483: result: yes" >&5
10484 echo "${ECHO_T}yes" >&6
10485 else
10486         echo "$as_me:10486: result: no" >&5
10487 echo "${ECHO_T}no" >&6
10488 fi
10489
10490 echo "$as_me:10490: checking if you want to link with Athena-Plus library" >&5
10491 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10492 withval=
10493
10494 # Check whether --with-XawPlus or --without-XawPlus was given.
10495 if test "${with_XawPlus+set}" = set; then
10496   withval="$with_XawPlus"
10497
10498 fi;
10499 if test "$withval" = yes ; then
10500         cf_x_athena=XawPlus
10501         echo "$as_me:10501: result: yes" >&5
10502 echo "${ECHO_T}yes" >&6
10503 else
10504         echo "$as_me:10504: result: no" >&5
10505 echo "${ECHO_T}no" >&6
10506 fi
10507
10508 cf_x_athena_lib=""
10509
10510 if test "$PKG_CONFIG" != none ; then
10511         cf_athena_list=
10512         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10513         for cf_athena_pkg in \
10514                 $cf_athena_list \
10515                 ${cf_x_athena} \
10516                 ${cf_x_athena}-devel \
10517                 lib${cf_x_athena} \
10518                 lib${cf_x_athena}-devel
10519         do
10520
10521 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10522         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10523
10524 echo "${as_me:-configure}:10524: testing found package $cf_athena_pkg ..." 1>&5
10525
10526         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10527         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10528         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10529
10530 echo "${as_me:-configure}:10530: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10531
10532         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10533
10534 echo "${as_me:-configure}:10534: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10535
10536 cf_fix_cppflags=no
10537 cf_new_cflags=
10538 cf_new_cppflags=
10539 cf_new_extra_cppflags=
10540
10541 for cf_add_cflags in $cf_pkgconfig_incs
10542 do
10543 case $cf_fix_cppflags in
10544 (no)
10545         case $cf_add_cflags in
10546         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10547                 case $cf_add_cflags in
10548                 (-D*)
10549                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10550
10551                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10552                                 && test -z "${cf_tst_cflags}" \
10553                                 && cf_fix_cppflags=yes
10554
10555                         if test $cf_fix_cppflags = yes ; then
10556                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10557                                 continue
10558                         elif test "${cf_tst_cflags}" = "\"'" ; then
10559                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10560                                 continue
10561                         fi
10562                         ;;
10563                 esac
10564                 case "$CPPFLAGS" in
10565                 (*$cf_add_cflags)
10566                         ;;
10567                 (*)
10568                         case $cf_add_cflags in
10569                         (-D*)
10570                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10571
10572 CPPFLAGS=`echo "$CPPFLAGS" | \
10573         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10574                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10575
10576                                 ;;
10577                         esac
10578                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10579                         ;;
10580                 esac
10581                 ;;
10582         (*)
10583                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10584                 ;;
10585         esac
10586         ;;
10587 (yes)
10588         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10589
10590         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10591
10592         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10593                 && test -z "${cf_tst_cflags}" \
10594                 && cf_fix_cppflags=no
10595         ;;
10596 esac
10597 done
10598
10599 if test -n "$cf_new_cflags" ; then
10600
10601         CFLAGS="$CFLAGS $cf_new_cflags"
10602 fi
10603
10604 if test -n "$cf_new_cppflags" ; then
10605
10606         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10607 fi
10608
10609 if test -n "$cf_new_extra_cppflags" ; then
10610
10611         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10612 fi
10613
10614 cf_add_libs="$cf_pkgconfig_libs"
10615 # Filter out duplicates - this happens with badly-designed ".pc" files...
10616 for cf_add_1lib in $LIBS
10617 do
10618         for cf_add_2lib in $cf_add_libs
10619         do
10620                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10621                 then
10622                         cf_add_1lib=
10623                         break
10624                 fi
10625         done
10626         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10627 done
10628 LIBS="$cf_add_libs"
10629
10630                         cf_x_athena_lib="$cf_pkgconfig_libs"
10631
10632 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10633
10634                         cat >>confdefs.h <<EOF
10635 #define $cf_x_athena_LIBS 1
10636 EOF
10637
10638         for cf_trim_lib in Xmu Xt X11
10639         do
10640                 case "$LIBS" in
10641                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10642                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10643                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10644
10645 echo "${as_me:-configure}:10645: testing ..trimmed $LIBS ..." 1>&5
10646
10647                         ;;
10648                 esac
10649         done
10650
10651 echo "$as_me:10651: checking for usable $cf_x_athena/Xmu package" >&5
10652 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10653 if test "${cf_cv_xaw_compat+set}" = set; then
10654   echo $ECHO_N "(cached) $ECHO_C" >&6
10655 else
10656
10657 cat >conftest.$ac_ext <<_ACEOF
10658 #line 10658 "configure"
10659 #include "confdefs.h"
10660
10661 #include <X11/Xmu/CharSet.h>
10662
10663 int
10664 main ()
10665 {
10666
10667 int check = XmuCompareISOLatin1("big", "small")
10668
10669   ;
10670   return 0;
10671 }
10672 _ACEOF
10673 rm -f conftest.$ac_objext conftest$ac_exeext
10674 if { (eval echo "$as_me:10674: \"$ac_link\"") >&5
10675   (eval $ac_link) 2>&5
10676   ac_status=$?
10677   echo "$as_me:10677: \$? = $ac_status" >&5
10678   (exit $ac_status); } &&
10679          { ac_try='test -s conftest$ac_exeext'
10680   { (eval echo "$as_me:10680: \"$ac_try\"") >&5
10681   (eval $ac_try) 2>&5
10682   ac_status=$?
10683   echo "$as_me:10683: \$? = $ac_status" >&5
10684   (exit $ac_status); }; }; then
10685   cf_cv_xaw_compat=yes
10686 else
10687   echo "$as_me: failed program was:" >&5
10688 cat conftest.$ac_ext >&5
10689 cf_cv_xaw_compat=no
10690 fi
10691 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10692 fi
10693 echo "$as_me:10693: result: $cf_cv_xaw_compat" >&5
10694 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10695
10696                         if test "$cf_cv_xaw_compat" = no
10697                         then
10698                                 # workaround for broken ".pc" files...
10699                                 case "$cf_x_athena_lib" in
10700                                 (*-lXmu*)
10701                                         ;;
10702                                 (*)
10703                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10704
10705 echo "${as_me:-configure}:10705: testing work around broken package ..." 1>&5
10706
10707                                         cf_save_xmu="$LIBS"
10708                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10709
10710 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10711         test -n "$verbose" && echo "    found package xmu" 1>&6
10712
10713 echo "${as_me:-configure}:10713: testing found package xmu ..." 1>&5
10714
10715         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10716         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10717         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10718
10719 echo "${as_me:-configure}:10719: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10720
10721         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10722
10723 echo "${as_me:-configure}:10723: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10724
10725 cf_fix_cppflags=no
10726 cf_new_cflags=
10727 cf_new_cppflags=
10728 cf_new_extra_cppflags=
10729
10730 for cf_add_cflags in $cf_pkgconfig_incs
10731 do
10732 case $cf_fix_cppflags in
10733 (no)
10734         case $cf_add_cflags in
10735         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10736                 case $cf_add_cflags in
10737                 (-D*)
10738                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10739
10740                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10741                                 && test -z "${cf_tst_cflags}" \
10742                                 && cf_fix_cppflags=yes
10743
10744                         if test $cf_fix_cppflags = yes ; then
10745                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10746                                 continue
10747                         elif test "${cf_tst_cflags}" = "\"'" ; then
10748                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10749                                 continue
10750                         fi
10751                         ;;
10752                 esac
10753                 case "$CPPFLAGS" in
10754                 (*$cf_add_cflags)
10755                         ;;
10756                 (*)
10757                         case $cf_add_cflags in
10758                         (-D*)
10759                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10760
10761 CPPFLAGS=`echo "$CPPFLAGS" | \
10762         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10763                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10764
10765                                 ;;
10766                         esac
10767                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10768                         ;;
10769                 esac
10770                 ;;
10771         (*)
10772                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10773                 ;;
10774         esac
10775         ;;
10776 (yes)
10777         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10778
10779         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10780
10781         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10782                 && test -z "${cf_tst_cflags}" \
10783                 && cf_fix_cppflags=no
10784         ;;
10785 esac
10786 done
10787
10788 if test -n "$cf_new_cflags" ; then
10789
10790         CFLAGS="$CFLAGS $cf_new_cflags"
10791 fi
10792
10793 if test -n "$cf_new_cppflags" ; then
10794
10795         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10796 fi
10797
10798 if test -n "$cf_new_extra_cppflags" ; then
10799
10800         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10801 fi
10802
10803 cf_add_libs="$cf_pkgconfig_libs"
10804 # Filter out duplicates - this happens with badly-designed ".pc" files...
10805 for cf_add_1lib in $LIBS
10806 do
10807         for cf_add_2lib in $cf_add_libs
10808         do
10809                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10810                 then
10811                         cf_add_1lib=
10812                         break
10813                 fi
10814         done
10815         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10816 done
10817 LIBS="$cf_add_libs"
10818
10819                                                         LIBS="$cf_save_xmu"
10820
10821 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10822
10823 echo "${as_me:-configure}:10823: testing ...before $LIBS ..." 1>&5
10824
10825 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10826 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10827
10828 echo "${as_me:-configure}:10828: testing ...after  $LIBS ..." 1>&5
10829
10830 else
10831         cf_pkgconfig_incs=
10832         cf_pkgconfig_libs=
10833
10834 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10835
10836 echo "${as_me:-configure}:10836: testing ...before $LIBS ..." 1>&5
10837
10838 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10839 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10840
10841 echo "${as_me:-configure}:10841: testing ...after  $LIBS ..." 1>&5
10842
10843 fi
10844
10845         for cf_trim_lib in Xmu Xt X11
10846         do
10847                 case "$LIBS" in
10848                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10849                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10850                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10851
10852 echo "${as_me:-configure}:10852: testing ..trimmed $LIBS ..." 1>&5
10853
10854                         ;;
10855                 esac
10856         done
10857
10858                                         ;;
10859                                 esac
10860                         fi
10861
10862                         break
10863 else
10864         cf_pkgconfig_incs=
10865         cf_pkgconfig_libs=
10866         :
10867 fi
10868
10869         done
10870 fi
10871
10872 if test -z "$cf_x_athena_lib" ; then
10873
10874 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10875         test -n "$verbose" && echo "    found package Xext" 1>&6
10876
10877 echo "${as_me:-configure}:10877: testing found package Xext ..." 1>&5
10878
10879         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10880         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10881         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10882
10883 echo "${as_me:-configure}:10883: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10884
10885         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10886
10887 echo "${as_me:-configure}:10887: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10888
10889 cf_fix_cppflags=no
10890 cf_new_cflags=
10891 cf_new_cppflags=
10892 cf_new_extra_cppflags=
10893
10894 for cf_add_cflags in $cf_pkgconfig_incs
10895 do
10896 case $cf_fix_cppflags in
10897 (no)
10898         case $cf_add_cflags in
10899         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10900                 case $cf_add_cflags in
10901                 (-D*)
10902                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10903
10904                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10905                                 && test -z "${cf_tst_cflags}" \
10906                                 && cf_fix_cppflags=yes
10907
10908                         if test $cf_fix_cppflags = yes ; then
10909                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10910                                 continue
10911                         elif test "${cf_tst_cflags}" = "\"'" ; then
10912                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10913                                 continue
10914                         fi
10915                         ;;
10916                 esac
10917                 case "$CPPFLAGS" in
10918                 (*$cf_add_cflags)
10919                         ;;
10920                 (*)
10921                         case $cf_add_cflags in
10922                         (-D*)
10923                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10924
10925 CPPFLAGS=`echo "$CPPFLAGS" | \
10926         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10927                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10928
10929                                 ;;
10930                         esac
10931                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10932                         ;;
10933                 esac
10934                 ;;
10935         (*)
10936                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10937                 ;;
10938         esac
10939         ;;
10940 (yes)
10941         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10942
10943         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10944
10945         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10946                 && test -z "${cf_tst_cflags}" \
10947                 && cf_fix_cppflags=no
10948         ;;
10949 esac
10950 done
10951
10952 if test -n "$cf_new_cflags" ; then
10953
10954         CFLAGS="$CFLAGS $cf_new_cflags"
10955 fi
10956
10957 if test -n "$cf_new_cppflags" ; then
10958
10959         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10960 fi
10961
10962 if test -n "$cf_new_extra_cppflags" ; then
10963
10964         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10965 fi
10966
10967 cf_add_libs="$cf_pkgconfig_libs"
10968 # Filter out duplicates - this happens with badly-designed ".pc" files...
10969 for cf_add_1lib in $LIBS
10970 do
10971         for cf_add_2lib in $cf_add_libs
10972         do
10973                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10974                 then
10975                         cf_add_1lib=
10976                         break
10977                 fi
10978         done
10979         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10980 done
10981 LIBS="$cf_add_libs"
10982
10983         :
10984 else
10985         cf_pkgconfig_incs=
10986         cf_pkgconfig_libs=
10987
10988         echo "$as_me:10988: checking for XextCreateExtension in -lXext" >&5
10989 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10990 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10991   echo $ECHO_N "(cached) $ECHO_C" >&6
10992 else
10993   ac_check_lib_save_LIBS=$LIBS
10994 LIBS="-lXext  $LIBS"
10995 cat >conftest.$ac_ext <<_ACEOF
10996 #line 10996 "configure"
10997 #include "confdefs.h"
10998
10999 /* Override any gcc2 internal prototype to avoid an error.  */
11000 #ifdef __cplusplus
11001 extern "C"
11002 #endif
11003 /* We use char because int might match the return type of a gcc2
11004    builtin and then its argument prototype would still apply.  */
11005 char XextCreateExtension ();
11006 int
11007 main ()
11008 {
11009 XextCreateExtension ();
11010   ;
11011   return 0;
11012 }
11013 _ACEOF
11014 rm -f conftest.$ac_objext conftest$ac_exeext
11015 if { (eval echo "$as_me:11015: \"$ac_link\"") >&5
11016   (eval $ac_link) 2>&5
11017   ac_status=$?
11018   echo "$as_me:11018: \$? = $ac_status" >&5
11019   (exit $ac_status); } &&
11020          { ac_try='test -s conftest$ac_exeext'
11021   { (eval echo "$as_me:11021: \"$ac_try\"") >&5
11022   (eval $ac_try) 2>&5
11023   ac_status=$?
11024   echo "$as_me:11024: \$? = $ac_status" >&5
11025   (exit $ac_status); }; }; then
11026   ac_cv_lib_Xext_XextCreateExtension=yes
11027 else
11028   echo "$as_me: failed program was:" >&5
11029 cat conftest.$ac_ext >&5
11030 ac_cv_lib_Xext_XextCreateExtension=no
11031 fi
11032 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11033 LIBS=$ac_check_lib_save_LIBS
11034 fi
11035 echo "$as_me:11035: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11036 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11037 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11038
11039 cf_add_libs="-lXext"
11040 # Filter out duplicates - this happens with badly-designed ".pc" files...
11041 for cf_add_1lib in $LIBS
11042 do
11043         for cf_add_2lib in $cf_add_libs
11044         do
11045                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11046                 then
11047                         cf_add_1lib=
11048                         break
11049                 fi
11050         done
11051         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11052 done
11053 LIBS="$cf_add_libs"
11054
11055 fi
11056
11057 fi
11058
11059 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11060 # in some cases has installed dummy files in the former, other cases replaced
11061 # it with a link to the new location).  This complicates the configure script.
11062 # Check for that pitfall, and recover using pkg-config
11063 #
11064 # If none of these are set, the configuration is almost certainly broken.
11065 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11066 then
11067
11068 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11069         test -n "$verbose" && echo "    found package x11" 1>&6
11070
11071 echo "${as_me:-configure}:11071: testing found package x11 ..." 1>&5
11072
11073         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11074         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11075         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11076
11077 echo "${as_me:-configure}:11077: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11078
11079         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11080
11081 echo "${as_me:-configure}:11081: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11082
11083 cf_fix_cppflags=no
11084 cf_new_cflags=
11085 cf_new_cppflags=
11086 cf_new_extra_cppflags=
11087
11088 for cf_add_cflags in $cf_pkgconfig_incs
11089 do
11090 case $cf_fix_cppflags in
11091 (no)
11092         case $cf_add_cflags in
11093         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11094                 case $cf_add_cflags in
11095                 (-D*)
11096                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11097
11098                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11099                                 && test -z "${cf_tst_cflags}" \
11100                                 && cf_fix_cppflags=yes
11101
11102                         if test $cf_fix_cppflags = yes ; then
11103                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11104                                 continue
11105                         elif test "${cf_tst_cflags}" = "\"'" ; then
11106                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11107                                 continue
11108                         fi
11109                         ;;
11110                 esac
11111                 case "$CPPFLAGS" in
11112                 (*$cf_add_cflags)
11113                         ;;
11114                 (*)
11115                         case $cf_add_cflags in
11116                         (-D*)
11117                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11118
11119 CPPFLAGS=`echo "$CPPFLAGS" | \
11120         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11121                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11122
11123                                 ;;
11124                         esac
11125                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11126                         ;;
11127                 esac
11128                 ;;
11129         (*)
11130                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11131                 ;;
11132         esac
11133         ;;
11134 (yes)
11135         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11136
11137         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11138
11139         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11140                 && test -z "${cf_tst_cflags}" \
11141                 && cf_fix_cppflags=no
11142         ;;
11143 esac
11144 done
11145
11146 if test -n "$cf_new_cflags" ; then
11147
11148         CFLAGS="$CFLAGS $cf_new_cflags"
11149 fi
11150
11151 if test -n "$cf_new_cppflags" ; then
11152
11153         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11154 fi
11155
11156 if test -n "$cf_new_extra_cppflags" ; then
11157
11158         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11159 fi
11160
11161 cf_add_libs="$cf_pkgconfig_libs"
11162 # Filter out duplicates - this happens with badly-designed ".pc" files...
11163 for cf_add_1lib in $LIBS
11164 do
11165         for cf_add_2lib in $cf_add_libs
11166         do
11167                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11168                 then
11169                         cf_add_1lib=
11170                         break
11171                 fi
11172         done
11173         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11174 done
11175 LIBS="$cf_add_libs"
11176
11177         :
11178 else
11179         cf_pkgconfig_incs=
11180         cf_pkgconfig_libs=
11181         { echo "$as_me:11181: WARNING: unable to find X11 library" >&5
11182 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11183 fi
11184
11185 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11186         test -n "$verbose" && echo "    found package ice" 1>&6
11187
11188 echo "${as_me:-configure}:11188: testing found package ice ..." 1>&5
11189
11190         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11191         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11192         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11193
11194 echo "${as_me:-configure}:11194: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11195
11196         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11197
11198 echo "${as_me:-configure}:11198: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11199
11200 cf_fix_cppflags=no
11201 cf_new_cflags=
11202 cf_new_cppflags=
11203 cf_new_extra_cppflags=
11204
11205 for cf_add_cflags in $cf_pkgconfig_incs
11206 do
11207 case $cf_fix_cppflags in
11208 (no)
11209         case $cf_add_cflags in
11210         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11211                 case $cf_add_cflags in
11212                 (-D*)
11213                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11214
11215                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11216                                 && test -z "${cf_tst_cflags}" \
11217                                 && cf_fix_cppflags=yes
11218
11219                         if test $cf_fix_cppflags = yes ; then
11220                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11221                                 continue
11222                         elif test "${cf_tst_cflags}" = "\"'" ; then
11223                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11224                                 continue
11225                         fi
11226                         ;;
11227                 esac
11228                 case "$CPPFLAGS" in
11229                 (*$cf_add_cflags)
11230                         ;;
11231                 (*)
11232                         case $cf_add_cflags in
11233                         (-D*)
11234                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11235
11236 CPPFLAGS=`echo "$CPPFLAGS" | \
11237         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11238                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11239
11240                                 ;;
11241                         esac
11242                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11243                         ;;
11244                 esac
11245                 ;;
11246         (*)
11247                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11248                 ;;
11249         esac
11250         ;;
11251 (yes)
11252         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11253
11254         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11255
11256         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11257                 && test -z "${cf_tst_cflags}" \
11258                 && cf_fix_cppflags=no
11259         ;;
11260 esac
11261 done
11262
11263 if test -n "$cf_new_cflags" ; then
11264
11265         CFLAGS="$CFLAGS $cf_new_cflags"
11266 fi
11267
11268 if test -n "$cf_new_cppflags" ; then
11269
11270         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11271 fi
11272
11273 if test -n "$cf_new_extra_cppflags" ; then
11274
11275         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11276 fi
11277
11278 cf_add_libs="$cf_pkgconfig_libs"
11279 # Filter out duplicates - this happens with badly-designed ".pc" files...
11280 for cf_add_1lib in $LIBS
11281 do
11282         for cf_add_2lib in $cf_add_libs
11283         do
11284                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11285                 then
11286                         cf_add_1lib=
11287                         break
11288                 fi
11289         done
11290         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11291 done
11292 LIBS="$cf_add_libs"
11293
11294         :
11295 else
11296         cf_pkgconfig_incs=
11297         cf_pkgconfig_libs=
11298         { echo "$as_me:11298: WARNING: unable to find ICE library" >&5
11299 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11300 fi
11301
11302 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11303         test -n "$verbose" && echo "    found package sm" 1>&6
11304
11305 echo "${as_me:-configure}:11305: testing found package sm ..." 1>&5
11306
11307         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11308         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11309         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11310
11311 echo "${as_me:-configure}:11311: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11312
11313         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11314
11315 echo "${as_me:-configure}:11315: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11316
11317 cf_fix_cppflags=no
11318 cf_new_cflags=
11319 cf_new_cppflags=
11320 cf_new_extra_cppflags=
11321
11322 for cf_add_cflags in $cf_pkgconfig_incs
11323 do
11324 case $cf_fix_cppflags in
11325 (no)
11326         case $cf_add_cflags in
11327         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11328                 case $cf_add_cflags in
11329                 (-D*)
11330                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11331
11332                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11333                                 && test -z "${cf_tst_cflags}" \
11334                                 && cf_fix_cppflags=yes
11335
11336                         if test $cf_fix_cppflags = yes ; then
11337                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11338                                 continue
11339                         elif test "${cf_tst_cflags}" = "\"'" ; then
11340                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11341                                 continue
11342                         fi
11343                         ;;
11344                 esac
11345                 case "$CPPFLAGS" in
11346                 (*$cf_add_cflags)
11347                         ;;
11348                 (*)
11349                         case $cf_add_cflags in
11350                         (-D*)
11351                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11352
11353 CPPFLAGS=`echo "$CPPFLAGS" | \
11354         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11355                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11356
11357                                 ;;
11358                         esac
11359                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11360                         ;;
11361                 esac
11362                 ;;
11363         (*)
11364                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11365                 ;;
11366         esac
11367         ;;
11368 (yes)
11369         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11370
11371         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11372
11373         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11374                 && test -z "${cf_tst_cflags}" \
11375                 && cf_fix_cppflags=no
11376         ;;
11377 esac
11378 done
11379
11380 if test -n "$cf_new_cflags" ; then
11381
11382         CFLAGS="$CFLAGS $cf_new_cflags"
11383 fi
11384
11385 if test -n "$cf_new_cppflags" ; then
11386
11387         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11388 fi
11389
11390 if test -n "$cf_new_extra_cppflags" ; then
11391
11392         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11393 fi
11394
11395 cf_add_libs="$cf_pkgconfig_libs"
11396 # Filter out duplicates - this happens with badly-designed ".pc" files...
11397 for cf_add_1lib in $LIBS
11398 do
11399         for cf_add_2lib in $cf_add_libs
11400         do
11401                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11402                 then
11403                         cf_add_1lib=
11404                         break
11405                 fi
11406         done
11407         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11408 done
11409 LIBS="$cf_add_libs"
11410
11411         :
11412 else
11413         cf_pkgconfig_incs=
11414         cf_pkgconfig_libs=
11415         { echo "$as_me:11415: WARNING: unable to find SM library" >&5
11416 echo "$as_me: WARNING: unable to find SM library" >&2;}
11417 fi
11418
11419 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11420         test -n "$verbose" && echo "    found package xt" 1>&6
11421
11422 echo "${as_me:-configure}:11422: testing found package xt ..." 1>&5
11423
11424         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11425         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11426         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11427
11428 echo "${as_me:-configure}:11428: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11429
11430         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11431
11432 echo "${as_me:-configure}:11432: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11433
11434 cf_fix_cppflags=no
11435 cf_new_cflags=
11436 cf_new_cppflags=
11437 cf_new_extra_cppflags=
11438
11439 for cf_add_cflags in $cf_pkgconfig_incs
11440 do
11441 case $cf_fix_cppflags in
11442 (no)
11443         case $cf_add_cflags in
11444         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11445                 case $cf_add_cflags in
11446                 (-D*)
11447                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11448
11449                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11450                                 && test -z "${cf_tst_cflags}" \
11451                                 && cf_fix_cppflags=yes
11452
11453                         if test $cf_fix_cppflags = yes ; then
11454                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11455                                 continue
11456                         elif test "${cf_tst_cflags}" = "\"'" ; then
11457                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11458                                 continue
11459                         fi
11460                         ;;
11461                 esac
11462                 case "$CPPFLAGS" in
11463                 (*$cf_add_cflags)
11464                         ;;
11465                 (*)
11466                         case $cf_add_cflags in
11467                         (-D*)
11468                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11469
11470 CPPFLAGS=`echo "$CPPFLAGS" | \
11471         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11472                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11473
11474                                 ;;
11475                         esac
11476                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11477                         ;;
11478                 esac
11479                 ;;
11480         (*)
11481                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11482                 ;;
11483         esac
11484         ;;
11485 (yes)
11486         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11487
11488         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11489
11490         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11491                 && test -z "${cf_tst_cflags}" \
11492                 && cf_fix_cppflags=no
11493         ;;
11494 esac
11495 done
11496
11497 if test -n "$cf_new_cflags" ; then
11498
11499         CFLAGS="$CFLAGS $cf_new_cflags"
11500 fi
11501
11502 if test -n "$cf_new_cppflags" ; then
11503
11504         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11505 fi
11506
11507 if test -n "$cf_new_extra_cppflags" ; then
11508
11509         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11510 fi
11511
11512 cf_add_libs="$cf_pkgconfig_libs"
11513 # Filter out duplicates - this happens with badly-designed ".pc" files...
11514 for cf_add_1lib in $LIBS
11515 do
11516         for cf_add_2lib in $cf_add_libs
11517         do
11518                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11519                 then
11520                         cf_add_1lib=
11521                         break
11522                 fi
11523         done
11524         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11525 done
11526 LIBS="$cf_add_libs"
11527
11528         :
11529 else
11530         cf_pkgconfig_incs=
11531         cf_pkgconfig_libs=
11532         { echo "$as_me:11532: WARNING: unable to find Xt library" >&5
11533 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11534 fi
11535
11536 fi
11537
11538 cf_have_X_LIBS=no
11539
11540 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11541         test -n "$verbose" && echo "    found package xt" 1>&6
11542
11543 echo "${as_me:-configure}:11543: testing found package xt ..." 1>&5
11544
11545         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11546         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11547         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11548
11549 echo "${as_me:-configure}:11549: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11550
11551         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11552
11553 echo "${as_me:-configure}:11553: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11554
11555 cf_fix_cppflags=no
11556 cf_new_cflags=
11557 cf_new_cppflags=
11558 cf_new_extra_cppflags=
11559
11560 for cf_add_cflags in $cf_pkgconfig_incs
11561 do
11562 case $cf_fix_cppflags in
11563 (no)
11564         case $cf_add_cflags in
11565         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11566                 case $cf_add_cflags in
11567                 (-D*)
11568                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11569
11570                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11571                                 && test -z "${cf_tst_cflags}" \
11572                                 && cf_fix_cppflags=yes
11573
11574                         if test $cf_fix_cppflags = yes ; then
11575                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11576                                 continue
11577                         elif test "${cf_tst_cflags}" = "\"'" ; then
11578                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11579                                 continue
11580                         fi
11581                         ;;
11582                 esac
11583                 case "$CPPFLAGS" in
11584                 (*$cf_add_cflags)
11585                         ;;
11586                 (*)
11587                         case $cf_add_cflags in
11588                         (-D*)
11589                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11590
11591 CPPFLAGS=`echo "$CPPFLAGS" | \
11592         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11593                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11594
11595                                 ;;
11596                         esac
11597                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11598                         ;;
11599                 esac
11600                 ;;
11601         (*)
11602                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11603                 ;;
11604         esac
11605         ;;
11606 (yes)
11607         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11608
11609         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11610
11611         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11612                 && test -z "${cf_tst_cflags}" \
11613                 && cf_fix_cppflags=no
11614         ;;
11615 esac
11616 done
11617
11618 if test -n "$cf_new_cflags" ; then
11619
11620         CFLAGS="$CFLAGS $cf_new_cflags"
11621 fi
11622
11623 if test -n "$cf_new_cppflags" ; then
11624
11625         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11626 fi
11627
11628 if test -n "$cf_new_extra_cppflags" ; then
11629
11630         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11631 fi
11632
11633 cf_add_libs="$cf_pkgconfig_libs"
11634 # Filter out duplicates - this happens with badly-designed ".pc" files...
11635 for cf_add_1lib in $LIBS
11636 do
11637         for cf_add_2lib in $cf_add_libs
11638         do
11639                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11640                 then
11641                         cf_add_1lib=
11642                         break
11643                 fi
11644         done
11645         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11646 done
11647 LIBS="$cf_add_libs"
11648
11649         case "x$LIBS" in
11650         (*-lX11*)
11651                 ;;
11652         (*)
11653 # we have an "xt" package, but it may omit Xt's dependency on X11
11654 echo "$as_me:11654: checking for usable X dependency" >&5
11655 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11656 if test "${cf_cv_xt_x11_compat+set}" = set; then
11657   echo $ECHO_N "(cached) $ECHO_C" >&6
11658 else
11659
11660 cat >conftest.$ac_ext <<_ACEOF
11661 #line 11661 "configure"
11662 #include "confdefs.h"
11663
11664 #include <X11/Xlib.h>
11665
11666 int
11667 main ()
11668 {
11669
11670         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11671         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11672         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11673         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11674
11675   ;
11676   return 0;
11677 }
11678 _ACEOF
11679 rm -f conftest.$ac_objext conftest$ac_exeext
11680 if { (eval echo "$as_me:11680: \"$ac_link\"") >&5
11681   (eval $ac_link) 2>&5
11682   ac_status=$?
11683   echo "$as_me:11683: \$? = $ac_status" >&5
11684   (exit $ac_status); } &&
11685          { ac_try='test -s conftest$ac_exeext'
11686   { (eval echo "$as_me:11686: \"$ac_try\"") >&5
11687   (eval $ac_try) 2>&5
11688   ac_status=$?
11689   echo "$as_me:11689: \$? = $ac_status" >&5
11690   (exit $ac_status); }; }; then
11691   cf_cv_xt_x11_compat=yes
11692 else
11693   echo "$as_me: failed program was:" >&5
11694 cat conftest.$ac_ext >&5
11695 cf_cv_xt_x11_compat=no
11696 fi
11697 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11698 fi
11699 echo "$as_me:11699: result: $cf_cv_xt_x11_compat" >&5
11700 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11701                 if test "$cf_cv_xt_x11_compat" = no
11702                 then
11703                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11704
11705 echo "${as_me:-configure}:11705: testing work around broken X11 dependency ..." 1>&5
11706
11707                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11708
11709 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11710         test -n "$verbose" && echo "    found package x11" 1>&6
11711
11712 echo "${as_me:-configure}:11712: testing found package x11 ..." 1>&5
11713
11714         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11715         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11716         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11717
11718 echo "${as_me:-configure}:11718: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11719
11720         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11721
11722 echo "${as_me:-configure}:11722: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11723
11724 cf_fix_cppflags=no
11725 cf_new_cflags=
11726 cf_new_cppflags=
11727 cf_new_extra_cppflags=
11728
11729 for cf_add_cflags in $cf_pkgconfig_incs
11730 do
11731 case $cf_fix_cppflags in
11732 (no)
11733         case $cf_add_cflags in
11734         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11735                 case $cf_add_cflags in
11736                 (-D*)
11737                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11738
11739                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11740                                 && test -z "${cf_tst_cflags}" \
11741                                 && cf_fix_cppflags=yes
11742
11743                         if test $cf_fix_cppflags = yes ; then
11744                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11745                                 continue
11746                         elif test "${cf_tst_cflags}" = "\"'" ; then
11747                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11748                                 continue
11749                         fi
11750                         ;;
11751                 esac
11752                 case "$CPPFLAGS" in
11753                 (*$cf_add_cflags)
11754                         ;;
11755                 (*)
11756                         case $cf_add_cflags in
11757                         (-D*)
11758                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11759
11760 CPPFLAGS=`echo "$CPPFLAGS" | \
11761         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11762                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11763
11764                                 ;;
11765                         esac
11766                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11767                         ;;
11768                 esac
11769                 ;;
11770         (*)
11771                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11772                 ;;
11773         esac
11774         ;;
11775 (yes)
11776         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11777
11778         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11779
11780         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11781                 && test -z "${cf_tst_cflags}" \
11782                 && cf_fix_cppflags=no
11783         ;;
11784 esac
11785 done
11786
11787 if test -n "$cf_new_cflags" ; then
11788
11789         CFLAGS="$CFLAGS $cf_new_cflags"
11790 fi
11791
11792 if test -n "$cf_new_cppflags" ; then
11793
11794         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11795 fi
11796
11797 if test -n "$cf_new_extra_cppflags" ; then
11798
11799         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11800 fi
11801
11802 cf_add_libs="$cf_pkgconfig_libs"
11803 # Filter out duplicates - this happens with badly-designed ".pc" files...
11804 for cf_add_1lib in $LIBS
11805 do
11806         for cf_add_2lib in $cf_add_libs
11807         do
11808                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11809                 then
11810                         cf_add_1lib=
11811                         break
11812                 fi
11813         done
11814         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11815 done
11816 LIBS="$cf_add_libs"
11817
11818         :
11819 else
11820         cf_pkgconfig_incs=
11821         cf_pkgconfig_libs=
11822
11823 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11824
11825 echo "${as_me:-configure}:11825: testing ...before $LIBS ..." 1>&5
11826
11827 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11828 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11829
11830 echo "${as_me:-configure}:11830: testing ...after  $LIBS ..." 1>&5
11831
11832 fi
11833
11834                 fi
11835                 ;;
11836         esac
11837
11838 echo "$as_me:11838: checking for usable X Toolkit package" >&5
11839 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11840 if test "${cf_cv_xt_ice_compat+set}" = set; then
11841   echo $ECHO_N "(cached) $ECHO_C" >&6
11842 else
11843
11844 cat >conftest.$ac_ext <<_ACEOF
11845 #line 11845 "configure"
11846 #include "confdefs.h"
11847
11848 #include <X11/Shell.h>
11849
11850 int
11851 main ()
11852 {
11853 int num = IceConnectionNumber(0)
11854
11855   ;
11856   return 0;
11857 }
11858 _ACEOF
11859 rm -f conftest.$ac_objext conftest$ac_exeext
11860 if { (eval echo "$as_me:11860: \"$ac_link\"") >&5
11861   (eval $ac_link) 2>&5
11862   ac_status=$?
11863   echo "$as_me:11863: \$? = $ac_status" >&5
11864   (exit $ac_status); } &&
11865          { ac_try='test -s conftest$ac_exeext'
11866   { (eval echo "$as_me:11866: \"$ac_try\"") >&5
11867   (eval $ac_try) 2>&5
11868   ac_status=$?
11869   echo "$as_me:11869: \$? = $ac_status" >&5
11870   (exit $ac_status); }; }; then
11871   cf_cv_xt_ice_compat=yes
11872 else
11873   echo "$as_me: failed program was:" >&5
11874 cat conftest.$ac_ext >&5
11875 cf_cv_xt_ice_compat=no
11876 fi
11877 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11878 fi
11879 echo "$as_me:11879: result: $cf_cv_xt_ice_compat" >&5
11880 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11881
11882         if test "$cf_cv_xt_ice_compat" = no
11883         then
11884                 # workaround for broken ".pc" files used for X Toolkit.
11885                 case "x$X_PRE_LIBS" in
11886                 (*-lICE*)
11887                         case "x$LIBS" in
11888                         (*-lICE*)
11889                                 ;;
11890                         (*)
11891                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11892
11893 echo "${as_me:-configure}:11893: testing work around broken ICE dependency ..." 1>&5
11894
11895 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11896         test -n "$verbose" && echo "    found package ice" 1>&6
11897
11898 echo "${as_me:-configure}:11898: testing found package ice ..." 1>&5
11899
11900         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11901         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11902         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11903
11904 echo "${as_me:-configure}:11904: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11905
11906         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11907
11908 echo "${as_me:-configure}:11908: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11909
11910 cf_fix_cppflags=no
11911 cf_new_cflags=
11912 cf_new_cppflags=
11913 cf_new_extra_cppflags=
11914
11915 for cf_add_cflags in $cf_pkgconfig_incs
11916 do
11917 case $cf_fix_cppflags in
11918 (no)
11919         case $cf_add_cflags in
11920         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11921                 case $cf_add_cflags in
11922                 (-D*)
11923                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11924
11925                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11926                                 && test -z "${cf_tst_cflags}" \
11927                                 && cf_fix_cppflags=yes
11928
11929                         if test $cf_fix_cppflags = yes ; then
11930                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11931                                 continue
11932                         elif test "${cf_tst_cflags}" = "\"'" ; then
11933                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11934                                 continue
11935                         fi
11936                         ;;
11937                 esac
11938                 case "$CPPFLAGS" in
11939                 (*$cf_add_cflags)
11940                         ;;
11941                 (*)
11942                         case $cf_add_cflags in
11943                         (-D*)
11944                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11945
11946 CPPFLAGS=`echo "$CPPFLAGS" | \
11947         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11948                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11949
11950                                 ;;
11951                         esac
11952                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11953                         ;;
11954                 esac
11955                 ;;
11956         (*)
11957                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11958                 ;;
11959         esac
11960         ;;
11961 (yes)
11962         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11963
11964         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11965
11966         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11967                 && test -z "${cf_tst_cflags}" \
11968                 && cf_fix_cppflags=no
11969         ;;
11970 esac
11971 done
11972
11973 if test -n "$cf_new_cflags" ; then
11974
11975         CFLAGS="$CFLAGS $cf_new_cflags"
11976 fi
11977
11978 if test -n "$cf_new_cppflags" ; then
11979
11980         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11981 fi
11982
11983 if test -n "$cf_new_extra_cppflags" ; then
11984
11985         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11986 fi
11987
11988 cf_add_libs="$cf_pkgconfig_libs"
11989 # Filter out duplicates - this happens with badly-designed ".pc" files...
11990 for cf_add_1lib in $LIBS
11991 do
11992         for cf_add_2lib in $cf_add_libs
11993         do
11994                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11995                 then
11996                         cf_add_1lib=
11997                         break
11998                 fi
11999         done
12000         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12001 done
12002 LIBS="$cf_add_libs"
12003
12004 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12005         test -n "$verbose" && echo "    found package sm" 1>&6
12006
12007 echo "${as_me:-configure}:12007: testing found package sm ..." 1>&5
12008
12009         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12010         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12011         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12012
12013 echo "${as_me:-configure}:12013: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12014
12015         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12016
12017 echo "${as_me:-configure}:12017: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12018
12019 cf_fix_cppflags=no
12020 cf_new_cflags=
12021 cf_new_cppflags=
12022 cf_new_extra_cppflags=
12023
12024 for cf_add_cflags in $cf_pkgconfig_incs
12025 do
12026 case $cf_fix_cppflags in
12027 (no)
12028         case $cf_add_cflags in
12029         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12030                 case $cf_add_cflags in
12031                 (-D*)
12032                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12033
12034                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12035                                 && test -z "${cf_tst_cflags}" \
12036                                 && cf_fix_cppflags=yes
12037
12038                         if test $cf_fix_cppflags = yes ; then
12039                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12040                                 continue
12041                         elif test "${cf_tst_cflags}" = "\"'" ; then
12042                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12043                                 continue
12044                         fi
12045                         ;;
12046                 esac
12047                 case "$CPPFLAGS" in
12048                 (*$cf_add_cflags)
12049                         ;;
12050                 (*)
12051                         case $cf_add_cflags in
12052                         (-D*)
12053                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12054
12055 CPPFLAGS=`echo "$CPPFLAGS" | \
12056         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12057                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12058
12059                                 ;;
12060                         esac
12061                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12062                         ;;
12063                 esac
12064                 ;;
12065         (*)
12066                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12067                 ;;
12068         esac
12069         ;;
12070 (yes)
12071         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12072
12073         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12074
12075         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12076                 && test -z "${cf_tst_cflags}" \
12077                 && cf_fix_cppflags=no
12078         ;;
12079 esac
12080 done
12081
12082 if test -n "$cf_new_cflags" ; then
12083
12084         CFLAGS="$CFLAGS $cf_new_cflags"
12085 fi
12086
12087 if test -n "$cf_new_cppflags" ; then
12088
12089         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12090 fi
12091
12092 if test -n "$cf_new_extra_cppflags" ; then
12093
12094         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12095 fi
12096
12097 cf_add_libs="$cf_pkgconfig_libs"
12098 # Filter out duplicates - this happens with badly-designed ".pc" files...
12099 for cf_add_1lib in $LIBS
12100 do
12101         for cf_add_2lib in $cf_add_libs
12102         do
12103                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12104                 then
12105                         cf_add_1lib=
12106                         break
12107                 fi
12108         done
12109         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12110 done
12111 LIBS="$cf_add_libs"
12112
12113         :
12114 else
12115         cf_pkgconfig_incs=
12116         cf_pkgconfig_libs=
12117         :
12118 fi
12119
12120 else
12121         cf_pkgconfig_incs=
12122         cf_pkgconfig_libs=
12123
12124 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12125
12126 echo "${as_me:-configure}:12126: testing ...before $LIBS ..." 1>&5
12127
12128 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12129 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12130
12131 echo "${as_me:-configure}:12131: testing ...after  $LIBS ..." 1>&5
12132
12133 fi
12134
12135                                 ;;
12136                         esac
12137                         ;;
12138                 esac
12139         fi
12140
12141         cf_have_X_LIBS=yes
12142
12143 else
12144         cf_pkgconfig_incs=
12145         cf_pkgconfig_libs=
12146
12147         LDFLAGS="$X_LIBS $LDFLAGS"
12148
12149 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12150
12151 echo "${as_me:-configure}:12151: testing checking additions to CFLAGS ..." 1>&5
12152
12153 cf_check_cflags="$CFLAGS"
12154 cf_check_cppflags="$CPPFLAGS"
12155
12156 cf_fix_cppflags=no
12157 cf_new_cflags=
12158 cf_new_cppflags=
12159 cf_new_extra_cppflags=
12160
12161 for cf_add_cflags in $X_CFLAGS
12162 do
12163 case $cf_fix_cppflags in
12164 (no)
12165         case $cf_add_cflags in
12166         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12167                 case $cf_add_cflags in
12168                 (-D*)
12169                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12170
12171                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12172                                 && test -z "${cf_tst_cflags}" \
12173                                 && cf_fix_cppflags=yes
12174
12175                         if test $cf_fix_cppflags = yes ; then
12176                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12177                                 continue
12178                         elif test "${cf_tst_cflags}" = "\"'" ; then
12179                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12180                                 continue
12181                         fi
12182                         ;;
12183                 esac
12184                 case "$CPPFLAGS" in
12185                 (*$cf_add_cflags)
12186                         ;;
12187                 (*)
12188                         case $cf_add_cflags in
12189                         (-D*)
12190                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12191
12192 CPPFLAGS=`echo "$CPPFLAGS" | \
12193         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12194                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12195
12196                                 ;;
12197                         esac
12198                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12199                         ;;
12200                 esac
12201                 ;;
12202         (*)
12203                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12204                 ;;
12205         esac
12206         ;;
12207 (yes)
12208         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12209
12210         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12211
12212         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12213                 && test -z "${cf_tst_cflags}" \
12214                 && cf_fix_cppflags=no
12215         ;;
12216 esac
12217 done
12218
12219 if test -n "$cf_new_cflags" ; then
12220         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12221
12222 echo "${as_me:-configure}:12222: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12223
12224         CFLAGS="$CFLAGS $cf_new_cflags"
12225 fi
12226
12227 if test -n "$cf_new_cppflags" ; then
12228         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12229
12230 echo "${as_me:-configure}:12230: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12231
12232         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12233 fi
12234
12235 if test -n "$cf_new_extra_cppflags" ; then
12236         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12237
12238 echo "${as_me:-configure}:12238: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12239
12240         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12241 fi
12242
12243 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12244 cat >conftest.$ac_ext <<_ACEOF
12245 #line 12245 "configure"
12246 #include "confdefs.h"
12247 #include <stdio.h>
12248 int
12249 main ()
12250 {
12251 printf("Hello world");
12252   ;
12253   return 0;
12254 }
12255 _ACEOF
12256 rm -f conftest.$ac_objext conftest$ac_exeext
12257 if { (eval echo "$as_me:12257: \"$ac_link\"") >&5
12258   (eval $ac_link) 2>&5
12259   ac_status=$?
12260   echo "$as_me:12260: \$? = $ac_status" >&5
12261   (exit $ac_status); } &&
12262          { ac_try='test -s conftest$ac_exeext'
12263   { (eval echo "$as_me:12263: \"$ac_try\"") >&5
12264   (eval $ac_try) 2>&5
12265   ac_status=$?
12266   echo "$as_me:12266: \$? = $ac_status" >&5
12267   (exit $ac_status); }; }; then
12268   :
12269 else
12270   echo "$as_me: failed program was:" >&5
12271 cat conftest.$ac_ext >&5
12272 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12273
12274 echo "${as_me:-configure}:12274: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12275
12276          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12277                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12278
12279 echo "${as_me:-configure}:12279: testing but keeping change to \$CPPFLAGS ..." 1>&5
12280
12281          fi
12282          CFLAGS="$cf_check_flags"
12283 fi
12284 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12285 fi
12286
12287         echo "$as_me:12287: checking for XOpenDisplay" >&5
12288 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12289 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12290   echo $ECHO_N "(cached) $ECHO_C" >&6
12291 else
12292   cat >conftest.$ac_ext <<_ACEOF
12293 #line 12293 "configure"
12294 #include "confdefs.h"
12295 /* System header to define __stub macros and hopefully few prototypes,
12296     which can conflict with char XOpenDisplay (); below.  */
12297 #include <assert.h>
12298 /* Override any gcc2 internal prototype to avoid an error.  */
12299 #ifdef __cplusplus
12300 extern "C"
12301 #endif
12302 /* We use char because int might match the return type of a gcc2
12303    builtin and then its argument prototype would still apply.  */
12304 char XOpenDisplay ();
12305 char (*f) ();
12306
12307 int
12308 main ()
12309 {
12310 /* The GNU C library defines this for functions which it implements
12311     to always fail with ENOSYS.  Some functions are actually named
12312     something starting with __ and the normal name is an alias.  */
12313 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12314 choke me
12315 #else
12316 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12317 #endif
12318
12319   ;
12320   return 0;
12321 }
12322 _ACEOF
12323 rm -f conftest.$ac_objext conftest$ac_exeext
12324 if { (eval echo "$as_me:12324: \"$ac_link\"") >&5
12325   (eval $ac_link) 2>&5
12326   ac_status=$?
12327   echo "$as_me:12327: \$? = $ac_status" >&5
12328   (exit $ac_status); } &&
12329          { ac_try='test -s conftest$ac_exeext'
12330   { (eval echo "$as_me:12330: \"$ac_try\"") >&5
12331   (eval $ac_try) 2>&5
12332   ac_status=$?
12333   echo "$as_me:12333: \$? = $ac_status" >&5
12334   (exit $ac_status); }; }; then
12335   ac_cv_func_XOpenDisplay=yes
12336 else
12337   echo "$as_me: failed program was:" >&5
12338 cat conftest.$ac_ext >&5
12339 ac_cv_func_XOpenDisplay=no
12340 fi
12341 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12342 fi
12343 echo "$as_me:12343: result: $ac_cv_func_XOpenDisplay" >&5
12344 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12345 if test $ac_cv_func_XOpenDisplay = yes; then
12346   :
12347 else
12348
12349         echo "$as_me:12349: checking for XOpenDisplay in -lX11" >&5
12350 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12351 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12352   echo $ECHO_N "(cached) $ECHO_C" >&6
12353 else
12354   ac_check_lib_save_LIBS=$LIBS
12355 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12356 cat >conftest.$ac_ext <<_ACEOF
12357 #line 12357 "configure"
12358 #include "confdefs.h"
12359
12360 /* Override any gcc2 internal prototype to avoid an error.  */
12361 #ifdef __cplusplus
12362 extern "C"
12363 #endif
12364 /* We use char because int might match the return type of a gcc2
12365    builtin and then its argument prototype would still apply.  */
12366 char XOpenDisplay ();
12367 int
12368 main ()
12369 {
12370 XOpenDisplay ();
12371   ;
12372   return 0;
12373 }
12374 _ACEOF
12375 rm -f conftest.$ac_objext conftest$ac_exeext
12376 if { (eval echo "$as_me:12376: \"$ac_link\"") >&5
12377   (eval $ac_link) 2>&5
12378   ac_status=$?
12379   echo "$as_me:12379: \$? = $ac_status" >&5
12380   (exit $ac_status); } &&
12381          { ac_try='test -s conftest$ac_exeext'
12382   { (eval echo "$as_me:12382: \"$ac_try\"") >&5
12383   (eval $ac_try) 2>&5
12384   ac_status=$?
12385   echo "$as_me:12385: \$? = $ac_status" >&5
12386   (exit $ac_status); }; }; then
12387   ac_cv_lib_X11_XOpenDisplay=yes
12388 else
12389   echo "$as_me: failed program was:" >&5
12390 cat conftest.$ac_ext >&5
12391 ac_cv_lib_X11_XOpenDisplay=no
12392 fi
12393 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12394 LIBS=$ac_check_lib_save_LIBS
12395 fi
12396 echo "$as_me:12396: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12397 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12398 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12399
12400 cf_add_libs="-lX11"
12401 # Filter out duplicates - this happens with badly-designed ".pc" files...
12402 for cf_add_1lib in $LIBS
12403 do
12404         for cf_add_2lib in $cf_add_libs
12405         do
12406                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12407                 then
12408                         cf_add_1lib=
12409                         break
12410                 fi
12411         done
12412         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12413 done
12414 LIBS="$cf_add_libs"
12415
12416 fi
12417
12418 fi
12419
12420         echo "$as_me:12420: checking for XtAppInitialize" >&5
12421 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12422 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12423   echo $ECHO_N "(cached) $ECHO_C" >&6
12424 else
12425   cat >conftest.$ac_ext <<_ACEOF
12426 #line 12426 "configure"
12427 #include "confdefs.h"
12428 /* System header to define __stub macros and hopefully few prototypes,
12429     which can conflict with char XtAppInitialize (); below.  */
12430 #include <assert.h>
12431 /* Override any gcc2 internal prototype to avoid an error.  */
12432 #ifdef __cplusplus
12433 extern "C"
12434 #endif
12435 /* We use char because int might match the return type of a gcc2
12436    builtin and then its argument prototype would still apply.  */
12437 char XtAppInitialize ();
12438 char (*f) ();
12439
12440 int
12441 main ()
12442 {
12443 /* The GNU C library defines this for functions which it implements
12444     to always fail with ENOSYS.  Some functions are actually named
12445     something starting with __ and the normal name is an alias.  */
12446 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12447 choke me
12448 #else
12449 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12450 #endif
12451
12452   ;
12453   return 0;
12454 }
12455 _ACEOF
12456 rm -f conftest.$ac_objext conftest$ac_exeext
12457 if { (eval echo "$as_me:12457: \"$ac_link\"") >&5
12458   (eval $ac_link) 2>&5
12459   ac_status=$?
12460   echo "$as_me:12460: \$? = $ac_status" >&5
12461   (exit $ac_status); } &&
12462          { ac_try='test -s conftest$ac_exeext'
12463   { (eval echo "$as_me:12463: \"$ac_try\"") >&5
12464   (eval $ac_try) 2>&5
12465   ac_status=$?
12466   echo "$as_me:12466: \$? = $ac_status" >&5
12467   (exit $ac_status); }; }; then
12468   ac_cv_func_XtAppInitialize=yes
12469 else
12470   echo "$as_me: failed program was:" >&5
12471 cat conftest.$ac_ext >&5
12472 ac_cv_func_XtAppInitialize=no
12473 fi
12474 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12475 fi
12476 echo "$as_me:12476: result: $ac_cv_func_XtAppInitialize" >&5
12477 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12478 if test $ac_cv_func_XtAppInitialize = yes; then
12479   :
12480 else
12481
12482         echo "$as_me:12482: checking for XtAppInitialize in -lXt" >&5
12483 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12484 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12485   echo $ECHO_N "(cached) $ECHO_C" >&6
12486 else
12487   ac_check_lib_save_LIBS=$LIBS
12488 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12489 cat >conftest.$ac_ext <<_ACEOF
12490 #line 12490 "configure"
12491 #include "confdefs.h"
12492
12493 /* Override any gcc2 internal prototype to avoid an error.  */
12494 #ifdef __cplusplus
12495 extern "C"
12496 #endif
12497 /* We use char because int might match the return type of a gcc2
12498    builtin and then its argument prototype would still apply.  */
12499 char XtAppInitialize ();
12500 int
12501 main ()
12502 {
12503 XtAppInitialize ();
12504   ;
12505   return 0;
12506 }
12507 _ACEOF
12508 rm -f conftest.$ac_objext conftest$ac_exeext
12509 if { (eval echo "$as_me:12509: \"$ac_link\"") >&5
12510   (eval $ac_link) 2>&5
12511   ac_status=$?
12512   echo "$as_me:12512: \$? = $ac_status" >&5
12513   (exit $ac_status); } &&
12514          { ac_try='test -s conftest$ac_exeext'
12515   { (eval echo "$as_me:12515: \"$ac_try\"") >&5
12516   (eval $ac_try) 2>&5
12517   ac_status=$?
12518   echo "$as_me:12518: \$? = $ac_status" >&5
12519   (exit $ac_status); }; }; then
12520   ac_cv_lib_Xt_XtAppInitialize=yes
12521 else
12522   echo "$as_me: failed program was:" >&5
12523 cat conftest.$ac_ext >&5
12524 ac_cv_lib_Xt_XtAppInitialize=no
12525 fi
12526 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12527 LIBS=$ac_check_lib_save_LIBS
12528 fi
12529 echo "$as_me:12529: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12530 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12531 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12532
12533 cat >>confdefs.h <<\EOF
12534 #define HAVE_LIBXT 1
12535 EOF
12536
12537                  cf_have_X_LIBS=Xt
12538                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12539 fi
12540
12541 fi
12542
12543 fi
12544
12545 if test $cf_have_X_LIBS = no ; then
12546         { echo "$as_me:12546: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12547 test program.  You will have to check and add the proper libraries by hand
12548 to makefile." >&5
12549 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12550 test program.  You will have to check and add the proper libraries by hand
12551 to makefile." >&2;}
12552 fi
12553
12554 cf_x_athena_root=$cf_x_athena
12555 cf_x_athena_inc=""
12556
12557 for cf_path in default \
12558         /usr/contrib/X11R6 \
12559         /usr/contrib/X11R5 \
12560         /usr/lib/X11R5 \
12561         /usr/local
12562 do
12563         if test -z "$cf_x_athena_inc" ; then
12564                 cf_save="$CPPFLAGS"
12565                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12566                 if test $cf_path != default ; then
12567                         CPPFLAGS="$cf_save -I$cf_path/include"
12568                         echo "$as_me:12568: checking for $cf_test in $cf_path" >&5
12569 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12570                 else
12571                         echo "$as_me:12571: checking for $cf_test" >&5
12572 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12573                 fi
12574                 cat >conftest.$ac_ext <<_ACEOF
12575 #line 12575 "configure"
12576 #include "confdefs.h"
12577
12578 #include <X11/Intrinsic.h>
12579 #include <$cf_test>
12580 int
12581 main ()
12582 {
12583
12584   ;
12585   return 0;
12586 }
12587 _ACEOF
12588 rm -f conftest.$ac_objext
12589 if { (eval echo "$as_me:12589: \"$ac_compile\"") >&5
12590   (eval $ac_compile) 2>&5
12591   ac_status=$?
12592   echo "$as_me:12592: \$? = $ac_status" >&5
12593   (exit $ac_status); } &&
12594          { ac_try='test -s conftest.$ac_objext'
12595   { (eval echo "$as_me:12595: \"$ac_try\"") >&5
12596   (eval $ac_try) 2>&5
12597   ac_status=$?
12598   echo "$as_me:12598: \$? = $ac_status" >&5
12599   (exit $ac_status); }; }; then
12600   cf_result=yes
12601 else
12602   echo "$as_me: failed program was:" >&5
12603 cat conftest.$ac_ext >&5
12604 cf_result=no
12605 fi
12606 rm -f conftest.$ac_objext conftest.$ac_ext
12607                 echo "$as_me:12607: result: $cf_result" >&5
12608 echo "${ECHO_T}$cf_result" >&6
12609                 if test "$cf_result" = yes ; then
12610                         cf_x_athena_inc=$cf_path
12611                         break
12612                 else
12613                         CPPFLAGS="$cf_save"
12614                 fi
12615         fi
12616 done
12617
12618 if test -z "$cf_x_athena_inc" ; then
12619         { echo "$as_me:12619: WARNING: Unable to successfully find Athena header files with test program" >&5
12620 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12621 elif test "$cf_x_athena_inc" != default ; then
12622         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12623 fi
12624
12625 cf_x_athena_root=$cf_x_athena
12626 cf_x_athena_lib=""
12627
12628 for cf_path in default \
12629         /usr/contrib/X11R6 \
12630         /usr/contrib/X11R5 \
12631         /usr/lib/X11R5 \
12632         /usr/local
12633 do
12634         for cf_lib in \
12635                 ${cf_x_athena_root} \
12636                 ${cf_x_athena_root}7 \
12637                 ${cf_x_athena_root}6
12638         do
12639         for cf_libs in \
12640                 "-l$cf_lib -lXmu" \
12641                 "-l$cf_lib -lXpm -lXmu" \
12642                 "-l${cf_lib}_s -lXmu_s"
12643         do
12644                 if test -z "$cf_x_athena_lib" ; then
12645                         cf_save="$LIBS"
12646                         cf_test=XawSimpleMenuAddGlobalActions
12647                         if test $cf_path != default ; then
12648
12649 cf_add_libs="-L$cf_path/lib $cf_libs"
12650 # Filter out duplicates - this happens with badly-designed ".pc" files...
12651 for cf_add_1lib in $LIBS
12652 do
12653         for cf_add_2lib in $cf_add_libs
12654         do
12655                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12656                 then
12657                         cf_add_1lib=
12658                         break
12659                 fi
12660         done
12661         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12662 done
12663 LIBS="$cf_add_libs"
12664
12665                                 echo "$as_me:12665: checking for $cf_libs in $cf_path" >&5
12666 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12667                         else
12668
12669 cf_add_libs="$cf_libs"
12670 # Filter out duplicates - this happens with badly-designed ".pc" files...
12671 for cf_add_1lib in $LIBS
12672 do
12673         for cf_add_2lib in $cf_add_libs
12674         do
12675                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12676                 then
12677                         cf_add_1lib=
12678                         break
12679                 fi
12680         done
12681         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12682 done
12683 LIBS="$cf_add_libs"
12684
12685                                 echo "$as_me:12685: checking for $cf_test in $cf_libs" >&5
12686 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12687                         fi
12688                         cat >conftest.$ac_ext <<_ACEOF
12689 #line 12689 "configure"
12690 #include "confdefs.h"
12691
12692 #include <X11/Intrinsic.h>
12693 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12694
12695 int
12696 main ()
12697 {
12698
12699 $cf_test((XtAppContext) 0)
12700   ;
12701   return 0;
12702 }
12703 _ACEOF
12704 rm -f conftest.$ac_objext conftest$ac_exeext
12705 if { (eval echo "$as_me:12705: \"$ac_link\"") >&5
12706   (eval $ac_link) 2>&5
12707   ac_status=$?
12708   echo "$as_me:12708: \$? = $ac_status" >&5
12709   (exit $ac_status); } &&
12710          { ac_try='test -s conftest$ac_exeext'
12711   { (eval echo "$as_me:12711: \"$ac_try\"") >&5
12712   (eval $ac_try) 2>&5
12713   ac_status=$?
12714   echo "$as_me:12714: \$? = $ac_status" >&5
12715   (exit $ac_status); }; }; then
12716   cf_result=yes
12717 else
12718   echo "$as_me: failed program was:" >&5
12719 cat conftest.$ac_ext >&5
12720 cf_result=no
12721 fi
12722 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12723                         echo "$as_me:12723: result: $cf_result" >&5
12724 echo "${ECHO_T}$cf_result" >&6
12725                         if test "$cf_result" = yes ; then
12726                                 cf_x_athena_lib="$cf_libs"
12727                                 break
12728                         fi
12729                         LIBS="$cf_save"
12730                 fi
12731         done # cf_libs
12732                 test -n "$cf_x_athena_lib" && break
12733         done # cf_lib
12734 done
12735
12736 if test -z "$cf_x_athena_lib" ; then
12737         { { echo "$as_me:12737: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12738 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12739    { (exit 1); exit 1; }; }
12740 fi
12741
12742 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12743
12744 cat >>confdefs.h <<EOF
12745 #define $cf_x_athena_LIBS 1
12746 EOF
12747
12748 fi
12749
12750 if test -n "$ac_tool_prefix"; then
12751   for ac_prog in xcurses-config
12752   do
12753     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12754 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12755 echo "$as_me:12755: checking for $ac_word" >&5
12756 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12757 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12758   echo $ECHO_N "(cached) $ECHO_C" >&6
12759 else
12760   if test -n "$XCURSES_CONFIG"; then
12761   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12762 else
12763   ac_save_IFS=$IFS; IFS=$ac_path_separator
12764 ac_dummy="$PATH"
12765 for ac_dir in $ac_dummy; do
12766   IFS=$ac_save_IFS
12767   test -z "$ac_dir" && ac_dir=.
12768   $as_executable_p "$ac_dir/$ac_word" || continue
12769 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12770 echo "$as_me:12770: found $ac_dir/$ac_word" >&5
12771 break
12772 done
12773
12774 fi
12775 fi
12776 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12777 if test -n "$XCURSES_CONFIG"; then
12778   echo "$as_me:12778: result: $XCURSES_CONFIG" >&5
12779 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12780 else
12781   echo "$as_me:12781: result: no" >&5
12782 echo "${ECHO_T}no" >&6
12783 fi
12784
12785     test -n "$XCURSES_CONFIG" && break
12786   done
12787 fi
12788 if test -z "$XCURSES_CONFIG"; then
12789   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12790   for ac_prog in xcurses-config
12791 do
12792   # Extract the first word of "$ac_prog", so it can be a program name with args.
12793 set dummy $ac_prog; ac_word=$2
12794 echo "$as_me:12794: checking for $ac_word" >&5
12795 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12796 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12797   echo $ECHO_N "(cached) $ECHO_C" >&6
12798 else
12799   if test -n "$ac_ct_XCURSES_CONFIG"; then
12800   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12801 else
12802   ac_save_IFS=$IFS; IFS=$ac_path_separator
12803 ac_dummy="$PATH"
12804 for ac_dir in $ac_dummy; do
12805   IFS=$ac_save_IFS
12806   test -z "$ac_dir" && ac_dir=.
12807   $as_executable_p "$ac_dir/$ac_word" || continue
12808 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12809 echo "$as_me:12809: found $ac_dir/$ac_word" >&5
12810 break
12811 done
12812
12813 fi
12814 fi
12815 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12816 if test -n "$ac_ct_XCURSES_CONFIG"; then
12817   echo "$as_me:12817: result: $ac_ct_XCURSES_CONFIG" >&5
12818 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12819 else
12820   echo "$as_me:12820: result: no" >&5
12821 echo "${ECHO_T}no" >&6
12822 fi
12823
12824   test -n "$ac_ct_XCURSES_CONFIG" && break
12825 done
12826 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12827
12828   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12829 fi
12830
12831 if test "$XCURSES_CONFIG" != none ; then
12832
12833 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12834
12835 cf_add_libs="`$XCURSES_CONFIG --libs`"
12836 # Filter out duplicates - this happens with badly-designed ".pc" files...
12837 for cf_add_1lib in $LIBS
12838 do
12839         for cf_add_2lib in $cf_add_libs
12840         do
12841                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12842                 then
12843                         cf_add_1lib=
12844                         break
12845                 fi
12846         done
12847         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12848 done
12849 LIBS="$cf_add_libs"
12850
12851 cf_cv_lib_XCurses=yes
12852
12853 else
12854
12855 LDFLAGS="$LDFLAGS $X_LIBS"
12856
12857 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12858
12859 echo "${as_me:-configure}:12859: testing checking additions to CFLAGS ..." 1>&5
12860
12861 cf_check_cflags="$CFLAGS"
12862 cf_check_cppflags="$CPPFLAGS"
12863
12864 cf_fix_cppflags=no
12865 cf_new_cflags=
12866 cf_new_cppflags=
12867 cf_new_extra_cppflags=
12868
12869 for cf_add_cflags in $X_CFLAGS
12870 do
12871 case $cf_fix_cppflags in
12872 (no)
12873         case $cf_add_cflags in
12874         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12875                 case $cf_add_cflags in
12876                 (-D*)
12877                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12878
12879                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12880                                 && test -z "${cf_tst_cflags}" \
12881                                 && cf_fix_cppflags=yes
12882
12883                         if test $cf_fix_cppflags = yes ; then
12884                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12885                                 continue
12886                         elif test "${cf_tst_cflags}" = "\"'" ; then
12887                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12888                                 continue
12889                         fi
12890                         ;;
12891                 esac
12892                 case "$CPPFLAGS" in
12893                 (*$cf_add_cflags)
12894                         ;;
12895                 (*)
12896                         case $cf_add_cflags in
12897                         (-D*)
12898                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12899
12900 CPPFLAGS=`echo "$CPPFLAGS" | \
12901         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12902                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12903
12904                                 ;;
12905                         esac
12906                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12907                         ;;
12908                 esac
12909                 ;;
12910         (*)
12911                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12912                 ;;
12913         esac
12914         ;;
12915 (yes)
12916         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12917
12918         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12919
12920         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12921                 && test -z "${cf_tst_cflags}" \
12922                 && cf_fix_cppflags=no
12923         ;;
12924 esac
12925 done
12926
12927 if test -n "$cf_new_cflags" ; then
12928         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12929
12930 echo "${as_me:-configure}:12930: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12931
12932         CFLAGS="$CFLAGS $cf_new_cflags"
12933 fi
12934
12935 if test -n "$cf_new_cppflags" ; then
12936         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12937
12938 echo "${as_me:-configure}:12938: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12939
12940         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12941 fi
12942
12943 if test -n "$cf_new_extra_cppflags" ; then
12944         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12945
12946 echo "${as_me:-configure}:12946: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12947
12948         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12949 fi
12950
12951 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12952 cat >conftest.$ac_ext <<_ACEOF
12953 #line 12953 "configure"
12954 #include "confdefs.h"
12955 #include <stdio.h>
12956 int
12957 main ()
12958 {
12959 printf("Hello world");
12960   ;
12961   return 0;
12962 }
12963 _ACEOF
12964 rm -f conftest.$ac_objext conftest$ac_exeext
12965 if { (eval echo "$as_me:12965: \"$ac_link\"") >&5
12966   (eval $ac_link) 2>&5
12967   ac_status=$?
12968   echo "$as_me:12968: \$? = $ac_status" >&5
12969   (exit $ac_status); } &&
12970          { ac_try='test -s conftest$ac_exeext'
12971   { (eval echo "$as_me:12971: \"$ac_try\"") >&5
12972   (eval $ac_try) 2>&5
12973   ac_status=$?
12974   echo "$as_me:12974: \$? = $ac_status" >&5
12975   (exit $ac_status); }; }; then
12976   :
12977 else
12978   echo "$as_me: failed program was:" >&5
12979 cat conftest.$ac_ext >&5
12980 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12981
12982 echo "${as_me:-configure}:12982: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12983
12984          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12985                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12986
12987 echo "${as_me:-configure}:12987: testing but keeping change to \$CPPFLAGS ..." 1>&5
12988
12989          fi
12990          CFLAGS="$cf_check_flags"
12991 fi
12992 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12993 fi
12994
12995 echo "$as_me:12995: checking for XOpenDisplay in -lX11" >&5
12996 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12997 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12998   echo $ECHO_N "(cached) $ECHO_C" >&6
12999 else
13000   ac_check_lib_save_LIBS=$LIBS
13001 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13002 cat >conftest.$ac_ext <<_ACEOF
13003 #line 13003 "configure"
13004 #include "confdefs.h"
13005
13006 /* Override any gcc2 internal prototype to avoid an error.  */
13007 #ifdef __cplusplus
13008 extern "C"
13009 #endif
13010 /* We use char because int might match the return type of a gcc2
13011    builtin and then its argument prototype would still apply.  */
13012 char XOpenDisplay ();
13013 int
13014 main ()
13015 {
13016 XOpenDisplay ();
13017   ;
13018   return 0;
13019 }
13020 _ACEOF
13021 rm -f conftest.$ac_objext conftest$ac_exeext
13022 if { (eval echo "$as_me:13022: \"$ac_link\"") >&5
13023   (eval $ac_link) 2>&5
13024   ac_status=$?
13025   echo "$as_me:13025: \$? = $ac_status" >&5
13026   (exit $ac_status); } &&
13027          { ac_try='test -s conftest$ac_exeext'
13028   { (eval echo "$as_me:13028: \"$ac_try\"") >&5
13029   (eval $ac_try) 2>&5
13030   ac_status=$?
13031   echo "$as_me:13031: \$? = $ac_status" >&5
13032   (exit $ac_status); }; }; then
13033   ac_cv_lib_X11_XOpenDisplay=yes
13034 else
13035   echo "$as_me: failed program was:" >&5
13036 cat conftest.$ac_ext >&5
13037 ac_cv_lib_X11_XOpenDisplay=no
13038 fi
13039 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13040 LIBS=$ac_check_lib_save_LIBS
13041 fi
13042 echo "$as_me:13042: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13043 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13044 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13045
13046 cf_add_libs="-lX11"
13047 # Filter out duplicates - this happens with badly-designed ".pc" files...
13048 for cf_add_1lib in $LIBS
13049 do
13050         for cf_add_2lib in $cf_add_libs
13051         do
13052                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13053                 then
13054                         cf_add_1lib=
13055                         break
13056                 fi
13057         done
13058         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13059 done
13060 LIBS="$cf_add_libs"
13061
13062 fi
13063
13064 echo "$as_me:13064: checking for XCurses library" >&5
13065 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13066 if test "${cf_cv_lib_XCurses+set}" = set; then
13067   echo $ECHO_N "(cached) $ECHO_C" >&6
13068 else
13069
13070 cf_add_libs="-lXCurses"
13071 # Filter out duplicates - this happens with badly-designed ".pc" files...
13072 for cf_add_1lib in $LIBS
13073 do
13074         for cf_add_2lib in $cf_add_libs
13075         do
13076                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13077                 then
13078                         cf_add_1lib=
13079                         break
13080                 fi
13081         done
13082         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13083 done
13084 LIBS="$cf_add_libs"
13085
13086 cat >conftest.$ac_ext <<_ACEOF
13087 #line 13087 "configure"
13088 #include "confdefs.h"
13089
13090 #include <xcurses.h>
13091 char *XCursesProgramName = "test";
13092
13093 int
13094 main ()
13095 {
13096 XCursesExit();
13097   ;
13098   return 0;
13099 }
13100 _ACEOF
13101 rm -f conftest.$ac_objext conftest$ac_exeext
13102 if { (eval echo "$as_me:13102: \"$ac_link\"") >&5
13103   (eval $ac_link) 2>&5
13104   ac_status=$?
13105   echo "$as_me:13105: \$? = $ac_status" >&5
13106   (exit $ac_status); } &&
13107          { ac_try='test -s conftest$ac_exeext'
13108   { (eval echo "$as_me:13108: \"$ac_try\"") >&5
13109   (eval $ac_try) 2>&5
13110   ac_status=$?
13111   echo "$as_me:13111: \$? = $ac_status" >&5
13112   (exit $ac_status); }; }; then
13113   cf_cv_lib_XCurses=yes
13114 else
13115   echo "$as_me: failed program was:" >&5
13116 cat conftest.$ac_ext >&5
13117 cf_cv_lib_XCurses=no
13118 fi
13119 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13120
13121 fi
13122 echo "$as_me:13122: result: $cf_cv_lib_XCurses" >&5
13123 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13124
13125 fi
13126
13127 if test $cf_cv_lib_XCurses = yes ; then
13128
13129 cat >>confdefs.h <<\EOF
13130 #define UNIX 1
13131 EOF
13132
13133 cat >>confdefs.h <<\EOF
13134 #define XCURSES 1
13135 EOF
13136
13137         echo "$as_me:13137: checking for xcurses.h" >&5
13138 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13139 if test "${ac_cv_header_xcurses_h+set}" = set; then
13140   echo $ECHO_N "(cached) $ECHO_C" >&6
13141 else
13142   cat >conftest.$ac_ext <<_ACEOF
13143 #line 13143 "configure"
13144 #include "confdefs.h"
13145 #include <xcurses.h>
13146 _ACEOF
13147 if { (eval echo "$as_me:13147: \"$ac_cpp conftest.$ac_ext\"") >&5
13148   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13149   ac_status=$?
13150   egrep -v '^ *\+' conftest.er1 >conftest.err
13151   rm -f conftest.er1
13152   cat conftest.err >&5
13153   echo "$as_me:13153: \$? = $ac_status" >&5
13154   (exit $ac_status); } >/dev/null; then
13155   if test -s conftest.err; then
13156     ac_cpp_err=$ac_c_preproc_warn_flag
13157   else
13158     ac_cpp_err=
13159   fi
13160 else
13161   ac_cpp_err=yes
13162 fi
13163 if test -z "$ac_cpp_err"; then
13164   ac_cv_header_xcurses_h=yes
13165 else
13166   echo "$as_me: failed program was:" >&5
13167   cat conftest.$ac_ext >&5
13168   ac_cv_header_xcurses_h=no
13169 fi
13170 rm -f conftest.err conftest.$ac_ext
13171 fi
13172 echo "$as_me:13172: result: $ac_cv_header_xcurses_h" >&5
13173 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13174 if test $ac_cv_header_xcurses_h = yes; then
13175
13176 cat >>confdefs.h <<\EOF
13177 #define HAVE_XCURSES 1
13178 EOF
13179
13180 fi
13181
13182 else
13183         { { echo "$as_me:13183: error: Cannot link with XCurses" >&5
13184 echo "$as_me: error: Cannot link with XCurses" >&2;}
13185    { (exit 1); exit 1; }; }
13186 fi
13187
13188         ;;
13189 (*)
13190         { { echo "$as_me:13190: error: unexpected screen-value: $cf_cv_screen" >&5
13191 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
13192    { (exit 1); exit 1; }; }
13193         ;;
13194 esac
13195
13196 : ${cf_nculib_root:=$cf_cv_screen}
13197 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
13198 echo "$as_me:13198: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
13199 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
13200 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13201   echo $ECHO_N "(cached) $ECHO_C" >&6
13202 else
13203   ac_check_lib_save_LIBS=$LIBS
13204 LIBS="-l$cf_nculib_root  $LIBS"
13205 cat >conftest.$ac_ext <<_ACEOF
13206 #line 13206 "configure"
13207 #include "confdefs.h"
13208
13209 /* Override any gcc2 internal prototype to avoid an error.  */
13210 #ifdef __cplusplus
13211 extern "C"
13212 #endif
13213 /* We use char because int might match the return type of a gcc2
13214    builtin and then its argument prototype would still apply.  */
13215 char _nc_init_pthreads ();
13216 int
13217 main ()
13218 {
13219 _nc_init_pthreads ();
13220   ;
13221   return 0;
13222 }
13223 _ACEOF
13224 rm -f conftest.$ac_objext conftest$ac_exeext
13225 if { (eval echo "$as_me:13225: \"$ac_link\"") >&5
13226   (eval $ac_link) 2>&5
13227   ac_status=$?
13228   echo "$as_me:13228: \$? = $ac_status" >&5
13229   (exit $ac_status); } &&
13230          { ac_try='test -s conftest$ac_exeext'
13231   { (eval echo "$as_me:13231: \"$ac_try\"") >&5
13232   (eval $ac_try) 2>&5
13233   ac_status=$?
13234   echo "$as_me:13234: \$? = $ac_status" >&5
13235   (exit $ac_status); }; }; then
13236   eval "$as_ac_Lib=yes"
13237 else
13238   echo "$as_me: failed program was:" >&5
13239 cat conftest.$ac_ext >&5
13240 eval "$as_ac_Lib=no"
13241 fi
13242 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13243 LIBS=$ac_check_lib_save_LIBS
13244 fi
13245 echo "$as_me:13245: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13246 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13247 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13248   cf_cv_ncurses_pthreads=yes
13249 else
13250   cf_cv_ncurses_pthreads=no
13251 fi
13252
13253 if test "$cf_cv_ncurses_pthreads" = yes
13254 then
13255
13256 cf_add_libs="-lpthread"
13257 # Filter out duplicates - this happens with badly-designed ".pc" files...
13258 for cf_add_1lib in $LIBS
13259 do
13260         for cf_add_2lib in $cf_add_libs
13261         do
13262                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13263                 then
13264                         cf_add_1lib=
13265                         break
13266                 fi
13267         done
13268         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13269 done
13270 LIBS="$cf_add_libs"
13271
13272 fi
13273
13274 case $cf_cv_screen in
13275 (ncurses*)
13276         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13277         ;;
13278 (curses|curses_*)
13279
13280 echo "$as_me:13280: checking for NetBSD form.h" >&5
13281 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13282 if test "${cf_cv_netbsd_form_h+set}" = set; then
13283   echo $ECHO_N "(cached) $ECHO_C" >&6
13284 else
13285
13286 cat >conftest.$ac_ext <<_ACEOF
13287 #line 13287 "configure"
13288 #include "confdefs.h"
13289
13290 #include <${cf_cv_ncurses_header:-curses.h}>
13291 #include <form.h>
13292
13293 int
13294 main ()
13295 {
13296
13297         FORM *form;
13298         int y = current_field(form)->cursor_ypos;
13299         int x = current_field(form)->cursor_xpos;
13300
13301   ;
13302   return 0;
13303 }
13304 _ACEOF
13305 rm -f conftest.$ac_objext
13306 if { (eval echo "$as_me:13306: \"$ac_compile\"") >&5
13307   (eval $ac_compile) 2>&5
13308   ac_status=$?
13309   echo "$as_me:13309: \$? = $ac_status" >&5
13310   (exit $ac_status); } &&
13311          { ac_try='test -s conftest.$ac_objext'
13312   { (eval echo "$as_me:13312: \"$ac_try\"") >&5
13313   (eval $ac_try) 2>&5
13314   ac_status=$?
13315   echo "$as_me:13315: \$? = $ac_status" >&5
13316   (exit $ac_status); }; }; then
13317   cf_cv_netbsd_form_h=yes
13318
13319 else
13320   echo "$as_me: failed program was:" >&5
13321 cat conftest.$ac_ext >&5
13322 cf_cv_netbsd_form_h=no
13323 fi
13324 rm -f conftest.$ac_objext conftest.$ac_ext
13325
13326 fi
13327 echo "$as_me:13327: result: $cf_cv_netbsd_form_h" >&5
13328 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13329
13330 test "$cf_cv_netbsd_form_h" = yes &&
13331 cat >>confdefs.h <<\EOF
13332 #define HAVE_NETBSD_FORM_H 1
13333 EOF
13334
13335 echo "$as_me:13335: checking for NetBSD menu.h" >&5
13336 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13337 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13338   echo $ECHO_N "(cached) $ECHO_C" >&6
13339 else
13340
13341 cat >conftest.$ac_ext <<_ACEOF
13342 #line 13342 "configure"
13343 #include "confdefs.h"
13344
13345 #include <${cf_cv_ncurses_header:-curses.h}>
13346 #include <menu.h>
13347
13348 int
13349 main ()
13350 {
13351
13352         MENU *menu;
13353         int y = menu->max_item_width;
13354
13355   ;
13356   return 0;
13357 }
13358 _ACEOF
13359 rm -f conftest.$ac_objext
13360 if { (eval echo "$as_me:13360: \"$ac_compile\"") >&5
13361   (eval $ac_compile) 2>&5
13362   ac_status=$?
13363   echo "$as_me:13363: \$? = $ac_status" >&5
13364   (exit $ac_status); } &&
13365          { ac_try='test -s conftest.$ac_objext'
13366   { (eval echo "$as_me:13366: \"$ac_try\"") >&5
13367   (eval $ac_try) 2>&5
13368   ac_status=$?
13369   echo "$as_me:13369: \$? = $ac_status" >&5
13370   (exit $ac_status); }; }; then
13371   cf_cv_netbsd_menu_h=yes
13372
13373 else
13374   echo "$as_me: failed program was:" >&5
13375 cat conftest.$ac_ext >&5
13376 cf_cv_netbsd_menu_h=no
13377 fi
13378 rm -f conftest.$ac_objext conftest.$ac_ext
13379
13380 fi
13381 echo "$as_me:13381: result: $cf_cv_netbsd_menu_h" >&5
13382 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13383
13384 test "$cf_cv_netbsd_menu_h" = yes &&
13385 cat >>confdefs.h <<\EOF
13386 #define HAVE_NETBSD_MENU_H 1
13387 EOF
13388
13389         ;;
13390 esac
13391
13392 case $cf_cv_screen in
13393 (pdcurses)
13394         ;;
13395 (*)
13396         # look for curses-related libraries
13397
13398 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13399 echo "$as_me:13399: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13400 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13401 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13402   echo $ECHO_N "(cached) $ECHO_C" >&6
13403 else
13404   ac_check_lib_save_LIBS=$LIBS
13405 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13406 cat >conftest.$ac_ext <<_ACEOF
13407 #line 13407 "configure"
13408 #include "confdefs.h"
13409
13410 /* Override any gcc2 internal prototype to avoid an error.  */
13411 #ifdef __cplusplus
13412 extern "C"
13413 #endif
13414 /* We use char because int might match the return type of a gcc2
13415    builtin and then its argument prototype would still apply.  */
13416 char new_panel ();
13417 int
13418 main ()
13419 {
13420 new_panel ();
13421   ;
13422   return 0;
13423 }
13424 _ACEOF
13425 rm -f conftest.$ac_objext conftest$ac_exeext
13426 if { (eval echo "$as_me:13426: \"$ac_link\"") >&5
13427   (eval $ac_link) 2>&5
13428   ac_status=$?
13429   echo "$as_me:13429: \$? = $ac_status" >&5
13430   (exit $ac_status); } &&
13431          { ac_try='test -s conftest$ac_exeext'
13432   { (eval echo "$as_me:13432: \"$ac_try\"") >&5
13433   (eval $ac_try) 2>&5
13434   ac_status=$?
13435   echo "$as_me:13435: \$? = $ac_status" >&5
13436   (exit $ac_status); }; }; then
13437   eval "$as_ac_Lib=yes"
13438 else
13439   echo "$as_me: failed program was:" >&5
13440 cat conftest.$ac_ext >&5
13441 eval "$as_ac_Lib=no"
13442 fi
13443 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13444 LIBS=$ac_check_lib_save_LIBS
13445 fi
13446 echo "$as_me:13446: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13447 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13448 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13449
13450 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13451
13452 cf_add_libs="-lpanel$cf_cv_libtype"
13453 # Filter out duplicates - this happens with badly-designed ".pc" files...
13454 for cf_add_1lib in $LIBS
13455 do
13456         for cf_add_2lib in $cf_add_libs
13457         do
13458                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13459                 then
13460                         cf_add_1lib=
13461                         break
13462                 fi
13463         done
13464         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13465 done
13466 LIBS="$cf_add_libs"
13467
13468 cat >>confdefs.h <<EOF
13469 #define $cf_upper 1
13470 EOF
13471
13472 fi
13473
13474 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13475 echo "$as_me:13475: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13476 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13477 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13478   echo $ECHO_N "(cached) $ECHO_C" >&6
13479 else
13480   ac_check_lib_save_LIBS=$LIBS
13481 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13482 cat >conftest.$ac_ext <<_ACEOF
13483 #line 13483 "configure"
13484 #include "confdefs.h"
13485
13486 /* Override any gcc2 internal prototype to avoid an error.  */
13487 #ifdef __cplusplus
13488 extern "C"
13489 #endif
13490 /* We use char because int might match the return type of a gcc2
13491    builtin and then its argument prototype would still apply.  */
13492 char menu_driver ();
13493 int
13494 main ()
13495 {
13496 menu_driver ();
13497   ;
13498   return 0;
13499 }
13500 _ACEOF
13501 rm -f conftest.$ac_objext conftest$ac_exeext
13502 if { (eval echo "$as_me:13502: \"$ac_link\"") >&5
13503   (eval $ac_link) 2>&5
13504   ac_status=$?
13505   echo "$as_me:13505: \$? = $ac_status" >&5
13506   (exit $ac_status); } &&
13507          { ac_try='test -s conftest$ac_exeext'
13508   { (eval echo "$as_me:13508: \"$ac_try\"") >&5
13509   (eval $ac_try) 2>&5
13510   ac_status=$?
13511   echo "$as_me:13511: \$? = $ac_status" >&5
13512   (exit $ac_status); }; }; then
13513   eval "$as_ac_Lib=yes"
13514 else
13515   echo "$as_me: failed program was:" >&5
13516 cat conftest.$ac_ext >&5
13517 eval "$as_ac_Lib=no"
13518 fi
13519 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13520 LIBS=$ac_check_lib_save_LIBS
13521 fi
13522 echo "$as_me:13522: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13523 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13524 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13525
13526 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13527
13528 cf_add_libs="-lmenu$cf_cv_libtype"
13529 # Filter out duplicates - this happens with badly-designed ".pc" files...
13530 for cf_add_1lib in $LIBS
13531 do
13532         for cf_add_2lib in $cf_add_libs
13533         do
13534                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13535                 then
13536                         cf_add_1lib=
13537                         break
13538                 fi
13539         done
13540         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13541 done
13542 LIBS="$cf_add_libs"
13543
13544 cat >>confdefs.h <<EOF
13545 #define $cf_upper 1
13546 EOF
13547
13548 fi
13549
13550 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13551 echo "$as_me:13551: checking for form_driver in -lform$cf_cv_libtype" >&5
13552 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13553 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13554   echo $ECHO_N "(cached) $ECHO_C" >&6
13555 else
13556   ac_check_lib_save_LIBS=$LIBS
13557 LIBS="-lform$cf_cv_libtype  $LIBS"
13558 cat >conftest.$ac_ext <<_ACEOF
13559 #line 13559 "configure"
13560 #include "confdefs.h"
13561
13562 /* Override any gcc2 internal prototype to avoid an error.  */
13563 #ifdef __cplusplus
13564 extern "C"
13565 #endif
13566 /* We use char because int might match the return type of a gcc2
13567    builtin and then its argument prototype would still apply.  */
13568 char form_driver ();
13569 int
13570 main ()
13571 {
13572 form_driver ();
13573   ;
13574   return 0;
13575 }
13576 _ACEOF
13577 rm -f conftest.$ac_objext conftest$ac_exeext
13578 if { (eval echo "$as_me:13578: \"$ac_link\"") >&5
13579   (eval $ac_link) 2>&5
13580   ac_status=$?
13581   echo "$as_me:13581: \$? = $ac_status" >&5
13582   (exit $ac_status); } &&
13583          { ac_try='test -s conftest$ac_exeext'
13584   { (eval echo "$as_me:13584: \"$ac_try\"") >&5
13585   (eval $ac_try) 2>&5
13586   ac_status=$?
13587   echo "$as_me:13587: \$? = $ac_status" >&5
13588   (exit $ac_status); }; }; then
13589   eval "$as_ac_Lib=yes"
13590 else
13591   echo "$as_me: failed program was:" >&5
13592 cat conftest.$ac_ext >&5
13593 eval "$as_ac_Lib=no"
13594 fi
13595 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13596 LIBS=$ac_check_lib_save_LIBS
13597 fi
13598 echo "$as_me:13598: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13599 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13600 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13601
13602 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13603
13604 cf_add_libs="-lform$cf_cv_libtype"
13605 # Filter out duplicates - this happens with badly-designed ".pc" files...
13606 for cf_add_1lib in $LIBS
13607 do
13608         for cf_add_2lib in $cf_add_libs
13609         do
13610                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13611                 then
13612                         cf_add_1lib=
13613                         break
13614                 fi
13615         done
13616         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13617 done
13618 LIBS="$cf_add_libs"
13619
13620 cat >>confdefs.h <<EOF
13621 #define $cf_upper 1
13622 EOF
13623
13624 fi
13625
13626         # look for curses-related headers
13627
13628 for ac_header in \
13629                 nc_alloc.h \
13630                 nomacros.h \
13631                 form.h \
13632                 menu.h \
13633                 panel.h \
13634                 term_entry.h \
13635
13636 do
13637 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13638 echo "$as_me:13638: checking for $ac_header" >&5
13639 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13640 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13641   echo $ECHO_N "(cached) $ECHO_C" >&6
13642 else
13643   cat >conftest.$ac_ext <<_ACEOF
13644 #line 13644 "configure"
13645 #include "confdefs.h"
13646 #include <$ac_header>
13647 _ACEOF
13648 if { (eval echo "$as_me:13648: \"$ac_cpp conftest.$ac_ext\"") >&5
13649   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13650   ac_status=$?
13651   egrep -v '^ *\+' conftest.er1 >conftest.err
13652   rm -f conftest.er1
13653   cat conftest.err >&5
13654   echo "$as_me:13654: \$? = $ac_status" >&5
13655   (exit $ac_status); } >/dev/null; then
13656   if test -s conftest.err; then
13657     ac_cpp_err=$ac_c_preproc_warn_flag
13658   else
13659     ac_cpp_err=
13660   fi
13661 else
13662   ac_cpp_err=yes
13663 fi
13664 if test -z "$ac_cpp_err"; then
13665   eval "$as_ac_Header=yes"
13666 else
13667   echo "$as_me: failed program was:" >&5
13668   cat conftest.$ac_ext >&5
13669   eval "$as_ac_Header=no"
13670 fi
13671 rm -f conftest.err conftest.$ac_ext
13672 fi
13673 echo "$as_me:13673: result: `eval echo '${'$as_ac_Header'}'`" >&5
13674 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13675 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13676   cat >>confdefs.h <<EOF
13677 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13678 EOF
13679
13680 fi
13681 done
13682
13683         ;;
13684 esac
13685
13686 echo "$as_me:13686: checking for ANSI C header files" >&5
13687 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13688 if test "${ac_cv_header_stdc+set}" = set; then
13689   echo $ECHO_N "(cached) $ECHO_C" >&6
13690 else
13691   cat >conftest.$ac_ext <<_ACEOF
13692 #line 13692 "configure"
13693 #include "confdefs.h"
13694 #include <stdlib.h>
13695 #include <stdarg.h>
13696 #include <string.h>
13697 #include <float.h>
13698
13699 _ACEOF
13700 if { (eval echo "$as_me:13700: \"$ac_cpp conftest.$ac_ext\"") >&5
13701   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13702   ac_status=$?
13703   egrep -v '^ *\+' conftest.er1 >conftest.err
13704   rm -f conftest.er1
13705   cat conftest.err >&5
13706   echo "$as_me:13706: \$? = $ac_status" >&5
13707   (exit $ac_status); } >/dev/null; then
13708   if test -s conftest.err; then
13709     ac_cpp_err=$ac_c_preproc_warn_flag
13710   else
13711     ac_cpp_err=
13712   fi
13713 else
13714   ac_cpp_err=yes
13715 fi
13716 if test -z "$ac_cpp_err"; then
13717   ac_cv_header_stdc=yes
13718 else
13719   echo "$as_me: failed program was:" >&5
13720   cat conftest.$ac_ext >&5
13721   ac_cv_header_stdc=no
13722 fi
13723 rm -f conftest.err conftest.$ac_ext
13724
13725 if test $ac_cv_header_stdc = yes; then
13726   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13727   cat >conftest.$ac_ext <<_ACEOF
13728 #line 13728 "configure"
13729 #include "confdefs.h"
13730 #include <string.h>
13731
13732 _ACEOF
13733 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13734   egrep "memchr" >/dev/null 2>&1; then
13735   :
13736 else
13737   ac_cv_header_stdc=no
13738 fi
13739 rm -rf conftest*
13740
13741 fi
13742
13743 if test $ac_cv_header_stdc = yes; then
13744   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13745   cat >conftest.$ac_ext <<_ACEOF
13746 #line 13746 "configure"
13747 #include "confdefs.h"
13748 #include <stdlib.h>
13749
13750 _ACEOF
13751 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13752   egrep "free" >/dev/null 2>&1; then
13753   :
13754 else
13755   ac_cv_header_stdc=no
13756 fi
13757 rm -rf conftest*
13758
13759 fi
13760
13761 if test $ac_cv_header_stdc = yes; then
13762   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13763   if test "$cross_compiling" = yes; then
13764   :
13765 else
13766   cat >conftest.$ac_ext <<_ACEOF
13767 #line 13767 "configure"
13768 #include "confdefs.h"
13769 #include <ctype.h>
13770 #if ((' ' & 0x0FF) == 0x020)
13771 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13772 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13773 #else
13774 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13775                      || ('j' <= (c) && (c) <= 'r') \
13776                      || ('s' <= (c) && (c) <= 'z'))
13777 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13778 #endif
13779
13780 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13781 int
13782 main ()
13783 {
13784   int i;
13785   for (i = 0; i < 256; i++)
13786     if (XOR (islower (i), ISLOWER (i))
13787         || toupper (i) != TOUPPER (i))
13788       $ac_main_return(2);
13789   $ac_main_return (0);
13790 }
13791 _ACEOF
13792 rm -f conftest$ac_exeext
13793 if { (eval echo "$as_me:13793: \"$ac_link\"") >&5
13794   (eval $ac_link) 2>&5
13795   ac_status=$?
13796   echo "$as_me:13796: \$? = $ac_status" >&5
13797   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13798   { (eval echo "$as_me:13798: \"$ac_try\"") >&5
13799   (eval $ac_try) 2>&5
13800   ac_status=$?
13801   echo "$as_me:13801: \$? = $ac_status" >&5
13802   (exit $ac_status); }; }; then
13803   :
13804 else
13805   echo "$as_me: program exited with status $ac_status" >&5
13806 echo "$as_me: failed program was:" >&5
13807 cat conftest.$ac_ext >&5
13808 ac_cv_header_stdc=no
13809 fi
13810 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13811 fi
13812 fi
13813 fi
13814 echo "$as_me:13814: result: $ac_cv_header_stdc" >&5
13815 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13816 if test $ac_cv_header_stdc = yes; then
13817
13818 cat >>confdefs.h <<\EOF
13819 #define STDC_HEADERS 1
13820 EOF
13821
13822 fi
13823
13824 echo "$as_me:13824: checking whether time.h and sys/time.h may both be included" >&5
13825 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13826 if test "${ac_cv_header_time+set}" = set; then
13827   echo $ECHO_N "(cached) $ECHO_C" >&6
13828 else
13829   cat >conftest.$ac_ext <<_ACEOF
13830 #line 13830 "configure"
13831 #include "confdefs.h"
13832 #include <sys/types.h>
13833 #include <sys/time.h>
13834 #include <time.h>
13835
13836 int
13837 main ()
13838 {
13839 if ((struct tm *) 0)
13840 return 0;
13841   ;
13842   return 0;
13843 }
13844 _ACEOF
13845 rm -f conftest.$ac_objext
13846 if { (eval echo "$as_me:13846: \"$ac_compile\"") >&5
13847   (eval $ac_compile) 2>&5
13848   ac_status=$?
13849   echo "$as_me:13849: \$? = $ac_status" >&5
13850   (exit $ac_status); } &&
13851          { ac_try='test -s conftest.$ac_objext'
13852   { (eval echo "$as_me:13852: \"$ac_try\"") >&5
13853   (eval $ac_try) 2>&5
13854   ac_status=$?
13855   echo "$as_me:13855: \$? = $ac_status" >&5
13856   (exit $ac_status); }; }; then
13857   ac_cv_header_time=yes
13858 else
13859   echo "$as_me: failed program was:" >&5
13860 cat conftest.$ac_ext >&5
13861 ac_cv_header_time=no
13862 fi
13863 rm -f conftest.$ac_objext conftest.$ac_ext
13864 fi
13865 echo "$as_me:13865: result: $ac_cv_header_time" >&5
13866 echo "${ECHO_T}$ac_cv_header_time" >&6
13867 if test $ac_cv_header_time = yes; then
13868
13869 cat >>confdefs.h <<\EOF
13870 #define TIME_WITH_SYS_TIME 1
13871 EOF
13872
13873 fi
13874
13875 for ac_header in \
13876 getopt.h \
13877 locale.h \
13878 math.h \
13879 stdarg.h \
13880 sys/ioctl.h \
13881 sys/select.h \
13882 sys/time.h \
13883 termios.h \
13884 unistd.h \
13885
13886 do
13887 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13888 echo "$as_me:13888: checking for $ac_header" >&5
13889 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13890 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13891   echo $ECHO_N "(cached) $ECHO_C" >&6
13892 else
13893   cat >conftest.$ac_ext <<_ACEOF
13894 #line 13894 "configure"
13895 #include "confdefs.h"
13896 #include <$ac_header>
13897 _ACEOF
13898 if { (eval echo "$as_me:13898: \"$ac_cpp conftest.$ac_ext\"") >&5
13899   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13900   ac_status=$?
13901   egrep -v '^ *\+' conftest.er1 >conftest.err
13902   rm -f conftest.er1
13903   cat conftest.err >&5
13904   echo "$as_me:13904: \$? = $ac_status" >&5
13905   (exit $ac_status); } >/dev/null; then
13906   if test -s conftest.err; then
13907     ac_cpp_err=$ac_c_preproc_warn_flag
13908   else
13909     ac_cpp_err=
13910   fi
13911 else
13912   ac_cpp_err=yes
13913 fi
13914 if test -z "$ac_cpp_err"; then
13915   eval "$as_ac_Header=yes"
13916 else
13917   echo "$as_me: failed program was:" >&5
13918   cat conftest.$ac_ext >&5
13919   eval "$as_ac_Header=no"
13920 fi
13921 rm -f conftest.err conftest.$ac_ext
13922 fi
13923 echo "$as_me:13923: result: `eval echo '${'$as_ac_Header'}'`" >&5
13924 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13925 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13926   cat >>confdefs.h <<EOF
13927 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13928 EOF
13929
13930 fi
13931 done
13932
13933 for ac_header in unistd.h getopt.h
13934 do
13935 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13936 echo "$as_me:13936: checking for $ac_header" >&5
13937 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13938 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13939   echo $ECHO_N "(cached) $ECHO_C" >&6
13940 else
13941   cat >conftest.$ac_ext <<_ACEOF
13942 #line 13942 "configure"
13943 #include "confdefs.h"
13944 #include <$ac_header>
13945 _ACEOF
13946 if { (eval echo "$as_me:13946: \"$ac_cpp conftest.$ac_ext\"") >&5
13947   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13948   ac_status=$?
13949   egrep -v '^ *\+' conftest.er1 >conftest.err
13950   rm -f conftest.er1
13951   cat conftest.err >&5
13952   echo "$as_me:13952: \$? = $ac_status" >&5
13953   (exit $ac_status); } >/dev/null; then
13954   if test -s conftest.err; then
13955     ac_cpp_err=$ac_c_preproc_warn_flag
13956   else
13957     ac_cpp_err=
13958   fi
13959 else
13960   ac_cpp_err=yes
13961 fi
13962 if test -z "$ac_cpp_err"; then
13963   eval "$as_ac_Header=yes"
13964 else
13965   echo "$as_me: failed program was:" >&5
13966   cat conftest.$ac_ext >&5
13967   eval "$as_ac_Header=no"
13968 fi
13969 rm -f conftest.err conftest.$ac_ext
13970 fi
13971 echo "$as_me:13971: result: `eval echo '${'$as_ac_Header'}'`" >&5
13972 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13973 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13974   cat >>confdefs.h <<EOF
13975 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13976 EOF
13977
13978 fi
13979 done
13980
13981 echo "$as_me:13981: checking for header declaring getopt variables" >&5
13982 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13983 if test "${cf_cv_getopt_header+set}" = set; then
13984   echo $ECHO_N "(cached) $ECHO_C" >&6
13985 else
13986
13987 cf_cv_getopt_header=none
13988 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13989 do
13990 cat >conftest.$ac_ext <<_ACEOF
13991 #line 13991 "configure"
13992 #include "confdefs.h"
13993
13994 #include <$cf_header>
13995 int
13996 main ()
13997 {
13998 int x = optind; char *y = optarg
13999   ;
14000   return 0;
14001 }
14002 _ACEOF
14003 rm -f conftest.$ac_objext
14004 if { (eval echo "$as_me:14004: \"$ac_compile\"") >&5
14005   (eval $ac_compile) 2>&5
14006   ac_status=$?
14007   echo "$as_me:14007: \$? = $ac_status" >&5
14008   (exit $ac_status); } &&
14009          { ac_try='test -s conftest.$ac_objext'
14010   { (eval echo "$as_me:14010: \"$ac_try\"") >&5
14011   (eval $ac_try) 2>&5
14012   ac_status=$?
14013   echo "$as_me:14013: \$? = $ac_status" >&5
14014   (exit $ac_status); }; }; then
14015   cf_cv_getopt_header=$cf_header
14016  break
14017 else
14018   echo "$as_me: failed program was:" >&5
14019 cat conftest.$ac_ext >&5
14020 fi
14021 rm -f conftest.$ac_objext conftest.$ac_ext
14022 done
14023
14024 fi
14025 echo "$as_me:14025: result: $cf_cv_getopt_header" >&5
14026 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14027 if test $cf_cv_getopt_header != none ; then
14028
14029 cat >>confdefs.h <<\EOF
14030 #define HAVE_GETOPT_HEADER 1
14031 EOF
14032
14033 fi
14034 if test $cf_cv_getopt_header = getopt.h ; then
14035
14036 cat >>confdefs.h <<\EOF
14037 #define NEED_GETOPT_H 1
14038 EOF
14039
14040 fi
14041
14042 for ac_func in \
14043 getopt \
14044 gettimeofday \
14045
14046 do
14047 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14048 echo "$as_me:14048: checking for $ac_func" >&5
14049 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14050 if eval "test \"\${$as_ac_var+set}\" = set"; then
14051   echo $ECHO_N "(cached) $ECHO_C" >&6
14052 else
14053   cat >conftest.$ac_ext <<_ACEOF
14054 #line 14054 "configure"
14055 #include "confdefs.h"
14056 /* System header to define __stub macros and hopefully few prototypes,
14057     which can conflict with char $ac_func (); below.  */
14058 #include <assert.h>
14059 /* Override any gcc2 internal prototype to avoid an error.  */
14060 #ifdef __cplusplus
14061 extern "C"
14062 #endif
14063 /* We use char because int might match the return type of a gcc2
14064    builtin and then its argument prototype would still apply.  */
14065 char $ac_func ();
14066 char (*f) ();
14067
14068 int
14069 main ()
14070 {
14071 /* The GNU C library defines this for functions which it implements
14072     to always fail with ENOSYS.  Some functions are actually named
14073     something starting with __ and the normal name is an alias.  */
14074 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14075 choke me
14076 #else
14077 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14078 #endif
14079
14080   ;
14081   return 0;
14082 }
14083 _ACEOF
14084 rm -f conftest.$ac_objext conftest$ac_exeext
14085 if { (eval echo "$as_me:14085: \"$ac_link\"") >&5
14086   (eval $ac_link) 2>&5
14087   ac_status=$?
14088   echo "$as_me:14088: \$? = $ac_status" >&5
14089   (exit $ac_status); } &&
14090          { ac_try='test -s conftest$ac_exeext'
14091   { (eval echo "$as_me:14091: \"$ac_try\"") >&5
14092   (eval $ac_try) 2>&5
14093   ac_status=$?
14094   echo "$as_me:14094: \$? = $ac_status" >&5
14095   (exit $ac_status); }; }; then
14096   eval "$as_ac_var=yes"
14097 else
14098   echo "$as_me: failed program was:" >&5
14099 cat conftest.$ac_ext >&5
14100 eval "$as_ac_var=no"
14101 fi
14102 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14103 fi
14104 echo "$as_me:14104: result: `eval echo '${'$as_ac_var'}'`" >&5
14105 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14106 if test `eval echo '${'$as_ac_var'}'` = yes; then
14107   cat >>confdefs.h <<EOF
14108 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14109 EOF
14110
14111 fi
14112 done
14113
14114 if test "x$ac_cv_func_getopt" = xno; then
14115         { { echo "$as_me:14115: error: getopt is required for building programs" >&5
14116 echo "$as_me: error: getopt is required for building programs" >&2;}
14117    { (exit 1); exit 1; }; }
14118 fi
14119
14120 if test "$cf_enable_widec" = yes; then
14121
14122 for ac_func in \
14123 mblen \
14124 mbrlen \
14125 mbrtowc \
14126 mbsrtowcs \
14127 mbstowcs \
14128 mbtowc \
14129 wcsrtombs \
14130 wcstombs \
14131
14132 do
14133 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14134 echo "$as_me:14134: checking for $ac_func" >&5
14135 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14136 if eval "test \"\${$as_ac_var+set}\" = set"; then
14137   echo $ECHO_N "(cached) $ECHO_C" >&6
14138 else
14139   cat >conftest.$ac_ext <<_ACEOF
14140 #line 14140 "configure"
14141 #include "confdefs.h"
14142 /* System header to define __stub macros and hopefully few prototypes,
14143     which can conflict with char $ac_func (); below.  */
14144 #include <assert.h>
14145 /* Override any gcc2 internal prototype to avoid an error.  */
14146 #ifdef __cplusplus
14147 extern "C"
14148 #endif
14149 /* We use char because int might match the return type of a gcc2
14150    builtin and then its argument prototype would still apply.  */
14151 char $ac_func ();
14152 char (*f) ();
14153
14154 int
14155 main ()
14156 {
14157 /* The GNU C library defines this for functions which it implements
14158     to always fail with ENOSYS.  Some functions are actually named
14159     something starting with __ and the normal name is an alias.  */
14160 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14161 choke me
14162 #else
14163 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14164 #endif
14165
14166   ;
14167   return 0;
14168 }
14169 _ACEOF
14170 rm -f conftest.$ac_objext conftest$ac_exeext
14171 if { (eval echo "$as_me:14171: \"$ac_link\"") >&5
14172   (eval $ac_link) 2>&5
14173   ac_status=$?
14174   echo "$as_me:14174: \$? = $ac_status" >&5
14175   (exit $ac_status); } &&
14176          { ac_try='test -s conftest$ac_exeext'
14177   { (eval echo "$as_me:14177: \"$ac_try\"") >&5
14178   (eval $ac_try) 2>&5
14179   ac_status=$?
14180   echo "$as_me:14180: \$? = $ac_status" >&5
14181   (exit $ac_status); }; }; then
14182   eval "$as_ac_var=yes"
14183 else
14184   echo "$as_me: failed program was:" >&5
14185 cat conftest.$ac_ext >&5
14186 eval "$as_ac_var=no"
14187 fi
14188 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14189 fi
14190 echo "$as_me:14190: result: `eval echo '${'$as_ac_var'}'`" >&5
14191 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14192 if test `eval echo '${'$as_ac_var'}'` = yes; then
14193   cat >>confdefs.h <<EOF
14194 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14195 EOF
14196
14197 fi
14198 done
14199
14200 fi
14201
14202 echo "$as_me:14202: checking definition to turn on extended curses functions" >&5
14203 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14204 if test "${cf_cv_need_xopen_extension+set}" = set; then
14205   echo $ECHO_N "(cached) $ECHO_C" >&6
14206 else
14207
14208 cf_cv_need_xopen_extension=unknown
14209 cat >conftest.$ac_ext <<_ACEOF
14210 #line 14210 "configure"
14211 #include "confdefs.h"
14212
14213 #include <stdlib.h>
14214 #include <${cf_cv_ncurses_header:-curses.h}>
14215 int
14216 main ()
14217 {
14218
14219 #if defined(NCURSES_VERSION_PATCH)
14220 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14221         make an error
14222 #endif
14223 #endif
14224 #ifdef NCURSES_VERSION
14225         cchar_t check;
14226         int check2 = curs_set((int)sizeof(check));
14227 #endif
14228         long x = winnstr(stdscr, "", 0);
14229         int x1, y1;
14230         getbegyx(stdscr, y1, x1)
14231   ;
14232   return 0;
14233 }
14234 _ACEOF
14235 rm -f conftest.$ac_objext conftest$ac_exeext
14236 if { (eval echo "$as_me:14236: \"$ac_link\"") >&5
14237   (eval $ac_link) 2>&5
14238   ac_status=$?
14239   echo "$as_me:14239: \$? = $ac_status" >&5
14240   (exit $ac_status); } &&
14241          { ac_try='test -s conftest$ac_exeext'
14242   { (eval echo "$as_me:14242: \"$ac_try\"") >&5
14243   (eval $ac_try) 2>&5
14244   ac_status=$?
14245   echo "$as_me:14245: \$? = $ac_status" >&5
14246   (exit $ac_status); }; }; then
14247   cf_cv_need_xopen_extension=none
14248 else
14249   echo "$as_me: failed program was:" >&5
14250 cat conftest.$ac_ext >&5
14251
14252         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14253         do
14254                 cat >conftest.$ac_ext <<_ACEOF
14255 #line 14255 "configure"
14256 #include "confdefs.h"
14257
14258 #define $cf_try_xopen_extension 1
14259 #include <stdlib.h>
14260 #include <${cf_cv_ncurses_header:-curses.h}>
14261 int
14262 main ()
14263 {
14264
14265 #ifdef NCURSES_VERSION
14266                 cchar_t check;
14267                 int check2 = curs_set((int)sizeof(check));
14268 #endif
14269                 long x = winnstr(stdscr, "", 0);
14270                 int x1, y1;
14271                 getbegyx(stdscr, y1, x1)
14272   ;
14273   return 0;
14274 }
14275 _ACEOF
14276 rm -f conftest.$ac_objext conftest$ac_exeext
14277 if { (eval echo "$as_me:14277: \"$ac_link\"") >&5
14278   (eval $ac_link) 2>&5
14279   ac_status=$?
14280   echo "$as_me:14280: \$? = $ac_status" >&5
14281   (exit $ac_status); } &&
14282          { ac_try='test -s conftest$ac_exeext'
14283   { (eval echo "$as_me:14283: \"$ac_try\"") >&5
14284   (eval $ac_try) 2>&5
14285   ac_status=$?
14286   echo "$as_me:14286: \$? = $ac_status" >&5
14287   (exit $ac_status); }; }; then
14288   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14289 else
14290   echo "$as_me: failed program was:" >&5
14291 cat conftest.$ac_ext >&5
14292 fi
14293 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14294         done
14295
14296 fi
14297 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14298
14299 fi
14300 echo "$as_me:14300: result: $cf_cv_need_xopen_extension" >&5
14301 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14302
14303 case $cf_cv_need_xopen_extension in
14304 (*_*)
14305         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14306         ;;
14307 esac
14308
14309 echo "$as_me:14309: checking for term.h" >&5
14310 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14311 if test "${cf_cv_term_header+set}" = set; then
14312   echo $ECHO_N "(cached) $ECHO_C" >&6
14313 else
14314
14315 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14316 # for <term.h> if we do not find the variant.
14317
14318 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14319
14320 case ${cf_cv_ncurses_header:-curses.h} in
14321 (*/*)
14322         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14323         cf_header_list="$cf_header_item $cf_header_list"
14324         ;;
14325 esac
14326
14327 for cf_header in $cf_header_list
14328 do
14329         cat >conftest.$ac_ext <<_ACEOF
14330 #line 14330 "configure"
14331 #include "confdefs.h"
14332
14333 #include <${cf_cv_ncurses_header:-curses.h}>
14334 #include <${cf_header}>
14335 int
14336 main ()
14337 {
14338 WINDOW *x
14339   ;
14340   return 0;
14341 }
14342 _ACEOF
14343 rm -f conftest.$ac_objext
14344 if { (eval echo "$as_me:14344: \"$ac_compile\"") >&5
14345   (eval $ac_compile) 2>&5
14346   ac_status=$?
14347   echo "$as_me:14347: \$? = $ac_status" >&5
14348   (exit $ac_status); } &&
14349          { ac_try='test -s conftest.$ac_objext'
14350   { (eval echo "$as_me:14350: \"$ac_try\"") >&5
14351   (eval $ac_try) 2>&5
14352   ac_status=$?
14353   echo "$as_me:14353: \$? = $ac_status" >&5
14354   (exit $ac_status); }; }; then
14355   cf_cv_term_header=$cf_header
14356          break
14357 else
14358   echo "$as_me: failed program was:" >&5
14359 cat conftest.$ac_ext >&5
14360 cf_cv_term_header=no
14361 fi
14362 rm -f conftest.$ac_objext conftest.$ac_ext
14363 done
14364
14365 case $cf_cv_term_header in
14366 (no)
14367         # If curses is ncurses, some packagers still mess it up by trying to make
14368         # us use GNU termcap.  This handles the most common case.
14369         for cf_header in ncurses/term.h ncursesw/term.h
14370         do
14371                 cat >conftest.$ac_ext <<_ACEOF
14372 #line 14372 "configure"
14373 #include "confdefs.h"
14374
14375 #include <${cf_cv_ncurses_header:-curses.h}>
14376 #ifdef NCURSES_VERSION
14377 #include <${cf_header}>
14378 #else
14379 make an error
14380 #endif
14381 int
14382 main ()
14383 {
14384 WINDOW *x
14385   ;
14386   return 0;
14387 }
14388 _ACEOF
14389 rm -f conftest.$ac_objext
14390 if { (eval echo "$as_me:14390: \"$ac_compile\"") >&5
14391   (eval $ac_compile) 2>&5
14392   ac_status=$?
14393   echo "$as_me:14393: \$? = $ac_status" >&5
14394   (exit $ac_status); } &&
14395          { ac_try='test -s conftest.$ac_objext'
14396   { (eval echo "$as_me:14396: \"$ac_try\"") >&5
14397   (eval $ac_try) 2>&5
14398   ac_status=$?
14399   echo "$as_me:14399: \$? = $ac_status" >&5
14400   (exit $ac_status); }; }; then
14401   cf_cv_term_header=$cf_header
14402                          break
14403 else
14404   echo "$as_me: failed program was:" >&5
14405 cat conftest.$ac_ext >&5
14406 cf_cv_term_header=no
14407 fi
14408 rm -f conftest.$ac_objext conftest.$ac_ext
14409         done
14410         ;;
14411 esac
14412
14413 fi
14414 echo "$as_me:14414: result: $cf_cv_term_header" >&5
14415 echo "${ECHO_T}$cf_cv_term_header" >&6
14416
14417 case $cf_cv_term_header in
14418 (term.h)
14419
14420 cat >>confdefs.h <<\EOF
14421 #define HAVE_TERM_H 1
14422 EOF
14423
14424         ;;
14425 (ncurses/term.h)
14426
14427 cat >>confdefs.h <<\EOF
14428 #define HAVE_NCURSES_TERM_H 1
14429 EOF
14430
14431         ;;
14432 (ncursesw/term.h)
14433
14434 cat >>confdefs.h <<\EOF
14435 #define HAVE_NCURSESW_TERM_H 1
14436 EOF
14437
14438         ;;
14439 esac
14440
14441 echo "$as_me:14441: checking for unctrl.h" >&5
14442 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14443 if test "${cf_cv_unctrl_header+set}" = set; then
14444   echo $ECHO_N "(cached) $ECHO_C" >&6
14445 else
14446
14447 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14448 # for <unctrl.h> if we do not find the variant.
14449
14450 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14451
14452 case ${cf_cv_ncurses_header:-curses.h} in
14453 (*/*)
14454         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14455         cf_header_list="$cf_header_item $cf_header_list"
14456         ;;
14457 esac
14458
14459 for cf_header in $cf_header_list
14460 do
14461         cat >conftest.$ac_ext <<_ACEOF
14462 #line 14462 "configure"
14463 #include "confdefs.h"
14464
14465 #include <${cf_cv_ncurses_header:-curses.h}>
14466 #include <${cf_header}>
14467 int
14468 main ()
14469 {
14470 WINDOW *x
14471   ;
14472   return 0;
14473 }
14474 _ACEOF
14475 rm -f conftest.$ac_objext
14476 if { (eval echo "$as_me:14476: \"$ac_compile\"") >&5
14477   (eval $ac_compile) 2>&5
14478   ac_status=$?
14479   echo "$as_me:14479: \$? = $ac_status" >&5
14480   (exit $ac_status); } &&
14481          { ac_try='test -s conftest.$ac_objext'
14482   { (eval echo "$as_me:14482: \"$ac_try\"") >&5
14483   (eval $ac_try) 2>&5
14484   ac_status=$?
14485   echo "$as_me:14485: \$? = $ac_status" >&5
14486   (exit $ac_status); }; }; then
14487   cf_cv_unctrl_header=$cf_header
14488          break
14489 else
14490   echo "$as_me: failed program was:" >&5
14491 cat conftest.$ac_ext >&5
14492 cf_cv_unctrl_header=no
14493 fi
14494 rm -f conftest.$ac_objext conftest.$ac_ext
14495 done
14496
14497 fi
14498 echo "$as_me:14498: result: $cf_cv_unctrl_header" >&5
14499 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14500
14501 case $cf_cv_unctrl_header in
14502 (no)
14503         { echo "$as_me:14503: WARNING: unctrl.h header not found" >&5
14504 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14505         ;;
14506 esac
14507
14508 case $cf_cv_unctrl_header in
14509 (unctrl.h)
14510
14511 cat >>confdefs.h <<\EOF
14512 #define HAVE_UNCTRL_H 1
14513 EOF
14514
14515         ;;
14516 (ncurses/unctrl.h)
14517
14518 cat >>confdefs.h <<\EOF
14519 #define HAVE_NCURSES_UNCTRL_H 1
14520 EOF
14521
14522         ;;
14523 (ncursesw/unctrl.h)
14524
14525 cat >>confdefs.h <<\EOF
14526 #define HAVE_NCURSESW_UNCTRL_H 1
14527 EOF
14528
14529         ;;
14530 esac
14531
14532 for cf_func in \
14533 assume_default_colors \
14534 chgat \
14535 color_set \
14536 filter \
14537 getbegx \
14538 getcurx \
14539 getmaxx \
14540 getnstr \
14541 getparx \
14542 getwin \
14543 mvvline \
14544 mvwvline \
14545 napms \
14546 putwin \
14547 resize_term \
14548 resizeterm \
14549 restartterm \
14550 ripoffline \
14551 scr_dump \
14552 setupterm \
14553 slk_color \
14554 slk_init \
14555 termattrs \
14556 tgetent \
14557 tigetnum \
14558 tigetstr \
14559 typeahead \
14560 use_default_colors \
14561 use_env \
14562 use_extended_names \
14563 use_screen \
14564 use_window \
14565 vid_puts \
14566 vidputs \
14567 vsscanf \
14568 vw_printw \
14569 wchgat \
14570 winsstr \
14571 wresize \
14572 wsyncdown \
14573
14574 do
14575
14576 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14577
14578         echo "$as_me:14578: checking for ${cf_func}" >&5
14579 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14580
14581 echo "${as_me:-configure}:14581: testing ${cf_func} ..." 1>&5
14582
14583         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14584   echo $ECHO_N "(cached) $ECHO_C" >&6
14585 else
14586
14587                 eval cf_result='$ac_cv_func_'$cf_func
14588                 if test ".$cf_result" != ".no"; then
14589                         cat >conftest.$ac_ext <<_ACEOF
14590 #line 14590 "configure"
14591 #include "confdefs.h"
14592
14593 #ifdef HAVE_XCURSES
14594 #include <xcurses.h>
14595 char * XCursesProgramName = "test";
14596 #else
14597 #include <${cf_cv_ncurses_header:-curses.h}>
14598 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14599 #include <ncursesw/term.h>
14600 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14601 #include <ncurses/term.h>
14602 #elif defined(HAVE_TERM_H)
14603 #include <term.h>
14604 #endif
14605 #endif
14606
14607 int
14608 main ()
14609 {
14610
14611 #ifndef ${cf_func}
14612 long foo = (long)(&${cf_func});
14613 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14614 if (foo + 1234 > 5678)
14615         ${cf_cv_main_return:-return}(foo);
14616 #endif
14617
14618   ;
14619   return 0;
14620 }
14621 _ACEOF
14622 rm -f conftest.$ac_objext conftest$ac_exeext
14623 if { (eval echo "$as_me:14623: \"$ac_link\"") >&5
14624   (eval $ac_link) 2>&5
14625   ac_status=$?
14626   echo "$as_me:14626: \$? = $ac_status" >&5
14627   (exit $ac_status); } &&
14628          { ac_try='test -s conftest$ac_exeext'
14629   { (eval echo "$as_me:14629: \"$ac_try\"") >&5
14630   (eval $ac_try) 2>&5
14631   ac_status=$?
14632   echo "$as_me:14632: \$? = $ac_status" >&5
14633   (exit $ac_status); }; }; then
14634   cf_result=yes
14635 else
14636   echo "$as_me: failed program was:" >&5
14637 cat conftest.$ac_ext >&5
14638 cf_result=no
14639 fi
14640 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14641                 fi
14642                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14643
14644 fi
14645
14646         # use the computed/retrieved cache-value:
14647         eval 'cf_result=$cf_cv_func_'$cf_func
14648         echo "$as_me:14648: result: $cf_result" >&5
14649 echo "${ECHO_T}$cf_result" >&6
14650         if test $cf_result != no; then
14651                 cat >>confdefs.h <<EOF
14652 #define HAVE_${cf_tr_func} 1
14653 EOF
14654
14655         fi
14656 done
14657
14658 for cf_func in tputs
14659 do
14660
14661 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14662
14663         echo "$as_me:14663: checking for ${cf_func}" >&5
14664 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14665
14666 echo "${as_me:-configure}:14666: testing ${cf_func} ..." 1>&5
14667
14668         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14669   echo $ECHO_N "(cached) $ECHO_C" >&6
14670 else
14671
14672                 eval cf_result='$ac_cv_func_'$cf_func
14673                 if test ".$cf_result" != ".no"; then
14674                         cat >conftest.$ac_ext <<_ACEOF
14675 #line 14675 "configure"
14676 #include "confdefs.h"
14677
14678 #ifdef HAVE_XCURSES
14679 #include <xcurses.h>
14680 char * XCursesProgramName = "test";
14681 #else
14682 #include <${cf_cv_ncurses_header:-curses.h}>
14683 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14684 #include <ncursesw/term.h>
14685 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14686 #include <ncurses/term.h>
14687 #elif defined(HAVE_TERM_H)
14688 #include <term.h>
14689 #endif
14690 #endif
14691
14692 int
14693 main ()
14694 {
14695
14696 #ifndef ${cf_func}
14697 long foo = (long)(&${cf_func});
14698 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14699 if (foo + 1234 > 5678)
14700         ${cf_cv_main_return:-return}(foo);
14701 #endif
14702
14703   ;
14704   return 0;
14705 }
14706 _ACEOF
14707 rm -f conftest.$ac_objext conftest$ac_exeext
14708 if { (eval echo "$as_me:14708: \"$ac_link\"") >&5
14709   (eval $ac_link) 2>&5
14710   ac_status=$?
14711   echo "$as_me:14711: \$? = $ac_status" >&5
14712   (exit $ac_status); } &&
14713          { ac_try='test -s conftest$ac_exeext'
14714   { (eval echo "$as_me:14714: \"$ac_try\"") >&5
14715   (eval $ac_try) 2>&5
14716   ac_status=$?
14717   echo "$as_me:14717: \$? = $ac_status" >&5
14718   (exit $ac_status); }; }; then
14719   cf_result=yes
14720 else
14721   echo "$as_me: failed program was:" >&5
14722 cat conftest.$ac_ext >&5
14723 cf_result=no
14724 fi
14725 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14726                 fi
14727                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14728
14729 fi
14730
14731         # use the computed/retrieved cache-value:
14732         eval 'cf_result=$cf_cv_func_'$cf_func
14733         echo "$as_me:14733: result: $cf_result" >&5
14734 echo "${ECHO_T}$cf_result" >&6
14735         if test $cf_result != no; then
14736                 cat >>confdefs.h <<EOF
14737 #define HAVE_${cf_tr_func} 1
14738 EOF
14739
14740         fi
14741 done
14742
14743 if test x$cf_cv_func_tputs = xyes
14744 then
14745         cf_done=no
14746         for cf_arg in int char
14747         do
14748                 for cf_ret in int void
14749                 do
14750                         if test $cf_ret = void
14751                         then
14752                                 cf_return="/* nothing */"
14753                         else
14754                                 cf_return="return value"
14755                         fi
14756                         cat >conftest.$ac_ext <<_ACEOF
14757 #line 14757 "configure"
14758 #include "confdefs.h"
14759
14760 #include <${cf_cv_ncurses_header:-curses.h}>
14761 #include <$cf_cv_term_header>
14762
14763 static $cf_ret outc($cf_arg value) { $cf_return; }
14764
14765 int
14766 main ()
14767 {
14768
14769         tputs("hello", 0, outc);
14770         ${cf_cv_main_return:-return}(0);
14771
14772   ;
14773   return 0;
14774 }
14775 _ACEOF
14776 rm -f conftest.$ac_objext
14777 if { (eval echo "$as_me:14777: \"$ac_compile\"") >&5
14778   (eval $ac_compile) 2>&5
14779   ac_status=$?
14780   echo "$as_me:14780: \$? = $ac_status" >&5
14781   (exit $ac_status); } &&
14782          { ac_try='test -s conftest.$ac_objext'
14783   { (eval echo "$as_me:14783: \"$ac_try\"") >&5
14784   (eval $ac_try) 2>&5
14785   ac_status=$?
14786   echo "$as_me:14786: \$? = $ac_status" >&5
14787   (exit $ac_status); }; }; then
14788
14789                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14790
14791 echo "${as_me:-configure}:14791: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14792
14793                 cat >>confdefs.h <<EOF
14794 #define TPUTS_ARG               $cf_arg
14795 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14796 #define TPUTS_RETURN(value)     $cf_return
14797 EOF
14798                 cf_done=yes
14799                 break
14800
14801 else
14802   echo "$as_me: failed program was:" >&5
14803 cat conftest.$ac_ext >&5
14804 fi
14805 rm -f conftest.$ac_objext conftest.$ac_ext
14806                 done
14807                 test $cf_done = yes && break
14808         done
14809 fi
14810
14811 echo "$as_me:14811: checking for ncurses extended functions" >&5
14812 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14813 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14814   echo $ECHO_N "(cached) $ECHO_C" >&6
14815 else
14816
14817 cat >conftest.$ac_ext <<_ACEOF
14818 #line 14818 "configure"
14819 #include "confdefs.h"
14820
14821 #include <${cf_cv_ncurses_header:-curses.h}>
14822 int
14823 main ()
14824 {
14825
14826 int x = NCURSES_EXT_FUNCS
14827
14828   ;
14829   return 0;
14830 }
14831 _ACEOF
14832 rm -f conftest.$ac_objext
14833 if { (eval echo "$as_me:14833: \"$ac_compile\"") >&5
14834   (eval $ac_compile) 2>&5
14835   ac_status=$?
14836   echo "$as_me:14836: \$? = $ac_status" >&5
14837   (exit $ac_status); } &&
14838          { ac_try='test -s conftest.$ac_objext'
14839   { (eval echo "$as_me:14839: \"$ac_try\"") >&5
14840   (eval $ac_try) 2>&5
14841   ac_status=$?
14842   echo "$as_me:14842: \$? = $ac_status" >&5
14843   (exit $ac_status); }; }; then
14844   cf_cv_ncurses_ext_funcs=defined
14845 else
14846   echo "$as_me: failed program was:" >&5
14847 cat conftest.$ac_ext >&5
14848
14849 cat >conftest.$ac_ext <<_ACEOF
14850 #line 14850 "configure"
14851 #include "confdefs.h"
14852
14853 #include <${cf_cv_ncurses_header:-curses.h}>
14854 int
14855 main ()
14856 {
14857
14858         (void) assume_default_colors (0, 0);
14859         (void) curses_version ();
14860         (void) define_key (0, 0);
14861         (void) is_term_resized (0, 0);
14862         (void) key_defined (0);
14863         (void) keybound (0, 0);
14864         (void) keyok (0, 0);
14865         (void) resize_term (0, 0);
14866         (void) resizeterm (0, 0);
14867         (void) use_default_colors ();
14868         (void) use_extended_names (0);
14869         (void) wresize (0, 0, 0);
14870   ;
14871   return 0;
14872 }
14873 _ACEOF
14874 rm -f conftest.$ac_objext conftest$ac_exeext
14875 if { (eval echo "$as_me:14875: \"$ac_link\"") >&5
14876   (eval $ac_link) 2>&5
14877   ac_status=$?
14878   echo "$as_me:14878: \$? = $ac_status" >&5
14879   (exit $ac_status); } &&
14880          { ac_try='test -s conftest$ac_exeext'
14881   { (eval echo "$as_me:14881: \"$ac_try\"") >&5
14882   (eval $ac_try) 2>&5
14883   ac_status=$?
14884   echo "$as_me:14884: \$? = $ac_status" >&5
14885   (exit $ac_status); }; }; then
14886   cf_cv_ncurses_ext_funcs=yes
14887 else
14888   echo "$as_me: failed program was:" >&5
14889 cat conftest.$ac_ext >&5
14890 cf_cv_ncurses_ext_funcs=no
14891 fi
14892 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14893
14894 fi
14895 rm -f conftest.$ac_objext conftest.$ac_ext
14896
14897 fi
14898 echo "$as_me:14898: result: $cf_cv_ncurses_ext_funcs" >&5
14899 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14900 test "$cf_cv_ncurses_ext_funcs" = yes &&
14901 cat >>confdefs.h <<\EOF
14902 #define NCURSES_EXT_FUNCS 1
14903 EOF
14904
14905 if test "$cf_enable_widec" = yes
14906 then
14907         # workaround for systems with ncurses before 20111029, due to change of
14908         # feature test macro from _XPG5 to _XOPEN_SOURCE
14909         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14910         then
14911                 cf_define_xpg5=no
14912                 echo "$as_me:14912: checking if _XPG5 should be defined to enable wide-characters" >&5
14913 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14914
14915                 cat >conftest.$ac_ext <<_ACEOF
14916 #line 14916 "configure"
14917 #include "confdefs.h"
14918
14919 #include <${cf_cv_ncurses_header:-curses.h}>
14920 int
14921 main ()
14922 {
14923 int x = _XPG5
14924   ;
14925   return 0;
14926 }
14927 _ACEOF
14928 rm -f conftest.$ac_objext
14929 if { (eval echo "$as_me:14929: \"$ac_compile\"") >&5
14930   (eval $ac_compile) 2>&5
14931   ac_status=$?
14932   echo "$as_me:14932: \$? = $ac_status" >&5
14933   (exit $ac_status); } &&
14934          { ac_try='test -s conftest.$ac_objext'
14935   { (eval echo "$as_me:14935: \"$ac_try\"") >&5
14936   (eval $ac_try) 2>&5
14937   ac_status=$?
14938   echo "$as_me:14938: \$? = $ac_status" >&5
14939   (exit $ac_status); }; }; then
14940   :
14941 else
14942   echo "$as_me: failed program was:" >&5
14943 cat conftest.$ac_ext >&5
14944 cf_save_cppflags="$CPPFLAGS"
14945                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14946                          cat >conftest.$ac_ext <<_ACEOF
14947 #line 14947 "configure"
14948 #include "confdefs.h"
14949
14950 #include <${cf_cv_ncurses_header:-curses.h}>
14951 int
14952 main ()
14953 {
14954 int x = _XPG5
14955   ;
14956   return 0;
14957 }
14958 _ACEOF
14959 rm -f conftest.$ac_objext
14960 if { (eval echo "$as_me:14960: \"$ac_compile\"") >&5
14961   (eval $ac_compile) 2>&5
14962   ac_status=$?
14963   echo "$as_me:14963: \$? = $ac_status" >&5
14964   (exit $ac_status); } &&
14965          { ac_try='test -s conftest.$ac_objext'
14966   { (eval echo "$as_me:14966: \"$ac_try\"") >&5
14967   (eval $ac_try) 2>&5
14968   ac_status=$?
14969   echo "$as_me:14969: \$? = $ac_status" >&5
14970   (exit $ac_status); }; }; then
14971   cf_define_xpg5=yes
14972 else
14973   echo "$as_me: failed program was:" >&5
14974 cat conftest.$ac_ext >&5
14975 fi
14976 rm -f conftest.$ac_objext conftest.$ac_ext
14977                          CPPFLAGS="$cf_save_cppflags"
14978 fi
14979 rm -f conftest.$ac_objext conftest.$ac_ext
14980                 echo "$as_me:14980: result: $cf_define_xpg5" >&5
14981 echo "${ECHO_T}$cf_define_xpg5" >&6
14982
14983                 if test "$cf_define_xpg5" = yes
14984                 then
14985                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14986                 fi
14987         fi
14988
14989         echo "$as_me:14989: checking for wide-character functions" >&5
14990 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14991 if test "${cf_cv_widechar_funcs+set}" = set; then
14992   echo $ECHO_N "(cached) $ECHO_C" >&6
14993 else
14994
14995         cat >conftest.$ac_ext <<_ACEOF
14996 #line 14996 "configure"
14997 #include "confdefs.h"
14998
14999 #include <${cf_cv_ncurses_header:-curses.h}>
15000 int
15001 main ()
15002 {
15003
15004                 static wchar_t src_wchar[2];
15005                 static cchar_t dst_cchar;
15006                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15007
15008   ;
15009   return 0;
15010 }
15011 _ACEOF
15012 rm -f conftest.$ac_objext conftest$ac_exeext
15013 if { (eval echo "$as_me:15013: \"$ac_link\"") >&5
15014   (eval $ac_link) 2>&5
15015   ac_status=$?
15016   echo "$as_me:15016: \$? = $ac_status" >&5
15017   (exit $ac_status); } &&
15018          { ac_try='test -s conftest$ac_exeext'
15019   { (eval echo "$as_me:15019: \"$ac_try\"") >&5
15020   (eval $ac_try) 2>&5
15021   ac_status=$?
15022   echo "$as_me:15022: \$? = $ac_status" >&5
15023   (exit $ac_status); }; }; then
15024   cf_cv_widechar_funcs=yes
15025 else
15026   echo "$as_me: failed program was:" >&5
15027 cat conftest.$ac_ext >&5
15028 cf_cv_widechar_funcs=no
15029 fi
15030 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15031
15032 fi
15033 echo "$as_me:15033: result: $cf_cv_widechar_funcs" >&5
15034 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15035         if test "$cf_cv_widechar_funcs" != no ; then
15036
15037 cat >>confdefs.h <<\EOF
15038 #define USE_WIDEC_SUPPORT 1
15039 EOF
15040
15041         else
15042                 cat >>confdefs.h <<\EOF
15043 #define USE_WIDEC_SUPPORT 0
15044 EOF
15045
15046         fi
15047 else
15048         cat >>confdefs.h <<\EOF
15049 #define USE_WIDEC_SUPPORT 0
15050 EOF
15051
15052 fi
15053
15054 echo "$as_me:15054: checking if $cf_cv_screen library uses pthreads" >&5
15055 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15056 if test "${cf_cv_use_pthreads+set}" = set; then
15057   echo $ECHO_N "(cached) $ECHO_C" >&6
15058 else
15059
15060 cat >conftest.$ac_ext <<_ACEOF
15061 #line 15061 "configure"
15062 #include "confdefs.h"
15063
15064 #include <${cf_cv_ncurses_header:-curses.h}>
15065 extern void _nc_init_pthreads(void);
15066
15067 int
15068 main ()
15069 {
15070
15071         initscr();
15072         _nc_init_pthreads();
15073
15074   ;
15075   return 0;
15076 }
15077 _ACEOF
15078 rm -f conftest.$ac_objext conftest$ac_exeext
15079 if { (eval echo "$as_me:15079: \"$ac_link\"") >&5
15080   (eval $ac_link) 2>&5
15081   ac_status=$?
15082   echo "$as_me:15082: \$? = $ac_status" >&5
15083   (exit $ac_status); } &&
15084          { ac_try='test -s conftest$ac_exeext'
15085   { (eval echo "$as_me:15085: \"$ac_try\"") >&5
15086   (eval $ac_try) 2>&5
15087   ac_status=$?
15088   echo "$as_me:15088: \$? = $ac_status" >&5
15089   (exit $ac_status); }; }; then
15090   cf_cv_use_pthreads=yes
15091 else
15092   echo "$as_me: failed program was:" >&5
15093 cat conftest.$ac_ext >&5
15094 cf_cv_use_pthreads=no
15095 fi
15096 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15097
15098 fi
15099 echo "$as_me:15099: result: $cf_cv_use_pthreads" >&5
15100 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
15101 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
15102 #define USE_PTHREADS 1
15103 EOF
15104
15105 echo "$as_me:15105: checking if sys/time.h works with sys/select.h" >&5
15106 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
15107 if test "${cf_cv_sys_time_select+set}" = set; then
15108   echo $ECHO_N "(cached) $ECHO_C" >&6
15109 else
15110
15111 cat >conftest.$ac_ext <<_ACEOF
15112 #line 15112 "configure"
15113 #include "confdefs.h"
15114
15115 #include <sys/types.h>
15116 #ifdef HAVE_SYS_TIME_H
15117 #include <sys/time.h>
15118 #endif
15119 #ifdef HAVE_SYS_SELECT_H
15120 #include <sys/select.h>
15121 #endif
15122
15123 int
15124 main ()
15125 {
15126
15127   ;
15128   return 0;
15129 }
15130 _ACEOF
15131 rm -f conftest.$ac_objext
15132 if { (eval echo "$as_me:15132: \"$ac_compile\"") >&5
15133   (eval $ac_compile) 2>&5
15134   ac_status=$?
15135   echo "$as_me:15135: \$? = $ac_status" >&5
15136   (exit $ac_status); } &&
15137          { ac_try='test -s conftest.$ac_objext'
15138   { (eval echo "$as_me:15138: \"$ac_try\"") >&5
15139   (eval $ac_try) 2>&5
15140   ac_status=$?
15141   echo "$as_me:15141: \$? = $ac_status" >&5
15142   (exit $ac_status); }; }; then
15143   cf_cv_sys_time_select=yes
15144 else
15145   echo "$as_me: failed program was:" >&5
15146 cat conftest.$ac_ext >&5
15147 cf_cv_sys_time_select=no
15148 fi
15149 rm -f conftest.$ac_objext conftest.$ac_ext
15150
15151 fi
15152
15153 echo "$as_me:15153: result: $cf_cv_sys_time_select" >&5
15154 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
15155 test "$cf_cv_sys_time_select" = yes &&
15156 cat >>confdefs.h <<\EOF
15157 #define HAVE_SYS_TIME_SELECT 1
15158 EOF
15159
15160 # special check for test/ditto.c
15161
15162 echo "$as_me:15162: checking for openpty in -lutil" >&5
15163 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
15164 if test "${ac_cv_lib_util_openpty+set}" = set; then
15165   echo $ECHO_N "(cached) $ECHO_C" >&6
15166 else
15167   ac_check_lib_save_LIBS=$LIBS
15168 LIBS="-lutil  $LIBS"
15169 cat >conftest.$ac_ext <<_ACEOF
15170 #line 15170 "configure"
15171 #include "confdefs.h"
15172
15173 /* Override any gcc2 internal prototype to avoid an error.  */
15174 #ifdef __cplusplus
15175 extern "C"
15176 #endif
15177 /* We use char because int might match the return type of a gcc2
15178    builtin and then its argument prototype would still apply.  */
15179 char openpty ();
15180 int
15181 main ()
15182 {
15183 openpty ();
15184   ;
15185   return 0;
15186 }
15187 _ACEOF
15188 rm -f conftest.$ac_objext conftest$ac_exeext
15189 if { (eval echo "$as_me:15189: \"$ac_link\"") >&5
15190   (eval $ac_link) 2>&5
15191   ac_status=$?
15192   echo "$as_me:15192: \$? = $ac_status" >&5
15193   (exit $ac_status); } &&
15194          { ac_try='test -s conftest$ac_exeext'
15195   { (eval echo "$as_me:15195: \"$ac_try\"") >&5
15196   (eval $ac_try) 2>&5
15197   ac_status=$?
15198   echo "$as_me:15198: \$? = $ac_status" >&5
15199   (exit $ac_status); }; }; then
15200   ac_cv_lib_util_openpty=yes
15201 else
15202   echo "$as_me: failed program was:" >&5
15203 cat conftest.$ac_ext >&5
15204 ac_cv_lib_util_openpty=no
15205 fi
15206 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15207 LIBS=$ac_check_lib_save_LIBS
15208 fi
15209 echo "$as_me:15209: result: $ac_cv_lib_util_openpty" >&5
15210 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15211 if test $ac_cv_lib_util_openpty = yes; then
15212   cf_cv_lib_util=yes
15213 else
15214   cf_cv_lib_util=no
15215 fi
15216
15217 echo "$as_me:15217: checking for openpty header" >&5
15218 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15219 if test "${cf_cv_func_openpty+set}" = set; then
15220   echo $ECHO_N "(cached) $ECHO_C" >&6
15221 else
15222
15223         cf_save_LIBS="$LIBS"
15224         test $cf_cv_lib_util = yes && {
15225 cf_add_libs="-lutil"
15226 # Filter out duplicates - this happens with badly-designed ".pc" files...
15227 for cf_add_1lib in $LIBS
15228 do
15229         for cf_add_2lib in $cf_add_libs
15230         do
15231                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15232                 then
15233                         cf_add_1lib=
15234                         break
15235                 fi
15236         done
15237         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15238 done
15239 LIBS="$cf_add_libs"
15240  }
15241         for cf_header in pty.h libutil.h util.h
15242         do
15243         cat >conftest.$ac_ext <<_ACEOF
15244 #line 15244 "configure"
15245 #include "confdefs.h"
15246
15247 #include <$cf_header>
15248
15249 int
15250 main ()
15251 {
15252
15253         int x = openpty((int *)0, (int *)0, (char *)0,
15254                                    (struct termios *)0, (struct winsize *)0);
15255
15256   ;
15257   return 0;
15258 }
15259 _ACEOF
15260 rm -f conftest.$ac_objext conftest$ac_exeext
15261 if { (eval echo "$as_me:15261: \"$ac_link\"") >&5
15262   (eval $ac_link) 2>&5
15263   ac_status=$?
15264   echo "$as_me:15264: \$? = $ac_status" >&5
15265   (exit $ac_status); } &&
15266          { ac_try='test -s conftest$ac_exeext'
15267   { (eval echo "$as_me:15267: \"$ac_try\"") >&5
15268   (eval $ac_try) 2>&5
15269   ac_status=$?
15270   echo "$as_me:15270: \$? = $ac_status" >&5
15271   (exit $ac_status); }; }; then
15272
15273                 cf_cv_func_openpty=$cf_header
15274                 break
15275
15276 else
15277   echo "$as_me: failed program was:" >&5
15278 cat conftest.$ac_ext >&5
15279
15280                 cf_cv_func_openpty=no
15281
15282 fi
15283 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15284         done
15285         LIBS="$cf_save_LIBS"
15286
15287 fi
15288 echo "$as_me:15288: result: $cf_cv_func_openpty" >&5
15289 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15290
15291 if test "$cf_cv_func_openpty" != no ; then
15292
15293 cat >>confdefs.h <<EOF
15294 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15295 EOF
15296
15297 cat >>confdefs.h <<\EOF
15298 #define USE_XTERM_PTY 1
15299 EOF
15300
15301         if test "x$cf_cv_lib_util" = xyes ; then
15302
15303 cf_add_libs="-lutil"
15304 # Filter out duplicates - this happens with badly-designed ".pc" files...
15305 for cf_add_1lib in $TEST_LIBS
15306 do
15307         for cf_add_2lib in $cf_add_libs
15308         do
15309                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15310                 then
15311                         cf_add_1lib=
15312                         break
15313                 fi
15314         done
15315         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15316 done
15317 TEST_LIBS="$cf_add_libs"
15318
15319         fi
15320 fi
15321
15322 echo "$as_me:15322: checking for function curses_version" >&5
15323 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15324 if test "${cf_cv_func_curses_version+set}" = set; then
15325   echo $ECHO_N "(cached) $ECHO_C" >&6
15326 else
15327
15328 if test "$cross_compiling" = yes; then
15329   cf_cv_func_curses_version=unknown
15330 else
15331   cat >conftest.$ac_ext <<_ACEOF
15332 #line 15332 "configure"
15333 #include "confdefs.h"
15334
15335 #include <${cf_cv_ncurses_header:-curses.h}>
15336 int main()
15337 {
15338         char temp[1024];
15339         sprintf(temp, "%s\n", curses_version());
15340         ${cf_cv_main_return:-return}(0);
15341 }
15342
15343 _ACEOF
15344 rm -f conftest$ac_exeext
15345 if { (eval echo "$as_me:15345: \"$ac_link\"") >&5
15346   (eval $ac_link) 2>&5
15347   ac_status=$?
15348   echo "$as_me:15348: \$? = $ac_status" >&5
15349   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15350   { (eval echo "$as_me:15350: \"$ac_try\"") >&5
15351   (eval $ac_try) 2>&5
15352   ac_status=$?
15353   echo "$as_me:15353: \$? = $ac_status" >&5
15354   (exit $ac_status); }; }; then
15355   cf_cv_func_curses_version=yes
15356
15357 else
15358   echo "$as_me: program exited with status $ac_status" >&5
15359 echo "$as_me: failed program was:" >&5
15360 cat conftest.$ac_ext >&5
15361 cf_cv_func_curses_version=no
15362
15363 fi
15364 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15365 fi
15366 rm -f core
15367 fi
15368 echo "$as_me:15368: result: $cf_cv_func_curses_version" >&5
15369 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15370 test "$cf_cv_func_curses_version" = yes &&
15371 cat >>confdefs.h <<\EOF
15372 #define HAVE_CURSES_VERSION 1
15373 EOF
15374
15375 echo "$as_me:15375: checking for alternate character set array" >&5
15376 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15377 if test "${cf_cv_curses_acs_map+set}" = set; then
15378   echo $ECHO_N "(cached) $ECHO_C" >&6
15379 else
15380
15381 cf_cv_curses_acs_map=unknown
15382 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15383 do
15384 cat >conftest.$ac_ext <<_ACEOF
15385 #line 15385 "configure"
15386 #include "confdefs.h"
15387
15388 #include <${cf_cv_ncurses_header:-curses.h}>
15389
15390 int
15391 main ()
15392 {
15393
15394 $name['k'] = ACS_PLUS
15395
15396   ;
15397   return 0;
15398 }
15399 _ACEOF
15400 rm -f conftest.$ac_objext conftest$ac_exeext
15401 if { (eval echo "$as_me:15401: \"$ac_link\"") >&5
15402   (eval $ac_link) 2>&5
15403   ac_status=$?
15404   echo "$as_me:15404: \$? = $ac_status" >&5
15405   (exit $ac_status); } &&
15406          { ac_try='test -s conftest$ac_exeext'
15407   { (eval echo "$as_me:15407: \"$ac_try\"") >&5
15408   (eval $ac_try) 2>&5
15409   ac_status=$?
15410   echo "$as_me:15410: \$? = $ac_status" >&5
15411   (exit $ac_status); }; }; then
15412   cf_cv_curses_acs_map=$name; break
15413 else
15414   echo "$as_me: failed program was:" >&5
15415 cat conftest.$ac_ext >&5
15416 fi
15417 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15418 done
15419
15420 fi
15421 echo "$as_me:15421: result: $cf_cv_curses_acs_map" >&5
15422 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15423
15424 test "$cf_cv_curses_acs_map" != unknown &&
15425 cat >>confdefs.h <<EOF
15426 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15427 EOF
15428
15429 if test "$cf_enable_widec" = yes; then
15430
15431 echo "$as_me:15431: checking for wide alternate character set array" >&5
15432 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15433 if test "${cf_cv_curses_wacs_map+set}" = set; then
15434   echo $ECHO_N "(cached) $ECHO_C" >&6
15435 else
15436
15437         cf_cv_curses_wacs_map=unknown
15438         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15439         do
15440         cat >conftest.$ac_ext <<_ACEOF
15441 #line 15441 "configure"
15442 #include "confdefs.h"
15443
15444 #ifndef _XOPEN_SOURCE_EXTENDED
15445 #define _XOPEN_SOURCE_EXTENDED
15446 #endif
15447 #include <${cf_cv_ncurses_header:-curses.h}>
15448 int
15449 main ()
15450 {
15451 void *foo = &($name['k'])
15452   ;
15453   return 0;
15454 }
15455 _ACEOF
15456 rm -f conftest.$ac_objext conftest$ac_exeext
15457 if { (eval echo "$as_me:15457: \"$ac_link\"") >&5
15458   (eval $ac_link) 2>&5
15459   ac_status=$?
15460   echo "$as_me:15460: \$? = $ac_status" >&5
15461   (exit $ac_status); } &&
15462          { ac_try='test -s conftest$ac_exeext'
15463   { (eval echo "$as_me:15463: \"$ac_try\"") >&5
15464   (eval $ac_try) 2>&5
15465   ac_status=$?
15466   echo "$as_me:15466: \$? = $ac_status" >&5
15467   (exit $ac_status); }; }; then
15468   cf_cv_curses_wacs_map=$name
15469          break
15470 else
15471   echo "$as_me: failed program was:" >&5
15472 cat conftest.$ac_ext >&5
15473 fi
15474 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15475         done
15476 fi
15477 echo "$as_me:15477: result: $cf_cv_curses_wacs_map" >&5
15478 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15479
15480 test "$cf_cv_curses_wacs_map" != unknown &&
15481 cat >>confdefs.h <<EOF
15482 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15483 EOF
15484
15485 echo "$as_me:15485: checking for wide alternate character constants" >&5
15486 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15487 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15488   echo $ECHO_N "(cached) $ECHO_C" >&6
15489 else
15490
15491 cf_cv_curses_wacs_symbols=no
15492 if test "$cf_cv_curses_wacs_map" != unknown
15493 then
15494         cat >conftest.$ac_ext <<_ACEOF
15495 #line 15495 "configure"
15496 #include "confdefs.h"
15497
15498 #ifndef _XOPEN_SOURCE_EXTENDED
15499 #define _XOPEN_SOURCE_EXTENDED
15500 #endif
15501 #include <${cf_cv_ncurses_header:-curses.h}>
15502 int
15503 main ()
15504 {
15505 cchar_t *foo = WACS_PLUS;
15506          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15507   ;
15508   return 0;
15509 }
15510 _ACEOF
15511 rm -f conftest.$ac_objext conftest$ac_exeext
15512 if { (eval echo "$as_me:15512: \"$ac_link\"") >&5
15513   (eval $ac_link) 2>&5
15514   ac_status=$?
15515   echo "$as_me:15515: \$? = $ac_status" >&5
15516   (exit $ac_status); } &&
15517          { ac_try='test -s conftest$ac_exeext'
15518   { (eval echo "$as_me:15518: \"$ac_try\"") >&5
15519   (eval $ac_try) 2>&5
15520   ac_status=$?
15521   echo "$as_me:15521: \$? = $ac_status" >&5
15522   (exit $ac_status); }; }; then
15523   cf_cv_curses_wacs_symbols=yes
15524 else
15525   echo "$as_me: failed program was:" >&5
15526 cat conftest.$ac_ext >&5
15527 fi
15528 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15529 else
15530         cat >conftest.$ac_ext <<_ACEOF
15531 #line 15531 "configure"
15532 #include "confdefs.h"
15533
15534 #ifndef _XOPEN_SOURCE_EXTENDED
15535 #define _XOPEN_SOURCE_EXTENDED
15536 #endif
15537 #include <${cf_cv_ncurses_header:-curses.h}>
15538 int
15539 main ()
15540 {
15541 cchar_t *foo = WACS_PLUS
15542   ;
15543   return 0;
15544 }
15545 _ACEOF
15546 rm -f conftest.$ac_objext conftest$ac_exeext
15547 if { (eval echo "$as_me:15547: \"$ac_link\"") >&5
15548   (eval $ac_link) 2>&5
15549   ac_status=$?
15550   echo "$as_me:15550: \$? = $ac_status" >&5
15551   (exit $ac_status); } &&
15552          { ac_try='test -s conftest$ac_exeext'
15553   { (eval echo "$as_me:15553: \"$ac_try\"") >&5
15554   (eval $ac_try) 2>&5
15555   ac_status=$?
15556   echo "$as_me:15556: \$? = $ac_status" >&5
15557   (exit $ac_status); }; }; then
15558   cf_cv_curses_wacs_symbols=yes
15559 else
15560   echo "$as_me: failed program was:" >&5
15561 cat conftest.$ac_ext >&5
15562 fi
15563 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15564 fi
15565
15566 fi
15567 echo "$as_me:15567: result: $cf_cv_curses_wacs_symbols" >&5
15568 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15569
15570 test "$cf_cv_curses_wacs_symbols" != no &&
15571 cat >>confdefs.h <<\EOF
15572 #define CURSES_WACS_SYMBOLS 1
15573 EOF
15574
15575 fi
15576
15577 echo "$as_me:15577: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15578 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15579 cat >conftest.$ac_ext <<_ACEOF
15580 #line 15580 "configure"
15581 #include "confdefs.h"
15582
15583 #ifndef _XOPEN_SOURCE_EXTENDED
15584 #define _XOPEN_SOURCE_EXTENDED
15585 #endif
15586 #include <${cf_cv_ncurses_header:-curses.h}>
15587 int
15588 main ()
15589 {
15590
15591 attr_t foo
15592
15593   ;
15594   return 0;
15595 }
15596 _ACEOF
15597 rm -f conftest.$ac_objext
15598 if { (eval echo "$as_me:15598: \"$ac_compile\"") >&5
15599   (eval $ac_compile) 2>&5
15600   ac_status=$?
15601   echo "$as_me:15601: \$? = $ac_status" >&5
15602   (exit $ac_status); } &&
15603          { ac_try='test -s conftest.$ac_objext'
15604   { (eval echo "$as_me:15604: \"$ac_try\"") >&5
15605   (eval $ac_try) 2>&5
15606   ac_status=$?
15607   echo "$as_me:15607: \$? = $ac_status" >&5
15608   (exit $ac_status); }; }; then
15609   cf_result=yes
15610 else
15611   echo "$as_me: failed program was:" >&5
15612 cat conftest.$ac_ext >&5
15613 cf_result=no
15614 fi
15615 rm -f conftest.$ac_objext conftest.$ac_ext
15616 echo "$as_me:15616: result: $cf_result" >&5
15617 echo "${ECHO_T}$cf_result" >&6
15618 if test $cf_result = yes ; then
15619
15620 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15621
15622 cat >>confdefs.h <<EOF
15623 #define $cf_result 1
15624 EOF
15625
15626 else
15627
15628 cat >>confdefs.h <<EOF
15629 #define attr_t long
15630 EOF
15631
15632 fi
15633
15634 if test "$cf_enable_widec" = yes; then
15635
15636 # This is needed on Tru64 5.0 to declare mbstate_t
15637 echo "$as_me:15637: checking if we must include wchar.h to declare mbstate_t" >&5
15638 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15639 if test "${cf_cv_mbstate_t+set}" = set; then
15640   echo $ECHO_N "(cached) $ECHO_C" >&6
15641 else
15642
15643 cat >conftest.$ac_ext <<_ACEOF
15644 #line 15644 "configure"
15645 #include "confdefs.h"
15646
15647 #include <stdlib.h>
15648 #include <stdarg.h>
15649 #include <stdio.h>
15650 #ifdef HAVE_LIBUTF8_H
15651 #include <libutf8.h>
15652 #endif
15653 int
15654 main ()
15655 {
15656 mbstate_t state
15657   ;
15658   return 0;
15659 }
15660 _ACEOF
15661 rm -f conftest.$ac_objext
15662 if { (eval echo "$as_me:15662: \"$ac_compile\"") >&5
15663   (eval $ac_compile) 2>&5
15664   ac_status=$?
15665   echo "$as_me:15665: \$? = $ac_status" >&5
15666   (exit $ac_status); } &&
15667          { ac_try='test -s conftest.$ac_objext'
15668   { (eval echo "$as_me:15668: \"$ac_try\"") >&5
15669   (eval $ac_try) 2>&5
15670   ac_status=$?
15671   echo "$as_me:15671: \$? = $ac_status" >&5
15672   (exit $ac_status); }; }; then
15673   cf_cv_mbstate_t=no
15674 else
15675   echo "$as_me: failed program was:" >&5
15676 cat conftest.$ac_ext >&5
15677 cat >conftest.$ac_ext <<_ACEOF
15678 #line 15678 "configure"
15679 #include "confdefs.h"
15680
15681 #include <stdlib.h>
15682 #include <stdarg.h>
15683 #include <stdio.h>
15684 #include <wchar.h>
15685 #ifdef HAVE_LIBUTF8_H
15686 #include <libutf8.h>
15687 #endif
15688 int
15689 main ()
15690 {
15691 mbstate_t value
15692   ;
15693   return 0;
15694 }
15695 _ACEOF
15696 rm -f conftest.$ac_objext
15697 if { (eval echo "$as_me:15697: \"$ac_compile\"") >&5
15698   (eval $ac_compile) 2>&5
15699   ac_status=$?
15700   echo "$as_me:15700: \$? = $ac_status" >&5
15701   (exit $ac_status); } &&
15702          { ac_try='test -s conftest.$ac_objext'
15703   { (eval echo "$as_me:15703: \"$ac_try\"") >&5
15704   (eval $ac_try) 2>&5
15705   ac_status=$?
15706   echo "$as_me:15706: \$? = $ac_status" >&5
15707   (exit $ac_status); }; }; then
15708   cf_cv_mbstate_t=yes
15709 else
15710   echo "$as_me: failed program was:" >&5
15711 cat conftest.$ac_ext >&5
15712 cf_cv_mbstate_t=unknown
15713 fi
15714 rm -f conftest.$ac_objext conftest.$ac_ext
15715 fi
15716 rm -f conftest.$ac_objext conftest.$ac_ext
15717 fi
15718 echo "$as_me:15718: result: $cf_cv_mbstate_t" >&5
15719 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15720
15721 if test "$cf_cv_mbstate_t" = yes ; then
15722
15723 cat >>confdefs.h <<\EOF
15724 #define NEED_WCHAR_H 1
15725 EOF
15726
15727         NEED_WCHAR_H=1
15728 fi
15729
15730 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15731 if test "$cf_cv_mbstate_t" = unknown ; then
15732         NCURSES_MBSTATE_T=1
15733 fi
15734
15735 # if we find mbstate_t in either place, use substitution to provide a fallback.
15736 if test "$cf_cv_mbstate_t" != unknown ; then
15737         NCURSES_OK_MBSTATE_T=1
15738 fi
15739
15740 # This is needed on Tru64 5.0 to declare wchar_t
15741 echo "$as_me:15741: checking if we must include wchar.h to declare wchar_t" >&5
15742 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15743 if test "${cf_cv_wchar_t+set}" = set; then
15744   echo $ECHO_N "(cached) $ECHO_C" >&6
15745 else
15746
15747 cat >conftest.$ac_ext <<_ACEOF
15748 #line 15748 "configure"
15749 #include "confdefs.h"
15750
15751 #include <stdlib.h>
15752 #include <stdarg.h>
15753 #include <stdio.h>
15754 #ifdef HAVE_LIBUTF8_H
15755 #include <libutf8.h>
15756 #endif
15757 int
15758 main ()
15759 {
15760 wchar_t state
15761   ;
15762   return 0;
15763 }
15764 _ACEOF
15765 rm -f conftest.$ac_objext
15766 if { (eval echo "$as_me:15766: \"$ac_compile\"") >&5
15767   (eval $ac_compile) 2>&5
15768   ac_status=$?
15769   echo "$as_me:15769: \$? = $ac_status" >&5
15770   (exit $ac_status); } &&
15771          { ac_try='test -s conftest.$ac_objext'
15772   { (eval echo "$as_me:15772: \"$ac_try\"") >&5
15773   (eval $ac_try) 2>&5
15774   ac_status=$?
15775   echo "$as_me:15775: \$? = $ac_status" >&5
15776   (exit $ac_status); }; }; then
15777   cf_cv_wchar_t=no
15778 else
15779   echo "$as_me: failed program was:" >&5
15780 cat conftest.$ac_ext >&5
15781 cat >conftest.$ac_ext <<_ACEOF
15782 #line 15782 "configure"
15783 #include "confdefs.h"
15784
15785 #include <stdlib.h>
15786 #include <stdarg.h>
15787 #include <stdio.h>
15788 #include <wchar.h>
15789 #ifdef HAVE_LIBUTF8_H
15790 #include <libutf8.h>
15791 #endif
15792 int
15793 main ()
15794 {
15795 wchar_t value
15796   ;
15797   return 0;
15798 }
15799 _ACEOF
15800 rm -f conftest.$ac_objext
15801 if { (eval echo "$as_me:15801: \"$ac_compile\"") >&5
15802   (eval $ac_compile) 2>&5
15803   ac_status=$?
15804   echo "$as_me:15804: \$? = $ac_status" >&5
15805   (exit $ac_status); } &&
15806          { ac_try='test -s conftest.$ac_objext'
15807   { (eval echo "$as_me:15807: \"$ac_try\"") >&5
15808   (eval $ac_try) 2>&5
15809   ac_status=$?
15810   echo "$as_me:15810: \$? = $ac_status" >&5
15811   (exit $ac_status); }; }; then
15812   cf_cv_wchar_t=yes
15813 else
15814   echo "$as_me: failed program was:" >&5
15815 cat conftest.$ac_ext >&5
15816 cf_cv_wchar_t=unknown
15817 fi
15818 rm -f conftest.$ac_objext conftest.$ac_ext
15819 fi
15820 rm -f conftest.$ac_objext conftest.$ac_ext
15821 fi
15822 echo "$as_me:15822: result: $cf_cv_wchar_t" >&5
15823 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15824
15825 if test "$cf_cv_wchar_t" = yes ; then
15826
15827 cat >>confdefs.h <<\EOF
15828 #define NEED_WCHAR_H 1
15829 EOF
15830
15831         NEED_WCHAR_H=1
15832 fi
15833
15834 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15835 if test "$cf_cv_wchar_t" = unknown ; then
15836         NCURSES_WCHAR_T=1
15837 fi
15838
15839 # if we find wchar_t in either place, use substitution to provide a fallback.
15840 if test "$cf_cv_wchar_t" != unknown ; then
15841         NCURSES_OK_WCHAR_T=1
15842 fi
15843
15844 # This is needed on Tru64 5.0 to declare wint_t
15845 echo "$as_me:15845: checking if we must include wchar.h to declare wint_t" >&5
15846 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15847 if test "${cf_cv_wint_t+set}" = set; then
15848   echo $ECHO_N "(cached) $ECHO_C" >&6
15849 else
15850
15851 cat >conftest.$ac_ext <<_ACEOF
15852 #line 15852 "configure"
15853 #include "confdefs.h"
15854
15855 #include <stdlib.h>
15856 #include <stdarg.h>
15857 #include <stdio.h>
15858 #ifdef HAVE_LIBUTF8_H
15859 #include <libutf8.h>
15860 #endif
15861 int
15862 main ()
15863 {
15864 wint_t state
15865   ;
15866   return 0;
15867 }
15868 _ACEOF
15869 rm -f conftest.$ac_objext
15870 if { (eval echo "$as_me:15870: \"$ac_compile\"") >&5
15871   (eval $ac_compile) 2>&5
15872   ac_status=$?
15873   echo "$as_me:15873: \$? = $ac_status" >&5
15874   (exit $ac_status); } &&
15875          { ac_try='test -s conftest.$ac_objext'
15876   { (eval echo "$as_me:15876: \"$ac_try\"") >&5
15877   (eval $ac_try) 2>&5
15878   ac_status=$?
15879   echo "$as_me:15879: \$? = $ac_status" >&5
15880   (exit $ac_status); }; }; then
15881   cf_cv_wint_t=no
15882 else
15883   echo "$as_me: failed program was:" >&5
15884 cat conftest.$ac_ext >&5
15885 cat >conftest.$ac_ext <<_ACEOF
15886 #line 15886 "configure"
15887 #include "confdefs.h"
15888
15889 #include <stdlib.h>
15890 #include <stdarg.h>
15891 #include <stdio.h>
15892 #include <wchar.h>
15893 #ifdef HAVE_LIBUTF8_H
15894 #include <libutf8.h>
15895 #endif
15896 int
15897 main ()
15898 {
15899 wint_t value
15900   ;
15901   return 0;
15902 }
15903 _ACEOF
15904 rm -f conftest.$ac_objext
15905 if { (eval echo "$as_me:15905: \"$ac_compile\"") >&5
15906   (eval $ac_compile) 2>&5
15907   ac_status=$?
15908   echo "$as_me:15908: \$? = $ac_status" >&5
15909   (exit $ac_status); } &&
15910          { ac_try='test -s conftest.$ac_objext'
15911   { (eval echo "$as_me:15911: \"$ac_try\"") >&5
15912   (eval $ac_try) 2>&5
15913   ac_status=$?
15914   echo "$as_me:15914: \$? = $ac_status" >&5
15915   (exit $ac_status); }; }; then
15916   cf_cv_wint_t=yes
15917 else
15918   echo "$as_me: failed program was:" >&5
15919 cat conftest.$ac_ext >&5
15920 cf_cv_wint_t=unknown
15921 fi
15922 rm -f conftest.$ac_objext conftest.$ac_ext
15923 fi
15924 rm -f conftest.$ac_objext conftest.$ac_ext
15925 fi
15926 echo "$as_me:15926: result: $cf_cv_wint_t" >&5
15927 echo "${ECHO_T}$cf_cv_wint_t" >&6
15928
15929 if test "$cf_cv_wint_t" = yes ; then
15930
15931 cat >>confdefs.h <<\EOF
15932 #define NEED_WCHAR_H 1
15933 EOF
15934
15935         NEED_WCHAR_H=1
15936 fi
15937
15938 # if we do not find wint_t in either place, use substitution to provide a fallback.
15939 if test "$cf_cv_wint_t" = unknown ; then
15940         NCURSES_WINT_T=1
15941 fi
15942
15943 # if we find wint_t in either place, use substitution to provide a fallback.
15944 if test "$cf_cv_wint_t" != unknown ; then
15945         NCURSES_OK_WINT_T=1
15946 fi
15947
15948         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15949
15950 echo "$as_me:15950: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15951 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15952 cat >conftest.$ac_ext <<_ACEOF
15953 #line 15953 "configure"
15954 #include "confdefs.h"
15955
15956 #ifndef _XOPEN_SOURCE_EXTENDED
15957 #define _XOPEN_SOURCE_EXTENDED
15958 #endif
15959 #include <${cf_cv_ncurses_header:-curses.h}>
15960 int
15961 main ()
15962 {
15963
15964 mbstate_t foo
15965
15966   ;
15967   return 0;
15968 }
15969 _ACEOF
15970 rm -f conftest.$ac_objext
15971 if { (eval echo "$as_me:15971: \"$ac_compile\"") >&5
15972   (eval $ac_compile) 2>&5
15973   ac_status=$?
15974   echo "$as_me:15974: \$? = $ac_status" >&5
15975   (exit $ac_status); } &&
15976          { ac_try='test -s conftest.$ac_objext'
15977   { (eval echo "$as_me:15977: \"$ac_try\"") >&5
15978   (eval $ac_try) 2>&5
15979   ac_status=$?
15980   echo "$as_me:15980: \$? = $ac_status" >&5
15981   (exit $ac_status); }; }; then
15982   cf_result=yes
15983 else
15984   echo "$as_me: failed program was:" >&5
15985 cat conftest.$ac_ext >&5
15986 cf_result=no
15987 fi
15988 rm -f conftest.$ac_objext conftest.$ac_ext
15989 echo "$as_me:15989: result: $cf_result" >&5
15990 echo "${ECHO_T}$cf_result" >&6
15991 if test $cf_result = yes ; then
15992
15993 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15994
15995 cat >>confdefs.h <<EOF
15996 #define $cf_result 1
15997 EOF
15998
15999 else
16000
16001 cat >>confdefs.h <<EOF
16002 #define mbstate_t long
16003 EOF
16004
16005 fi
16006
16007         fi
16008
16009         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16010
16011 echo "$as_me:16011: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16012 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16013 cat >conftest.$ac_ext <<_ACEOF
16014 #line 16014 "configure"
16015 #include "confdefs.h"
16016
16017 #ifndef _XOPEN_SOURCE_EXTENDED
16018 #define _XOPEN_SOURCE_EXTENDED
16019 #endif
16020 #include <${cf_cv_ncurses_header:-curses.h}>
16021 int
16022 main ()
16023 {
16024
16025 wchar_t foo
16026
16027   ;
16028   return 0;
16029 }
16030 _ACEOF
16031 rm -f conftest.$ac_objext
16032 if { (eval echo "$as_me:16032: \"$ac_compile\"") >&5
16033   (eval $ac_compile) 2>&5
16034   ac_status=$?
16035   echo "$as_me:16035: \$? = $ac_status" >&5
16036   (exit $ac_status); } &&
16037          { ac_try='test -s conftest.$ac_objext'
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_result=yes
16044 else
16045   echo "$as_me: failed program was:" >&5
16046 cat conftest.$ac_ext >&5
16047 cf_result=no
16048 fi
16049 rm -f conftest.$ac_objext conftest.$ac_ext
16050 echo "$as_me:16050: result: $cf_result" >&5
16051 echo "${ECHO_T}$cf_result" >&6
16052 if test $cf_result = yes ; then
16053
16054 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16055
16056 cat >>confdefs.h <<EOF
16057 #define $cf_result 1
16058 EOF
16059
16060 else
16061
16062 cat >>confdefs.h <<EOF
16063 #define wchar_t long
16064 EOF
16065
16066 fi
16067
16068         fi
16069
16070         if test "$NCURSES_OK_WINT_T" = 0 ; then
16071
16072 echo "$as_me:16072: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16073 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16074 cat >conftest.$ac_ext <<_ACEOF
16075 #line 16075 "configure"
16076 #include "confdefs.h"
16077
16078 #ifndef _XOPEN_SOURCE_EXTENDED
16079 #define _XOPEN_SOURCE_EXTENDED
16080 #endif
16081 #include <${cf_cv_ncurses_header:-curses.h}>
16082 int
16083 main ()
16084 {
16085
16086 wint_t foo
16087
16088   ;
16089   return 0;
16090 }
16091 _ACEOF
16092 rm -f conftest.$ac_objext
16093 if { (eval echo "$as_me:16093: \"$ac_compile\"") >&5
16094   (eval $ac_compile) 2>&5
16095   ac_status=$?
16096   echo "$as_me:16096: \$? = $ac_status" >&5
16097   (exit $ac_status); } &&
16098          { ac_try='test -s conftest.$ac_objext'
16099   { (eval echo "$as_me:16099: \"$ac_try\"") >&5
16100   (eval $ac_try) 2>&5
16101   ac_status=$?
16102   echo "$as_me:16102: \$? = $ac_status" >&5
16103   (exit $ac_status); }; }; then
16104   cf_result=yes
16105 else
16106   echo "$as_me: failed program was:" >&5
16107 cat conftest.$ac_ext >&5
16108 cf_result=no
16109 fi
16110 rm -f conftest.$ac_objext conftest.$ac_ext
16111 echo "$as_me:16111: result: $cf_result" >&5
16112 echo "${ECHO_T}$cf_result" >&6
16113 if test $cf_result = yes ; then
16114
16115 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16116
16117 cat >>confdefs.h <<EOF
16118 #define $cf_result 1
16119 EOF
16120
16121 else
16122
16123 cat >>confdefs.h <<EOF
16124 #define wint_t long
16125 EOF
16126
16127 fi
16128
16129         fi
16130 fi
16131
16132 echo "$as_me:16132: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16133 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16134
16135 cat >conftest.$ac_ext <<_ACEOF
16136 #line 16136 "configure"
16137 #include "confdefs.h"
16138
16139 #ifdef HAVE_XCURSES
16140 #include <xcurses.h>
16141 char * XCursesProgramName = "test";
16142 #else
16143 #include <${cf_cv_ncurses_header:-curses.h}>
16144 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16145 #include <ncursesw/term.h>
16146 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16147 #include <ncurses/term.h>
16148 #elif defined(HAVE_TERM_H)
16149 #include <term.h>
16150 #endif
16151 #endif
16152
16153 int
16154 main ()
16155 {
16156
16157 void *foo = &(ospeed)
16158
16159   ;
16160   return 0;
16161 }
16162 _ACEOF
16163 rm -f conftest.$ac_objext
16164 if { (eval echo "$as_me:16164: \"$ac_compile\"") >&5
16165   (eval $ac_compile) 2>&5
16166   ac_status=$?
16167   echo "$as_me:16167: \$? = $ac_status" >&5
16168   (exit $ac_status); } &&
16169          { ac_try='test -s conftest.$ac_objext'
16170   { (eval echo "$as_me:16170: \"$ac_try\"") >&5
16171   (eval $ac_try) 2>&5
16172   ac_status=$?
16173   echo "$as_me:16173: \$? = $ac_status" >&5
16174   (exit $ac_status); }; }; then
16175   cf_result=yes
16176 else
16177   echo "$as_me: failed program was:" >&5
16178 cat conftest.$ac_ext >&5
16179 cf_result=no
16180 fi
16181 rm -f conftest.$ac_objext conftest.$ac_ext
16182 echo "$as_me:16182: result: $cf_result" >&5
16183 echo "${ECHO_T}$cf_result" >&6
16184
16185 if test $cf_result = yes ; then
16186
16187 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16188
16189         cat >>confdefs.h <<EOF
16190 #define $cf_result 1
16191 EOF
16192
16193 else
16194         echo "$as_me:16194: checking for data ospeed in library" >&5
16195 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
16196         # BSD linkers insist on making weak linkage, but resolve at runtime.
16197         if test "$cross_compiling" = yes; then
16198
16199         # cross-compiling
16200         cat >conftest.$ac_ext <<_ACEOF
16201 #line 16201 "configure"
16202 #include "confdefs.h"
16203
16204 #ifdef HAVE_XCURSES
16205 #include <xcurses.h>
16206 char * XCursesProgramName = "test";
16207 #else
16208 #include <${cf_cv_ncurses_header:-curses.h}>
16209 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16210 #include <ncursesw/term.h>
16211 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16212 #include <ncurses/term.h>
16213 #elif defined(HAVE_TERM_H)
16214 #include <term.h>
16215 #endif
16216 #endif
16217
16218 extern char ospeed;
16219 int
16220 main ()
16221 {
16222
16223         do {
16224                 void *foo = &(ospeed);
16225                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16226                 ${cf_cv_main_return:-return}(foo == 0);
16227         } while (0)
16228
16229   ;
16230   return 0;
16231 }
16232 _ACEOF
16233 rm -f conftest.$ac_objext conftest$ac_exeext
16234 if { (eval echo "$as_me:16234: \"$ac_link\"") >&5
16235   (eval $ac_link) 2>&5
16236   ac_status=$?
16237   echo "$as_me:16237: \$? = $ac_status" >&5
16238   (exit $ac_status); } &&
16239          { ac_try='test -s conftest$ac_exeext'
16240   { (eval echo "$as_me:16240: \"$ac_try\"") >&5
16241   (eval $ac_try) 2>&5
16242   ac_status=$?
16243   echo "$as_me:16243: \$? = $ac_status" >&5
16244   (exit $ac_status); }; }; then
16245   cf_result=yes
16246 else
16247   echo "$as_me: failed program was:" >&5
16248 cat conftest.$ac_ext >&5
16249 cf_result=no
16250 fi
16251 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16252
16253 else
16254   cat >conftest.$ac_ext <<_ACEOF
16255 #line 16255 "configure"
16256 #include "confdefs.h"
16257
16258 #ifdef HAVE_XCURSES
16259 #include <xcurses.h>
16260 char * XCursesProgramName = "test";
16261 #else
16262 #include <${cf_cv_ncurses_header:-curses.h}>
16263 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16264 #include <ncursesw/term.h>
16265 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16266 #include <ncurses/term.h>
16267 #elif defined(HAVE_TERM_H)
16268 #include <term.h>
16269 #endif
16270 #endif
16271
16272 extern char ospeed;
16273 int main(void)
16274 {
16275         void *foo = &(ospeed);
16276         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16277         ${cf_cv_main_return:-return}(foo == 0);
16278 }
16279 _ACEOF
16280 rm -f conftest$ac_exeext
16281 if { (eval echo "$as_me:16281: \"$ac_link\"") >&5
16282   (eval $ac_link) 2>&5
16283   ac_status=$?
16284   echo "$as_me:16284: \$? = $ac_status" >&5
16285   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16286   { (eval echo "$as_me:16286: \"$ac_try\"") >&5
16287   (eval $ac_try) 2>&5
16288   ac_status=$?
16289   echo "$as_me:16289: \$? = $ac_status" >&5
16290   (exit $ac_status); }; }; then
16291   cf_result=yes
16292 else
16293   echo "$as_me: program exited with status $ac_status" >&5
16294 echo "$as_me: failed program was:" >&5
16295 cat conftest.$ac_ext >&5
16296 cf_result=no
16297 fi
16298 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16299 fi
16300         echo "$as_me:16300: result: $cf_result" >&5
16301 echo "${ECHO_T}$cf_result" >&6
16302         if test $cf_result = yes ; then
16303
16304 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16305
16306                 cat >>confdefs.h <<EOF
16307 #define $cf_result 1
16308 EOF
16309
16310         fi
16311 fi
16312
16313 echo "$as_me:16313: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16314 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16315
16316 cat >conftest.$ac_ext <<_ACEOF
16317 #line 16317 "configure"
16318 #include "confdefs.h"
16319
16320 #ifdef HAVE_XCURSES
16321 #include <xcurses.h>
16322 char * XCursesProgramName = "test";
16323 #else
16324 #include <${cf_cv_ncurses_header:-curses.h}>
16325 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16326 #include <ncursesw/term.h>
16327 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16328 #include <ncurses/term.h>
16329 #elif defined(HAVE_TERM_H)
16330 #include <term.h>
16331 #endif
16332 #endif
16333
16334 int
16335 main ()
16336 {
16337
16338 void *foo = &(boolnames)
16339
16340   ;
16341   return 0;
16342 }
16343 _ACEOF
16344 rm -f conftest.$ac_objext
16345 if { (eval echo "$as_me:16345: \"$ac_compile\"") >&5
16346   (eval $ac_compile) 2>&5
16347   ac_status=$?
16348   echo "$as_me:16348: \$? = $ac_status" >&5
16349   (exit $ac_status); } &&
16350          { ac_try='test -s conftest.$ac_objext'
16351   { (eval echo "$as_me:16351: \"$ac_try\"") >&5
16352   (eval $ac_try) 2>&5
16353   ac_status=$?
16354   echo "$as_me:16354: \$? = $ac_status" >&5
16355   (exit $ac_status); }; }; then
16356   cf_result=yes
16357 else
16358   echo "$as_me: failed program was:" >&5
16359 cat conftest.$ac_ext >&5
16360 cf_result=no
16361 fi
16362 rm -f conftest.$ac_objext conftest.$ac_ext
16363 echo "$as_me:16363: result: $cf_result" >&5
16364 echo "${ECHO_T}$cf_result" >&6
16365
16366 if test $cf_result = yes ; then
16367
16368 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16369
16370         cat >>confdefs.h <<EOF
16371 #define $cf_result 1
16372 EOF
16373
16374 else
16375         echo "$as_me:16375: checking for data boolnames in library" >&5
16376 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16377         # BSD linkers insist on making weak linkage, but resolve at runtime.
16378         if test "$cross_compiling" = yes; then
16379
16380         # cross-compiling
16381         cat >conftest.$ac_ext <<_ACEOF
16382 #line 16382 "configure"
16383 #include "confdefs.h"
16384
16385 #ifdef HAVE_XCURSES
16386 #include <xcurses.h>
16387 char * XCursesProgramName = "test";
16388 #else
16389 #include <${cf_cv_ncurses_header:-curses.h}>
16390 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16391 #include <ncursesw/term.h>
16392 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16393 #include <ncurses/term.h>
16394 #elif defined(HAVE_TERM_H)
16395 #include <term.h>
16396 #endif
16397 #endif
16398
16399 extern char boolnames;
16400 int
16401 main ()
16402 {
16403
16404         do {
16405                 void *foo = &(boolnames);
16406                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16407                 ${cf_cv_main_return:-return}(foo == 0);
16408         } while (0)
16409
16410   ;
16411   return 0;
16412 }
16413 _ACEOF
16414 rm -f conftest.$ac_objext conftest$ac_exeext
16415 if { (eval echo "$as_me:16415: \"$ac_link\"") >&5
16416   (eval $ac_link) 2>&5
16417   ac_status=$?
16418   echo "$as_me:16418: \$? = $ac_status" >&5
16419   (exit $ac_status); } &&
16420          { ac_try='test -s conftest$ac_exeext'
16421   { (eval echo "$as_me:16421: \"$ac_try\"") >&5
16422   (eval $ac_try) 2>&5
16423   ac_status=$?
16424   echo "$as_me:16424: \$? = $ac_status" >&5
16425   (exit $ac_status); }; }; then
16426   cf_result=yes
16427 else
16428   echo "$as_me: failed program was:" >&5
16429 cat conftest.$ac_ext >&5
16430 cf_result=no
16431 fi
16432 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16433
16434 else
16435   cat >conftest.$ac_ext <<_ACEOF
16436 #line 16436 "configure"
16437 #include "confdefs.h"
16438
16439 #ifdef HAVE_XCURSES
16440 #include <xcurses.h>
16441 char * XCursesProgramName = "test";
16442 #else
16443 #include <${cf_cv_ncurses_header:-curses.h}>
16444 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16445 #include <ncursesw/term.h>
16446 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16447 #include <ncurses/term.h>
16448 #elif defined(HAVE_TERM_H)
16449 #include <term.h>
16450 #endif
16451 #endif
16452
16453 extern char boolnames;
16454 int main(void)
16455 {
16456         void *foo = &(boolnames);
16457         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16458         ${cf_cv_main_return:-return}(foo == 0);
16459 }
16460 _ACEOF
16461 rm -f conftest$ac_exeext
16462 if { (eval echo "$as_me:16462: \"$ac_link\"") >&5
16463   (eval $ac_link) 2>&5
16464   ac_status=$?
16465   echo "$as_me:16465: \$? = $ac_status" >&5
16466   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16467   { (eval echo "$as_me:16467: \"$ac_try\"") >&5
16468   (eval $ac_try) 2>&5
16469   ac_status=$?
16470   echo "$as_me:16470: \$? = $ac_status" >&5
16471   (exit $ac_status); }; }; then
16472   cf_result=yes
16473 else
16474   echo "$as_me: program exited with status $ac_status" >&5
16475 echo "$as_me: failed program was:" >&5
16476 cat conftest.$ac_ext >&5
16477 cf_result=no
16478 fi
16479 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16480 fi
16481         echo "$as_me:16481: result: $cf_result" >&5
16482 echo "${ECHO_T}$cf_result" >&6
16483         if test $cf_result = yes ; then
16484
16485 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16486
16487                 cat >>confdefs.h <<EOF
16488 #define $cf_result 1
16489 EOF
16490
16491         fi
16492 fi
16493
16494 echo "$as_me:16494: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16495 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16496
16497 cat >conftest.$ac_ext <<_ACEOF
16498 #line 16498 "configure"
16499 #include "confdefs.h"
16500
16501 #ifdef HAVE_XCURSES
16502 #include <xcurses.h>
16503 char * XCursesProgramName = "test";
16504 #else
16505 #include <${cf_cv_ncurses_header:-curses.h}>
16506 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16507 #include <ncursesw/term.h>
16508 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16509 #include <ncurses/term.h>
16510 #elif defined(HAVE_TERM_H)
16511 #include <term.h>
16512 #endif
16513 #endif
16514
16515 int
16516 main ()
16517 {
16518
16519 void *foo = &(boolfnames)
16520
16521   ;
16522   return 0;
16523 }
16524 _ACEOF
16525 rm -f conftest.$ac_objext
16526 if { (eval echo "$as_me:16526: \"$ac_compile\"") >&5
16527   (eval $ac_compile) 2>&5
16528   ac_status=$?
16529   echo "$as_me:16529: \$? = $ac_status" >&5
16530   (exit $ac_status); } &&
16531          { ac_try='test -s conftest.$ac_objext'
16532   { (eval echo "$as_me:16532: \"$ac_try\"") >&5
16533   (eval $ac_try) 2>&5
16534   ac_status=$?
16535   echo "$as_me:16535: \$? = $ac_status" >&5
16536   (exit $ac_status); }; }; then
16537   cf_result=yes
16538 else
16539   echo "$as_me: failed program was:" >&5
16540 cat conftest.$ac_ext >&5
16541 cf_result=no
16542 fi
16543 rm -f conftest.$ac_objext conftest.$ac_ext
16544 echo "$as_me:16544: result: $cf_result" >&5
16545 echo "${ECHO_T}$cf_result" >&6
16546
16547 if test $cf_result = yes ; then
16548
16549 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16550
16551         cat >>confdefs.h <<EOF
16552 #define $cf_result 1
16553 EOF
16554
16555 else
16556         echo "$as_me:16556: checking for data boolfnames in library" >&5
16557 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16558         # BSD linkers insist on making weak linkage, but resolve at runtime.
16559         if test "$cross_compiling" = yes; then
16560
16561         # cross-compiling
16562         cat >conftest.$ac_ext <<_ACEOF
16563 #line 16563 "configure"
16564 #include "confdefs.h"
16565
16566 #ifdef HAVE_XCURSES
16567 #include <xcurses.h>
16568 char * XCursesProgramName = "test";
16569 #else
16570 #include <${cf_cv_ncurses_header:-curses.h}>
16571 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16572 #include <ncursesw/term.h>
16573 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16574 #include <ncurses/term.h>
16575 #elif defined(HAVE_TERM_H)
16576 #include <term.h>
16577 #endif
16578 #endif
16579
16580 extern char boolfnames;
16581 int
16582 main ()
16583 {
16584
16585         do {
16586                 void *foo = &(boolfnames);
16587                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16588                 ${cf_cv_main_return:-return}(foo == 0);
16589         } while (0)
16590
16591   ;
16592   return 0;
16593 }
16594 _ACEOF
16595 rm -f conftest.$ac_objext conftest$ac_exeext
16596 if { (eval echo "$as_me:16596: \"$ac_link\"") >&5
16597   (eval $ac_link) 2>&5
16598   ac_status=$?
16599   echo "$as_me:16599: \$? = $ac_status" >&5
16600   (exit $ac_status); } &&
16601          { ac_try='test -s conftest$ac_exeext'
16602   { (eval echo "$as_me:16602: \"$ac_try\"") >&5
16603   (eval $ac_try) 2>&5
16604   ac_status=$?
16605   echo "$as_me:16605: \$? = $ac_status" >&5
16606   (exit $ac_status); }; }; then
16607   cf_result=yes
16608 else
16609   echo "$as_me: failed program was:" >&5
16610 cat conftest.$ac_ext >&5
16611 cf_result=no
16612 fi
16613 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16614
16615 else
16616   cat >conftest.$ac_ext <<_ACEOF
16617 #line 16617 "configure"
16618 #include "confdefs.h"
16619
16620 #ifdef HAVE_XCURSES
16621 #include <xcurses.h>
16622 char * XCursesProgramName = "test";
16623 #else
16624 #include <${cf_cv_ncurses_header:-curses.h}>
16625 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16626 #include <ncursesw/term.h>
16627 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16628 #include <ncurses/term.h>
16629 #elif defined(HAVE_TERM_H)
16630 #include <term.h>
16631 #endif
16632 #endif
16633
16634 extern char boolfnames;
16635 int main(void)
16636 {
16637         void *foo = &(boolfnames);
16638         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16639         ${cf_cv_main_return:-return}(foo == 0);
16640 }
16641 _ACEOF
16642 rm -f conftest$ac_exeext
16643 if { (eval echo "$as_me:16643: \"$ac_link\"") >&5
16644   (eval $ac_link) 2>&5
16645   ac_status=$?
16646   echo "$as_me:16646: \$? = $ac_status" >&5
16647   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16648   { (eval echo "$as_me:16648: \"$ac_try\"") >&5
16649   (eval $ac_try) 2>&5
16650   ac_status=$?
16651   echo "$as_me:16651: \$? = $ac_status" >&5
16652   (exit $ac_status); }; }; then
16653   cf_result=yes
16654 else
16655   echo "$as_me: program exited with status $ac_status" >&5
16656 echo "$as_me: failed program was:" >&5
16657 cat conftest.$ac_ext >&5
16658 cf_result=no
16659 fi
16660 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16661 fi
16662         echo "$as_me:16662: result: $cf_result" >&5
16663 echo "${ECHO_T}$cf_result" >&6
16664         if test $cf_result = yes ; then
16665
16666 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16667
16668                 cat >>confdefs.h <<EOF
16669 #define $cf_result 1
16670 EOF
16671
16672         fi
16673 fi
16674
16675 echo "$as_me:16675: checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16676 echo $ECHO_N "checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16677
16678 cat >conftest.$ac_ext <<_ACEOF
16679 #line 16679 "configure"
16680 #include "confdefs.h"
16681
16682 #ifdef HAVE_XCURSES
16683 #include <xcurses.h>
16684 char * XCursesProgramName = "test";
16685 #else
16686 #include <${cf_cv_ncurses_header:-curses.h}>
16687 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16688 #include <ncursesw/term.h>
16689 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16690 #include <ncurses/term.h>
16691 #elif defined(HAVE_TERM_H)
16692 #include <term.h>
16693 #endif
16694 #endif
16695
16696 int
16697 main ()
16698 {
16699
16700 void *foo = &(ttytype)
16701
16702   ;
16703   return 0;
16704 }
16705 _ACEOF
16706 rm -f conftest.$ac_objext
16707 if { (eval echo "$as_me:16707: \"$ac_compile\"") >&5
16708   (eval $ac_compile) 2>&5
16709   ac_status=$?
16710   echo "$as_me:16710: \$? = $ac_status" >&5
16711   (exit $ac_status); } &&
16712          { ac_try='test -s conftest.$ac_objext'
16713   { (eval echo "$as_me:16713: \"$ac_try\"") >&5
16714   (eval $ac_try) 2>&5
16715   ac_status=$?
16716   echo "$as_me:16716: \$? = $ac_status" >&5
16717   (exit $ac_status); }; }; then
16718   cf_result=yes
16719 else
16720   echo "$as_me: failed program was:" >&5
16721 cat conftest.$ac_ext >&5
16722 cf_result=no
16723 fi
16724 rm -f conftest.$ac_objext conftest.$ac_ext
16725 echo "$as_me:16725: result: $cf_result" >&5
16726 echo "${ECHO_T}$cf_result" >&6
16727
16728 if test $cf_result = yes ; then
16729
16730 cf_result=`echo "have_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16731
16732         cat >>confdefs.h <<EOF
16733 #define $cf_result 1
16734 EOF
16735
16736 else
16737         echo "$as_me:16737: checking for data ttytype in library" >&5
16738 echo $ECHO_N "checking for data ttytype in library... $ECHO_C" >&6
16739         # BSD linkers insist on making weak linkage, but resolve at runtime.
16740         if test "$cross_compiling" = yes; then
16741
16742         # cross-compiling
16743         cat >conftest.$ac_ext <<_ACEOF
16744 #line 16744 "configure"
16745 #include "confdefs.h"
16746
16747 #ifdef HAVE_XCURSES
16748 #include <xcurses.h>
16749 char * XCursesProgramName = "test";
16750 #else
16751 #include <${cf_cv_ncurses_header:-curses.h}>
16752 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16753 #include <ncursesw/term.h>
16754 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16755 #include <ncurses/term.h>
16756 #elif defined(HAVE_TERM_H)
16757 #include <term.h>
16758 #endif
16759 #endif
16760
16761 extern char ttytype;
16762 int
16763 main ()
16764 {
16765
16766         do {
16767                 void *foo = &(ttytype);
16768                 fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
16769                 ${cf_cv_main_return:-return}(foo == 0);
16770         } while (0)
16771
16772   ;
16773   return 0;
16774 }
16775 _ACEOF
16776 rm -f conftest.$ac_objext conftest$ac_exeext
16777 if { (eval echo "$as_me:16777: \"$ac_link\"") >&5
16778   (eval $ac_link) 2>&5
16779   ac_status=$?
16780   echo "$as_me:16780: \$? = $ac_status" >&5
16781   (exit $ac_status); } &&
16782          { ac_try='test -s conftest$ac_exeext'
16783   { (eval echo "$as_me:16783: \"$ac_try\"") >&5
16784   (eval $ac_try) 2>&5
16785   ac_status=$?
16786   echo "$as_me:16786: \$? = $ac_status" >&5
16787   (exit $ac_status); }; }; then
16788   cf_result=yes
16789 else
16790   echo "$as_me: failed program was:" >&5
16791 cat conftest.$ac_ext >&5
16792 cf_result=no
16793 fi
16794 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16795
16796 else
16797   cat >conftest.$ac_ext <<_ACEOF
16798 #line 16798 "configure"
16799 #include "confdefs.h"
16800
16801 #ifdef HAVE_XCURSES
16802 #include <xcurses.h>
16803 char * XCursesProgramName = "test";
16804 #else
16805 #include <${cf_cv_ncurses_header:-curses.h}>
16806 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16807 #include <ncursesw/term.h>
16808 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16809 #include <ncurses/term.h>
16810 #elif defined(HAVE_TERM_H)
16811 #include <term.h>
16812 #endif
16813 #endif
16814
16815 extern char ttytype;
16816 int main(void)
16817 {
16818         void *foo = &(ttytype);
16819         fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
16820         ${cf_cv_main_return:-return}(foo == 0);
16821 }
16822 _ACEOF
16823 rm -f conftest$ac_exeext
16824 if { (eval echo "$as_me:16824: \"$ac_link\"") >&5
16825   (eval $ac_link) 2>&5
16826   ac_status=$?
16827   echo "$as_me:16827: \$? = $ac_status" >&5
16828   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16829   { (eval echo "$as_me:16829: \"$ac_try\"") >&5
16830   (eval $ac_try) 2>&5
16831   ac_status=$?
16832   echo "$as_me:16832: \$? = $ac_status" >&5
16833   (exit $ac_status); }; }; then
16834   cf_result=yes
16835 else
16836   echo "$as_me: program exited with status $ac_status" >&5
16837 echo "$as_me: failed program was:" >&5
16838 cat conftest.$ac_ext >&5
16839 cf_result=no
16840 fi
16841 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16842 fi
16843         echo "$as_me:16843: result: $cf_result" >&5
16844 echo "${ECHO_T}$cf_result" >&6
16845         if test $cf_result = yes ; then
16846
16847 cf_result=`echo "decl_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16848
16849                 cat >>confdefs.h <<EOF
16850 #define $cf_result 1
16851 EOF
16852
16853         fi
16854 fi
16855
16856 if ( test "$GCC" = yes || test "$GXX" = yes )
16857 then
16858 echo "$as_me:16858: checking if you want to turn on gcc warnings" >&5
16859 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16860
16861 # Check whether --enable-warnings or --disable-warnings was given.
16862 if test "${enable_warnings+set}" = set; then
16863   enableval="$enable_warnings"
16864   test "$enableval" != yes && enableval=no
16865         if test "$enableval" != "no" ; then
16866     with_warnings=yes
16867         else
16868                 with_warnings=no
16869         fi
16870 else
16871   enableval=no
16872         with_warnings=no
16873
16874 fi;
16875 echo "$as_me:16875: result: $with_warnings" >&5
16876 echo "${ECHO_T}$with_warnings" >&6
16877 if test "$with_warnings" = "yes"
16878 then
16879
16880 if test "$GCC" = yes
16881 then
16882 cat > conftest.i <<EOF
16883 #ifndef GCC_PRINTF
16884 #define GCC_PRINTF 0
16885 #endif
16886 #ifndef GCC_SCANF
16887 #define GCC_SCANF 0
16888 #endif
16889 #ifndef GCC_NORETURN
16890 #define GCC_NORETURN /* nothing */
16891 #endif
16892 #ifndef GCC_UNUSED
16893 #define GCC_UNUSED /* nothing */
16894 #endif
16895 EOF
16896 if test "$GCC" = yes
16897 then
16898         { echo "$as_me:16898: checking for $CC __attribute__ directives..." >&5
16899 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16900 cat > conftest.$ac_ext <<EOF
16901 #line 16901 "${as_me:-configure}"
16902 #include "confdefs.h"
16903 #include "conftest.h"
16904 #include "conftest.i"
16905 #if     GCC_PRINTF
16906 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16907 #else
16908 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16909 #endif
16910 #if     GCC_SCANF
16911 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16912 #else
16913 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16914 #endif
16915 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16916 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16917 extern void foo(void) GCC_NORETURN;
16918 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16919 EOF
16920         cf_printf_attribute=no
16921         cf_scanf_attribute=no
16922         for cf_attribute in scanf printf unused noreturn
16923         do
16924
16925 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16926
16927                 cf_directive="__attribute__(($cf_attribute))"
16928                 echo "checking for $CC $cf_directive" 1>&5
16929
16930                 case $cf_attribute in
16931                 (printf)
16932                         cf_printf_attribute=yes
16933                         cat >conftest.h <<EOF
16934 #define GCC_$cf_ATTRIBUTE 1
16935 EOF
16936                         ;;
16937                 (scanf)
16938                         cf_scanf_attribute=yes
16939                         cat >conftest.h <<EOF
16940 #define GCC_$cf_ATTRIBUTE 1
16941 EOF
16942                         ;;
16943                 (*)
16944                         cat >conftest.h <<EOF
16945 #define GCC_$cf_ATTRIBUTE $cf_directive
16946 EOF
16947                         ;;
16948                 esac
16949
16950                 if { (eval echo "$as_me:16950: \"$ac_compile\"") >&5
16951   (eval $ac_compile) 2>&5
16952   ac_status=$?
16953   echo "$as_me:16953: \$? = $ac_status" >&5
16954   (exit $ac_status); }; then
16955                         test -n "$verbose" && echo "$as_me:16955: result: ... $cf_attribute" >&5
16956 echo "${ECHO_T}... $cf_attribute" >&6
16957                         cat conftest.h >>confdefs.h
16958                         case $cf_attribute in
16959                         (noreturn)
16960
16961 cat >>confdefs.h <<EOF
16962 #define GCC_NORETURN $cf_directive
16963 EOF
16964
16965                                 ;;
16966                         (printf)
16967                                 cf_value='/* nothing */'
16968                                 if test "$cf_printf_attribute" != no ; then
16969                                         cf_value='__attribute__((format(printf,fmt,var)))'
16970
16971 cat >>confdefs.h <<\EOF
16972 #define GCC_PRINTF 1
16973 EOF
16974
16975                                 fi
16976
16977 cat >>confdefs.h <<EOF
16978 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16979 EOF
16980
16981                                 ;;
16982                         (scanf)
16983                                 cf_value='/* nothing */'
16984                                 if test "$cf_scanf_attribute" != no ; then
16985                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16986
16987 cat >>confdefs.h <<\EOF
16988 #define GCC_SCANF 1
16989 EOF
16990
16991                                 fi
16992
16993 cat >>confdefs.h <<EOF
16994 #define GCC_SCANFLIKE(fmt,var) $cf_value
16995 EOF
16996
16997                                 ;;
16998                         (unused)
16999
17000 cat >>confdefs.h <<EOF
17001 #define GCC_UNUSED $cf_directive
17002 EOF
17003
17004                                 ;;
17005                         esac
17006                 fi
17007         done
17008 else
17009         fgrep define conftest.i >>confdefs.h
17010 fi
17011 rm -rf conftest*
17012 fi
17013
17014 INTEL_COMPILER=no
17015
17016 if test "$GCC" = yes ; then
17017         case $host_os in
17018         (linux*|gnu*)
17019                 echo "$as_me:17019: checking if this is really Intel C compiler" >&5
17020 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17021                 cf_save_CFLAGS="$CFLAGS"
17022                 CFLAGS="$CFLAGS -no-gcc"
17023                 cat >conftest.$ac_ext <<_ACEOF
17024 #line 17024 "configure"
17025 #include "confdefs.h"
17026
17027 int
17028 main ()
17029 {
17030
17031 #ifdef __INTEL_COMPILER
17032 #else
17033 make an error
17034 #endif
17035
17036   ;
17037   return 0;
17038 }
17039 _ACEOF
17040 rm -f conftest.$ac_objext
17041 if { (eval echo "$as_me:17041: \"$ac_compile\"") >&5
17042   (eval $ac_compile) 2>&5
17043   ac_status=$?
17044   echo "$as_me:17044: \$? = $ac_status" >&5
17045   (exit $ac_status); } &&
17046          { ac_try='test -s conftest.$ac_objext'
17047   { (eval echo "$as_me:17047: \"$ac_try\"") >&5
17048   (eval $ac_try) 2>&5
17049   ac_status=$?
17050   echo "$as_me:17050: \$? = $ac_status" >&5
17051   (exit $ac_status); }; }; then
17052   INTEL_COMPILER=yes
17053 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17054
17055 else
17056   echo "$as_me: failed program was:" >&5
17057 cat conftest.$ac_ext >&5
17058 fi
17059 rm -f conftest.$ac_objext conftest.$ac_ext
17060                 CFLAGS="$cf_save_CFLAGS"
17061                 echo "$as_me:17061: result: $INTEL_COMPILER" >&5
17062 echo "${ECHO_T}$INTEL_COMPILER" >&6
17063                 ;;
17064         esac
17065 fi
17066
17067 CLANG_COMPILER=no
17068
17069 if test "$GCC" = yes ; then
17070         echo "$as_me:17070: checking if this is really Clang C compiler" >&5
17071 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
17072         cf_save_CFLAGS="$CFLAGS"
17073         CFLAGS="$CFLAGS -Qunused-arguments"
17074         cat >conftest.$ac_ext <<_ACEOF
17075 #line 17075 "configure"
17076 #include "confdefs.h"
17077
17078 int
17079 main ()
17080 {
17081
17082 #ifdef __clang__
17083 #else
17084 make an error
17085 #endif
17086
17087   ;
17088   return 0;
17089 }
17090 _ACEOF
17091 rm -f conftest.$ac_objext
17092 if { (eval echo "$as_me:17092: \"$ac_compile\"") >&5
17093   (eval $ac_compile) 2>&5
17094   ac_status=$?
17095   echo "$as_me:17095: \$? = $ac_status" >&5
17096   (exit $ac_status); } &&
17097          { ac_try='test -s conftest.$ac_objext'
17098   { (eval echo "$as_me:17098: \"$ac_try\"") >&5
17099   (eval $ac_try) 2>&5
17100   ac_status=$?
17101   echo "$as_me:17101: \$? = $ac_status" >&5
17102   (exit $ac_status); }; }; then
17103   CLANG_COMPILER=yes
17104 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
17105
17106 else
17107   echo "$as_me: failed program was:" >&5
17108 cat conftest.$ac_ext >&5
17109 fi
17110 rm -f conftest.$ac_objext conftest.$ac_ext
17111         CFLAGS="$cf_save_CFLAGS"
17112         echo "$as_me:17112: result: $CLANG_COMPILER" >&5
17113 echo "${ECHO_T}$CLANG_COMPILER" >&6
17114 fi
17115
17116 cat > conftest.$ac_ext <<EOF
17117 #line 17117 "${as_me:-configure}"
17118 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
17119 EOF
17120
17121 if test "$INTEL_COMPILER" = yes
17122 then
17123 # The "-wdXXX" options suppress warnings:
17124 # remark #1419: external declaration in primary source file
17125 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
17126 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
17127 # remark #193: zero used for undefined preprocessing identifier
17128 # remark #593: variable "curs_sb_left_arrow" was set but never used
17129 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
17130 # remark #869: parameter "tw" was never referenced
17131 # remark #981: operands are evaluated in unspecified order
17132 # warning #279: controlling expression is constant
17133
17134         { echo "$as_me:17134: checking for $CC warning options..." >&5
17135 echo "$as_me: checking for $CC warning options..." >&6;}
17136         cf_save_CFLAGS="$CFLAGS"
17137         EXTRA_CFLAGS="-Wall"
17138         for cf_opt in \
17139                 wd1419 \
17140                 wd1683 \
17141                 wd1684 \
17142                 wd193 \
17143                 wd593 \
17144                 wd279 \
17145                 wd810 \
17146                 wd869 \
17147                 wd981
17148         do
17149                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17150                 if { (eval echo "$as_me:17150: \"$ac_compile\"") >&5
17151   (eval $ac_compile) 2>&5
17152   ac_status=$?
17153   echo "$as_me:17153: \$? = $ac_status" >&5
17154   (exit $ac_status); }; then
17155                         test -n "$verbose" && echo "$as_me:17155: result: ... -$cf_opt" >&5
17156 echo "${ECHO_T}... -$cf_opt" >&6
17157                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17158                 fi
17159         done
17160         CFLAGS="$cf_save_CFLAGS"
17161
17162 elif test "$GCC" = yes
17163 then
17164         { echo "$as_me:17164: checking for $CC warning options..." >&5
17165 echo "$as_me: checking for $CC warning options..." >&6;}
17166         cf_save_CFLAGS="$CFLAGS"
17167         EXTRA_CFLAGS=
17168         cf_warn_CONST=""
17169         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
17170         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
17171         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
17172         for cf_opt in W Wall \
17173                 Wbad-function-cast \
17174                 Wcast-align \
17175                 Wcast-qual \
17176                 Wdeclaration-after-statement \
17177                 Wextra \
17178                 Winline \
17179                 Wmissing-declarations \
17180                 Wmissing-prototypes \
17181                 Wnested-externs \
17182                 Wpointer-arith \
17183                 Wshadow \
17184                 Wstrict-prototypes \
17185                 Wundef $cf_gcc_warnings $cf_warn_CONST
17186         do
17187                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17188                 if { (eval echo "$as_me:17188: \"$ac_compile\"") >&5
17189   (eval $ac_compile) 2>&5
17190   ac_status=$?
17191   echo "$as_me:17191: \$? = $ac_status" >&5
17192   (exit $ac_status); }; then
17193                         test -n "$verbose" && echo "$as_me:17193: result: ... -$cf_opt" >&5
17194 echo "${ECHO_T}... -$cf_opt" >&6
17195                         case $cf_opt in
17196                         (Wcast-qual)
17197                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17198                                 ;;
17199                         (Winline)
17200                                 case $GCC_VERSION in
17201                                 ([34].*)
17202                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17203
17204 echo "${as_me:-configure}:17204: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17205
17206                                         continue;;
17207                                 esac
17208                                 ;;
17209                         (Wpointer-arith)
17210                                 case $GCC_VERSION in
17211                                 ([12].*)
17212                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17213
17214 echo "${as_me:-configure}:17214: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17215
17216                                         continue;;
17217                                 esac
17218                                 ;;
17219                         esac
17220                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17221                 fi
17222         done
17223         CFLAGS="$cf_save_CFLAGS"
17224 fi
17225 rm -rf conftest*
17226
17227 fi
17228 fi
17229
17230 echo "$as_me:17230: checking if you want to use dmalloc for testing" >&5
17231 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17232
17233 # Check whether --with-dmalloc or --without-dmalloc was given.
17234 if test "${with_dmalloc+set}" = set; then
17235   withval="$with_dmalloc"
17236
17237 cat >>confdefs.h <<EOF
17238 #define USE_DMALLOC 1
17239 EOF
17240
17241         : ${with_cflags:=-g}
17242         : ${with_no_leaks:=yes}
17243          with_dmalloc=yes
17244 else
17245   with_dmalloc=
17246 fi;
17247 echo "$as_me:17247: result: ${with_dmalloc:-no}" >&5
17248 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17249
17250 case .$with_cflags in
17251 (.*-g*)
17252         case .$CFLAGS in
17253         (.*-g*)
17254                 ;;
17255         (*)
17256
17257 cf_fix_cppflags=no
17258 cf_new_cflags=
17259 cf_new_cppflags=
17260 cf_new_extra_cppflags=
17261
17262 for cf_add_cflags in -g
17263 do
17264 case $cf_fix_cppflags in
17265 (no)
17266         case $cf_add_cflags in
17267         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17268                 case $cf_add_cflags in
17269                 (-D*)
17270                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17271
17272                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17273                                 && test -z "${cf_tst_cflags}" \
17274                                 && cf_fix_cppflags=yes
17275
17276                         if test $cf_fix_cppflags = yes ; then
17277                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17278                                 continue
17279                         elif test "${cf_tst_cflags}" = "\"'" ; then
17280                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17281                                 continue
17282                         fi
17283                         ;;
17284                 esac
17285                 case "$CPPFLAGS" in
17286                 (*$cf_add_cflags)
17287                         ;;
17288                 (*)
17289                         case $cf_add_cflags in
17290                         (-D*)
17291                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17292
17293 CPPFLAGS=`echo "$CPPFLAGS" | \
17294         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17295                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17296
17297                                 ;;
17298                         esac
17299                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17300                         ;;
17301                 esac
17302                 ;;
17303         (*)
17304                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17305                 ;;
17306         esac
17307         ;;
17308 (yes)
17309         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17310
17311         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17312
17313         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17314                 && test -z "${cf_tst_cflags}" \
17315                 && cf_fix_cppflags=no
17316         ;;
17317 esac
17318 done
17319
17320 if test -n "$cf_new_cflags" ; then
17321
17322         CFLAGS="$CFLAGS $cf_new_cflags"
17323 fi
17324
17325 if test -n "$cf_new_cppflags" ; then
17326
17327         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17328 fi
17329
17330 if test -n "$cf_new_extra_cppflags" ; then
17331
17332         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17333 fi
17334
17335                 ;;
17336         esac
17337         ;;
17338 esac
17339
17340 if test "$with_dmalloc" = yes ; then
17341         echo "$as_me:17341: checking for dmalloc.h" >&5
17342 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17343 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17344   echo $ECHO_N "(cached) $ECHO_C" >&6
17345 else
17346   cat >conftest.$ac_ext <<_ACEOF
17347 #line 17347 "configure"
17348 #include "confdefs.h"
17349 #include <dmalloc.h>
17350 _ACEOF
17351 if { (eval echo "$as_me:17351: \"$ac_cpp conftest.$ac_ext\"") >&5
17352   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17353   ac_status=$?
17354   egrep -v '^ *\+' conftest.er1 >conftest.err
17355   rm -f conftest.er1
17356   cat conftest.err >&5
17357   echo "$as_me:17357: \$? = $ac_status" >&5
17358   (exit $ac_status); } >/dev/null; then
17359   if test -s conftest.err; then
17360     ac_cpp_err=$ac_c_preproc_warn_flag
17361   else
17362     ac_cpp_err=
17363   fi
17364 else
17365   ac_cpp_err=yes
17366 fi
17367 if test -z "$ac_cpp_err"; then
17368   ac_cv_header_dmalloc_h=yes
17369 else
17370   echo "$as_me: failed program was:" >&5
17371   cat conftest.$ac_ext >&5
17372   ac_cv_header_dmalloc_h=no
17373 fi
17374 rm -f conftest.err conftest.$ac_ext
17375 fi
17376 echo "$as_me:17376: result: $ac_cv_header_dmalloc_h" >&5
17377 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
17378 if test $ac_cv_header_dmalloc_h = yes; then
17379
17380 echo "$as_me:17380: checking for dmalloc_debug in -ldmalloc" >&5
17381 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
17382 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
17383   echo $ECHO_N "(cached) $ECHO_C" >&6
17384 else
17385   ac_check_lib_save_LIBS=$LIBS
17386 LIBS="-ldmalloc  $LIBS"
17387 cat >conftest.$ac_ext <<_ACEOF
17388 #line 17388 "configure"
17389 #include "confdefs.h"
17390
17391 /* Override any gcc2 internal prototype to avoid an error.  */
17392 #ifdef __cplusplus
17393 extern "C"
17394 #endif
17395 /* We use char because int might match the return type of a gcc2
17396    builtin and then its argument prototype would still apply.  */
17397 char dmalloc_debug ();
17398 int
17399 main ()
17400 {
17401 dmalloc_debug ();
17402   ;
17403   return 0;
17404 }
17405 _ACEOF
17406 rm -f conftest.$ac_objext conftest$ac_exeext
17407 if { (eval echo "$as_me:17407: \"$ac_link\"") >&5
17408   (eval $ac_link) 2>&5
17409   ac_status=$?
17410   echo "$as_me:17410: \$? = $ac_status" >&5
17411   (exit $ac_status); } &&
17412          { ac_try='test -s conftest$ac_exeext'
17413   { (eval echo "$as_me:17413: \"$ac_try\"") >&5
17414   (eval $ac_try) 2>&5
17415   ac_status=$?
17416   echo "$as_me:17416: \$? = $ac_status" >&5
17417   (exit $ac_status); }; }; then
17418   ac_cv_lib_dmalloc_dmalloc_debug=yes
17419 else
17420   echo "$as_me: failed program was:" >&5
17421 cat conftest.$ac_ext >&5
17422 ac_cv_lib_dmalloc_dmalloc_debug=no
17423 fi
17424 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17425 LIBS=$ac_check_lib_save_LIBS
17426 fi
17427 echo "$as_me:17427: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17428 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17429 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17430   cat >>confdefs.h <<EOF
17431 #define HAVE_LIBDMALLOC 1
17432 EOF
17433
17434   LIBS="-ldmalloc $LIBS"
17435
17436 fi
17437
17438 fi
17439
17440 fi
17441
17442 echo "$as_me:17442: checking if you want to use dbmalloc for testing" >&5
17443 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17444
17445 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17446 if test "${with_dbmalloc+set}" = set; then
17447   withval="$with_dbmalloc"
17448
17449 cat >>confdefs.h <<EOF
17450 #define USE_DBMALLOC 1
17451 EOF
17452
17453         : ${with_cflags:=-g}
17454         : ${with_no_leaks:=yes}
17455          with_dbmalloc=yes
17456 else
17457   with_dbmalloc=
17458 fi;
17459 echo "$as_me:17459: result: ${with_dbmalloc:-no}" >&5
17460 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17461
17462 case .$with_cflags in
17463 (.*-g*)
17464         case .$CFLAGS in
17465         (.*-g*)
17466                 ;;
17467         (*)
17468
17469 cf_fix_cppflags=no
17470 cf_new_cflags=
17471 cf_new_cppflags=
17472 cf_new_extra_cppflags=
17473
17474 for cf_add_cflags in -g
17475 do
17476 case $cf_fix_cppflags in
17477 (no)
17478         case $cf_add_cflags in
17479         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17480                 case $cf_add_cflags in
17481                 (-D*)
17482                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17483
17484                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17485                                 && test -z "${cf_tst_cflags}" \
17486                                 && cf_fix_cppflags=yes
17487
17488                         if test $cf_fix_cppflags = yes ; then
17489                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17490                                 continue
17491                         elif test "${cf_tst_cflags}" = "\"'" ; then
17492                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17493                                 continue
17494                         fi
17495                         ;;
17496                 esac
17497                 case "$CPPFLAGS" in
17498                 (*$cf_add_cflags)
17499                         ;;
17500                 (*)
17501                         case $cf_add_cflags in
17502                         (-D*)
17503                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17504
17505 CPPFLAGS=`echo "$CPPFLAGS" | \
17506         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17507                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17508
17509                                 ;;
17510                         esac
17511                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17512                         ;;
17513                 esac
17514                 ;;
17515         (*)
17516                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17517                 ;;
17518         esac
17519         ;;
17520 (yes)
17521         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17522
17523         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17524
17525         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17526                 && test -z "${cf_tst_cflags}" \
17527                 && cf_fix_cppflags=no
17528         ;;
17529 esac
17530 done
17531
17532 if test -n "$cf_new_cflags" ; then
17533
17534         CFLAGS="$CFLAGS $cf_new_cflags"
17535 fi
17536
17537 if test -n "$cf_new_cppflags" ; then
17538
17539         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17540 fi
17541
17542 if test -n "$cf_new_extra_cppflags" ; then
17543
17544         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17545 fi
17546
17547                 ;;
17548         esac
17549         ;;
17550 esac
17551
17552 if test "$with_dbmalloc" = yes ; then
17553         echo "$as_me:17553: checking for dbmalloc.h" >&5
17554 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17555 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17556   echo $ECHO_N "(cached) $ECHO_C" >&6
17557 else
17558   cat >conftest.$ac_ext <<_ACEOF
17559 #line 17559 "configure"
17560 #include "confdefs.h"
17561 #include <dbmalloc.h>
17562 _ACEOF
17563 if { (eval echo "$as_me:17563: \"$ac_cpp conftest.$ac_ext\"") >&5
17564   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17565   ac_status=$?
17566   egrep -v '^ *\+' conftest.er1 >conftest.err
17567   rm -f conftest.er1
17568   cat conftest.err >&5
17569   echo "$as_me:17569: \$? = $ac_status" >&5
17570   (exit $ac_status); } >/dev/null; then
17571   if test -s conftest.err; then
17572     ac_cpp_err=$ac_c_preproc_warn_flag
17573   else
17574     ac_cpp_err=
17575   fi
17576 else
17577   ac_cpp_err=yes
17578 fi
17579 if test -z "$ac_cpp_err"; then
17580   ac_cv_header_dbmalloc_h=yes
17581 else
17582   echo "$as_me: failed program was:" >&5
17583   cat conftest.$ac_ext >&5
17584   ac_cv_header_dbmalloc_h=no
17585 fi
17586 rm -f conftest.err conftest.$ac_ext
17587 fi
17588 echo "$as_me:17588: result: $ac_cv_header_dbmalloc_h" >&5
17589 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17590 if test $ac_cv_header_dbmalloc_h = yes; then
17591
17592 echo "$as_me:17592: checking for debug_malloc in -ldbmalloc" >&5
17593 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17594 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17595   echo $ECHO_N "(cached) $ECHO_C" >&6
17596 else
17597   ac_check_lib_save_LIBS=$LIBS
17598 LIBS="-ldbmalloc  $LIBS"
17599 cat >conftest.$ac_ext <<_ACEOF
17600 #line 17600 "configure"
17601 #include "confdefs.h"
17602
17603 /* Override any gcc2 internal prototype to avoid an error.  */
17604 #ifdef __cplusplus
17605 extern "C"
17606 #endif
17607 /* We use char because int might match the return type of a gcc2
17608    builtin and then its argument prototype would still apply.  */
17609 char debug_malloc ();
17610 int
17611 main ()
17612 {
17613 debug_malloc ();
17614   ;
17615   return 0;
17616 }
17617 _ACEOF
17618 rm -f conftest.$ac_objext conftest$ac_exeext
17619 if { (eval echo "$as_me:17619: \"$ac_link\"") >&5
17620   (eval $ac_link) 2>&5
17621   ac_status=$?
17622   echo "$as_me:17622: \$? = $ac_status" >&5
17623   (exit $ac_status); } &&
17624          { ac_try='test -s conftest$ac_exeext'
17625   { (eval echo "$as_me:17625: \"$ac_try\"") >&5
17626   (eval $ac_try) 2>&5
17627   ac_status=$?
17628   echo "$as_me:17628: \$? = $ac_status" >&5
17629   (exit $ac_status); }; }; then
17630   ac_cv_lib_dbmalloc_debug_malloc=yes
17631 else
17632   echo "$as_me: failed program was:" >&5
17633 cat conftest.$ac_ext >&5
17634 ac_cv_lib_dbmalloc_debug_malloc=no
17635 fi
17636 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17637 LIBS=$ac_check_lib_save_LIBS
17638 fi
17639 echo "$as_me:17639: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17640 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17641 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17642   cat >>confdefs.h <<EOF
17643 #define HAVE_LIBDBMALLOC 1
17644 EOF
17645
17646   LIBS="-ldbmalloc $LIBS"
17647
17648 fi
17649
17650 fi
17651
17652 fi
17653
17654 echo "$as_me:17654: checking if you want to use valgrind for testing" >&5
17655 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17656
17657 # Check whether --with-valgrind or --without-valgrind was given.
17658 if test "${with_valgrind+set}" = set; then
17659   withval="$with_valgrind"
17660
17661 cat >>confdefs.h <<EOF
17662 #define USE_VALGRIND 1
17663 EOF
17664
17665         : ${with_cflags:=-g}
17666         : ${with_no_leaks:=yes}
17667          with_valgrind=yes
17668 else
17669   with_valgrind=
17670 fi;
17671 echo "$as_me:17671: result: ${with_valgrind:-no}" >&5
17672 echo "${ECHO_T}${with_valgrind:-no}" >&6
17673
17674 case .$with_cflags in
17675 (.*-g*)
17676         case .$CFLAGS in
17677         (.*-g*)
17678                 ;;
17679         (*)
17680
17681 cf_fix_cppflags=no
17682 cf_new_cflags=
17683 cf_new_cppflags=
17684 cf_new_extra_cppflags=
17685
17686 for cf_add_cflags in -g
17687 do
17688 case $cf_fix_cppflags in
17689 (no)
17690         case $cf_add_cflags in
17691         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17692                 case $cf_add_cflags in
17693                 (-D*)
17694                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17695
17696                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17697                                 && test -z "${cf_tst_cflags}" \
17698                                 && cf_fix_cppflags=yes
17699
17700                         if test $cf_fix_cppflags = yes ; then
17701                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17702                                 continue
17703                         elif test "${cf_tst_cflags}" = "\"'" ; then
17704                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17705                                 continue
17706                         fi
17707                         ;;
17708                 esac
17709                 case "$CPPFLAGS" in
17710                 (*$cf_add_cflags)
17711                         ;;
17712                 (*)
17713                         case $cf_add_cflags in
17714                         (-D*)
17715                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17716
17717 CPPFLAGS=`echo "$CPPFLAGS" | \
17718         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17719                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17720
17721                                 ;;
17722                         esac
17723                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17724                         ;;
17725                 esac
17726                 ;;
17727         (*)
17728                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17729                 ;;
17730         esac
17731         ;;
17732 (yes)
17733         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17734
17735         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17736
17737         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17738                 && test -z "${cf_tst_cflags}" \
17739                 && cf_fix_cppflags=no
17740         ;;
17741 esac
17742 done
17743
17744 if test -n "$cf_new_cflags" ; then
17745
17746         CFLAGS="$CFLAGS $cf_new_cflags"
17747 fi
17748
17749 if test -n "$cf_new_cppflags" ; then
17750
17751         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17752 fi
17753
17754 if test -n "$cf_new_extra_cppflags" ; then
17755
17756         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17757 fi
17758
17759                 ;;
17760         esac
17761         ;;
17762 esac
17763
17764 echo "$as_me:17764: checking if you want to perform memory-leak testing" >&5
17765 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
17766
17767 # Check whether --enable-leaks or --disable-leaks was given.
17768 if test "${enable_leaks+set}" = set; then
17769   enableval="$enable_leaks"
17770   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
17771 else
17772   : ${with_no_leaks:=no}
17773 fi;
17774 echo "$as_me:17774: result: $with_no_leaks" >&5
17775 echo "${ECHO_T}$with_no_leaks" >&6
17776
17777 if test "$with_no_leaks" = yes ; then
17778
17779 cat >>confdefs.h <<\EOF
17780 #define NO_LEAKS 1
17781 EOF
17782
17783 cat >>confdefs.h <<\EOF
17784 #define YY_NO_LEAKS 1
17785 EOF
17786
17787 fi
17788
17789 LD_RPATH_OPT=
17790 echo "$as_me:17790: checking for an rpath option" >&5
17791 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
17792 case $cf_cv_system_name in
17793 (irix*)
17794         if test "$GCC" = yes; then
17795                 LD_RPATH_OPT="-Wl,-rpath,"
17796         else
17797                 LD_RPATH_OPT="-rpath "
17798         fi
17799         ;;
17800 (linux*|gnu*|k*bsd*-gnu|freebsd*)
17801         LD_RPATH_OPT="-Wl,-rpath,"
17802         ;;
17803 (openbsd[2-9].*|mirbsd*)
17804         LD_RPATH_OPT="-Wl,-rpath,"
17805         ;;
17806 (dragonfly*)
17807         LD_RPATH_OPT="-rpath "
17808         ;;
17809 (netbsd*)
17810         LD_RPATH_OPT="-Wl,-rpath,"
17811         ;;
17812 (osf*|mls+*)
17813         LD_RPATH_OPT="-rpath "
17814         ;;
17815 (solaris2*)
17816         LD_RPATH_OPT="-R"
17817         ;;
17818 (*)
17819         ;;
17820 esac
17821 echo "$as_me:17821: result: $LD_RPATH_OPT" >&5
17822 echo "${ECHO_T}$LD_RPATH_OPT" >&6
17823
17824 case "x$LD_RPATH_OPT" in
17825 (x-R*)
17826         echo "$as_me:17826: checking if we need a space after rpath option" >&5
17827 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
17828         cf_save_LIBS="$LIBS"
17829
17830 cf_add_libs="${LD_RPATH_OPT}$libdir"
17831 # Filter out duplicates - this happens with badly-designed ".pc" files...
17832 for cf_add_1lib in $LIBS
17833 do
17834         for cf_add_2lib in $cf_add_libs
17835         do
17836                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17837                 then
17838                         cf_add_1lib=
17839                         break
17840                 fi
17841         done
17842         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17843 done
17844 LIBS="$cf_add_libs"
17845
17846         cat >conftest.$ac_ext <<_ACEOF
17847 #line 17847 "configure"
17848 #include "confdefs.h"
17849
17850 int
17851 main ()
17852 {
17853
17854   ;
17855   return 0;
17856 }
17857 _ACEOF
17858 rm -f conftest.$ac_objext conftest$ac_exeext
17859 if { (eval echo "$as_me:17859: \"$ac_link\"") >&5
17860   (eval $ac_link) 2>&5
17861   ac_status=$?
17862   echo "$as_me:17862: \$? = $ac_status" >&5
17863   (exit $ac_status); } &&
17864          { ac_try='test -s conftest$ac_exeext'
17865   { (eval echo "$as_me:17865: \"$ac_try\"") >&5
17866   (eval $ac_try) 2>&5
17867   ac_status=$?
17868   echo "$as_me:17868: \$? = $ac_status" >&5
17869   (exit $ac_status); }; }; then
17870   cf_rpath_space=no
17871 else
17872   echo "$as_me: failed program was:" >&5
17873 cat conftest.$ac_ext >&5
17874 cf_rpath_space=yes
17875 fi
17876 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17877         LIBS="$cf_save_LIBS"
17878         echo "$as_me:17878: result: $cf_rpath_space" >&5
17879 echo "${ECHO_T}$cf_rpath_space" >&6
17880         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
17881         ;;
17882 esac
17883
17884 echo "$as_me:17884: checking if rpath-hack should be disabled" >&5
17885 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
17886
17887 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
17888 if test "${enable_rpath_hack+set}" = set; then
17889   enableval="$enable_rpath_hack"
17890   test "$enableval" != no && enableval=yes
17891         if test "$enableval" != "yes" ; then
17892     cf_disable_rpath_hack=yes
17893         else
17894                 cf_disable_rpath_hack=no
17895         fi
17896 else
17897   enableval=yes
17898         cf_disable_rpath_hack=no
17899
17900 fi;
17901 echo "$as_me:17901: result: $cf_disable_rpath_hack" >&5
17902 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
17903 if test "$cf_disable_rpath_hack" = no ; then
17904
17905 echo "$as_me:17905: checking for updated LDFLAGS" >&5
17906 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
17907 if test -n "$LD_RPATH_OPT" ; then
17908         echo "$as_me:17908: result: maybe" >&5
17909 echo "${ECHO_T}maybe" >&6
17910
17911         for ac_prog in ldd
17912 do
17913   # Extract the first word of "$ac_prog", so it can be a program name with args.
17914 set dummy $ac_prog; ac_word=$2
17915 echo "$as_me:17915: checking for $ac_word" >&5
17916 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17917 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17918   echo $ECHO_N "(cached) $ECHO_C" >&6
17919 else
17920   if test -n "$cf_ldd_prog"; then
17921   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17922 else
17923   ac_save_IFS=$IFS; IFS=$ac_path_separator
17924 ac_dummy="$PATH"
17925 for ac_dir in $ac_dummy; do
17926   IFS=$ac_save_IFS
17927   test -z "$ac_dir" && ac_dir=.
17928   $as_executable_p "$ac_dir/$ac_word" || continue
17929 ac_cv_prog_cf_ldd_prog="$ac_prog"
17930 echo "$as_me:17930: found $ac_dir/$ac_word" >&5
17931 break
17932 done
17933
17934 fi
17935 fi
17936 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17937 if test -n "$cf_ldd_prog"; then
17938   echo "$as_me:17938: result: $cf_ldd_prog" >&5
17939 echo "${ECHO_T}$cf_ldd_prog" >&6
17940 else
17941   echo "$as_me:17941: result: no" >&5
17942 echo "${ECHO_T}no" >&6
17943 fi
17944
17945   test -n "$cf_ldd_prog" && break
17946 done
17947 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
17948
17949         cf_rpath_list="/usr/lib /lib"
17950         if test "$cf_ldd_prog" != no
17951         then
17952                 cf_rpath_oops=
17953
17954 cat >conftest.$ac_ext <<_ACEOF
17955 #line 17955 "configure"
17956 #include "confdefs.h"
17957 #include <stdio.h>
17958 int
17959 main ()
17960 {
17961 printf("Hello");
17962   ;
17963   return 0;
17964 }
17965 _ACEOF
17966 rm -f conftest.$ac_objext conftest$ac_exeext
17967 if { (eval echo "$as_me:17967: \"$ac_link\"") >&5
17968   (eval $ac_link) 2>&5
17969   ac_status=$?
17970   echo "$as_me:17970: \$? = $ac_status" >&5
17971   (exit $ac_status); } &&
17972          { ac_try='test -s conftest$ac_exeext'
17973   { (eval echo "$as_me:17973: \"$ac_try\"") >&5
17974   (eval $ac_try) 2>&5
17975   ac_status=$?
17976   echo "$as_me:17976: \$? = $ac_status" >&5
17977   (exit $ac_status); }; }; then
17978   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
17979                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
17980 else
17981   echo "$as_me: failed program was:" >&5
17982 cat conftest.$ac_ext >&5
17983 fi
17984 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17985
17986                 # If we passed the link-test, but get a "not found" on a given library,
17987                 # this could be due to inept reconfiguration of gcc to make it only
17988                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
17989                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
17990                 # /usr/local libraries.
17991                 if test -n "$cf_rpath_oops"
17992                 then
17993                         for cf_rpath_src in $cf_rpath_oops
17994                         do
17995                                 for cf_rpath_dir in \
17996                                         /usr/local \
17997                                         /usr/pkg \
17998                                         /opt/sfw
17999                                 do
18000                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18001                                         then
18002                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18003
18004 echo "${as_me:-configure}:18004: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18005
18006                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18007                                                 break
18008                                         fi
18009                                 done
18010                         done
18011                 fi
18012         fi
18013
18014         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18015
18016 echo "${as_me:-configure}:18016: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18017
18018 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
18019
18020 echo "${as_me:-configure}:18020: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
18021
18022 cf_rpath_dst=
18023 for cf_rpath_src in $LDFLAGS
18024 do
18025         case $cf_rpath_src in
18026         (-L*)
18027
18028                 # check if this refers to a directory which we will ignore
18029                 cf_rpath_skip=no
18030                 if test -n "$cf_rpath_list"
18031                 then
18032                         for cf_rpath_item in $cf_rpath_list
18033                         do
18034                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18035                                 then
18036                                         cf_rpath_skip=yes
18037                                         break
18038                                 fi
18039                         done
18040                 fi
18041
18042                 if test "$cf_rpath_skip" = no
18043                 then
18044                         # transform the option
18045                         if test "$LD_RPATH_OPT" = "-R " ; then
18046                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18047                         else
18048                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18049                         fi
18050
18051                         # if we have not already added this, add it now
18052                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18053                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18054                         then
18055                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18056
18057 echo "${as_me:-configure}:18057: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18058
18059                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18060                         fi
18061                 fi
18062                 ;;
18063         esac
18064         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18065 done
18066 LDFLAGS=$cf_rpath_dst
18067
18068 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
18069
18070 echo "${as_me:-configure}:18070: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
18071
18072 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
18073
18074 echo "${as_me:-configure}:18074: testing ...checking LIBS $LIBS ..." 1>&5
18075
18076 cf_rpath_dst=
18077 for cf_rpath_src in $LIBS
18078 do
18079         case $cf_rpath_src in
18080         (-L*)
18081
18082                 # check if this refers to a directory which we will ignore
18083                 cf_rpath_skip=no
18084                 if test -n "$cf_rpath_list"
18085                 then
18086                         for cf_rpath_item in $cf_rpath_list
18087                         do
18088                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18089                                 then
18090                                         cf_rpath_skip=yes
18091                                         break
18092                                 fi
18093                         done
18094                 fi
18095
18096                 if test "$cf_rpath_skip" = no
18097                 then
18098                         # transform the option
18099                         if test "$LD_RPATH_OPT" = "-R " ; then
18100                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18101                         else
18102                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18103                         fi
18104
18105                         # if we have not already added this, add it now
18106                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18107                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18108                         then
18109                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18110
18111 echo "${as_me:-configure}:18111: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18112
18113                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18114                         fi
18115                 fi
18116                 ;;
18117         esac
18118         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18119 done
18120 LIBS=$cf_rpath_dst
18121
18122 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
18123
18124 echo "${as_me:-configure}:18124: testing ...checked LIBS $LIBS ..." 1>&5
18125
18126         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18127
18128 echo "${as_me:-configure}:18128: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18129
18130 else
18131         echo "$as_me:18131: result: no" >&5
18132 echo "${ECHO_T}no" >&6
18133 fi
18134
18135 fi
18136
18137 TEST_ARGS="$LIBS"
18138 LIBS=
18139
18140 ac_config_files="$ac_config_files Makefile"
18141 ac_config_commands="$ac_config_commands default"
18142 cat >confcache <<\_ACEOF
18143 # This file is a shell script that caches the results of configure
18144 # tests run on this system so they can be shared between configure
18145 # scripts and configure runs, see configure's option --config-cache.
18146 # It is not useful on other systems.  If it contains results you don't
18147 # want to keep, you may remove or edit it.
18148 #
18149 # config.status only pays attention to the cache file if you give it
18150 # the --recheck option to rerun configure.
18151 #
18152 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18153 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18154 # following values.
18155
18156 _ACEOF
18157
18158 # The following way of writing the cache mishandles newlines in values,
18159 # but we know of no workaround that is simple, portable, and efficient.
18160 # So, don't put newlines in cache variables' values.
18161 # Ultrix sh set writes to stderr and can't be redirected directly,
18162 # and sets the high bit in the cache file unless we assign to the vars.
18163 {
18164   (set) 2>&1 |
18165     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18166     *ac_space=\ *)
18167       # `set' does not quote correctly, so add quotes (double-quote
18168       # substitution turns \\\\ into \\, and sed turns \\ into \).
18169       sed -n \
18170         "s/'/'\\\\''/g;
18171           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18172       ;;
18173     *)
18174       # `set' quotes correctly as required by POSIX, so do not add quotes.
18175       sed -n \
18176         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18177       ;;
18178     esac;
18179 } |
18180   sed '
18181      t clear
18182      : clear
18183      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18184      t end
18185      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18186      : end' >>confcache
18187 if cmp -s $cache_file confcache; then :; else
18188   if test -w $cache_file; then
18189     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18190     cat confcache >$cache_file
18191   else
18192     echo "not updating unwritable cache $cache_file"
18193   fi
18194 fi
18195 rm -f confcache
18196
18197 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18198 # Let make expand exec_prefix.
18199 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18200
18201 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18202 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18203 # trailing colons and then remove the whole line if VPATH becomes empty
18204 # (actually we leave an empty line to preserve line numbers).
18205 if test "x$srcdir" = x.; then
18206   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18207 s/:*\$(srcdir):*/:/;
18208 s/:*\${srcdir}:*/:/;
18209 s/:*@srcdir@:*/:/;
18210 s/^\([^=]*=[    ]*\):*/\1/;
18211 s/:*$//;
18212 s/^[^=]*=[      ]*$//;
18213 }'
18214 fi
18215
18216 DEFS=-DHAVE_CONFIG_H
18217
18218 : ${CONFIG_STATUS=./config.status}
18219 ac_clean_files_save=$ac_clean_files
18220 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18221 { echo "$as_me:18221: creating $CONFIG_STATUS" >&5
18222 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18223 cat >$CONFIG_STATUS <<_ACEOF
18224 #! $SHELL
18225 # Generated automatically by configure.
18226 # Run this file to recreate the current configuration.
18227 # Compiler output produced by configure, useful for debugging
18228 # configure, is in config.log if it exists.
18229
18230 debug=false
18231 SHELL=\${CONFIG_SHELL-$SHELL}
18232 ac_cs_invocation="\$0 \$@"
18233
18234 _ACEOF
18235
18236 cat >>$CONFIG_STATUS <<\_ACEOF
18237 # Be Bourne compatible
18238 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18239   emulate sh
18240   NULLCMD=:
18241 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18242   set -o posix
18243 fi
18244
18245 # Name of the executable.
18246 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18247
18248 if expr a : '\(a\)' >/dev/null 2>&1; then
18249   as_expr=expr
18250 else
18251   as_expr=false
18252 fi
18253
18254 rm -f conf$$ conf$$.exe conf$$.file
18255 echo >conf$$.file
18256 if ln -s conf$$.file conf$$ 2>/dev/null; then
18257   # We could just check for DJGPP; but this test a) works b) is more generic
18258   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18259   if test -f conf$$.exe; then
18260     # Don't use ln at all; we don't have any links
18261     as_ln_s='cp -p'
18262   else
18263     as_ln_s='ln -s'
18264   fi
18265 elif ln conf$$.file conf$$ 2>/dev/null; then
18266   as_ln_s=ln
18267 else
18268   as_ln_s='cp -p'
18269 fi
18270 rm -f conf$$ conf$$.exe conf$$.file
18271
18272 as_executable_p="test -f"
18273
18274 # Support unset when possible.
18275 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18276   as_unset=unset
18277 else
18278   as_unset=false
18279 fi
18280
18281 # NLS nuisances.
18282 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18283 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18284 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18285 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18286 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18287 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18288 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18289 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18290
18291 # IFS
18292 # We need space, tab and new line, in precisely that order.
18293 as_nl='
18294 '
18295 IFS="   $as_nl"
18296
18297 # CDPATH.
18298 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18299
18300 exec 6>&1
18301
18302 _ACEOF
18303
18304 # Files that config.status was made for.
18305 if test -n "$ac_config_files"; then
18306   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18307 fi
18308
18309 if test -n "$ac_config_headers"; then
18310   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18311 fi
18312
18313 if test -n "$ac_config_links"; then
18314   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18315 fi
18316
18317 if test -n "$ac_config_commands"; then
18318   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18319 fi
18320
18321 cat >>$CONFIG_STATUS <<\EOF
18322
18323 ac_cs_usage="\
18324 \`$as_me' instantiates files from templates according to the
18325 current configuration.
18326
18327 Usage: $0 [OPTIONS] [FILE]...
18328
18329   -h, --help       print this help, then exit
18330   -V, --version    print version number, then exit
18331   -d, --debug      don't remove temporary files
18332       --recheck    update $as_me by reconfiguring in the same conditions
18333   --file=FILE[:TEMPLATE]
18334                    instantiate the configuration file FILE
18335   --header=FILE[:TEMPLATE]
18336                    instantiate the configuration header FILE
18337
18338 Configuration files:
18339 $config_files
18340
18341 Configuration headers:
18342 $config_headers
18343
18344 Configuration commands:
18345 $config_commands
18346
18347 Report bugs to <dickey@invisible-island.net>."
18348 EOF
18349
18350 cat >>$CONFIG_STATUS <<EOF
18351 ac_cs_version="\\
18352 config.status
18353 configured by $0, generated by GNU Autoconf 2.52.20150926,
18354   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18355
18356 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18357 Free Software Foundation, Inc.
18358 This config.status script is free software; the Free Software Foundation
18359 gives unlimited permission to copy, distribute and modify it."
18360 srcdir=$srcdir
18361 INSTALL="$INSTALL"
18362 EOF
18363
18364 cat >>$CONFIG_STATUS <<\EOF
18365 # If no file are specified by the user, then we need to provide default
18366 # value.  By we need to know if files were specified by the user.
18367 ac_need_defaults=:
18368 while test $# != 0
18369 do
18370   case $1 in
18371   --*=*)
18372     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18373     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18374     shift
18375     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18376     shift
18377     ;;
18378   -*);;
18379   *) # This is not an option, so the user has probably given explicit
18380      # arguments.
18381      ac_need_defaults=false;;
18382   esac
18383
18384   case $1 in
18385   # Handling of the options.
18386 EOF
18387 cat >>$CONFIG_STATUS <<EOF
18388   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18389     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18390     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18391 EOF
18392 cat >>$CONFIG_STATUS <<\EOF
18393   --version | --vers* | -V )
18394     echo "$ac_cs_version"; exit 0 ;;
18395   --he | --h)
18396     # Conflict between --help and --header
18397     { { echo "$as_me:18397: error: ambiguous option: $1
18398 Try \`$0 --help' for more information." >&5
18399 echo "$as_me: error: ambiguous option: $1
18400 Try \`$0 --help' for more information." >&2;}
18401    { (exit 1); exit 1; }; };;
18402   --help | --hel | -h )
18403     echo "$ac_cs_usage"; exit 0 ;;
18404   --debug | --d* | -d )
18405     debug=: ;;
18406   --file | --fil | --fi | --f )
18407     shift
18408     CONFIG_FILES="$CONFIG_FILES $1"
18409     ac_need_defaults=false;;
18410   --header | --heade | --head | --hea )
18411     shift
18412     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18413     ac_need_defaults=false;;
18414
18415   # This is an error.
18416   -*) { { echo "$as_me:18416: error: unrecognized option: $1
18417 Try \`$0 --help' for more information." >&5
18418 echo "$as_me: error: unrecognized option: $1
18419 Try \`$0 --help' for more information." >&2;}
18420    { (exit 1); exit 1; }; } ;;
18421
18422   *) ac_config_targets="$ac_config_targets $1" ;;
18423
18424   esac
18425   shift
18426 done
18427
18428 exec 5>>config.log
18429 cat >&5 << _ACEOF
18430
18431 ## ----------------------- ##
18432 ## Running config.status.  ##
18433 ## ----------------------- ##
18434
18435 This file was extended by $as_me 2.52.20150926, executed with
18436   CONFIG_FILES    = $CONFIG_FILES
18437   CONFIG_HEADERS  = $CONFIG_HEADERS
18438   CONFIG_LINKS    = $CONFIG_LINKS
18439   CONFIG_COMMANDS = $CONFIG_COMMANDS
18440   > $ac_cs_invocation
18441 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18442
18443 _ACEOF
18444 EOF
18445
18446 cat >>$CONFIG_STATUS <<EOF
18447 #
18448 # INIT-COMMANDS section.
18449 #
18450
18451 AWK="$AWK"
18452 ECHO_CC="$ECHO_CC"
18453 ECHO_LD="$ECHO_LD"
18454 SHOW_CC="$SHOW_LD"
18455
18456 EOF
18457
18458 cat >>$CONFIG_STATUS <<\EOF
18459 for ac_config_target in $ac_config_targets
18460 do
18461   case "$ac_config_target" in
18462   # Handling of arguments.
18463   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18464   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18465   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
18466   *) { { echo "$as_me:18466: error: invalid argument: $ac_config_target" >&5
18467 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18468    { (exit 1); exit 1; }; };;
18469   esac
18470 done
18471
18472 # If the user did not use the arguments to specify the items to instantiate,
18473 # then the envvar interface is used.  Set only those that are not.
18474 # We use the long form for the default assignment because of an extremely
18475 # bizarre bug on SunOS 4.1.3.
18476 if $ac_need_defaults; then
18477   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18478   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18479   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18480 fi
18481
18482 # Create a temporary directory, and hook for its removal unless debugging.
18483 $debug ||
18484 {
18485   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18486   trap '{ (exit 1); exit 1; }' 1 2 13 15
18487 }
18488
18489 # Create a (secure) tmp directory for tmp files.
18490 : ${TMPDIR=/tmp}
18491 {
18492   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18493   test -n "$tmp" && test -d "$tmp"
18494 }  ||
18495 {
18496   tmp=$TMPDIR/cs$$-$RANDOM
18497   (umask 077 && mkdir $tmp)
18498 } ||
18499 {
18500    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18501    { (exit 1); exit 1; }
18502 }
18503
18504 EOF
18505
18506 cat >>$CONFIG_STATUS <<EOF
18507
18508 #
18509 # CONFIG_FILES section.
18510 #
18511
18512 # No need to generate the scripts if there are no CONFIG_FILES.
18513 # This happens for instance when ./config.status config.h
18514 if test -n "\$CONFIG_FILES"; then
18515   # Protect against being on the right side of a sed subst in config.status.
18516   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18517    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18518 s,@SHELL@,$SHELL,;t t
18519 s,@exec_prefix@,$exec_prefix,;t t
18520 s,@prefix@,$prefix,;t t
18521 s,@program_transform_name@,$program_transform_name,;t t
18522 s,@bindir@,$bindir,;t t
18523 s,@sbindir@,$sbindir,;t t
18524 s,@libexecdir@,$libexecdir,;t t
18525 s,@datarootdir@,$datarootdir,;t t
18526 s,@datadir@,$datadir,;t t
18527 s,@sysconfdir@,$sysconfdir,;t t
18528 s,@sharedstatedir@,$sharedstatedir,;t t
18529 s,@localstatedir@,$localstatedir,;t t
18530 s,@libdir@,$libdir,;t t
18531 s,@includedir@,$includedir,;t t
18532 s,@oldincludedir@,$oldincludedir,;t t
18533 s,@infodir@,$infodir,;t t
18534 s,@mandir@,$mandir,;t t
18535 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18536 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18537 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18538 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18539 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18540 s,@build_alias@,$build_alias,;t t
18541 s,@host_alias@,$host_alias,;t t
18542 s,@target_alias@,$target_alias,;t t
18543 s,@ECHO_C@,$ECHO_C,;t t
18544 s,@ECHO_N@,$ECHO_N,;t t
18545 s,@ECHO_T@,$ECHO_T,;t t
18546 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18547 s,@DEFS@,$DEFS,;t t
18548 s,@LIBS@,$LIBS,;t t
18549 s,@build@,$build,;t t
18550 s,@build_cpu@,$build_cpu,;t t
18551 s,@build_vendor@,$build_vendor,;t t
18552 s,@build_os@,$build_os,;t t
18553 s,@host@,$host,;t t
18554 s,@host_cpu@,$host_cpu,;t t
18555 s,@host_vendor@,$host_vendor,;t t
18556 s,@host_os@,$host_os,;t t
18557 s,@SET_MAKE@,$SET_MAKE,;t t
18558 s,@CC@,$CC,;t t
18559 s,@CFLAGS@,$CFLAGS,;t t
18560 s,@LDFLAGS@,$LDFLAGS,;t t
18561 s,@CPPFLAGS@,$CPPFLAGS,;t t
18562 s,@ac_ct_CC@,$ac_ct_CC,;t t
18563 s,@EXEEXT@,$EXEEXT,;t t
18564 s,@OBJEXT@,$OBJEXT,;t t
18565 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18566 s,@CPP@,$CPP,;t t
18567 s,@AWK@,$AWK,;t t
18568 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18569 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18570 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18571 s,@LINT@,$LINT,;t t
18572 s,@LINT_OPTS@,$LINT_OPTS,;t t
18573 s,@CTAGS@,$CTAGS,;t t
18574 s,@ETAGS@,$ETAGS,;t t
18575 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18576 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18577 s,@MATH_LIB@,$MATH_LIB,;t t
18578 s,@top_builddir@,$top_builddir,;t t
18579 s,@CC_G_OPT@,$CC_G_OPT,;t t
18580 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18581 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18582 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18583 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18584 s,@LD@,$LD,;t t
18585 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18586 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18587 s,@LD_MODEL@,$LD_MODEL,;t t
18588 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18589 s,@LIBTOOL@,$LIBTOOL,;t t
18590 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18591 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18592 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18593 s,@LIB_LINK@,$LIB_LINK,;t t
18594 s,@LINK_TESTS@,$LINK_TESTS,;t t
18595 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18596 s,@PACKAGE@,$PACKAGE,;t t
18597 s,@PTHREAD@,$PTHREAD,;t t
18598 s,@TEST_ARGS@,$TEST_ARGS,;t t
18599 s,@TEST_DEPS@,$TEST_DEPS,;t t
18600 s,@TEST_LIBS@,$TEST_LIBS,;t t
18601 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18602 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18603 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18604 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18605 s,@includesubdir@,$includesubdir,;t t
18606 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18607 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18608 s,@ECHO_LT@,$ECHO_LT,;t t
18609 s,@ECHO_LD@,$ECHO_LD,;t t
18610 s,@RULE_CC@,$RULE_CC,;t t
18611 s,@SHOW_CC@,$SHOW_CC,;t t
18612 s,@ECHO_CC@,$ECHO_CC,;t t
18613 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18614 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18615 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18616 s,@X_CFLAGS@,$X_CFLAGS,;t t
18617 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18618 s,@X_LIBS@,$X_LIBS,;t t
18619 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18620 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18621 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18622 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18623 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18624 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18625 CEOF
18626
18627 EOF
18628
18629   cat >>$CONFIG_STATUS <<\EOF
18630   # Split the substitutions into bite-sized pieces for seds with
18631   # small command number limits, like on Digital OSF/1 and HP-UX.
18632   ac_max_sed_lines=48
18633   ac_sed_frag=1 # Number of current file.
18634   ac_beg=1 # First line for current file.
18635   ac_end=$ac_max_sed_lines # Line after last line for current file.
18636   ac_more_lines=:
18637   ac_sed_cmds=
18638   while $ac_more_lines; do
18639     if test $ac_beg -gt 1; then
18640       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18641     else
18642       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18643     fi
18644     if test ! -s $tmp/subs.frag; then
18645       ac_more_lines=false
18646     else
18647       # The purpose of the label and of the branching condition is to
18648       # speed up the sed processing (if there are no `@' at all, there
18649       # is no need to browse any of the substitutions).
18650       # These are the two extra sed commands mentioned above.
18651       (echo ':t
18652   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18653       # It is possible to make a multiline substitution using escaped newlines.
18654       # Ensure that we do not split the substitution between script fragments.
18655       ac_BEG=$ac_end
18656       ac_END=`expr $ac_end + $ac_max_sed_lines`
18657       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18658       if test -s $tmp/subs.next; then
18659         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18660         if test ! -s $tmp/subs.edit; then
18661           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18662           if test ! -s $tmp/subs.edit; then
18663             if test $ac_beg -gt 1; then
18664               ac_end=`expr $ac_end - 1`
18665               continue
18666             fi
18667           fi
18668         fi
18669       fi
18670
18671       if test -z "$ac_sed_cmds"; then
18672         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18673       else
18674         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18675       fi
18676       ac_sed_frag=`expr $ac_sed_frag + 1`
18677       ac_beg=$ac_end
18678       ac_end=`expr $ac_end + $ac_max_sed_lines`
18679     fi
18680   done
18681   if test -z "$ac_sed_cmds"; then
18682     ac_sed_cmds=cat
18683   fi
18684 fi # test -n "$CONFIG_FILES"
18685
18686 EOF
18687 cat >>$CONFIG_STATUS <<\EOF
18688 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18689   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18690   case $ac_file in
18691   - | *:- | *:-:* ) # input from stdin
18692         cat >$tmp/stdin
18693         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18694         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18695   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18696         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18697   * )   ac_file_in=$ac_file.in ;;
18698   esac
18699
18700   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18701   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18702          X"$ac_file" : 'X\(//\)[^/]' \| \
18703          X"$ac_file" : 'X\(//\)$' \| \
18704          X"$ac_file" : 'X\(/\)' \| \
18705          .     : '\(.\)' 2>/dev/null ||
18706 echo X"$ac_file" |
18707     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18708           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18709           /^X\(\/\/\)$/{ s//\1/; q; }
18710           /^X\(\/\).*/{ s//\1/; q; }
18711           s/.*/./; q'`
18712   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18713     { case "$ac_dir" in
18714   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18715   *)                      as_incr_dir=.;;
18716 esac
18717 as_dummy="$ac_dir"
18718 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18719   case $as_mkdir_dir in
18720     # Skip DOS drivespec
18721     ?:) as_incr_dir=$as_mkdir_dir ;;
18722     *)
18723       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18724       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18725     ;;
18726   esac
18727 done; }
18728
18729     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18730     # A "../" for each directory in $ac_dir_suffix.
18731     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18732   else
18733     ac_dir_suffix= ac_dots=
18734   fi
18735
18736   case $srcdir in
18737   .)  ac_srcdir=.
18738       if test -z "$ac_dots"; then
18739          ac_top_srcdir=.
18740       else
18741          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18742       fi ;;
18743   [\\/]* | ?:[\\/]* )
18744       ac_srcdir=$srcdir$ac_dir_suffix;
18745       ac_top_srcdir=$srcdir ;;
18746   *) # Relative path.
18747     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18748     ac_top_srcdir=$ac_dots$srcdir ;;
18749   esac
18750
18751   case $INSTALL in
18752   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18753   *) ac_INSTALL=$ac_dots$INSTALL ;;
18754   esac
18755
18756   if test x"$ac_file" != x-; then
18757     { echo "$as_me:18757: creating $ac_file" >&5
18758 echo "$as_me: creating $ac_file" >&6;}
18759     rm -f "$ac_file"
18760   fi
18761   # Let's still pretend it is `configure' which instantiates (i.e., don't
18762   # use $as_me), people would be surprised to read:
18763   #    /* config.h.  Generated automatically by config.status.  */
18764   configure_input="Generated automatically from `echo $ac_file_in |
18765                                                  sed 's,.*/,,'` by configure."
18766
18767   # First look for the input files in the build tree, otherwise in the
18768   # src tree.
18769   ac_file_inputs=`IFS=:
18770     for f in $ac_file_in; do
18771       case $f in
18772       -) echo $tmp/stdin ;;
18773       [\\/$]*)
18774          # Absolute (can't be DOS-style, as IFS=:)
18775          test -f "$f" || { { echo "$as_me:18775: error: cannot find input file: $f" >&5
18776 echo "$as_me: error: cannot find input file: $f" >&2;}
18777    { (exit 1); exit 1; }; }
18778          echo $f;;
18779       *) # Relative
18780          if test -f "$f"; then
18781            # Build tree
18782            echo $f
18783          elif test -f "$srcdir/$f"; then
18784            # Source tree
18785            echo $srcdir/$f
18786          else
18787            # /dev/null tree
18788            { { echo "$as_me:18788: error: cannot find input file: $f" >&5
18789 echo "$as_me: error: cannot find input file: $f" >&2;}
18790    { (exit 1); exit 1; }; }
18791          fi;;
18792       esac
18793     done` || { (exit 1); exit 1; }
18794 EOF
18795 cat >>$CONFIG_STATUS <<\EOF
18796   ac_warn_datarootdir=no
18797   if test x"$ac_file" != x-; then
18798     for ac_item in $ac_file_inputs
18799     do
18800       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18801       if test -n "$ac_seen"; then
18802         ac_used=`grep '@datarootdir@' $ac_item`
18803         if test -z "$ac_used"; then
18804           { echo "$as_me:18804: WARNING: datarootdir was used implicitly but not set:
18805 $ac_seen" >&5
18806 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18807 $ac_seen" >&2;}
18808           ac_warn_datarootdir=yes
18809         fi
18810       fi
18811       ac_seen=`grep '${datarootdir}' $ac_item`
18812       if test -n "$ac_seen"; then
18813         { echo "$as_me:18813: WARNING: datarootdir was used explicitly but not set:
18814 $ac_seen" >&5
18815 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18816 $ac_seen" >&2;}
18817         ac_warn_datarootdir=yes
18818       fi
18819     done
18820   fi
18821
18822 if test "x$ac_warn_datarootdir" = xyes; then
18823   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18824 fi
18825
18826 EOF
18827 cat >>$CONFIG_STATUS <<EOF
18828   sed "$ac_vpsub
18829 $extrasub
18830 EOF
18831 cat >>$CONFIG_STATUS <<\EOF
18832 :t
18833 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18834 s,@configure_input@,$configure_input,;t t
18835 s,@srcdir@,$ac_srcdir,;t t
18836 s,@top_srcdir@,$ac_top_srcdir,;t t
18837 s,@INSTALL@,$ac_INSTALL,;t t
18838 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18839   rm -f $tmp/stdin
18840   if test x"$ac_file" != x-; then
18841     cp $tmp/out $ac_file
18842
18843     for ac_name in prefix exec_prefix datarootdir
18844     do
18845         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18846         if test -n "$ac_seen"; then
18847             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18848             if test -z "$ac_init"; then
18849               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18850               { echo "$as_me:18850: WARNING: Variable $ac_name is used but was not set:
18851 $ac_seen" >&5
18852 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18853 $ac_seen" >&2;}
18854             fi
18855         fi
18856     done
18857     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18858     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18859     if test -s $tmp/out; then
18860       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18861       { echo "$as_me:18861: WARNING: Some variables may not be substituted:
18862 $ac_seen" >&5
18863 echo "$as_me: WARNING: Some variables may not be substituted:
18864 $ac_seen" >&2;}
18865     fi
18866   else
18867     cat $tmp/out
18868   fi
18869   rm -f $tmp/out
18870
18871 done
18872 EOF
18873 cat >>$CONFIG_STATUS <<\EOF
18874
18875 #
18876 # CONFIG_HEADER section.
18877 #
18878
18879 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18880 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18881 #
18882 # ac_d sets the value in "#define NAME VALUE" lines.
18883 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18884 ac_dB='[        ].*$,\1#\2'
18885 ac_dC=' '
18886 ac_dD=',;t'
18887 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18888 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18889 ac_iB='\([      ]\),\1#\2define\3'
18890 ac_iC=' '
18891 ac_iD='\4,;t'
18892 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18893 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18894 ac_uB='$,\1#\2define\3'
18895 ac_uC=' '
18896 ac_uD=',;t'
18897
18898 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18899   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18900   case $ac_file in
18901   - | *:- | *:-:* ) # input from stdin
18902         cat >$tmp/stdin
18903         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18904         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18905   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18906         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18907   * )   ac_file_in=$ac_file.in ;;
18908   esac
18909
18910   test x"$ac_file" != x- && { echo "$as_me:18910: creating $ac_file" >&5
18911 echo "$as_me: creating $ac_file" >&6;}
18912
18913   # First look for the input files in the build tree, otherwise in the
18914   # src tree.
18915   ac_file_inputs=`IFS=:
18916     for f in $ac_file_in; do
18917       case $f in
18918       -) echo $tmp/stdin ;;
18919       [\\/$]*)
18920          # Absolute (can't be DOS-style, as IFS=:)
18921          test -f "$f" || { { echo "$as_me:18921: error: cannot find input file: $f" >&5
18922 echo "$as_me: error: cannot find input file: $f" >&2;}
18923    { (exit 1); exit 1; }; }
18924          echo $f;;
18925       *) # Relative
18926          if test -f "$f"; then
18927            # Build tree
18928            echo $f
18929          elif test -f "$srcdir/$f"; then
18930            # Source tree
18931            echo $srcdir/$f
18932          else
18933            # /dev/null tree
18934            { { echo "$as_me:18934: error: cannot find input file: $f" >&5
18935 echo "$as_me: error: cannot find input file: $f" >&2;}
18936    { (exit 1); exit 1; }; }
18937          fi;;
18938       esac
18939     done` || { (exit 1); exit 1; }
18940   # Remove the trailing spaces.
18941   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18942
18943 EOF
18944
18945 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18946 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18947 # be either 'cat' or 'sort'.
18948 cat confdefs.h | uniq >conftest.vals
18949
18950 # Break up conftest.vals because some shells have a limit on
18951 # the size of here documents, and old seds have small limits too.
18952
18953 rm -f conftest.tail
18954 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18955 while grep . conftest.vals >/dev/null
18956 do
18957   # Write chunks of a limited-size here document to conftest.frag.
18958   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18959   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18960   echo 'CEOF' >> $CONFIG_STATUS
18961   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18962   rm -f conftest.vals
18963   mv conftest.tail conftest.vals
18964 done
18965 rm -f conftest.vals
18966
18967 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18968 # marker @DEFS@.
18969 echo '  cat >> conftest.edit <<CEOF
18970 /@DEFS@/r conftest.frag
18971 /@DEFS@/d
18972 CEOF
18973 sed -f conftest.edit $tmp/in > $tmp/out
18974 rm -f $tmp/in
18975 mv $tmp/out $tmp/in
18976 rm -f conftest.edit conftest.frag
18977 ' >> $CONFIG_STATUS
18978
18979 cat >>$CONFIG_STATUS <<\EOF
18980   # Let's still pretend it is `configure' which instantiates (i.e., don't
18981   # use $as_me), people would be surprised to read:
18982   #    /* config.h.  Generated automatically by config.status.  */
18983   if test x"$ac_file" = x-; then
18984     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18985   else
18986     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18987   fi
18988   cat $tmp/in >>$tmp/config.h
18989   rm -f $tmp/in
18990   if test x"$ac_file" != x-; then
18991     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18992       { echo "$as_me:18992: $ac_file is unchanged" >&5
18993 echo "$as_me: $ac_file is unchanged" >&6;}
18994     else
18995       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18996          X"$ac_file" : 'X\(//\)[^/]' \| \
18997          X"$ac_file" : 'X\(//\)$' \| \
18998          X"$ac_file" : 'X\(/\)' \| \
18999          .     : '\(.\)' 2>/dev/null ||
19000 echo X"$ac_file" |
19001     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19002           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19003           /^X\(\/\/\)$/{ s//\1/; q; }
19004           /^X\(\/\).*/{ s//\1/; q; }
19005           s/.*/./; q'`
19006       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19007         { case "$ac_dir" in
19008   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19009   *)                      as_incr_dir=.;;
19010 esac
19011 as_dummy="$ac_dir"
19012 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19013   case $as_mkdir_dir in
19014     # Skip DOS drivespec
19015     ?:) as_incr_dir=$as_mkdir_dir ;;
19016     *)
19017       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19018       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19019     ;;
19020   esac
19021 done; }
19022
19023       fi
19024       rm -f $ac_file
19025       mv $tmp/config.h $ac_file
19026     fi
19027   else
19028     cat $tmp/config.h
19029     rm -f $tmp/config.h
19030   fi
19031 done
19032 EOF
19033 cat >>$CONFIG_STATUS <<\EOF
19034 #
19035 # CONFIG_COMMANDS section.
19036 #
19037 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19038   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19039   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19040
19041   case $ac_dest in
19042     default )
19043
19044 for cf_dir in .
19045 do
19046         if test ! -d $srcdir/$cf_dir; then
19047                 continue
19048         elif test -f $srcdir/$cf_dir/programs; then
19049                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
19050         fi
19051 done
19052
19053         cat >>Makefile <<TEST_EOF
19054
19055 # These rules are generated so we do not rely on suffix rules, which do not
19056 # work consistently for different make-programs (the '\$(MODEL)/' confuses
19057 # some, and the '\$x' confuses others).
19058 TEST_EOF
19059
19060 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
19061 for N in $LIST
19062 do
19063         cat >>Makefile <<TEST_EOF
19064
19065 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
19066         \$(srcdir)/test.priv.h \\
19067         ncurses_cfg.h
19068         $SHOW_CC
19069         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
19070 TEST_EOF
19071 done
19072
19073 if test -f ../config.guess && test -f ../config.sub
19074 then
19075         cat >>Makefile <<TEST_EOF
19076
19077 # if we used CF_INHERIT for getting these files, we can remove them
19078 distclean::
19079         rm -f config.guess config.sub
19080 TEST_EOF
19081 fi
19082  ;;
19083   esac
19084 done
19085 EOF
19086
19087 cat >>$CONFIG_STATUS <<\EOF
19088
19089 { (exit 0); exit 0; }
19090 EOF
19091 chmod +x $CONFIG_STATUS
19092 ac_clean_files=$ac_clean_files_save
19093
19094 # configure is writing to config.log, and then calls config.status.
19095 # config.status does its own redirection, appending to config.log.
19096 # Unfortunately, on DOS this fails, as config.log is still kept open
19097 # by configure, so config.status won't be able to write to it; its
19098 # output is simply discarded.  So we exec the FD to /dev/null,
19099 # effectively closing config.log, so it can be properly (re)opened and
19100 # appended to by config.status.  When coming back to configure, we
19101 # need to make the FD available again.
19102 if test "$no_create" != yes; then
19103   ac_cs_success=:
19104   exec 5>/dev/null
19105   $SHELL $CONFIG_STATUS || ac_cs_success=false
19106   exec 5>>config.log
19107   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19108   # would make configure fail if this is the last instruction.
19109   $ac_cs_success || { (exit 1); exit 1; }
19110 fi
19111