]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.0 - patch 20170318
[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 Features:
650   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
651   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
652
653 Optional Packages:
654   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
655   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
656
657   --enable-string-hacks   work around bogus compiler/loader warnings
658 General Options:
659   --with-pkg-config{=path} enable/disable use of pkg-config
660   --disable-echo          do not display "compiling" commands
661 Curses Version-dependent Options:
662   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
663   --disable-widec         disable checks for wide-character functions
664   --with-curses-dir=DIR   directory in which (n)curses is installed
665   --with-screen=XXX       use specified curses-libraries
666   --with-ncursesw         use wide ncurses-libraries
667   --with-ncurses          use ncurses-libraries
668   --with-pdcurses         compile/link with pdcurses X11 library
669   --with-curses-colr      compile/link with HPUX 10.x color-curses
670   --with-curses-5lib      compile/link with SunOS 5lib curses
671   --with-Xaw3d            link with Xaw 3d library
672   --with-Xaw3dxft         link with Xaw 3d xft library
673   --with-neXtaw           link with neXT Athena library
674   --with-XawPlus          link with Athena-Plus library
675   --with-x                use the X Window System
676 Testing/development Options:
677   --enable-warnings       test: turn on gcc compiler warnings
678   --with-dmalloc          test: use Gray Watson's dmalloc library
679   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
680   --with-valgrind         test: use valgrind
681   --disable-leaks         test: free permanent memory, analyze leaks
682   --disable-rpath-hack    don't add rpath options for additional libraries
683
684 Some influential environment variables:
685   CC          C compiler command
686   CFLAGS      C compiler flags
687   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
688               nonstandard directory <lib dir>
689   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
690               headers in a nonstandard directory <include dir>
691   CPP         C preprocessor
692
693 Use these variables to override the choices made by `configure' or to help
694 it to find libraries and programs with nonstandard names/locations.
695
696 EOF
697 fi
698
699 if test "$ac_init_help" = "recursive"; then
700   # If there are subdirs, report their specific --help.
701   ac_popdir=`pwd`
702   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
703     cd $ac_subdir
704     # A "../" for each directory in /$ac_subdir.
705     ac_dots=`echo $ac_subdir |
706              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
707
708     case $srcdir in
709     .) # No --srcdir option.  We are building in place.
710       ac_sub_srcdir=$srcdir ;;
711     [\\/]* | ?:[\\/]* ) # Absolute path.
712       ac_sub_srcdir=$srcdir/$ac_subdir ;;
713     *) # Relative path.
714       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
715     esac
716
717     # Check for guested configure; otherwise get Cygnus style configure.
718     if test -f $ac_sub_srcdir/configure.gnu; then
719       echo
720       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
721     elif test -f $ac_sub_srcdir/configure; then
722       echo
723       $SHELL $ac_sub_srcdir/configure  --help=recursive
724     elif test -f $ac_sub_srcdir/configure.ac ||
725            test -f $ac_sub_srcdir/configure.in; then
726       echo
727       $ac_configure --help
728     else
729       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
730     fi
731     cd $ac_popdir
732   done
733 fi
734
735 test -n "$ac_init_help" && exit 0
736 if $ac_init_version; then
737   cat <<\EOF
738
739 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
740 Free Software Foundation, Inc.
741 This configure script is free software; the Free Software Foundation
742 gives unlimited permission to copy, distribute and modify it.
743 EOF
744   exit 0
745 fi
746 exec 5>config.log
747 cat >&5 <<EOF
748 This file contains any messages produced by compilers while
749 running configure, to aid debugging if configure makes a mistake.
750
751 It was created by $as_me, which was
752 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
753
754   $ $0 $@
755
756 EOF
757 {
758 cat <<_ASUNAME
759 ## ---------- ##
760 ## Platform.  ##
761 ## ---------- ##
762
763 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
764 uname -m = `(uname -m) 2>/dev/null || echo unknown`
765 uname -r = `(uname -r) 2>/dev/null || echo unknown`
766 uname -s = `(uname -s) 2>/dev/null || echo unknown`
767 uname -v = `(uname -v) 2>/dev/null || echo unknown`
768
769 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
770 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
771
772 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
773 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
774 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
775 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
776 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
777 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
778 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
779
780 PATH = $PATH
781
782 _ASUNAME
783 } >&5
784
785 cat >&5 <<EOF
786 ## ------------ ##
787 ## Core tests.  ##
788 ## ------------ ##
789
790 EOF
791
792 # Keep a trace of the command line.
793 # Strip out --no-create and --no-recursion so they do not pile up.
794 # Also quote any args containing shell meta-characters.
795 ac_configure_args=
796 ac_sep=
797 for ac_arg
798 do
799   case $ac_arg in
800   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
801   | --no-cr | --no-c) ;;
802   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
803   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
804   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
805     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
806     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
807     ac_sep=" " ;;
808   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
809      ac_sep=" " ;;
810   esac
811   # Get rid of the leading space.
812 done
813
814 # When interrupted or exit'd, cleanup temporary files, and complete
815 # config.log.  We remove comments because anyway the quotes in there
816 # would cause problems or look ugly.
817 trap 'exit_status=$?
818   # Save into config.log some information that might help in debugging.
819   echo >&5
820   echo "## ----------------- ##" >&5
821   echo "## Cache variables.  ##" >&5
822   echo "## ----------------- ##" >&5
823   echo >&5
824   # The following way of writing the cache mishandles newlines in values,
825 {
826   (set) 2>&1 |
827     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
828     *ac_space=\ *)
829       sed -n \
830         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
831           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
832       ;;
833     *)
834       sed -n \
835         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
836       ;;
837     esac;
838 } >&5
839   sed "/^$/d" confdefs.h >conftest.log
840   if test -s conftest.log; then
841     echo >&5
842     echo "## ------------ ##" >&5
843     echo "## confdefs.h.  ##" >&5
844     echo "## ------------ ##" >&5
845     echo >&5
846     cat conftest.log >&5
847   fi
848   (echo; echo) >&5
849   test "$ac_signal" != 0 &&
850     echo "$as_me: caught signal $ac_signal" >&5
851   echo "$as_me: exit $exit_status" >&5
852   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
853     exit $exit_status
854      ' 0
855 for ac_signal in 1 2 13 15; do
856   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
857 done
858 ac_signal=0
859
860 # confdefs.h avoids OS command line length limits that DEFS can exceed.
861 rm -rf conftest* confdefs.h
862 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
863 echo >confdefs.h
864
865 # Let the site file select an alternate cache file if it wants to.
866 # Prefer explicitly selected file to automatically selected ones.
867 if test -z "$CONFIG_SITE"; then
868   if test "x$prefix" != xNONE; then
869     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
870   else
871     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
872   fi
873 fi
874 for ac_site_file in $CONFIG_SITE; do
875   if test -r "$ac_site_file"; then
876     { echo "$as_me:876: loading site script $ac_site_file" >&5
877 echo "$as_me: loading site script $ac_site_file" >&6;}
878     cat "$ac_site_file" >&5
879     . "$ac_site_file"
880   fi
881 done
882
883 if test -r "$cache_file"; then
884   # Some versions of bash will fail to source /dev/null (special
885   # files actually), so we avoid doing that.
886   if test -f "$cache_file"; then
887     { echo "$as_me:887: loading cache $cache_file" >&5
888 echo "$as_me: loading cache $cache_file" >&6;}
889     case $cache_file in
890       [\\/]* | ?:[\\/]* ) . $cache_file;;
891       *)                      . ./$cache_file;;
892     esac
893   fi
894 else
895   { echo "$as_me:895: creating cache $cache_file" >&5
896 echo "$as_me: creating cache $cache_file" >&6;}
897   >$cache_file
898 fi
899
900 # Check that the precious variables saved in the cache have kept the same
901 # value.
902 ac_cache_corrupted=false
903 for ac_var in `(set) 2>&1 |
904                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
905   eval ac_old_set=\$ac_cv_env_${ac_var}_set
906   eval ac_new_set=\$ac_env_${ac_var}_set
907   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
908   eval ac_new_val="\$ac_env_${ac_var}_value"
909   case $ac_old_set,$ac_new_set in
910     set,)
911       { echo "$as_me:911: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
912 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
913       ac_cache_corrupted=: ;;
914     ,set)
915       { echo "$as_me:915: error: \`$ac_var' was not set in the previous run" >&5
916 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
917       ac_cache_corrupted=: ;;
918     ,);;
919     *)
920       if test "x$ac_old_val" != "x$ac_new_val"; then
921         { echo "$as_me:921: error: \`$ac_var' has changed since the previous run:" >&5
922 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
923         { echo "$as_me:923:   former value:  $ac_old_val" >&5
924 echo "$as_me:   former value:  $ac_old_val" >&2;}
925         { echo "$as_me:925:   current value: $ac_new_val" >&5
926 echo "$as_me:   current value: $ac_new_val" >&2;}
927         ac_cache_corrupted=:
928       fi;;
929   esac
930   # Pass precious variables to config.status.  It doesn't matter if
931   # we pass some twice (in addition to the command line arguments).
932   if test "$ac_new_set" = set; then
933     case $ac_new_val in
934     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
935       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
936       ac_configure_args="$ac_configure_args '$ac_arg'"
937       ;;
938     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
939        ;;
940     esac
941   fi
942 done
943 if $ac_cache_corrupted; then
944   { echo "$as_me:944: error: changes in the environment can compromise the build" >&5
945 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
946   { { echo "$as_me:946: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
947 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
948    { (exit 1); exit 1; }; }
949 fi
950
951 ac_ext=c
952 ac_cpp='$CPP $CPPFLAGS'
953 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
954 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
955 ac_compiler_gnu=$ac_cv_c_compiler_gnu
956 ac_main_return=return
957
958 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
959   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
960                    ECHO_T='     ' ;;
961   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
962   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
963 esac
964 echo "#! $SHELL" >conftest.sh
965 echo  "exit 0"   >>conftest.sh
966 chmod +x conftest.sh
967 if { (echo "$as_me:967: PATH=\".;.\"; conftest.sh") >&5
968   (PATH=".;."; conftest.sh) 2>&5
969   ac_status=$?
970   echo "$as_me:970: \$? = $ac_status" >&5
971   (exit $ac_status); }; then
972   ac_path_separator=';'
973 else
974   ac_path_separator=:
975 fi
976 PATH_SEPARATOR="$ac_path_separator"
977 rm -f conftest.sh
978
979 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
980
981 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
982
983 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
984
985 ac_aux_dir=
986 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
987   if test -f $ac_dir/install-sh; then
988     ac_aux_dir=$ac_dir
989     ac_install_sh="$ac_aux_dir/install-sh -c"
990     break
991   elif test -f $ac_dir/install.sh; then
992     ac_aux_dir=$ac_dir
993     ac_install_sh="$ac_aux_dir/install.sh -c"
994     break
995   elif test -f $ac_dir/shtool; then
996     ac_aux_dir=$ac_dir
997     ac_install_sh="$ac_aux_dir/shtool install -c"
998     break
999   fi
1000 done
1001 if test -z "$ac_aux_dir"; then
1002   { { echo "$as_me:1002: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1003 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1004    { (exit 1); exit 1; }; }
1005 fi
1006 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1007 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1008 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1009
1010 # Make sure we can run config.sub.
1011 $ac_config_sub sun4 >/dev/null 2>&1 ||
1012   { { echo "$as_me:1012: error: cannot run $ac_config_sub" >&5
1013 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1014    { (exit 1); exit 1; }; }
1015
1016 echo "$as_me:1016: checking build system type" >&5
1017 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1018 if test "${ac_cv_build+set}" = set; then
1019   echo $ECHO_N "(cached) $ECHO_C" >&6
1020 else
1021   ac_cv_build_alias=$build_alias
1022 test -z "$ac_cv_build_alias" &&
1023   ac_cv_build_alias=`$ac_config_guess`
1024 test -z "$ac_cv_build_alias" &&
1025   { { echo "$as_me:1025: error: cannot guess build type; you must specify one" >&5
1026 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1027    { (exit 1); exit 1; }; }
1028 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1029   { { echo "$as_me:1029: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1030 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1031    { (exit 1); exit 1; }; }
1032
1033 fi
1034 echo "$as_me:1034: result: $ac_cv_build" >&5
1035 echo "${ECHO_T}$ac_cv_build" >&6
1036 build=$ac_cv_build
1037 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1038 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1039 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1040
1041 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1042         echo "$as_me:1042: checking host system type" >&5
1043 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1044 if test "${ac_cv_host+set}" = set; then
1045   echo $ECHO_N "(cached) $ECHO_C" >&6
1046 else
1047   ac_cv_host_alias=$host_alias
1048 test -z "$ac_cv_host_alias" &&
1049   ac_cv_host_alias=$ac_cv_build_alias
1050 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1051   { { echo "$as_me:1051: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1052 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1053    { (exit 1); exit 1; }; }
1054
1055 fi
1056 echo "$as_me:1056: result: $ac_cv_host" >&5
1057 echo "${ECHO_T}$ac_cv_host" >&6
1058 host=$ac_cv_host
1059 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1060 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1061 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1062
1063         system_name="$host_os"
1064 else
1065         system_name="`(uname -s -r) 2>/dev/null`"
1066         if test -z "$system_name" ; then
1067                 system_name="`(hostname) 2>/dev/null`"
1068         fi
1069 fi
1070 test -n "$system_name" &&
1071 cat >>confdefs.h <<EOF
1072 #define SYSTEM_NAME "$system_name"
1073 EOF
1074
1075 if test "${cf_cv_system_name+set}" = set; then
1076   echo $ECHO_N "(cached) $ECHO_C" >&6
1077 else
1078   cf_cv_system_name="$system_name"
1079 fi
1080
1081 test -z "$system_name" && system_name="$cf_cv_system_name"
1082 test -n "$cf_cv_system_name" && echo "$as_me:1082: result: Configuring for $cf_cv_system_name" >&5
1083 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1084
1085 if test ".$system_name" != ".$cf_cv_system_name" ; then
1086         echo "$as_me:1086: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1087 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1088         { { echo "$as_me:1088: error: \"Please remove config.cache and try again.\"" >&5
1089 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1090    { (exit 1); exit 1; }; }
1091 fi
1092
1093 test "$program_prefix" != NONE &&
1094   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1095 # Use a double $ so make ignores it.
1096 test "$program_suffix" != NONE &&
1097   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1098 # Double any \ or $.  echo might interpret backslashes.
1099 # By default was `s,x,x', remove it if useless.
1100 cat <<\_ACEOF >conftest.sed
1101 s/[\\$]/&&/g;s/;s,x,x,$//
1102 _ACEOF
1103 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1104 rm conftest.sed
1105
1106 echo "$as_me:1106: checking whether ${MAKE-make} sets \${MAKE}" >&5
1107 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1108 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1109 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1110   echo $ECHO_N "(cached) $ECHO_C" >&6
1111 else
1112   cat >conftest.make <<\EOF
1113 all:
1114         @echo 'ac_maketemp="${MAKE}"'
1115 EOF
1116 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1117 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1118 if test -n "$ac_maketemp"; then
1119   eval ac_cv_prog_make_${ac_make}_set=yes
1120 else
1121   eval ac_cv_prog_make_${ac_make}_set=no
1122 fi
1123 rm -f conftest.make
1124 fi
1125 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1126   echo "$as_me:1126: result: yes" >&5
1127 echo "${ECHO_T}yes" >&6
1128   SET_MAKE=
1129 else
1130   echo "$as_me:1130: result: no" >&5
1131 echo "${ECHO_T}no" >&6
1132   SET_MAKE="MAKE=${MAKE-make}"
1133 fi
1134
1135 ac_ext=c
1136 ac_cpp='$CPP $CPPFLAGS'
1137 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1138 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1139 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1140 ac_main_return=return
1141 if test -n "$ac_tool_prefix"; then
1142   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1143 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1144 echo "$as_me:1144: checking for $ac_word" >&5
1145 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1146 if test "${ac_cv_prog_CC+set}" = set; then
1147   echo $ECHO_N "(cached) $ECHO_C" >&6
1148 else
1149   if test -n "$CC"; then
1150   ac_cv_prog_CC="$CC" # Let the user override the test.
1151 else
1152   ac_save_IFS=$IFS; IFS=$ac_path_separator
1153 ac_dummy="$PATH"
1154 for ac_dir in $ac_dummy; do
1155   IFS=$ac_save_IFS
1156   test -z "$ac_dir" && ac_dir=.
1157   $as_executable_p "$ac_dir/$ac_word" || continue
1158 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1159 echo "$as_me:1159: found $ac_dir/$ac_word" >&5
1160 break
1161 done
1162
1163 fi
1164 fi
1165 CC=$ac_cv_prog_CC
1166 if test -n "$CC"; then
1167   echo "$as_me:1167: result: $CC" >&5
1168 echo "${ECHO_T}$CC" >&6
1169 else
1170   echo "$as_me:1170: result: no" >&5
1171 echo "${ECHO_T}no" >&6
1172 fi
1173
1174 fi
1175 if test -z "$ac_cv_prog_CC"; then
1176   ac_ct_CC=$CC
1177   # Extract the first word of "gcc", so it can be a program name with args.
1178 set dummy gcc; ac_word=$2
1179 echo "$as_me:1179: checking for $ac_word" >&5
1180 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1181 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   if test -n "$ac_ct_CC"; then
1185   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1186 else
1187   ac_save_IFS=$IFS; IFS=$ac_path_separator
1188 ac_dummy="$PATH"
1189 for ac_dir in $ac_dummy; do
1190   IFS=$ac_save_IFS
1191   test -z "$ac_dir" && ac_dir=.
1192   $as_executable_p "$ac_dir/$ac_word" || continue
1193 ac_cv_prog_ac_ct_CC="gcc"
1194 echo "$as_me:1194: found $ac_dir/$ac_word" >&5
1195 break
1196 done
1197
1198 fi
1199 fi
1200 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1201 if test -n "$ac_ct_CC"; then
1202   echo "$as_me:1202: result: $ac_ct_CC" >&5
1203 echo "${ECHO_T}$ac_ct_CC" >&6
1204 else
1205   echo "$as_me:1205: result: no" >&5
1206 echo "${ECHO_T}no" >&6
1207 fi
1208
1209   CC=$ac_ct_CC
1210 else
1211   CC="$ac_cv_prog_CC"
1212 fi
1213
1214 if test -z "$CC"; then
1215   if test -n "$ac_tool_prefix"; then
1216   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1217 set dummy ${ac_tool_prefix}cc; ac_word=$2
1218 echo "$as_me:1218: checking for $ac_word" >&5
1219 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1220 if test "${ac_cv_prog_CC+set}" = set; then
1221   echo $ECHO_N "(cached) $ECHO_C" >&6
1222 else
1223   if test -n "$CC"; then
1224   ac_cv_prog_CC="$CC" # Let the user override the test.
1225 else
1226   ac_save_IFS=$IFS; IFS=$ac_path_separator
1227 ac_dummy="$PATH"
1228 for ac_dir in $ac_dummy; do
1229   IFS=$ac_save_IFS
1230   test -z "$ac_dir" && ac_dir=.
1231   $as_executable_p "$ac_dir/$ac_word" || continue
1232 ac_cv_prog_CC="${ac_tool_prefix}cc"
1233 echo "$as_me:1233: found $ac_dir/$ac_word" >&5
1234 break
1235 done
1236
1237 fi
1238 fi
1239 CC=$ac_cv_prog_CC
1240 if test -n "$CC"; then
1241   echo "$as_me:1241: result: $CC" >&5
1242 echo "${ECHO_T}$CC" >&6
1243 else
1244   echo "$as_me:1244: result: no" >&5
1245 echo "${ECHO_T}no" >&6
1246 fi
1247
1248 fi
1249 if test -z "$ac_cv_prog_CC"; then
1250   ac_ct_CC=$CC
1251   # Extract the first word of "cc", so it can be a program name with args.
1252 set dummy cc; ac_word=$2
1253 echo "$as_me:1253: checking for $ac_word" >&5
1254 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1255 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1256   echo $ECHO_N "(cached) $ECHO_C" >&6
1257 else
1258   if test -n "$ac_ct_CC"; then
1259   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1260 else
1261   ac_save_IFS=$IFS; IFS=$ac_path_separator
1262 ac_dummy="$PATH"
1263 for ac_dir in $ac_dummy; do
1264   IFS=$ac_save_IFS
1265   test -z "$ac_dir" && ac_dir=.
1266   $as_executable_p "$ac_dir/$ac_word" || continue
1267 ac_cv_prog_ac_ct_CC="cc"
1268 echo "$as_me:1268: found $ac_dir/$ac_word" >&5
1269 break
1270 done
1271
1272 fi
1273 fi
1274 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1275 if test -n "$ac_ct_CC"; then
1276   echo "$as_me:1276: result: $ac_ct_CC" >&5
1277 echo "${ECHO_T}$ac_ct_CC" >&6
1278 else
1279   echo "$as_me:1279: result: no" >&5
1280 echo "${ECHO_T}no" >&6
1281 fi
1282
1283   CC=$ac_ct_CC
1284 else
1285   CC="$ac_cv_prog_CC"
1286 fi
1287
1288 fi
1289 if test -z "$CC"; then
1290   # Extract the first word of "cc", so it can be a program name with args.
1291 set dummy cc; ac_word=$2
1292 echo "$as_me:1292: checking for $ac_word" >&5
1293 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1294 if test "${ac_cv_prog_CC+set}" = set; then
1295   echo $ECHO_N "(cached) $ECHO_C" >&6
1296 else
1297   if test -n "$CC"; then
1298   ac_cv_prog_CC="$CC" # Let the user override the test.
1299 else
1300   ac_prog_rejected=no
1301   ac_save_IFS=$IFS; IFS=$ac_path_separator
1302 ac_dummy="$PATH"
1303 for ac_dir in $ac_dummy; do
1304   IFS=$ac_save_IFS
1305   test -z "$ac_dir" && ac_dir=.
1306   $as_executable_p "$ac_dir/$ac_word" || continue
1307 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1308   ac_prog_rejected=yes
1309   continue
1310 fi
1311 ac_cv_prog_CC="cc"
1312 echo "$as_me:1312: found $ac_dir/$ac_word" >&5
1313 break
1314 done
1315
1316 if test $ac_prog_rejected = yes; then
1317   # We found a bogon in the path, so make sure we never use it.
1318   set dummy $ac_cv_prog_CC
1319   shift
1320   if test $# != 0; then
1321     # We chose a different compiler from the bogus one.
1322     # However, it has the same basename, so the bogon will be chosen
1323     # first if we set CC to just the basename; use the full file name.
1324     shift
1325     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1326     shift
1327     ac_cv_prog_CC="$@"
1328   fi
1329 fi
1330 fi
1331 fi
1332 CC=$ac_cv_prog_CC
1333 if test -n "$CC"; then
1334   echo "$as_me:1334: result: $CC" >&5
1335 echo "${ECHO_T}$CC" >&6
1336 else
1337   echo "$as_me:1337: result: no" >&5
1338 echo "${ECHO_T}no" >&6
1339 fi
1340
1341 fi
1342 if test -z "$CC"; then
1343   if test -n "$ac_tool_prefix"; then
1344   for ac_prog in cl
1345   do
1346     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1347 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1348 echo "$as_me:1348: checking for $ac_word" >&5
1349 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1350 if test "${ac_cv_prog_CC+set}" = set; then
1351   echo $ECHO_N "(cached) $ECHO_C" >&6
1352 else
1353   if test -n "$CC"; then
1354   ac_cv_prog_CC="$CC" # Let the user override the test.
1355 else
1356   ac_save_IFS=$IFS; IFS=$ac_path_separator
1357 ac_dummy="$PATH"
1358 for ac_dir in $ac_dummy; do
1359   IFS=$ac_save_IFS
1360   test -z "$ac_dir" && ac_dir=.
1361   $as_executable_p "$ac_dir/$ac_word" || continue
1362 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1363 echo "$as_me:1363: found $ac_dir/$ac_word" >&5
1364 break
1365 done
1366
1367 fi
1368 fi
1369 CC=$ac_cv_prog_CC
1370 if test -n "$CC"; then
1371   echo "$as_me:1371: result: $CC" >&5
1372 echo "${ECHO_T}$CC" >&6
1373 else
1374   echo "$as_me:1374: result: no" >&5
1375 echo "${ECHO_T}no" >&6
1376 fi
1377
1378     test -n "$CC" && break
1379   done
1380 fi
1381 if test -z "$CC"; then
1382   ac_ct_CC=$CC
1383   for ac_prog in cl
1384 do
1385   # Extract the first word of "$ac_prog", so it can be a program name with args.
1386 set dummy $ac_prog; ac_word=$2
1387 echo "$as_me:1387: checking for $ac_word" >&5
1388 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1389 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1390   echo $ECHO_N "(cached) $ECHO_C" >&6
1391 else
1392   if test -n "$ac_ct_CC"; then
1393   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1394 else
1395   ac_save_IFS=$IFS; IFS=$ac_path_separator
1396 ac_dummy="$PATH"
1397 for ac_dir in $ac_dummy; do
1398   IFS=$ac_save_IFS
1399   test -z "$ac_dir" && ac_dir=.
1400   $as_executable_p "$ac_dir/$ac_word" || continue
1401 ac_cv_prog_ac_ct_CC="$ac_prog"
1402 echo "$as_me:1402: found $ac_dir/$ac_word" >&5
1403 break
1404 done
1405
1406 fi
1407 fi
1408 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1409 if test -n "$ac_ct_CC"; then
1410   echo "$as_me:1410: result: $ac_ct_CC" >&5
1411 echo "${ECHO_T}$ac_ct_CC" >&6
1412 else
1413   echo "$as_me:1413: result: no" >&5
1414 echo "${ECHO_T}no" >&6
1415 fi
1416
1417   test -n "$ac_ct_CC" && break
1418 done
1419
1420   CC=$ac_ct_CC
1421 fi
1422
1423 fi
1424
1425 test -z "$CC" && { { echo "$as_me:1425: error: no acceptable cc found in \$PATH" >&5
1426 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1427    { (exit 1); exit 1; }; }
1428
1429 # Provide some information about the compiler.
1430 echo "$as_me:1430:" \
1431      "checking for C compiler version" >&5
1432 ac_compiler=`set X $ac_compile; echo $2`
1433 { (eval echo "$as_me:1433: \"$ac_compiler --version </dev/null >&5\"") >&5
1434   (eval $ac_compiler --version </dev/null >&5) 2>&5
1435   ac_status=$?
1436   echo "$as_me:1436: \$? = $ac_status" >&5
1437   (exit $ac_status); }
1438 { (eval echo "$as_me:1438: \"$ac_compiler -v </dev/null >&5\"") >&5
1439   (eval $ac_compiler -v </dev/null >&5) 2>&5
1440   ac_status=$?
1441   echo "$as_me:1441: \$? = $ac_status" >&5
1442   (exit $ac_status); }
1443 { (eval echo "$as_me:1443: \"$ac_compiler -V </dev/null >&5\"") >&5
1444   (eval $ac_compiler -V </dev/null >&5) 2>&5
1445   ac_status=$?
1446   echo "$as_me:1446: \$? = $ac_status" >&5
1447   (exit $ac_status); }
1448
1449 cat >conftest.$ac_ext <<_ACEOF
1450 #line 1450 "configure"
1451 #include "confdefs.h"
1452
1453 int
1454 main ()
1455 {
1456
1457   ;
1458   return 0;
1459 }
1460 _ACEOF
1461 ac_clean_files_save=$ac_clean_files
1462 ac_clean_files="$ac_clean_files a.out a.exe"
1463 # Try to create an executable without -o first, disregard a.out.
1464 # It will help us diagnose broken compilers, and finding out an intuition
1465 # of exeext.
1466 echo "$as_me:1466: checking for C compiler default output" >&5
1467 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1468 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1469 if { (eval echo "$as_me:1469: \"$ac_link_default\"") >&5
1470   (eval $ac_link_default) 2>&5
1471   ac_status=$?
1472   echo "$as_me:1472: \$? = $ac_status" >&5
1473   (exit $ac_status); }; then
1474   # Find the output, starting from the most likely.  This scheme is
1475 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1476 # resort.
1477 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1478                 ls a.out conftest 2>/dev/null;
1479                 ls a.* conftest.* 2>/dev/null`; do
1480   case $ac_file in
1481     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1482     a.out ) # We found the default executable, but exeext='' is most
1483             # certainly right.
1484             break;;
1485     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1486           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1487           export ac_cv_exeext
1488           break;;
1489     * ) break;;
1490   esac
1491 done
1492 else
1493   echo "$as_me: failed program was:" >&5
1494 cat conftest.$ac_ext >&5
1495 { { echo "$as_me:1495: error: C compiler cannot create executables" >&5
1496 echo "$as_me: error: C compiler cannot create executables" >&2;}
1497    { (exit 77); exit 77; }; }
1498 fi
1499
1500 ac_exeext=$ac_cv_exeext
1501 echo "$as_me:1501: result: $ac_file" >&5
1502 echo "${ECHO_T}$ac_file" >&6
1503
1504 # Check the compiler produces executables we can run.  If not, either
1505 # the compiler is broken, or we cross compile.
1506 echo "$as_me:1506: checking whether the C compiler works" >&5
1507 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1508 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1509 # If not cross compiling, check that we can run a simple program.
1510 if test "$cross_compiling" != yes; then
1511   if { ac_try='./$ac_file'
1512   { (eval echo "$as_me:1512: \"$ac_try\"") >&5
1513   (eval $ac_try) 2>&5
1514   ac_status=$?
1515   echo "$as_me:1515: \$? = $ac_status" >&5
1516   (exit $ac_status); }; }; then
1517     cross_compiling=no
1518   else
1519     if test "$cross_compiling" = maybe; then
1520         cross_compiling=yes
1521     else
1522         { { echo "$as_me:1522: error: cannot run C compiled programs.
1523 If you meant to cross compile, use \`--host'." >&5
1524 echo "$as_me: error: cannot run C compiled programs.
1525 If you meant to cross compile, use \`--host'." >&2;}
1526    { (exit 1); exit 1; }; }
1527     fi
1528   fi
1529 fi
1530 echo "$as_me:1530: result: yes" >&5
1531 echo "${ECHO_T}yes" >&6
1532
1533 rm -f a.out a.exe conftest$ac_cv_exeext
1534 ac_clean_files=$ac_clean_files_save
1535 # Check the compiler produces executables we can run.  If not, either
1536 # the compiler is broken, or we cross compile.
1537 echo "$as_me:1537: checking whether we are cross compiling" >&5
1538 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1539 echo "$as_me:1539: result: $cross_compiling" >&5
1540 echo "${ECHO_T}$cross_compiling" >&6
1541
1542 echo "$as_me:1542: checking for executable suffix" >&5
1543 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1544 if { (eval echo "$as_me:1544: \"$ac_link\"") >&5
1545   (eval $ac_link) 2>&5
1546   ac_status=$?
1547   echo "$as_me:1547: \$? = $ac_status" >&5
1548   (exit $ac_status); }; then
1549   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1550 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1551 # work properly (i.e., refer to `conftest.exe'), while it won't with
1552 # `rm'.
1553 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1554   case $ac_file in
1555     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1556     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1557           export ac_cv_exeext
1558           break;;
1559     * ) break;;
1560   esac
1561 done
1562 else
1563   { { echo "$as_me:1563: error: cannot compute EXEEXT: cannot compile and link" >&5
1564 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1565    { (exit 1); exit 1; }; }
1566 fi
1567
1568 rm -f conftest$ac_cv_exeext
1569 echo "$as_me:1569: result: $ac_cv_exeext" >&5
1570 echo "${ECHO_T}$ac_cv_exeext" >&6
1571
1572 rm -f conftest.$ac_ext
1573 EXEEXT=$ac_cv_exeext
1574 ac_exeext=$EXEEXT
1575 echo "$as_me:1575: checking for object suffix" >&5
1576 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1577 if test "${ac_cv_objext+set}" = set; then
1578   echo $ECHO_N "(cached) $ECHO_C" >&6
1579 else
1580   cat >conftest.$ac_ext <<_ACEOF
1581 #line 1581 "configure"
1582 #include "confdefs.h"
1583
1584 int
1585 main ()
1586 {
1587
1588   ;
1589   return 0;
1590 }
1591 _ACEOF
1592 rm -f conftest.o conftest.obj
1593 if { (eval echo "$as_me:1593: \"$ac_compile\"") >&5
1594   (eval $ac_compile) 2>&5
1595   ac_status=$?
1596   echo "$as_me:1596: \$? = $ac_status" >&5
1597   (exit $ac_status); }; then
1598   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1599   case $ac_file in
1600     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1601     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1602        break;;
1603   esac
1604 done
1605 else
1606   echo "$as_me: failed program was:" >&5
1607 cat conftest.$ac_ext >&5
1608 { { echo "$as_me:1608: error: cannot compute OBJEXT: cannot compile" >&5
1609 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1610    { (exit 1); exit 1; }; }
1611 fi
1612
1613 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1614 fi
1615 echo "$as_me:1615: result: $ac_cv_objext" >&5
1616 echo "${ECHO_T}$ac_cv_objext" >&6
1617 OBJEXT=$ac_cv_objext
1618 ac_objext=$OBJEXT
1619 echo "$as_me:1619: checking whether we are using the GNU C compiler" >&5
1620 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1621 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1622   echo $ECHO_N "(cached) $ECHO_C" >&6
1623 else
1624   cat >conftest.$ac_ext <<_ACEOF
1625 #line 1625 "configure"
1626 #include "confdefs.h"
1627
1628 int
1629 main ()
1630 {
1631 #ifndef __GNUC__
1632        choke me
1633 #endif
1634
1635   ;
1636   return 0;
1637 }
1638 _ACEOF
1639 rm -f conftest.$ac_objext
1640 if { (eval echo "$as_me:1640: \"$ac_compile\"") >&5
1641   (eval $ac_compile) 2>&5
1642   ac_status=$?
1643   echo "$as_me:1643: \$? = $ac_status" >&5
1644   (exit $ac_status); } &&
1645          { ac_try='test -s conftest.$ac_objext'
1646   { (eval echo "$as_me:1646: \"$ac_try\"") >&5
1647   (eval $ac_try) 2>&5
1648   ac_status=$?
1649   echo "$as_me:1649: \$? = $ac_status" >&5
1650   (exit $ac_status); }; }; then
1651   ac_compiler_gnu=yes
1652 else
1653   echo "$as_me: failed program was:" >&5
1654 cat conftest.$ac_ext >&5
1655 ac_compiler_gnu=no
1656 fi
1657 rm -f conftest.$ac_objext conftest.$ac_ext
1658 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1659
1660 fi
1661 echo "$as_me:1661: result: $ac_cv_c_compiler_gnu" >&5
1662 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1663 GCC=`test $ac_compiler_gnu = yes && echo yes`
1664 ac_test_CFLAGS=${CFLAGS+set}
1665 ac_save_CFLAGS=$CFLAGS
1666 CFLAGS="-g"
1667 echo "$as_me:1667: checking whether $CC accepts -g" >&5
1668 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1669 if test "${ac_cv_prog_cc_g+set}" = set; then
1670   echo $ECHO_N "(cached) $ECHO_C" >&6
1671 else
1672   cat >conftest.$ac_ext <<_ACEOF
1673 #line 1673 "configure"
1674 #include "confdefs.h"
1675
1676 int
1677 main ()
1678 {
1679
1680   ;
1681   return 0;
1682 }
1683 _ACEOF
1684 rm -f conftest.$ac_objext
1685 if { (eval echo "$as_me:1685: \"$ac_compile\"") >&5
1686   (eval $ac_compile) 2>&5
1687   ac_status=$?
1688   echo "$as_me:1688: \$? = $ac_status" >&5
1689   (exit $ac_status); } &&
1690          { ac_try='test -s conftest.$ac_objext'
1691   { (eval echo "$as_me:1691: \"$ac_try\"") >&5
1692   (eval $ac_try) 2>&5
1693   ac_status=$?
1694   echo "$as_me:1694: \$? = $ac_status" >&5
1695   (exit $ac_status); }; }; then
1696   ac_cv_prog_cc_g=yes
1697 else
1698   echo "$as_me: failed program was:" >&5
1699 cat conftest.$ac_ext >&5
1700 ac_cv_prog_cc_g=no
1701 fi
1702 rm -f conftest.$ac_objext conftest.$ac_ext
1703 fi
1704 echo "$as_me:1704: result: $ac_cv_prog_cc_g" >&5
1705 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1706 if test "$ac_test_CFLAGS" = set; then
1707   CFLAGS=$ac_save_CFLAGS
1708 elif test $ac_cv_prog_cc_g = yes; then
1709   if test "$GCC" = yes; then
1710     CFLAGS="-g -O2"
1711   else
1712     CFLAGS="-g"
1713   fi
1714 else
1715   if test "$GCC" = yes; then
1716     CFLAGS="-O2"
1717   else
1718     CFLAGS=
1719   fi
1720 fi
1721 # Some people use a C++ compiler to compile C.  Since we use `exit',
1722 # in C++ we need to declare it.  In case someone uses the same compiler
1723 # for both compiling C and C++ we need to have the C++ compiler decide
1724 # the declaration of exit, since it's the most demanding environment.
1725 cat >conftest.$ac_ext <<_ACEOF
1726 #ifndef __cplusplus
1727   choke me
1728 #endif
1729 _ACEOF
1730 rm -f conftest.$ac_objext
1731 if { (eval echo "$as_me:1731: \"$ac_compile\"") >&5
1732   (eval $ac_compile) 2>&5
1733   ac_status=$?
1734   echo "$as_me:1734: \$? = $ac_status" >&5
1735   (exit $ac_status); } &&
1736          { ac_try='test -s conftest.$ac_objext'
1737   { (eval echo "$as_me:1737: \"$ac_try\"") >&5
1738   (eval $ac_try) 2>&5
1739   ac_status=$?
1740   echo "$as_me:1740: \$? = $ac_status" >&5
1741   (exit $ac_status); }; }; then
1742   for ac_declaration in \
1743    ''\
1744    '#include <stdlib.h>' \
1745    'extern "C" void std::exit (int) throw (); using std::exit;' \
1746    'extern "C" void std::exit (int); using std::exit;' \
1747    'extern "C" void exit (int) throw ();' \
1748    'extern "C" void exit (int);' \
1749    'void exit (int);'
1750 do
1751   cat >conftest.$ac_ext <<_ACEOF
1752 #line 1752 "configure"
1753 #include "confdefs.h"
1754 #include <stdlib.h>
1755 $ac_declaration
1756 int
1757 main ()
1758 {
1759 exit (42);
1760   ;
1761   return 0;
1762 }
1763 _ACEOF
1764 rm -f conftest.$ac_objext
1765 if { (eval echo "$as_me:1765: \"$ac_compile\"") >&5
1766   (eval $ac_compile) 2>&5
1767   ac_status=$?
1768   echo "$as_me:1768: \$? = $ac_status" >&5
1769   (exit $ac_status); } &&
1770          { ac_try='test -s conftest.$ac_objext'
1771   { (eval echo "$as_me:1771: \"$ac_try\"") >&5
1772   (eval $ac_try) 2>&5
1773   ac_status=$?
1774   echo "$as_me:1774: \$? = $ac_status" >&5
1775   (exit $ac_status); }; }; then
1776   :
1777 else
1778   echo "$as_me: failed program was:" >&5
1779 cat conftest.$ac_ext >&5
1780 continue
1781 fi
1782 rm -f conftest.$ac_objext conftest.$ac_ext
1783   cat >conftest.$ac_ext <<_ACEOF
1784 #line 1784 "configure"
1785 #include "confdefs.h"
1786 $ac_declaration
1787 int
1788 main ()
1789 {
1790 exit (42);
1791   ;
1792   return 0;
1793 }
1794 _ACEOF
1795 rm -f conftest.$ac_objext
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit $ac_status); } &&
1801          { ac_try='test -s conftest.$ac_objext'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit $ac_status); }; }; then
1807   break
1808 else
1809   echo "$as_me: failed program was:" >&5
1810 cat conftest.$ac_ext >&5
1811 fi
1812 rm -f conftest.$ac_objext conftest.$ac_ext
1813 done
1814 rm -rf conftest*
1815 if test -n "$ac_declaration"; then
1816   echo '#ifdef __cplusplus' >>confdefs.h
1817   echo $ac_declaration      >>confdefs.h
1818   echo '#endif'             >>confdefs.h
1819 fi
1820
1821 else
1822   echo "$as_me: failed program was:" >&5
1823 cat conftest.$ac_ext >&5
1824 fi
1825 rm -f conftest.$ac_objext conftest.$ac_ext
1826 ac_ext=c
1827 ac_cpp='$CPP $CPPFLAGS'
1828 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1829 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1830 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1831 ac_main_return=return
1832
1833 GCC_VERSION=none
1834 if test "$GCC" = yes ; then
1835         echo "$as_me:1835: checking version of $CC" >&5
1836 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1837         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1838         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1839         echo "$as_me:1839: result: $GCC_VERSION" >&5
1840 echo "${ECHO_T}$GCC_VERSION" >&6
1841 fi
1842
1843 echo "$as_me:1843: checking for $CC option to accept ANSI C" >&5
1844 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1845 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1846   echo $ECHO_N "(cached) $ECHO_C" >&6
1847 else
1848   ac_cv_prog_cc_stdc=no
1849 ac_save_CC=$CC
1850 cat >conftest.$ac_ext <<_ACEOF
1851 #line 1851 "configure"
1852 #include "confdefs.h"
1853 #include <stdarg.h>
1854 #include <stdio.h>
1855 #include <sys/types.h>
1856 #include <sys/stat.h>
1857 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1858 struct buf { int x; };
1859 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1860 static char *e (p, i)
1861      char **p;
1862      int i;
1863 {
1864   return p[i];
1865 }
1866 static char *f (char * (*g) (char **, int), char **p, ...)
1867 {
1868   char *s;
1869   va_list v;
1870   va_start (v,p);
1871   s = g (p, va_arg (v,int));
1872   va_end (v);
1873   return s;
1874 }
1875 int test (int i, double x);
1876 struct s1 {int (*f) (int a);};
1877 struct s2 {int (*f) (double a);};
1878 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1879 int argc;
1880 char **argv;
1881 int
1882 main ()
1883 {
1884 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1885   ;
1886   return 0;
1887 }
1888 _ACEOF
1889 # Don't try gcc -ansi; that turns off useful extensions and
1890 # breaks some systems' header files.
1891 # AIX                   -qlanglvl=ansi
1892 # Ultrix and OSF/1      -std1
1893 # HP-UX 10.20 and later -Ae
1894 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1895 # SVR4                  -Xc -D__EXTENSIONS__
1896 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1897 do
1898   CC="$ac_save_CC $ac_arg"
1899   rm -f conftest.$ac_objext
1900 if { (eval echo "$as_me:1900: \"$ac_compile\"") >&5
1901   (eval $ac_compile) 2>&5
1902   ac_status=$?
1903   echo "$as_me:1903: \$? = $ac_status" >&5
1904   (exit $ac_status); } &&
1905          { ac_try='test -s conftest.$ac_objext'
1906   { (eval echo "$as_me:1906: \"$ac_try\"") >&5
1907   (eval $ac_try) 2>&5
1908   ac_status=$?
1909   echo "$as_me:1909: \$? = $ac_status" >&5
1910   (exit $ac_status); }; }; then
1911   ac_cv_prog_cc_stdc=$ac_arg
1912 break
1913 else
1914   echo "$as_me: failed program was:" >&5
1915 cat conftest.$ac_ext >&5
1916 fi
1917 rm -f conftest.$ac_objext
1918 done
1919 rm -f conftest.$ac_ext conftest.$ac_objext
1920 CC=$ac_save_CC
1921
1922 fi
1923
1924 case "x$ac_cv_prog_cc_stdc" in
1925   x|xno)
1926     echo "$as_me:1926: result: none needed" >&5
1927 echo "${ECHO_T}none needed" >&6 ;;
1928   *)
1929     echo "$as_me:1929: result: $ac_cv_prog_cc_stdc" >&5
1930 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1931     CC="$CC $ac_cv_prog_cc_stdc" ;;
1932 esac
1933
1934 # This should have been defined by AC_PROG_CC
1935 : ${CC:=cc}
1936
1937 echo "$as_me:1937: checking \$CC variable" >&5
1938 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1939 case "$CC" in
1940 (*[\ \  ]-*)
1941         echo "$as_me:1941: result: broken" >&5
1942 echo "${ECHO_T}broken" >&6
1943         { echo "$as_me:1943: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1944 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1945         # humor him...
1946         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1947         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1948         CC="$cf_prog"
1949         for cf_arg in $cf_flags
1950         do
1951                 case "x$cf_arg" in
1952                 (x-[IUDfgOW]*)
1953
1954 cf_fix_cppflags=no
1955 cf_new_cflags=
1956 cf_new_cppflags=
1957 cf_new_extra_cppflags=
1958
1959 for cf_add_cflags in $cf_arg
1960 do
1961 case $cf_fix_cppflags in
1962 (no)
1963         case $cf_add_cflags in
1964         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1965                 case $cf_add_cflags in
1966                 (-D*)
1967                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1968
1969                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1970                                 && test -z "${cf_tst_cflags}" \
1971                                 && cf_fix_cppflags=yes
1972
1973                         if test $cf_fix_cppflags = yes ; then
1974
1975         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1976         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1977
1978                                 continue
1979                         elif test "${cf_tst_cflags}" = "\"'" ; then
1980
1981         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1982         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1983
1984                                 continue
1985                         fi
1986                         ;;
1987                 esac
1988                 case "$CPPFLAGS" in
1989                 (*$cf_add_cflags)
1990                         ;;
1991                 (*)
1992                         case $cf_add_cflags in
1993                         (-D*)
1994                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1995
1996 CPPFLAGS=`echo "$CPPFLAGS" | \
1997         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1998                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1999
2000                                 ;;
2001                         esac
2002
2003         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2004         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2005
2006                         ;;
2007                 esac
2008                 ;;
2009         (*)
2010
2011         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2012         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2013
2014                 ;;
2015         esac
2016         ;;
2017 (yes)
2018
2019         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2020         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2021
2022         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2023
2024         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2025                 && test -z "${cf_tst_cflags}" \
2026                 && cf_fix_cppflags=no
2027         ;;
2028 esac
2029 done
2030
2031 if test -n "$cf_new_cflags" ; then
2032
2033         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2034         CFLAGS="${CFLAGS}$cf_new_cflags"
2035
2036 fi
2037
2038 if test -n "$cf_new_cppflags" ; then
2039
2040         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2041         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2042
2043 fi
2044
2045 if test -n "$cf_new_extra_cppflags" ; then
2046
2047         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2048         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2049
2050 fi
2051
2052                         ;;
2053                 (*)
2054                         CC="$CC $cf_arg"
2055                         ;;
2056                 esac
2057         done
2058         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2059
2060 echo "${as_me:-configure}:2060: testing resulting CC: '$CC' ..." 1>&5
2061
2062         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2063
2064 echo "${as_me:-configure}:2064: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2065
2066         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2067
2068 echo "${as_me:-configure}:2068: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2069
2070         ;;
2071 (*)
2072         echo "$as_me:2072: result: ok" >&5
2073 echo "${ECHO_T}ok" >&6
2074         ;;
2075 esac
2076
2077 ac_ext=c
2078 ac_cpp='$CPP $CPPFLAGS'
2079 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2080 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2081 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2082 ac_main_return=return
2083 echo "$as_me:2083: checking how to run the C preprocessor" >&5
2084 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2085 # On Suns, sometimes $CPP names a directory.
2086 if test -n "$CPP" && test -d "$CPP"; then
2087   CPP=
2088 fi
2089 if test -z "$CPP"; then
2090   if test "${ac_cv_prog_CPP+set}" = set; then
2091   echo $ECHO_N "(cached) $ECHO_C" >&6
2092 else
2093       # Double quotes because CPP needs to be expanded
2094     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2095     do
2096       ac_preproc_ok=false
2097 for ac_c_preproc_warn_flag in '' yes
2098 do
2099   # Use a header file that comes with gcc, so configuring glibc
2100   # with a fresh cross-compiler works.
2101   # On the NeXT, cc -E runs the code through the compiler's parser,
2102   # not just through cpp. "Syntax error" is here to catch this case.
2103   cat >conftest.$ac_ext <<_ACEOF
2104 #line 2104 "configure"
2105 #include "confdefs.h"
2106 #include <assert.h>
2107                      Syntax error
2108 _ACEOF
2109 if { (eval echo "$as_me:2109: \"$ac_cpp conftest.$ac_ext\"") >&5
2110   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2111   ac_status=$?
2112   egrep -v '^ *\+' conftest.er1 >conftest.err
2113   rm -f conftest.er1
2114   cat conftest.err >&5
2115   echo "$as_me:2115: \$? = $ac_status" >&5
2116   (exit $ac_status); } >/dev/null; then
2117   if test -s conftest.err; then
2118     ac_cpp_err=$ac_c_preproc_warn_flag
2119   else
2120     ac_cpp_err=
2121   fi
2122 else
2123   ac_cpp_err=yes
2124 fi
2125 if test -z "$ac_cpp_err"; then
2126   :
2127 else
2128   echo "$as_me: failed program was:" >&5
2129   cat conftest.$ac_ext >&5
2130   # Broken: fails on valid input.
2131 continue
2132 fi
2133 rm -f conftest.err conftest.$ac_ext
2134
2135   # OK, works on sane cases.  Now check whether non-existent headers
2136   # can be detected and how.
2137   cat >conftest.$ac_ext <<_ACEOF
2138 #line 2138 "configure"
2139 #include "confdefs.h"
2140 #include <ac_nonexistent.h>
2141 _ACEOF
2142 if { (eval echo "$as_me:2142: \"$ac_cpp conftest.$ac_ext\"") >&5
2143   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2144   ac_status=$?
2145   egrep -v '^ *\+' conftest.er1 >conftest.err
2146   rm -f conftest.er1
2147   cat conftest.err >&5
2148   echo "$as_me:2148: \$? = $ac_status" >&5
2149   (exit $ac_status); } >/dev/null; then
2150   if test -s conftest.err; then
2151     ac_cpp_err=$ac_c_preproc_warn_flag
2152   else
2153     ac_cpp_err=
2154   fi
2155 else
2156   ac_cpp_err=yes
2157 fi
2158 if test -z "$ac_cpp_err"; then
2159   # Broken: success on invalid input.
2160 continue
2161 else
2162   echo "$as_me: failed program was:" >&5
2163   cat conftest.$ac_ext >&5
2164   # Passes both tests.
2165 ac_preproc_ok=:
2166 break
2167 fi
2168 rm -f conftest.err conftest.$ac_ext
2169
2170 done
2171 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2172 rm -f conftest.err conftest.$ac_ext
2173 if $ac_preproc_ok; then
2174   break
2175 fi
2176
2177     done
2178     ac_cv_prog_CPP=$CPP
2179
2180 fi
2181   CPP=$ac_cv_prog_CPP
2182 else
2183   ac_cv_prog_CPP=$CPP
2184 fi
2185 echo "$as_me:2185: result: $CPP" >&5
2186 echo "${ECHO_T}$CPP" >&6
2187 ac_preproc_ok=false
2188 for ac_c_preproc_warn_flag in '' yes
2189 do
2190   # Use a header file that comes with gcc, so configuring glibc
2191   # with a fresh cross-compiler works.
2192   # On the NeXT, cc -E runs the code through the compiler's parser,
2193   # not just through cpp. "Syntax error" is here to catch this case.
2194   cat >conftest.$ac_ext <<_ACEOF
2195 #line 2195 "configure"
2196 #include "confdefs.h"
2197 #include <assert.h>
2198                      Syntax error
2199 _ACEOF
2200 if { (eval echo "$as_me:2200: \"$ac_cpp conftest.$ac_ext\"") >&5
2201   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2202   ac_status=$?
2203   egrep -v '^ *\+' conftest.er1 >conftest.err
2204   rm -f conftest.er1
2205   cat conftest.err >&5
2206   echo "$as_me:2206: \$? = $ac_status" >&5
2207   (exit $ac_status); } >/dev/null; then
2208   if test -s conftest.err; then
2209     ac_cpp_err=$ac_c_preproc_warn_flag
2210   else
2211     ac_cpp_err=
2212   fi
2213 else
2214   ac_cpp_err=yes
2215 fi
2216 if test -z "$ac_cpp_err"; then
2217   :
2218 else
2219   echo "$as_me: failed program was:" >&5
2220   cat conftest.$ac_ext >&5
2221   # Broken: fails on valid input.
2222 continue
2223 fi
2224 rm -f conftest.err conftest.$ac_ext
2225
2226   # OK, works on sane cases.  Now check whether non-existent headers
2227   # can be detected and how.
2228   cat >conftest.$ac_ext <<_ACEOF
2229 #line 2229 "configure"
2230 #include "confdefs.h"
2231 #include <ac_nonexistent.h>
2232 _ACEOF
2233 if { (eval echo "$as_me:2233: \"$ac_cpp conftest.$ac_ext\"") >&5
2234   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2235   ac_status=$?
2236   egrep -v '^ *\+' conftest.er1 >conftest.err
2237   rm -f conftest.er1
2238   cat conftest.err >&5
2239   echo "$as_me:2239: \$? = $ac_status" >&5
2240   (exit $ac_status); } >/dev/null; then
2241   if test -s conftest.err; then
2242     ac_cpp_err=$ac_c_preproc_warn_flag
2243   else
2244     ac_cpp_err=
2245   fi
2246 else
2247   ac_cpp_err=yes
2248 fi
2249 if test -z "$ac_cpp_err"; then
2250   # Broken: success on invalid input.
2251 continue
2252 else
2253   echo "$as_me: failed program was:" >&5
2254   cat conftest.$ac_ext >&5
2255   # Passes both tests.
2256 ac_preproc_ok=:
2257 break
2258 fi
2259 rm -f conftest.err conftest.$ac_ext
2260
2261 done
2262 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2263 rm -f conftest.err conftest.$ac_ext
2264 if $ac_preproc_ok; then
2265   :
2266 else
2267   { { echo "$as_me:2267: error: C preprocessor \"$CPP\" fails sanity check" >&5
2268 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2269    { (exit 1); exit 1; }; }
2270 fi
2271
2272 ac_ext=c
2273 ac_cpp='$CPP $CPPFLAGS'
2274 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2275 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2276 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2277 ac_main_return=return
2278
2279 for ac_prog in mawk gawk nawk awk
2280 do
2281   # Extract the first word of "$ac_prog", so it can be a program name with args.
2282 set dummy $ac_prog; ac_word=$2
2283 echo "$as_me:2283: checking for $ac_word" >&5
2284 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2285 if test "${ac_cv_prog_AWK+set}" = set; then
2286   echo $ECHO_N "(cached) $ECHO_C" >&6
2287 else
2288   if test -n "$AWK"; then
2289   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2290 else
2291   ac_save_IFS=$IFS; IFS=$ac_path_separator
2292 ac_dummy="$PATH"
2293 for ac_dir in $ac_dummy; do
2294   IFS=$ac_save_IFS
2295   test -z "$ac_dir" && ac_dir=.
2296   $as_executable_p "$ac_dir/$ac_word" || continue
2297 ac_cv_prog_AWK="$ac_prog"
2298 echo "$as_me:2298: found $ac_dir/$ac_word" >&5
2299 break
2300 done
2301
2302 fi
2303 fi
2304 AWK=$ac_cv_prog_AWK
2305 if test -n "$AWK"; then
2306   echo "$as_me:2306: result: $AWK" >&5
2307 echo "${ECHO_T}$AWK" >&6
2308 else
2309   echo "$as_me:2309: result: no" >&5
2310 echo "${ECHO_T}no" >&6
2311 fi
2312
2313   test -n "$AWK" && break
2314 done
2315
2316 # Find a good install program.  We prefer a C program (faster),
2317 # so one script is as good as another.  But avoid the broken or
2318 # incompatible versions:
2319 # SysV /etc/install, /usr/sbin/install
2320 # SunOS /usr/etc/install
2321 # IRIX /sbin/install
2322 # AIX /bin/install
2323 # AmigaOS /C/install, which installs bootblocks on floppy discs
2324 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2325 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2326 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2327 # ./install, which can be erroneously created by make from ./install.sh.
2328 echo "$as_me:2328: checking for a BSD compatible install" >&5
2329 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2330 if test -z "$INSTALL"; then
2331 if test "${ac_cv_path_install+set}" = set; then
2332   echo $ECHO_N "(cached) $ECHO_C" >&6
2333 else
2334     ac_save_IFS=$IFS; IFS=$ac_path_separator
2335   for ac_dir in $PATH; do
2336     IFS=$ac_save_IFS
2337     # Account for people who put trailing slashes in PATH elements.
2338     case $ac_dir/ in
2339     / | ./ | .// | /cC/* \
2340     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2341     | /usr/ucb/* ) ;;
2342     *)
2343       # OSF1 and SCO ODT 3.0 have their own names for install.
2344       # Don't use installbsd from OSF since it installs stuff as root
2345       # by default.
2346       for ac_prog in ginstall scoinst install; do
2347         if $as_executable_p "$ac_dir/$ac_prog"; then
2348           if test $ac_prog = install &&
2349             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2350             # AIX install.  It has an incompatible calling convention.
2351             :
2352           elif test $ac_prog = install &&
2353             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2354             # program-specific install script used by HP pwplus--don't use.
2355             :
2356           else
2357             ac_cv_path_install="$ac_dir/$ac_prog -c"
2358             break 2
2359           fi
2360         fi
2361       done
2362       ;;
2363     esac
2364   done
2365
2366 fi
2367   if test "${ac_cv_path_install+set}" = set; then
2368     INSTALL=$ac_cv_path_install
2369   else
2370     # As a last resort, use the slow shell script.  We don't cache a
2371     # path for INSTALL within a source directory, because that will
2372     # break other packages using the cache if that directory is
2373     # removed, or if the path is relative.
2374     INSTALL=$ac_install_sh
2375   fi
2376 fi
2377 echo "$as_me:2377: result: $INSTALL" >&5
2378 echo "${ECHO_T}$INSTALL" >&6
2379
2380 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2381 # It thinks the first close brace ends the variable substitution.
2382 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2383
2384 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2385
2386 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2387
2388 case $INSTALL in
2389 (/*)
2390         ;;
2391 (*)
2392         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2393         test -z "$cf_dir" && cf_dir=.
2394         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2395         ;;
2396 esac
2397
2398 for ac_prog in lint cppcheck splint
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_prog_LINT+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   if test -n "$LINT"; then
2408   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2409 else
2410   ac_save_IFS=$IFS; IFS=$ac_path_separator
2411 ac_dummy="$PATH"
2412 for ac_dir in $ac_dummy; do
2413   IFS=$ac_save_IFS
2414   test -z "$ac_dir" && ac_dir=.
2415   $as_executable_p "$ac_dir/$ac_word" || continue
2416 ac_cv_prog_LINT="$ac_prog"
2417 echo "$as_me:2417: found $ac_dir/$ac_word" >&5
2418 break
2419 done
2420
2421 fi
2422 fi
2423 LINT=$ac_cv_prog_LINT
2424 if test -n "$LINT"; then
2425   echo "$as_me:2425: result: $LINT" >&5
2426 echo "${ECHO_T}$LINT" >&6
2427 else
2428   echo "$as_me:2428: result: no" >&5
2429 echo "${ECHO_T}no" >&6
2430 fi
2431
2432   test -n "$LINT" && break
2433 done
2434
2435 echo "$as_me:2435: checking if filesystem supports mixed-case filenames" >&5
2436 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2437 if test "${cf_cv_mixedcase+set}" = set; then
2438   echo $ECHO_N "(cached) $ECHO_C" >&6
2439 else
2440
2441 if test "$cross_compiling" = yes ; then
2442         case $target_alias in
2443         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2444                 cf_cv_mixedcase=no
2445                 ;;
2446         (*)
2447                 cf_cv_mixedcase=yes
2448                 ;;
2449         esac
2450 else
2451         rm -f conftest CONFTEST
2452         echo test >conftest
2453         if test -f CONFTEST ; then
2454                 cf_cv_mixedcase=no
2455         else
2456                 cf_cv_mixedcase=yes
2457         fi
2458         rm -f conftest CONFTEST
2459 fi
2460
2461 fi
2462 echo "$as_me:2462: result: $cf_cv_mixedcase" >&5
2463 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2464 test "$cf_cv_mixedcase" = yes &&
2465 cat >>confdefs.h <<\EOF
2466 #define MIXEDCASE_FILENAMES 1
2467 EOF
2468
2469 for ac_prog in exctags ctags
2470 do
2471   # Extract the first word of "$ac_prog", so it can be a program name with args.
2472 set dummy $ac_prog; ac_word=$2
2473 echo "$as_me:2473: checking for $ac_word" >&5
2474 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2475 if test "${ac_cv_prog_CTAGS+set}" = set; then
2476   echo $ECHO_N "(cached) $ECHO_C" >&6
2477 else
2478   if test -n "$CTAGS"; then
2479   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2480 else
2481   ac_save_IFS=$IFS; IFS=$ac_path_separator
2482 ac_dummy="$PATH"
2483 for ac_dir in $ac_dummy; do
2484   IFS=$ac_save_IFS
2485   test -z "$ac_dir" && ac_dir=.
2486   $as_executable_p "$ac_dir/$ac_word" || continue
2487 ac_cv_prog_CTAGS="$ac_prog"
2488 echo "$as_me:2488: found $ac_dir/$ac_word" >&5
2489 break
2490 done
2491
2492 fi
2493 fi
2494 CTAGS=$ac_cv_prog_CTAGS
2495 if test -n "$CTAGS"; then
2496   echo "$as_me:2496: result: $CTAGS" >&5
2497 echo "${ECHO_T}$CTAGS" >&6
2498 else
2499   echo "$as_me:2499: result: no" >&5
2500 echo "${ECHO_T}no" >&6
2501 fi
2502
2503   test -n "$CTAGS" && break
2504 done
2505
2506 for ac_prog in exetags etags
2507 do
2508   # Extract the first word of "$ac_prog", so it can be a program name with args.
2509 set dummy $ac_prog; ac_word=$2
2510 echo "$as_me:2510: checking for $ac_word" >&5
2511 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2512 if test "${ac_cv_prog_ETAGS+set}" = set; then
2513   echo $ECHO_N "(cached) $ECHO_C" >&6
2514 else
2515   if test -n "$ETAGS"; then
2516   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2517 else
2518   ac_save_IFS=$IFS; IFS=$ac_path_separator
2519 ac_dummy="$PATH"
2520 for ac_dir in $ac_dummy; do
2521   IFS=$ac_save_IFS
2522   test -z "$ac_dir" && ac_dir=.
2523   $as_executable_p "$ac_dir/$ac_word" || continue
2524 ac_cv_prog_ETAGS="$ac_prog"
2525 echo "$as_me:2525: found $ac_dir/$ac_word" >&5
2526 break
2527 done
2528
2529 fi
2530 fi
2531 ETAGS=$ac_cv_prog_ETAGS
2532 if test -n "$ETAGS"; then
2533   echo "$as_me:2533: result: $ETAGS" >&5
2534 echo "${ECHO_T}$ETAGS" >&6
2535 else
2536   echo "$as_me:2536: result: no" >&5
2537 echo "${ECHO_T}no" >&6
2538 fi
2539
2540   test -n "$ETAGS" && break
2541 done
2542
2543 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2544 set dummy ${CTAGS:-ctags}; ac_word=$2
2545 echo "$as_me:2545: checking for $ac_word" >&5
2546 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2547 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2548   echo $ECHO_N "(cached) $ECHO_C" >&6
2549 else
2550   if test -n "$MAKE_LOWER_TAGS"; then
2551   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2552 else
2553   ac_save_IFS=$IFS; IFS=$ac_path_separator
2554 ac_dummy="$PATH"
2555 for ac_dir in $ac_dummy; do
2556   IFS=$ac_save_IFS
2557   test -z "$ac_dir" && ac_dir=.
2558   $as_executable_p "$ac_dir/$ac_word" || continue
2559 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2560 echo "$as_me:2560: found $ac_dir/$ac_word" >&5
2561 break
2562 done
2563
2564   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2565 fi
2566 fi
2567 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2568 if test -n "$MAKE_LOWER_TAGS"; then
2569   echo "$as_me:2569: result: $MAKE_LOWER_TAGS" >&5
2570 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2571 else
2572   echo "$as_me:2572: result: no" >&5
2573 echo "${ECHO_T}no" >&6
2574 fi
2575
2576 if test "$cf_cv_mixedcase" = yes ; then
2577         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2578 set dummy ${ETAGS:-etags}; ac_word=$2
2579 echo "$as_me:2579: checking for $ac_word" >&5
2580 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2581 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2582   echo $ECHO_N "(cached) $ECHO_C" >&6
2583 else
2584   if test -n "$MAKE_UPPER_TAGS"; then
2585   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2586 else
2587   ac_save_IFS=$IFS; IFS=$ac_path_separator
2588 ac_dummy="$PATH"
2589 for ac_dir in $ac_dummy; do
2590   IFS=$ac_save_IFS
2591   test -z "$ac_dir" && ac_dir=.
2592   $as_executable_p "$ac_dir/$ac_word" || continue
2593 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2594 echo "$as_me:2594: found $ac_dir/$ac_word" >&5
2595 break
2596 done
2597
2598   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2599 fi
2600 fi
2601 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2602 if test -n "$MAKE_UPPER_TAGS"; then
2603   echo "$as_me:2603: result: $MAKE_UPPER_TAGS" >&5
2604 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2605 else
2606   echo "$as_me:2606: result: no" >&5
2607 echo "${ECHO_T}no" >&6
2608 fi
2609
2610 else
2611         MAKE_UPPER_TAGS=no
2612 fi
2613
2614 if test "$MAKE_UPPER_TAGS" = yes ; then
2615         MAKE_UPPER_TAGS=
2616 else
2617         MAKE_UPPER_TAGS="#"
2618 fi
2619
2620 if test "$MAKE_LOWER_TAGS" = yes ; then
2621         MAKE_LOWER_TAGS=
2622 else
2623         MAKE_LOWER_TAGS="#"
2624 fi
2625
2626 echo "$as_me:2626: checking if -lm needed for math functions" >&5
2627 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2628 if test "${cf_cv_need_libm+set}" = set; then
2629   echo $ECHO_N "(cached) $ECHO_C" >&6
2630 else
2631
2632         cat >conftest.$ac_ext <<_ACEOF
2633 #line 2633 "configure"
2634 #include "confdefs.h"
2635
2636         #include <stdio.h>
2637         #include <stdlib.h>
2638         #include <math.h>
2639
2640 int
2641 main ()
2642 {
2643 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2644   ;
2645   return 0;
2646 }
2647 _ACEOF
2648 rm -f conftest.$ac_objext conftest$ac_exeext
2649 if { (eval echo "$as_me:2649: \"$ac_link\"") >&5
2650   (eval $ac_link) 2>&5
2651   ac_status=$?
2652   echo "$as_me:2652: \$? = $ac_status" >&5
2653   (exit $ac_status); } &&
2654          { ac_try='test -s conftest$ac_exeext'
2655   { (eval echo "$as_me:2655: \"$ac_try\"") >&5
2656   (eval $ac_try) 2>&5
2657   ac_status=$?
2658   echo "$as_me:2658: \$? = $ac_status" >&5
2659   (exit $ac_status); }; }; then
2660   cf_cv_need_libm=no
2661 else
2662   echo "$as_me: failed program was:" >&5
2663 cat conftest.$ac_ext >&5
2664 cf_cv_need_libm=yes
2665 fi
2666 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2667 fi
2668 echo "$as_me:2668: result: $cf_cv_need_libm" >&5
2669 echo "${ECHO_T}$cf_cv_need_libm" >&6
2670 if test "$cf_cv_need_libm" = yes
2671 then
2672 MATH_LIB=-lm
2673 fi
2674
2675 top_builddir=`pwd`
2676
2677 CC_G_OPT="-g"
2678 CC_SHARED_OPTS=unknown
2679 CPPFLAGS="$CPPFLAGS"
2680 DFT_DEP_SUFFIX=""
2681 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2682 DFT_UPR_MODEL="NORMAL"
2683 LD="ld"
2684 LDFLAGS_SHARED=""
2685 LDFLAGS_STATIC=""
2686 LD_MODEL=""
2687 LD_SHARED_OPTS=""
2688 LIBTOOL=""
2689 LIBTOOL_OPTS=""
2690 LIB_CLEAN=""
2691 LIB_COMPILE=""
2692 LIB_LINK='${CC}'
2693 LINK_TESTS=""
2694 LOCAL_LDFLAGS=""
2695 PACKAGE="ncurses-examples"
2696 PTHREAD="-lm"
2697 TEST_ARGS=""
2698 TEST_DEPS=""
2699 TEST_LIBS=""
2700 TINFO_LDFLAGS=''
2701 TINFO_LIBS='$(LIBS_CURSES)'
2702 cf_cv_abi_version=""
2703 cf_cv_rel_version=""
2704 includesubdir=""
2705
2706 cf_cv_screen=curses
2707 cf_cv_libtype=
2708
2709 if test "$GCC" = yes
2710 then
2711 cat > conftest.i <<EOF
2712 #ifndef GCC_PRINTF
2713 #define GCC_PRINTF 0
2714 #endif
2715 #ifndef GCC_SCANF
2716 #define GCC_SCANF 0
2717 #endif
2718 #ifndef GCC_NORETURN
2719 #define GCC_NORETURN /* nothing */
2720 #endif
2721 #ifndef GCC_UNUSED
2722 #define GCC_UNUSED /* nothing */
2723 #endif
2724 EOF
2725 if test "$GCC" = yes
2726 then
2727         { echo "$as_me:2727: checking for $CC __attribute__ directives..." >&5
2728 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2729 cat > conftest.$ac_ext <<EOF
2730 #line 2730 "${as_me:-configure}"
2731 #include "confdefs.h"
2732 #include "conftest.h"
2733 #include "conftest.i"
2734 #if     GCC_PRINTF
2735 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2736 #else
2737 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2738 #endif
2739 #if     GCC_SCANF
2740 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2741 #else
2742 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2743 #endif
2744 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2745 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2746 extern void foo(void) GCC_NORETURN;
2747 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2748 EOF
2749         cf_printf_attribute=no
2750         cf_scanf_attribute=no
2751         for cf_attribute in scanf printf unused noreturn
2752         do
2753
2754 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2755
2756                 cf_directive="__attribute__(($cf_attribute))"
2757                 echo "checking for $CC $cf_directive" 1>&5
2758
2759                 case $cf_attribute in
2760                 (printf)
2761                         cf_printf_attribute=yes
2762                         cat >conftest.h <<EOF
2763 #define GCC_$cf_ATTRIBUTE 1
2764 EOF
2765                         ;;
2766                 (scanf)
2767                         cf_scanf_attribute=yes
2768                         cat >conftest.h <<EOF
2769 #define GCC_$cf_ATTRIBUTE 1
2770 EOF
2771                         ;;
2772                 (*)
2773                         cat >conftest.h <<EOF
2774 #define GCC_$cf_ATTRIBUTE $cf_directive
2775 EOF
2776                         ;;
2777                 esac
2778
2779                 if { (eval echo "$as_me:2779: \"$ac_compile\"") >&5
2780   (eval $ac_compile) 2>&5
2781   ac_status=$?
2782   echo "$as_me:2782: \$? = $ac_status" >&5
2783   (exit $ac_status); }; then
2784                         test -n "$verbose" && echo "$as_me:2784: result: ... $cf_attribute" >&5
2785 echo "${ECHO_T}... $cf_attribute" >&6
2786                         cat conftest.h >>confdefs.h
2787                         case $cf_attribute in
2788                         (noreturn)
2789
2790 cat >>confdefs.h <<EOF
2791 #define GCC_NORETURN $cf_directive
2792 EOF
2793
2794                                 ;;
2795                         (printf)
2796                                 cf_value='/* nothing */'
2797                                 if test "$cf_printf_attribute" != no ; then
2798                                         cf_value='__attribute__((format(printf,fmt,var)))'
2799
2800 cat >>confdefs.h <<\EOF
2801 #define GCC_PRINTF 1
2802 EOF
2803
2804                                 fi
2805
2806 cat >>confdefs.h <<EOF
2807 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2808 EOF
2809
2810                                 ;;
2811                         (scanf)
2812                                 cf_value='/* nothing */'
2813                                 if test "$cf_scanf_attribute" != no ; then
2814                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2815
2816 cat >>confdefs.h <<\EOF
2817 #define GCC_SCANF 1
2818 EOF
2819
2820                                 fi
2821
2822 cat >>confdefs.h <<EOF
2823 #define GCC_SCANFLIKE(fmt,var) $cf_value
2824 EOF
2825
2826                                 ;;
2827                         (unused)
2828
2829 cat >>confdefs.h <<EOF
2830 #define GCC_UNUSED $cf_directive
2831 EOF
2832
2833                                 ;;
2834                         esac
2835                 fi
2836         done
2837 else
2838         fgrep define conftest.i >>confdefs.h
2839 fi
2840 rm -rf conftest*
2841 fi
2842
2843 echo "$as_me:2843: checking if you want to work around bogus compiler/loader warnings" >&5
2844 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
2845
2846 # Check whether --enable-string-hacks or --disable-string-hacks was given.
2847 if test "${enable_string_hacks+set}" = set; then
2848   enableval="$enable_string_hacks"
2849   with_string_hacks=$enableval
2850 else
2851   with_string_hacks=no
2852 fi;
2853 echo "$as_me:2853: result: $with_string_hacks" >&5
2854 echo "${ECHO_T}$with_string_hacks" >&6
2855
2856 if test "x$with_string_hacks" = "xyes"; then
2857
2858 cat >>confdefs.h <<\EOF
2859 #define USE_STRING_HACKS 1
2860 EOF
2861
2862         { echo "$as_me:2862: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
2863 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
2864         echo "$as_me:2864: checking for strlcat" >&5
2865 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
2866 if test "${ac_cv_func_strlcat+set}" = set; then
2867   echo $ECHO_N "(cached) $ECHO_C" >&6
2868 else
2869   cat >conftest.$ac_ext <<_ACEOF
2870 #line 2870 "configure"
2871 #include "confdefs.h"
2872 /* System header to define __stub macros and hopefully few prototypes,
2873     which can conflict with char strlcat (); below.  */
2874 #include <assert.h>
2875 /* Override any gcc2 internal prototype to avoid an error.  */
2876 #ifdef __cplusplus
2877 extern "C"
2878 #endif
2879 /* We use char because int might match the return type of a gcc2
2880    builtin and then its argument prototype would still apply.  */
2881 char strlcat ();
2882 char (*f) ();
2883
2884 int
2885 main ()
2886 {
2887 /* The GNU C library defines this for functions which it implements
2888     to always fail with ENOSYS.  Some functions are actually named
2889     something starting with __ and the normal name is an alias.  */
2890 #if defined (__stub_strlcat) || defined (__stub___strlcat)
2891 choke me
2892 #else
2893 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
2894 #endif
2895
2896   ;
2897   return 0;
2898 }
2899 _ACEOF
2900 rm -f conftest.$ac_objext conftest$ac_exeext
2901 if { (eval echo "$as_me:2901: \"$ac_link\"") >&5
2902   (eval $ac_link) 2>&5
2903   ac_status=$?
2904   echo "$as_me:2904: \$? = $ac_status" >&5
2905   (exit $ac_status); } &&
2906          { ac_try='test -s conftest$ac_exeext'
2907   { (eval echo "$as_me:2907: \"$ac_try\"") >&5
2908   (eval $ac_try) 2>&5
2909   ac_status=$?
2910   echo "$as_me:2910: \$? = $ac_status" >&5
2911   (exit $ac_status); }; }; then
2912   ac_cv_func_strlcat=yes
2913 else
2914   echo "$as_me: failed program was:" >&5
2915 cat conftest.$ac_ext >&5
2916 ac_cv_func_strlcat=no
2917 fi
2918 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2919 fi
2920 echo "$as_me:2920: result: $ac_cv_func_strlcat" >&5
2921 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
2922 if test $ac_cv_func_strlcat = yes; then
2923
2924 cat >>confdefs.h <<\EOF
2925 #define HAVE_STRLCAT 1
2926 EOF
2927
2928 else
2929
2930                 echo "$as_me:2930: checking for strlcat in -lbsd" >&5
2931 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
2932 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
2933   echo $ECHO_N "(cached) $ECHO_C" >&6
2934 else
2935   ac_check_lib_save_LIBS=$LIBS
2936 LIBS="-lbsd  $LIBS"
2937 cat >conftest.$ac_ext <<_ACEOF
2938 #line 2938 "configure"
2939 #include "confdefs.h"
2940
2941 /* Override any gcc2 internal prototype to avoid an error.  */
2942 #ifdef __cplusplus
2943 extern "C"
2944 #endif
2945 /* We use char because int might match the return type of a gcc2
2946    builtin and then its argument prototype would still apply.  */
2947 char strlcat ();
2948 int
2949 main ()
2950 {
2951 strlcat ();
2952   ;
2953   return 0;
2954 }
2955 _ACEOF
2956 rm -f conftest.$ac_objext conftest$ac_exeext
2957 if { (eval echo "$as_me:2957: \"$ac_link\"") >&5
2958   (eval $ac_link) 2>&5
2959   ac_status=$?
2960   echo "$as_me:2960: \$? = $ac_status" >&5
2961   (exit $ac_status); } &&
2962          { ac_try='test -s conftest$ac_exeext'
2963   { (eval echo "$as_me:2963: \"$ac_try\"") >&5
2964   (eval $ac_try) 2>&5
2965   ac_status=$?
2966   echo "$as_me:2966: \$? = $ac_status" >&5
2967   (exit $ac_status); }; }; then
2968   ac_cv_lib_bsd_strlcat=yes
2969 else
2970   echo "$as_me: failed program was:" >&5
2971 cat conftest.$ac_ext >&5
2972 ac_cv_lib_bsd_strlcat=no
2973 fi
2974 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2975 LIBS=$ac_check_lib_save_LIBS
2976 fi
2977 echo "$as_me:2977: result: $ac_cv_lib_bsd_strlcat" >&5
2978 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
2979 if test $ac_cv_lib_bsd_strlcat = yes; then
2980
2981 cf_add_libs="-lbsd"
2982 # Filter out duplicates - this happens with badly-designed ".pc" files...
2983 for cf_add_1lib in $LIBS
2984 do
2985         for cf_add_2lib in $cf_add_libs
2986         do
2987                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
2988                 then
2989                         cf_add_1lib=
2990                         break
2991                 fi
2992         done
2993         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
2994 done
2995 LIBS="$cf_add_libs"
2996
2997 for ac_header in bsd/string.h
2998 do
2999 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3000 echo "$as_me:3000: checking for $ac_header" >&5
3001 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3002 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3003   echo $ECHO_N "(cached) $ECHO_C" >&6
3004 else
3005   cat >conftest.$ac_ext <<_ACEOF
3006 #line 3006 "configure"
3007 #include "confdefs.h"
3008 #include <$ac_header>
3009 _ACEOF
3010 if { (eval echo "$as_me:3010: \"$ac_cpp conftest.$ac_ext\"") >&5
3011   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3012   ac_status=$?
3013   egrep -v '^ *\+' conftest.er1 >conftest.err
3014   rm -f conftest.er1
3015   cat conftest.err >&5
3016   echo "$as_me:3016: \$? = $ac_status" >&5
3017   (exit $ac_status); } >/dev/null; then
3018   if test -s conftest.err; then
3019     ac_cpp_err=$ac_c_preproc_warn_flag
3020   else
3021     ac_cpp_err=
3022   fi
3023 else
3024   ac_cpp_err=yes
3025 fi
3026 if test -z "$ac_cpp_err"; then
3027   eval "$as_ac_Header=yes"
3028 else
3029   echo "$as_me: failed program was:" >&5
3030   cat conftest.$ac_ext >&5
3031   eval "$as_ac_Header=no"
3032 fi
3033 rm -f conftest.err conftest.$ac_ext
3034 fi
3035 echo "$as_me:3035: result: `eval echo '${'$as_ac_Header'}'`" >&5
3036 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3037 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3038   cat >>confdefs.h <<EOF
3039 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3040 EOF
3041
3042 fi
3043 done
3044
3045 cat >>confdefs.h <<\EOF
3046 #define HAVE_STRLCAT 1
3047 EOF
3048
3049 fi
3050
3051 fi
3052
3053 for ac_func in strlcpy snprintf
3054 do
3055 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3056 echo "$as_me:3056: checking for $ac_func" >&5
3057 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3058 if eval "test \"\${$as_ac_var+set}\" = set"; then
3059   echo $ECHO_N "(cached) $ECHO_C" >&6
3060 else
3061   cat >conftest.$ac_ext <<_ACEOF
3062 #line 3062 "configure"
3063 #include "confdefs.h"
3064 /* System header to define __stub macros and hopefully few prototypes,
3065     which can conflict with char $ac_func (); below.  */
3066 #include <assert.h>
3067 /* Override any gcc2 internal prototype to avoid an error.  */
3068 #ifdef __cplusplus
3069 extern "C"
3070 #endif
3071 /* We use char because int might match the return type of a gcc2
3072    builtin and then its argument prototype would still apply.  */
3073 char $ac_func ();
3074 char (*f) ();
3075
3076 int
3077 main ()
3078 {
3079 /* The GNU C library defines this for functions which it implements
3080     to always fail with ENOSYS.  Some functions are actually named
3081     something starting with __ and the normal name is an alias.  */
3082 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3083 choke me
3084 #else
3085 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3086 #endif
3087
3088   ;
3089   return 0;
3090 }
3091 _ACEOF
3092 rm -f conftest.$ac_objext conftest$ac_exeext
3093 if { (eval echo "$as_me:3093: \"$ac_link\"") >&5
3094   (eval $ac_link) 2>&5
3095   ac_status=$?
3096   echo "$as_me:3096: \$? = $ac_status" >&5
3097   (exit $ac_status); } &&
3098          { ac_try='test -s conftest$ac_exeext'
3099   { (eval echo "$as_me:3099: \"$ac_try\"") >&5
3100   (eval $ac_try) 2>&5
3101   ac_status=$?
3102   echo "$as_me:3102: \$? = $ac_status" >&5
3103   (exit $ac_status); }; }; then
3104   eval "$as_ac_var=yes"
3105 else
3106   echo "$as_me: failed program was:" >&5
3107 cat conftest.$ac_ext >&5
3108 eval "$as_ac_var=no"
3109 fi
3110 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3111 fi
3112 echo "$as_me:3112: result: `eval echo '${'$as_ac_var'}'`" >&5
3113 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3114 if test `eval echo '${'$as_ac_var'}'` = yes; then
3115   cat >>confdefs.h <<EOF
3116 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3117 EOF
3118
3119 fi
3120 done
3121
3122 fi
3123
3124 cf_XOPEN_SOURCE=500
3125 cf_POSIX_C_SOURCE=199506L
3126 cf_xopen_source=
3127
3128 case $host_os in
3129 (aix[4-7]*)
3130         cf_xopen_source="-D_ALL_SOURCE"
3131         ;;
3132 (msys)
3133         cf_XOPEN_SOURCE=600
3134         ;;
3135 (darwin[0-8].*)
3136         cf_xopen_source="-D_APPLE_C_SOURCE"
3137         ;;
3138 (darwin*)
3139         cf_xopen_source="-D_DARWIN_C_SOURCE"
3140         cf_XOPEN_SOURCE=
3141         ;;
3142 (freebsd*|dragonfly*)
3143         # 5.x headers associate
3144         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3145         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3146         cf_POSIX_C_SOURCE=200112L
3147         cf_XOPEN_SOURCE=600
3148         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3149         ;;
3150 (hpux11*)
3151         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3152         ;;
3153 (hpux*)
3154         cf_xopen_source="-D_HPUX_SOURCE"
3155         ;;
3156 (irix[56].*)
3157         cf_xopen_source="-D_SGI_SOURCE"
3158         cf_XOPEN_SOURCE=
3159         ;;
3160 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3161
3162 echo "$as_me:3162: checking if we must define _GNU_SOURCE" >&5
3163 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3164 if test "${cf_cv_gnu_source+set}" = set; then
3165   echo $ECHO_N "(cached) $ECHO_C" >&6
3166 else
3167
3168 cat >conftest.$ac_ext <<_ACEOF
3169 #line 3169 "configure"
3170 #include "confdefs.h"
3171 #include <sys/types.h>
3172 int
3173 main ()
3174 {
3175
3176 #ifndef _XOPEN_SOURCE
3177 make an error
3178 #endif
3179   ;
3180   return 0;
3181 }
3182 _ACEOF
3183 rm -f conftest.$ac_objext
3184 if { (eval echo "$as_me:3184: \"$ac_compile\"") >&5
3185   (eval $ac_compile) 2>&5
3186   ac_status=$?
3187   echo "$as_me:3187: \$? = $ac_status" >&5
3188   (exit $ac_status); } &&
3189          { ac_try='test -s conftest.$ac_objext'
3190   { (eval echo "$as_me:3190: \"$ac_try\"") >&5
3191   (eval $ac_try) 2>&5
3192   ac_status=$?
3193   echo "$as_me:3193: \$? = $ac_status" >&5
3194   (exit $ac_status); }; }; then
3195   cf_cv_gnu_source=no
3196 else
3197   echo "$as_me: failed program was:" >&5
3198 cat conftest.$ac_ext >&5
3199 cf_save="$CPPFLAGS"
3200          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3201          cat >conftest.$ac_ext <<_ACEOF
3202 #line 3202 "configure"
3203 #include "confdefs.h"
3204 #include <sys/types.h>
3205 int
3206 main ()
3207 {
3208
3209 #ifdef _XOPEN_SOURCE
3210 make an error
3211 #endif
3212   ;
3213   return 0;
3214 }
3215 _ACEOF
3216 rm -f conftest.$ac_objext
3217 if { (eval echo "$as_me:3217: \"$ac_compile\"") >&5
3218   (eval $ac_compile) 2>&5
3219   ac_status=$?
3220   echo "$as_me:3220: \$? = $ac_status" >&5
3221   (exit $ac_status); } &&
3222          { ac_try='test -s conftest.$ac_objext'
3223   { (eval echo "$as_me:3223: \"$ac_try\"") >&5
3224   (eval $ac_try) 2>&5
3225   ac_status=$?
3226   echo "$as_me:3226: \$? = $ac_status" >&5
3227   (exit $ac_status); }; }; then
3228   cf_cv_gnu_source=no
3229 else
3230   echo "$as_me: failed program was:" >&5
3231 cat conftest.$ac_ext >&5
3232 cf_cv_gnu_source=yes
3233 fi
3234 rm -f conftest.$ac_objext conftest.$ac_ext
3235         CPPFLAGS="$cf_save"
3236
3237 fi
3238 rm -f conftest.$ac_objext conftest.$ac_ext
3239
3240 fi
3241 echo "$as_me:3241: result: $cf_cv_gnu_source" >&5
3242 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3243
3244 if test "$cf_cv_gnu_source" = yes
3245 then
3246 echo "$as_me:3246: checking if we should also define _DEFAULT_SOURCE" >&5
3247 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3248 if test "${cf_cv_default_source+set}" = set; then
3249   echo $ECHO_N "(cached) $ECHO_C" >&6
3250 else
3251
3252 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3253         cat >conftest.$ac_ext <<_ACEOF
3254 #line 3254 "configure"
3255 #include "confdefs.h"
3256 #include <sys/types.h>
3257 int
3258 main ()
3259 {
3260
3261 #ifdef _DEFAULT_SOURCE
3262 make an error
3263 #endif
3264   ;
3265   return 0;
3266 }
3267 _ACEOF
3268 rm -f conftest.$ac_objext
3269 if { (eval echo "$as_me:3269: \"$ac_compile\"") >&5
3270   (eval $ac_compile) 2>&5
3271   ac_status=$?
3272   echo "$as_me:3272: \$? = $ac_status" >&5
3273   (exit $ac_status); } &&
3274          { ac_try='test -s conftest.$ac_objext'
3275   { (eval echo "$as_me:3275: \"$ac_try\"") >&5
3276   (eval $ac_try) 2>&5
3277   ac_status=$?
3278   echo "$as_me:3278: \$? = $ac_status" >&5
3279   (exit $ac_status); }; }; then
3280   cf_cv_default_source=no
3281 else
3282   echo "$as_me: failed program was:" >&5
3283 cat conftest.$ac_ext >&5
3284 cf_cv_default_source=yes
3285 fi
3286 rm -f conftest.$ac_objext conftest.$ac_ext
3287
3288 fi
3289 echo "$as_me:3289: result: $cf_cv_default_source" >&5
3290 echo "${ECHO_T}$cf_cv_default_source" >&6
3291 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3292 fi
3293
3294         ;;
3295 (minix*)
3296         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3297         ;;
3298 (mirbsd*)
3299         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3300         cf_XOPEN_SOURCE=
3301
3302 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3303
3304 cf_save_CFLAGS="$CFLAGS"
3305 cf_save_CPPFLAGS="$CPPFLAGS"
3306
3307 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3308         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3309                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3310
3311 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3312         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3313                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3314
3315 echo "$as_me:3315: checking if we should define _POSIX_C_SOURCE" >&5
3316 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3317 if test "${cf_cv_posix_c_source+set}" = set; then
3318   echo $ECHO_N "(cached) $ECHO_C" >&6
3319 else
3320
3321 echo "${as_me:-configure}:3321: testing if the symbol is already defined go no further ..." 1>&5
3322
3323         cat >conftest.$ac_ext <<_ACEOF
3324 #line 3324 "configure"
3325 #include "confdefs.h"
3326 #include <sys/types.h>
3327 int
3328 main ()
3329 {
3330
3331 #ifndef _POSIX_C_SOURCE
3332 make an error
3333 #endif
3334   ;
3335   return 0;
3336 }
3337 _ACEOF
3338 rm -f conftest.$ac_objext
3339 if { (eval echo "$as_me:3339: \"$ac_compile\"") >&5
3340   (eval $ac_compile) 2>&5
3341   ac_status=$?
3342   echo "$as_me:3342: \$? = $ac_status" >&5
3343   (exit $ac_status); } &&
3344          { ac_try='test -s conftest.$ac_objext'
3345   { (eval echo "$as_me:3345: \"$ac_try\"") >&5
3346   (eval $ac_try) 2>&5
3347   ac_status=$?
3348   echo "$as_me:3348: \$? = $ac_status" >&5
3349   (exit $ac_status); }; }; then
3350   cf_cv_posix_c_source=no
3351 else
3352   echo "$as_me: failed program was:" >&5
3353 cat conftest.$ac_ext >&5
3354 cf_want_posix_source=no
3355          case .$cf_POSIX_C_SOURCE in
3356          (.[12]??*)
3357                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3358                 ;;
3359          (.2)
3360                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3361                 cf_want_posix_source=yes
3362                 ;;
3363          (.*)
3364                 cf_want_posix_source=yes
3365                 ;;
3366          esac
3367          if test "$cf_want_posix_source" = yes ; then
3368                 cat >conftest.$ac_ext <<_ACEOF
3369 #line 3369 "configure"
3370 #include "confdefs.h"
3371 #include <sys/types.h>
3372 int
3373 main ()
3374 {
3375
3376 #ifdef _POSIX_SOURCE
3377 make an error
3378 #endif
3379   ;
3380   return 0;
3381 }
3382 _ACEOF
3383 rm -f conftest.$ac_objext
3384 if { (eval echo "$as_me:3384: \"$ac_compile\"") >&5
3385   (eval $ac_compile) 2>&5
3386   ac_status=$?
3387   echo "$as_me:3387: \$? = $ac_status" >&5
3388   (exit $ac_status); } &&
3389          { ac_try='test -s conftest.$ac_objext'
3390   { (eval echo "$as_me:3390: \"$ac_try\"") >&5
3391   (eval $ac_try) 2>&5
3392   ac_status=$?
3393   echo "$as_me:3393: \$? = $ac_status" >&5
3394   (exit $ac_status); }; }; then
3395   :
3396 else
3397   echo "$as_me: failed program was:" >&5
3398 cat conftest.$ac_ext >&5
3399 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3400 fi
3401 rm -f conftest.$ac_objext conftest.$ac_ext
3402          fi
3403
3404 echo "${as_me:-configure}:3404: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3405
3406          CFLAGS="$cf_trim_CFLAGS"
3407          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3408
3409 echo "${as_me:-configure}:3409: testing if the second compile does not leave our definition intact error ..." 1>&5
3410
3411          cat >conftest.$ac_ext <<_ACEOF
3412 #line 3412 "configure"
3413 #include "confdefs.h"
3414 #include <sys/types.h>
3415 int
3416 main ()
3417 {
3418
3419 #ifndef _POSIX_C_SOURCE
3420 make an error
3421 #endif
3422   ;
3423   return 0;
3424 }
3425 _ACEOF
3426 rm -f conftest.$ac_objext
3427 if { (eval echo "$as_me:3427: \"$ac_compile\"") >&5
3428   (eval $ac_compile) 2>&5
3429   ac_status=$?
3430   echo "$as_me:3430: \$? = $ac_status" >&5
3431   (exit $ac_status); } &&
3432          { ac_try='test -s conftest.$ac_objext'
3433   { (eval echo "$as_me:3433: \"$ac_try\"") >&5
3434   (eval $ac_try) 2>&5
3435   ac_status=$?
3436   echo "$as_me:3436: \$? = $ac_status" >&5
3437   (exit $ac_status); }; }; then
3438   :
3439 else
3440   echo "$as_me: failed program was:" >&5
3441 cat conftest.$ac_ext >&5
3442 cf_cv_posix_c_source=no
3443 fi
3444 rm -f conftest.$ac_objext conftest.$ac_ext
3445          CFLAGS="$cf_save_CFLAGS"
3446          CPPFLAGS="$cf_save_CPPFLAGS"
3447
3448 fi
3449 rm -f conftest.$ac_objext conftest.$ac_ext
3450
3451 fi
3452 echo "$as_me:3452: result: $cf_cv_posix_c_source" >&5
3453 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3454
3455 if test "$cf_cv_posix_c_source" != no ; then
3456         CFLAGS="$cf_trim_CFLAGS"
3457         CPPFLAGS="$cf_trim_CPPFLAGS"
3458
3459 cf_fix_cppflags=no
3460 cf_new_cflags=
3461 cf_new_cppflags=
3462 cf_new_extra_cppflags=
3463
3464 for cf_add_cflags in $cf_cv_posix_c_source
3465 do
3466 case $cf_fix_cppflags in
3467 (no)
3468         case $cf_add_cflags in
3469         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3470                 case $cf_add_cflags in
3471                 (-D*)
3472                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3473
3474                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3475                                 && test -z "${cf_tst_cflags}" \
3476                                 && cf_fix_cppflags=yes
3477
3478                         if test $cf_fix_cppflags = yes ; then
3479
3480         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3481         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3482
3483                                 continue
3484                         elif test "${cf_tst_cflags}" = "\"'" ; then
3485
3486         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3487         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3488
3489                                 continue
3490                         fi
3491                         ;;
3492                 esac
3493                 case "$CPPFLAGS" in
3494                 (*$cf_add_cflags)
3495                         ;;
3496                 (*)
3497                         case $cf_add_cflags in
3498                         (-D*)
3499                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3500
3501 CPPFLAGS=`echo "$CPPFLAGS" | \
3502         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3503                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3504
3505                                 ;;
3506                         esac
3507
3508         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3509         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3510
3511                         ;;
3512                 esac
3513                 ;;
3514         (*)
3515
3516         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3517         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3518
3519                 ;;
3520         esac
3521         ;;
3522 (yes)
3523
3524         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3525         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3526
3527         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3528
3529         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3530                 && test -z "${cf_tst_cflags}" \
3531                 && cf_fix_cppflags=no
3532         ;;
3533 esac
3534 done
3535
3536 if test -n "$cf_new_cflags" ; then
3537
3538         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3539         CFLAGS="${CFLAGS}$cf_new_cflags"
3540
3541 fi
3542
3543 if test -n "$cf_new_cppflags" ; then
3544
3545         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3546         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3547
3548 fi
3549
3550 if test -n "$cf_new_extra_cppflags" ; then
3551
3552         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3553         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3554
3555 fi
3556
3557 fi
3558
3559         ;;
3560 (netbsd*)
3561         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3562         ;;
3563 (openbsd[4-9]*)
3564         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3565         cf_xopen_source="-D_BSD_SOURCE"
3566         cf_XOPEN_SOURCE=600
3567         ;;
3568 (openbsd*)
3569         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3570         ;;
3571 (osf[45]*)
3572         cf_xopen_source="-D_OSF_SOURCE"
3573         ;;
3574 (nto-qnx*)
3575         cf_xopen_source="-D_QNX_SOURCE"
3576         ;;
3577 (sco*)
3578         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3579         ;;
3580 (solaris2.*)
3581         cf_xopen_source="-D__EXTENSIONS__"
3582         cf_cv_xopen_source=broken
3583         ;;
3584 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3585         cf_XOPEN_SOURCE=
3586         cf_POSIX_C_SOURCE=
3587         ;;
3588 (*)
3589
3590 echo "$as_me:3590: checking if we should define _XOPEN_SOURCE" >&5
3591 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3592 if test "${cf_cv_xopen_source+set}" = set; then
3593   echo $ECHO_N "(cached) $ECHO_C" >&6
3594 else
3595
3596         cat >conftest.$ac_ext <<_ACEOF
3597 #line 3597 "configure"
3598 #include "confdefs.h"
3599
3600 #include <stdlib.h>
3601 #include <string.h>
3602 #include <sys/types.h>
3603
3604 int
3605 main ()
3606 {
3607
3608 #ifndef _XOPEN_SOURCE
3609 make an error
3610 #endif
3611   ;
3612   return 0;
3613 }
3614 _ACEOF
3615 rm -f conftest.$ac_objext
3616 if { (eval echo "$as_me:3616: \"$ac_compile\"") >&5
3617   (eval $ac_compile) 2>&5
3618   ac_status=$?
3619   echo "$as_me:3619: \$? = $ac_status" >&5
3620   (exit $ac_status); } &&
3621          { ac_try='test -s conftest.$ac_objext'
3622   { (eval echo "$as_me:3622: \"$ac_try\"") >&5
3623   (eval $ac_try) 2>&5
3624   ac_status=$?
3625   echo "$as_me:3625: \$? = $ac_status" >&5
3626   (exit $ac_status); }; }; then
3627   cf_cv_xopen_source=no
3628 else
3629   echo "$as_me: failed program was:" >&5
3630 cat conftest.$ac_ext >&5
3631 cf_save="$CPPFLAGS"
3632          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3633          cat >conftest.$ac_ext <<_ACEOF
3634 #line 3634 "configure"
3635 #include "confdefs.h"
3636
3637 #include <stdlib.h>
3638 #include <string.h>
3639 #include <sys/types.h>
3640
3641 int
3642 main ()
3643 {
3644
3645 #ifdef _XOPEN_SOURCE
3646 make an error
3647 #endif
3648   ;
3649   return 0;
3650 }
3651 _ACEOF
3652 rm -f conftest.$ac_objext
3653 if { (eval echo "$as_me:3653: \"$ac_compile\"") >&5
3654   (eval $ac_compile) 2>&5
3655   ac_status=$?
3656   echo "$as_me:3656: \$? = $ac_status" >&5
3657   (exit $ac_status); } &&
3658          { ac_try='test -s conftest.$ac_objext'
3659   { (eval echo "$as_me:3659: \"$ac_try\"") >&5
3660   (eval $ac_try) 2>&5
3661   ac_status=$?
3662   echo "$as_me:3662: \$? = $ac_status" >&5
3663   (exit $ac_status); }; }; then
3664   cf_cv_xopen_source=no
3665 else
3666   echo "$as_me: failed program was:" >&5
3667 cat conftest.$ac_ext >&5
3668 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3669 fi
3670 rm -f conftest.$ac_objext conftest.$ac_ext
3671         CPPFLAGS="$cf_save"
3672
3673 fi
3674 rm -f conftest.$ac_objext conftest.$ac_ext
3675
3676 fi
3677 echo "$as_me:3677: result: $cf_cv_xopen_source" >&5
3678 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3679
3680 if test "$cf_cv_xopen_source" != no ; then
3681
3682 CFLAGS=`echo "$CFLAGS" | \
3683         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3684                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3685
3686 CPPFLAGS=`echo "$CPPFLAGS" | \
3687         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3688                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3689
3690         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3691
3692 cf_fix_cppflags=no
3693 cf_new_cflags=
3694 cf_new_cppflags=
3695 cf_new_extra_cppflags=
3696
3697 for cf_add_cflags in $cf_temp_xopen_source
3698 do
3699 case $cf_fix_cppflags in
3700 (no)
3701         case $cf_add_cflags in
3702         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3703                 case $cf_add_cflags in
3704                 (-D*)
3705                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3706
3707                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3708                                 && test -z "${cf_tst_cflags}" \
3709                                 && cf_fix_cppflags=yes
3710
3711                         if test $cf_fix_cppflags = yes ; then
3712
3713         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3714         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3715
3716                                 continue
3717                         elif test "${cf_tst_cflags}" = "\"'" ; then
3718
3719         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3720         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3721
3722                                 continue
3723                         fi
3724                         ;;
3725                 esac
3726                 case "$CPPFLAGS" in
3727                 (*$cf_add_cflags)
3728                         ;;
3729                 (*)
3730                         case $cf_add_cflags in
3731                         (-D*)
3732                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3733
3734 CPPFLAGS=`echo "$CPPFLAGS" | \
3735         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3736                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3737
3738                                 ;;
3739                         esac
3740
3741         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3742         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3743
3744                         ;;
3745                 esac
3746                 ;;
3747         (*)
3748
3749         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3750         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3751
3752                 ;;
3753         esac
3754         ;;
3755 (yes)
3756
3757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3759
3760         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3761
3762         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3763                 && test -z "${cf_tst_cflags}" \
3764                 && cf_fix_cppflags=no
3765         ;;
3766 esac
3767 done
3768
3769 if test -n "$cf_new_cflags" ; then
3770
3771         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3772         CFLAGS="${CFLAGS}$cf_new_cflags"
3773
3774 fi
3775
3776 if test -n "$cf_new_cppflags" ; then
3777
3778         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3779         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3780
3781 fi
3782
3783 if test -n "$cf_new_extra_cppflags" ; then
3784
3785         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3786         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3787
3788 fi
3789
3790 fi
3791
3792 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3793
3794 cf_save_CFLAGS="$CFLAGS"
3795 cf_save_CPPFLAGS="$CPPFLAGS"
3796
3797 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3798         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3799                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3800
3801 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3802         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3803                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3804
3805 echo "$as_me:3805: checking if we should define _POSIX_C_SOURCE" >&5
3806 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3807 if test "${cf_cv_posix_c_source+set}" = set; then
3808   echo $ECHO_N "(cached) $ECHO_C" >&6
3809 else
3810
3811 echo "${as_me:-configure}:3811: testing if the symbol is already defined go no further ..." 1>&5
3812
3813         cat >conftest.$ac_ext <<_ACEOF
3814 #line 3814 "configure"
3815 #include "confdefs.h"
3816 #include <sys/types.h>
3817 int
3818 main ()
3819 {
3820
3821 #ifndef _POSIX_C_SOURCE
3822 make an error
3823 #endif
3824   ;
3825   return 0;
3826 }
3827 _ACEOF
3828 rm -f conftest.$ac_objext
3829 if { (eval echo "$as_me:3829: \"$ac_compile\"") >&5
3830   (eval $ac_compile) 2>&5
3831   ac_status=$?
3832   echo "$as_me:3832: \$? = $ac_status" >&5
3833   (exit $ac_status); } &&
3834          { ac_try='test -s conftest.$ac_objext'
3835   { (eval echo "$as_me:3835: \"$ac_try\"") >&5
3836   (eval $ac_try) 2>&5
3837   ac_status=$?
3838   echo "$as_me:3838: \$? = $ac_status" >&5
3839   (exit $ac_status); }; }; then
3840   cf_cv_posix_c_source=no
3841 else
3842   echo "$as_me: failed program was:" >&5
3843 cat conftest.$ac_ext >&5
3844 cf_want_posix_source=no
3845          case .$cf_POSIX_C_SOURCE in
3846          (.[12]??*)
3847                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3848                 ;;
3849          (.2)
3850                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3851                 cf_want_posix_source=yes
3852                 ;;
3853          (.*)
3854                 cf_want_posix_source=yes
3855                 ;;
3856          esac
3857          if test "$cf_want_posix_source" = yes ; then
3858                 cat >conftest.$ac_ext <<_ACEOF
3859 #line 3859 "configure"
3860 #include "confdefs.h"
3861 #include <sys/types.h>
3862 int
3863 main ()
3864 {
3865
3866 #ifdef _POSIX_SOURCE
3867 make an error
3868 #endif
3869   ;
3870   return 0;
3871 }
3872 _ACEOF
3873 rm -f conftest.$ac_objext
3874 if { (eval echo "$as_me:3874: \"$ac_compile\"") >&5
3875   (eval $ac_compile) 2>&5
3876   ac_status=$?
3877   echo "$as_me:3877: \$? = $ac_status" >&5
3878   (exit $ac_status); } &&
3879          { ac_try='test -s conftest.$ac_objext'
3880   { (eval echo "$as_me:3880: \"$ac_try\"") >&5
3881   (eval $ac_try) 2>&5
3882   ac_status=$?
3883   echo "$as_me:3883: \$? = $ac_status" >&5
3884   (exit $ac_status); }; }; then
3885   :
3886 else
3887   echo "$as_me: failed program was:" >&5
3888 cat conftest.$ac_ext >&5
3889 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3890 fi
3891 rm -f conftest.$ac_objext conftest.$ac_ext
3892          fi
3893
3894 echo "${as_me:-configure}:3894: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3895
3896          CFLAGS="$cf_trim_CFLAGS"
3897          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3898
3899 echo "${as_me:-configure}:3899: testing if the second compile does not leave our definition intact error ..." 1>&5
3900
3901          cat >conftest.$ac_ext <<_ACEOF
3902 #line 3902 "configure"
3903 #include "confdefs.h"
3904 #include <sys/types.h>
3905 int
3906 main ()
3907 {
3908
3909 #ifndef _POSIX_C_SOURCE
3910 make an error
3911 #endif
3912   ;
3913   return 0;
3914 }
3915 _ACEOF
3916 rm -f conftest.$ac_objext
3917 if { (eval echo "$as_me:3917: \"$ac_compile\"") >&5
3918   (eval $ac_compile) 2>&5
3919   ac_status=$?
3920   echo "$as_me:3920: \$? = $ac_status" >&5
3921   (exit $ac_status); } &&
3922          { ac_try='test -s conftest.$ac_objext'
3923   { (eval echo "$as_me:3923: \"$ac_try\"") >&5
3924   (eval $ac_try) 2>&5
3925   ac_status=$?
3926   echo "$as_me:3926: \$? = $ac_status" >&5
3927   (exit $ac_status); }; }; then
3928   :
3929 else
3930   echo "$as_me: failed program was:" >&5
3931 cat conftest.$ac_ext >&5
3932 cf_cv_posix_c_source=no
3933 fi
3934 rm -f conftest.$ac_objext conftest.$ac_ext
3935          CFLAGS="$cf_save_CFLAGS"
3936          CPPFLAGS="$cf_save_CPPFLAGS"
3937
3938 fi
3939 rm -f conftest.$ac_objext conftest.$ac_ext
3940
3941 fi
3942 echo "$as_me:3942: result: $cf_cv_posix_c_source" >&5
3943 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3944
3945 if test "$cf_cv_posix_c_source" != no ; then
3946         CFLAGS="$cf_trim_CFLAGS"
3947         CPPFLAGS="$cf_trim_CPPFLAGS"
3948
3949 cf_fix_cppflags=no
3950 cf_new_cflags=
3951 cf_new_cppflags=
3952 cf_new_extra_cppflags=
3953
3954 for cf_add_cflags in $cf_cv_posix_c_source
3955 do
3956 case $cf_fix_cppflags in
3957 (no)
3958         case $cf_add_cflags in
3959         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3960                 case $cf_add_cflags in
3961                 (-D*)
3962                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3963
3964                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3965                                 && test -z "${cf_tst_cflags}" \
3966                                 && cf_fix_cppflags=yes
3967
3968                         if test $cf_fix_cppflags = yes ; then
3969
3970         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3971         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3972
3973                                 continue
3974                         elif test "${cf_tst_cflags}" = "\"'" ; then
3975
3976         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3977         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3978
3979                                 continue
3980                         fi
3981                         ;;
3982                 esac
3983                 case "$CPPFLAGS" in
3984                 (*$cf_add_cflags)
3985                         ;;
3986                 (*)
3987                         case $cf_add_cflags in
3988                         (-D*)
3989                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3990
3991 CPPFLAGS=`echo "$CPPFLAGS" | \
3992         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3993                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3994
3995                                 ;;
3996                         esac
3997
3998         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3999         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4000
4001                         ;;
4002                 esac
4003                 ;;
4004         (*)
4005
4006         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4007         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4008
4009                 ;;
4010         esac
4011         ;;
4012 (yes)
4013
4014         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4015         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4016
4017         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4018
4019         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4020                 && test -z "${cf_tst_cflags}" \
4021                 && cf_fix_cppflags=no
4022         ;;
4023 esac
4024 done
4025
4026 if test -n "$cf_new_cflags" ; then
4027
4028         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4029         CFLAGS="${CFLAGS}$cf_new_cflags"
4030
4031 fi
4032
4033 if test -n "$cf_new_cppflags" ; then
4034
4035         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4036         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4037
4038 fi
4039
4040 if test -n "$cf_new_extra_cppflags" ; then
4041
4042         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4043         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4044
4045 fi
4046
4047 fi
4048
4049         ;;
4050 esac
4051
4052 if test -n "$cf_xopen_source" ; then
4053
4054 cf_fix_cppflags=no
4055 cf_new_cflags=
4056 cf_new_cppflags=
4057 cf_new_extra_cppflags=
4058
4059 for cf_add_cflags in $cf_xopen_source
4060 do
4061 case $cf_fix_cppflags in
4062 (no)
4063         case $cf_add_cflags in
4064         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4065                 case $cf_add_cflags in
4066                 (-D*)
4067                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4068
4069                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4070                                 && test -z "${cf_tst_cflags}" \
4071                                 && cf_fix_cppflags=yes
4072
4073                         if test $cf_fix_cppflags = yes ; then
4074
4075         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4076         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4077
4078                                 continue
4079                         elif test "${cf_tst_cflags}" = "\"'" ; then
4080
4081         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4082         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4083
4084                                 continue
4085                         fi
4086                         ;;
4087                 esac
4088                 case "$CPPFLAGS" in
4089                 (*$cf_add_cflags)
4090                         ;;
4091                 (*)
4092                         case $cf_add_cflags in
4093                         (-D*)
4094                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4095
4096 CPPFLAGS=`echo "$CPPFLAGS" | \
4097         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4098                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4099
4100                                 ;;
4101                         esac
4102
4103         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4104         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4105
4106                         ;;
4107                 esac
4108                 ;;
4109         (*)
4110
4111         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4112         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4113
4114                 ;;
4115         esac
4116         ;;
4117 (yes)
4118
4119         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4120         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4121
4122         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4123
4124         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4125                 && test -z "${cf_tst_cflags}" \
4126                 && cf_fix_cppflags=no
4127         ;;
4128 esac
4129 done
4130
4131 if test -n "$cf_new_cflags" ; then
4132         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4133
4134 echo "${as_me:-configure}:4134: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4135
4136         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4137         CFLAGS="${CFLAGS}$cf_new_cflags"
4138
4139 fi
4140
4141 if test -n "$cf_new_cppflags" ; then
4142         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4143
4144 echo "${as_me:-configure}:4144: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4145
4146         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4147         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4148
4149 fi
4150
4151 if test -n "$cf_new_extra_cppflags" ; then
4152         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4153
4154 echo "${as_me:-configure}:4154: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4155
4156         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4157         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4158
4159 fi
4160
4161 fi
4162
4163 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4164         echo "$as_me:4164: checking if _XOPEN_SOURCE really is set" >&5
4165 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4166         cat >conftest.$ac_ext <<_ACEOF
4167 #line 4167 "configure"
4168 #include "confdefs.h"
4169 #include <stdlib.h>
4170 int
4171 main ()
4172 {
4173
4174 #ifndef _XOPEN_SOURCE
4175 make an error
4176 #endif
4177   ;
4178   return 0;
4179 }
4180 _ACEOF
4181 rm -f conftest.$ac_objext
4182 if { (eval echo "$as_me:4182: \"$ac_compile\"") >&5
4183   (eval $ac_compile) 2>&5
4184   ac_status=$?
4185   echo "$as_me:4185: \$? = $ac_status" >&5
4186   (exit $ac_status); } &&
4187          { ac_try='test -s conftest.$ac_objext'
4188   { (eval echo "$as_me:4188: \"$ac_try\"") >&5
4189   (eval $ac_try) 2>&5
4190   ac_status=$?
4191   echo "$as_me:4191: \$? = $ac_status" >&5
4192   (exit $ac_status); }; }; then
4193   cf_XOPEN_SOURCE_set=yes
4194 else
4195   echo "$as_me: failed program was:" >&5
4196 cat conftest.$ac_ext >&5
4197 cf_XOPEN_SOURCE_set=no
4198 fi
4199 rm -f conftest.$ac_objext conftest.$ac_ext
4200         echo "$as_me:4200: result: $cf_XOPEN_SOURCE_set" >&5
4201 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4202         if test $cf_XOPEN_SOURCE_set = yes
4203         then
4204                 cat >conftest.$ac_ext <<_ACEOF
4205 #line 4205 "configure"
4206 #include "confdefs.h"
4207 #include <stdlib.h>
4208 int
4209 main ()
4210 {
4211
4212 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4213 make an error
4214 #endif
4215   ;
4216   return 0;
4217 }
4218 _ACEOF
4219 rm -f conftest.$ac_objext
4220 if { (eval echo "$as_me:4220: \"$ac_compile\"") >&5
4221   (eval $ac_compile) 2>&5
4222   ac_status=$?
4223   echo "$as_me:4223: \$? = $ac_status" >&5
4224   (exit $ac_status); } &&
4225          { ac_try='test -s conftest.$ac_objext'
4226   { (eval echo "$as_me:4226: \"$ac_try\"") >&5
4227   (eval $ac_try) 2>&5
4228   ac_status=$?
4229   echo "$as_me:4229: \$? = $ac_status" >&5
4230   (exit $ac_status); }; }; then
4231   cf_XOPEN_SOURCE_set_ok=yes
4232 else
4233   echo "$as_me: failed program was:" >&5
4234 cat conftest.$ac_ext >&5
4235 cf_XOPEN_SOURCE_set_ok=no
4236 fi
4237 rm -f conftest.$ac_objext conftest.$ac_ext
4238                 if test $cf_XOPEN_SOURCE_set_ok = no
4239                 then
4240                         { echo "$as_me:4240: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4241 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4242                 fi
4243         else
4244
4245 echo "$as_me:4245: checking if we should define _XOPEN_SOURCE" >&5
4246 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4247 if test "${cf_cv_xopen_source+set}" = set; then
4248   echo $ECHO_N "(cached) $ECHO_C" >&6
4249 else
4250
4251         cat >conftest.$ac_ext <<_ACEOF
4252 #line 4252 "configure"
4253 #include "confdefs.h"
4254
4255 #include <stdlib.h>
4256 #include <string.h>
4257 #include <sys/types.h>
4258
4259 int
4260 main ()
4261 {
4262
4263 #ifndef _XOPEN_SOURCE
4264 make an error
4265 #endif
4266   ;
4267   return 0;
4268 }
4269 _ACEOF
4270 rm -f conftest.$ac_objext
4271 if { (eval echo "$as_me:4271: \"$ac_compile\"") >&5
4272   (eval $ac_compile) 2>&5
4273   ac_status=$?
4274   echo "$as_me:4274: \$? = $ac_status" >&5
4275   (exit $ac_status); } &&
4276          { ac_try='test -s conftest.$ac_objext'
4277   { (eval echo "$as_me:4277: \"$ac_try\"") >&5
4278   (eval $ac_try) 2>&5
4279   ac_status=$?
4280   echo "$as_me:4280: \$? = $ac_status" >&5
4281   (exit $ac_status); }; }; then
4282   cf_cv_xopen_source=no
4283 else
4284   echo "$as_me: failed program was:" >&5
4285 cat conftest.$ac_ext >&5
4286 cf_save="$CPPFLAGS"
4287          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4288          cat >conftest.$ac_ext <<_ACEOF
4289 #line 4289 "configure"
4290 #include "confdefs.h"
4291
4292 #include <stdlib.h>
4293 #include <string.h>
4294 #include <sys/types.h>
4295
4296 int
4297 main ()
4298 {
4299
4300 #ifdef _XOPEN_SOURCE
4301 make an error
4302 #endif
4303   ;
4304   return 0;
4305 }
4306 _ACEOF
4307 rm -f conftest.$ac_objext
4308 if { (eval echo "$as_me:4308: \"$ac_compile\"") >&5
4309   (eval $ac_compile) 2>&5
4310   ac_status=$?
4311   echo "$as_me:4311: \$? = $ac_status" >&5
4312   (exit $ac_status); } &&
4313          { ac_try='test -s conftest.$ac_objext'
4314   { (eval echo "$as_me:4314: \"$ac_try\"") >&5
4315   (eval $ac_try) 2>&5
4316   ac_status=$?
4317   echo "$as_me:4317: \$? = $ac_status" >&5
4318   (exit $ac_status); }; }; then
4319   cf_cv_xopen_source=no
4320 else
4321   echo "$as_me: failed program was:" >&5
4322 cat conftest.$ac_ext >&5
4323 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4324 fi
4325 rm -f conftest.$ac_objext conftest.$ac_ext
4326         CPPFLAGS="$cf_save"
4327
4328 fi
4329 rm -f conftest.$ac_objext conftest.$ac_ext
4330
4331 fi
4332 echo "$as_me:4332: result: $cf_cv_xopen_source" >&5
4333 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4334
4335 if test "$cf_cv_xopen_source" != no ; then
4336
4337 CFLAGS=`echo "$CFLAGS" | \
4338         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4339                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4340
4341 CPPFLAGS=`echo "$CPPFLAGS" | \
4342         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4343                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4344
4345         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4346
4347 cf_fix_cppflags=no
4348 cf_new_cflags=
4349 cf_new_cppflags=
4350 cf_new_extra_cppflags=
4351
4352 for cf_add_cflags in $cf_temp_xopen_source
4353 do
4354 case $cf_fix_cppflags in
4355 (no)
4356         case $cf_add_cflags in
4357         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4358                 case $cf_add_cflags in
4359                 (-D*)
4360                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4361
4362                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4363                                 && test -z "${cf_tst_cflags}" \
4364                                 && cf_fix_cppflags=yes
4365
4366                         if test $cf_fix_cppflags = yes ; then
4367
4368         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4369         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4370
4371                                 continue
4372                         elif test "${cf_tst_cflags}" = "\"'" ; then
4373
4374         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4375         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4376
4377                                 continue
4378                         fi
4379                         ;;
4380                 esac
4381                 case "$CPPFLAGS" in
4382                 (*$cf_add_cflags)
4383                         ;;
4384                 (*)
4385                         case $cf_add_cflags in
4386                         (-D*)
4387                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4388
4389 CPPFLAGS=`echo "$CPPFLAGS" | \
4390         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4391                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4392
4393                                 ;;
4394                         esac
4395
4396         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4397         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4398
4399                         ;;
4400                 esac
4401                 ;;
4402         (*)
4403
4404         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4405         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4406
4407                 ;;
4408         esac
4409         ;;
4410 (yes)
4411
4412         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4413         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4414
4415         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4416
4417         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4418                 && test -z "${cf_tst_cflags}" \
4419                 && cf_fix_cppflags=no
4420         ;;
4421 esac
4422 done
4423
4424 if test -n "$cf_new_cflags" ; then
4425
4426         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4427         CFLAGS="${CFLAGS}$cf_new_cflags"
4428
4429 fi
4430
4431 if test -n "$cf_new_cppflags" ; then
4432
4433         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4434         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4435
4436 fi
4437
4438 if test -n "$cf_new_extra_cppflags" ; then
4439
4440         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4441         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4442
4443 fi
4444
4445 fi
4446
4447         fi
4448 fi
4449
4450 echo "$as_me:4450: checking for signal global datatype" >&5
4451 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4452 if test "${cf_cv_sig_atomic_t+set}" = set; then
4453   echo $ECHO_N "(cached) $ECHO_C" >&6
4454 else
4455
4456         for cf_type in \
4457                 "volatile sig_atomic_t" \
4458                 "sig_atomic_t" \
4459                 "int"
4460         do
4461         cat >conftest.$ac_ext <<_ACEOF
4462 #line 4462 "configure"
4463 #include "confdefs.h"
4464
4465 #include <sys/types.h>
4466 #include <signal.h>
4467 #include <stdio.h>
4468
4469 extern $cf_type x;
4470 $cf_type x;
4471 static void handler(int sig)
4472 {
4473         x = 5;
4474 }
4475 int
4476 main ()
4477 {
4478 signal(SIGINT, handler);
4479                  x = 1
4480   ;
4481   return 0;
4482 }
4483 _ACEOF
4484 rm -f conftest.$ac_objext
4485 if { (eval echo "$as_me:4485: \"$ac_compile\"") >&5
4486   (eval $ac_compile) 2>&5
4487   ac_status=$?
4488   echo "$as_me:4488: \$? = $ac_status" >&5
4489   (exit $ac_status); } &&
4490          { ac_try='test -s conftest.$ac_objext'
4491   { (eval echo "$as_me:4491: \"$ac_try\"") >&5
4492   (eval $ac_try) 2>&5
4493   ac_status=$?
4494   echo "$as_me:4494: \$? = $ac_status" >&5
4495   (exit $ac_status); }; }; then
4496   cf_cv_sig_atomic_t=$cf_type
4497 else
4498   echo "$as_me: failed program was:" >&5
4499 cat conftest.$ac_ext >&5
4500 cf_cv_sig_atomic_t=no
4501 fi
4502 rm -f conftest.$ac_objext conftest.$ac_ext
4503                 test "$cf_cv_sig_atomic_t" != no && break
4504         done
4505
4506 fi
4507
4508 echo "$as_me:4508: result: $cf_cv_sig_atomic_t" >&5
4509 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4510 test "$cf_cv_sig_atomic_t" != no &&
4511 cat >>confdefs.h <<EOF
4512 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4513 EOF
4514
4515 # Work around breakage on OS X
4516
4517 echo "$as_me:4517: checking if SIGWINCH is defined" >&5
4518 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4519 if test "${cf_cv_define_sigwinch+set}" = set; then
4520   echo $ECHO_N "(cached) $ECHO_C" >&6
4521 else
4522
4523         cat >conftest.$ac_ext <<_ACEOF
4524 #line 4524 "configure"
4525 #include "confdefs.h"
4526
4527 #include <sys/types.h>
4528 #include <sys/signal.h>
4529
4530 int
4531 main ()
4532 {
4533 int x = SIGWINCH
4534   ;
4535   return 0;
4536 }
4537 _ACEOF
4538 rm -f conftest.$ac_objext
4539 if { (eval echo "$as_me:4539: \"$ac_compile\"") >&5
4540   (eval $ac_compile) 2>&5
4541   ac_status=$?
4542   echo "$as_me:4542: \$? = $ac_status" >&5
4543   (exit $ac_status); } &&
4544          { ac_try='test -s conftest.$ac_objext'
4545   { (eval echo "$as_me:4545: \"$ac_try\"") >&5
4546   (eval $ac_try) 2>&5
4547   ac_status=$?
4548   echo "$as_me:4548: \$? = $ac_status" >&5
4549   (exit $ac_status); }; }; then
4550   cf_cv_define_sigwinch=yes
4551 else
4552   echo "$as_me: failed program was:" >&5
4553 cat conftest.$ac_ext >&5
4554 cat >conftest.$ac_ext <<_ACEOF
4555 #line 4555 "configure"
4556 #include "confdefs.h"
4557
4558 #undef _XOPEN_SOURCE
4559 #undef _POSIX_SOURCE
4560 #undef _POSIX_C_SOURCE
4561 #include <sys/types.h>
4562 #include <sys/signal.h>
4563
4564 int
4565 main ()
4566 {
4567 int x = SIGWINCH
4568   ;
4569   return 0;
4570 }
4571 _ACEOF
4572 rm -f conftest.$ac_objext
4573 if { (eval echo "$as_me:4573: \"$ac_compile\"") >&5
4574   (eval $ac_compile) 2>&5
4575   ac_status=$?
4576   echo "$as_me:4576: \$? = $ac_status" >&5
4577   (exit $ac_status); } &&
4578          { ac_try='test -s conftest.$ac_objext'
4579   { (eval echo "$as_me:4579: \"$ac_try\"") >&5
4580   (eval $ac_try) 2>&5
4581   ac_status=$?
4582   echo "$as_me:4582: \$? = $ac_status" >&5
4583   (exit $ac_status); }; }; then
4584   cf_cv_define_sigwinch=maybe
4585 else
4586   echo "$as_me: failed program was:" >&5
4587 cat conftest.$ac_ext >&5
4588 cf_cv_define_sigwinch=no
4589 fi
4590 rm -f conftest.$ac_objext conftest.$ac_ext
4591
4592 fi
4593 rm -f conftest.$ac_objext conftest.$ac_ext
4594
4595 fi
4596 echo "$as_me:4596: result: $cf_cv_define_sigwinch" >&5
4597 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4598
4599 if test "$cf_cv_define_sigwinch" = maybe ; then
4600 echo "$as_me:4600: checking for actual SIGWINCH definition" >&5
4601 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4602 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4603   echo $ECHO_N "(cached) $ECHO_C" >&6
4604 else
4605
4606 cf_cv_fixup_sigwinch=unknown
4607 cf_sigwinch=32
4608 while test $cf_sigwinch != 1
4609 do
4610         cat >conftest.$ac_ext <<_ACEOF
4611 #line 4611 "configure"
4612 #include "confdefs.h"
4613
4614 #undef _XOPEN_SOURCE
4615 #undef _POSIX_SOURCE
4616 #undef _POSIX_C_SOURCE
4617 #include <sys/types.h>
4618 #include <sys/signal.h>
4619
4620 int
4621 main ()
4622 {
4623
4624 #if SIGWINCH != $cf_sigwinch
4625 make an error
4626 #endif
4627 int x = SIGWINCH
4628   ;
4629   return 0;
4630 }
4631 _ACEOF
4632 rm -f conftest.$ac_objext
4633 if { (eval echo "$as_me:4633: \"$ac_compile\"") >&5
4634   (eval $ac_compile) 2>&5
4635   ac_status=$?
4636   echo "$as_me:4636: \$? = $ac_status" >&5
4637   (exit $ac_status); } &&
4638          { ac_try='test -s conftest.$ac_objext'
4639   { (eval echo "$as_me:4639: \"$ac_try\"") >&5
4640   (eval $ac_try) 2>&5
4641   ac_status=$?
4642   echo "$as_me:4642: \$? = $ac_status" >&5
4643   (exit $ac_status); }; }; then
4644   cf_cv_fixup_sigwinch=$cf_sigwinch
4645          break
4646 else
4647   echo "$as_me: failed program was:" >&5
4648 cat conftest.$ac_ext >&5
4649 fi
4650 rm -f conftest.$ac_objext conftest.$ac_ext
4651
4652 cf_sigwinch=`expr $cf_sigwinch - 1`
4653 done
4654
4655 fi
4656 echo "$as_me:4656: result: $cf_cv_fixup_sigwinch" >&5
4657 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4658
4659         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4660                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4661         fi
4662 fi
4663
4664 # Checks for CODESET support.
4665
4666 echo "$as_me:4666: checking for nl_langinfo and CODESET" >&5
4667 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4668 if test "${am_cv_langinfo_codeset+set}" = set; then
4669   echo $ECHO_N "(cached) $ECHO_C" >&6
4670 else
4671   cat >conftest.$ac_ext <<_ACEOF
4672 #line 4672 "configure"
4673 #include "confdefs.h"
4674 #include <langinfo.h>
4675 int
4676 main ()
4677 {
4678 char* cs = nl_langinfo(CODESET);
4679   ;
4680   return 0;
4681 }
4682 _ACEOF
4683 rm -f conftest.$ac_objext conftest$ac_exeext
4684 if { (eval echo "$as_me:4684: \"$ac_link\"") >&5
4685   (eval $ac_link) 2>&5
4686   ac_status=$?
4687   echo "$as_me:4687: \$? = $ac_status" >&5
4688   (exit $ac_status); } &&
4689          { ac_try='test -s conftest$ac_exeext'
4690   { (eval echo "$as_me:4690: \"$ac_try\"") >&5
4691   (eval $ac_try) 2>&5
4692   ac_status=$?
4693   echo "$as_me:4693: \$? = $ac_status" >&5
4694   (exit $ac_status); }; }; then
4695   am_cv_langinfo_codeset=yes
4696 else
4697   echo "$as_me: failed program was:" >&5
4698 cat conftest.$ac_ext >&5
4699 am_cv_langinfo_codeset=no
4700 fi
4701 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4702
4703 fi
4704 echo "$as_me:4704: result: $am_cv_langinfo_codeset" >&5
4705 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4706         if test $am_cv_langinfo_codeset = yes; then
4707
4708 cat >>confdefs.h <<\EOF
4709 #define HAVE_LANGINFO_CODESET 1
4710 EOF
4711
4712         fi
4713
4714 echo "$as_me:4714: checking if you want to use pkg-config" >&5
4715 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4716
4717 # Check whether --with-pkg-config or --without-pkg-config was given.
4718 if test "${with_pkg_config+set}" = set; then
4719   withval="$with_pkg_config"
4720   cf_pkg_config=$withval
4721 else
4722   cf_pkg_config=yes
4723 fi;
4724 echo "$as_me:4724: result: $cf_pkg_config" >&5
4725 echo "${ECHO_T}$cf_pkg_config" >&6
4726
4727 case $cf_pkg_config in
4728 (no)
4729         PKG_CONFIG=none
4730         ;;
4731 (yes)
4732
4733 if test -n "$ac_tool_prefix"; then
4734   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4735 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4736 echo "$as_me:4736: checking for $ac_word" >&5
4737 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4738 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4739   echo $ECHO_N "(cached) $ECHO_C" >&6
4740 else
4741   case $PKG_CONFIG in
4742   [\\/]* | ?:[\\/]*)
4743   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4744   ;;
4745   *)
4746   ac_save_IFS=$IFS; IFS=$ac_path_separator
4747 ac_dummy="$PATH"
4748 for ac_dir in $ac_dummy; do
4749   IFS=$ac_save_IFS
4750   test -z "$ac_dir" && ac_dir=.
4751   if $as_executable_p "$ac_dir/$ac_word"; then
4752    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4753    echo "$as_me:4753: found $ac_dir/$ac_word" >&5
4754    break
4755 fi
4756 done
4757
4758   ;;
4759 esac
4760 fi
4761 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4762
4763 if test -n "$PKG_CONFIG"; then
4764   echo "$as_me:4764: result: $PKG_CONFIG" >&5
4765 echo "${ECHO_T}$PKG_CONFIG" >&6
4766 else
4767   echo "$as_me:4767: result: no" >&5
4768 echo "${ECHO_T}no" >&6
4769 fi
4770
4771 fi
4772 if test -z "$ac_cv_path_PKG_CONFIG"; then
4773   ac_pt_PKG_CONFIG=$PKG_CONFIG
4774   # Extract the first word of "pkg-config", so it can be a program name with args.
4775 set dummy pkg-config; ac_word=$2
4776 echo "$as_me:4776: checking for $ac_word" >&5
4777 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4778 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4779   echo $ECHO_N "(cached) $ECHO_C" >&6
4780 else
4781   case $ac_pt_PKG_CONFIG in
4782   [\\/]* | ?:[\\/]*)
4783   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4784   ;;
4785   *)
4786   ac_save_IFS=$IFS; IFS=$ac_path_separator
4787 ac_dummy="$PATH"
4788 for ac_dir in $ac_dummy; do
4789   IFS=$ac_save_IFS
4790   test -z "$ac_dir" && ac_dir=.
4791   if $as_executable_p "$ac_dir/$ac_word"; then
4792    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4793    echo "$as_me:4793: found $ac_dir/$ac_word" >&5
4794    break
4795 fi
4796 done
4797
4798   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4799   ;;
4800 esac
4801 fi
4802 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4803
4804 if test -n "$ac_pt_PKG_CONFIG"; then
4805   echo "$as_me:4805: result: $ac_pt_PKG_CONFIG" >&5
4806 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4807 else
4808   echo "$as_me:4808: result: no" >&5
4809 echo "${ECHO_T}no" >&6
4810 fi
4811
4812   PKG_CONFIG=$ac_pt_PKG_CONFIG
4813 else
4814   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4815 fi
4816
4817         ;;
4818 (*)
4819         PKG_CONFIG=$withval
4820         ;;
4821 esac
4822
4823 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4824 if test "$PKG_CONFIG" != none ; then
4825
4826 if test "x$prefix" != xNONE; then
4827         cf_path_syntax="$prefix"
4828 else
4829         cf_path_syntax="$ac_default_prefix"
4830 fi
4831
4832 case ".$PKG_CONFIG" in
4833 (.\$\(*\)*|.\'*\'*)
4834         ;;
4835 (..|./*|.\\*)
4836         ;;
4837 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4838         ;;
4839 (.\${*prefix}*|.\${*dir}*)
4840         eval PKG_CONFIG="$PKG_CONFIG"
4841         case ".$PKG_CONFIG" in
4842         (.NONE/*)
4843                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4844                 ;;
4845         esac
4846         ;;
4847 (.no|.NONE/*)
4848         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4849         ;;
4850 (*)
4851         { { echo "$as_me:4851: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4852 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4853    { (exit 1); exit 1; }; }
4854         ;;
4855 esac
4856
4857 elif test "x$cf_pkg_config" != xno ; then
4858         { echo "$as_me:4858: WARNING: pkg-config is not installed" >&5
4859 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4860 fi
4861
4862 echo "$as_me:4862: checking if you want to see long compiling messages" >&5
4863 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4864
4865 # Check whether --enable-echo or --disable-echo was given.
4866 if test "${enable_echo+set}" = set; then
4867   enableval="$enable_echo"
4868   test "$enableval" != no && enableval=yes
4869         if test "$enableval" != "yes" ; then
4870
4871         ECHO_LT='--silent'
4872         ECHO_LD='@echo linking $@;'
4873         RULE_CC='@echo compiling $<'
4874         SHOW_CC='@echo compiling $@'
4875         ECHO_CC='@'
4876
4877         else
4878
4879         ECHO_LT=''
4880         ECHO_LD=''
4881         RULE_CC=''
4882         SHOW_CC=''
4883         ECHO_CC=''
4884
4885         fi
4886 else
4887   enableval=yes
4888
4889         ECHO_LT=''
4890         ECHO_LD=''
4891         RULE_CC=''
4892         SHOW_CC=''
4893         ECHO_CC=''
4894
4895 fi;
4896 echo "$as_me:4896: result: $enableval" >&5
4897 echo "${ECHO_T}$enableval" >&6
4898
4899 echo "$as_me:4899: checking for ncurses wrap-prefix" >&5
4900 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4901
4902 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4903 if test "${with_ncurses_wrap_prefix+set}" = set; then
4904   withval="$with_ncurses_wrap_prefix"
4905   NCURSES_WRAP_PREFIX=$withval
4906 else
4907   NCURSES_WRAP_PREFIX=_nc_
4908 fi;
4909 echo "$as_me:4909: result: $NCURSES_WRAP_PREFIX" >&5
4910 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4911
4912 echo "$as_me:4912: checking if you want to check for wide-character functions" >&5
4913 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4914
4915 # Check whether --enable-widec or --disable-widec was given.
4916 if test "${enable_widec+set}" = set; then
4917   enableval="$enable_widec"
4918   test "$enableval" != no && enableval=yes
4919         if test "$enableval" != "yes" ; then
4920     cf_enable_widec=no
4921         else
4922                 cf_enable_widec=yes
4923         fi
4924 else
4925   enableval=yes
4926         cf_enable_widec=yes
4927
4928 fi;
4929 echo "$as_me:4929: result: $cf_enable_widec" >&5
4930 echo "${ECHO_T}$cf_enable_widec" >&6
4931
4932 echo "$as_me:4932: checking for specific curses-directory" >&5
4933 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4934
4935 # Check whether --with-curses-dir or --without-curses-dir was given.
4936 if test "${with_curses_dir+set}" = set; then
4937   withval="$with_curses_dir"
4938   cf_cv_curses_dir=$withval
4939 else
4940   cf_cv_curses_dir=no
4941 fi;
4942 echo "$as_me:4942: result: $cf_cv_curses_dir" >&5
4943 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4944
4945 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4946 then
4947
4948 if test "x$prefix" != xNONE; then
4949         cf_path_syntax="$prefix"
4950 else
4951         cf_path_syntax="$ac_default_prefix"
4952 fi
4953
4954 case ".$withval" in
4955 (.\$\(*\)*|.\'*\'*)
4956         ;;
4957 (..|./*|.\\*)
4958         ;;
4959 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4960         ;;
4961 (.\${*prefix}*|.\${*dir}*)
4962         eval withval="$withval"
4963         case ".$withval" in
4964         (.NONE/*)
4965                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4966                 ;;
4967         esac
4968         ;;
4969 (.no|.NONE/*)
4970         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4971         ;;
4972 (*)
4973         { { echo "$as_me:4973: error: expected a pathname, not \"$withval\"" >&5
4974 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4975    { (exit 1); exit 1; }; }
4976         ;;
4977 esac
4978
4979         if test -d "$cf_cv_curses_dir"
4980         then
4981
4982 if test -n "$cf_cv_curses_dir/include" ; then
4983   for cf_add_incdir in $cf_cv_curses_dir/include
4984   do
4985         while test $cf_add_incdir != /usr/include
4986         do
4987           if test -d $cf_add_incdir
4988           then
4989                 cf_have_incdir=no
4990                 if test -n "$CFLAGS$CPPFLAGS" ; then
4991                   # a loop is needed to ensure we can add subdirs of existing dirs
4992                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4993                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4994                           cf_have_incdir=yes; break
4995                         fi
4996                   done
4997                 fi
4998
4999                 if test "$cf_have_incdir" = no ; then
5000                   if test "$cf_add_incdir" = /usr/local/include ; then
5001                         if test "$GCC" = yes
5002                         then
5003                           cf_save_CPPFLAGS=$CPPFLAGS
5004                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5005                           cat >conftest.$ac_ext <<_ACEOF
5006 #line 5006 "configure"
5007 #include "confdefs.h"
5008 #include <stdio.h>
5009 int
5010 main ()
5011 {
5012 printf("Hello")
5013   ;
5014   return 0;
5015 }
5016 _ACEOF
5017 rm -f conftest.$ac_objext
5018 if { (eval echo "$as_me:5018: \"$ac_compile\"") >&5
5019   (eval $ac_compile) 2>&5
5020   ac_status=$?
5021   echo "$as_me:5021: \$? = $ac_status" >&5
5022   (exit $ac_status); } &&
5023          { ac_try='test -s conftest.$ac_objext'
5024   { (eval echo "$as_me:5024: \"$ac_try\"") >&5
5025   (eval $ac_try) 2>&5
5026   ac_status=$?
5027   echo "$as_me:5027: \$? = $ac_status" >&5
5028   (exit $ac_status); }; }; then
5029   :
5030 else
5031   echo "$as_me: failed program was:" >&5
5032 cat conftest.$ac_ext >&5
5033 cf_have_incdir=yes
5034 fi
5035 rm -f conftest.$ac_objext conftest.$ac_ext
5036                           CPPFLAGS=$cf_save_CPPFLAGS
5037                         fi
5038                   fi
5039                 fi
5040
5041                 if test "$cf_have_incdir" = no ; then
5042                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5043
5044 echo "${as_me:-configure}:5044: testing adding $cf_add_incdir to include-path ..." 1>&5
5045
5046                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5047
5048                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5049                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5050                   cf_add_incdir="$cf_top_incdir"
5051                 else
5052                   break
5053                 fi
5054           else
5055                 break
5056           fi
5057         done
5058   done
5059 fi
5060
5061 if test -n "$cf_cv_curses_dir/lib" ; then
5062         for cf_add_libdir in $cf_cv_curses_dir/lib
5063         do
5064                 if test $cf_add_libdir = /usr/lib ; then
5065                         :
5066                 elif test -d $cf_add_libdir
5067                 then
5068                         cf_have_libdir=no
5069                         if test -n "$LDFLAGS$LIBS" ; then
5070                                 # a loop is needed to ensure we can add subdirs of existing dirs
5071                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5072                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5073                                                 cf_have_libdir=yes; break
5074                                         fi
5075                                 done
5076                         fi
5077                         if test "$cf_have_libdir" = no ; then
5078                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5079
5080 echo "${as_me:-configure}:5080: testing adding $cf_add_libdir to library-path ..." 1>&5
5081
5082                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5083                         fi
5084                 fi
5085         done
5086 fi
5087
5088         fi
5089 fi
5090
5091 cf_cv_screen=curses
5092
5093 echo "$as_me:5093: checking for specified curses library type" >&5
5094 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5095
5096 # Check whether --with-screen or --without-screen was given.
5097 if test "${with_screen+set}" = set; then
5098   withval="$with_screen"
5099   cf_cv_screen=$withval
5100 else
5101
5102 # Check whether --with-ncursesw or --without-ncursesw was given.
5103 if test "${with_ncursesw+set}" = set; then
5104   withval="$with_ncursesw"
5105   cf_cv_screen=ncursesw
5106 else
5107
5108 # Check whether --with-ncurses or --without-ncurses was given.
5109 if test "${with_ncurses+set}" = set; then
5110   withval="$with_ncurses"
5111   cf_cv_screen=ncurses
5112 else
5113
5114 # Check whether --with-pdcurses or --without-pdcurses was given.
5115 if test "${with_pdcurses+set}" = set; then
5116   withval="$with_pdcurses"
5117   cf_cv_screen=pdcurses
5118 else
5119
5120 # Check whether --with-curses-colr or --without-curses-colr was given.
5121 if test "${with_curses_colr+set}" = set; then
5122   withval="$with_curses_colr"
5123   cf_cv_screen=curses_colr
5124 else
5125
5126 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5127 if test "${with_curses_5lib+set}" = set; then
5128   withval="$with_curses_5lib"
5129   cf_cv_screen=curses_5lib
5130 fi;
5131 fi;
5132 fi;
5133 fi;
5134 fi;
5135 fi;
5136
5137 echo "$as_me:5137: result: $cf_cv_screen" >&5
5138 echo "${ECHO_T}$cf_cv_screen" >&6
5139
5140 case $cf_cv_screen in
5141 (curses|curses_*)
5142
5143 echo "$as_me:5143: checking for extra include directories" >&5
5144 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5145 if test "${cf_cv_curses_incdir+set}" = set; then
5146   echo $ECHO_N "(cached) $ECHO_C" >&6
5147 else
5148
5149 cf_cv_curses_incdir=no
5150 case $host_os in
5151 (hpux10.*)
5152         if test "x$cf_cv_screen" = "xcurses_colr"
5153         then
5154                 test -d /usr/include/curses_colr && \
5155                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5156         fi
5157         ;;
5158 (sunos3*|sunos4*)
5159         if test "x$cf_cv_screen" = "xcurses_5lib"
5160         then
5161                 test -d /usr/5lib && \
5162                 test -d /usr/5include && \
5163                 cf_cv_curses_incdir="-I/usr/5include"
5164         fi
5165         ;;
5166 esac
5167
5168 fi
5169 echo "$as_me:5169: result: $cf_cv_curses_incdir" >&5
5170 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5171 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5172
5173 echo "$as_me:5173: checking if we have identified curses headers" >&5
5174 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5175 if test "${cf_cv_ncurses_header+set}" = set; then
5176   echo $ECHO_N "(cached) $ECHO_C" >&6
5177 else
5178
5179 cf_cv_ncurses_header=none
5180 for cf_header in \
5181         ncurses.h  \
5182         curses.h  ncurses/ncurses.h ncurses/curses.h
5183 do
5184 cat >conftest.$ac_ext <<_ACEOF
5185 #line 5185 "configure"
5186 #include "confdefs.h"
5187 #include <${cf_header}>
5188 int
5189 main ()
5190 {
5191 initscr(); tgoto("?", 0,0)
5192   ;
5193   return 0;
5194 }
5195 _ACEOF
5196 rm -f conftest.$ac_objext
5197 if { (eval echo "$as_me:5197: \"$ac_compile\"") >&5
5198   (eval $ac_compile) 2>&5
5199   ac_status=$?
5200   echo "$as_me:5200: \$? = $ac_status" >&5
5201   (exit $ac_status); } &&
5202          { ac_try='test -s conftest.$ac_objext'
5203   { (eval echo "$as_me:5203: \"$ac_try\"") >&5
5204   (eval $ac_try) 2>&5
5205   ac_status=$?
5206   echo "$as_me:5206: \$? = $ac_status" >&5
5207   (exit $ac_status); }; }; then
5208   cf_cv_ncurses_header=$cf_header; break
5209 else
5210   echo "$as_me: failed program was:" >&5
5211 cat conftest.$ac_ext >&5
5212 fi
5213 rm -f conftest.$ac_objext conftest.$ac_ext
5214 done
5215
5216 fi
5217 echo "$as_me:5217: result: $cf_cv_ncurses_header" >&5
5218 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5219
5220 if test "$cf_cv_ncurses_header" = none ; then
5221         { { echo "$as_me:5221: error: No curses header-files found" >&5
5222 echo "$as_me: error: No curses header-files found" >&2;}
5223    { (exit 1); exit 1; }; }
5224 fi
5225
5226 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5227
5228 for ac_header in $cf_cv_ncurses_header
5229 do
5230 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5231 echo "$as_me:5231: checking for $ac_header" >&5
5232 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5233 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5234   echo $ECHO_N "(cached) $ECHO_C" >&6
5235 else
5236   cat >conftest.$ac_ext <<_ACEOF
5237 #line 5237 "configure"
5238 #include "confdefs.h"
5239 #include <$ac_header>
5240 _ACEOF
5241 if { (eval echo "$as_me:5241: \"$ac_cpp conftest.$ac_ext\"") >&5
5242   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5243   ac_status=$?
5244   egrep -v '^ *\+' conftest.er1 >conftest.err
5245   rm -f conftest.er1
5246   cat conftest.err >&5
5247   echo "$as_me:5247: \$? = $ac_status" >&5
5248   (exit $ac_status); } >/dev/null; then
5249   if test -s conftest.err; then
5250     ac_cpp_err=$ac_c_preproc_warn_flag
5251   else
5252     ac_cpp_err=
5253   fi
5254 else
5255   ac_cpp_err=yes
5256 fi
5257 if test -z "$ac_cpp_err"; then
5258   eval "$as_ac_Header=yes"
5259 else
5260   echo "$as_me: failed program was:" >&5
5261   cat conftest.$ac_ext >&5
5262   eval "$as_ac_Header=no"
5263 fi
5264 rm -f conftest.err conftest.$ac_ext
5265 fi
5266 echo "$as_me:5266: result: `eval echo '${'$as_ac_Header'}'`" >&5
5267 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5268 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5269   cat >>confdefs.h <<EOF
5270 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5271 EOF
5272
5273 fi
5274 done
5275
5276 echo "$as_me:5276: checking for terminfo header" >&5
5277 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5278 if test "${cf_cv_term_header+set}" = set; then
5279   echo $ECHO_N "(cached) $ECHO_C" >&6
5280 else
5281
5282 case ${cf_cv_ncurses_header} in
5283 (*/ncurses.h|*/ncursesw.h)
5284         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5285         ;;
5286 (*)
5287         cf_term_header=term.h
5288         ;;
5289 esac
5290
5291 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5292 do
5293 cat >conftest.$ac_ext <<_ACEOF
5294 #line 5294 "configure"
5295 #include "confdefs.h"
5296 #include <stdio.h>
5297 #include <${cf_cv_ncurses_header:-curses.h}>
5298 #include <$cf_test>
5299
5300 int
5301 main ()
5302 {
5303 int x = auto_left_margin
5304   ;
5305   return 0;
5306 }
5307 _ACEOF
5308 rm -f conftest.$ac_objext
5309 if { (eval echo "$as_me:5309: \"$ac_compile\"") >&5
5310   (eval $ac_compile) 2>&5
5311   ac_status=$?
5312   echo "$as_me:5312: \$? = $ac_status" >&5
5313   (exit $ac_status); } &&
5314          { ac_try='test -s conftest.$ac_objext'
5315   { (eval echo "$as_me:5315: \"$ac_try\"") >&5
5316   (eval $ac_try) 2>&5
5317   ac_status=$?
5318   echo "$as_me:5318: \$? = $ac_status" >&5
5319   (exit $ac_status); }; }; then
5320
5321         cf_cv_term_header="$cf_test"
5322 else
5323   echo "$as_me: failed program was:" >&5
5324 cat conftest.$ac_ext >&5
5325
5326         cf_cv_term_header=unknown
5327
5328 fi
5329 rm -f conftest.$ac_objext conftest.$ac_ext
5330         test "$cf_cv_term_header" != unknown && break
5331 done
5332
5333 fi
5334 echo "$as_me:5334: result: $cf_cv_term_header" >&5
5335 echo "${ECHO_T}$cf_cv_term_header" >&6
5336
5337 # Set definitions to allow ifdef'ing to accommodate subdirectories
5338
5339 case $cf_cv_term_header in
5340 (*term.h)
5341
5342 cat >>confdefs.h <<\EOF
5343 #define HAVE_TERM_H 1
5344 EOF
5345
5346         ;;
5347 esac
5348
5349 case $cf_cv_term_header in
5350 (ncurses/term.h)
5351
5352 cat >>confdefs.h <<\EOF
5353 #define HAVE_NCURSES_TERM_H 1
5354 EOF
5355
5356         ;;
5357 (ncursesw/term.h)
5358
5359 cat >>confdefs.h <<\EOF
5360 #define HAVE_NCURSESW_TERM_H 1
5361 EOF
5362
5363         ;;
5364 esac
5365
5366 echo "$as_me:5366: checking for ncurses version" >&5
5367 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5368 if test "${cf_cv_ncurses_version+set}" = set; then
5369   echo $ECHO_N "(cached) $ECHO_C" >&6
5370 else
5371
5372         cf_cv_ncurses_version=no
5373         cf_tempfile=out$$
5374         rm -f $cf_tempfile
5375         if test "$cross_compiling" = yes; then
5376
5377         # This will not work if the preprocessor splits the line after the
5378         # Autoconf token.  The 'unproto' program does that.
5379         cat > conftest.$ac_ext <<EOF
5380 #include <${cf_cv_ncurses_header:-curses.h}>
5381 #undef Autoconf
5382 #ifdef NCURSES_VERSION
5383 Autoconf NCURSES_VERSION
5384 #else
5385 #ifdef __NCURSES_H
5386 Autoconf "old"
5387 #endif
5388 ;
5389 #endif
5390 EOF
5391         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5392         { (eval echo "$as_me:5392: \"$cf_try\"") >&5
5393   (eval $cf_try) 2>&5
5394   ac_status=$?
5395   echo "$as_me:5395: \$? = $ac_status" >&5
5396   (exit $ac_status); }
5397         if test -f conftest.out ; then
5398                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5399                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5400                 rm -f conftest.out
5401         fi
5402
5403 else
5404   cat >conftest.$ac_ext <<_ACEOF
5405 #line 5405 "configure"
5406 #include "confdefs.h"
5407
5408 #include <${cf_cv_ncurses_header:-curses.h}>
5409 #include <stdio.h>
5410 int main()
5411 {
5412         FILE *fp = fopen("$cf_tempfile", "w");
5413 #ifdef NCURSES_VERSION
5414 # ifdef NCURSES_VERSION_PATCH
5415         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5416 # else
5417         fprintf(fp, "%s\n", NCURSES_VERSION);
5418 # endif
5419 #else
5420 # ifdef __NCURSES_H
5421         fprintf(fp, "old\n");
5422 # else
5423         make an error
5424 # endif
5425 #endif
5426         ${cf_cv_main_return:-return}(0);
5427 }
5428 _ACEOF
5429 rm -f conftest$ac_exeext
5430 if { (eval echo "$as_me:5430: \"$ac_link\"") >&5
5431   (eval $ac_link) 2>&5
5432   ac_status=$?
5433   echo "$as_me:5433: \$? = $ac_status" >&5
5434   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5435   { (eval echo "$as_me:5435: \"$ac_try\"") >&5
5436   (eval $ac_try) 2>&5
5437   ac_status=$?
5438   echo "$as_me:5438: \$? = $ac_status" >&5
5439   (exit $ac_status); }; }; then
5440
5441         cf_cv_ncurses_version=`cat $cf_tempfile`
5442 else
5443   echo "$as_me: program exited with status $ac_status" >&5
5444 echo "$as_me: failed program was:" >&5
5445 cat conftest.$ac_ext >&5
5446 fi
5447 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5448 fi
5449         rm -f $cf_tempfile
5450
5451 fi
5452 echo "$as_me:5452: result: $cf_cv_ncurses_version" >&5
5453 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5454 test "$cf_cv_ncurses_version" = no ||
5455 cat >>confdefs.h <<\EOF
5456 #define NCURSES 1
5457 EOF
5458
5459 echo "$as_me:5459: checking if we have identified curses libraries" >&5
5460 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5461 cat >conftest.$ac_ext <<_ACEOF
5462 #line 5462 "configure"
5463 #include "confdefs.h"
5464 #include <${cf_cv_ncurses_header:-curses.h}>
5465 int
5466 main ()
5467 {
5468 initscr(); tgoto("?", 0,0)
5469   ;
5470   return 0;
5471 }
5472 _ACEOF
5473 rm -f conftest.$ac_objext conftest$ac_exeext
5474 if { (eval echo "$as_me:5474: \"$ac_link\"") >&5
5475   (eval $ac_link) 2>&5
5476   ac_status=$?
5477   echo "$as_me:5477: \$? = $ac_status" >&5
5478   (exit $ac_status); } &&
5479          { ac_try='test -s conftest$ac_exeext'
5480   { (eval echo "$as_me:5480: \"$ac_try\"") >&5
5481   (eval $ac_try) 2>&5
5482   ac_status=$?
5483   echo "$as_me:5483: \$? = $ac_status" >&5
5484   (exit $ac_status); }; }; then
5485   cf_result=yes
5486 else
5487   echo "$as_me: failed program was:" >&5
5488 cat conftest.$ac_ext >&5
5489 cf_result=no
5490 fi
5491 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5492 echo "$as_me:5492: result: $cf_result" >&5
5493 echo "${ECHO_T}$cf_result" >&6
5494
5495 if test "$cf_result" = no ; then
5496 case $host_os in
5497 (freebsd*)
5498         echo "$as_me:5498: checking for tgoto in -lmytinfo" >&5
5499 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5500 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5501   echo $ECHO_N "(cached) $ECHO_C" >&6
5502 else
5503   ac_check_lib_save_LIBS=$LIBS
5504 LIBS="-lmytinfo  $LIBS"
5505 cat >conftest.$ac_ext <<_ACEOF
5506 #line 5506 "configure"
5507 #include "confdefs.h"
5508
5509 /* Override any gcc2 internal prototype to avoid an error.  */
5510 #ifdef __cplusplus
5511 extern "C"
5512 #endif
5513 /* We use char because int might match the return type of a gcc2
5514    builtin and then its argument prototype would still apply.  */
5515 char tgoto ();
5516 int
5517 main ()
5518 {
5519 tgoto ();
5520   ;
5521   return 0;
5522 }
5523 _ACEOF
5524 rm -f conftest.$ac_objext conftest$ac_exeext
5525 if { (eval echo "$as_me:5525: \"$ac_link\"") >&5
5526   (eval $ac_link) 2>&5
5527   ac_status=$?
5528   echo "$as_me:5528: \$? = $ac_status" >&5
5529   (exit $ac_status); } &&
5530          { ac_try='test -s conftest$ac_exeext'
5531   { (eval echo "$as_me:5531: \"$ac_try\"") >&5
5532   (eval $ac_try) 2>&5
5533   ac_status=$?
5534   echo "$as_me:5534: \$? = $ac_status" >&5
5535   (exit $ac_status); }; }; then
5536   ac_cv_lib_mytinfo_tgoto=yes
5537 else
5538   echo "$as_me: failed program was:" >&5
5539 cat conftest.$ac_ext >&5
5540 ac_cv_lib_mytinfo_tgoto=no
5541 fi
5542 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5543 LIBS=$ac_check_lib_save_LIBS
5544 fi
5545 echo "$as_me:5545: result: $ac_cv_lib_mytinfo_tgoto" >&5
5546 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5547 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5548
5549 cf_add_libs="-lmytinfo"
5550 # Filter out duplicates - this happens with badly-designed ".pc" files...
5551 for cf_add_1lib in $LIBS
5552 do
5553         for cf_add_2lib in $cf_add_libs
5554         do
5555                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5556                 then
5557                         cf_add_1lib=
5558                         break
5559                 fi
5560         done
5561         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5562 done
5563 LIBS="$cf_add_libs"
5564
5565 fi
5566
5567         ;;
5568 (hpux10.*)
5569         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5570         # next (1998), and xcurses "newer" (2000).  There is no header file for
5571         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5572         # term.h) for cur_colr
5573         if test "x$cf_cv_screen" = "xcurses_colr"
5574         then
5575                 echo "$as_me:5575: checking for initscr in -lcur_colr" >&5
5576 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5577 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5578   echo $ECHO_N "(cached) $ECHO_C" >&6
5579 else
5580   ac_check_lib_save_LIBS=$LIBS
5581 LIBS="-lcur_colr  $LIBS"
5582 cat >conftest.$ac_ext <<_ACEOF
5583 #line 5583 "configure"
5584 #include "confdefs.h"
5585
5586 /* Override any gcc2 internal prototype to avoid an error.  */
5587 #ifdef __cplusplus
5588 extern "C"
5589 #endif
5590 /* We use char because int might match the return type of a gcc2
5591    builtin and then its argument prototype would still apply.  */
5592 char initscr ();
5593 int
5594 main ()
5595 {
5596 initscr ();
5597   ;
5598   return 0;
5599 }
5600 _ACEOF
5601 rm -f conftest.$ac_objext conftest$ac_exeext
5602 if { (eval echo "$as_me:5602: \"$ac_link\"") >&5
5603   (eval $ac_link) 2>&5
5604   ac_status=$?
5605   echo "$as_me:5605: \$? = $ac_status" >&5
5606   (exit $ac_status); } &&
5607          { ac_try='test -s conftest$ac_exeext'
5608   { (eval echo "$as_me:5608: \"$ac_try\"") >&5
5609   (eval $ac_try) 2>&5
5610   ac_status=$?
5611   echo "$as_me:5611: \$? = $ac_status" >&5
5612   (exit $ac_status); }; }; then
5613   ac_cv_lib_cur_colr_initscr=yes
5614 else
5615   echo "$as_me: failed program was:" >&5
5616 cat conftest.$ac_ext >&5
5617 ac_cv_lib_cur_colr_initscr=no
5618 fi
5619 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5620 LIBS=$ac_check_lib_save_LIBS
5621 fi
5622 echo "$as_me:5622: result: $ac_cv_lib_cur_colr_initscr" >&5
5623 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5624 if test $ac_cv_lib_cur_colr_initscr = yes; then
5625
5626 cf_add_libs="-lcur_colr"
5627 # Filter out duplicates - this happens with badly-designed ".pc" files...
5628 for cf_add_1lib in $LIBS
5629 do
5630         for cf_add_2lib in $cf_add_libs
5631         do
5632                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5633                 then
5634                         cf_add_1lib=
5635                         break
5636                 fi
5637         done
5638         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5639 done
5640 LIBS="$cf_add_libs"
5641
5642                         ac_cv_func_initscr=yes
5643
5644 else
5645
5646                 echo "$as_me:5646: checking for initscr in -lHcurses" >&5
5647 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5648 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5649   echo $ECHO_N "(cached) $ECHO_C" >&6
5650 else
5651   ac_check_lib_save_LIBS=$LIBS
5652 LIBS="-lHcurses  $LIBS"
5653 cat >conftest.$ac_ext <<_ACEOF
5654 #line 5654 "configure"
5655 #include "confdefs.h"
5656
5657 /* Override any gcc2 internal prototype to avoid an error.  */
5658 #ifdef __cplusplus
5659 extern "C"
5660 #endif
5661 /* We use char because int might match the return type of a gcc2
5662    builtin and then its argument prototype would still apply.  */
5663 char initscr ();
5664 int
5665 main ()
5666 {
5667 initscr ();
5668   ;
5669   return 0;
5670 }
5671 _ACEOF
5672 rm -f conftest.$ac_objext conftest$ac_exeext
5673 if { (eval echo "$as_me:5673: \"$ac_link\"") >&5
5674   (eval $ac_link) 2>&5
5675   ac_status=$?
5676   echo "$as_me:5676: \$? = $ac_status" >&5
5677   (exit $ac_status); } &&
5678          { ac_try='test -s conftest$ac_exeext'
5679   { (eval echo "$as_me:5679: \"$ac_try\"") >&5
5680   (eval $ac_try) 2>&5
5681   ac_status=$?
5682   echo "$as_me:5682: \$? = $ac_status" >&5
5683   (exit $ac_status); }; }; then
5684   ac_cv_lib_Hcurses_initscr=yes
5685 else
5686   echo "$as_me: failed program was:" >&5
5687 cat conftest.$ac_ext >&5
5688 ac_cv_lib_Hcurses_initscr=no
5689 fi
5690 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5691 LIBS=$ac_check_lib_save_LIBS
5692 fi
5693 echo "$as_me:5693: result: $ac_cv_lib_Hcurses_initscr" >&5
5694 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5695 if test $ac_cv_lib_Hcurses_initscr = yes; then
5696
5697                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5698
5699 cf_add_libs="-lHcurses"
5700 # Filter out duplicates - this happens with badly-designed ".pc" files...
5701 for cf_add_1lib in $LIBS
5702 do
5703         for cf_add_2lib in $cf_add_libs
5704         do
5705                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5706                 then
5707                         cf_add_1lib=
5708                         break
5709                 fi
5710         done
5711         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5712 done
5713 LIBS="$cf_add_libs"
5714
5715                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5716                         ac_cv_func_initscr=yes
5717
5718 fi
5719
5720 fi
5721
5722         fi
5723         ;;
5724 (linux*)
5725         case `arch 2>/dev/null` in
5726         (x86_64)
5727                 if test -d /lib64
5728                 then
5729
5730 if test -n "/lib64" ; then
5731         for cf_add_libdir in /lib64
5732         do
5733                 if test $cf_add_libdir = /usr/lib ; then
5734                         :
5735                 elif test -d $cf_add_libdir
5736                 then
5737                         cf_have_libdir=no
5738                         if test -n "$LDFLAGS$LIBS" ; then
5739                                 # a loop is needed to ensure we can add subdirs of existing dirs
5740                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5741                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5742                                                 cf_have_libdir=yes; break
5743                                         fi
5744                                 done
5745                         fi
5746                         if test "$cf_have_libdir" = no ; then
5747                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5748
5749 echo "${as_me:-configure}:5749: testing adding $cf_add_libdir to library-path ..." 1>&5
5750
5751                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5752                         fi
5753                 fi
5754         done
5755 fi
5756
5757                 else
5758
5759 if test -n "/lib" ; then
5760         for cf_add_libdir in /lib
5761         do
5762                 if test $cf_add_libdir = /usr/lib ; then
5763                         :
5764                 elif test -d $cf_add_libdir
5765                 then
5766                         cf_have_libdir=no
5767                         if test -n "$LDFLAGS$LIBS" ; then
5768                                 # a loop is needed to ensure we can add subdirs of existing dirs
5769                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5770                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5771                                                 cf_have_libdir=yes; break
5772                                         fi
5773                                 done
5774                         fi
5775                         if test "$cf_have_libdir" = no ; then
5776                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5777
5778 echo "${as_me:-configure}:5778: testing adding $cf_add_libdir to library-path ..." 1>&5
5779
5780                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5781                         fi
5782                 fi
5783         done
5784 fi
5785
5786                 fi
5787                 ;;
5788         (*)
5789
5790 if test -n "/lib" ; then
5791         for cf_add_libdir in /lib
5792         do
5793                 if test $cf_add_libdir = /usr/lib ; then
5794                         :
5795                 elif test -d $cf_add_libdir
5796                 then
5797                         cf_have_libdir=no
5798                         if test -n "$LDFLAGS$LIBS" ; then
5799                                 # a loop is needed to ensure we can add subdirs of existing dirs
5800                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5801                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5802                                                 cf_have_libdir=yes; break
5803                                         fi
5804                                 done
5805                         fi
5806                         if test "$cf_have_libdir" = no ; then
5807                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5808
5809 echo "${as_me:-configure}:5809: testing adding $cf_add_libdir to library-path ..." 1>&5
5810
5811                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5812                         fi
5813                 fi
5814         done
5815 fi
5816
5817                 ;;
5818         esac
5819         ;;
5820 (sunos3*|sunos4*)
5821         if test "x$cf_cv_screen" = "xcurses_5lib"
5822         then
5823                 if test -d /usr/5lib ; then
5824
5825 if test -n "/usr/5lib" ; then
5826         for cf_add_libdir in /usr/5lib
5827         do
5828                 if test $cf_add_libdir = /usr/lib ; then
5829                         :
5830                 elif test -d $cf_add_libdir
5831                 then
5832                         cf_have_libdir=no
5833                         if test -n "$LDFLAGS$LIBS" ; then
5834                                 # a loop is needed to ensure we can add subdirs of existing dirs
5835                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5836                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5837                                                 cf_have_libdir=yes; break
5838                                         fi
5839                                 done
5840                         fi
5841                         if test "$cf_have_libdir" = no ; then
5842                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5843
5844 echo "${as_me:-configure}:5844: testing adding $cf_add_libdir to library-path ..." 1>&5
5845
5846                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5847                         fi
5848                 fi
5849         done
5850 fi
5851
5852 cf_add_libs="-lcurses -ltermcap"
5853 # Filter out duplicates - this happens with badly-designed ".pc" files...
5854 for cf_add_1lib in $LIBS
5855 do
5856         for cf_add_2lib in $cf_add_libs
5857         do
5858                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5859                 then
5860                         cf_add_1lib=
5861                         break
5862                 fi
5863         done
5864         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5865 done
5866 LIBS="$cf_add_libs"
5867
5868                 fi
5869         fi
5870         ac_cv_func_initscr=yes
5871         ;;
5872 esac
5873
5874 if test ".$ac_cv_func_initscr" != .yes ; then
5875         cf_save_LIBS="$LIBS"
5876
5877         if test ".${cf_cv_ncurses_version:-no}" != .no
5878         then
5879                 cf_check_list="ncurses curses cursesX"
5880         else
5881                 cf_check_list="cursesX curses ncurses"
5882         fi
5883
5884         # Check for library containing tgoto.  Do this before curses library
5885         # because it may be needed to link the test-case for initscr.
5886         if test "x$cf_term_lib" = x
5887         then
5888                 echo "$as_me:5888: checking for tgoto" >&5
5889 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5890 if test "${ac_cv_func_tgoto+set}" = set; then
5891   echo $ECHO_N "(cached) $ECHO_C" >&6
5892 else
5893   cat >conftest.$ac_ext <<_ACEOF
5894 #line 5894 "configure"
5895 #include "confdefs.h"
5896 /* System header to define __stub macros and hopefully few prototypes,
5897     which can conflict with char tgoto (); below.  */
5898 #include <assert.h>
5899 /* Override any gcc2 internal prototype to avoid an error.  */
5900 #ifdef __cplusplus
5901 extern "C"
5902 #endif
5903 /* We use char because int might match the return type of a gcc2
5904    builtin and then its argument prototype would still apply.  */
5905 char tgoto ();
5906 char (*f) ();
5907
5908 int
5909 main ()
5910 {
5911 /* The GNU C library defines this for functions which it implements
5912     to always fail with ENOSYS.  Some functions are actually named
5913     something starting with __ and the normal name is an alias.  */
5914 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5915 choke me
5916 #else
5917 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5918 #endif
5919
5920   ;
5921   return 0;
5922 }
5923 _ACEOF
5924 rm -f conftest.$ac_objext conftest$ac_exeext
5925 if { (eval echo "$as_me:5925: \"$ac_link\"") >&5
5926   (eval $ac_link) 2>&5
5927   ac_status=$?
5928   echo "$as_me:5928: \$? = $ac_status" >&5
5929   (exit $ac_status); } &&
5930          { ac_try='test -s conftest$ac_exeext'
5931   { (eval echo "$as_me:5931: \"$ac_try\"") >&5
5932   (eval $ac_try) 2>&5
5933   ac_status=$?
5934   echo "$as_me:5934: \$? = $ac_status" >&5
5935   (exit $ac_status); }; }; then
5936   ac_cv_func_tgoto=yes
5937 else
5938   echo "$as_me: failed program was:" >&5
5939 cat conftest.$ac_ext >&5
5940 ac_cv_func_tgoto=no
5941 fi
5942 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5943 fi
5944 echo "$as_me:5944: result: $ac_cv_func_tgoto" >&5
5945 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5946 if test $ac_cv_func_tgoto = yes; then
5947   cf_term_lib=predefined
5948 else
5949
5950                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5951                         do
5952                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5953 echo "$as_me:5953: checking for tgoto in -l$cf_term_lib" >&5
5954 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5955 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5956   echo $ECHO_N "(cached) $ECHO_C" >&6
5957 else
5958   ac_check_lib_save_LIBS=$LIBS
5959 LIBS="-l$cf_term_lib  $LIBS"
5960 cat >conftest.$ac_ext <<_ACEOF
5961 #line 5961 "configure"
5962 #include "confdefs.h"
5963
5964 /* Override any gcc2 internal prototype to avoid an error.  */
5965 #ifdef __cplusplus
5966 extern "C"
5967 #endif
5968 /* We use char because int might match the return type of a gcc2
5969    builtin and then its argument prototype would still apply.  */
5970 char tgoto ();
5971 int
5972 main ()
5973 {
5974 tgoto ();
5975   ;
5976   return 0;
5977 }
5978 _ACEOF
5979 rm -f conftest.$ac_objext conftest$ac_exeext
5980 if { (eval echo "$as_me:5980: \"$ac_link\"") >&5
5981   (eval $ac_link) 2>&5
5982   ac_status=$?
5983   echo "$as_me:5983: \$? = $ac_status" >&5
5984   (exit $ac_status); } &&
5985          { ac_try='test -s conftest$ac_exeext'
5986   { (eval echo "$as_me:5986: \"$ac_try\"") >&5
5987   (eval $ac_try) 2>&5
5988   ac_status=$?
5989   echo "$as_me:5989: \$? = $ac_status" >&5
5990   (exit $ac_status); }; }; then
5991   eval "$as_ac_Lib=yes"
5992 else
5993   echo "$as_me: failed program was:" >&5
5994 cat conftest.$ac_ext >&5
5995 eval "$as_ac_Lib=no"
5996 fi
5997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5998 LIBS=$ac_check_lib_save_LIBS
5999 fi
6000 echo "$as_me:6000: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6001 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6002 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6003   break
6004 fi
6005
6006                         done
6007
6008 fi
6009
6010         fi
6011
6012         # Check for library containing initscr
6013         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6014         if test "x$cf_curs_lib" = x
6015         then
6016                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6017                 do
6018                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
6019 echo "$as_me:6019: checking for initscr in -l$cf_curs_lib" >&5
6020 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
6021 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6022   echo $ECHO_N "(cached) $ECHO_C" >&6
6023 else
6024   ac_check_lib_save_LIBS=$LIBS
6025 LIBS="-l$cf_curs_lib  $LIBS"
6026 cat >conftest.$ac_ext <<_ACEOF
6027 #line 6027 "configure"
6028 #include "confdefs.h"
6029
6030 /* Override any gcc2 internal prototype to avoid an error.  */
6031 #ifdef __cplusplus
6032 extern "C"
6033 #endif
6034 /* We use char because int might match the return type of a gcc2
6035    builtin and then its argument prototype would still apply.  */
6036 char initscr ();
6037 int
6038 main ()
6039 {
6040 initscr ();
6041   ;
6042   return 0;
6043 }
6044 _ACEOF
6045 rm -f conftest.$ac_objext conftest$ac_exeext
6046 if { (eval echo "$as_me:6046: \"$ac_link\"") >&5
6047   (eval $ac_link) 2>&5
6048   ac_status=$?
6049   echo "$as_me:6049: \$? = $ac_status" >&5
6050   (exit $ac_status); } &&
6051          { ac_try='test -s conftest$ac_exeext'
6052   { (eval echo "$as_me:6052: \"$ac_try\"") >&5
6053   (eval $ac_try) 2>&5
6054   ac_status=$?
6055   echo "$as_me:6055: \$? = $ac_status" >&5
6056   (exit $ac_status); }; }; then
6057   eval "$as_ac_Lib=yes"
6058 else
6059   echo "$as_me: failed program was:" >&5
6060 cat conftest.$ac_ext >&5
6061 eval "$as_ac_Lib=no"
6062 fi
6063 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6064 LIBS=$ac_check_lib_save_LIBS
6065 fi
6066 echo "$as_me:6066: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6067 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6068 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6069   break
6070 fi
6071
6072                 done
6073         fi
6074         test $cf_curs_lib = unknown && { { echo "$as_me:6074: error: no curses library found" >&5
6075 echo "$as_me: error: no curses library found" >&2;}
6076    { (exit 1); exit 1; }; }
6077
6078         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6079         if test "$cf_term_lib" = unknown ; then
6080                 echo "$as_me:6080: checking if we can link with $cf_curs_lib library" >&5
6081 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6082                 cat >conftest.$ac_ext <<_ACEOF
6083 #line 6083 "configure"
6084 #include "confdefs.h"
6085 #include <${cf_cv_ncurses_header:-curses.h}>
6086 int
6087 main ()
6088 {
6089 initscr()
6090   ;
6091   return 0;
6092 }
6093 _ACEOF
6094 rm -f conftest.$ac_objext conftest$ac_exeext
6095 if { (eval echo "$as_me:6095: \"$ac_link\"") >&5
6096   (eval $ac_link) 2>&5
6097   ac_status=$?
6098   echo "$as_me:6098: \$? = $ac_status" >&5
6099   (exit $ac_status); } &&
6100          { ac_try='test -s conftest$ac_exeext'
6101   { (eval echo "$as_me:6101: \"$ac_try\"") >&5
6102   (eval $ac_try) 2>&5
6103   ac_status=$?
6104   echo "$as_me:6104: \$? = $ac_status" >&5
6105   (exit $ac_status); }; }; then
6106   cf_result=yes
6107 else
6108   echo "$as_me: failed program was:" >&5
6109 cat conftest.$ac_ext >&5
6110 cf_result=no
6111 fi
6112 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6113                 echo "$as_me:6113: result: $cf_result" >&5
6114 echo "${ECHO_T}$cf_result" >&6
6115                 test $cf_result = no && { { echo "$as_me:6115: error: Cannot link curses library" >&5
6116 echo "$as_me: error: Cannot link curses library" >&2;}
6117    { (exit 1); exit 1; }; }
6118         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6119                 :
6120         elif test "$cf_term_lib" != predefined ; then
6121                 echo "$as_me:6121: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6122 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6123                 cat >conftest.$ac_ext <<_ACEOF
6124 #line 6124 "configure"
6125 #include "confdefs.h"
6126 #include <${cf_cv_ncurses_header:-curses.h}>
6127 int
6128 main ()
6129 {
6130 initscr(); tgoto((char *)0, 0, 0);
6131   ;
6132   return 0;
6133 }
6134 _ACEOF
6135 rm -f conftest.$ac_objext conftest$ac_exeext
6136 if { (eval echo "$as_me:6136: \"$ac_link\"") >&5
6137   (eval $ac_link) 2>&5
6138   ac_status=$?
6139   echo "$as_me:6139: \$? = $ac_status" >&5
6140   (exit $ac_status); } &&
6141          { ac_try='test -s conftest$ac_exeext'
6142   { (eval echo "$as_me:6142: \"$ac_try\"") >&5
6143   (eval $ac_try) 2>&5
6144   ac_status=$?
6145   echo "$as_me:6145: \$? = $ac_status" >&5
6146   (exit $ac_status); }; }; then
6147   cf_result=no
6148 else
6149   echo "$as_me: failed program was:" >&5
6150 cat conftest.$ac_ext >&5
6151
6152                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6153                         cat >conftest.$ac_ext <<_ACEOF
6154 #line 6154 "configure"
6155 #include "confdefs.h"
6156 #include <${cf_cv_ncurses_header:-curses.h}>
6157 int
6158 main ()
6159 {
6160 initscr()
6161   ;
6162   return 0;
6163 }
6164 _ACEOF
6165 rm -f conftest.$ac_objext conftest$ac_exeext
6166 if { (eval echo "$as_me:6166: \"$ac_link\"") >&5
6167   (eval $ac_link) 2>&5
6168   ac_status=$?
6169   echo "$as_me:6169: \$? = $ac_status" >&5
6170   (exit $ac_status); } &&
6171          { ac_try='test -s conftest$ac_exeext'
6172   { (eval echo "$as_me:6172: \"$ac_try\"") >&5
6173   (eval $ac_try) 2>&5
6174   ac_status=$?
6175   echo "$as_me:6175: \$? = $ac_status" >&5
6176   (exit $ac_status); }; }; then
6177   cf_result=yes
6178 else
6179   echo "$as_me: failed program was:" >&5
6180 cat conftest.$ac_ext >&5
6181 cf_result=error
6182 fi
6183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6184
6185 fi
6186 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6187                 echo "$as_me:6187: result: $cf_result" >&5
6188 echo "${ECHO_T}$cf_result" >&6
6189         fi
6190 fi
6191 fi
6192
6193         ;;
6194 (ncursesw*)
6195
6196 echo "$as_me:6196: checking for multibyte character support" >&5
6197 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6198 if test "${cf_cv_utf8_lib+set}" = set; then
6199   echo $ECHO_N "(cached) $ECHO_C" >&6
6200 else
6201
6202         cf_save_LIBS="$LIBS"
6203         cat >conftest.$ac_ext <<_ACEOF
6204 #line 6204 "configure"
6205 #include "confdefs.h"
6206
6207 #include <stdlib.h>
6208 int
6209 main ()
6210 {
6211 putwc(0,0);
6212   ;
6213   return 0;
6214 }
6215 _ACEOF
6216 rm -f conftest.$ac_objext conftest$ac_exeext
6217 if { (eval echo "$as_me:6217: \"$ac_link\"") >&5
6218   (eval $ac_link) 2>&5
6219   ac_status=$?
6220   echo "$as_me:6220: \$? = $ac_status" >&5
6221   (exit $ac_status); } &&
6222          { ac_try='test -s conftest$ac_exeext'
6223   { (eval echo "$as_me:6223: \"$ac_try\"") >&5
6224   (eval $ac_try) 2>&5
6225   ac_status=$?
6226   echo "$as_me:6226: \$? = $ac_status" >&5
6227   (exit $ac_status); }; }; then
6228   cf_cv_utf8_lib=yes
6229 else
6230   echo "$as_me: failed program was:" >&5
6231 cat conftest.$ac_ext >&5
6232
6233 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6234 # will be set on completion of the AC_TRY_LINK below.
6235 cf_cv_header_path_utf8=
6236 cf_cv_library_path_utf8=
6237
6238 echo "${as_me:-configure}:6238: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6239
6240 cf_save_LIBS="$LIBS"
6241
6242 cat >conftest.$ac_ext <<_ACEOF
6243 #line 6243 "configure"
6244 #include "confdefs.h"
6245
6246 #include <libutf8.h>
6247 int
6248 main ()
6249 {
6250 putwc(0,0);
6251   ;
6252   return 0;
6253 }
6254 _ACEOF
6255 rm -f conftest.$ac_objext conftest$ac_exeext
6256 if { (eval echo "$as_me:6256: \"$ac_link\"") >&5
6257   (eval $ac_link) 2>&5
6258   ac_status=$?
6259   echo "$as_me:6259: \$? = $ac_status" >&5
6260   (exit $ac_status); } &&
6261          { ac_try='test -s conftest$ac_exeext'
6262   { (eval echo "$as_me:6262: \"$ac_try\"") >&5
6263   (eval $ac_try) 2>&5
6264   ac_status=$?
6265   echo "$as_me:6265: \$? = $ac_status" >&5
6266   (exit $ac_status); }; }; then
6267
6268         cf_cv_find_linkage_utf8=yes
6269         cf_cv_header_path_utf8=/usr/include
6270         cf_cv_library_path_utf8=/usr/lib
6271
6272 else
6273   echo "$as_me: failed program was:" >&5
6274 cat conftest.$ac_ext >&5
6275
6276 LIBS="-lutf8  $cf_save_LIBS"
6277
6278 cat >conftest.$ac_ext <<_ACEOF
6279 #line 6279 "configure"
6280 #include "confdefs.h"
6281
6282 #include <libutf8.h>
6283 int
6284 main ()
6285 {
6286 putwc(0,0);
6287   ;
6288   return 0;
6289 }
6290 _ACEOF
6291 rm -f conftest.$ac_objext conftest$ac_exeext
6292 if { (eval echo "$as_me:6292: \"$ac_link\"") >&5
6293   (eval $ac_link) 2>&5
6294   ac_status=$?
6295   echo "$as_me:6295: \$? = $ac_status" >&5
6296   (exit $ac_status); } &&
6297          { ac_try='test -s conftest$ac_exeext'
6298   { (eval echo "$as_me:6298: \"$ac_try\"") >&5
6299   (eval $ac_try) 2>&5
6300   ac_status=$?
6301   echo "$as_me:6301: \$? = $ac_status" >&5
6302   (exit $ac_status); }; }; then
6303
6304         cf_cv_find_linkage_utf8=yes
6305         cf_cv_header_path_utf8=/usr/include
6306         cf_cv_library_path_utf8=/usr/lib
6307         cf_cv_library_file_utf8="-lutf8"
6308
6309 else
6310   echo "$as_me: failed program was:" >&5
6311 cat conftest.$ac_ext >&5
6312
6313         cf_cv_find_linkage_utf8=no
6314         LIBS="$cf_save_LIBS"
6315
6316         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6317
6318 echo "${as_me:-configure}:6318: testing find linkage for utf8 library ..." 1>&5
6319
6320 echo "${as_me:-configure}:6320: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6321
6322         cf_save_CPPFLAGS="$CPPFLAGS"
6323         cf_test_CPPFLAGS="$CPPFLAGS"
6324
6325 cf_search=
6326
6327 # collect the current set of include-directories from compiler flags
6328 cf_header_path_list=""
6329 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6330         for cf_header_path in $CPPFLAGS $CFLAGS
6331         do
6332                 case $cf_header_path in
6333                 (-I*)
6334                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6335
6336 test "x$cf_header_path" != "xNONE" && \
6337 test -d "$cf_header_path" && \
6338  {
6339         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6340         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6341         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6342         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6343         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6344         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6345 }
6346
6347                         cf_header_path_list="$cf_header_path_list $cf_search"
6348                         ;;
6349                 esac
6350         done
6351 fi
6352
6353 # add the variations for the package we are looking for
6354
6355 cf_search=
6356
6357 test "x$prefix" != "xNONE" && \
6358 test -d "$prefix" && \
6359  {
6360         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6361         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6362         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6363         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6364         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6365         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6366 }
6367
6368 for cf_subdir_prefix in \
6369         /usr \
6370         /usr/local \
6371         /usr/pkg \
6372         /opt \
6373         /opt/local \
6374         $HOME
6375 do
6376
6377 test "x$cf_subdir_prefix" != "x$prefix" && \
6378 test -d "$cf_subdir_prefix" && \
6379 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6380         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6381         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6382         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6383         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6384         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6385         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6386 }
6387
6388 done
6389
6390 test "$includedir" != NONE && \
6391 test "$includedir" != "/usr/include" && \
6392 test -d "$includedir" && {
6393         test -d $includedir &&    cf_search="$cf_search $includedir"
6394         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6395 }
6396
6397 test "$oldincludedir" != NONE && \
6398 test "$oldincludedir" != "/usr/include" && \
6399 test -d "$oldincludedir" && {
6400         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6401         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6402 }
6403
6404 cf_search="$cf_search $cf_header_path_list"
6405
6406         for cf_cv_header_path_utf8 in $cf_search
6407         do
6408                 if test -d $cf_cv_header_path_utf8 ; then
6409                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6410
6411 echo "${as_me:-configure}:6411: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6412
6413                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6414                         cat >conftest.$ac_ext <<_ACEOF
6415 #line 6415 "configure"
6416 #include "confdefs.h"
6417
6418 #include <libutf8.h>
6419 int
6420 main ()
6421 {
6422 putwc(0,0);
6423   ;
6424   return 0;
6425 }
6426 _ACEOF
6427 rm -f conftest.$ac_objext
6428 if { (eval echo "$as_me:6428: \"$ac_compile\"") >&5
6429   (eval $ac_compile) 2>&5
6430   ac_status=$?
6431   echo "$as_me:6431: \$? = $ac_status" >&5
6432   (exit $ac_status); } &&
6433          { ac_try='test -s conftest.$ac_objext'
6434   { (eval echo "$as_me:6434: \"$ac_try\"") >&5
6435   (eval $ac_try) 2>&5
6436   ac_status=$?
6437   echo "$as_me:6437: \$? = $ac_status" >&5
6438   (exit $ac_status); }; }; then
6439
6440                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6441
6442 echo "${as_me:-configure}:6442: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6443
6444                                 cf_cv_find_linkage_utf8=maybe
6445                                 cf_test_CPPFLAGS="$CPPFLAGS"
6446                                 break
6447 else
6448   echo "$as_me: failed program was:" >&5
6449 cat conftest.$ac_ext >&5
6450
6451                                 CPPFLAGS="$cf_save_CPPFLAGS"
6452
6453 fi
6454 rm -f conftest.$ac_objext conftest.$ac_ext
6455                 fi
6456         done
6457
6458         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6459
6460 echo "${as_me:-configure}:6460: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6461
6462                 cf_save_LIBS="$LIBS"
6463                 cf_save_LDFLAGS="$LDFLAGS"
6464
6465                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6466
6467 cf_search=
6468 cf_library_path_list=""
6469 if test -n "${LDFLAGS}${LIBS}" ; then
6470         for cf_library_path in $LDFLAGS $LIBS
6471         do
6472                 case $cf_library_path in
6473                 (-L*)
6474                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6475
6476 test "x$cf_library_path" != "xNONE" && \
6477 test -d "$cf_library_path" && \
6478  {
6479         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6480         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6481         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6482         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6483         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6484         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6485 }
6486
6487                         cf_library_path_list="$cf_library_path_list $cf_search"
6488                         ;;
6489                 esac
6490         done
6491 fi
6492
6493 cf_search=
6494
6495 test "x$prefix" != "xNONE" && \
6496 test -d "$prefix" && \
6497  {
6498         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6499         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6500         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6501         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6502         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6503         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6504 }
6505
6506 for cf_subdir_prefix in \
6507         /usr \
6508         /usr/local \
6509         /usr/pkg \
6510         /opt \
6511         /opt/local \
6512         $HOME
6513 do
6514
6515 test "x$cf_subdir_prefix" != "x$prefix" && \
6516 test -d "$cf_subdir_prefix" && \
6517 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6518         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6519         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6520         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6521         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6522         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6523         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6524 }
6525
6526 done
6527
6528 cf_search="$cf_library_path_list $cf_search"
6529
6530                         for cf_cv_library_path_utf8 in $cf_search
6531                         do
6532                                 if test -d $cf_cv_library_path_utf8 ; then
6533                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6534
6535 echo "${as_me:-configure}:6535: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6536
6537                                         CPPFLAGS="$cf_test_CPPFLAGS"
6538                                         LIBS="-lutf8  $cf_save_LIBS"
6539                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6540                                         cat >conftest.$ac_ext <<_ACEOF
6541 #line 6541 "configure"
6542 #include "confdefs.h"
6543
6544 #include <libutf8.h>
6545 int
6546 main ()
6547 {
6548 putwc(0,0);
6549   ;
6550   return 0;
6551 }
6552 _ACEOF
6553 rm -f conftest.$ac_objext conftest$ac_exeext
6554 if { (eval echo "$as_me:6554: \"$ac_link\"") >&5
6555   (eval $ac_link) 2>&5
6556   ac_status=$?
6557   echo "$as_me:6557: \$? = $ac_status" >&5
6558   (exit $ac_status); } &&
6559          { ac_try='test -s conftest$ac_exeext'
6560   { (eval echo "$as_me:6560: \"$ac_try\"") >&5
6561   (eval $ac_try) 2>&5
6562   ac_status=$?
6563   echo "$as_me:6563: \$? = $ac_status" >&5
6564   (exit $ac_status); }; }; then
6565
6566                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6567
6568 echo "${as_me:-configure}:6568: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6569
6570                                         cf_cv_find_linkage_utf8=yes
6571                                         cf_cv_library_file_utf8="-lutf8"
6572                                         break
6573 else
6574   echo "$as_me: failed program was:" >&5
6575 cat conftest.$ac_ext >&5
6576
6577                                         CPPFLAGS="$cf_save_CPPFLAGS"
6578                                         LIBS="$cf_save_LIBS"
6579                                         LDFLAGS="$cf_save_LDFLAGS"
6580
6581 fi
6582 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6583                                 fi
6584                         done
6585                         CPPFLAGS="$cf_save_CPPFLAGS"
6586                         LDFLAGS="$cf_save_LDFLAGS"
6587                 fi
6588
6589         else
6590                 cf_cv_find_linkage_utf8=no
6591         fi
6592
6593 fi
6594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6595
6596 fi
6597 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6598
6599 LIBS="$cf_save_LIBS"
6600
6601 if test "$cf_cv_find_linkage_utf8" = yes ; then
6602 cf_cv_utf8_lib=add-on
6603 else
6604 cf_cv_utf8_lib=no
6605 fi
6606
6607 fi
6608 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6609 fi
6610 echo "$as_me:6610: result: $cf_cv_utf8_lib" >&5
6611 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6612
6613 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6614 # ncurses/ncursesw:
6615 if test "$cf_cv_utf8_lib" = "add-on" ; then
6616
6617 cat >>confdefs.h <<\EOF
6618 #define HAVE_LIBUTF8_H 1
6619 EOF
6620
6621 if test -n "$cf_cv_header_path_utf8" ; then
6622   for cf_add_incdir in $cf_cv_header_path_utf8
6623   do
6624         while test $cf_add_incdir != /usr/include
6625         do
6626           if test -d $cf_add_incdir
6627           then
6628                 cf_have_incdir=no
6629                 if test -n "$CFLAGS$CPPFLAGS" ; then
6630                   # a loop is needed to ensure we can add subdirs of existing dirs
6631                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6632                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6633                           cf_have_incdir=yes; break
6634                         fi
6635                   done
6636                 fi
6637
6638                 if test "$cf_have_incdir" = no ; then
6639                   if test "$cf_add_incdir" = /usr/local/include ; then
6640                         if test "$GCC" = yes
6641                         then
6642                           cf_save_CPPFLAGS=$CPPFLAGS
6643                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6644                           cat >conftest.$ac_ext <<_ACEOF
6645 #line 6645 "configure"
6646 #include "confdefs.h"
6647 #include <stdio.h>
6648 int
6649 main ()
6650 {
6651 printf("Hello")
6652   ;
6653   return 0;
6654 }
6655 _ACEOF
6656 rm -f conftest.$ac_objext
6657 if { (eval echo "$as_me:6657: \"$ac_compile\"") >&5
6658   (eval $ac_compile) 2>&5
6659   ac_status=$?
6660   echo "$as_me:6660: \$? = $ac_status" >&5
6661   (exit $ac_status); } &&
6662          { ac_try='test -s conftest.$ac_objext'
6663   { (eval echo "$as_me:6663: \"$ac_try\"") >&5
6664   (eval $ac_try) 2>&5
6665   ac_status=$?
6666   echo "$as_me:6666: \$? = $ac_status" >&5
6667   (exit $ac_status); }; }; then
6668   :
6669 else
6670   echo "$as_me: failed program was:" >&5
6671 cat conftest.$ac_ext >&5
6672 cf_have_incdir=yes
6673 fi
6674 rm -f conftest.$ac_objext conftest.$ac_ext
6675                           CPPFLAGS=$cf_save_CPPFLAGS
6676                         fi
6677                   fi
6678                 fi
6679
6680                 if test "$cf_have_incdir" = no ; then
6681                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6682
6683 echo "${as_me:-configure}:6683: testing adding $cf_add_incdir to include-path ..." 1>&5
6684
6685                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6686
6687                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6688                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6689                   cf_add_incdir="$cf_top_incdir"
6690                 else
6691                   break
6692                 fi
6693           else
6694                 break
6695           fi
6696         done
6697   done
6698 fi
6699
6700 if test -n "$cf_cv_library_path_utf8" ; then
6701         for cf_add_libdir in $cf_cv_library_path_utf8
6702         do
6703                 if test $cf_add_libdir = /usr/lib ; then
6704                         :
6705                 elif test -d $cf_add_libdir
6706                 then
6707                         cf_have_libdir=no
6708                         if test -n "$LDFLAGS$LIBS" ; then
6709                                 # a loop is needed to ensure we can add subdirs of existing dirs
6710                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6711                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6712                                                 cf_have_libdir=yes; break
6713                                         fi
6714                                 done
6715                         fi
6716                         if test "$cf_have_libdir" = no ; then
6717                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6718
6719 echo "${as_me:-configure}:6719: testing adding $cf_add_libdir to library-path ..." 1>&5
6720
6721                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6722                         fi
6723                 fi
6724         done
6725 fi
6726
6727 cf_add_libs="$cf_cv_library_file_utf8"
6728 # Filter out duplicates - this happens with badly-designed ".pc" files...
6729 for cf_add_1lib in $LIBS
6730 do
6731         for cf_add_2lib in $cf_add_libs
6732         do
6733                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6734                 then
6735                         cf_add_1lib=
6736                         break
6737                 fi
6738         done
6739         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6740 done
6741 LIBS="$cf_add_libs"
6742
6743 fi
6744
6745 cf_ncuconfig_root=$cf_cv_screen
6746 cf_have_ncuconfig=no
6747
6748 if test "x${PKG_CONFIG:=none}" != xnone; then
6749         echo "$as_me:6749: checking pkg-config for $cf_ncuconfig_root" >&5
6750 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6751         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6752                 echo "$as_me:6752: result: yes" >&5
6753 echo "${ECHO_T}yes" >&6
6754
6755                 echo "$as_me:6755: checking if the $cf_ncuconfig_root package files work" >&5
6756 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6757                 cf_have_ncuconfig=unknown
6758
6759                 cf_save_CPPFLAGS="$CPPFLAGS"
6760                 cf_save_LIBS="$LIBS"
6761
6762                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6763
6764 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6765 # Filter out duplicates - this happens with badly-designed ".pc" files...
6766 for cf_add_1lib in $LIBS
6767 do
6768         for cf_add_2lib in $cf_add_libs
6769         do
6770                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6771                 then
6772                         cf_add_1lib=
6773                         break
6774                 fi
6775         done
6776         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6777 done
6778 LIBS="$cf_add_libs"
6779
6780                 cat >conftest.$ac_ext <<_ACEOF
6781 #line 6781 "configure"
6782 #include "confdefs.h"
6783 #include <${cf_cv_ncurses_header:-curses.h}>
6784 int
6785 main ()
6786 {
6787 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6788   ;
6789   return 0;
6790 }
6791 _ACEOF
6792 rm -f conftest.$ac_objext conftest$ac_exeext
6793 if { (eval echo "$as_me:6793: \"$ac_link\"") >&5
6794   (eval $ac_link) 2>&5
6795   ac_status=$?
6796   echo "$as_me:6796: \$? = $ac_status" >&5
6797   (exit $ac_status); } &&
6798          { ac_try='test -s conftest$ac_exeext'
6799   { (eval echo "$as_me:6799: \"$ac_try\"") >&5
6800   (eval $ac_try) 2>&5
6801   ac_status=$?
6802   echo "$as_me:6802: \$? = $ac_status" >&5
6803   (exit $ac_status); }; }; then
6804   if test "$cross_compiling" = yes; then
6805   cf_have_ncuconfig=maybe
6806 else
6807   cat >conftest.$ac_ext <<_ACEOF
6808 #line 6808 "configure"
6809 #include "confdefs.h"
6810 #include <${cf_cv_ncurses_header:-curses.h}>
6811                                 int main(void)
6812                                 { char *xx = curses_version(); return (xx == 0); }
6813 _ACEOF
6814 rm -f conftest$ac_exeext
6815 if { (eval echo "$as_me:6815: \"$ac_link\"") >&5
6816   (eval $ac_link) 2>&5
6817   ac_status=$?
6818   echo "$as_me:6818: \$? = $ac_status" >&5
6819   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6820   { (eval echo "$as_me:6820: \"$ac_try\"") >&5
6821   (eval $ac_try) 2>&5
6822   ac_status=$?
6823   echo "$as_me:6823: \$? = $ac_status" >&5
6824   (exit $ac_status); }; }; then
6825   cf_have_ncuconfig=yes
6826 else
6827   echo "$as_me: program exited with status $ac_status" >&5
6828 echo "$as_me: failed program was:" >&5
6829 cat conftest.$ac_ext >&5
6830 cf_have_ncuconfig=no
6831 fi
6832 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6833 fi
6834 else
6835   echo "$as_me: failed program was:" >&5
6836 cat conftest.$ac_ext >&5
6837 cf_have_ncuconfig=no
6838 fi
6839 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6840                 echo "$as_me:6840: result: $cf_have_ncuconfig" >&5
6841 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6842                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6843                 if test "$cf_have_ncuconfig" != "yes"
6844                 then
6845                         CPPFLAGS="$cf_save_CPPFLAGS"
6846                         LIBS="$cf_save_LIBS"
6847                         NCURSES_CONFIG_PKG=none
6848                 else
6849
6850 cat >>confdefs.h <<\EOF
6851 #define NCURSES 1
6852 EOF
6853
6854                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6855                 fi
6856
6857         else
6858                 echo "$as_me:6858: result: no" >&5
6859 echo "${ECHO_T}no" >&6
6860                 NCURSES_CONFIG_PKG=none
6861         fi
6862 else
6863         NCURSES_CONFIG_PKG=none
6864 fi
6865
6866 if test "x$cf_have_ncuconfig" = "xno"; then
6867         echo "Looking for ${cf_ncuconfig_root}-config"
6868
6869 if test -n "$ac_tool_prefix"; then
6870   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6871   do
6872     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6873 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6874 echo "$as_me:6874: checking for $ac_word" >&5
6875 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6876 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6877   echo $ECHO_N "(cached) $ECHO_C" >&6
6878 else
6879   if test -n "$NCURSES_CONFIG"; then
6880   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6881 else
6882   ac_save_IFS=$IFS; IFS=$ac_path_separator
6883 ac_dummy="$PATH"
6884 for ac_dir in $ac_dummy; do
6885   IFS=$ac_save_IFS
6886   test -z "$ac_dir" && ac_dir=.
6887   $as_executable_p "$ac_dir/$ac_word" || continue
6888 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6889 echo "$as_me:6889: found $ac_dir/$ac_word" >&5
6890 break
6891 done
6892
6893 fi
6894 fi
6895 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6896 if test -n "$NCURSES_CONFIG"; then
6897   echo "$as_me:6897: result: $NCURSES_CONFIG" >&5
6898 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6899 else
6900   echo "$as_me:6900: result: no" >&5
6901 echo "${ECHO_T}no" >&6
6902 fi
6903
6904     test -n "$NCURSES_CONFIG" && break
6905   done
6906 fi
6907 if test -z "$NCURSES_CONFIG"; then
6908   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6909   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6910 do
6911   # Extract the first word of "$ac_prog", so it can be a program name with args.
6912 set dummy $ac_prog; ac_word=$2
6913 echo "$as_me:6913: checking for $ac_word" >&5
6914 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6915 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6916   echo $ECHO_N "(cached) $ECHO_C" >&6
6917 else
6918   if test -n "$ac_ct_NCURSES_CONFIG"; then
6919   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6920 else
6921   ac_save_IFS=$IFS; IFS=$ac_path_separator
6922 ac_dummy="$PATH"
6923 for ac_dir in $ac_dummy; do
6924   IFS=$ac_save_IFS
6925   test -z "$ac_dir" && ac_dir=.
6926   $as_executable_p "$ac_dir/$ac_word" || continue
6927 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6928 echo "$as_me:6928: found $ac_dir/$ac_word" >&5
6929 break
6930 done
6931
6932 fi
6933 fi
6934 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6935 if test -n "$ac_ct_NCURSES_CONFIG"; then
6936   echo "$as_me:6936: result: $ac_ct_NCURSES_CONFIG" >&5
6937 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6938 else
6939   echo "$as_me:6939: result: no" >&5
6940 echo "${ECHO_T}no" >&6
6941 fi
6942
6943   test -n "$ac_ct_NCURSES_CONFIG" && break
6944 done
6945 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6946
6947   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6948 fi
6949
6950         if test "$NCURSES_CONFIG" != none ; then
6951
6952                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6953
6954 cf_add_libs="`$NCURSES_CONFIG --libs`"
6955 # Filter out duplicates - this happens with badly-designed ".pc" files...
6956 for cf_add_1lib in $LIBS
6957 do
6958         for cf_add_2lib in $cf_add_libs
6959         do
6960                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6961                 then
6962                         cf_add_1lib=
6963                         break
6964                 fi
6965         done
6966         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6967 done
6968 LIBS="$cf_add_libs"
6969
6970                 # even with config script, some packages use no-override for curses.h
6971
6972 echo "$as_me:6972: checking if we have identified curses headers" >&5
6973 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6974 if test "${cf_cv_ncurses_header+set}" = set; then
6975   echo $ECHO_N "(cached) $ECHO_C" >&6
6976 else
6977
6978 cf_cv_ncurses_header=none
6979 for cf_header in \
6980         ncurses.h $cf_cv_screen/ncurses.h \
6981         curses.h $cf_cv_screen/curses.h
6982 do
6983 cat >conftest.$ac_ext <<_ACEOF
6984 #line 6984 "configure"
6985 #include "confdefs.h"
6986 #include <${cf_header}>
6987 int
6988 main ()
6989 {
6990 initscr(); tgoto("?", 0,0)
6991   ;
6992   return 0;
6993 }
6994 _ACEOF
6995 rm -f conftest.$ac_objext
6996 if { (eval echo "$as_me:6996: \"$ac_compile\"") >&5
6997   (eval $ac_compile) 2>&5
6998   ac_status=$?
6999   echo "$as_me:6999: \$? = $ac_status" >&5
7000   (exit $ac_status); } &&
7001          { ac_try='test -s conftest.$ac_objext'
7002   { (eval echo "$as_me:7002: \"$ac_try\"") >&5
7003   (eval $ac_try) 2>&5
7004   ac_status=$?
7005   echo "$as_me:7005: \$? = $ac_status" >&5
7006   (exit $ac_status); }; }; then
7007   cf_cv_ncurses_header=$cf_header; break
7008 else
7009   echo "$as_me: failed program was:" >&5
7010 cat conftest.$ac_ext >&5
7011 fi
7012 rm -f conftest.$ac_objext conftest.$ac_ext
7013 done
7014
7015 fi
7016 echo "$as_me:7016: result: $cf_cv_ncurses_header" >&5
7017 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7018
7019 if test "$cf_cv_ncurses_header" = none ; then
7020         { { echo "$as_me:7020: error: No curses header-files found" >&5
7021 echo "$as_me: error: No curses header-files found" >&2;}
7022    { (exit 1); exit 1; }; }
7023 fi
7024
7025 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7026
7027 for ac_header in $cf_cv_ncurses_header
7028 do
7029 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7030 echo "$as_me:7030: checking for $ac_header" >&5
7031 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7032 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7033   echo $ECHO_N "(cached) $ECHO_C" >&6
7034 else
7035   cat >conftest.$ac_ext <<_ACEOF
7036 #line 7036 "configure"
7037 #include "confdefs.h"
7038 #include <$ac_header>
7039 _ACEOF
7040 if { (eval echo "$as_me:7040: \"$ac_cpp conftest.$ac_ext\"") >&5
7041   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7042   ac_status=$?
7043   egrep -v '^ *\+' conftest.er1 >conftest.err
7044   rm -f conftest.er1
7045   cat conftest.err >&5
7046   echo "$as_me:7046: \$? = $ac_status" >&5
7047   (exit $ac_status); } >/dev/null; then
7048   if test -s conftest.err; then
7049     ac_cpp_err=$ac_c_preproc_warn_flag
7050   else
7051     ac_cpp_err=
7052   fi
7053 else
7054   ac_cpp_err=yes
7055 fi
7056 if test -z "$ac_cpp_err"; then
7057   eval "$as_ac_Header=yes"
7058 else
7059   echo "$as_me: failed program was:" >&5
7060   cat conftest.$ac_ext >&5
7061   eval "$as_ac_Header=no"
7062 fi
7063 rm -f conftest.err conftest.$ac_ext
7064 fi
7065 echo "$as_me:7065: result: `eval echo '${'$as_ac_Header'}'`" >&5
7066 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7067 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7068   cat >>confdefs.h <<EOF
7069 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7070 EOF
7071
7072 fi
7073 done
7074
7075 cat >>confdefs.h <<\EOF
7076 #define NCURSES 1
7077 EOF
7078
7079 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7080
7081                 cat >>confdefs.h <<EOF
7082 #define $cf_nculib_ROOT 1
7083 EOF
7084
7085                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7086
7087         else
7088
7089 cf_ncuhdr_root=$cf_cv_screen
7090
7091 test -n "$cf_cv_curses_dir" && \
7092 test "$cf_cv_curses_dir" != "no" && { \
7093
7094 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7095   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7096   do
7097         while test $cf_add_incdir != /usr/include
7098         do
7099           if test -d $cf_add_incdir
7100           then
7101                 cf_have_incdir=no
7102                 if test -n "$CFLAGS$CPPFLAGS" ; then
7103                   # a loop is needed to ensure we can add subdirs of existing dirs
7104                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7105                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7106                           cf_have_incdir=yes; break
7107                         fi
7108                   done
7109                 fi
7110
7111                 if test "$cf_have_incdir" = no ; then
7112                   if test "$cf_add_incdir" = /usr/local/include ; then
7113                         if test "$GCC" = yes
7114                         then
7115                           cf_save_CPPFLAGS=$CPPFLAGS
7116                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7117                           cat >conftest.$ac_ext <<_ACEOF
7118 #line 7118 "configure"
7119 #include "confdefs.h"
7120 #include <stdio.h>
7121 int
7122 main ()
7123 {
7124 printf("Hello")
7125   ;
7126   return 0;
7127 }
7128 _ACEOF
7129 rm -f conftest.$ac_objext
7130 if { (eval echo "$as_me:7130: \"$ac_compile\"") >&5
7131   (eval $ac_compile) 2>&5
7132   ac_status=$?
7133   echo "$as_me:7133: \$? = $ac_status" >&5
7134   (exit $ac_status); } &&
7135          { ac_try='test -s conftest.$ac_objext'
7136   { (eval echo "$as_me:7136: \"$ac_try\"") >&5
7137   (eval $ac_try) 2>&5
7138   ac_status=$?
7139   echo "$as_me:7139: \$? = $ac_status" >&5
7140   (exit $ac_status); }; }; then
7141   :
7142 else
7143   echo "$as_me: failed program was:" >&5
7144 cat conftest.$ac_ext >&5
7145 cf_have_incdir=yes
7146 fi
7147 rm -f conftest.$ac_objext conftest.$ac_ext
7148                           CPPFLAGS=$cf_save_CPPFLAGS
7149                         fi
7150                   fi
7151                 fi
7152
7153                 if test "$cf_have_incdir" = no ; then
7154                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7155
7156 echo "${as_me:-configure}:7156: testing adding $cf_add_incdir to include-path ..." 1>&5
7157
7158                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7159
7160                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7161                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7162                   cf_add_incdir="$cf_top_incdir"
7163                 else
7164                   break
7165                 fi
7166           else
7167                 break
7168           fi
7169         done
7170   done
7171 fi
7172
7173 }
7174
7175 echo "$as_me:7175: checking for $cf_ncuhdr_root header in include-path" >&5
7176 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7177 if test "${cf_cv_ncurses_h+set}" = set; then
7178   echo $ECHO_N "(cached) $ECHO_C" >&6
7179 else
7180
7181         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7182         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7183         for cf_header in $cf_header_list
7184         do
7185
7186         cat >conftest.$ac_ext <<_ACEOF
7187 #line 7187 "configure"
7188 #include "confdefs.h"
7189
7190 #include <$cf_header>
7191 int
7192 main ()
7193 {
7194
7195 #ifdef NCURSES_VERSION
7196
7197 printf("%s\n", NCURSES_VERSION);
7198 #else
7199 #ifdef __NCURSES_H
7200 printf("old\n");
7201 #else
7202         make an error
7203 #endif
7204 #endif
7205
7206   ;
7207   return 0;
7208 }
7209 _ACEOF
7210 rm -f conftest.$ac_objext
7211 if { (eval echo "$as_me:7211: \"$ac_compile\"") >&5
7212   (eval $ac_compile) 2>&5
7213   ac_status=$?
7214   echo "$as_me:7214: \$? = $ac_status" >&5
7215   (exit $ac_status); } &&
7216          { ac_try='test -s conftest.$ac_objext'
7217   { (eval echo "$as_me:7217: \"$ac_try\"") >&5
7218   (eval $ac_try) 2>&5
7219   ac_status=$?
7220   echo "$as_me:7220: \$? = $ac_status" >&5
7221   (exit $ac_status); }; }; then
7222   cf_cv_ncurses_h=$cf_header
7223
7224 else
7225   echo "$as_me: failed program was:" >&5
7226 cat conftest.$ac_ext >&5
7227 cf_cv_ncurses_h=no
7228 fi
7229 rm -f conftest.$ac_objext conftest.$ac_ext
7230
7231                 test "$cf_cv_ncurses_h" != no && break
7232         done
7233
7234 fi
7235 echo "$as_me:7235: result: $cf_cv_ncurses_h" >&5
7236 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7237
7238 if test "$cf_cv_ncurses_h" != no ; then
7239         cf_cv_ncurses_header=$cf_cv_ncurses_h
7240 else
7241
7242 echo "$as_me:7242: checking for $cf_ncuhdr_root include-path" >&5
7243 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7244 if test "${cf_cv_ncurses_h2+set}" = set; then
7245   echo $ECHO_N "(cached) $ECHO_C" >&6
7246 else
7247
7248         test -n "$verbose" && echo
7249
7250 cf_search=
7251
7252 # collect the current set of include-directories from compiler flags
7253 cf_header_path_list=""
7254 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7255         for cf_header_path in $CPPFLAGS $CFLAGS
7256         do
7257                 case $cf_header_path in
7258                 (-I*)
7259                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7260
7261 test "x$cf_header_path" != "xNONE" && \
7262 test -d "$cf_header_path" && \
7263  {
7264         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7265         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7266         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7267         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7268         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7269         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"
7270 }
7271
7272                         cf_header_path_list="$cf_header_path_list $cf_search"
7273                         ;;
7274                 esac
7275         done
7276 fi
7277
7278 # add the variations for the package we are looking for
7279
7280 cf_search=
7281
7282 test "x$prefix" != "xNONE" && \
7283 test -d "$prefix" && \
7284  {
7285         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7286         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7287         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7288         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7289         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7290         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7291 }
7292
7293 for cf_subdir_prefix in \
7294         /usr \
7295         /usr/local \
7296         /usr/pkg \
7297         /opt \
7298         /opt/local \
7299         $HOME
7300 do
7301
7302 test "x$cf_subdir_prefix" != "x$prefix" && \
7303 test -d "$cf_subdir_prefix" && \
7304 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7305         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7306         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7307         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7308         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7309         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7310         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"
7311 }
7312
7313 done
7314
7315 test "$includedir" != NONE && \
7316 test "$includedir" != "/usr/include" && \
7317 test -d "$includedir" && {
7318         test -d $includedir &&    cf_search="$cf_search $includedir"
7319         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7320 }
7321
7322 test "$oldincludedir" != NONE && \
7323 test "$oldincludedir" != "/usr/include" && \
7324 test -d "$oldincludedir" && {
7325         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7326         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7327 }
7328
7329 cf_search="$cf_search $cf_header_path_list"
7330
7331         test -n "$verbose" && echo search path $cf_search
7332         cf_save2_CPPFLAGS="$CPPFLAGS"
7333         for cf_incdir in $cf_search
7334         do
7335
7336 if test -n "$cf_incdir" ; then
7337   for cf_add_incdir in $cf_incdir
7338   do
7339         while test $cf_add_incdir != /usr/include
7340         do
7341           if test -d $cf_add_incdir
7342           then
7343                 cf_have_incdir=no
7344                 if test -n "$CFLAGS$CPPFLAGS" ; then
7345                   # a loop is needed to ensure we can add subdirs of existing dirs
7346                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7347                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7348                           cf_have_incdir=yes; break
7349                         fi
7350                   done
7351                 fi
7352
7353                 if test "$cf_have_incdir" = no ; then
7354                   if test "$cf_add_incdir" = /usr/local/include ; then
7355                         if test "$GCC" = yes
7356                         then
7357                           cf_save_CPPFLAGS=$CPPFLAGS
7358                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7359                           cat >conftest.$ac_ext <<_ACEOF
7360 #line 7360 "configure"
7361 #include "confdefs.h"
7362 #include <stdio.h>
7363 int
7364 main ()
7365 {
7366 printf("Hello")
7367   ;
7368   return 0;
7369 }
7370 _ACEOF
7371 rm -f conftest.$ac_objext
7372 if { (eval echo "$as_me:7372: \"$ac_compile\"") >&5
7373   (eval $ac_compile) 2>&5
7374   ac_status=$?
7375   echo "$as_me:7375: \$? = $ac_status" >&5
7376   (exit $ac_status); } &&
7377          { ac_try='test -s conftest.$ac_objext'
7378   { (eval echo "$as_me:7378: \"$ac_try\"") >&5
7379   (eval $ac_try) 2>&5
7380   ac_status=$?
7381   echo "$as_me:7381: \$? = $ac_status" >&5
7382   (exit $ac_status); }; }; then
7383   :
7384 else
7385   echo "$as_me: failed program was:" >&5
7386 cat conftest.$ac_ext >&5
7387 cf_have_incdir=yes
7388 fi
7389 rm -f conftest.$ac_objext conftest.$ac_ext
7390                           CPPFLAGS=$cf_save_CPPFLAGS
7391                         fi
7392                   fi
7393                 fi
7394
7395                 if test "$cf_have_incdir" = no ; then
7396                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7397
7398 echo "${as_me:-configure}:7398: testing adding $cf_add_incdir to include-path ..." 1>&5
7399
7400                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7401
7402                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7403                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7404                   cf_add_incdir="$cf_top_incdir"
7405                 else
7406                   break
7407                 fi
7408           else
7409                 break
7410           fi
7411         done
7412   done
7413 fi
7414
7415                 for cf_header in \
7416                         ncurses.h \
7417                         curses.h
7418                 do
7419
7420         cat >conftest.$ac_ext <<_ACEOF
7421 #line 7421 "configure"
7422 #include "confdefs.h"
7423
7424 #include <$cf_header>
7425 int
7426 main ()
7427 {
7428
7429 #ifdef NCURSES_VERSION
7430
7431 printf("%s\n", NCURSES_VERSION);
7432 #else
7433 #ifdef __NCURSES_H
7434 printf("old\n");
7435 #else
7436         make an error
7437 #endif
7438 #endif
7439
7440   ;
7441   return 0;
7442 }
7443 _ACEOF
7444 rm -f conftest.$ac_objext
7445 if { (eval echo "$as_me:7445: \"$ac_compile\"") >&5
7446   (eval $ac_compile) 2>&5
7447   ac_status=$?
7448   echo "$as_me:7448: \$? = $ac_status" >&5
7449   (exit $ac_status); } &&
7450          { ac_try='test -s conftest.$ac_objext'
7451   { (eval echo "$as_me:7451: \"$ac_try\"") >&5
7452   (eval $ac_try) 2>&5
7453   ac_status=$?
7454   echo "$as_me:7454: \$? = $ac_status" >&5
7455   (exit $ac_status); }; }; then
7456   cf_cv_ncurses_h2=$cf_header
7457
7458 else
7459   echo "$as_me: failed program was:" >&5
7460 cat conftest.$ac_ext >&5
7461 cf_cv_ncurses_h2=no
7462 fi
7463 rm -f conftest.$ac_objext conftest.$ac_ext
7464
7465                         if test "$cf_cv_ncurses_h2" != no ; then
7466                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7467                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7468                                 break
7469                         fi
7470                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7471                 done
7472                 CPPFLAGS="$cf_save2_CPPFLAGS"
7473                 test "$cf_cv_ncurses_h2" != no && break
7474         done
7475         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7475: error: not found" >&5
7476 echo "$as_me: error: not found" >&2;}
7477    { (exit 1); exit 1; }; }
7478
7479 fi
7480 echo "$as_me:7480: result: $cf_cv_ncurses_h2" >&5
7481 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7482
7483         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7484         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7485         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7486                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7487         fi
7488
7489 if test -n "$cf_1st_incdir" ; then
7490   for cf_add_incdir in $cf_1st_incdir
7491   do
7492         while test $cf_add_incdir != /usr/include
7493         do
7494           if test -d $cf_add_incdir
7495           then
7496                 cf_have_incdir=no
7497                 if test -n "$CFLAGS$CPPFLAGS" ; then
7498                   # a loop is needed to ensure we can add subdirs of existing dirs
7499                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7500                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7501                           cf_have_incdir=yes; break
7502                         fi
7503                   done
7504                 fi
7505
7506                 if test "$cf_have_incdir" = no ; then
7507                   if test "$cf_add_incdir" = /usr/local/include ; then
7508                         if test "$GCC" = yes
7509                         then
7510                           cf_save_CPPFLAGS=$CPPFLAGS
7511                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7512                           cat >conftest.$ac_ext <<_ACEOF
7513 #line 7513 "configure"
7514 #include "confdefs.h"
7515 #include <stdio.h>
7516 int
7517 main ()
7518 {
7519 printf("Hello")
7520   ;
7521   return 0;
7522 }
7523 _ACEOF
7524 rm -f conftest.$ac_objext
7525 if { (eval echo "$as_me:7525: \"$ac_compile\"") >&5
7526   (eval $ac_compile) 2>&5
7527   ac_status=$?
7528   echo "$as_me:7528: \$? = $ac_status" >&5
7529   (exit $ac_status); } &&
7530          { ac_try='test -s conftest.$ac_objext'
7531   { (eval echo "$as_me:7531: \"$ac_try\"") >&5
7532   (eval $ac_try) 2>&5
7533   ac_status=$?
7534   echo "$as_me:7534: \$? = $ac_status" >&5
7535   (exit $ac_status); }; }; then
7536   :
7537 else
7538   echo "$as_me: failed program was:" >&5
7539 cat conftest.$ac_ext >&5
7540 cf_have_incdir=yes
7541 fi
7542 rm -f conftest.$ac_objext conftest.$ac_ext
7543                           CPPFLAGS=$cf_save_CPPFLAGS
7544                         fi
7545                   fi
7546                 fi
7547
7548                 if test "$cf_have_incdir" = no ; then
7549                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7550
7551 echo "${as_me:-configure}:7551: testing adding $cf_add_incdir to include-path ..." 1>&5
7552
7553                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7554
7555                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7556                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7557                   cf_add_incdir="$cf_top_incdir"
7558                 else
7559                   break
7560                 fi
7561           else
7562                 break
7563           fi
7564         done
7565   done
7566 fi
7567
7568 fi
7569
7570 # Set definitions to allow ifdef'ing for ncurses.h
7571
7572 case $cf_cv_ncurses_header in
7573 (*ncurses.h)
7574
7575 cat >>confdefs.h <<\EOF
7576 #define HAVE_NCURSES_H 1
7577 EOF
7578
7579         ;;
7580 esac
7581
7582 case $cf_cv_ncurses_header in
7583 (ncurses/curses.h|ncurses/ncurses.h)
7584
7585 cat >>confdefs.h <<\EOF
7586 #define HAVE_NCURSES_NCURSES_H 1
7587 EOF
7588
7589         ;;
7590 (ncursesw/curses.h|ncursesw/ncurses.h)
7591
7592 cat >>confdefs.h <<\EOF
7593 #define HAVE_NCURSESW_NCURSES_H 1
7594 EOF
7595
7596         ;;
7597 esac
7598
7599 echo "$as_me:7599: checking for terminfo header" >&5
7600 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7601 if test "${cf_cv_term_header+set}" = set; then
7602   echo $ECHO_N "(cached) $ECHO_C" >&6
7603 else
7604
7605 case ${cf_cv_ncurses_header} in
7606 (*/ncurses.h|*/ncursesw.h)
7607         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7608         ;;
7609 (*)
7610         cf_term_header=term.h
7611         ;;
7612 esac
7613
7614 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7615 do
7616 cat >conftest.$ac_ext <<_ACEOF
7617 #line 7617 "configure"
7618 #include "confdefs.h"
7619 #include <stdio.h>
7620 #include <${cf_cv_ncurses_header:-curses.h}>
7621 #include <$cf_test>
7622
7623 int
7624 main ()
7625 {
7626 int x = auto_left_margin
7627   ;
7628   return 0;
7629 }
7630 _ACEOF
7631 rm -f conftest.$ac_objext
7632 if { (eval echo "$as_me:7632: \"$ac_compile\"") >&5
7633   (eval $ac_compile) 2>&5
7634   ac_status=$?
7635   echo "$as_me:7635: \$? = $ac_status" >&5
7636   (exit $ac_status); } &&
7637          { ac_try='test -s conftest.$ac_objext'
7638   { (eval echo "$as_me:7638: \"$ac_try\"") >&5
7639   (eval $ac_try) 2>&5
7640   ac_status=$?
7641   echo "$as_me:7641: \$? = $ac_status" >&5
7642   (exit $ac_status); }; }; then
7643
7644         cf_cv_term_header="$cf_test"
7645 else
7646   echo "$as_me: failed program was:" >&5
7647 cat conftest.$ac_ext >&5
7648
7649         cf_cv_term_header=unknown
7650
7651 fi
7652 rm -f conftest.$ac_objext conftest.$ac_ext
7653         test "$cf_cv_term_header" != unknown && break
7654 done
7655
7656 fi
7657 echo "$as_me:7657: result: $cf_cv_term_header" >&5
7658 echo "${ECHO_T}$cf_cv_term_header" >&6
7659
7660 # Set definitions to allow ifdef'ing to accommodate subdirectories
7661
7662 case $cf_cv_term_header in
7663 (*term.h)
7664
7665 cat >>confdefs.h <<\EOF
7666 #define HAVE_TERM_H 1
7667 EOF
7668
7669         ;;
7670 esac
7671
7672 case $cf_cv_term_header in
7673 (ncurses/term.h)
7674
7675 cat >>confdefs.h <<\EOF
7676 #define HAVE_NCURSES_TERM_H 1
7677 EOF
7678
7679         ;;
7680 (ncursesw/term.h)
7681
7682 cat >>confdefs.h <<\EOF
7683 #define HAVE_NCURSESW_TERM_H 1
7684 EOF
7685
7686         ;;
7687 esac
7688
7689 # some applications need this, but should check for NCURSES_VERSION
7690
7691 cat >>confdefs.h <<\EOF
7692 #define NCURSES 1
7693 EOF
7694
7695 echo "$as_me:7695: checking for ncurses version" >&5
7696 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7697 if test "${cf_cv_ncurses_version+set}" = set; then
7698   echo $ECHO_N "(cached) $ECHO_C" >&6
7699 else
7700
7701         cf_cv_ncurses_version=no
7702         cf_tempfile=out$$
7703         rm -f $cf_tempfile
7704         if test "$cross_compiling" = yes; then
7705
7706         # This will not work if the preprocessor splits the line after the
7707         # Autoconf token.  The 'unproto' program does that.
7708         cat > conftest.$ac_ext <<EOF
7709 #include <${cf_cv_ncurses_header:-curses.h}>
7710 #undef Autoconf
7711 #ifdef NCURSES_VERSION
7712 Autoconf NCURSES_VERSION
7713 #else
7714 #ifdef __NCURSES_H
7715 Autoconf "old"
7716 #endif
7717 ;
7718 #endif
7719 EOF
7720         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7721         { (eval echo "$as_me:7721: \"$cf_try\"") >&5
7722   (eval $cf_try) 2>&5
7723   ac_status=$?
7724   echo "$as_me:7724: \$? = $ac_status" >&5
7725   (exit $ac_status); }
7726         if test -f conftest.out ; then
7727                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7728                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7729                 rm -f conftest.out
7730         fi
7731
7732 else
7733   cat >conftest.$ac_ext <<_ACEOF
7734 #line 7734 "configure"
7735 #include "confdefs.h"
7736
7737 #include <${cf_cv_ncurses_header:-curses.h}>
7738 #include <stdio.h>
7739 int main()
7740 {
7741         FILE *fp = fopen("$cf_tempfile", "w");
7742 #ifdef NCURSES_VERSION
7743 # ifdef NCURSES_VERSION_PATCH
7744         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7745 # else
7746         fprintf(fp, "%s\n", NCURSES_VERSION);
7747 # endif
7748 #else
7749 # ifdef __NCURSES_H
7750         fprintf(fp, "old\n");
7751 # else
7752         make an error
7753 # endif
7754 #endif
7755         ${cf_cv_main_return:-return}(0);
7756 }
7757 _ACEOF
7758 rm -f conftest$ac_exeext
7759 if { (eval echo "$as_me:7759: \"$ac_link\"") >&5
7760   (eval $ac_link) 2>&5
7761   ac_status=$?
7762   echo "$as_me:7762: \$? = $ac_status" >&5
7763   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7764   { (eval echo "$as_me:7764: \"$ac_try\"") >&5
7765   (eval $ac_try) 2>&5
7766   ac_status=$?
7767   echo "$as_me:7767: \$? = $ac_status" >&5
7768   (exit $ac_status); }; }; then
7769
7770         cf_cv_ncurses_version=`cat $cf_tempfile`
7771 else
7772   echo "$as_me: program exited with status $ac_status" >&5
7773 echo "$as_me: failed program was:" >&5
7774 cat conftest.$ac_ext >&5
7775 fi
7776 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7777 fi
7778         rm -f $cf_tempfile
7779
7780 fi
7781 echo "$as_me:7781: result: $cf_cv_ncurses_version" >&5
7782 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7783 test "$cf_cv_ncurses_version" = no ||
7784 cat >>confdefs.h <<\EOF
7785 #define NCURSES 1
7786 EOF
7787
7788 cf_nculib_root=$cf_cv_screen
7789         # This works, except for the special case where we find gpm, but
7790         # ncurses is in a nonstandard location via $LIBS, and we really want
7791         # to link gpm.
7792 cf_ncurses_LIBS=""
7793 cf_ncurses_SAVE="$LIBS"
7794 echo "$as_me:7794: checking for Gpm_Open in -lgpm" >&5
7795 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7796 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7797   echo $ECHO_N "(cached) $ECHO_C" >&6
7798 else
7799   ac_check_lib_save_LIBS=$LIBS
7800 LIBS="-lgpm  $LIBS"
7801 cat >conftest.$ac_ext <<_ACEOF
7802 #line 7802 "configure"
7803 #include "confdefs.h"
7804
7805 /* Override any gcc2 internal prototype to avoid an error.  */
7806 #ifdef __cplusplus
7807 extern "C"
7808 #endif
7809 /* We use char because int might match the return type of a gcc2
7810    builtin and then its argument prototype would still apply.  */
7811 char Gpm_Open ();
7812 int
7813 main ()
7814 {
7815 Gpm_Open ();
7816   ;
7817   return 0;
7818 }
7819 _ACEOF
7820 rm -f conftest.$ac_objext conftest$ac_exeext
7821 if { (eval echo "$as_me:7821: \"$ac_link\"") >&5
7822   (eval $ac_link) 2>&5
7823   ac_status=$?
7824   echo "$as_me:7824: \$? = $ac_status" >&5
7825   (exit $ac_status); } &&
7826          { ac_try='test -s conftest$ac_exeext'
7827   { (eval echo "$as_me:7827: \"$ac_try\"") >&5
7828   (eval $ac_try) 2>&5
7829   ac_status=$?
7830   echo "$as_me:7830: \$? = $ac_status" >&5
7831   (exit $ac_status); }; }; then
7832   ac_cv_lib_gpm_Gpm_Open=yes
7833 else
7834   echo "$as_me: failed program was:" >&5
7835 cat conftest.$ac_ext >&5
7836 ac_cv_lib_gpm_Gpm_Open=no
7837 fi
7838 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7839 LIBS=$ac_check_lib_save_LIBS
7840 fi
7841 echo "$as_me:7841: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7842 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7843 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7844   echo "$as_me:7844: checking for initscr in -lgpm" >&5
7845 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7846 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7847   echo $ECHO_N "(cached) $ECHO_C" >&6
7848 else
7849   ac_check_lib_save_LIBS=$LIBS
7850 LIBS="-lgpm  $LIBS"
7851 cat >conftest.$ac_ext <<_ACEOF
7852 #line 7852 "configure"
7853 #include "confdefs.h"
7854
7855 /* Override any gcc2 internal prototype to avoid an error.  */
7856 #ifdef __cplusplus
7857 extern "C"
7858 #endif
7859 /* We use char because int might match the return type of a gcc2
7860    builtin and then its argument prototype would still apply.  */
7861 char initscr ();
7862 int
7863 main ()
7864 {
7865 initscr ();
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   ac_cv_lib_gpm_initscr=yes
7883 else
7884   echo "$as_me: failed program was:" >&5
7885 cat conftest.$ac_ext >&5
7886 ac_cv_lib_gpm_initscr=no
7887 fi
7888 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7889 LIBS=$ac_check_lib_save_LIBS
7890 fi
7891 echo "$as_me:7891: result: $ac_cv_lib_gpm_initscr" >&5
7892 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7893 if test $ac_cv_lib_gpm_initscr = yes; then
7894   LIBS="$cf_ncurses_SAVE"
7895 else
7896   cf_ncurses_LIBS="-lgpm"
7897 fi
7898
7899 fi
7900
7901 case $host_os in
7902 (freebsd*)
7903         # This is only necessary if you are linking against an obsolete
7904         # version of ncurses (but it should do no harm, since it's static).
7905         if test "$cf_nculib_root" = ncurses ; then
7906                 echo "$as_me:7906: checking for tgoto in -lmytinfo" >&5
7907 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7908 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7909   echo $ECHO_N "(cached) $ECHO_C" >&6
7910 else
7911   ac_check_lib_save_LIBS=$LIBS
7912 LIBS="-lmytinfo  $LIBS"
7913 cat >conftest.$ac_ext <<_ACEOF
7914 #line 7914 "configure"
7915 #include "confdefs.h"
7916
7917 /* Override any gcc2 internal prototype to avoid an error.  */
7918 #ifdef __cplusplus
7919 extern "C"
7920 #endif
7921 /* We use char because int might match the return type of a gcc2
7922    builtin and then its argument prototype would still apply.  */
7923 char tgoto ();
7924 int
7925 main ()
7926 {
7927 tgoto ();
7928   ;
7929   return 0;
7930 }
7931 _ACEOF
7932 rm -f conftest.$ac_objext conftest$ac_exeext
7933 if { (eval echo "$as_me:7933: \"$ac_link\"") >&5
7934   (eval $ac_link) 2>&5
7935   ac_status=$?
7936   echo "$as_me:7936: \$? = $ac_status" >&5
7937   (exit $ac_status); } &&
7938          { ac_try='test -s conftest$ac_exeext'
7939   { (eval echo "$as_me:7939: \"$ac_try\"") >&5
7940   (eval $ac_try) 2>&5
7941   ac_status=$?
7942   echo "$as_me:7942: \$? = $ac_status" >&5
7943   (exit $ac_status); }; }; then
7944   ac_cv_lib_mytinfo_tgoto=yes
7945 else
7946   echo "$as_me: failed program was:" >&5
7947 cat conftest.$ac_ext >&5
7948 ac_cv_lib_mytinfo_tgoto=no
7949 fi
7950 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7951 LIBS=$ac_check_lib_save_LIBS
7952 fi
7953 echo "$as_me:7953: result: $ac_cv_lib_mytinfo_tgoto" >&5
7954 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7955 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7956   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7957 fi
7958
7959         fi
7960         ;;
7961 esac
7962
7963 cf_add_libs="$cf_ncurses_LIBS"
7964 # Filter out duplicates - this happens with badly-designed ".pc" files...
7965 for cf_add_1lib in $LIBS
7966 do
7967         for cf_add_2lib in $cf_add_libs
7968         do
7969                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7970                 then
7971                         cf_add_1lib=
7972                         break
7973                 fi
7974         done
7975         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7976 done
7977 LIBS="$cf_add_libs"
7978
7979 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7980 then
7981
7982 cf_add_libs="-l$cf_nculib_root"
7983 # Filter out duplicates - this happens with badly-designed ".pc" files...
7984 for cf_add_1lib in $LIBS
7985 do
7986         for cf_add_2lib in $cf_add_libs
7987         do
7988                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7989                 then
7990                         cf_add_1lib=
7991                         break
7992                 fi
7993         done
7994         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7995 done
7996 LIBS="$cf_add_libs"
7997
7998 else
7999
8000         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8001         cf_libdir=""
8002         echo "$as_me:8002: checking for initscr" >&5
8003 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8004 if test "${ac_cv_func_initscr+set}" = set; then
8005   echo $ECHO_N "(cached) $ECHO_C" >&6
8006 else
8007   cat >conftest.$ac_ext <<_ACEOF
8008 #line 8008 "configure"
8009 #include "confdefs.h"
8010 /* System header to define __stub macros and hopefully few prototypes,
8011     which can conflict with char initscr (); below.  */
8012 #include <assert.h>
8013 /* Override any gcc2 internal prototype to avoid an error.  */
8014 #ifdef __cplusplus
8015 extern "C"
8016 #endif
8017 /* We use char because int might match the return type of a gcc2
8018    builtin and then its argument prototype would still apply.  */
8019 char initscr ();
8020 char (*f) ();
8021
8022 int
8023 main ()
8024 {
8025 /* The GNU C library defines this for functions which it implements
8026     to always fail with ENOSYS.  Some functions are actually named
8027     something starting with __ and the normal name is an alias.  */
8028 #if defined (__stub_initscr) || defined (__stub___initscr)
8029 choke me
8030 #else
8031 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8032 #endif
8033
8034   ;
8035   return 0;
8036 }
8037 _ACEOF
8038 rm -f conftest.$ac_objext conftest$ac_exeext
8039 if { (eval echo "$as_me:8039: \"$ac_link\"") >&5
8040   (eval $ac_link) 2>&5
8041   ac_status=$?
8042   echo "$as_me:8042: \$? = $ac_status" >&5
8043   (exit $ac_status); } &&
8044          { ac_try='test -s conftest$ac_exeext'
8045   { (eval echo "$as_me:8045: \"$ac_try\"") >&5
8046   (eval $ac_try) 2>&5
8047   ac_status=$?
8048   echo "$as_me:8048: \$? = $ac_status" >&5
8049   (exit $ac_status); }; }; then
8050   ac_cv_func_initscr=yes
8051 else
8052   echo "$as_me: failed program was:" >&5
8053 cat conftest.$ac_ext >&5
8054 ac_cv_func_initscr=no
8055 fi
8056 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8057 fi
8058 echo "$as_me:8058: result: $ac_cv_func_initscr" >&5
8059 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8060 if test $ac_cv_func_initscr = yes; then
8061   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8062 else
8063
8064                 cf_save_LIBS="$LIBS"
8065                 echo "$as_me:8065: checking for initscr in -l$cf_nculib_root" >&5
8066 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8067                 LIBS="-l$cf_nculib_root $LIBS"
8068                 cat >conftest.$ac_ext <<_ACEOF
8069 #line 8069 "configure"
8070 #include "confdefs.h"
8071 #include <${cf_cv_ncurses_header:-curses.h}>
8072 int
8073 main ()
8074 {
8075 initscr()
8076   ;
8077   return 0;
8078 }
8079 _ACEOF
8080 rm -f conftest.$ac_objext conftest$ac_exeext
8081 if { (eval echo "$as_me:8081: \"$ac_link\"") >&5
8082   (eval $ac_link) 2>&5
8083   ac_status=$?
8084   echo "$as_me:8084: \$? = $ac_status" >&5
8085   (exit $ac_status); } &&
8086          { ac_try='test -s conftest$ac_exeext'
8087   { (eval echo "$as_me:8087: \"$ac_try\"") >&5
8088   (eval $ac_try) 2>&5
8089   ac_status=$?
8090   echo "$as_me:8090: \$? = $ac_status" >&5
8091   (exit $ac_status); }; }; then
8092   echo "$as_me:8092: result: yes" >&5
8093 echo "${ECHO_T}yes" >&6
8094                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8095
8096 else
8097   echo "$as_me: failed program was:" >&5
8098 cat conftest.$ac_ext >&5
8099 echo "$as_me:8099: result: no" >&5
8100 echo "${ECHO_T}no" >&6
8101
8102 cf_search=
8103 cf_library_path_list=""
8104 if test -n "${LDFLAGS}${LIBS}" ; then
8105         for cf_library_path in $LDFLAGS $LIBS
8106         do
8107                 case $cf_library_path in
8108                 (-L*)
8109                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8110
8111 test "x$cf_library_path" != "xNONE" && \
8112 test -d "$cf_library_path" && \
8113  {
8114         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8115         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8116         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8117         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8118         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8119         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"
8120 }
8121
8122                         cf_library_path_list="$cf_library_path_list $cf_search"
8123                         ;;
8124                 esac
8125         done
8126 fi
8127
8128 cf_search=
8129
8130 test "x$prefix" != "xNONE" && \
8131 test -d "$prefix" && \
8132  {
8133         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8134         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8135         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8136         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8137         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8138         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8139 }
8140
8141 for cf_subdir_prefix in \
8142         /usr \
8143         /usr/local \
8144         /usr/pkg \
8145         /opt \
8146         /opt/local \
8147         $HOME
8148 do
8149
8150 test "x$cf_subdir_prefix" != "x$prefix" && \
8151 test -d "$cf_subdir_prefix" && \
8152 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8153         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8154         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8155         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8156         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8157         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8158         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"
8159 }
8160
8161 done
8162
8163 cf_search="$cf_library_path_list $cf_search"
8164
8165                         for cf_libdir in $cf_search
8166                         do
8167                                 echo "$as_me:8167: checking for -l$cf_nculib_root in $cf_libdir" >&5
8168 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8169                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8170                                 cat >conftest.$ac_ext <<_ACEOF
8171 #line 8171 "configure"
8172 #include "confdefs.h"
8173 #include <${cf_cv_ncurses_header:-curses.h}>
8174 int
8175 main ()
8176 {
8177 initscr()
8178   ;
8179   return 0;
8180 }
8181 _ACEOF
8182 rm -f conftest.$ac_objext conftest$ac_exeext
8183 if { (eval echo "$as_me:8183: \"$ac_link\"") >&5
8184   (eval $ac_link) 2>&5
8185   ac_status=$?
8186   echo "$as_me:8186: \$? = $ac_status" >&5
8187   (exit $ac_status); } &&
8188          { ac_try='test -s conftest$ac_exeext'
8189   { (eval echo "$as_me:8189: \"$ac_try\"") >&5
8190   (eval $ac_try) 2>&5
8191   ac_status=$?
8192   echo "$as_me:8192: \$? = $ac_status" >&5
8193   (exit $ac_status); }; }; then
8194   echo "$as_me:8194: result: yes" >&5
8195 echo "${ECHO_T}yes" >&6
8196                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8197                                          break
8198 else
8199   echo "$as_me: failed program was:" >&5
8200 cat conftest.$ac_ext >&5
8201 echo "$as_me:8201: result: no" >&5
8202 echo "${ECHO_T}no" >&6
8203                                          LIBS="$cf_save_LIBS"
8204 fi
8205 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8206                         done
8207
8208 fi
8209 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8210
8211 fi
8212
8213 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8214
8215 if test $cf_found_library = no ; then
8216         { { echo "$as_me:8216: error: Cannot link $cf_nculib_root library" >&5
8217 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8218    { (exit 1); exit 1; }; }
8219 fi
8220
8221 fi
8222
8223 if test -n "$cf_ncurses_LIBS" ; then
8224         echo "$as_me:8224: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8225 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8226         cf_ncurses_SAVE="$LIBS"
8227         for p in $cf_ncurses_LIBS ; do
8228                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8229                 if test "$q" != "$LIBS" ; then
8230                         LIBS="$q"
8231                 fi
8232         done
8233         cat >conftest.$ac_ext <<_ACEOF
8234 #line 8234 "configure"
8235 #include "confdefs.h"
8236 #include <${cf_cv_ncurses_header:-curses.h}>
8237 int
8238 main ()
8239 {
8240 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8241   ;
8242   return 0;
8243 }
8244 _ACEOF
8245 rm -f conftest.$ac_objext conftest$ac_exeext
8246 if { (eval echo "$as_me:8246: \"$ac_link\"") >&5
8247   (eval $ac_link) 2>&5
8248   ac_status=$?
8249   echo "$as_me:8249: \$? = $ac_status" >&5
8250   (exit $ac_status); } &&
8251          { ac_try='test -s conftest$ac_exeext'
8252   { (eval echo "$as_me:8252: \"$ac_try\"") >&5
8253   (eval $ac_try) 2>&5
8254   ac_status=$?
8255   echo "$as_me:8255: \$? = $ac_status" >&5
8256   (exit $ac_status); }; }; then
8257   echo "$as_me:8257: result: yes" >&5
8258 echo "${ECHO_T}yes" >&6
8259 else
8260   echo "$as_me: failed program was:" >&5
8261 cat conftest.$ac_ext >&5
8262 echo "$as_me:8262: result: no" >&5
8263 echo "${ECHO_T}no" >&6
8264                  LIBS="$cf_ncurses_SAVE"
8265 fi
8266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8267 fi
8268
8269 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8270
8271 cat >>confdefs.h <<EOF
8272 #define $cf_nculib_ROOT 1
8273 EOF
8274
8275         fi
8276 else
8277         NCURSES_CONFIG=none
8278 fi
8279
8280         ;;
8281 (ncurses*)
8282
8283 cf_ncuconfig_root=$cf_cv_screen
8284 cf_have_ncuconfig=no
8285
8286 if test "x${PKG_CONFIG:=none}" != xnone; then
8287         echo "$as_me:8287: checking pkg-config for $cf_ncuconfig_root" >&5
8288 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8289         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8290                 echo "$as_me:8290: result: yes" >&5
8291 echo "${ECHO_T}yes" >&6
8292
8293                 echo "$as_me:8293: checking if the $cf_ncuconfig_root package files work" >&5
8294 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8295                 cf_have_ncuconfig=unknown
8296
8297                 cf_save_CPPFLAGS="$CPPFLAGS"
8298                 cf_save_LIBS="$LIBS"
8299
8300                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8301
8302 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8303 # Filter out duplicates - this happens with badly-designed ".pc" files...
8304 for cf_add_1lib in $LIBS
8305 do
8306         for cf_add_2lib in $cf_add_libs
8307         do
8308                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8309                 then
8310                         cf_add_1lib=
8311                         break
8312                 fi
8313         done
8314         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8315 done
8316 LIBS="$cf_add_libs"
8317
8318                 cat >conftest.$ac_ext <<_ACEOF
8319 #line 8319 "configure"
8320 #include "confdefs.h"
8321 #include <${cf_cv_ncurses_header:-curses.h}>
8322 int
8323 main ()
8324 {
8325 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8326   ;
8327   return 0;
8328 }
8329 _ACEOF
8330 rm -f conftest.$ac_objext conftest$ac_exeext
8331 if { (eval echo "$as_me:8331: \"$ac_link\"") >&5
8332   (eval $ac_link) 2>&5
8333   ac_status=$?
8334   echo "$as_me:8334: \$? = $ac_status" >&5
8335   (exit $ac_status); } &&
8336          { ac_try='test -s conftest$ac_exeext'
8337   { (eval echo "$as_me:8337: \"$ac_try\"") >&5
8338   (eval $ac_try) 2>&5
8339   ac_status=$?
8340   echo "$as_me:8340: \$? = $ac_status" >&5
8341   (exit $ac_status); }; }; then
8342   if test "$cross_compiling" = yes; then
8343   cf_have_ncuconfig=maybe
8344 else
8345   cat >conftest.$ac_ext <<_ACEOF
8346 #line 8346 "configure"
8347 #include "confdefs.h"
8348 #include <${cf_cv_ncurses_header:-curses.h}>
8349                                 int main(void)
8350                                 { char *xx = curses_version(); return (xx == 0); }
8351 _ACEOF
8352 rm -f conftest$ac_exeext
8353 if { (eval echo "$as_me:8353: \"$ac_link\"") >&5
8354   (eval $ac_link) 2>&5
8355   ac_status=$?
8356   echo "$as_me:8356: \$? = $ac_status" >&5
8357   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8358   { (eval echo "$as_me:8358: \"$ac_try\"") >&5
8359   (eval $ac_try) 2>&5
8360   ac_status=$?
8361   echo "$as_me:8361: \$? = $ac_status" >&5
8362   (exit $ac_status); }; }; then
8363   cf_have_ncuconfig=yes
8364 else
8365   echo "$as_me: program exited with status $ac_status" >&5
8366 echo "$as_me: failed program was:" >&5
8367 cat conftest.$ac_ext >&5
8368 cf_have_ncuconfig=no
8369 fi
8370 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8371 fi
8372 else
8373   echo "$as_me: failed program was:" >&5
8374 cat conftest.$ac_ext >&5
8375 cf_have_ncuconfig=no
8376 fi
8377 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8378                 echo "$as_me:8378: result: $cf_have_ncuconfig" >&5
8379 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8380                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8381                 if test "$cf_have_ncuconfig" != "yes"
8382                 then
8383                         CPPFLAGS="$cf_save_CPPFLAGS"
8384                         LIBS="$cf_save_LIBS"
8385                         NCURSES_CONFIG_PKG=none
8386                 else
8387
8388 cat >>confdefs.h <<\EOF
8389 #define NCURSES 1
8390 EOF
8391
8392                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8393                 fi
8394
8395         else
8396                 echo "$as_me:8396: result: no" >&5
8397 echo "${ECHO_T}no" >&6
8398                 NCURSES_CONFIG_PKG=none
8399         fi
8400 else
8401         NCURSES_CONFIG_PKG=none
8402 fi
8403
8404 if test "x$cf_have_ncuconfig" = "xno"; then
8405         echo "Looking for ${cf_ncuconfig_root}-config"
8406
8407 if test -n "$ac_tool_prefix"; then
8408   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8409   do
8410     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8411 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8412 echo "$as_me:8412: checking for $ac_word" >&5
8413 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8414 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8415   echo $ECHO_N "(cached) $ECHO_C" >&6
8416 else
8417   if test -n "$NCURSES_CONFIG"; then
8418   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8419 else
8420   ac_save_IFS=$IFS; IFS=$ac_path_separator
8421 ac_dummy="$PATH"
8422 for ac_dir in $ac_dummy; do
8423   IFS=$ac_save_IFS
8424   test -z "$ac_dir" && ac_dir=.
8425   $as_executable_p "$ac_dir/$ac_word" || continue
8426 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8427 echo "$as_me:8427: found $ac_dir/$ac_word" >&5
8428 break
8429 done
8430
8431 fi
8432 fi
8433 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8434 if test -n "$NCURSES_CONFIG"; then
8435   echo "$as_me:8435: result: $NCURSES_CONFIG" >&5
8436 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8437 else
8438   echo "$as_me:8438: result: no" >&5
8439 echo "${ECHO_T}no" >&6
8440 fi
8441
8442     test -n "$NCURSES_CONFIG" && break
8443   done
8444 fi
8445 if test -z "$NCURSES_CONFIG"; then
8446   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8447   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8448 do
8449   # Extract the first word of "$ac_prog", so it can be a program name with args.
8450 set dummy $ac_prog; ac_word=$2
8451 echo "$as_me:8451: checking for $ac_word" >&5
8452 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8453 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8454   echo $ECHO_N "(cached) $ECHO_C" >&6
8455 else
8456   if test -n "$ac_ct_NCURSES_CONFIG"; then
8457   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8458 else
8459   ac_save_IFS=$IFS; IFS=$ac_path_separator
8460 ac_dummy="$PATH"
8461 for ac_dir in $ac_dummy; do
8462   IFS=$ac_save_IFS
8463   test -z "$ac_dir" && ac_dir=.
8464   $as_executable_p "$ac_dir/$ac_word" || continue
8465 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8466 echo "$as_me:8466: found $ac_dir/$ac_word" >&5
8467 break
8468 done
8469
8470 fi
8471 fi
8472 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8473 if test -n "$ac_ct_NCURSES_CONFIG"; then
8474   echo "$as_me:8474: result: $ac_ct_NCURSES_CONFIG" >&5
8475 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8476 else
8477   echo "$as_me:8477: result: no" >&5
8478 echo "${ECHO_T}no" >&6
8479 fi
8480
8481   test -n "$ac_ct_NCURSES_CONFIG" && break
8482 done
8483 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8484
8485   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8486 fi
8487
8488         if test "$NCURSES_CONFIG" != none ; then
8489
8490                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8491
8492 cf_add_libs="`$NCURSES_CONFIG --libs`"
8493 # Filter out duplicates - this happens with badly-designed ".pc" files...
8494 for cf_add_1lib in $LIBS
8495 do
8496         for cf_add_2lib in $cf_add_libs
8497         do
8498                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8499                 then
8500                         cf_add_1lib=
8501                         break
8502                 fi
8503         done
8504         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8505 done
8506 LIBS="$cf_add_libs"
8507
8508                 # even with config script, some packages use no-override for curses.h
8509
8510 echo "$as_me:8510: checking if we have identified curses headers" >&5
8511 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8512 if test "${cf_cv_ncurses_header+set}" = set; then
8513   echo $ECHO_N "(cached) $ECHO_C" >&6
8514 else
8515
8516 cf_cv_ncurses_header=none
8517 for cf_header in \
8518         ncurses.h $cf_cv_screen/ncurses.h \
8519         curses.h $cf_cv_screen/curses.h
8520 do
8521 cat >conftest.$ac_ext <<_ACEOF
8522 #line 8522 "configure"
8523 #include "confdefs.h"
8524 #include <${cf_header}>
8525 int
8526 main ()
8527 {
8528 initscr(); tgoto("?", 0,0)
8529   ;
8530   return 0;
8531 }
8532 _ACEOF
8533 rm -f conftest.$ac_objext
8534 if { (eval echo "$as_me:8534: \"$ac_compile\"") >&5
8535   (eval $ac_compile) 2>&5
8536   ac_status=$?
8537   echo "$as_me:8537: \$? = $ac_status" >&5
8538   (exit $ac_status); } &&
8539          { ac_try='test -s conftest.$ac_objext'
8540   { (eval echo "$as_me:8540: \"$ac_try\"") >&5
8541   (eval $ac_try) 2>&5
8542   ac_status=$?
8543   echo "$as_me:8543: \$? = $ac_status" >&5
8544   (exit $ac_status); }; }; then
8545   cf_cv_ncurses_header=$cf_header; break
8546 else
8547   echo "$as_me: failed program was:" >&5
8548 cat conftest.$ac_ext >&5
8549 fi
8550 rm -f conftest.$ac_objext conftest.$ac_ext
8551 done
8552
8553 fi
8554 echo "$as_me:8554: result: $cf_cv_ncurses_header" >&5
8555 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8556
8557 if test "$cf_cv_ncurses_header" = none ; then
8558         { { echo "$as_me:8558: error: No curses header-files found" >&5
8559 echo "$as_me: error: No curses header-files found" >&2;}
8560    { (exit 1); exit 1; }; }
8561 fi
8562
8563 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8564
8565 for ac_header in $cf_cv_ncurses_header
8566 do
8567 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8568 echo "$as_me:8568: checking for $ac_header" >&5
8569 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8570 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8571   echo $ECHO_N "(cached) $ECHO_C" >&6
8572 else
8573   cat >conftest.$ac_ext <<_ACEOF
8574 #line 8574 "configure"
8575 #include "confdefs.h"
8576 #include <$ac_header>
8577 _ACEOF
8578 if { (eval echo "$as_me:8578: \"$ac_cpp conftest.$ac_ext\"") >&5
8579   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8580   ac_status=$?
8581   egrep -v '^ *\+' conftest.er1 >conftest.err
8582   rm -f conftest.er1
8583   cat conftest.err >&5
8584   echo "$as_me:8584: \$? = $ac_status" >&5
8585   (exit $ac_status); } >/dev/null; then
8586   if test -s conftest.err; then
8587     ac_cpp_err=$ac_c_preproc_warn_flag
8588   else
8589     ac_cpp_err=
8590   fi
8591 else
8592   ac_cpp_err=yes
8593 fi
8594 if test -z "$ac_cpp_err"; then
8595   eval "$as_ac_Header=yes"
8596 else
8597   echo "$as_me: failed program was:" >&5
8598   cat conftest.$ac_ext >&5
8599   eval "$as_ac_Header=no"
8600 fi
8601 rm -f conftest.err conftest.$ac_ext
8602 fi
8603 echo "$as_me:8603: result: `eval echo '${'$as_ac_Header'}'`" >&5
8604 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8605 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8606   cat >>confdefs.h <<EOF
8607 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8608 EOF
8609
8610 fi
8611 done
8612
8613 cat >>confdefs.h <<\EOF
8614 #define NCURSES 1
8615 EOF
8616
8617 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8618
8619                 cat >>confdefs.h <<EOF
8620 #define $cf_nculib_ROOT 1
8621 EOF
8622
8623                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8624
8625         else
8626
8627 cf_ncuhdr_root=$cf_cv_screen
8628
8629 test -n "$cf_cv_curses_dir" && \
8630 test "$cf_cv_curses_dir" != "no" && { \
8631
8632 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8633   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8634   do
8635         while test $cf_add_incdir != /usr/include
8636         do
8637           if test -d $cf_add_incdir
8638           then
8639                 cf_have_incdir=no
8640                 if test -n "$CFLAGS$CPPFLAGS" ; then
8641                   # a loop is needed to ensure we can add subdirs of existing dirs
8642                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8643                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8644                           cf_have_incdir=yes; break
8645                         fi
8646                   done
8647                 fi
8648
8649                 if test "$cf_have_incdir" = no ; then
8650                   if test "$cf_add_incdir" = /usr/local/include ; then
8651                         if test "$GCC" = yes
8652                         then
8653                           cf_save_CPPFLAGS=$CPPFLAGS
8654                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8655                           cat >conftest.$ac_ext <<_ACEOF
8656 #line 8656 "configure"
8657 #include "confdefs.h"
8658 #include <stdio.h>
8659 int
8660 main ()
8661 {
8662 printf("Hello")
8663   ;
8664   return 0;
8665 }
8666 _ACEOF
8667 rm -f conftest.$ac_objext
8668 if { (eval echo "$as_me:8668: \"$ac_compile\"") >&5
8669   (eval $ac_compile) 2>&5
8670   ac_status=$?
8671   echo "$as_me:8671: \$? = $ac_status" >&5
8672   (exit $ac_status); } &&
8673          { ac_try='test -s conftest.$ac_objext'
8674   { (eval echo "$as_me:8674: \"$ac_try\"") >&5
8675   (eval $ac_try) 2>&5
8676   ac_status=$?
8677   echo "$as_me:8677: \$? = $ac_status" >&5
8678   (exit $ac_status); }; }; then
8679   :
8680 else
8681   echo "$as_me: failed program was:" >&5
8682 cat conftest.$ac_ext >&5
8683 cf_have_incdir=yes
8684 fi
8685 rm -f conftest.$ac_objext conftest.$ac_ext
8686                           CPPFLAGS=$cf_save_CPPFLAGS
8687                         fi
8688                   fi
8689                 fi
8690
8691                 if test "$cf_have_incdir" = no ; then
8692                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8693
8694 echo "${as_me:-configure}:8694: testing adding $cf_add_incdir to include-path ..." 1>&5
8695
8696                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8697
8698                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8699                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8700                   cf_add_incdir="$cf_top_incdir"
8701                 else
8702                   break
8703                 fi
8704           else
8705                 break
8706           fi
8707         done
8708   done
8709 fi
8710
8711 }
8712
8713 echo "$as_me:8713: checking for $cf_ncuhdr_root header in include-path" >&5
8714 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8715 if test "${cf_cv_ncurses_h+set}" = set; then
8716   echo $ECHO_N "(cached) $ECHO_C" >&6
8717 else
8718
8719         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8720         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8721         for cf_header in $cf_header_list
8722         do
8723
8724         cat >conftest.$ac_ext <<_ACEOF
8725 #line 8725 "configure"
8726 #include "confdefs.h"
8727
8728 #include <$cf_header>
8729 int
8730 main ()
8731 {
8732
8733 #ifdef NCURSES_VERSION
8734
8735 printf("%s\n", NCURSES_VERSION);
8736 #else
8737 #ifdef __NCURSES_H
8738 printf("old\n");
8739 #else
8740         make an error
8741 #endif
8742 #endif
8743
8744   ;
8745   return 0;
8746 }
8747 _ACEOF
8748 rm -f conftest.$ac_objext
8749 if { (eval echo "$as_me:8749: \"$ac_compile\"") >&5
8750   (eval $ac_compile) 2>&5
8751   ac_status=$?
8752   echo "$as_me:8752: \$? = $ac_status" >&5
8753   (exit $ac_status); } &&
8754          { ac_try='test -s conftest.$ac_objext'
8755   { (eval echo "$as_me:8755: \"$ac_try\"") >&5
8756   (eval $ac_try) 2>&5
8757   ac_status=$?
8758   echo "$as_me:8758: \$? = $ac_status" >&5
8759   (exit $ac_status); }; }; then
8760   cf_cv_ncurses_h=$cf_header
8761
8762 else
8763   echo "$as_me: failed program was:" >&5
8764 cat conftest.$ac_ext >&5
8765 cf_cv_ncurses_h=no
8766 fi
8767 rm -f conftest.$ac_objext conftest.$ac_ext
8768
8769                 test "$cf_cv_ncurses_h" != no && break
8770         done
8771
8772 fi
8773 echo "$as_me:8773: result: $cf_cv_ncurses_h" >&5
8774 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8775
8776 if test "$cf_cv_ncurses_h" != no ; then
8777         cf_cv_ncurses_header=$cf_cv_ncurses_h
8778 else
8779
8780 echo "$as_me:8780: checking for $cf_ncuhdr_root include-path" >&5
8781 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8782 if test "${cf_cv_ncurses_h2+set}" = set; then
8783   echo $ECHO_N "(cached) $ECHO_C" >&6
8784 else
8785
8786         test -n "$verbose" && echo
8787
8788 cf_search=
8789
8790 # collect the current set of include-directories from compiler flags
8791 cf_header_path_list=""
8792 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8793         for cf_header_path in $CPPFLAGS $CFLAGS
8794         do
8795                 case $cf_header_path in
8796                 (-I*)
8797                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8798
8799 test "x$cf_header_path" != "xNONE" && \
8800 test -d "$cf_header_path" && \
8801  {
8802         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8803         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8804         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8805         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8806         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8807         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"
8808 }
8809
8810                         cf_header_path_list="$cf_header_path_list $cf_search"
8811                         ;;
8812                 esac
8813         done
8814 fi
8815
8816 # add the variations for the package we are looking for
8817
8818 cf_search=
8819
8820 test "x$prefix" != "xNONE" && \
8821 test -d "$prefix" && \
8822  {
8823         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8824         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8825         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8826         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8827         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8828         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8829 }
8830
8831 for cf_subdir_prefix in \
8832         /usr \
8833         /usr/local \
8834         /usr/pkg \
8835         /opt \
8836         /opt/local \
8837         $HOME
8838 do
8839
8840 test "x$cf_subdir_prefix" != "x$prefix" && \
8841 test -d "$cf_subdir_prefix" && \
8842 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8843         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8844         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8845         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8846         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8847         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8848         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"
8849 }
8850
8851 done
8852
8853 test "$includedir" != NONE && \
8854 test "$includedir" != "/usr/include" && \
8855 test -d "$includedir" && {
8856         test -d $includedir &&    cf_search="$cf_search $includedir"
8857         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8858 }
8859
8860 test "$oldincludedir" != NONE && \
8861 test "$oldincludedir" != "/usr/include" && \
8862 test -d "$oldincludedir" && {
8863         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8864         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8865 }
8866
8867 cf_search="$cf_search $cf_header_path_list"
8868
8869         test -n "$verbose" && echo search path $cf_search
8870         cf_save2_CPPFLAGS="$CPPFLAGS"
8871         for cf_incdir in $cf_search
8872         do
8873
8874 if test -n "$cf_incdir" ; then
8875   for cf_add_incdir in $cf_incdir
8876   do
8877         while test $cf_add_incdir != /usr/include
8878         do
8879           if test -d $cf_add_incdir
8880           then
8881                 cf_have_incdir=no
8882                 if test -n "$CFLAGS$CPPFLAGS" ; then
8883                   # a loop is needed to ensure we can add subdirs of existing dirs
8884                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8885                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8886                           cf_have_incdir=yes; break
8887                         fi
8888                   done
8889                 fi
8890
8891                 if test "$cf_have_incdir" = no ; then
8892                   if test "$cf_add_incdir" = /usr/local/include ; then
8893                         if test "$GCC" = yes
8894                         then
8895                           cf_save_CPPFLAGS=$CPPFLAGS
8896                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8897                           cat >conftest.$ac_ext <<_ACEOF
8898 #line 8898 "configure"
8899 #include "confdefs.h"
8900 #include <stdio.h>
8901 int
8902 main ()
8903 {
8904 printf("Hello")
8905   ;
8906   return 0;
8907 }
8908 _ACEOF
8909 rm -f conftest.$ac_objext
8910 if { (eval echo "$as_me:8910: \"$ac_compile\"") >&5
8911   (eval $ac_compile) 2>&5
8912   ac_status=$?
8913   echo "$as_me:8913: \$? = $ac_status" >&5
8914   (exit $ac_status); } &&
8915          { ac_try='test -s conftest.$ac_objext'
8916   { (eval echo "$as_me:8916: \"$ac_try\"") >&5
8917   (eval $ac_try) 2>&5
8918   ac_status=$?
8919   echo "$as_me:8919: \$? = $ac_status" >&5
8920   (exit $ac_status); }; }; then
8921   :
8922 else
8923   echo "$as_me: failed program was:" >&5
8924 cat conftest.$ac_ext >&5
8925 cf_have_incdir=yes
8926 fi
8927 rm -f conftest.$ac_objext conftest.$ac_ext
8928                           CPPFLAGS=$cf_save_CPPFLAGS
8929                         fi
8930                   fi
8931                 fi
8932
8933                 if test "$cf_have_incdir" = no ; then
8934                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8935
8936 echo "${as_me:-configure}:8936: testing adding $cf_add_incdir to include-path ..." 1>&5
8937
8938                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8939
8940                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8941                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8942                   cf_add_incdir="$cf_top_incdir"
8943                 else
8944                   break
8945                 fi
8946           else
8947                 break
8948           fi
8949         done
8950   done
8951 fi
8952
8953                 for cf_header in \
8954                         ncurses.h \
8955                         curses.h
8956                 do
8957
8958         cat >conftest.$ac_ext <<_ACEOF
8959 #line 8959 "configure"
8960 #include "confdefs.h"
8961
8962 #include <$cf_header>
8963 int
8964 main ()
8965 {
8966
8967 #ifdef NCURSES_VERSION
8968
8969 printf("%s\n", NCURSES_VERSION);
8970 #else
8971 #ifdef __NCURSES_H
8972 printf("old\n");
8973 #else
8974         make an error
8975 #endif
8976 #endif
8977
8978   ;
8979   return 0;
8980 }
8981 _ACEOF
8982 rm -f conftest.$ac_objext
8983 if { (eval echo "$as_me:8983: \"$ac_compile\"") >&5
8984   (eval $ac_compile) 2>&5
8985   ac_status=$?
8986   echo "$as_me:8986: \$? = $ac_status" >&5
8987   (exit $ac_status); } &&
8988          { ac_try='test -s conftest.$ac_objext'
8989   { (eval echo "$as_me:8989: \"$ac_try\"") >&5
8990   (eval $ac_try) 2>&5
8991   ac_status=$?
8992   echo "$as_me:8992: \$? = $ac_status" >&5
8993   (exit $ac_status); }; }; then
8994   cf_cv_ncurses_h2=$cf_header
8995
8996 else
8997   echo "$as_me: failed program was:" >&5
8998 cat conftest.$ac_ext >&5
8999 cf_cv_ncurses_h2=no
9000 fi
9001 rm -f conftest.$ac_objext conftest.$ac_ext
9002
9003                         if test "$cf_cv_ncurses_h2" != no ; then
9004                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9005                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9006                                 break
9007                         fi
9008                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9009                 done
9010                 CPPFLAGS="$cf_save2_CPPFLAGS"
9011                 test "$cf_cv_ncurses_h2" != no && break
9012         done
9013         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9013: error: not found" >&5
9014 echo "$as_me: error: not found" >&2;}
9015    { (exit 1); exit 1; }; }
9016
9017 fi
9018 echo "$as_me:9018: result: $cf_cv_ncurses_h2" >&5
9019 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9020
9021         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9022         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9023         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9024                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9025         fi
9026
9027 if test -n "$cf_1st_incdir" ; then
9028   for cf_add_incdir in $cf_1st_incdir
9029   do
9030         while test $cf_add_incdir != /usr/include
9031         do
9032           if test -d $cf_add_incdir
9033           then
9034                 cf_have_incdir=no
9035                 if test -n "$CFLAGS$CPPFLAGS" ; then
9036                   # a loop is needed to ensure we can add subdirs of existing dirs
9037                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9038                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9039                           cf_have_incdir=yes; break
9040                         fi
9041                   done
9042                 fi
9043
9044                 if test "$cf_have_incdir" = no ; then
9045                   if test "$cf_add_incdir" = /usr/local/include ; then
9046                         if test "$GCC" = yes
9047                         then
9048                           cf_save_CPPFLAGS=$CPPFLAGS
9049                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9050                           cat >conftest.$ac_ext <<_ACEOF
9051 #line 9051 "configure"
9052 #include "confdefs.h"
9053 #include <stdio.h>
9054 int
9055 main ()
9056 {
9057 printf("Hello")
9058   ;
9059   return 0;
9060 }
9061 _ACEOF
9062 rm -f conftest.$ac_objext
9063 if { (eval echo "$as_me:9063: \"$ac_compile\"") >&5
9064   (eval $ac_compile) 2>&5
9065   ac_status=$?
9066   echo "$as_me:9066: \$? = $ac_status" >&5
9067   (exit $ac_status); } &&
9068          { ac_try='test -s conftest.$ac_objext'
9069   { (eval echo "$as_me:9069: \"$ac_try\"") >&5
9070   (eval $ac_try) 2>&5
9071   ac_status=$?
9072   echo "$as_me:9072: \$? = $ac_status" >&5
9073   (exit $ac_status); }; }; then
9074   :
9075 else
9076   echo "$as_me: failed program was:" >&5
9077 cat conftest.$ac_ext >&5
9078 cf_have_incdir=yes
9079 fi
9080 rm -f conftest.$ac_objext conftest.$ac_ext
9081                           CPPFLAGS=$cf_save_CPPFLAGS
9082                         fi
9083                   fi
9084                 fi
9085
9086                 if test "$cf_have_incdir" = no ; then
9087                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9088
9089 echo "${as_me:-configure}:9089: testing adding $cf_add_incdir to include-path ..." 1>&5
9090
9091                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9092
9093                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9094                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9095                   cf_add_incdir="$cf_top_incdir"
9096                 else
9097                   break
9098                 fi
9099           else
9100                 break
9101           fi
9102         done
9103   done
9104 fi
9105
9106 fi
9107
9108 # Set definitions to allow ifdef'ing for ncurses.h
9109
9110 case $cf_cv_ncurses_header in
9111 (*ncurses.h)
9112
9113 cat >>confdefs.h <<\EOF
9114 #define HAVE_NCURSES_H 1
9115 EOF
9116
9117         ;;
9118 esac
9119
9120 case $cf_cv_ncurses_header in
9121 (ncurses/curses.h|ncurses/ncurses.h)
9122
9123 cat >>confdefs.h <<\EOF
9124 #define HAVE_NCURSES_NCURSES_H 1
9125 EOF
9126
9127         ;;
9128 (ncursesw/curses.h|ncursesw/ncurses.h)
9129
9130 cat >>confdefs.h <<\EOF
9131 #define HAVE_NCURSESW_NCURSES_H 1
9132 EOF
9133
9134         ;;
9135 esac
9136
9137 echo "$as_me:9137: checking for terminfo header" >&5
9138 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9139 if test "${cf_cv_term_header+set}" = set; then
9140   echo $ECHO_N "(cached) $ECHO_C" >&6
9141 else
9142
9143 case ${cf_cv_ncurses_header} in
9144 (*/ncurses.h|*/ncursesw.h)
9145         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9146         ;;
9147 (*)
9148         cf_term_header=term.h
9149         ;;
9150 esac
9151
9152 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9153 do
9154 cat >conftest.$ac_ext <<_ACEOF
9155 #line 9155 "configure"
9156 #include "confdefs.h"
9157 #include <stdio.h>
9158 #include <${cf_cv_ncurses_header:-curses.h}>
9159 #include <$cf_test>
9160
9161 int
9162 main ()
9163 {
9164 int x = auto_left_margin
9165   ;
9166   return 0;
9167 }
9168 _ACEOF
9169 rm -f conftest.$ac_objext
9170 if { (eval echo "$as_me:9170: \"$ac_compile\"") >&5
9171   (eval $ac_compile) 2>&5
9172   ac_status=$?
9173   echo "$as_me:9173: \$? = $ac_status" >&5
9174   (exit $ac_status); } &&
9175          { ac_try='test -s conftest.$ac_objext'
9176   { (eval echo "$as_me:9176: \"$ac_try\"") >&5
9177   (eval $ac_try) 2>&5
9178   ac_status=$?
9179   echo "$as_me:9179: \$? = $ac_status" >&5
9180   (exit $ac_status); }; }; then
9181
9182         cf_cv_term_header="$cf_test"
9183 else
9184   echo "$as_me: failed program was:" >&5
9185 cat conftest.$ac_ext >&5
9186
9187         cf_cv_term_header=unknown
9188
9189 fi
9190 rm -f conftest.$ac_objext conftest.$ac_ext
9191         test "$cf_cv_term_header" != unknown && break
9192 done
9193
9194 fi
9195 echo "$as_me:9195: result: $cf_cv_term_header" >&5
9196 echo "${ECHO_T}$cf_cv_term_header" >&6
9197
9198 # Set definitions to allow ifdef'ing to accommodate subdirectories
9199
9200 case $cf_cv_term_header in
9201 (*term.h)
9202
9203 cat >>confdefs.h <<\EOF
9204 #define HAVE_TERM_H 1
9205 EOF
9206
9207         ;;
9208 esac
9209
9210 case $cf_cv_term_header in
9211 (ncurses/term.h)
9212
9213 cat >>confdefs.h <<\EOF
9214 #define HAVE_NCURSES_TERM_H 1
9215 EOF
9216
9217         ;;
9218 (ncursesw/term.h)
9219
9220 cat >>confdefs.h <<\EOF
9221 #define HAVE_NCURSESW_TERM_H 1
9222 EOF
9223
9224         ;;
9225 esac
9226
9227 # some applications need this, but should check for NCURSES_VERSION
9228
9229 cat >>confdefs.h <<\EOF
9230 #define NCURSES 1
9231 EOF
9232
9233 echo "$as_me:9233: checking for ncurses version" >&5
9234 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9235 if test "${cf_cv_ncurses_version+set}" = set; then
9236   echo $ECHO_N "(cached) $ECHO_C" >&6
9237 else
9238
9239         cf_cv_ncurses_version=no
9240         cf_tempfile=out$$
9241         rm -f $cf_tempfile
9242         if test "$cross_compiling" = yes; then
9243
9244         # This will not work if the preprocessor splits the line after the
9245         # Autoconf token.  The 'unproto' program does that.
9246         cat > conftest.$ac_ext <<EOF
9247 #include <${cf_cv_ncurses_header:-curses.h}>
9248 #undef Autoconf
9249 #ifdef NCURSES_VERSION
9250 Autoconf NCURSES_VERSION
9251 #else
9252 #ifdef __NCURSES_H
9253 Autoconf "old"
9254 #endif
9255 ;
9256 #endif
9257 EOF
9258         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9259         { (eval echo "$as_me:9259: \"$cf_try\"") >&5
9260   (eval $cf_try) 2>&5
9261   ac_status=$?
9262   echo "$as_me:9262: \$? = $ac_status" >&5
9263   (exit $ac_status); }
9264         if test -f conftest.out ; then
9265                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9266                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9267                 rm -f conftest.out
9268         fi
9269
9270 else
9271   cat >conftest.$ac_ext <<_ACEOF
9272 #line 9272 "configure"
9273 #include "confdefs.h"
9274
9275 #include <${cf_cv_ncurses_header:-curses.h}>
9276 #include <stdio.h>
9277 int main()
9278 {
9279         FILE *fp = fopen("$cf_tempfile", "w");
9280 #ifdef NCURSES_VERSION
9281 # ifdef NCURSES_VERSION_PATCH
9282         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9283 # else
9284         fprintf(fp, "%s\n", NCURSES_VERSION);
9285 # endif
9286 #else
9287 # ifdef __NCURSES_H
9288         fprintf(fp, "old\n");
9289 # else
9290         make an error
9291 # endif
9292 #endif
9293         ${cf_cv_main_return:-return}(0);
9294 }
9295 _ACEOF
9296 rm -f conftest$ac_exeext
9297 if { (eval echo "$as_me:9297: \"$ac_link\"") >&5
9298   (eval $ac_link) 2>&5
9299   ac_status=$?
9300   echo "$as_me:9300: \$? = $ac_status" >&5
9301   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9302   { (eval echo "$as_me:9302: \"$ac_try\"") >&5
9303   (eval $ac_try) 2>&5
9304   ac_status=$?
9305   echo "$as_me:9305: \$? = $ac_status" >&5
9306   (exit $ac_status); }; }; then
9307
9308         cf_cv_ncurses_version=`cat $cf_tempfile`
9309 else
9310   echo "$as_me: program exited with status $ac_status" >&5
9311 echo "$as_me: failed program was:" >&5
9312 cat conftest.$ac_ext >&5
9313 fi
9314 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9315 fi
9316         rm -f $cf_tempfile
9317
9318 fi
9319 echo "$as_me:9319: result: $cf_cv_ncurses_version" >&5
9320 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9321 test "$cf_cv_ncurses_version" = no ||
9322 cat >>confdefs.h <<\EOF
9323 #define NCURSES 1
9324 EOF
9325
9326 cf_nculib_root=$cf_cv_screen
9327         # This works, except for the special case where we find gpm, but
9328         # ncurses is in a nonstandard location via $LIBS, and we really want
9329         # to link gpm.
9330 cf_ncurses_LIBS=""
9331 cf_ncurses_SAVE="$LIBS"
9332 echo "$as_me:9332: checking for Gpm_Open in -lgpm" >&5
9333 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9334 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9335   echo $ECHO_N "(cached) $ECHO_C" >&6
9336 else
9337   ac_check_lib_save_LIBS=$LIBS
9338 LIBS="-lgpm  $LIBS"
9339 cat >conftest.$ac_ext <<_ACEOF
9340 #line 9340 "configure"
9341 #include "confdefs.h"
9342
9343 /* Override any gcc2 internal prototype to avoid an error.  */
9344 #ifdef __cplusplus
9345 extern "C"
9346 #endif
9347 /* We use char because int might match the return type of a gcc2
9348    builtin and then its argument prototype would still apply.  */
9349 char Gpm_Open ();
9350 int
9351 main ()
9352 {
9353 Gpm_Open ();
9354   ;
9355   return 0;
9356 }
9357 _ACEOF
9358 rm -f conftest.$ac_objext conftest$ac_exeext
9359 if { (eval echo "$as_me:9359: \"$ac_link\"") >&5
9360   (eval $ac_link) 2>&5
9361   ac_status=$?
9362   echo "$as_me:9362: \$? = $ac_status" >&5
9363   (exit $ac_status); } &&
9364          { ac_try='test -s conftest$ac_exeext'
9365   { (eval echo "$as_me:9365: \"$ac_try\"") >&5
9366   (eval $ac_try) 2>&5
9367   ac_status=$?
9368   echo "$as_me:9368: \$? = $ac_status" >&5
9369   (exit $ac_status); }; }; then
9370   ac_cv_lib_gpm_Gpm_Open=yes
9371 else
9372   echo "$as_me: failed program was:" >&5
9373 cat conftest.$ac_ext >&5
9374 ac_cv_lib_gpm_Gpm_Open=no
9375 fi
9376 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9377 LIBS=$ac_check_lib_save_LIBS
9378 fi
9379 echo "$as_me:9379: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9380 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9381 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9382   echo "$as_me:9382: checking for initscr in -lgpm" >&5
9383 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9384 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9385   echo $ECHO_N "(cached) $ECHO_C" >&6
9386 else
9387   ac_check_lib_save_LIBS=$LIBS
9388 LIBS="-lgpm  $LIBS"
9389 cat >conftest.$ac_ext <<_ACEOF
9390 #line 9390 "configure"
9391 #include "confdefs.h"
9392
9393 /* Override any gcc2 internal prototype to avoid an error.  */
9394 #ifdef __cplusplus
9395 extern "C"
9396 #endif
9397 /* We use char because int might match the return type of a gcc2
9398    builtin and then its argument prototype would still apply.  */
9399 char initscr ();
9400 int
9401 main ()
9402 {
9403 initscr ();
9404   ;
9405   return 0;
9406 }
9407 _ACEOF
9408 rm -f conftest.$ac_objext conftest$ac_exeext
9409 if { (eval echo "$as_me:9409: \"$ac_link\"") >&5
9410   (eval $ac_link) 2>&5
9411   ac_status=$?
9412   echo "$as_me:9412: \$? = $ac_status" >&5
9413   (exit $ac_status); } &&
9414          { ac_try='test -s conftest$ac_exeext'
9415   { (eval echo "$as_me:9415: \"$ac_try\"") >&5
9416   (eval $ac_try) 2>&5
9417   ac_status=$?
9418   echo "$as_me:9418: \$? = $ac_status" >&5
9419   (exit $ac_status); }; }; then
9420   ac_cv_lib_gpm_initscr=yes
9421 else
9422   echo "$as_me: failed program was:" >&5
9423 cat conftest.$ac_ext >&5
9424 ac_cv_lib_gpm_initscr=no
9425 fi
9426 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9427 LIBS=$ac_check_lib_save_LIBS
9428 fi
9429 echo "$as_me:9429: result: $ac_cv_lib_gpm_initscr" >&5
9430 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9431 if test $ac_cv_lib_gpm_initscr = yes; then
9432   LIBS="$cf_ncurses_SAVE"
9433 else
9434   cf_ncurses_LIBS="-lgpm"
9435 fi
9436
9437 fi
9438
9439 case $host_os in
9440 (freebsd*)
9441         # This is only necessary if you are linking against an obsolete
9442         # version of ncurses (but it should do no harm, since it's static).
9443         if test "$cf_nculib_root" = ncurses ; then
9444                 echo "$as_me:9444: checking for tgoto in -lmytinfo" >&5
9445 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9446 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9447   echo $ECHO_N "(cached) $ECHO_C" >&6
9448 else
9449   ac_check_lib_save_LIBS=$LIBS
9450 LIBS="-lmytinfo  $LIBS"
9451 cat >conftest.$ac_ext <<_ACEOF
9452 #line 9452 "configure"
9453 #include "confdefs.h"
9454
9455 /* Override any gcc2 internal prototype to avoid an error.  */
9456 #ifdef __cplusplus
9457 extern "C"
9458 #endif
9459 /* We use char because int might match the return type of a gcc2
9460    builtin and then its argument prototype would still apply.  */
9461 char tgoto ();
9462 int
9463 main ()
9464 {
9465 tgoto ();
9466   ;
9467   return 0;
9468 }
9469 _ACEOF
9470 rm -f conftest.$ac_objext conftest$ac_exeext
9471 if { (eval echo "$as_me:9471: \"$ac_link\"") >&5
9472   (eval $ac_link) 2>&5
9473   ac_status=$?
9474   echo "$as_me:9474: \$? = $ac_status" >&5
9475   (exit $ac_status); } &&
9476          { ac_try='test -s conftest$ac_exeext'
9477   { (eval echo "$as_me:9477: \"$ac_try\"") >&5
9478   (eval $ac_try) 2>&5
9479   ac_status=$?
9480   echo "$as_me:9480: \$? = $ac_status" >&5
9481   (exit $ac_status); }; }; then
9482   ac_cv_lib_mytinfo_tgoto=yes
9483 else
9484   echo "$as_me: failed program was:" >&5
9485 cat conftest.$ac_ext >&5
9486 ac_cv_lib_mytinfo_tgoto=no
9487 fi
9488 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9489 LIBS=$ac_check_lib_save_LIBS
9490 fi
9491 echo "$as_me:9491: result: $ac_cv_lib_mytinfo_tgoto" >&5
9492 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9493 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9494   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9495 fi
9496
9497         fi
9498         ;;
9499 esac
9500
9501 cf_add_libs="$cf_ncurses_LIBS"
9502 # Filter out duplicates - this happens with badly-designed ".pc" files...
9503 for cf_add_1lib in $LIBS
9504 do
9505         for cf_add_2lib in $cf_add_libs
9506         do
9507                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9508                 then
9509                         cf_add_1lib=
9510                         break
9511                 fi
9512         done
9513         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9514 done
9515 LIBS="$cf_add_libs"
9516
9517 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9518 then
9519
9520 cf_add_libs="-l$cf_nculib_root"
9521 # Filter out duplicates - this happens with badly-designed ".pc" files...
9522 for cf_add_1lib in $LIBS
9523 do
9524         for cf_add_2lib in $cf_add_libs
9525         do
9526                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9527                 then
9528                         cf_add_1lib=
9529                         break
9530                 fi
9531         done
9532         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9533 done
9534 LIBS="$cf_add_libs"
9535
9536 else
9537
9538         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9539         cf_libdir=""
9540         echo "$as_me:9540: checking for initscr" >&5
9541 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9542 if test "${ac_cv_func_initscr+set}" = set; then
9543   echo $ECHO_N "(cached) $ECHO_C" >&6
9544 else
9545   cat >conftest.$ac_ext <<_ACEOF
9546 #line 9546 "configure"
9547 #include "confdefs.h"
9548 /* System header to define __stub macros and hopefully few prototypes,
9549     which can conflict with char initscr (); below.  */
9550 #include <assert.h>
9551 /* Override any gcc2 internal prototype to avoid an error.  */
9552 #ifdef __cplusplus
9553 extern "C"
9554 #endif
9555 /* We use char because int might match the return type of a gcc2
9556    builtin and then its argument prototype would still apply.  */
9557 char initscr ();
9558 char (*f) ();
9559
9560 int
9561 main ()
9562 {
9563 /* The GNU C library defines this for functions which it implements
9564     to always fail with ENOSYS.  Some functions are actually named
9565     something starting with __ and the normal name is an alias.  */
9566 #if defined (__stub_initscr) || defined (__stub___initscr)
9567 choke me
9568 #else
9569 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9570 #endif
9571
9572   ;
9573   return 0;
9574 }
9575 _ACEOF
9576 rm -f conftest.$ac_objext conftest$ac_exeext
9577 if { (eval echo "$as_me:9577: \"$ac_link\"") >&5
9578   (eval $ac_link) 2>&5
9579   ac_status=$?
9580   echo "$as_me:9580: \$? = $ac_status" >&5
9581   (exit $ac_status); } &&
9582          { ac_try='test -s conftest$ac_exeext'
9583   { (eval echo "$as_me:9583: \"$ac_try\"") >&5
9584   (eval $ac_try) 2>&5
9585   ac_status=$?
9586   echo "$as_me:9586: \$? = $ac_status" >&5
9587   (exit $ac_status); }; }; then
9588   ac_cv_func_initscr=yes
9589 else
9590   echo "$as_me: failed program was:" >&5
9591 cat conftest.$ac_ext >&5
9592 ac_cv_func_initscr=no
9593 fi
9594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9595 fi
9596 echo "$as_me:9596: result: $ac_cv_func_initscr" >&5
9597 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9598 if test $ac_cv_func_initscr = yes; then
9599   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9600 else
9601
9602                 cf_save_LIBS="$LIBS"
9603                 echo "$as_me:9603: checking for initscr in -l$cf_nculib_root" >&5
9604 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9605                 LIBS="-l$cf_nculib_root $LIBS"
9606                 cat >conftest.$ac_ext <<_ACEOF
9607 #line 9607 "configure"
9608 #include "confdefs.h"
9609 #include <${cf_cv_ncurses_header:-curses.h}>
9610 int
9611 main ()
9612 {
9613 initscr()
9614   ;
9615   return 0;
9616 }
9617 _ACEOF
9618 rm -f conftest.$ac_objext conftest$ac_exeext
9619 if { (eval echo "$as_me:9619: \"$ac_link\"") >&5
9620   (eval $ac_link) 2>&5
9621   ac_status=$?
9622   echo "$as_me:9622: \$? = $ac_status" >&5
9623   (exit $ac_status); } &&
9624          { ac_try='test -s conftest$ac_exeext'
9625   { (eval echo "$as_me:9625: \"$ac_try\"") >&5
9626   (eval $ac_try) 2>&5
9627   ac_status=$?
9628   echo "$as_me:9628: \$? = $ac_status" >&5
9629   (exit $ac_status); }; }; then
9630   echo "$as_me:9630: result: yes" >&5
9631 echo "${ECHO_T}yes" >&6
9632                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9633
9634 else
9635   echo "$as_me: failed program was:" >&5
9636 cat conftest.$ac_ext >&5
9637 echo "$as_me:9637: result: no" >&5
9638 echo "${ECHO_T}no" >&6
9639
9640 cf_search=
9641 cf_library_path_list=""
9642 if test -n "${LDFLAGS}${LIBS}" ; then
9643         for cf_library_path in $LDFLAGS $LIBS
9644         do
9645                 case $cf_library_path in
9646                 (-L*)
9647                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9648
9649 test "x$cf_library_path" != "xNONE" && \
9650 test -d "$cf_library_path" && \
9651  {
9652         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9653         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9654         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9655         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9656         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9657         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"
9658 }
9659
9660                         cf_library_path_list="$cf_library_path_list $cf_search"
9661                         ;;
9662                 esac
9663         done
9664 fi
9665
9666 cf_search=
9667
9668 test "x$prefix" != "xNONE" && \
9669 test -d "$prefix" && \
9670  {
9671         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9672         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9673         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9674         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9675         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9676         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9677 }
9678
9679 for cf_subdir_prefix in \
9680         /usr \
9681         /usr/local \
9682         /usr/pkg \
9683         /opt \
9684         /opt/local \
9685         $HOME
9686 do
9687
9688 test "x$cf_subdir_prefix" != "x$prefix" && \
9689 test -d "$cf_subdir_prefix" && \
9690 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9691         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9692         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9693         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9694         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9695         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9696         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"
9697 }
9698
9699 done
9700
9701 cf_search="$cf_library_path_list $cf_search"
9702
9703                         for cf_libdir in $cf_search
9704                         do
9705                                 echo "$as_me:9705: checking for -l$cf_nculib_root in $cf_libdir" >&5
9706 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9707                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9708                                 cat >conftest.$ac_ext <<_ACEOF
9709 #line 9709 "configure"
9710 #include "confdefs.h"
9711 #include <${cf_cv_ncurses_header:-curses.h}>
9712 int
9713 main ()
9714 {
9715 initscr()
9716   ;
9717   return 0;
9718 }
9719 _ACEOF
9720 rm -f conftest.$ac_objext conftest$ac_exeext
9721 if { (eval echo "$as_me:9721: \"$ac_link\"") >&5
9722   (eval $ac_link) 2>&5
9723   ac_status=$?
9724   echo "$as_me:9724: \$? = $ac_status" >&5
9725   (exit $ac_status); } &&
9726          { ac_try='test -s conftest$ac_exeext'
9727   { (eval echo "$as_me:9727: \"$ac_try\"") >&5
9728   (eval $ac_try) 2>&5
9729   ac_status=$?
9730   echo "$as_me:9730: \$? = $ac_status" >&5
9731   (exit $ac_status); }; }; then
9732   echo "$as_me:9732: result: yes" >&5
9733 echo "${ECHO_T}yes" >&6
9734                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9735                                          break
9736 else
9737   echo "$as_me: failed program was:" >&5
9738 cat conftest.$ac_ext >&5
9739 echo "$as_me:9739: result: no" >&5
9740 echo "${ECHO_T}no" >&6
9741                                          LIBS="$cf_save_LIBS"
9742 fi
9743 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9744                         done
9745
9746 fi
9747 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9748
9749 fi
9750
9751 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9752
9753 if test $cf_found_library = no ; then
9754         { { echo "$as_me:9754: error: Cannot link $cf_nculib_root library" >&5
9755 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9756    { (exit 1); exit 1; }; }
9757 fi
9758
9759 fi
9760
9761 if test -n "$cf_ncurses_LIBS" ; then
9762         echo "$as_me:9762: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9763 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9764         cf_ncurses_SAVE="$LIBS"
9765         for p in $cf_ncurses_LIBS ; do
9766                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9767                 if test "$q" != "$LIBS" ; then
9768                         LIBS="$q"
9769                 fi
9770         done
9771         cat >conftest.$ac_ext <<_ACEOF
9772 #line 9772 "configure"
9773 #include "confdefs.h"
9774 #include <${cf_cv_ncurses_header:-curses.h}>
9775 int
9776 main ()
9777 {
9778 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9779   ;
9780   return 0;
9781 }
9782 _ACEOF
9783 rm -f conftest.$ac_objext conftest$ac_exeext
9784 if { (eval echo "$as_me:9784: \"$ac_link\"") >&5
9785   (eval $ac_link) 2>&5
9786   ac_status=$?
9787   echo "$as_me:9787: \$? = $ac_status" >&5
9788   (exit $ac_status); } &&
9789          { ac_try='test -s conftest$ac_exeext'
9790   { (eval echo "$as_me:9790: \"$ac_try\"") >&5
9791   (eval $ac_try) 2>&5
9792   ac_status=$?
9793   echo "$as_me:9793: \$? = $ac_status" >&5
9794   (exit $ac_status); }; }; then
9795   echo "$as_me:9795: result: yes" >&5
9796 echo "${ECHO_T}yes" >&6
9797 else
9798   echo "$as_me: failed program was:" >&5
9799 cat conftest.$ac_ext >&5
9800 echo "$as_me:9800: result: no" >&5
9801 echo "${ECHO_T}no" >&6
9802                  LIBS="$cf_ncurses_SAVE"
9803 fi
9804 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9805 fi
9806
9807 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9808
9809 cat >>confdefs.h <<EOF
9810 #define $cf_nculib_ROOT 1
9811 EOF
9812
9813         fi
9814 else
9815         NCURSES_CONFIG=none
9816 fi
9817
9818         ;;
9819 (pdcurses)
9820         echo "$as_me:9820: checking for X" >&5
9821 echo $ECHO_N "checking for X... $ECHO_C" >&6
9822
9823 # Check whether --with-x or --without-x was given.
9824 if test "${with_x+set}" = set; then
9825   withval="$with_x"
9826
9827 fi;
9828 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9829 if test "x$with_x" = xno; then
9830   # The user explicitly disabled X.
9831   have_x=disabled
9832 else
9833   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9834     # Both variables are already set.
9835     have_x=yes
9836   else
9837     if test "${ac_cv_have_x+set}" = set; then
9838   echo $ECHO_N "(cached) $ECHO_C" >&6
9839 else
9840   # One or both of the vars are not set, and there is no cached value.
9841 ac_x_includes=no ac_x_libraries=no
9842 rm -fr conftest.dir
9843 if mkdir conftest.dir; then
9844   cd conftest.dir
9845   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9846   cat >Imakefile <<'EOF'
9847 acfindx:
9848         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9849 EOF
9850   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9851     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9852     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9853     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9854     for ac_extension in a so sl dylib dll; do
9855       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9856          test -f $ac_im_libdir/libX11.$ac_extension; then
9857         ac_im_usrlibdir=$ac_im_libdir; break
9858       fi
9859     done
9860     # Screen out bogus values from the imake configuration.  They are
9861     # bogus both because they are the default anyway, and because
9862     # using them would break gcc on systems where it needs fixed includes.
9863     case $ac_im_incroot in
9864         /usr/include) ;;
9865         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9866     esac
9867     case $ac_im_usrlibdir in
9868         /usr/lib | /lib) ;;
9869         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9870     esac
9871   fi
9872   cd ..
9873   rm -fr conftest.dir
9874 fi
9875
9876 # Standard set of common directories for X headers.
9877 # Check X11 before X11Rn because it is often a symlink to the current release.
9878 ac_x_header_dirs='
9879 /usr/X11/include
9880 /usr/X11R6/include
9881 /usr/X11R5/include
9882 /usr/X11R4/include
9883
9884 /usr/include/X11
9885 /usr/include/X11R6
9886 /usr/include/X11R5
9887 /usr/include/X11R4
9888
9889 /usr/local/X11/include
9890 /usr/local/X11R6/include
9891 /usr/local/X11R5/include
9892 /usr/local/X11R4/include
9893
9894 /usr/local/include/X11
9895 /usr/local/include/X11R6
9896 /usr/local/include/X11R5
9897 /usr/local/include/X11R4
9898
9899 /usr/X386/include
9900 /usr/x386/include
9901 /usr/XFree86/include/X11
9902
9903 /usr/include
9904 /usr/local/include
9905 /usr/unsupported/include
9906 /usr/athena/include
9907 /usr/local/x11r5/include
9908 /usr/lpp/Xamples/include
9909
9910 /usr/openwin/include
9911 /usr/openwin/share/include'
9912
9913 if test "$ac_x_includes" = no; then
9914   # Guess where to find include files, by looking for Intrinsic.h.
9915   # First, try using that file with no special directory specified.
9916   cat >conftest.$ac_ext <<_ACEOF
9917 #line 9917 "configure"
9918 #include "confdefs.h"
9919 #include <X11/Intrinsic.h>
9920 _ACEOF
9921 if { (eval echo "$as_me:9921: \"$ac_cpp conftest.$ac_ext\"") >&5
9922   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9923   ac_status=$?
9924   egrep -v '^ *\+' conftest.er1 >conftest.err
9925   rm -f conftest.er1
9926   cat conftest.err >&5
9927   echo "$as_me:9927: \$? = $ac_status" >&5
9928   (exit $ac_status); } >/dev/null; then
9929   if test -s conftest.err; then
9930     ac_cpp_err=$ac_c_preproc_warn_flag
9931   else
9932     ac_cpp_err=
9933   fi
9934 else
9935   ac_cpp_err=yes
9936 fi
9937 if test -z "$ac_cpp_err"; then
9938   # We can compile using X headers with no special include directory.
9939 ac_x_includes=
9940 else
9941   echo "$as_me: failed program was:" >&5
9942   cat conftest.$ac_ext >&5
9943   for ac_dir in $ac_x_header_dirs; do
9944   if test -r "$ac_dir/X11/Intrinsic.h"; then
9945     ac_x_includes=$ac_dir
9946     break
9947   fi
9948 done
9949 fi
9950 rm -f conftest.err conftest.$ac_ext
9951 fi # $ac_x_includes = no
9952
9953 if test "$ac_x_libraries" = no; then
9954   # Check for the libraries.
9955   # See if we find them without any special options.
9956   # Don't add to $LIBS permanently.
9957   ac_save_LIBS=$LIBS
9958   LIBS="-lXt $LIBS"
9959   cat >conftest.$ac_ext <<_ACEOF
9960 #line 9960 "configure"
9961 #include "confdefs.h"
9962 #include <X11/Intrinsic.h>
9963 int
9964 main ()
9965 {
9966 XtMalloc (0)
9967   ;
9968   return 0;
9969 }
9970 _ACEOF
9971 rm -f conftest.$ac_objext conftest$ac_exeext
9972 if { (eval echo "$as_me:9972: \"$ac_link\"") >&5
9973   (eval $ac_link) 2>&5
9974   ac_status=$?
9975   echo "$as_me:9975: \$? = $ac_status" >&5
9976   (exit $ac_status); } &&
9977          { ac_try='test -s conftest$ac_exeext'
9978   { (eval echo "$as_me:9978: \"$ac_try\"") >&5
9979   (eval $ac_try) 2>&5
9980   ac_status=$?
9981   echo "$as_me:9981: \$? = $ac_status" >&5
9982   (exit $ac_status); }; }; then
9983   LIBS=$ac_save_LIBS
9984 # We can link X programs with no special library path.
9985 ac_x_libraries=
9986 else
9987   echo "$as_me: failed program was:" >&5
9988 cat conftest.$ac_ext >&5
9989 LIBS=$ac_save_LIBS
9990 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9991 do
9992   # Don't even attempt the hair of trying to link an X program!
9993   for ac_extension in a so sl dylib dll; do
9994     if test -r $ac_dir/libXt.$ac_extension; then
9995       ac_x_libraries=$ac_dir
9996       break 2
9997     fi
9998   done
9999 done
10000 fi
10001 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10002 fi # $ac_x_libraries = no
10003
10004 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10005   # Didn't find X anywhere.  Cache the known absence of X.
10006   ac_cv_have_x="have_x=no"
10007 else
10008   # Record where we found X for the cache.
10009   ac_cv_have_x="have_x=yes \
10010                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10011 fi
10012 fi
10013
10014   fi
10015   eval "$ac_cv_have_x"
10016 fi # $with_x != no
10017
10018 if test "$have_x" != yes; then
10019   echo "$as_me:10019: result: $have_x" >&5
10020 echo "${ECHO_T}$have_x" >&6
10021   no_x=yes
10022 else
10023   # If each of the values was on the command line, it overrides each guess.
10024   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10025   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10026   # Update the cache value to reflect the command line values.
10027   ac_cv_have_x="have_x=yes \
10028                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10029   echo "$as_me:10029: result: libraries $x_libraries, headers $x_includes" >&5
10030 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10031 fi
10032
10033 if test "$no_x" = yes; then
10034   # Not all programs may use this symbol, but it does not hurt to define it.
10035
10036 cat >>confdefs.h <<\EOF
10037 #define X_DISPLAY_MISSING 1
10038 EOF
10039
10040   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10041 else
10042   if test -n "$x_includes"; then
10043     X_CFLAGS="$X_CFLAGS -I$x_includes"
10044   fi
10045
10046   # It would also be nice to do this for all -L options, not just this one.
10047   if test -n "$x_libraries"; then
10048     X_LIBS="$X_LIBS -L$x_libraries"
10049     # For Solaris; some versions of Sun CC require a space after -R and
10050     # others require no space.  Words are not sufficient . . . .
10051     case `(uname -sr) 2>/dev/null` in
10052     "SunOS 5"*)
10053       echo "$as_me:10053: checking whether -R must be followed by a space" >&5
10054 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10055       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10056       cat >conftest.$ac_ext <<_ACEOF
10057 #line 10057 "configure"
10058 #include "confdefs.h"
10059
10060 int
10061 main ()
10062 {
10063
10064   ;
10065   return 0;
10066 }
10067 _ACEOF
10068 rm -f conftest.$ac_objext conftest$ac_exeext
10069 if { (eval echo "$as_me:10069: \"$ac_link\"") >&5
10070   (eval $ac_link) 2>&5
10071   ac_status=$?
10072   echo "$as_me:10072: \$? = $ac_status" >&5
10073   (exit $ac_status); } &&
10074          { ac_try='test -s conftest$ac_exeext'
10075   { (eval echo "$as_me:10075: \"$ac_try\"") >&5
10076   (eval $ac_try) 2>&5
10077   ac_status=$?
10078   echo "$as_me:10078: \$? = $ac_status" >&5
10079   (exit $ac_status); }; }; then
10080   ac_R_nospace=yes
10081 else
10082   echo "$as_me: failed program was:" >&5
10083 cat conftest.$ac_ext >&5
10084 ac_R_nospace=no
10085 fi
10086 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10087       if test $ac_R_nospace = yes; then
10088         echo "$as_me:10088: result: no" >&5
10089 echo "${ECHO_T}no" >&6
10090         X_LIBS="$X_LIBS -R$x_libraries"
10091       else
10092         LIBS="$ac_xsave_LIBS -R $x_libraries"
10093         cat >conftest.$ac_ext <<_ACEOF
10094 #line 10094 "configure"
10095 #include "confdefs.h"
10096
10097 int
10098 main ()
10099 {
10100
10101   ;
10102   return 0;
10103 }
10104 _ACEOF
10105 rm -f conftest.$ac_objext conftest$ac_exeext
10106 if { (eval echo "$as_me:10106: \"$ac_link\"") >&5
10107   (eval $ac_link) 2>&5
10108   ac_status=$?
10109   echo "$as_me:10109: \$? = $ac_status" >&5
10110   (exit $ac_status); } &&
10111          { ac_try='test -s conftest$ac_exeext'
10112   { (eval echo "$as_me:10112: \"$ac_try\"") >&5
10113   (eval $ac_try) 2>&5
10114   ac_status=$?
10115   echo "$as_me:10115: \$? = $ac_status" >&5
10116   (exit $ac_status); }; }; then
10117   ac_R_space=yes
10118 else
10119   echo "$as_me: failed program was:" >&5
10120 cat conftest.$ac_ext >&5
10121 ac_R_space=no
10122 fi
10123 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10124         if test $ac_R_space = yes; then
10125           echo "$as_me:10125: result: yes" >&5
10126 echo "${ECHO_T}yes" >&6
10127           X_LIBS="$X_LIBS -R $x_libraries"
10128         else
10129           echo "$as_me:10129: result: neither works" >&5
10130 echo "${ECHO_T}neither works" >&6
10131         fi
10132       fi
10133       LIBS=$ac_xsave_LIBS
10134     esac
10135   fi
10136
10137   # Check for system-dependent libraries X programs must link with.
10138   # Do this before checking for the system-independent R6 libraries
10139   # (-lICE), since we may need -lsocket or whatever for X linking.
10140
10141   if test "$ISC" = yes; then
10142     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10143   else
10144     # Martyn Johnson says this is needed for Ultrix, if the X
10145     # libraries were built with DECnet support.  And Karl Berry says
10146     # the Alpha needs dnet_stub (dnet does not exist).
10147     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10148     cat >conftest.$ac_ext <<_ACEOF
10149 #line 10149 "configure"
10150 #include "confdefs.h"
10151
10152 /* Override any gcc2 internal prototype to avoid an error.  */
10153 #ifdef __cplusplus
10154 extern "C"
10155 #endif
10156 /* We use char because int might match the return type of a gcc2
10157    builtin and then its argument prototype would still apply.  */
10158 char XOpenDisplay ();
10159 int
10160 main ()
10161 {
10162 XOpenDisplay ();
10163   ;
10164   return 0;
10165 }
10166 _ACEOF
10167 rm -f conftest.$ac_objext conftest$ac_exeext
10168 if { (eval echo "$as_me:10168: \"$ac_link\"") >&5
10169   (eval $ac_link) 2>&5
10170   ac_status=$?
10171   echo "$as_me:10171: \$? = $ac_status" >&5
10172   (exit $ac_status); } &&
10173          { ac_try='test -s conftest$ac_exeext'
10174   { (eval echo "$as_me:10174: \"$ac_try\"") >&5
10175   (eval $ac_try) 2>&5
10176   ac_status=$?
10177   echo "$as_me:10177: \$? = $ac_status" >&5
10178   (exit $ac_status); }; }; then
10179   :
10180 else
10181   echo "$as_me: failed program was:" >&5
10182 cat conftest.$ac_ext >&5
10183 echo "$as_me:10183: checking for dnet_ntoa in -ldnet" >&5
10184 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10185 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10186   echo $ECHO_N "(cached) $ECHO_C" >&6
10187 else
10188   ac_check_lib_save_LIBS=$LIBS
10189 LIBS="-ldnet  $LIBS"
10190 cat >conftest.$ac_ext <<_ACEOF
10191 #line 10191 "configure"
10192 #include "confdefs.h"
10193
10194 /* Override any gcc2 internal prototype to avoid an error.  */
10195 #ifdef __cplusplus
10196 extern "C"
10197 #endif
10198 /* We use char because int might match the return type of a gcc2
10199    builtin and then its argument prototype would still apply.  */
10200 char dnet_ntoa ();
10201 int
10202 main ()
10203 {
10204 dnet_ntoa ();
10205   ;
10206   return 0;
10207 }
10208 _ACEOF
10209 rm -f conftest.$ac_objext conftest$ac_exeext
10210 if { (eval echo "$as_me:10210: \"$ac_link\"") >&5
10211   (eval $ac_link) 2>&5
10212   ac_status=$?
10213   echo "$as_me:10213: \$? = $ac_status" >&5
10214   (exit $ac_status); } &&
10215          { ac_try='test -s conftest$ac_exeext'
10216   { (eval echo "$as_me:10216: \"$ac_try\"") >&5
10217   (eval $ac_try) 2>&5
10218   ac_status=$?
10219   echo "$as_me:10219: \$? = $ac_status" >&5
10220   (exit $ac_status); }; }; then
10221   ac_cv_lib_dnet_dnet_ntoa=yes
10222 else
10223   echo "$as_me: failed program was:" >&5
10224 cat conftest.$ac_ext >&5
10225 ac_cv_lib_dnet_dnet_ntoa=no
10226 fi
10227 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10228 LIBS=$ac_check_lib_save_LIBS
10229 fi
10230 echo "$as_me:10230: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10231 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10232 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10233   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10234 fi
10235
10236     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10237       echo "$as_me:10237: checking for dnet_ntoa in -ldnet_stub" >&5
10238 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10239 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10240   echo $ECHO_N "(cached) $ECHO_C" >&6
10241 else
10242   ac_check_lib_save_LIBS=$LIBS
10243 LIBS="-ldnet_stub  $LIBS"
10244 cat >conftest.$ac_ext <<_ACEOF
10245 #line 10245 "configure"
10246 #include "confdefs.h"
10247
10248 /* Override any gcc2 internal prototype to avoid an error.  */
10249 #ifdef __cplusplus
10250 extern "C"
10251 #endif
10252 /* We use char because int might match the return type of a gcc2
10253    builtin and then its argument prototype would still apply.  */
10254 char dnet_ntoa ();
10255 int
10256 main ()
10257 {
10258 dnet_ntoa ();
10259   ;
10260   return 0;
10261 }
10262 _ACEOF
10263 rm -f conftest.$ac_objext conftest$ac_exeext
10264 if { (eval echo "$as_me:10264: \"$ac_link\"") >&5
10265   (eval $ac_link) 2>&5
10266   ac_status=$?
10267   echo "$as_me:10267: \$? = $ac_status" >&5
10268   (exit $ac_status); } &&
10269          { ac_try='test -s conftest$ac_exeext'
10270   { (eval echo "$as_me:10270: \"$ac_try\"") >&5
10271   (eval $ac_try) 2>&5
10272   ac_status=$?
10273   echo "$as_me:10273: \$? = $ac_status" >&5
10274   (exit $ac_status); }; }; then
10275   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10276 else
10277   echo "$as_me: failed program was:" >&5
10278 cat conftest.$ac_ext >&5
10279 ac_cv_lib_dnet_stub_dnet_ntoa=no
10280 fi
10281 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10282 LIBS=$ac_check_lib_save_LIBS
10283 fi
10284 echo "$as_me:10284: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10285 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10286 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10287   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10288 fi
10289
10290     fi
10291 fi
10292 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10293     LIBS="$ac_xsave_LIBS"
10294
10295     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10296     # to get the SysV transport functions.
10297     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10298     # needs -lnsl.
10299     # The nsl library prevents programs from opening the X display
10300     # on Irix 5.2, according to T.E. Dickey.
10301     # The functions gethostbyname, getservbyname, and inet_addr are
10302     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10303     echo "$as_me:10303: checking for gethostbyname" >&5
10304 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10305 if test "${ac_cv_func_gethostbyname+set}" = set; then
10306   echo $ECHO_N "(cached) $ECHO_C" >&6
10307 else
10308   cat >conftest.$ac_ext <<_ACEOF
10309 #line 10309 "configure"
10310 #include "confdefs.h"
10311 /* System header to define __stub macros and hopefully few prototypes,
10312     which can conflict with char gethostbyname (); below.  */
10313 #include <assert.h>
10314 /* Override any gcc2 internal prototype to avoid an error.  */
10315 #ifdef __cplusplus
10316 extern "C"
10317 #endif
10318 /* We use char because int might match the return type of a gcc2
10319    builtin and then its argument prototype would still apply.  */
10320 char gethostbyname ();
10321 char (*f) ();
10322
10323 int
10324 main ()
10325 {
10326 /* The GNU C library defines this for functions which it implements
10327     to always fail with ENOSYS.  Some functions are actually named
10328     something starting with __ and the normal name is an alias.  */
10329 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10330 choke me
10331 #else
10332 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10333 #endif
10334
10335   ;
10336   return 0;
10337 }
10338 _ACEOF
10339 rm -f conftest.$ac_objext conftest$ac_exeext
10340 if { (eval echo "$as_me:10340: \"$ac_link\"") >&5
10341   (eval $ac_link) 2>&5
10342   ac_status=$?
10343   echo "$as_me:10343: \$? = $ac_status" >&5
10344   (exit $ac_status); } &&
10345          { ac_try='test -s conftest$ac_exeext'
10346   { (eval echo "$as_me:10346: \"$ac_try\"") >&5
10347   (eval $ac_try) 2>&5
10348   ac_status=$?
10349   echo "$as_me:10349: \$? = $ac_status" >&5
10350   (exit $ac_status); }; }; then
10351   ac_cv_func_gethostbyname=yes
10352 else
10353   echo "$as_me: failed program was:" >&5
10354 cat conftest.$ac_ext >&5
10355 ac_cv_func_gethostbyname=no
10356 fi
10357 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10358 fi
10359 echo "$as_me:10359: result: $ac_cv_func_gethostbyname" >&5
10360 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10361
10362     if test $ac_cv_func_gethostbyname = no; then
10363       echo "$as_me:10363: checking for gethostbyname in -lnsl" >&5
10364 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10365 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10366   echo $ECHO_N "(cached) $ECHO_C" >&6
10367 else
10368   ac_check_lib_save_LIBS=$LIBS
10369 LIBS="-lnsl  $LIBS"
10370 cat >conftest.$ac_ext <<_ACEOF
10371 #line 10371 "configure"
10372 #include "confdefs.h"
10373
10374 /* Override any gcc2 internal prototype to avoid an error.  */
10375 #ifdef __cplusplus
10376 extern "C"
10377 #endif
10378 /* We use char because int might match the return type of a gcc2
10379    builtin and then its argument prototype would still apply.  */
10380 char gethostbyname ();
10381 int
10382 main ()
10383 {
10384 gethostbyname ();
10385   ;
10386   return 0;
10387 }
10388 _ACEOF
10389 rm -f conftest.$ac_objext conftest$ac_exeext
10390 if { (eval echo "$as_me:10390: \"$ac_link\"") >&5
10391   (eval $ac_link) 2>&5
10392   ac_status=$?
10393   echo "$as_me:10393: \$? = $ac_status" >&5
10394   (exit $ac_status); } &&
10395          { ac_try='test -s conftest$ac_exeext'
10396   { (eval echo "$as_me:10396: \"$ac_try\"") >&5
10397   (eval $ac_try) 2>&5
10398   ac_status=$?
10399   echo "$as_me:10399: \$? = $ac_status" >&5
10400   (exit $ac_status); }; }; then
10401   ac_cv_lib_nsl_gethostbyname=yes
10402 else
10403   echo "$as_me: failed program was:" >&5
10404 cat conftest.$ac_ext >&5
10405 ac_cv_lib_nsl_gethostbyname=no
10406 fi
10407 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10408 LIBS=$ac_check_lib_save_LIBS
10409 fi
10410 echo "$as_me:10410: result: $ac_cv_lib_nsl_gethostbyname" >&5
10411 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10412 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10413   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10414 fi
10415
10416       if test $ac_cv_lib_nsl_gethostbyname = no; then
10417         echo "$as_me:10417: checking for gethostbyname in -lbsd" >&5
10418 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10419 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10420   echo $ECHO_N "(cached) $ECHO_C" >&6
10421 else
10422   ac_check_lib_save_LIBS=$LIBS
10423 LIBS="-lbsd  $LIBS"
10424 cat >conftest.$ac_ext <<_ACEOF
10425 #line 10425 "configure"
10426 #include "confdefs.h"
10427
10428 /* Override any gcc2 internal prototype to avoid an error.  */
10429 #ifdef __cplusplus
10430 extern "C"
10431 #endif
10432 /* We use char because int might match the return type of a gcc2
10433    builtin and then its argument prototype would still apply.  */
10434 char gethostbyname ();
10435 int
10436 main ()
10437 {
10438 gethostbyname ();
10439   ;
10440   return 0;
10441 }
10442 _ACEOF
10443 rm -f conftest.$ac_objext conftest$ac_exeext
10444 if { (eval echo "$as_me:10444: \"$ac_link\"") >&5
10445   (eval $ac_link) 2>&5
10446   ac_status=$?
10447   echo "$as_me:10447: \$? = $ac_status" >&5
10448   (exit $ac_status); } &&
10449          { ac_try='test -s conftest$ac_exeext'
10450   { (eval echo "$as_me:10450: \"$ac_try\"") >&5
10451   (eval $ac_try) 2>&5
10452   ac_status=$?
10453   echo "$as_me:10453: \$? = $ac_status" >&5
10454   (exit $ac_status); }; }; then
10455   ac_cv_lib_bsd_gethostbyname=yes
10456 else
10457   echo "$as_me: failed program was:" >&5
10458 cat conftest.$ac_ext >&5
10459 ac_cv_lib_bsd_gethostbyname=no
10460 fi
10461 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10462 LIBS=$ac_check_lib_save_LIBS
10463 fi
10464 echo "$as_me:10464: result: $ac_cv_lib_bsd_gethostbyname" >&5
10465 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10466 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10467   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10468 fi
10469
10470       fi
10471     fi
10472
10473     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10474     # socket/setsockopt and other routines are undefined under SCO ODT
10475     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10476     # on later versions), says Simon Leinen: it contains gethostby*
10477     # variants that don't use the nameserver (or something).  -lsocket
10478     # must be given before -lnsl if both are needed.  We assume that
10479     # if connect needs -lnsl, so does gethostbyname.
10480     echo "$as_me:10480: checking for connect" >&5
10481 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10482 if test "${ac_cv_func_connect+set}" = set; then
10483   echo $ECHO_N "(cached) $ECHO_C" >&6
10484 else
10485   cat >conftest.$ac_ext <<_ACEOF
10486 #line 10486 "configure"
10487 #include "confdefs.h"
10488 /* System header to define __stub macros and hopefully few prototypes,
10489     which can conflict with char connect (); below.  */
10490 #include <assert.h>
10491 /* Override any gcc2 internal prototype to avoid an error.  */
10492 #ifdef __cplusplus
10493 extern "C"
10494 #endif
10495 /* We use char because int might match the return type of a gcc2
10496    builtin and then its argument prototype would still apply.  */
10497 char connect ();
10498 char (*f) ();
10499
10500 int
10501 main ()
10502 {
10503 /* The GNU C library defines this for functions which it implements
10504     to always fail with ENOSYS.  Some functions are actually named
10505     something starting with __ and the normal name is an alias.  */
10506 #if defined (__stub_connect) || defined (__stub___connect)
10507 choke me
10508 #else
10509 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10510 #endif
10511
10512   ;
10513   return 0;
10514 }
10515 _ACEOF
10516 rm -f conftest.$ac_objext conftest$ac_exeext
10517 if { (eval echo "$as_me:10517: \"$ac_link\"") >&5
10518   (eval $ac_link) 2>&5
10519   ac_status=$?
10520   echo "$as_me:10520: \$? = $ac_status" >&5
10521   (exit $ac_status); } &&
10522          { ac_try='test -s conftest$ac_exeext'
10523   { (eval echo "$as_me:10523: \"$ac_try\"") >&5
10524   (eval $ac_try) 2>&5
10525   ac_status=$?
10526   echo "$as_me:10526: \$? = $ac_status" >&5
10527   (exit $ac_status); }; }; then
10528   ac_cv_func_connect=yes
10529 else
10530   echo "$as_me: failed program was:" >&5
10531 cat conftest.$ac_ext >&5
10532 ac_cv_func_connect=no
10533 fi
10534 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10535 fi
10536 echo "$as_me:10536: result: $ac_cv_func_connect" >&5
10537 echo "${ECHO_T}$ac_cv_func_connect" >&6
10538
10539     if test $ac_cv_func_connect = no; then
10540       echo "$as_me:10540: checking for connect in -lsocket" >&5
10541 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10542 if test "${ac_cv_lib_socket_connect+set}" = set; then
10543   echo $ECHO_N "(cached) $ECHO_C" >&6
10544 else
10545   ac_check_lib_save_LIBS=$LIBS
10546 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10547 cat >conftest.$ac_ext <<_ACEOF
10548 #line 10548 "configure"
10549 #include "confdefs.h"
10550
10551 /* Override any gcc2 internal prototype to avoid an error.  */
10552 #ifdef __cplusplus
10553 extern "C"
10554 #endif
10555 /* We use char because int might match the return type of a gcc2
10556    builtin and then its argument prototype would still apply.  */
10557 char connect ();
10558 int
10559 main ()
10560 {
10561 connect ();
10562   ;
10563   return 0;
10564 }
10565 _ACEOF
10566 rm -f conftest.$ac_objext conftest$ac_exeext
10567 if { (eval echo "$as_me:10567: \"$ac_link\"") >&5
10568   (eval $ac_link) 2>&5
10569   ac_status=$?
10570   echo "$as_me:10570: \$? = $ac_status" >&5
10571   (exit $ac_status); } &&
10572          { ac_try='test -s conftest$ac_exeext'
10573   { (eval echo "$as_me:10573: \"$ac_try\"") >&5
10574   (eval $ac_try) 2>&5
10575   ac_status=$?
10576   echo "$as_me:10576: \$? = $ac_status" >&5
10577   (exit $ac_status); }; }; then
10578   ac_cv_lib_socket_connect=yes
10579 else
10580   echo "$as_me: failed program was:" >&5
10581 cat conftest.$ac_ext >&5
10582 ac_cv_lib_socket_connect=no
10583 fi
10584 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10585 LIBS=$ac_check_lib_save_LIBS
10586 fi
10587 echo "$as_me:10587: result: $ac_cv_lib_socket_connect" >&5
10588 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10589 if test $ac_cv_lib_socket_connect = yes; then
10590   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10591 fi
10592
10593     fi
10594
10595     # Guillermo Gomez says -lposix is necessary on A/UX.
10596     echo "$as_me:10596: checking for remove" >&5
10597 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10598 if test "${ac_cv_func_remove+set}" = set; then
10599   echo $ECHO_N "(cached) $ECHO_C" >&6
10600 else
10601   cat >conftest.$ac_ext <<_ACEOF
10602 #line 10602 "configure"
10603 #include "confdefs.h"
10604 /* System header to define __stub macros and hopefully few prototypes,
10605     which can conflict with char remove (); below.  */
10606 #include <assert.h>
10607 /* Override any gcc2 internal prototype to avoid an error.  */
10608 #ifdef __cplusplus
10609 extern "C"
10610 #endif
10611 /* We use char because int might match the return type of a gcc2
10612    builtin and then its argument prototype would still apply.  */
10613 char remove ();
10614 char (*f) ();
10615
10616 int
10617 main ()
10618 {
10619 /* The GNU C library defines this for functions which it implements
10620     to always fail with ENOSYS.  Some functions are actually named
10621     something starting with __ and the normal name is an alias.  */
10622 #if defined (__stub_remove) || defined (__stub___remove)
10623 choke me
10624 #else
10625 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10626 #endif
10627
10628   ;
10629   return 0;
10630 }
10631 _ACEOF
10632 rm -f conftest.$ac_objext conftest$ac_exeext
10633 if { (eval echo "$as_me:10633: \"$ac_link\"") >&5
10634   (eval $ac_link) 2>&5
10635   ac_status=$?
10636   echo "$as_me:10636: \$? = $ac_status" >&5
10637   (exit $ac_status); } &&
10638          { ac_try='test -s conftest$ac_exeext'
10639   { (eval echo "$as_me:10639: \"$ac_try\"") >&5
10640   (eval $ac_try) 2>&5
10641   ac_status=$?
10642   echo "$as_me:10642: \$? = $ac_status" >&5
10643   (exit $ac_status); }; }; then
10644   ac_cv_func_remove=yes
10645 else
10646   echo "$as_me: failed program was:" >&5
10647 cat conftest.$ac_ext >&5
10648 ac_cv_func_remove=no
10649 fi
10650 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10651 fi
10652 echo "$as_me:10652: result: $ac_cv_func_remove" >&5
10653 echo "${ECHO_T}$ac_cv_func_remove" >&6
10654
10655     if test $ac_cv_func_remove = no; then
10656       echo "$as_me:10656: checking for remove in -lposix" >&5
10657 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10658 if test "${ac_cv_lib_posix_remove+set}" = set; then
10659   echo $ECHO_N "(cached) $ECHO_C" >&6
10660 else
10661   ac_check_lib_save_LIBS=$LIBS
10662 LIBS="-lposix  $LIBS"
10663 cat >conftest.$ac_ext <<_ACEOF
10664 #line 10664 "configure"
10665 #include "confdefs.h"
10666
10667 /* Override any gcc2 internal prototype to avoid an error.  */
10668 #ifdef __cplusplus
10669 extern "C"
10670 #endif
10671 /* We use char because int might match the return type of a gcc2
10672    builtin and then its argument prototype would still apply.  */
10673 char remove ();
10674 int
10675 main ()
10676 {
10677 remove ();
10678   ;
10679   return 0;
10680 }
10681 _ACEOF
10682 rm -f conftest.$ac_objext conftest$ac_exeext
10683 if { (eval echo "$as_me:10683: \"$ac_link\"") >&5
10684   (eval $ac_link) 2>&5
10685   ac_status=$?
10686   echo "$as_me:10686: \$? = $ac_status" >&5
10687   (exit $ac_status); } &&
10688          { ac_try='test -s conftest$ac_exeext'
10689   { (eval echo "$as_me:10689: \"$ac_try\"") >&5
10690   (eval $ac_try) 2>&5
10691   ac_status=$?
10692   echo "$as_me:10692: \$? = $ac_status" >&5
10693   (exit $ac_status); }; }; then
10694   ac_cv_lib_posix_remove=yes
10695 else
10696   echo "$as_me: failed program was:" >&5
10697 cat conftest.$ac_ext >&5
10698 ac_cv_lib_posix_remove=no
10699 fi
10700 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10701 LIBS=$ac_check_lib_save_LIBS
10702 fi
10703 echo "$as_me:10703: result: $ac_cv_lib_posix_remove" >&5
10704 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10705 if test $ac_cv_lib_posix_remove = yes; then
10706   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10707 fi
10708
10709     fi
10710
10711     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10712     echo "$as_me:10712: checking for shmat" >&5
10713 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10714 if test "${ac_cv_func_shmat+set}" = set; then
10715   echo $ECHO_N "(cached) $ECHO_C" >&6
10716 else
10717   cat >conftest.$ac_ext <<_ACEOF
10718 #line 10718 "configure"
10719 #include "confdefs.h"
10720 /* System header to define __stub macros and hopefully few prototypes,
10721     which can conflict with char shmat (); below.  */
10722 #include <assert.h>
10723 /* Override any gcc2 internal prototype to avoid an error.  */
10724 #ifdef __cplusplus
10725 extern "C"
10726 #endif
10727 /* We use char because int might match the return type of a gcc2
10728    builtin and then its argument prototype would still apply.  */
10729 char shmat ();
10730 char (*f) ();
10731
10732 int
10733 main ()
10734 {
10735 /* The GNU C library defines this for functions which it implements
10736     to always fail with ENOSYS.  Some functions are actually named
10737     something starting with __ and the normal name is an alias.  */
10738 #if defined (__stub_shmat) || defined (__stub___shmat)
10739 choke me
10740 #else
10741 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10742 #endif
10743
10744   ;
10745   return 0;
10746 }
10747 _ACEOF
10748 rm -f conftest.$ac_objext conftest$ac_exeext
10749 if { (eval echo "$as_me:10749: \"$ac_link\"") >&5
10750   (eval $ac_link) 2>&5
10751   ac_status=$?
10752   echo "$as_me:10752: \$? = $ac_status" >&5
10753   (exit $ac_status); } &&
10754          { ac_try='test -s conftest$ac_exeext'
10755   { (eval echo "$as_me:10755: \"$ac_try\"") >&5
10756   (eval $ac_try) 2>&5
10757   ac_status=$?
10758   echo "$as_me:10758: \$? = $ac_status" >&5
10759   (exit $ac_status); }; }; then
10760   ac_cv_func_shmat=yes
10761 else
10762   echo "$as_me: failed program was:" >&5
10763 cat conftest.$ac_ext >&5
10764 ac_cv_func_shmat=no
10765 fi
10766 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10767 fi
10768 echo "$as_me:10768: result: $ac_cv_func_shmat" >&5
10769 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10770
10771     if test $ac_cv_func_shmat = no; then
10772       echo "$as_me:10772: checking for shmat in -lipc" >&5
10773 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10774 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10775   echo $ECHO_N "(cached) $ECHO_C" >&6
10776 else
10777   ac_check_lib_save_LIBS=$LIBS
10778 LIBS="-lipc  $LIBS"
10779 cat >conftest.$ac_ext <<_ACEOF
10780 #line 10780 "configure"
10781 #include "confdefs.h"
10782
10783 /* Override any gcc2 internal prototype to avoid an error.  */
10784 #ifdef __cplusplus
10785 extern "C"
10786 #endif
10787 /* We use char because int might match the return type of a gcc2
10788    builtin and then its argument prototype would still apply.  */
10789 char shmat ();
10790 int
10791 main ()
10792 {
10793 shmat ();
10794   ;
10795   return 0;
10796 }
10797 _ACEOF
10798 rm -f conftest.$ac_objext conftest$ac_exeext
10799 if { (eval echo "$as_me:10799: \"$ac_link\"") >&5
10800   (eval $ac_link) 2>&5
10801   ac_status=$?
10802   echo "$as_me:10802: \$? = $ac_status" >&5
10803   (exit $ac_status); } &&
10804          { ac_try='test -s conftest$ac_exeext'
10805   { (eval echo "$as_me:10805: \"$ac_try\"") >&5
10806   (eval $ac_try) 2>&5
10807   ac_status=$?
10808   echo "$as_me:10808: \$? = $ac_status" >&5
10809   (exit $ac_status); }; }; then
10810   ac_cv_lib_ipc_shmat=yes
10811 else
10812   echo "$as_me: failed program was:" >&5
10813 cat conftest.$ac_ext >&5
10814 ac_cv_lib_ipc_shmat=no
10815 fi
10816 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10817 LIBS=$ac_check_lib_save_LIBS
10818 fi
10819 echo "$as_me:10819: result: $ac_cv_lib_ipc_shmat" >&5
10820 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10821 if test $ac_cv_lib_ipc_shmat = yes; then
10822   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10823 fi
10824
10825     fi
10826   fi
10827
10828   # Check for libraries that X11R6 Xt/Xaw programs need.
10829   ac_save_LDFLAGS=$LDFLAGS
10830   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10831   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10832   # check for ICE first), but we must link in the order -lSM -lICE or
10833   # we get undefined symbols.  So assume we have SM if we have ICE.
10834   # These have to be linked with before -lX11, unlike the other
10835   # libraries we check for below, so use a different variable.
10836   # John Interrante, Karl Berry
10837   echo "$as_me:10837: checking for IceConnectionNumber in -lICE" >&5
10838 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10839 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10840   echo $ECHO_N "(cached) $ECHO_C" >&6
10841 else
10842   ac_check_lib_save_LIBS=$LIBS
10843 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10844 cat >conftest.$ac_ext <<_ACEOF
10845 #line 10845 "configure"
10846 #include "confdefs.h"
10847
10848 /* Override any gcc2 internal prototype to avoid an error.  */
10849 #ifdef __cplusplus
10850 extern "C"
10851 #endif
10852 /* We use char because int might match the return type of a gcc2
10853    builtin and then its argument prototype would still apply.  */
10854 char IceConnectionNumber ();
10855 int
10856 main ()
10857 {
10858 IceConnectionNumber ();
10859   ;
10860   return 0;
10861 }
10862 _ACEOF
10863 rm -f conftest.$ac_objext conftest$ac_exeext
10864 if { (eval echo "$as_me:10864: \"$ac_link\"") >&5
10865   (eval $ac_link) 2>&5
10866   ac_status=$?
10867   echo "$as_me:10867: \$? = $ac_status" >&5
10868   (exit $ac_status); } &&
10869          { ac_try='test -s conftest$ac_exeext'
10870   { (eval echo "$as_me:10870: \"$ac_try\"") >&5
10871   (eval $ac_try) 2>&5
10872   ac_status=$?
10873   echo "$as_me:10873: \$? = $ac_status" >&5
10874   (exit $ac_status); }; }; then
10875   ac_cv_lib_ICE_IceConnectionNumber=yes
10876 else
10877   echo "$as_me: failed program was:" >&5
10878 cat conftest.$ac_ext >&5
10879 ac_cv_lib_ICE_IceConnectionNumber=no
10880 fi
10881 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10882 LIBS=$ac_check_lib_save_LIBS
10883 fi
10884 echo "$as_me:10884: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10885 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10886 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10887   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10888 fi
10889
10890   LDFLAGS=$ac_save_LDFLAGS
10891
10892 fi
10893
10894 cf_x_athena=${cf_x_athena:-Xaw}
10895
10896 echo "$as_me:10896: checking if you want to link with Xaw 3d library" >&5
10897 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10898 withval=
10899
10900 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10901 if test "${with_Xaw3d+set}" = set; then
10902   withval="$with_Xaw3d"
10903
10904 fi;
10905 if test "$withval" = yes ; then
10906         cf_x_athena=Xaw3d
10907         echo "$as_me:10907: result: yes" >&5
10908 echo "${ECHO_T}yes" >&6
10909 else
10910         echo "$as_me:10910: result: no" >&5
10911 echo "${ECHO_T}no" >&6
10912 fi
10913
10914 echo "$as_me:10914: checking if you want to link with Xaw 3d xft library" >&5
10915 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10916 withval=
10917
10918 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10919 if test "${with_Xaw3dxft+set}" = set; then
10920   withval="$with_Xaw3dxft"
10921
10922 fi;
10923 if test "$withval" = yes ; then
10924         cf_x_athena=Xaw3dxft
10925         echo "$as_me:10925: result: yes" >&5
10926 echo "${ECHO_T}yes" >&6
10927 else
10928         echo "$as_me:10928: result: no" >&5
10929 echo "${ECHO_T}no" >&6
10930 fi
10931
10932 echo "$as_me:10932: checking if you want to link with neXT Athena library" >&5
10933 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10934 withval=
10935
10936 # Check whether --with-neXtaw or --without-neXtaw was given.
10937 if test "${with_neXtaw+set}" = set; then
10938   withval="$with_neXtaw"
10939
10940 fi;
10941 if test "$withval" = yes ; then
10942         cf_x_athena=neXtaw
10943         echo "$as_me:10943: result: yes" >&5
10944 echo "${ECHO_T}yes" >&6
10945 else
10946         echo "$as_me:10946: result: no" >&5
10947 echo "${ECHO_T}no" >&6
10948 fi
10949
10950 echo "$as_me:10950: checking if you want to link with Athena-Plus library" >&5
10951 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10952 withval=
10953
10954 # Check whether --with-XawPlus or --without-XawPlus was given.
10955 if test "${with_XawPlus+set}" = set; then
10956   withval="$with_XawPlus"
10957
10958 fi;
10959 if test "$withval" = yes ; then
10960         cf_x_athena=XawPlus
10961         echo "$as_me:10961: result: yes" >&5
10962 echo "${ECHO_T}yes" >&6
10963 else
10964         echo "$as_me:10964: result: no" >&5
10965 echo "${ECHO_T}no" >&6
10966 fi
10967
10968 cf_x_athena_lib=""
10969
10970 if test "$PKG_CONFIG" != none ; then
10971         cf_athena_list=
10972         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10973         for cf_athena_pkg in \
10974                 $cf_athena_list \
10975                 ${cf_x_athena} \
10976                 ${cf_x_athena}-devel \
10977                 lib${cf_x_athena} \
10978                 lib${cf_x_athena}-devel
10979         do
10980
10981 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10982         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10983
10984 echo "${as_me:-configure}:10984: testing found package $cf_athena_pkg ..." 1>&5
10985
10986         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10987         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10988         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10989
10990 echo "${as_me:-configure}:10990: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10991
10992         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10993
10994 echo "${as_me:-configure}:10994: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10995
10996 cf_fix_cppflags=no
10997 cf_new_cflags=
10998 cf_new_cppflags=
10999 cf_new_extra_cppflags=
11000
11001 for cf_add_cflags in $cf_pkgconfig_incs
11002 do
11003 case $cf_fix_cppflags in
11004 (no)
11005         case $cf_add_cflags in
11006         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11007                 case $cf_add_cflags in
11008                 (-D*)
11009                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11010
11011                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11012                                 && test -z "${cf_tst_cflags}" \
11013                                 && cf_fix_cppflags=yes
11014
11015                         if test $cf_fix_cppflags = yes ; then
11016
11017         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11018         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11019
11020                                 continue
11021                         elif test "${cf_tst_cflags}" = "\"'" ; then
11022
11023         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11024         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11025
11026                                 continue
11027                         fi
11028                         ;;
11029                 esac
11030                 case "$CPPFLAGS" in
11031                 (*$cf_add_cflags)
11032                         ;;
11033                 (*)
11034                         case $cf_add_cflags in
11035                         (-D*)
11036                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11037
11038 CPPFLAGS=`echo "$CPPFLAGS" | \
11039         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11040                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11041
11042                                 ;;
11043                         esac
11044
11045         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11046         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11047
11048                         ;;
11049                 esac
11050                 ;;
11051         (*)
11052
11053         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11054         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11055
11056                 ;;
11057         esac
11058         ;;
11059 (yes)
11060
11061         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11062         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11063
11064         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11065
11066         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11067                 && test -z "${cf_tst_cflags}" \
11068                 && cf_fix_cppflags=no
11069         ;;
11070 esac
11071 done
11072
11073 if test -n "$cf_new_cflags" ; then
11074
11075         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11076         CFLAGS="${CFLAGS}$cf_new_cflags"
11077
11078 fi
11079
11080 if test -n "$cf_new_cppflags" ; then
11081
11082         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11083         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11084
11085 fi
11086
11087 if test -n "$cf_new_extra_cppflags" ; then
11088
11089         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11090         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11091
11092 fi
11093
11094 cf_add_libs="$cf_pkgconfig_libs"
11095 # Filter out duplicates - this happens with badly-designed ".pc" files...
11096 for cf_add_1lib in $LIBS
11097 do
11098         for cf_add_2lib in $cf_add_libs
11099         do
11100                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11101                 then
11102                         cf_add_1lib=
11103                         break
11104                 fi
11105         done
11106         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11107 done
11108 LIBS="$cf_add_libs"
11109
11110                         cf_x_athena_lib="$cf_pkgconfig_libs"
11111
11112 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11113
11114                         cat >>confdefs.h <<EOF
11115 #define $cf_x_athena_LIBS 1
11116 EOF
11117
11118         for cf_trim_lib in Xmu Xt X11
11119         do
11120                 case "$LIBS" in
11121                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11122                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11123                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11124
11125 echo "${as_me:-configure}:11125: testing ..trimmed $LIBS ..." 1>&5
11126
11127                         ;;
11128                 esac
11129         done
11130
11131 echo "$as_me:11131: checking for usable $cf_x_athena/Xmu package" >&5
11132 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11133 if test "${cf_cv_xaw_compat+set}" = set; then
11134   echo $ECHO_N "(cached) $ECHO_C" >&6
11135 else
11136
11137 cat >conftest.$ac_ext <<_ACEOF
11138 #line 11138 "configure"
11139 #include "confdefs.h"
11140
11141 #include <X11/Xmu/CharSet.h>
11142
11143 int
11144 main ()
11145 {
11146
11147 int check = XmuCompareISOLatin1("big", "small")
11148
11149   ;
11150   return 0;
11151 }
11152 _ACEOF
11153 rm -f conftest.$ac_objext conftest$ac_exeext
11154 if { (eval echo "$as_me:11154: \"$ac_link\"") >&5
11155   (eval $ac_link) 2>&5
11156   ac_status=$?
11157   echo "$as_me:11157: \$? = $ac_status" >&5
11158   (exit $ac_status); } &&
11159          { ac_try='test -s conftest$ac_exeext'
11160   { (eval echo "$as_me:11160: \"$ac_try\"") >&5
11161   (eval $ac_try) 2>&5
11162   ac_status=$?
11163   echo "$as_me:11163: \$? = $ac_status" >&5
11164   (exit $ac_status); }; }; then
11165   cf_cv_xaw_compat=yes
11166 else
11167   echo "$as_me: failed program was:" >&5
11168 cat conftest.$ac_ext >&5
11169 cf_cv_xaw_compat=no
11170 fi
11171 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11172 fi
11173 echo "$as_me:11173: result: $cf_cv_xaw_compat" >&5
11174 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11175
11176                         if test "$cf_cv_xaw_compat" = no
11177                         then
11178                                 # workaround for broken ".pc" files...
11179                                 case "$cf_x_athena_lib" in
11180                                 (*-lXmu*)
11181                                         ;;
11182                                 (*)
11183                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11184
11185 echo "${as_me:-configure}:11185: testing work around broken package ..." 1>&5
11186
11187                                         cf_save_xmu="$LIBS"
11188                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11189
11190 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11191         test -n "$verbose" && echo "    found package xmu" 1>&6
11192
11193 echo "${as_me:-configure}:11193: testing found package xmu ..." 1>&5
11194
11195         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11196         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11197         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11198
11199 echo "${as_me:-configure}:11199: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11200
11201         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11202
11203 echo "${as_me:-configure}:11203: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11204
11205 cf_fix_cppflags=no
11206 cf_new_cflags=
11207 cf_new_cppflags=
11208 cf_new_extra_cppflags=
11209
11210 for cf_add_cflags in $cf_pkgconfig_incs
11211 do
11212 case $cf_fix_cppflags in
11213 (no)
11214         case $cf_add_cflags in
11215         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11216                 case $cf_add_cflags in
11217                 (-D*)
11218                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11219
11220                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11221                                 && test -z "${cf_tst_cflags}" \
11222                                 && cf_fix_cppflags=yes
11223
11224                         if test $cf_fix_cppflags = yes ; then
11225
11226         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11227         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11228
11229                                 continue
11230                         elif test "${cf_tst_cflags}" = "\"'" ; then
11231
11232         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11233         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11234
11235                                 continue
11236                         fi
11237                         ;;
11238                 esac
11239                 case "$CPPFLAGS" in
11240                 (*$cf_add_cflags)
11241                         ;;
11242                 (*)
11243                         case $cf_add_cflags in
11244                         (-D*)
11245                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11246
11247 CPPFLAGS=`echo "$CPPFLAGS" | \
11248         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11249                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11250
11251                                 ;;
11252                         esac
11253
11254         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11255         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11256
11257                         ;;
11258                 esac
11259                 ;;
11260         (*)
11261
11262         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11263         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11264
11265                 ;;
11266         esac
11267         ;;
11268 (yes)
11269
11270         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11271         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11272
11273         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11274
11275         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11276                 && test -z "${cf_tst_cflags}" \
11277                 && cf_fix_cppflags=no
11278         ;;
11279 esac
11280 done
11281
11282 if test -n "$cf_new_cflags" ; then
11283
11284         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11285         CFLAGS="${CFLAGS}$cf_new_cflags"
11286
11287 fi
11288
11289 if test -n "$cf_new_cppflags" ; then
11290
11291         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11292         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11293
11294 fi
11295
11296 if test -n "$cf_new_extra_cppflags" ; then
11297
11298         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11299         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11300
11301 fi
11302
11303 cf_add_libs="$cf_pkgconfig_libs"
11304 # Filter out duplicates - this happens with badly-designed ".pc" files...
11305 for cf_add_1lib in $LIBS
11306 do
11307         for cf_add_2lib in $cf_add_libs
11308         do
11309                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11310                 then
11311                         cf_add_1lib=
11312                         break
11313                 fi
11314         done
11315         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11316 done
11317 LIBS="$cf_add_libs"
11318
11319                                                         LIBS="$cf_save_xmu"
11320
11321 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11322
11323 echo "${as_me:-configure}:11323: testing ...before $LIBS ..." 1>&5
11324
11325 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11326 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11327
11328 echo "${as_me:-configure}:11328: testing ...after  $LIBS ..." 1>&5
11329
11330 else
11331         cf_pkgconfig_incs=
11332         cf_pkgconfig_libs=
11333
11334 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11335
11336 echo "${as_me:-configure}:11336: testing ...before $LIBS ..." 1>&5
11337
11338 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11339 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11340
11341 echo "${as_me:-configure}:11341: testing ...after  $LIBS ..." 1>&5
11342
11343 fi
11344
11345         for cf_trim_lib in Xmu Xt X11
11346         do
11347                 case "$LIBS" in
11348                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11349                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11350                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11351
11352 echo "${as_me:-configure}:11352: testing ..trimmed $LIBS ..." 1>&5
11353
11354                         ;;
11355                 esac
11356         done
11357
11358                                         ;;
11359                                 esac
11360                         fi
11361
11362                         break
11363 else
11364         cf_pkgconfig_incs=
11365         cf_pkgconfig_libs=
11366         :
11367 fi
11368
11369         done
11370 fi
11371
11372 if test -z "$cf_x_athena_lib" ; then
11373
11374 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11375         test -n "$verbose" && echo "    found package Xext" 1>&6
11376
11377 echo "${as_me:-configure}:11377: testing found package Xext ..." 1>&5
11378
11379         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11380         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11381         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11382
11383 echo "${as_me:-configure}:11383: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11384
11385         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11386
11387 echo "${as_me:-configure}:11387: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11388
11389 cf_fix_cppflags=no
11390 cf_new_cflags=
11391 cf_new_cppflags=
11392 cf_new_extra_cppflags=
11393
11394 for cf_add_cflags in $cf_pkgconfig_incs
11395 do
11396 case $cf_fix_cppflags in
11397 (no)
11398         case $cf_add_cflags in
11399         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11400                 case $cf_add_cflags in
11401                 (-D*)
11402                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11403
11404                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11405                                 && test -z "${cf_tst_cflags}" \
11406                                 && cf_fix_cppflags=yes
11407
11408                         if test $cf_fix_cppflags = yes ; then
11409
11410         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11411         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11412
11413                                 continue
11414                         elif test "${cf_tst_cflags}" = "\"'" ; then
11415
11416         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11417         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11418
11419                                 continue
11420                         fi
11421                         ;;
11422                 esac
11423                 case "$CPPFLAGS" in
11424                 (*$cf_add_cflags)
11425                         ;;
11426                 (*)
11427                         case $cf_add_cflags in
11428                         (-D*)
11429                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11430
11431 CPPFLAGS=`echo "$CPPFLAGS" | \
11432         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11433                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11434
11435                                 ;;
11436                         esac
11437
11438         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11439         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11440
11441                         ;;
11442                 esac
11443                 ;;
11444         (*)
11445
11446         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11447         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11448
11449                 ;;
11450         esac
11451         ;;
11452 (yes)
11453
11454         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11455         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11456
11457         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11458
11459         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11460                 && test -z "${cf_tst_cflags}" \
11461                 && cf_fix_cppflags=no
11462         ;;
11463 esac
11464 done
11465
11466 if test -n "$cf_new_cflags" ; then
11467
11468         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11469         CFLAGS="${CFLAGS}$cf_new_cflags"
11470
11471 fi
11472
11473 if test -n "$cf_new_cppflags" ; then
11474
11475         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11476         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11477
11478 fi
11479
11480 if test -n "$cf_new_extra_cppflags" ; then
11481
11482         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11483         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11484
11485 fi
11486
11487 cf_add_libs="$cf_pkgconfig_libs"
11488 # Filter out duplicates - this happens with badly-designed ".pc" files...
11489 for cf_add_1lib in $LIBS
11490 do
11491         for cf_add_2lib in $cf_add_libs
11492         do
11493                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11494                 then
11495                         cf_add_1lib=
11496                         break
11497                 fi
11498         done
11499         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11500 done
11501 LIBS="$cf_add_libs"
11502
11503         :
11504 else
11505         cf_pkgconfig_incs=
11506         cf_pkgconfig_libs=
11507
11508         echo "$as_me:11508: checking for XextCreateExtension in -lXext" >&5
11509 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11510 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11511   echo $ECHO_N "(cached) $ECHO_C" >&6
11512 else
11513   ac_check_lib_save_LIBS=$LIBS
11514 LIBS="-lXext  $LIBS"
11515 cat >conftest.$ac_ext <<_ACEOF
11516 #line 11516 "configure"
11517 #include "confdefs.h"
11518
11519 /* Override any gcc2 internal prototype to avoid an error.  */
11520 #ifdef __cplusplus
11521 extern "C"
11522 #endif
11523 /* We use char because int might match the return type of a gcc2
11524    builtin and then its argument prototype would still apply.  */
11525 char XextCreateExtension ();
11526 int
11527 main ()
11528 {
11529 XextCreateExtension ();
11530   ;
11531   return 0;
11532 }
11533 _ACEOF
11534 rm -f conftest.$ac_objext conftest$ac_exeext
11535 if { (eval echo "$as_me:11535: \"$ac_link\"") >&5
11536   (eval $ac_link) 2>&5
11537   ac_status=$?
11538   echo "$as_me:11538: \$? = $ac_status" >&5
11539   (exit $ac_status); } &&
11540          { ac_try='test -s conftest$ac_exeext'
11541   { (eval echo "$as_me:11541: \"$ac_try\"") >&5
11542   (eval $ac_try) 2>&5
11543   ac_status=$?
11544   echo "$as_me:11544: \$? = $ac_status" >&5
11545   (exit $ac_status); }; }; then
11546   ac_cv_lib_Xext_XextCreateExtension=yes
11547 else
11548   echo "$as_me: failed program was:" >&5
11549 cat conftest.$ac_ext >&5
11550 ac_cv_lib_Xext_XextCreateExtension=no
11551 fi
11552 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11553 LIBS=$ac_check_lib_save_LIBS
11554 fi
11555 echo "$as_me:11555: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11556 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11557 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11558
11559 cf_add_libs="-lXext"
11560 # Filter out duplicates - this happens with badly-designed ".pc" files...
11561 for cf_add_1lib in $LIBS
11562 do
11563         for cf_add_2lib in $cf_add_libs
11564         do
11565                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11566                 then
11567                         cf_add_1lib=
11568                         break
11569                 fi
11570         done
11571         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11572 done
11573 LIBS="$cf_add_libs"
11574
11575 fi
11576
11577 fi
11578
11579 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11580 # in some cases has installed dummy files in the former, other cases replaced
11581 # it with a link to the new location).  This complicates the configure script.
11582 # Check for that pitfall, and recover using pkg-config
11583 #
11584 # If none of these are set, the configuration is almost certainly broken.
11585 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11586 then
11587
11588 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11589         test -n "$verbose" && echo "    found package x11" 1>&6
11590
11591 echo "${as_me:-configure}:11591: testing found package x11 ..." 1>&5
11592
11593         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11594         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11595         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11596
11597 echo "${as_me:-configure}:11597: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11598
11599         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11600
11601 echo "${as_me:-configure}:11601: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11602
11603 cf_fix_cppflags=no
11604 cf_new_cflags=
11605 cf_new_cppflags=
11606 cf_new_extra_cppflags=
11607
11608 for cf_add_cflags in $cf_pkgconfig_incs
11609 do
11610 case $cf_fix_cppflags in
11611 (no)
11612         case $cf_add_cflags in
11613         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11614                 case $cf_add_cflags in
11615                 (-D*)
11616                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11617
11618                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11619                                 && test -z "${cf_tst_cflags}" \
11620                                 && cf_fix_cppflags=yes
11621
11622                         if test $cf_fix_cppflags = yes ; then
11623
11624         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11625         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11626
11627                                 continue
11628                         elif test "${cf_tst_cflags}" = "\"'" ; then
11629
11630         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11631         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11632
11633                                 continue
11634                         fi
11635                         ;;
11636                 esac
11637                 case "$CPPFLAGS" in
11638                 (*$cf_add_cflags)
11639                         ;;
11640                 (*)
11641                         case $cf_add_cflags in
11642                         (-D*)
11643                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11644
11645 CPPFLAGS=`echo "$CPPFLAGS" | \
11646         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11647                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11648
11649                                 ;;
11650                         esac
11651
11652         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11653         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11654
11655                         ;;
11656                 esac
11657                 ;;
11658         (*)
11659
11660         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11661         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11662
11663                 ;;
11664         esac
11665         ;;
11666 (yes)
11667
11668         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11669         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11670
11671         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11672
11673         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11674                 && test -z "${cf_tst_cflags}" \
11675                 && cf_fix_cppflags=no
11676         ;;
11677 esac
11678 done
11679
11680 if test -n "$cf_new_cflags" ; then
11681
11682         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11683         CFLAGS="${CFLAGS}$cf_new_cflags"
11684
11685 fi
11686
11687 if test -n "$cf_new_cppflags" ; then
11688
11689         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11690         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11691
11692 fi
11693
11694 if test -n "$cf_new_extra_cppflags" ; then
11695
11696         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11697         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11698
11699 fi
11700
11701 cf_add_libs="$cf_pkgconfig_libs"
11702 # Filter out duplicates - this happens with badly-designed ".pc" files...
11703 for cf_add_1lib in $LIBS
11704 do
11705         for cf_add_2lib in $cf_add_libs
11706         do
11707                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11708                 then
11709                         cf_add_1lib=
11710                         break
11711                 fi
11712         done
11713         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11714 done
11715 LIBS="$cf_add_libs"
11716
11717         :
11718 else
11719         cf_pkgconfig_incs=
11720         cf_pkgconfig_libs=
11721         { echo "$as_me:11721: WARNING: unable to find X11 library" >&5
11722 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11723 fi
11724
11725 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11726         test -n "$verbose" && echo "    found package ice" 1>&6
11727
11728 echo "${as_me:-configure}:11728: testing found package ice ..." 1>&5
11729
11730         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11731         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11732         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11733
11734 echo "${as_me:-configure}:11734: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11735
11736         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11737
11738 echo "${as_me:-configure}:11738: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11739
11740 cf_fix_cppflags=no
11741 cf_new_cflags=
11742 cf_new_cppflags=
11743 cf_new_extra_cppflags=
11744
11745 for cf_add_cflags in $cf_pkgconfig_incs
11746 do
11747 case $cf_fix_cppflags in
11748 (no)
11749         case $cf_add_cflags in
11750         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11751                 case $cf_add_cflags in
11752                 (-D*)
11753                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11754
11755                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11756                                 && test -z "${cf_tst_cflags}" \
11757                                 && cf_fix_cppflags=yes
11758
11759                         if test $cf_fix_cppflags = yes ; then
11760
11761         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11762         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11763
11764                                 continue
11765                         elif test "${cf_tst_cflags}" = "\"'" ; then
11766
11767         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11768         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11769
11770                                 continue
11771                         fi
11772                         ;;
11773                 esac
11774                 case "$CPPFLAGS" in
11775                 (*$cf_add_cflags)
11776                         ;;
11777                 (*)
11778                         case $cf_add_cflags in
11779                         (-D*)
11780                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11781
11782 CPPFLAGS=`echo "$CPPFLAGS" | \
11783         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11784                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11785
11786                                 ;;
11787                         esac
11788
11789         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11790         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11791
11792                         ;;
11793                 esac
11794                 ;;
11795         (*)
11796
11797         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11798         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11799
11800                 ;;
11801         esac
11802         ;;
11803 (yes)
11804
11805         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11806         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11807
11808         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11809
11810         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11811                 && test -z "${cf_tst_cflags}" \
11812                 && cf_fix_cppflags=no
11813         ;;
11814 esac
11815 done
11816
11817 if test -n "$cf_new_cflags" ; then
11818
11819         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11820         CFLAGS="${CFLAGS}$cf_new_cflags"
11821
11822 fi
11823
11824 if test -n "$cf_new_cppflags" ; then
11825
11826         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11827         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11828
11829 fi
11830
11831 if test -n "$cf_new_extra_cppflags" ; then
11832
11833         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11834         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11835
11836 fi
11837
11838 cf_add_libs="$cf_pkgconfig_libs"
11839 # Filter out duplicates - this happens with badly-designed ".pc" files...
11840 for cf_add_1lib in $LIBS
11841 do
11842         for cf_add_2lib in $cf_add_libs
11843         do
11844                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11845                 then
11846                         cf_add_1lib=
11847                         break
11848                 fi
11849         done
11850         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11851 done
11852 LIBS="$cf_add_libs"
11853
11854         :
11855 else
11856         cf_pkgconfig_incs=
11857         cf_pkgconfig_libs=
11858         { echo "$as_me:11858: WARNING: unable to find ICE library" >&5
11859 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11860 fi
11861
11862 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11863         test -n "$verbose" && echo "    found package sm" 1>&6
11864
11865 echo "${as_me:-configure}:11865: testing found package sm ..." 1>&5
11866
11867         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11868         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11869         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11870
11871 echo "${as_me:-configure}:11871: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11872
11873         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11874
11875 echo "${as_me:-configure}:11875: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11876
11877 cf_fix_cppflags=no
11878 cf_new_cflags=
11879 cf_new_cppflags=
11880 cf_new_extra_cppflags=
11881
11882 for cf_add_cflags in $cf_pkgconfig_incs
11883 do
11884 case $cf_fix_cppflags in
11885 (no)
11886         case $cf_add_cflags in
11887         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11888                 case $cf_add_cflags in
11889                 (-D*)
11890                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11891
11892                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11893                                 && test -z "${cf_tst_cflags}" \
11894                                 && cf_fix_cppflags=yes
11895
11896                         if test $cf_fix_cppflags = yes ; then
11897
11898         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11899         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11900
11901                                 continue
11902                         elif test "${cf_tst_cflags}" = "\"'" ; then
11903
11904         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11905         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11906
11907                                 continue
11908                         fi
11909                         ;;
11910                 esac
11911                 case "$CPPFLAGS" in
11912                 (*$cf_add_cflags)
11913                         ;;
11914                 (*)
11915                         case $cf_add_cflags in
11916                         (-D*)
11917                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11918
11919 CPPFLAGS=`echo "$CPPFLAGS" | \
11920         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11921                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11922
11923                                 ;;
11924                         esac
11925
11926         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11927         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11928
11929                         ;;
11930                 esac
11931                 ;;
11932         (*)
11933
11934         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11935         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11936
11937                 ;;
11938         esac
11939         ;;
11940 (yes)
11941
11942         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11943         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11944
11945         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11946
11947         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11948                 && test -z "${cf_tst_cflags}" \
11949                 && cf_fix_cppflags=no
11950         ;;
11951 esac
11952 done
11953
11954 if test -n "$cf_new_cflags" ; then
11955
11956         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11957         CFLAGS="${CFLAGS}$cf_new_cflags"
11958
11959 fi
11960
11961 if test -n "$cf_new_cppflags" ; then
11962
11963         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11964         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11965
11966 fi
11967
11968 if test -n "$cf_new_extra_cppflags" ; then
11969
11970         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11971         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11972
11973 fi
11974
11975 cf_add_libs="$cf_pkgconfig_libs"
11976 # Filter out duplicates - this happens with badly-designed ".pc" files...
11977 for cf_add_1lib in $LIBS
11978 do
11979         for cf_add_2lib in $cf_add_libs
11980         do
11981                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11982                 then
11983                         cf_add_1lib=
11984                         break
11985                 fi
11986         done
11987         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11988 done
11989 LIBS="$cf_add_libs"
11990
11991         :
11992 else
11993         cf_pkgconfig_incs=
11994         cf_pkgconfig_libs=
11995         { echo "$as_me:11995: WARNING: unable to find SM library" >&5
11996 echo "$as_me: WARNING: unable to find SM library" >&2;}
11997 fi
11998
11999 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12000         test -n "$verbose" && echo "    found package xt" 1>&6
12001
12002 echo "${as_me:-configure}:12002: testing found package xt ..." 1>&5
12003
12004         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12005         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12006         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12007
12008 echo "${as_me:-configure}:12008: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12009
12010         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12011
12012 echo "${as_me:-configure}:12012: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12013
12014 cf_fix_cppflags=no
12015 cf_new_cflags=
12016 cf_new_cppflags=
12017 cf_new_extra_cppflags=
12018
12019 for cf_add_cflags in $cf_pkgconfig_incs
12020 do
12021 case $cf_fix_cppflags in
12022 (no)
12023         case $cf_add_cflags in
12024         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12025                 case $cf_add_cflags in
12026                 (-D*)
12027                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12028
12029                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12030                                 && test -z "${cf_tst_cflags}" \
12031                                 && cf_fix_cppflags=yes
12032
12033                         if test $cf_fix_cppflags = yes ; then
12034
12035         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12036         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12037
12038                                 continue
12039                         elif test "${cf_tst_cflags}" = "\"'" ; then
12040
12041         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12042         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12043
12044                                 continue
12045                         fi
12046                         ;;
12047                 esac
12048                 case "$CPPFLAGS" in
12049                 (*$cf_add_cflags)
12050                         ;;
12051                 (*)
12052                         case $cf_add_cflags in
12053                         (-D*)
12054                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12055
12056 CPPFLAGS=`echo "$CPPFLAGS" | \
12057         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12058                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12059
12060                                 ;;
12061                         esac
12062
12063         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12064         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12065
12066                         ;;
12067                 esac
12068                 ;;
12069         (*)
12070
12071         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12072         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12073
12074                 ;;
12075         esac
12076         ;;
12077 (yes)
12078
12079         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12080         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12081
12082         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12083
12084         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12085                 && test -z "${cf_tst_cflags}" \
12086                 && cf_fix_cppflags=no
12087         ;;
12088 esac
12089 done
12090
12091 if test -n "$cf_new_cflags" ; then
12092
12093         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12094         CFLAGS="${CFLAGS}$cf_new_cflags"
12095
12096 fi
12097
12098 if test -n "$cf_new_cppflags" ; then
12099
12100         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12101         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12102
12103 fi
12104
12105 if test -n "$cf_new_extra_cppflags" ; then
12106
12107         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12108         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12109
12110 fi
12111
12112 cf_add_libs="$cf_pkgconfig_libs"
12113 # Filter out duplicates - this happens with badly-designed ".pc" files...
12114 for cf_add_1lib in $LIBS
12115 do
12116         for cf_add_2lib in $cf_add_libs
12117         do
12118                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12119                 then
12120                         cf_add_1lib=
12121                         break
12122                 fi
12123         done
12124         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12125 done
12126 LIBS="$cf_add_libs"
12127
12128         :
12129 else
12130         cf_pkgconfig_incs=
12131         cf_pkgconfig_libs=
12132         { echo "$as_me:12132: WARNING: unable to find Xt library" >&5
12133 echo "$as_me: WARNING: unable to find Xt library" >&2;}
12134 fi
12135
12136 fi
12137
12138 cf_have_X_LIBS=no
12139
12140 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12141         test -n "$verbose" && echo "    found package xt" 1>&6
12142
12143 echo "${as_me:-configure}:12143: testing found package xt ..." 1>&5
12144
12145         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12146         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12147         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12148
12149 echo "${as_me:-configure}:12149: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12150
12151         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12152
12153 echo "${as_me:-configure}:12153: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12154
12155 cf_fix_cppflags=no
12156 cf_new_cflags=
12157 cf_new_cppflags=
12158 cf_new_extra_cppflags=
12159
12160 for cf_add_cflags in $cf_pkgconfig_incs
12161 do
12162 case $cf_fix_cppflags in
12163 (no)
12164         case $cf_add_cflags in
12165         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12166                 case $cf_add_cflags in
12167                 (-D*)
12168                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12169
12170                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12171                                 && test -z "${cf_tst_cflags}" \
12172                                 && cf_fix_cppflags=yes
12173
12174                         if test $cf_fix_cppflags = yes ; then
12175
12176         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12177         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12178
12179                                 continue
12180                         elif test "${cf_tst_cflags}" = "\"'" ; then
12181
12182         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12183         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12184
12185                                 continue
12186                         fi
12187                         ;;
12188                 esac
12189                 case "$CPPFLAGS" in
12190                 (*$cf_add_cflags)
12191                         ;;
12192                 (*)
12193                         case $cf_add_cflags in
12194                         (-D*)
12195                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12196
12197 CPPFLAGS=`echo "$CPPFLAGS" | \
12198         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12199                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12200
12201                                 ;;
12202                         esac
12203
12204         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12205         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12206
12207                         ;;
12208                 esac
12209                 ;;
12210         (*)
12211
12212         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12213         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12214
12215                 ;;
12216         esac
12217         ;;
12218 (yes)
12219
12220         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12221         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12222
12223         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12224
12225         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12226                 && test -z "${cf_tst_cflags}" \
12227                 && cf_fix_cppflags=no
12228         ;;
12229 esac
12230 done
12231
12232 if test -n "$cf_new_cflags" ; then
12233
12234         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12235         CFLAGS="${CFLAGS}$cf_new_cflags"
12236
12237 fi
12238
12239 if test -n "$cf_new_cppflags" ; then
12240
12241         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12242         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12243
12244 fi
12245
12246 if test -n "$cf_new_extra_cppflags" ; then
12247
12248         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12249         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12250
12251 fi
12252
12253 cf_add_libs="$cf_pkgconfig_libs"
12254 # Filter out duplicates - this happens with badly-designed ".pc" files...
12255 for cf_add_1lib in $LIBS
12256 do
12257         for cf_add_2lib in $cf_add_libs
12258         do
12259                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12260                 then
12261                         cf_add_1lib=
12262                         break
12263                 fi
12264         done
12265         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12266 done
12267 LIBS="$cf_add_libs"
12268
12269         case "x$LIBS" in
12270         (*-lX11*)
12271                 ;;
12272         (*)
12273 # we have an "xt" package, but it may omit Xt's dependency on X11
12274 echo "$as_me:12274: checking for usable X dependency" >&5
12275 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
12276 if test "${cf_cv_xt_x11_compat+set}" = set; then
12277   echo $ECHO_N "(cached) $ECHO_C" >&6
12278 else
12279
12280 cat >conftest.$ac_ext <<_ACEOF
12281 #line 12281 "configure"
12282 #include "confdefs.h"
12283
12284 #include <X11/Xlib.h>
12285
12286 int
12287 main ()
12288 {
12289
12290         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12291         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12292         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12293         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12294
12295   ;
12296   return 0;
12297 }
12298 _ACEOF
12299 rm -f conftest.$ac_objext conftest$ac_exeext
12300 if { (eval echo "$as_me:12300: \"$ac_link\"") >&5
12301   (eval $ac_link) 2>&5
12302   ac_status=$?
12303   echo "$as_me:12303: \$? = $ac_status" >&5
12304   (exit $ac_status); } &&
12305          { ac_try='test -s conftest$ac_exeext'
12306   { (eval echo "$as_me:12306: \"$ac_try\"") >&5
12307   (eval $ac_try) 2>&5
12308   ac_status=$?
12309   echo "$as_me:12309: \$? = $ac_status" >&5
12310   (exit $ac_status); }; }; then
12311   cf_cv_xt_x11_compat=yes
12312 else
12313   echo "$as_me: failed program was:" >&5
12314 cat conftest.$ac_ext >&5
12315 cf_cv_xt_x11_compat=no
12316 fi
12317 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12318 fi
12319 echo "$as_me:12319: result: $cf_cv_xt_x11_compat" >&5
12320 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12321                 if test "$cf_cv_xt_x11_compat" = no
12322                 then
12323                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12324
12325 echo "${as_me:-configure}:12325: testing work around broken X11 dependency ..." 1>&5
12326
12327                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12328
12329 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12330         test -n "$verbose" && echo "    found package x11" 1>&6
12331
12332 echo "${as_me:-configure}:12332: testing found package x11 ..." 1>&5
12333
12334         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12335         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12336         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12337
12338 echo "${as_me:-configure}:12338: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12339
12340         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12341
12342 echo "${as_me:-configure}:12342: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12343
12344 cf_fix_cppflags=no
12345 cf_new_cflags=
12346 cf_new_cppflags=
12347 cf_new_extra_cppflags=
12348
12349 for cf_add_cflags in $cf_pkgconfig_incs
12350 do
12351 case $cf_fix_cppflags in
12352 (no)
12353         case $cf_add_cflags in
12354         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12355                 case $cf_add_cflags in
12356                 (-D*)
12357                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12358
12359                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12360                                 && test -z "${cf_tst_cflags}" \
12361                                 && cf_fix_cppflags=yes
12362
12363                         if test $cf_fix_cppflags = yes ; then
12364
12365         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12366         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12367
12368                                 continue
12369                         elif test "${cf_tst_cflags}" = "\"'" ; then
12370
12371         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12372         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12373
12374                                 continue
12375                         fi
12376                         ;;
12377                 esac
12378                 case "$CPPFLAGS" in
12379                 (*$cf_add_cflags)
12380                         ;;
12381                 (*)
12382                         case $cf_add_cflags in
12383                         (-D*)
12384                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12385
12386 CPPFLAGS=`echo "$CPPFLAGS" | \
12387         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12388                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12389
12390                                 ;;
12391                         esac
12392
12393         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12394         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12395
12396                         ;;
12397                 esac
12398                 ;;
12399         (*)
12400
12401         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12402         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12403
12404                 ;;
12405         esac
12406         ;;
12407 (yes)
12408
12409         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12410         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12411
12412         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12413
12414         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12415                 && test -z "${cf_tst_cflags}" \
12416                 && cf_fix_cppflags=no
12417         ;;
12418 esac
12419 done
12420
12421 if test -n "$cf_new_cflags" ; then
12422
12423         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12424         CFLAGS="${CFLAGS}$cf_new_cflags"
12425
12426 fi
12427
12428 if test -n "$cf_new_cppflags" ; then
12429
12430         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12431         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12432
12433 fi
12434
12435 if test -n "$cf_new_extra_cppflags" ; then
12436
12437         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12438         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12439
12440 fi
12441
12442 cf_add_libs="$cf_pkgconfig_libs"
12443 # Filter out duplicates - this happens with badly-designed ".pc" files...
12444 for cf_add_1lib in $LIBS
12445 do
12446         for cf_add_2lib in $cf_add_libs
12447         do
12448                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12449                 then
12450                         cf_add_1lib=
12451                         break
12452                 fi
12453         done
12454         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12455 done
12456 LIBS="$cf_add_libs"
12457
12458         :
12459 else
12460         cf_pkgconfig_incs=
12461         cf_pkgconfig_libs=
12462
12463 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12464
12465 echo "${as_me:-configure}:12465: testing ...before $LIBS ..." 1>&5
12466
12467 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12468 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12469
12470 echo "${as_me:-configure}:12470: testing ...after  $LIBS ..." 1>&5
12471
12472 fi
12473
12474                 fi
12475                 ;;
12476         esac
12477
12478 echo "$as_me:12478: checking for usable X Toolkit package" >&5
12479 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12480 if test "${cf_cv_xt_ice_compat+set}" = set; then
12481   echo $ECHO_N "(cached) $ECHO_C" >&6
12482 else
12483
12484 cat >conftest.$ac_ext <<_ACEOF
12485 #line 12485 "configure"
12486 #include "confdefs.h"
12487
12488 #include <X11/Shell.h>
12489
12490 int
12491 main ()
12492 {
12493 int num = IceConnectionNumber(0)
12494
12495   ;
12496   return 0;
12497 }
12498 _ACEOF
12499 rm -f conftest.$ac_objext conftest$ac_exeext
12500 if { (eval echo "$as_me:12500: \"$ac_link\"") >&5
12501   (eval $ac_link) 2>&5
12502   ac_status=$?
12503   echo "$as_me:12503: \$? = $ac_status" >&5
12504   (exit $ac_status); } &&
12505          { ac_try='test -s conftest$ac_exeext'
12506   { (eval echo "$as_me:12506: \"$ac_try\"") >&5
12507   (eval $ac_try) 2>&5
12508   ac_status=$?
12509   echo "$as_me:12509: \$? = $ac_status" >&5
12510   (exit $ac_status); }; }; then
12511   cf_cv_xt_ice_compat=yes
12512 else
12513   echo "$as_me: failed program was:" >&5
12514 cat conftest.$ac_ext >&5
12515 cf_cv_xt_ice_compat=no
12516 fi
12517 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12518 fi
12519 echo "$as_me:12519: result: $cf_cv_xt_ice_compat" >&5
12520 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12521
12522         if test "$cf_cv_xt_ice_compat" = no
12523         then
12524                 # workaround for broken ".pc" files used for X Toolkit.
12525                 case "x$X_PRE_LIBS" in
12526                 (*-lICE*)
12527                         case "x$LIBS" in
12528                         (*-lICE*)
12529                                 ;;
12530                         (*)
12531                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12532
12533 echo "${as_me:-configure}:12533: testing work around broken ICE dependency ..." 1>&5
12534
12535 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12536         test -n "$verbose" && echo "    found package ice" 1>&6
12537
12538 echo "${as_me:-configure}:12538: testing found package ice ..." 1>&5
12539
12540         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12541         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12542         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12543
12544 echo "${as_me:-configure}:12544: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12545
12546         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12547
12548 echo "${as_me:-configure}:12548: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12549
12550 cf_fix_cppflags=no
12551 cf_new_cflags=
12552 cf_new_cppflags=
12553 cf_new_extra_cppflags=
12554
12555 for cf_add_cflags in $cf_pkgconfig_incs
12556 do
12557 case $cf_fix_cppflags in
12558 (no)
12559         case $cf_add_cflags in
12560         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12561                 case $cf_add_cflags in
12562                 (-D*)
12563                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12564
12565                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12566                                 && test -z "${cf_tst_cflags}" \
12567                                 && cf_fix_cppflags=yes
12568
12569                         if test $cf_fix_cppflags = yes ; then
12570
12571         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12572         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12573
12574                                 continue
12575                         elif test "${cf_tst_cflags}" = "\"'" ; then
12576
12577         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12578         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12579
12580                                 continue
12581                         fi
12582                         ;;
12583                 esac
12584                 case "$CPPFLAGS" in
12585                 (*$cf_add_cflags)
12586                         ;;
12587                 (*)
12588                         case $cf_add_cflags in
12589                         (-D*)
12590                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12591
12592 CPPFLAGS=`echo "$CPPFLAGS" | \
12593         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12594                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12595
12596                                 ;;
12597                         esac
12598
12599         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12600         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12601
12602                         ;;
12603                 esac
12604                 ;;
12605         (*)
12606
12607         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12608         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12609
12610                 ;;
12611         esac
12612         ;;
12613 (yes)
12614
12615         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12616         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12617
12618         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12619
12620         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12621                 && test -z "${cf_tst_cflags}" \
12622                 && cf_fix_cppflags=no
12623         ;;
12624 esac
12625 done
12626
12627 if test -n "$cf_new_cflags" ; then
12628
12629         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12630         CFLAGS="${CFLAGS}$cf_new_cflags"
12631
12632 fi
12633
12634 if test -n "$cf_new_cppflags" ; then
12635
12636         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12637         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12638
12639 fi
12640
12641 if test -n "$cf_new_extra_cppflags" ; then
12642
12643         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12644         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12645
12646 fi
12647
12648 cf_add_libs="$cf_pkgconfig_libs"
12649 # Filter out duplicates - this happens with badly-designed ".pc" files...
12650 for cf_add_1lib in $LIBS
12651 do
12652         for cf_add_2lib in $cf_add_libs
12653         do
12654                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12655                 then
12656                         cf_add_1lib=
12657                         break
12658                 fi
12659         done
12660         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12661 done
12662 LIBS="$cf_add_libs"
12663
12664 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12665         test -n "$verbose" && echo "    found package sm" 1>&6
12666
12667 echo "${as_me:-configure}:12667: testing found package sm ..." 1>&5
12668
12669         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12670         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12671         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12672
12673 echo "${as_me:-configure}:12673: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12674
12675         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12676
12677 echo "${as_me:-configure}:12677: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12678
12679 cf_fix_cppflags=no
12680 cf_new_cflags=
12681 cf_new_cppflags=
12682 cf_new_extra_cppflags=
12683
12684 for cf_add_cflags in $cf_pkgconfig_incs
12685 do
12686 case $cf_fix_cppflags in
12687 (no)
12688         case $cf_add_cflags in
12689         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12690                 case $cf_add_cflags in
12691                 (-D*)
12692                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12693
12694                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12695                                 && test -z "${cf_tst_cflags}" \
12696                                 && cf_fix_cppflags=yes
12697
12698                         if test $cf_fix_cppflags = yes ; then
12699
12700         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12701         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12702
12703                                 continue
12704                         elif test "${cf_tst_cflags}" = "\"'" ; then
12705
12706         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12707         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12708
12709                                 continue
12710                         fi
12711                         ;;
12712                 esac
12713                 case "$CPPFLAGS" in
12714                 (*$cf_add_cflags)
12715                         ;;
12716                 (*)
12717                         case $cf_add_cflags in
12718                         (-D*)
12719                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12720
12721 CPPFLAGS=`echo "$CPPFLAGS" | \
12722         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12723                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12724
12725                                 ;;
12726                         esac
12727
12728         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12729         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12730
12731                         ;;
12732                 esac
12733                 ;;
12734         (*)
12735
12736         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12737         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12738
12739                 ;;
12740         esac
12741         ;;
12742 (yes)
12743
12744         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12745         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12746
12747         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12748
12749         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12750                 && test -z "${cf_tst_cflags}" \
12751                 && cf_fix_cppflags=no
12752         ;;
12753 esac
12754 done
12755
12756 if test -n "$cf_new_cflags" ; then
12757
12758         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12759         CFLAGS="${CFLAGS}$cf_new_cflags"
12760
12761 fi
12762
12763 if test -n "$cf_new_cppflags" ; then
12764
12765         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12766         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12767
12768 fi
12769
12770 if test -n "$cf_new_extra_cppflags" ; then
12771
12772         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12773         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12774
12775 fi
12776
12777 cf_add_libs="$cf_pkgconfig_libs"
12778 # Filter out duplicates - this happens with badly-designed ".pc" files...
12779 for cf_add_1lib in $LIBS
12780 do
12781         for cf_add_2lib in $cf_add_libs
12782         do
12783                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12784                 then
12785                         cf_add_1lib=
12786                         break
12787                 fi
12788         done
12789         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12790 done
12791 LIBS="$cf_add_libs"
12792
12793         :
12794 else
12795         cf_pkgconfig_incs=
12796         cf_pkgconfig_libs=
12797         :
12798 fi
12799
12800 else
12801         cf_pkgconfig_incs=
12802         cf_pkgconfig_libs=
12803
12804 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12805
12806 echo "${as_me:-configure}:12806: testing ...before $LIBS ..." 1>&5
12807
12808 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12809 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12810
12811 echo "${as_me:-configure}:12811: testing ...after  $LIBS ..." 1>&5
12812
12813 fi
12814
12815                                 ;;
12816                         esac
12817                         ;;
12818                 esac
12819         fi
12820
12821         cf_have_X_LIBS=yes
12822
12823 else
12824         cf_pkgconfig_incs=
12825         cf_pkgconfig_libs=
12826
12827         LDFLAGS="$X_LIBS $LDFLAGS"
12828
12829 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12830
12831 echo "${as_me:-configure}:12831: testing checking additions to CFLAGS ..." 1>&5
12832
12833 cf_check_cflags="$CFLAGS"
12834 cf_check_cppflags="$CPPFLAGS"
12835
12836 cf_fix_cppflags=no
12837 cf_new_cflags=
12838 cf_new_cppflags=
12839 cf_new_extra_cppflags=
12840
12841 for cf_add_cflags in $X_CFLAGS
12842 do
12843 case $cf_fix_cppflags in
12844 (no)
12845         case $cf_add_cflags in
12846         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12847                 case $cf_add_cflags in
12848                 (-D*)
12849                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12850
12851                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12852                                 && test -z "${cf_tst_cflags}" \
12853                                 && cf_fix_cppflags=yes
12854
12855                         if test $cf_fix_cppflags = yes ; then
12856
12857         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12858         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12859
12860                                 continue
12861                         elif test "${cf_tst_cflags}" = "\"'" ; then
12862
12863         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12864         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12865
12866                                 continue
12867                         fi
12868                         ;;
12869                 esac
12870                 case "$CPPFLAGS" in
12871                 (*$cf_add_cflags)
12872                         ;;
12873                 (*)
12874                         case $cf_add_cflags in
12875                         (-D*)
12876                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12877
12878 CPPFLAGS=`echo "$CPPFLAGS" | \
12879         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12880                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12881
12882                                 ;;
12883                         esac
12884
12885         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12886         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12887
12888                         ;;
12889                 esac
12890                 ;;
12891         (*)
12892
12893         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12894         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12895
12896                 ;;
12897         esac
12898         ;;
12899 (yes)
12900
12901         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12902         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12903
12904         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12905
12906         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12907                 && test -z "${cf_tst_cflags}" \
12908                 && cf_fix_cppflags=no
12909         ;;
12910 esac
12911 done
12912
12913 if test -n "$cf_new_cflags" ; then
12914         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12915
12916 echo "${as_me:-configure}:12916: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12917
12918         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12919         CFLAGS="${CFLAGS}$cf_new_cflags"
12920
12921 fi
12922
12923 if test -n "$cf_new_cppflags" ; then
12924         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12925
12926 echo "${as_me:-configure}:12926: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12927
12928         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12929         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12930
12931 fi
12932
12933 if test -n "$cf_new_extra_cppflags" ; then
12934         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12935
12936 echo "${as_me:-configure}:12936: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12937
12938         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12939         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12940
12941 fi
12942
12943 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12944 cat >conftest.$ac_ext <<_ACEOF
12945 #line 12945 "configure"
12946 #include "confdefs.h"
12947 #include <stdio.h>
12948 int
12949 main ()
12950 {
12951 printf("Hello world");
12952   ;
12953   return 0;
12954 }
12955 _ACEOF
12956 rm -f conftest.$ac_objext conftest$ac_exeext
12957 if { (eval echo "$as_me:12957: \"$ac_link\"") >&5
12958   (eval $ac_link) 2>&5
12959   ac_status=$?
12960   echo "$as_me:12960: \$? = $ac_status" >&5
12961   (exit $ac_status); } &&
12962          { ac_try='test -s conftest$ac_exeext'
12963   { (eval echo "$as_me:12963: \"$ac_try\"") >&5
12964   (eval $ac_try) 2>&5
12965   ac_status=$?
12966   echo "$as_me:12966: \$? = $ac_status" >&5
12967   (exit $ac_status); }; }; then
12968   :
12969 else
12970   echo "$as_me: failed program was:" >&5
12971 cat conftest.$ac_ext >&5
12972 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12973
12974 echo "${as_me:-configure}:12974: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12975
12976          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12977                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12978
12979 echo "${as_me:-configure}:12979: testing but keeping change to \$CPPFLAGS ..." 1>&5
12980
12981          fi
12982          CFLAGS="$cf_check_flags"
12983 fi
12984 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12985 fi
12986
12987         echo "$as_me:12987: checking for XOpenDisplay" >&5
12988 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12989 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12990   echo $ECHO_N "(cached) $ECHO_C" >&6
12991 else
12992   cat >conftest.$ac_ext <<_ACEOF
12993 #line 12993 "configure"
12994 #include "confdefs.h"
12995 /* System header to define __stub macros and hopefully few prototypes,
12996     which can conflict with char XOpenDisplay (); below.  */
12997 #include <assert.h>
12998 /* Override any gcc2 internal prototype to avoid an error.  */
12999 #ifdef __cplusplus
13000 extern "C"
13001 #endif
13002 /* We use char because int might match the return type of a gcc2
13003    builtin and then its argument prototype would still apply.  */
13004 char XOpenDisplay ();
13005 char (*f) ();
13006
13007 int
13008 main ()
13009 {
13010 /* The GNU C library defines this for functions which it implements
13011     to always fail with ENOSYS.  Some functions are actually named
13012     something starting with __ and the normal name is an alias.  */
13013 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
13014 choke me
13015 #else
13016 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13017 #endif
13018
13019   ;
13020   return 0;
13021 }
13022 _ACEOF
13023 rm -f conftest.$ac_objext conftest$ac_exeext
13024 if { (eval echo "$as_me:13024: \"$ac_link\"") >&5
13025   (eval $ac_link) 2>&5
13026   ac_status=$?
13027   echo "$as_me:13027: \$? = $ac_status" >&5
13028   (exit $ac_status); } &&
13029          { ac_try='test -s conftest$ac_exeext'
13030   { (eval echo "$as_me:13030: \"$ac_try\"") >&5
13031   (eval $ac_try) 2>&5
13032   ac_status=$?
13033   echo "$as_me:13033: \$? = $ac_status" >&5
13034   (exit $ac_status); }; }; then
13035   ac_cv_func_XOpenDisplay=yes
13036 else
13037   echo "$as_me: failed program was:" >&5
13038 cat conftest.$ac_ext >&5
13039 ac_cv_func_XOpenDisplay=no
13040 fi
13041 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13042 fi
13043 echo "$as_me:13043: result: $ac_cv_func_XOpenDisplay" >&5
13044 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
13045 if test $ac_cv_func_XOpenDisplay = yes; then
13046   :
13047 else
13048
13049         echo "$as_me:13049: checking for XOpenDisplay in -lX11" >&5
13050 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13051 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13052   echo $ECHO_N "(cached) $ECHO_C" >&6
13053 else
13054   ac_check_lib_save_LIBS=$LIBS
13055 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13056 cat >conftest.$ac_ext <<_ACEOF
13057 #line 13057 "configure"
13058 #include "confdefs.h"
13059
13060 /* Override any gcc2 internal prototype to avoid an error.  */
13061 #ifdef __cplusplus
13062 extern "C"
13063 #endif
13064 /* We use char because int might match the return type of a gcc2
13065    builtin and then its argument prototype would still apply.  */
13066 char XOpenDisplay ();
13067 int
13068 main ()
13069 {
13070 XOpenDisplay ();
13071   ;
13072   return 0;
13073 }
13074 _ACEOF
13075 rm -f conftest.$ac_objext conftest$ac_exeext
13076 if { (eval echo "$as_me:13076: \"$ac_link\"") >&5
13077   (eval $ac_link) 2>&5
13078   ac_status=$?
13079   echo "$as_me:13079: \$? = $ac_status" >&5
13080   (exit $ac_status); } &&
13081          { ac_try='test -s conftest$ac_exeext'
13082   { (eval echo "$as_me:13082: \"$ac_try\"") >&5
13083   (eval $ac_try) 2>&5
13084   ac_status=$?
13085   echo "$as_me:13085: \$? = $ac_status" >&5
13086   (exit $ac_status); }; }; then
13087   ac_cv_lib_X11_XOpenDisplay=yes
13088 else
13089   echo "$as_me: failed program was:" >&5
13090 cat conftest.$ac_ext >&5
13091 ac_cv_lib_X11_XOpenDisplay=no
13092 fi
13093 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13094 LIBS=$ac_check_lib_save_LIBS
13095 fi
13096 echo "$as_me:13096: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13097 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13098 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13099
13100 cf_add_libs="-lX11"
13101 # Filter out duplicates - this happens with badly-designed ".pc" files...
13102 for cf_add_1lib in $LIBS
13103 do
13104         for cf_add_2lib in $cf_add_libs
13105         do
13106                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13107                 then
13108                         cf_add_1lib=
13109                         break
13110                 fi
13111         done
13112         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13113 done
13114 LIBS="$cf_add_libs"
13115
13116 fi
13117
13118 fi
13119
13120         echo "$as_me:13120: checking for XtAppInitialize" >&5
13121 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
13122 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
13123   echo $ECHO_N "(cached) $ECHO_C" >&6
13124 else
13125   cat >conftest.$ac_ext <<_ACEOF
13126 #line 13126 "configure"
13127 #include "confdefs.h"
13128 /* System header to define __stub macros and hopefully few prototypes,
13129     which can conflict with char XtAppInitialize (); below.  */
13130 #include <assert.h>
13131 /* Override any gcc2 internal prototype to avoid an error.  */
13132 #ifdef __cplusplus
13133 extern "C"
13134 #endif
13135 /* We use char because int might match the return type of a gcc2
13136    builtin and then its argument prototype would still apply.  */
13137 char XtAppInitialize ();
13138 char (*f) ();
13139
13140 int
13141 main ()
13142 {
13143 /* The GNU C library defines this for functions which it implements
13144     to always fail with ENOSYS.  Some functions are actually named
13145     something starting with __ and the normal name is an alias.  */
13146 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
13147 choke me
13148 #else
13149 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13150 #endif
13151
13152   ;
13153   return 0;
13154 }
13155 _ACEOF
13156 rm -f conftest.$ac_objext conftest$ac_exeext
13157 if { (eval echo "$as_me:13157: \"$ac_link\"") >&5
13158   (eval $ac_link) 2>&5
13159   ac_status=$?
13160   echo "$as_me:13160: \$? = $ac_status" >&5
13161   (exit $ac_status); } &&
13162          { ac_try='test -s conftest$ac_exeext'
13163   { (eval echo "$as_me:13163: \"$ac_try\"") >&5
13164   (eval $ac_try) 2>&5
13165   ac_status=$?
13166   echo "$as_me:13166: \$? = $ac_status" >&5
13167   (exit $ac_status); }; }; then
13168   ac_cv_func_XtAppInitialize=yes
13169 else
13170   echo "$as_me: failed program was:" >&5
13171 cat conftest.$ac_ext >&5
13172 ac_cv_func_XtAppInitialize=no
13173 fi
13174 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13175 fi
13176 echo "$as_me:13176: result: $ac_cv_func_XtAppInitialize" >&5
13177 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
13178 if test $ac_cv_func_XtAppInitialize = yes; then
13179   :
13180 else
13181
13182         echo "$as_me:13182: checking for XtAppInitialize in -lXt" >&5
13183 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
13184 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
13185   echo $ECHO_N "(cached) $ECHO_C" >&6
13186 else
13187   ac_check_lib_save_LIBS=$LIBS
13188 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13189 cat >conftest.$ac_ext <<_ACEOF
13190 #line 13190 "configure"
13191 #include "confdefs.h"
13192
13193 /* Override any gcc2 internal prototype to avoid an error.  */
13194 #ifdef __cplusplus
13195 extern "C"
13196 #endif
13197 /* We use char because int might match the return type of a gcc2
13198    builtin and then its argument prototype would still apply.  */
13199 char XtAppInitialize ();
13200 int
13201 main ()
13202 {
13203 XtAppInitialize ();
13204   ;
13205   return 0;
13206 }
13207 _ACEOF
13208 rm -f conftest.$ac_objext conftest$ac_exeext
13209 if { (eval echo "$as_me:13209: \"$ac_link\"") >&5
13210   (eval $ac_link) 2>&5
13211   ac_status=$?
13212   echo "$as_me:13212: \$? = $ac_status" >&5
13213   (exit $ac_status); } &&
13214          { ac_try='test -s conftest$ac_exeext'
13215   { (eval echo "$as_me:13215: \"$ac_try\"") >&5
13216   (eval $ac_try) 2>&5
13217   ac_status=$?
13218   echo "$as_me:13218: \$? = $ac_status" >&5
13219   (exit $ac_status); }; }; then
13220   ac_cv_lib_Xt_XtAppInitialize=yes
13221 else
13222   echo "$as_me: failed program was:" >&5
13223 cat conftest.$ac_ext >&5
13224 ac_cv_lib_Xt_XtAppInitialize=no
13225 fi
13226 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13227 LIBS=$ac_check_lib_save_LIBS
13228 fi
13229 echo "$as_me:13229: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
13230 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
13231 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
13232
13233 cat >>confdefs.h <<\EOF
13234 #define HAVE_LIBXT 1
13235 EOF
13236
13237                  cf_have_X_LIBS=Xt
13238                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13239 fi
13240
13241 fi
13242
13243 fi
13244
13245 if test $cf_have_X_LIBS = no ; then
13246         { echo "$as_me:13246: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13247 test program.  You will have to check and add the proper libraries by hand
13248 to makefile." >&5
13249 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13250 test program.  You will have to check and add the proper libraries by hand
13251 to makefile." >&2;}
13252 fi
13253
13254 cf_x_athena_root=$cf_x_athena
13255 cf_x_athena_inc=""
13256
13257 for cf_path in default \
13258         /usr/contrib/X11R6 \
13259         /usr/contrib/X11R5 \
13260         /usr/lib/X11R5 \
13261         /usr/local
13262 do
13263         if test -z "$cf_x_athena_inc" ; then
13264                 cf_save="$CPPFLAGS"
13265                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
13266                 if test $cf_path != default ; then
13267                         CPPFLAGS="$cf_save -I$cf_path/include"
13268                         echo "$as_me:13268: checking for $cf_test in $cf_path" >&5
13269 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
13270                 else
13271                         echo "$as_me:13271: checking for $cf_test" >&5
13272 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
13273                 fi
13274                 cat >conftest.$ac_ext <<_ACEOF
13275 #line 13275 "configure"
13276 #include "confdefs.h"
13277
13278 #include <X11/Intrinsic.h>
13279 #include <$cf_test>
13280 int
13281 main ()
13282 {
13283
13284   ;
13285   return 0;
13286 }
13287 _ACEOF
13288 rm -f conftest.$ac_objext
13289 if { (eval echo "$as_me:13289: \"$ac_compile\"") >&5
13290   (eval $ac_compile) 2>&5
13291   ac_status=$?
13292   echo "$as_me:13292: \$? = $ac_status" >&5
13293   (exit $ac_status); } &&
13294          { ac_try='test -s conftest.$ac_objext'
13295   { (eval echo "$as_me:13295: \"$ac_try\"") >&5
13296   (eval $ac_try) 2>&5
13297   ac_status=$?
13298   echo "$as_me:13298: \$? = $ac_status" >&5
13299   (exit $ac_status); }; }; then
13300   cf_result=yes
13301 else
13302   echo "$as_me: failed program was:" >&5
13303 cat conftest.$ac_ext >&5
13304 cf_result=no
13305 fi
13306 rm -f conftest.$ac_objext conftest.$ac_ext
13307                 echo "$as_me:13307: result: $cf_result" >&5
13308 echo "${ECHO_T}$cf_result" >&6
13309                 if test "$cf_result" = yes ; then
13310                         cf_x_athena_inc=$cf_path
13311                         break
13312                 else
13313                         CPPFLAGS="$cf_save"
13314                 fi
13315         fi
13316 done
13317
13318 if test -z "$cf_x_athena_inc" ; then
13319         { echo "$as_me:13319: WARNING: Unable to successfully find Athena header files with test program" >&5
13320 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
13321 elif test "$cf_x_athena_inc" != default ; then
13322         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
13323 fi
13324
13325 cf_x_athena_root=$cf_x_athena
13326 cf_x_athena_lib=""
13327
13328 for cf_path in default \
13329         /usr/contrib/X11R6 \
13330         /usr/contrib/X11R5 \
13331         /usr/lib/X11R5 \
13332         /usr/local
13333 do
13334         for cf_lib in \
13335                 ${cf_x_athena_root} \
13336                 ${cf_x_athena_root}7 \
13337                 ${cf_x_athena_root}6
13338         do
13339         for cf_libs in \
13340                 "-l$cf_lib -lXmu" \
13341                 "-l$cf_lib -lXpm -lXmu" \
13342                 "-l${cf_lib}_s -lXmu_s"
13343         do
13344                 if test -z "$cf_x_athena_lib" ; then
13345                         cf_save="$LIBS"
13346                         cf_test=XawSimpleMenuAddGlobalActions
13347                         if test $cf_path != default ; then
13348
13349 cf_add_libs="-L$cf_path/lib $cf_libs"
13350 # Filter out duplicates - this happens with badly-designed ".pc" files...
13351 for cf_add_1lib in $LIBS
13352 do
13353         for cf_add_2lib in $cf_add_libs
13354         do
13355                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13356                 then
13357                         cf_add_1lib=
13358                         break
13359                 fi
13360         done
13361         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13362 done
13363 LIBS="$cf_add_libs"
13364
13365                                 echo "$as_me:13365: checking for $cf_libs in $cf_path" >&5
13366 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13367                         else
13368
13369 cf_add_libs="$cf_libs"
13370 # Filter out duplicates - this happens with badly-designed ".pc" files...
13371 for cf_add_1lib in $LIBS
13372 do
13373         for cf_add_2lib in $cf_add_libs
13374         do
13375                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13376                 then
13377                         cf_add_1lib=
13378                         break
13379                 fi
13380         done
13381         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13382 done
13383 LIBS="$cf_add_libs"
13384
13385                                 echo "$as_me:13385: checking for $cf_test in $cf_libs" >&5
13386 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13387                         fi
13388                         cat >conftest.$ac_ext <<_ACEOF
13389 #line 13389 "configure"
13390 #include "confdefs.h"
13391
13392 #include <X11/Intrinsic.h>
13393 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13394
13395 int
13396 main ()
13397 {
13398
13399 $cf_test((XtAppContext) 0)
13400   ;
13401   return 0;
13402 }
13403 _ACEOF
13404 rm -f conftest.$ac_objext conftest$ac_exeext
13405 if { (eval echo "$as_me:13405: \"$ac_link\"") >&5
13406   (eval $ac_link) 2>&5
13407   ac_status=$?
13408   echo "$as_me:13408: \$? = $ac_status" >&5
13409   (exit $ac_status); } &&
13410          { ac_try='test -s conftest$ac_exeext'
13411   { (eval echo "$as_me:13411: \"$ac_try\"") >&5
13412   (eval $ac_try) 2>&5
13413   ac_status=$?
13414   echo "$as_me:13414: \$? = $ac_status" >&5
13415   (exit $ac_status); }; }; then
13416   cf_result=yes
13417 else
13418   echo "$as_me: failed program was:" >&5
13419 cat conftest.$ac_ext >&5
13420 cf_result=no
13421 fi
13422 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13423                         echo "$as_me:13423: result: $cf_result" >&5
13424 echo "${ECHO_T}$cf_result" >&6
13425                         if test "$cf_result" = yes ; then
13426                                 cf_x_athena_lib="$cf_libs"
13427                                 break
13428                         fi
13429                         LIBS="$cf_save"
13430                 fi
13431         done # cf_libs
13432                 test -n "$cf_x_athena_lib" && break
13433         done # cf_lib
13434 done
13435
13436 if test -z "$cf_x_athena_lib" ; then
13437         { { echo "$as_me:13437: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13438 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13439    { (exit 1); exit 1; }; }
13440 fi
13441
13442 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13443
13444 cat >>confdefs.h <<EOF
13445 #define $cf_x_athena_LIBS 1
13446 EOF
13447
13448 fi
13449
13450 if test -n "$ac_tool_prefix"; then
13451   for ac_prog in xcurses-config
13452   do
13453     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13454 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13455 echo "$as_me:13455: checking for $ac_word" >&5
13456 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13457 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13458   echo $ECHO_N "(cached) $ECHO_C" >&6
13459 else
13460   if test -n "$XCURSES_CONFIG"; then
13461   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13462 else
13463   ac_save_IFS=$IFS; IFS=$ac_path_separator
13464 ac_dummy="$PATH"
13465 for ac_dir in $ac_dummy; do
13466   IFS=$ac_save_IFS
13467   test -z "$ac_dir" && ac_dir=.
13468   $as_executable_p "$ac_dir/$ac_word" || continue
13469 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13470 echo "$as_me:13470: found $ac_dir/$ac_word" >&5
13471 break
13472 done
13473
13474 fi
13475 fi
13476 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13477 if test -n "$XCURSES_CONFIG"; then
13478   echo "$as_me:13478: result: $XCURSES_CONFIG" >&5
13479 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13480 else
13481   echo "$as_me:13481: result: no" >&5
13482 echo "${ECHO_T}no" >&6
13483 fi
13484
13485     test -n "$XCURSES_CONFIG" && break
13486   done
13487 fi
13488 if test -z "$XCURSES_CONFIG"; then
13489   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13490   for ac_prog in xcurses-config
13491 do
13492   # Extract the first word of "$ac_prog", so it can be a program name with args.
13493 set dummy $ac_prog; ac_word=$2
13494 echo "$as_me:13494: checking for $ac_word" >&5
13495 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13496 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13497   echo $ECHO_N "(cached) $ECHO_C" >&6
13498 else
13499   if test -n "$ac_ct_XCURSES_CONFIG"; then
13500   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13501 else
13502   ac_save_IFS=$IFS; IFS=$ac_path_separator
13503 ac_dummy="$PATH"
13504 for ac_dir in $ac_dummy; do
13505   IFS=$ac_save_IFS
13506   test -z "$ac_dir" && ac_dir=.
13507   $as_executable_p "$ac_dir/$ac_word" || continue
13508 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13509 echo "$as_me:13509: found $ac_dir/$ac_word" >&5
13510 break
13511 done
13512
13513 fi
13514 fi
13515 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13516 if test -n "$ac_ct_XCURSES_CONFIG"; then
13517   echo "$as_me:13517: result: $ac_ct_XCURSES_CONFIG" >&5
13518 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13519 else
13520   echo "$as_me:13520: result: no" >&5
13521 echo "${ECHO_T}no" >&6
13522 fi
13523
13524   test -n "$ac_ct_XCURSES_CONFIG" && break
13525 done
13526 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13527
13528   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13529 fi
13530
13531 if test "$XCURSES_CONFIG" != none ; then
13532
13533 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13534
13535 cf_add_libs="`$XCURSES_CONFIG --libs`"
13536 # Filter out duplicates - this happens with badly-designed ".pc" files...
13537 for cf_add_1lib in $LIBS
13538 do
13539         for cf_add_2lib in $cf_add_libs
13540         do
13541                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13542                 then
13543                         cf_add_1lib=
13544                         break
13545                 fi
13546         done
13547         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13548 done
13549 LIBS="$cf_add_libs"
13550
13551 cf_cv_lib_XCurses=yes
13552
13553 else
13554
13555 LDFLAGS="$LDFLAGS $X_LIBS"
13556
13557 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13558
13559 echo "${as_me:-configure}:13559: testing checking additions to CFLAGS ..." 1>&5
13560
13561 cf_check_cflags="$CFLAGS"
13562 cf_check_cppflags="$CPPFLAGS"
13563
13564 cf_fix_cppflags=no
13565 cf_new_cflags=
13566 cf_new_cppflags=
13567 cf_new_extra_cppflags=
13568
13569 for cf_add_cflags in $X_CFLAGS
13570 do
13571 case $cf_fix_cppflags in
13572 (no)
13573         case $cf_add_cflags in
13574         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13575                 case $cf_add_cflags in
13576                 (-D*)
13577                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13578
13579                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13580                                 && test -z "${cf_tst_cflags}" \
13581                                 && cf_fix_cppflags=yes
13582
13583                         if test $cf_fix_cppflags = yes ; then
13584
13585         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13586         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13587
13588                                 continue
13589                         elif test "${cf_tst_cflags}" = "\"'" ; then
13590
13591         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13592         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13593
13594                                 continue
13595                         fi
13596                         ;;
13597                 esac
13598                 case "$CPPFLAGS" in
13599                 (*$cf_add_cflags)
13600                         ;;
13601                 (*)
13602                         case $cf_add_cflags in
13603                         (-D*)
13604                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13605
13606 CPPFLAGS=`echo "$CPPFLAGS" | \
13607         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13608                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13609
13610                                 ;;
13611                         esac
13612
13613         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13614         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13615
13616                         ;;
13617                 esac
13618                 ;;
13619         (*)
13620
13621         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13622         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13623
13624                 ;;
13625         esac
13626         ;;
13627 (yes)
13628
13629         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13630         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13631
13632         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13633
13634         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13635                 && test -z "${cf_tst_cflags}" \
13636                 && cf_fix_cppflags=no
13637         ;;
13638 esac
13639 done
13640
13641 if test -n "$cf_new_cflags" ; then
13642         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13643
13644 echo "${as_me:-configure}:13644: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13645
13646         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13647         CFLAGS="${CFLAGS}$cf_new_cflags"
13648
13649 fi
13650
13651 if test -n "$cf_new_cppflags" ; then
13652         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13653
13654 echo "${as_me:-configure}:13654: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13655
13656         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13657         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13658
13659 fi
13660
13661 if test -n "$cf_new_extra_cppflags" ; then
13662         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13663
13664 echo "${as_me:-configure}:13664: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13665
13666         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13667         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13668
13669 fi
13670
13671 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13672 cat >conftest.$ac_ext <<_ACEOF
13673 #line 13673 "configure"
13674 #include "confdefs.h"
13675 #include <stdio.h>
13676 int
13677 main ()
13678 {
13679 printf("Hello world");
13680   ;
13681   return 0;
13682 }
13683 _ACEOF
13684 rm -f conftest.$ac_objext conftest$ac_exeext
13685 if { (eval echo "$as_me:13685: \"$ac_link\"") >&5
13686   (eval $ac_link) 2>&5
13687   ac_status=$?
13688   echo "$as_me:13688: \$? = $ac_status" >&5
13689   (exit $ac_status); } &&
13690          { ac_try='test -s conftest$ac_exeext'
13691   { (eval echo "$as_me:13691: \"$ac_try\"") >&5
13692   (eval $ac_try) 2>&5
13693   ac_status=$?
13694   echo "$as_me:13694: \$? = $ac_status" >&5
13695   (exit $ac_status); }; }; then
13696   :
13697 else
13698   echo "$as_me: failed program was:" >&5
13699 cat conftest.$ac_ext >&5
13700 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13701
13702 echo "${as_me:-configure}:13702: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13703
13704          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13705                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13706
13707 echo "${as_me:-configure}:13707: testing but keeping change to \$CPPFLAGS ..." 1>&5
13708
13709          fi
13710          CFLAGS="$cf_check_flags"
13711 fi
13712 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13713 fi
13714
13715 echo "$as_me:13715: checking for XOpenDisplay in -lX11" >&5
13716 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13717 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13718   echo $ECHO_N "(cached) $ECHO_C" >&6
13719 else
13720   ac_check_lib_save_LIBS=$LIBS
13721 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13722 cat >conftest.$ac_ext <<_ACEOF
13723 #line 13723 "configure"
13724 #include "confdefs.h"
13725
13726 /* Override any gcc2 internal prototype to avoid an error.  */
13727 #ifdef __cplusplus
13728 extern "C"
13729 #endif
13730 /* We use char because int might match the return type of a gcc2
13731    builtin and then its argument prototype would still apply.  */
13732 char XOpenDisplay ();
13733 int
13734 main ()
13735 {
13736 XOpenDisplay ();
13737   ;
13738   return 0;
13739 }
13740 _ACEOF
13741 rm -f conftest.$ac_objext conftest$ac_exeext
13742 if { (eval echo "$as_me:13742: \"$ac_link\"") >&5
13743   (eval $ac_link) 2>&5
13744   ac_status=$?
13745   echo "$as_me:13745: \$? = $ac_status" >&5
13746   (exit $ac_status); } &&
13747          { ac_try='test -s conftest$ac_exeext'
13748   { (eval echo "$as_me:13748: \"$ac_try\"") >&5
13749   (eval $ac_try) 2>&5
13750   ac_status=$?
13751   echo "$as_me:13751: \$? = $ac_status" >&5
13752   (exit $ac_status); }; }; then
13753   ac_cv_lib_X11_XOpenDisplay=yes
13754 else
13755   echo "$as_me: failed program was:" >&5
13756 cat conftest.$ac_ext >&5
13757 ac_cv_lib_X11_XOpenDisplay=no
13758 fi
13759 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13760 LIBS=$ac_check_lib_save_LIBS
13761 fi
13762 echo "$as_me:13762: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13763 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13764 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13765
13766 cf_add_libs="-lX11"
13767 # Filter out duplicates - this happens with badly-designed ".pc" files...
13768 for cf_add_1lib in $LIBS
13769 do
13770         for cf_add_2lib in $cf_add_libs
13771         do
13772                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13773                 then
13774                         cf_add_1lib=
13775                         break
13776                 fi
13777         done
13778         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13779 done
13780 LIBS="$cf_add_libs"
13781
13782 fi
13783
13784 echo "$as_me:13784: checking for XCurses library" >&5
13785 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13786 if test "${cf_cv_lib_XCurses+set}" = set; then
13787   echo $ECHO_N "(cached) $ECHO_C" >&6
13788 else
13789
13790 cf_add_libs="-lXCurses"
13791 # Filter out duplicates - this happens with badly-designed ".pc" files...
13792 for cf_add_1lib in $LIBS
13793 do
13794         for cf_add_2lib in $cf_add_libs
13795         do
13796                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13797                 then
13798                         cf_add_1lib=
13799                         break
13800                 fi
13801         done
13802         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13803 done
13804 LIBS="$cf_add_libs"
13805
13806 cat >conftest.$ac_ext <<_ACEOF
13807 #line 13807 "configure"
13808 #include "confdefs.h"
13809
13810 #include <xcurses.h>
13811 char *XCursesProgramName = "test";
13812
13813 int
13814 main ()
13815 {
13816 XCursesExit();
13817   ;
13818   return 0;
13819 }
13820 _ACEOF
13821 rm -f conftest.$ac_objext conftest$ac_exeext
13822 if { (eval echo "$as_me:13822: \"$ac_link\"") >&5
13823   (eval $ac_link) 2>&5
13824   ac_status=$?
13825   echo "$as_me:13825: \$? = $ac_status" >&5
13826   (exit $ac_status); } &&
13827          { ac_try='test -s conftest$ac_exeext'
13828   { (eval echo "$as_me:13828: \"$ac_try\"") >&5
13829   (eval $ac_try) 2>&5
13830   ac_status=$?
13831   echo "$as_me:13831: \$? = $ac_status" >&5
13832   (exit $ac_status); }; }; then
13833   cf_cv_lib_XCurses=yes
13834 else
13835   echo "$as_me: failed program was:" >&5
13836 cat conftest.$ac_ext >&5
13837 cf_cv_lib_XCurses=no
13838 fi
13839 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13840
13841 fi
13842 echo "$as_me:13842: result: $cf_cv_lib_XCurses" >&5
13843 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13844
13845 fi
13846
13847 if test $cf_cv_lib_XCurses = yes ; then
13848
13849 cat >>confdefs.h <<\EOF
13850 #define UNIX 1
13851 EOF
13852
13853 cat >>confdefs.h <<\EOF
13854 #define XCURSES 1
13855 EOF
13856
13857         echo "$as_me:13857: checking for xcurses.h" >&5
13858 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13859 if test "${ac_cv_header_xcurses_h+set}" = set; then
13860   echo $ECHO_N "(cached) $ECHO_C" >&6
13861 else
13862   cat >conftest.$ac_ext <<_ACEOF
13863 #line 13863 "configure"
13864 #include "confdefs.h"
13865 #include <xcurses.h>
13866 _ACEOF
13867 if { (eval echo "$as_me:13867: \"$ac_cpp conftest.$ac_ext\"") >&5
13868   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13869   ac_status=$?
13870   egrep -v '^ *\+' conftest.er1 >conftest.err
13871   rm -f conftest.er1
13872   cat conftest.err >&5
13873   echo "$as_me:13873: \$? = $ac_status" >&5
13874   (exit $ac_status); } >/dev/null; then
13875   if test -s conftest.err; then
13876     ac_cpp_err=$ac_c_preproc_warn_flag
13877   else
13878     ac_cpp_err=
13879   fi
13880 else
13881   ac_cpp_err=yes
13882 fi
13883 if test -z "$ac_cpp_err"; then
13884   ac_cv_header_xcurses_h=yes
13885 else
13886   echo "$as_me: failed program was:" >&5
13887   cat conftest.$ac_ext >&5
13888   ac_cv_header_xcurses_h=no
13889 fi
13890 rm -f conftest.err conftest.$ac_ext
13891 fi
13892 echo "$as_me:13892: result: $ac_cv_header_xcurses_h" >&5
13893 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13894 if test $ac_cv_header_xcurses_h = yes; then
13895
13896 cat >>confdefs.h <<\EOF
13897 #define HAVE_XCURSES 1
13898 EOF
13899
13900 fi
13901
13902 else
13903         { { echo "$as_me:13903: error: Cannot link with XCurses" >&5
13904 echo "$as_me: error: Cannot link with XCurses" >&2;}
13905    { (exit 1); exit 1; }; }
13906 fi
13907
13908         ;;
13909 (*)
13910         { { echo "$as_me:13910: error: unexpected screen-value: $cf_cv_screen" >&5
13911 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
13912    { (exit 1); exit 1; }; }
13913         ;;
13914 esac
13915
13916 : ${cf_nculib_root:=$cf_cv_screen}
13917 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
13918 echo "$as_me:13918: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
13919 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
13920 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13921   echo $ECHO_N "(cached) $ECHO_C" >&6
13922 else
13923   ac_check_lib_save_LIBS=$LIBS
13924 LIBS="-l$cf_nculib_root  $LIBS"
13925 cat >conftest.$ac_ext <<_ACEOF
13926 #line 13926 "configure"
13927 #include "confdefs.h"
13928
13929 /* Override any gcc2 internal prototype to avoid an error.  */
13930 #ifdef __cplusplus
13931 extern "C"
13932 #endif
13933 /* We use char because int might match the return type of a gcc2
13934    builtin and then its argument prototype would still apply.  */
13935 char _nc_init_pthreads ();
13936 int
13937 main ()
13938 {
13939 _nc_init_pthreads ();
13940   ;
13941   return 0;
13942 }
13943 _ACEOF
13944 rm -f conftest.$ac_objext conftest$ac_exeext
13945 if { (eval echo "$as_me:13945: \"$ac_link\"") >&5
13946   (eval $ac_link) 2>&5
13947   ac_status=$?
13948   echo "$as_me:13948: \$? = $ac_status" >&5
13949   (exit $ac_status); } &&
13950          { ac_try='test -s conftest$ac_exeext'
13951   { (eval echo "$as_me:13951: \"$ac_try\"") >&5
13952   (eval $ac_try) 2>&5
13953   ac_status=$?
13954   echo "$as_me:13954: \$? = $ac_status" >&5
13955   (exit $ac_status); }; }; then
13956   eval "$as_ac_Lib=yes"
13957 else
13958   echo "$as_me: failed program was:" >&5
13959 cat conftest.$ac_ext >&5
13960 eval "$as_ac_Lib=no"
13961 fi
13962 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13963 LIBS=$ac_check_lib_save_LIBS
13964 fi
13965 echo "$as_me:13965: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13966 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13967 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13968   cf_cv_ncurses_pthreads=yes
13969 else
13970   cf_cv_ncurses_pthreads=no
13971 fi
13972
13973 if test "$cf_cv_ncurses_pthreads" = yes
13974 then
13975
13976 cf_add_libs="-lpthread"
13977 # Filter out duplicates - this happens with badly-designed ".pc" files...
13978 for cf_add_1lib in $LIBS
13979 do
13980         for cf_add_2lib in $cf_add_libs
13981         do
13982                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13983                 then
13984                         cf_add_1lib=
13985                         break
13986                 fi
13987         done
13988         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13989 done
13990 LIBS="$cf_add_libs"
13991
13992 fi
13993
13994 case $cf_cv_screen in
13995 (ncurses*)
13996         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13997         ;;
13998 (curses|curses_*)
13999
14000 echo "$as_me:14000: checking for NetBSD form.h" >&5
14001 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
14002 if test "${cf_cv_netbsd_form_h+set}" = set; then
14003   echo $ECHO_N "(cached) $ECHO_C" >&6
14004 else
14005
14006 cat >conftest.$ac_ext <<_ACEOF
14007 #line 14007 "configure"
14008 #include "confdefs.h"
14009
14010 #include <${cf_cv_ncurses_header:-curses.h}>
14011 #include <form.h>
14012
14013 int
14014 main ()
14015 {
14016
14017         FORM *form;
14018         int y = current_field(form)->cursor_ypos;
14019         int x = current_field(form)->cursor_xpos;
14020
14021   ;
14022   return 0;
14023 }
14024 _ACEOF
14025 rm -f conftest.$ac_objext
14026 if { (eval echo "$as_me:14026: \"$ac_compile\"") >&5
14027   (eval $ac_compile) 2>&5
14028   ac_status=$?
14029   echo "$as_me:14029: \$? = $ac_status" >&5
14030   (exit $ac_status); } &&
14031          { ac_try='test -s conftest.$ac_objext'
14032   { (eval echo "$as_me:14032: \"$ac_try\"") >&5
14033   (eval $ac_try) 2>&5
14034   ac_status=$?
14035   echo "$as_me:14035: \$? = $ac_status" >&5
14036   (exit $ac_status); }; }; then
14037   cf_cv_netbsd_form_h=yes
14038
14039 else
14040   echo "$as_me: failed program was:" >&5
14041 cat conftest.$ac_ext >&5
14042 cf_cv_netbsd_form_h=no
14043 fi
14044 rm -f conftest.$ac_objext conftest.$ac_ext
14045
14046 fi
14047 echo "$as_me:14047: result: $cf_cv_netbsd_form_h" >&5
14048 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
14049
14050 test "$cf_cv_netbsd_form_h" = yes &&
14051 cat >>confdefs.h <<\EOF
14052 #define HAVE_NETBSD_FORM_H 1
14053 EOF
14054
14055 echo "$as_me:14055: checking for NetBSD menu.h" >&5
14056 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
14057 if test "${cf_cv_netbsd_menu_h+set}" = set; then
14058   echo $ECHO_N "(cached) $ECHO_C" >&6
14059 else
14060
14061 cat >conftest.$ac_ext <<_ACEOF
14062 #line 14062 "configure"
14063 #include "confdefs.h"
14064
14065 #include <${cf_cv_ncurses_header:-curses.h}>
14066 #include <menu.h>
14067
14068 int
14069 main ()
14070 {
14071
14072         MENU *menu;
14073         int y = menu->max_item_width;
14074
14075   ;
14076   return 0;
14077 }
14078 _ACEOF
14079 rm -f conftest.$ac_objext
14080 if { (eval echo "$as_me:14080: \"$ac_compile\"") >&5
14081   (eval $ac_compile) 2>&5
14082   ac_status=$?
14083   echo "$as_me:14083: \$? = $ac_status" >&5
14084   (exit $ac_status); } &&
14085          { ac_try='test -s conftest.$ac_objext'
14086   { (eval echo "$as_me:14086: \"$ac_try\"") >&5
14087   (eval $ac_try) 2>&5
14088   ac_status=$?
14089   echo "$as_me:14089: \$? = $ac_status" >&5
14090   (exit $ac_status); }; }; then
14091   cf_cv_netbsd_menu_h=yes
14092
14093 else
14094   echo "$as_me: failed program was:" >&5
14095 cat conftest.$ac_ext >&5
14096 cf_cv_netbsd_menu_h=no
14097 fi
14098 rm -f conftest.$ac_objext conftest.$ac_ext
14099
14100 fi
14101 echo "$as_me:14101: result: $cf_cv_netbsd_menu_h" >&5
14102 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
14103
14104 test "$cf_cv_netbsd_menu_h" = yes &&
14105 cat >>confdefs.h <<\EOF
14106 #define HAVE_NETBSD_MENU_H 1
14107 EOF
14108
14109         ;;
14110 esac
14111
14112 case $cf_cv_screen in
14113 (pdcurses)
14114         ;;
14115 (*)
14116         # look for curses-related libraries
14117
14118 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
14119 echo "$as_me:14119: checking for new_panel in -lpanel$cf_cv_libtype" >&5
14120 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
14121 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14122   echo $ECHO_N "(cached) $ECHO_C" >&6
14123 else
14124   ac_check_lib_save_LIBS=$LIBS
14125 LIBS="-lpanel$cf_cv_libtype  $LIBS"
14126 cat >conftest.$ac_ext <<_ACEOF
14127 #line 14127 "configure"
14128 #include "confdefs.h"
14129
14130 /* Override any gcc2 internal prototype to avoid an error.  */
14131 #ifdef __cplusplus
14132 extern "C"
14133 #endif
14134 /* We use char because int might match the return type of a gcc2
14135    builtin and then its argument prototype would still apply.  */
14136 char new_panel ();
14137 int
14138 main ()
14139 {
14140 new_panel ();
14141   ;
14142   return 0;
14143 }
14144 _ACEOF
14145 rm -f conftest.$ac_objext conftest$ac_exeext
14146 if { (eval echo "$as_me:14146: \"$ac_link\"") >&5
14147   (eval $ac_link) 2>&5
14148   ac_status=$?
14149   echo "$as_me:14149: \$? = $ac_status" >&5
14150   (exit $ac_status); } &&
14151          { ac_try='test -s conftest$ac_exeext'
14152   { (eval echo "$as_me:14152: \"$ac_try\"") >&5
14153   (eval $ac_try) 2>&5
14154   ac_status=$?
14155   echo "$as_me:14155: \$? = $ac_status" >&5
14156   (exit $ac_status); }; }; then
14157   eval "$as_ac_Lib=yes"
14158 else
14159   echo "$as_me: failed program was:" >&5
14160 cat conftest.$ac_ext >&5
14161 eval "$as_ac_Lib=no"
14162 fi
14163 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14164 LIBS=$ac_check_lib_save_LIBS
14165 fi
14166 echo "$as_me:14166: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14167 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14168 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14169
14170 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14171
14172 cf_add_libs="-lpanel$cf_cv_libtype"
14173 # Filter out duplicates - this happens with badly-designed ".pc" files...
14174 for cf_add_1lib in $LIBS
14175 do
14176         for cf_add_2lib in $cf_add_libs
14177         do
14178                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14179                 then
14180                         cf_add_1lib=
14181                         break
14182                 fi
14183         done
14184         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14185 done
14186 LIBS="$cf_add_libs"
14187
14188 cat >>confdefs.h <<EOF
14189 #define $cf_upper 1
14190 EOF
14191
14192 fi
14193
14194 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
14195 echo "$as_me:14195: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
14196 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
14197 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14198   echo $ECHO_N "(cached) $ECHO_C" >&6
14199 else
14200   ac_check_lib_save_LIBS=$LIBS
14201 LIBS="-lmenu$cf_cv_libtype  $LIBS"
14202 cat >conftest.$ac_ext <<_ACEOF
14203 #line 14203 "configure"
14204 #include "confdefs.h"
14205
14206 /* Override any gcc2 internal prototype to avoid an error.  */
14207 #ifdef __cplusplus
14208 extern "C"
14209 #endif
14210 /* We use char because int might match the return type of a gcc2
14211    builtin and then its argument prototype would still apply.  */
14212 char menu_driver ();
14213 int
14214 main ()
14215 {
14216 menu_driver ();
14217   ;
14218   return 0;
14219 }
14220 _ACEOF
14221 rm -f conftest.$ac_objext conftest$ac_exeext
14222 if { (eval echo "$as_me:14222: \"$ac_link\"") >&5
14223   (eval $ac_link) 2>&5
14224   ac_status=$?
14225   echo "$as_me:14225: \$? = $ac_status" >&5
14226   (exit $ac_status); } &&
14227          { ac_try='test -s conftest$ac_exeext'
14228   { (eval echo "$as_me:14228: \"$ac_try\"") >&5
14229   (eval $ac_try) 2>&5
14230   ac_status=$?
14231   echo "$as_me:14231: \$? = $ac_status" >&5
14232   (exit $ac_status); }; }; then
14233   eval "$as_ac_Lib=yes"
14234 else
14235   echo "$as_me: failed program was:" >&5
14236 cat conftest.$ac_ext >&5
14237 eval "$as_ac_Lib=no"
14238 fi
14239 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14240 LIBS=$ac_check_lib_save_LIBS
14241 fi
14242 echo "$as_me:14242: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14243 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14244 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14245
14246 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14247
14248 cf_add_libs="-lmenu$cf_cv_libtype"
14249 # Filter out duplicates - this happens with badly-designed ".pc" files...
14250 for cf_add_1lib in $LIBS
14251 do
14252         for cf_add_2lib in $cf_add_libs
14253         do
14254                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14255                 then
14256                         cf_add_1lib=
14257                         break
14258                 fi
14259         done
14260         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14261 done
14262 LIBS="$cf_add_libs"
14263
14264 cat >>confdefs.h <<EOF
14265 #define $cf_upper 1
14266 EOF
14267
14268 fi
14269
14270 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
14271 echo "$as_me:14271: checking for form_driver in -lform$cf_cv_libtype" >&5
14272 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
14273 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14274   echo $ECHO_N "(cached) $ECHO_C" >&6
14275 else
14276   ac_check_lib_save_LIBS=$LIBS
14277 LIBS="-lform$cf_cv_libtype  $LIBS"
14278 cat >conftest.$ac_ext <<_ACEOF
14279 #line 14279 "configure"
14280 #include "confdefs.h"
14281
14282 /* Override any gcc2 internal prototype to avoid an error.  */
14283 #ifdef __cplusplus
14284 extern "C"
14285 #endif
14286 /* We use char because int might match the return type of a gcc2
14287    builtin and then its argument prototype would still apply.  */
14288 char form_driver ();
14289 int
14290 main ()
14291 {
14292 form_driver ();
14293   ;
14294   return 0;
14295 }
14296 _ACEOF
14297 rm -f conftest.$ac_objext conftest$ac_exeext
14298 if { (eval echo "$as_me:14298: \"$ac_link\"") >&5
14299   (eval $ac_link) 2>&5
14300   ac_status=$?
14301   echo "$as_me:14301: \$? = $ac_status" >&5
14302   (exit $ac_status); } &&
14303          { ac_try='test -s conftest$ac_exeext'
14304   { (eval echo "$as_me:14304: \"$ac_try\"") >&5
14305   (eval $ac_try) 2>&5
14306   ac_status=$?
14307   echo "$as_me:14307: \$? = $ac_status" >&5
14308   (exit $ac_status); }; }; then
14309   eval "$as_ac_Lib=yes"
14310 else
14311   echo "$as_me: failed program was:" >&5
14312 cat conftest.$ac_ext >&5
14313 eval "$as_ac_Lib=no"
14314 fi
14315 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14316 LIBS=$ac_check_lib_save_LIBS
14317 fi
14318 echo "$as_me:14318: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14319 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14320 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14321
14322 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14323
14324 cf_add_libs="-lform$cf_cv_libtype"
14325 # Filter out duplicates - this happens with badly-designed ".pc" files...
14326 for cf_add_1lib in $LIBS
14327 do
14328         for cf_add_2lib in $cf_add_libs
14329         do
14330                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14331                 then
14332                         cf_add_1lib=
14333                         break
14334                 fi
14335         done
14336         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14337 done
14338 LIBS="$cf_add_libs"
14339
14340 cat >>confdefs.h <<EOF
14341 #define $cf_upper 1
14342 EOF
14343
14344 fi
14345
14346         # look for curses-related headers
14347
14348 for ac_header in \
14349                 nc_alloc.h \
14350                 nomacros.h \
14351                 form.h \
14352                 menu.h \
14353                 panel.h \
14354                 term_entry.h \
14355
14356 do
14357 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14358 echo "$as_me:14358: checking for $ac_header" >&5
14359 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14360 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14361   echo $ECHO_N "(cached) $ECHO_C" >&6
14362 else
14363   cat >conftest.$ac_ext <<_ACEOF
14364 #line 14364 "configure"
14365 #include "confdefs.h"
14366 #include <$ac_header>
14367 _ACEOF
14368 if { (eval echo "$as_me:14368: \"$ac_cpp conftest.$ac_ext\"") >&5
14369   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14370   ac_status=$?
14371   egrep -v '^ *\+' conftest.er1 >conftest.err
14372   rm -f conftest.er1
14373   cat conftest.err >&5
14374   echo "$as_me:14374: \$? = $ac_status" >&5
14375   (exit $ac_status); } >/dev/null; then
14376   if test -s conftest.err; then
14377     ac_cpp_err=$ac_c_preproc_warn_flag
14378   else
14379     ac_cpp_err=
14380   fi
14381 else
14382   ac_cpp_err=yes
14383 fi
14384 if test -z "$ac_cpp_err"; then
14385   eval "$as_ac_Header=yes"
14386 else
14387   echo "$as_me: failed program was:" >&5
14388   cat conftest.$ac_ext >&5
14389   eval "$as_ac_Header=no"
14390 fi
14391 rm -f conftest.err conftest.$ac_ext
14392 fi
14393 echo "$as_me:14393: result: `eval echo '${'$as_ac_Header'}'`" >&5
14394 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14395 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14396   cat >>confdefs.h <<EOF
14397 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14398 EOF
14399
14400 fi
14401 done
14402
14403         ;;
14404 esac
14405
14406 echo "$as_me:14406: checking for ANSI C header files" >&5
14407 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14408 if test "${ac_cv_header_stdc+set}" = set; then
14409   echo $ECHO_N "(cached) $ECHO_C" >&6
14410 else
14411   cat >conftest.$ac_ext <<_ACEOF
14412 #line 14412 "configure"
14413 #include "confdefs.h"
14414 #include <stdlib.h>
14415 #include <stdarg.h>
14416 #include <string.h>
14417 #include <float.h>
14418
14419 _ACEOF
14420 if { (eval echo "$as_me:14420: \"$ac_cpp conftest.$ac_ext\"") >&5
14421   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14422   ac_status=$?
14423   egrep -v '^ *\+' conftest.er1 >conftest.err
14424   rm -f conftest.er1
14425   cat conftest.err >&5
14426   echo "$as_me:14426: \$? = $ac_status" >&5
14427   (exit $ac_status); } >/dev/null; then
14428   if test -s conftest.err; then
14429     ac_cpp_err=$ac_c_preproc_warn_flag
14430   else
14431     ac_cpp_err=
14432   fi
14433 else
14434   ac_cpp_err=yes
14435 fi
14436 if test -z "$ac_cpp_err"; then
14437   ac_cv_header_stdc=yes
14438 else
14439   echo "$as_me: failed program was:" >&5
14440   cat conftest.$ac_ext >&5
14441   ac_cv_header_stdc=no
14442 fi
14443 rm -f conftest.err conftest.$ac_ext
14444
14445 if test $ac_cv_header_stdc = yes; then
14446   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14447   cat >conftest.$ac_ext <<_ACEOF
14448 #line 14448 "configure"
14449 #include "confdefs.h"
14450 #include <string.h>
14451
14452 _ACEOF
14453 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14454   egrep "memchr" >/dev/null 2>&1; then
14455   :
14456 else
14457   ac_cv_header_stdc=no
14458 fi
14459 rm -rf conftest*
14460
14461 fi
14462
14463 if test $ac_cv_header_stdc = yes; then
14464   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14465   cat >conftest.$ac_ext <<_ACEOF
14466 #line 14466 "configure"
14467 #include "confdefs.h"
14468 #include <stdlib.h>
14469
14470 _ACEOF
14471 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14472   egrep "free" >/dev/null 2>&1; then
14473   :
14474 else
14475   ac_cv_header_stdc=no
14476 fi
14477 rm -rf conftest*
14478
14479 fi
14480
14481 if test $ac_cv_header_stdc = yes; then
14482   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14483   if test "$cross_compiling" = yes; then
14484   :
14485 else
14486   cat >conftest.$ac_ext <<_ACEOF
14487 #line 14487 "configure"
14488 #include "confdefs.h"
14489 #include <ctype.h>
14490 #if ((' ' & 0x0FF) == 0x020)
14491 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14492 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14493 #else
14494 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14495                      || ('j' <= (c) && (c) <= 'r') \
14496                      || ('s' <= (c) && (c) <= 'z'))
14497 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14498 #endif
14499
14500 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14501 int
14502 main ()
14503 {
14504   int i;
14505   for (i = 0; i < 256; i++)
14506     if (XOR (islower (i), ISLOWER (i))
14507         || toupper (i) != TOUPPER (i))
14508       $ac_main_return(2);
14509   $ac_main_return (0);
14510 }
14511 _ACEOF
14512 rm -f conftest$ac_exeext
14513 if { (eval echo "$as_me:14513: \"$ac_link\"") >&5
14514   (eval $ac_link) 2>&5
14515   ac_status=$?
14516   echo "$as_me:14516: \$? = $ac_status" >&5
14517   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14518   { (eval echo "$as_me:14518: \"$ac_try\"") >&5
14519   (eval $ac_try) 2>&5
14520   ac_status=$?
14521   echo "$as_me:14521: \$? = $ac_status" >&5
14522   (exit $ac_status); }; }; then
14523   :
14524 else
14525   echo "$as_me: program exited with status $ac_status" >&5
14526 echo "$as_me: failed program was:" >&5
14527 cat conftest.$ac_ext >&5
14528 ac_cv_header_stdc=no
14529 fi
14530 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14531 fi
14532 fi
14533 fi
14534 echo "$as_me:14534: result: $ac_cv_header_stdc" >&5
14535 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14536 if test $ac_cv_header_stdc = yes; then
14537
14538 cat >>confdefs.h <<\EOF
14539 #define STDC_HEADERS 1
14540 EOF
14541
14542 fi
14543
14544 echo "$as_me:14544: checking whether time.h and sys/time.h may both be included" >&5
14545 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
14546 if test "${ac_cv_header_time+set}" = set; then
14547   echo $ECHO_N "(cached) $ECHO_C" >&6
14548 else
14549   cat >conftest.$ac_ext <<_ACEOF
14550 #line 14550 "configure"
14551 #include "confdefs.h"
14552 #include <sys/types.h>
14553 #include <sys/time.h>
14554 #include <time.h>
14555
14556 int
14557 main ()
14558 {
14559 if ((struct tm *) 0)
14560 return 0;
14561   ;
14562   return 0;
14563 }
14564 _ACEOF
14565 rm -f conftest.$ac_objext
14566 if { (eval echo "$as_me:14566: \"$ac_compile\"") >&5
14567   (eval $ac_compile) 2>&5
14568   ac_status=$?
14569   echo "$as_me:14569: \$? = $ac_status" >&5
14570   (exit $ac_status); } &&
14571          { ac_try='test -s conftest.$ac_objext'
14572   { (eval echo "$as_me:14572: \"$ac_try\"") >&5
14573   (eval $ac_try) 2>&5
14574   ac_status=$?
14575   echo "$as_me:14575: \$? = $ac_status" >&5
14576   (exit $ac_status); }; }; then
14577   ac_cv_header_time=yes
14578 else
14579   echo "$as_me: failed program was:" >&5
14580 cat conftest.$ac_ext >&5
14581 ac_cv_header_time=no
14582 fi
14583 rm -f conftest.$ac_objext conftest.$ac_ext
14584 fi
14585 echo "$as_me:14585: result: $ac_cv_header_time" >&5
14586 echo "${ECHO_T}$ac_cv_header_time" >&6
14587 if test $ac_cv_header_time = yes; then
14588
14589 cat >>confdefs.h <<\EOF
14590 #define TIME_WITH_SYS_TIME 1
14591 EOF
14592
14593 fi
14594
14595 for ac_header in \
14596 getopt.h \
14597 locale.h \
14598 math.h \
14599 stdarg.h \
14600 sys/ioctl.h \
14601 sys/select.h \
14602 sys/time.h \
14603 termios.h \
14604 unistd.h \
14605
14606 do
14607 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14608 echo "$as_me:14608: checking for $ac_header" >&5
14609 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14610 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14611   echo $ECHO_N "(cached) $ECHO_C" >&6
14612 else
14613   cat >conftest.$ac_ext <<_ACEOF
14614 #line 14614 "configure"
14615 #include "confdefs.h"
14616 #include <$ac_header>
14617 _ACEOF
14618 if { (eval echo "$as_me:14618: \"$ac_cpp conftest.$ac_ext\"") >&5
14619   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14620   ac_status=$?
14621   egrep -v '^ *\+' conftest.er1 >conftest.err
14622   rm -f conftest.er1
14623   cat conftest.err >&5
14624   echo "$as_me:14624: \$? = $ac_status" >&5
14625   (exit $ac_status); } >/dev/null; then
14626   if test -s conftest.err; then
14627     ac_cpp_err=$ac_c_preproc_warn_flag
14628   else
14629     ac_cpp_err=
14630   fi
14631 else
14632   ac_cpp_err=yes
14633 fi
14634 if test -z "$ac_cpp_err"; then
14635   eval "$as_ac_Header=yes"
14636 else
14637   echo "$as_me: failed program was:" >&5
14638   cat conftest.$ac_ext >&5
14639   eval "$as_ac_Header=no"
14640 fi
14641 rm -f conftest.err conftest.$ac_ext
14642 fi
14643 echo "$as_me:14643: result: `eval echo '${'$as_ac_Header'}'`" >&5
14644 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14645 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14646   cat >>confdefs.h <<EOF
14647 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14648 EOF
14649
14650 fi
14651 done
14652
14653 for ac_header in unistd.h getopt.h
14654 do
14655 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14656 echo "$as_me:14656: checking for $ac_header" >&5
14657 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14658 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14659   echo $ECHO_N "(cached) $ECHO_C" >&6
14660 else
14661   cat >conftest.$ac_ext <<_ACEOF
14662 #line 14662 "configure"
14663 #include "confdefs.h"
14664 #include <$ac_header>
14665 _ACEOF
14666 if { (eval echo "$as_me:14666: \"$ac_cpp conftest.$ac_ext\"") >&5
14667   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14668   ac_status=$?
14669   egrep -v '^ *\+' conftest.er1 >conftest.err
14670   rm -f conftest.er1
14671   cat conftest.err >&5
14672   echo "$as_me:14672: \$? = $ac_status" >&5
14673   (exit $ac_status); } >/dev/null; then
14674   if test -s conftest.err; then
14675     ac_cpp_err=$ac_c_preproc_warn_flag
14676   else
14677     ac_cpp_err=
14678   fi
14679 else
14680   ac_cpp_err=yes
14681 fi
14682 if test -z "$ac_cpp_err"; then
14683   eval "$as_ac_Header=yes"
14684 else
14685   echo "$as_me: failed program was:" >&5
14686   cat conftest.$ac_ext >&5
14687   eval "$as_ac_Header=no"
14688 fi
14689 rm -f conftest.err conftest.$ac_ext
14690 fi
14691 echo "$as_me:14691: result: `eval echo '${'$as_ac_Header'}'`" >&5
14692 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14693 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14694   cat >>confdefs.h <<EOF
14695 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14696 EOF
14697
14698 fi
14699 done
14700
14701 echo "$as_me:14701: checking for header declaring getopt variables" >&5
14702 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
14703 if test "${cf_cv_getopt_header+set}" = set; then
14704   echo $ECHO_N "(cached) $ECHO_C" >&6
14705 else
14706
14707 cf_cv_getopt_header=none
14708 for cf_header in stdio.h stdlib.h unistd.h getopt.h
14709 do
14710 cat >conftest.$ac_ext <<_ACEOF
14711 #line 14711 "configure"
14712 #include "confdefs.h"
14713
14714 #include <$cf_header>
14715 int
14716 main ()
14717 {
14718 int x = optind; char *y = optarg
14719   ;
14720   return 0;
14721 }
14722 _ACEOF
14723 rm -f conftest.$ac_objext
14724 if { (eval echo "$as_me:14724: \"$ac_compile\"") >&5
14725   (eval $ac_compile) 2>&5
14726   ac_status=$?
14727   echo "$as_me:14727: \$? = $ac_status" >&5
14728   (exit $ac_status); } &&
14729          { ac_try='test -s conftest.$ac_objext'
14730   { (eval echo "$as_me:14730: \"$ac_try\"") >&5
14731   (eval $ac_try) 2>&5
14732   ac_status=$?
14733   echo "$as_me:14733: \$? = $ac_status" >&5
14734   (exit $ac_status); }; }; then
14735   cf_cv_getopt_header=$cf_header
14736  break
14737 else
14738   echo "$as_me: failed program was:" >&5
14739 cat conftest.$ac_ext >&5
14740 fi
14741 rm -f conftest.$ac_objext conftest.$ac_ext
14742 done
14743
14744 fi
14745 echo "$as_me:14745: result: $cf_cv_getopt_header" >&5
14746 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14747 if test $cf_cv_getopt_header != none ; then
14748
14749 cat >>confdefs.h <<\EOF
14750 #define HAVE_GETOPT_HEADER 1
14751 EOF
14752
14753 fi
14754 if test $cf_cv_getopt_header = getopt.h ; then
14755
14756 cat >>confdefs.h <<\EOF
14757 #define NEED_GETOPT_H 1
14758 EOF
14759
14760 fi
14761
14762 for ac_func in \
14763 getopt \
14764 gettimeofday \
14765
14766 do
14767 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14768 echo "$as_me:14768: checking for $ac_func" >&5
14769 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14770 if eval "test \"\${$as_ac_var+set}\" = set"; then
14771   echo $ECHO_N "(cached) $ECHO_C" >&6
14772 else
14773   cat >conftest.$ac_ext <<_ACEOF
14774 #line 14774 "configure"
14775 #include "confdefs.h"
14776 /* System header to define __stub macros and hopefully few prototypes,
14777     which can conflict with char $ac_func (); below.  */
14778 #include <assert.h>
14779 /* Override any gcc2 internal prototype to avoid an error.  */
14780 #ifdef __cplusplus
14781 extern "C"
14782 #endif
14783 /* We use char because int might match the return type of a gcc2
14784    builtin and then its argument prototype would still apply.  */
14785 char $ac_func ();
14786 char (*f) ();
14787
14788 int
14789 main ()
14790 {
14791 /* The GNU C library defines this for functions which it implements
14792     to always fail with ENOSYS.  Some functions are actually named
14793     something starting with __ and the normal name is an alias.  */
14794 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14795 choke me
14796 #else
14797 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14798 #endif
14799
14800   ;
14801   return 0;
14802 }
14803 _ACEOF
14804 rm -f conftest.$ac_objext conftest$ac_exeext
14805 if { (eval echo "$as_me:14805: \"$ac_link\"") >&5
14806   (eval $ac_link) 2>&5
14807   ac_status=$?
14808   echo "$as_me:14808: \$? = $ac_status" >&5
14809   (exit $ac_status); } &&
14810          { ac_try='test -s conftest$ac_exeext'
14811   { (eval echo "$as_me:14811: \"$ac_try\"") >&5
14812   (eval $ac_try) 2>&5
14813   ac_status=$?
14814   echo "$as_me:14814: \$? = $ac_status" >&5
14815   (exit $ac_status); }; }; then
14816   eval "$as_ac_var=yes"
14817 else
14818   echo "$as_me: failed program was:" >&5
14819 cat conftest.$ac_ext >&5
14820 eval "$as_ac_var=no"
14821 fi
14822 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14823 fi
14824 echo "$as_me:14824: result: `eval echo '${'$as_ac_var'}'`" >&5
14825 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14826 if test `eval echo '${'$as_ac_var'}'` = yes; then
14827   cat >>confdefs.h <<EOF
14828 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14829 EOF
14830
14831 fi
14832 done
14833
14834 if test "x$ac_cv_func_getopt" = xno; then
14835         { { echo "$as_me:14835: error: getopt is required for building programs" >&5
14836 echo "$as_me: error: getopt is required for building programs" >&2;}
14837    { (exit 1); exit 1; }; }
14838 fi
14839
14840 if test "$cf_enable_widec" = yes; then
14841
14842 for ac_func in \
14843 mblen \
14844 mbrlen \
14845 mbrtowc \
14846 mbsrtowcs \
14847 mbstowcs \
14848 mbtowc \
14849 wcsrtombs \
14850 wcstombs \
14851
14852 do
14853 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14854 echo "$as_me:14854: checking for $ac_func" >&5
14855 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14856 if eval "test \"\${$as_ac_var+set}\" = set"; then
14857   echo $ECHO_N "(cached) $ECHO_C" >&6
14858 else
14859   cat >conftest.$ac_ext <<_ACEOF
14860 #line 14860 "configure"
14861 #include "confdefs.h"
14862 /* System header to define __stub macros and hopefully few prototypes,
14863     which can conflict with char $ac_func (); below.  */
14864 #include <assert.h>
14865 /* Override any gcc2 internal prototype to avoid an error.  */
14866 #ifdef __cplusplus
14867 extern "C"
14868 #endif
14869 /* We use char because int might match the return type of a gcc2
14870    builtin and then its argument prototype would still apply.  */
14871 char $ac_func ();
14872 char (*f) ();
14873
14874 int
14875 main ()
14876 {
14877 /* The GNU C library defines this for functions which it implements
14878     to always fail with ENOSYS.  Some functions are actually named
14879     something starting with __ and the normal name is an alias.  */
14880 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14881 choke me
14882 #else
14883 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14884 #endif
14885
14886   ;
14887   return 0;
14888 }
14889 _ACEOF
14890 rm -f conftest.$ac_objext conftest$ac_exeext
14891 if { (eval echo "$as_me:14891: \"$ac_link\"") >&5
14892   (eval $ac_link) 2>&5
14893   ac_status=$?
14894   echo "$as_me:14894: \$? = $ac_status" >&5
14895   (exit $ac_status); } &&
14896          { ac_try='test -s conftest$ac_exeext'
14897   { (eval echo "$as_me:14897: \"$ac_try\"") >&5
14898   (eval $ac_try) 2>&5
14899   ac_status=$?
14900   echo "$as_me:14900: \$? = $ac_status" >&5
14901   (exit $ac_status); }; }; then
14902   eval "$as_ac_var=yes"
14903 else
14904   echo "$as_me: failed program was:" >&5
14905 cat conftest.$ac_ext >&5
14906 eval "$as_ac_var=no"
14907 fi
14908 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14909 fi
14910 echo "$as_me:14910: result: `eval echo '${'$as_ac_var'}'`" >&5
14911 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14912 if test `eval echo '${'$as_ac_var'}'` = yes; then
14913   cat >>confdefs.h <<EOF
14914 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14915 EOF
14916
14917 fi
14918 done
14919
14920 fi
14921
14922 echo "$as_me:14922: checking definition to turn on extended curses functions" >&5
14923 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14924 if test "${cf_cv_need_xopen_extension+set}" = set; then
14925   echo $ECHO_N "(cached) $ECHO_C" >&6
14926 else
14927
14928 cf_cv_need_xopen_extension=unknown
14929 cat >conftest.$ac_ext <<_ACEOF
14930 #line 14930 "configure"
14931 #include "confdefs.h"
14932
14933 #include <stdlib.h>
14934 #include <${cf_cv_ncurses_header:-curses.h}>
14935 int
14936 main ()
14937 {
14938
14939 #if defined(NCURSES_VERSION_PATCH)
14940 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14941         make an error
14942 #endif
14943 #endif
14944 #ifdef NCURSES_VERSION
14945         cchar_t check;
14946         int check2 = curs_set((int)sizeof(check));
14947 #endif
14948         long x = winnstr(stdscr, "", 0);
14949         int x1, y1;
14950         getbegyx(stdscr, y1, x1)
14951   ;
14952   return 0;
14953 }
14954 _ACEOF
14955 rm -f conftest.$ac_objext conftest$ac_exeext
14956 if { (eval echo "$as_me:14956: \"$ac_link\"") >&5
14957   (eval $ac_link) 2>&5
14958   ac_status=$?
14959   echo "$as_me:14959: \$? = $ac_status" >&5
14960   (exit $ac_status); } &&
14961          { ac_try='test -s conftest$ac_exeext'
14962   { (eval echo "$as_me:14962: \"$ac_try\"") >&5
14963   (eval $ac_try) 2>&5
14964   ac_status=$?
14965   echo "$as_me:14965: \$? = $ac_status" >&5
14966   (exit $ac_status); }; }; then
14967   cf_cv_need_xopen_extension=none
14968 else
14969   echo "$as_me: failed program was:" >&5
14970 cat conftest.$ac_ext >&5
14971
14972         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14973         do
14974                 cat >conftest.$ac_ext <<_ACEOF
14975 #line 14975 "configure"
14976 #include "confdefs.h"
14977
14978 #define $cf_try_xopen_extension 1
14979 #include <stdlib.h>
14980 #include <${cf_cv_ncurses_header:-curses.h}>
14981 int
14982 main ()
14983 {
14984
14985 #ifdef NCURSES_VERSION
14986                 cchar_t check;
14987                 int check2 = curs_set((int)sizeof(check));
14988 #endif
14989                 long x = winnstr(stdscr, "", 0);
14990                 int x1, y1;
14991                 getbegyx(stdscr, y1, x1)
14992   ;
14993   return 0;
14994 }
14995 _ACEOF
14996 rm -f conftest.$ac_objext conftest$ac_exeext
14997 if { (eval echo "$as_me:14997: \"$ac_link\"") >&5
14998   (eval $ac_link) 2>&5
14999   ac_status=$?
15000   echo "$as_me:15000: \$? = $ac_status" >&5
15001   (exit $ac_status); } &&
15002          { ac_try='test -s conftest$ac_exeext'
15003   { (eval echo "$as_me:15003: \"$ac_try\"") >&5
15004   (eval $ac_try) 2>&5
15005   ac_status=$?
15006   echo "$as_me:15006: \$? = $ac_status" >&5
15007   (exit $ac_status); }; }; then
15008   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
15009 else
15010   echo "$as_me: failed program was:" >&5
15011 cat conftest.$ac_ext >&5
15012 fi
15013 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15014         done
15015
15016 fi
15017 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15018
15019 fi
15020 echo "$as_me:15020: result: $cf_cv_need_xopen_extension" >&5
15021 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
15022
15023 case $cf_cv_need_xopen_extension in
15024 (*_*)
15025         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
15026         ;;
15027 esac
15028
15029 echo "$as_me:15029: checking for term.h" >&5
15030 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
15031 if test "${cf_cv_term_header+set}" = set; then
15032   echo $ECHO_N "(cached) $ECHO_C" >&6
15033 else
15034
15035 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
15036 # for <term.h> if we do not find the variant.
15037
15038 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
15039
15040 case ${cf_cv_ncurses_header:-curses.h} in
15041 (*/*)
15042         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
15043         cf_header_list="$cf_header_item $cf_header_list"
15044         ;;
15045 esac
15046
15047 for cf_header in $cf_header_list
15048 do
15049         cat >conftest.$ac_ext <<_ACEOF
15050 #line 15050 "configure"
15051 #include "confdefs.h"
15052
15053 #include <${cf_cv_ncurses_header:-curses.h}>
15054 #include <${cf_header}>
15055 int
15056 main ()
15057 {
15058 WINDOW *x
15059   ;
15060   return 0;
15061 }
15062 _ACEOF
15063 rm -f conftest.$ac_objext
15064 if { (eval echo "$as_me:15064: \"$ac_compile\"") >&5
15065   (eval $ac_compile) 2>&5
15066   ac_status=$?
15067   echo "$as_me:15067: \$? = $ac_status" >&5
15068   (exit $ac_status); } &&
15069          { ac_try='test -s conftest.$ac_objext'
15070   { (eval echo "$as_me:15070: \"$ac_try\"") >&5
15071   (eval $ac_try) 2>&5
15072   ac_status=$?
15073   echo "$as_me:15073: \$? = $ac_status" >&5
15074   (exit $ac_status); }; }; then
15075   cf_cv_term_header=$cf_header
15076          break
15077 else
15078   echo "$as_me: failed program was:" >&5
15079 cat conftest.$ac_ext >&5
15080 cf_cv_term_header=no
15081 fi
15082 rm -f conftest.$ac_objext conftest.$ac_ext
15083 done
15084
15085 case $cf_cv_term_header in
15086 (no)
15087         # If curses is ncurses, some packagers still mess it up by trying to make
15088         # us use GNU termcap.  This handles the most common case.
15089         for cf_header in ncurses/term.h ncursesw/term.h
15090         do
15091                 cat >conftest.$ac_ext <<_ACEOF
15092 #line 15092 "configure"
15093 #include "confdefs.h"
15094
15095 #include <${cf_cv_ncurses_header:-curses.h}>
15096 #ifdef NCURSES_VERSION
15097 #include <${cf_header}>
15098 #else
15099 make an error
15100 #endif
15101 int
15102 main ()
15103 {
15104 WINDOW *x
15105   ;
15106   return 0;
15107 }
15108 _ACEOF
15109 rm -f conftest.$ac_objext
15110 if { (eval echo "$as_me:15110: \"$ac_compile\"") >&5
15111   (eval $ac_compile) 2>&5
15112   ac_status=$?
15113   echo "$as_me:15113: \$? = $ac_status" >&5
15114   (exit $ac_status); } &&
15115          { ac_try='test -s conftest.$ac_objext'
15116   { (eval echo "$as_me:15116: \"$ac_try\"") >&5
15117   (eval $ac_try) 2>&5
15118   ac_status=$?
15119   echo "$as_me:15119: \$? = $ac_status" >&5
15120   (exit $ac_status); }; }; then
15121   cf_cv_term_header=$cf_header
15122                          break
15123 else
15124   echo "$as_me: failed program was:" >&5
15125 cat conftest.$ac_ext >&5
15126 cf_cv_term_header=no
15127 fi
15128 rm -f conftest.$ac_objext conftest.$ac_ext
15129         done
15130         ;;
15131 esac
15132
15133 fi
15134 echo "$as_me:15134: result: $cf_cv_term_header" >&5
15135 echo "${ECHO_T}$cf_cv_term_header" >&6
15136
15137 case $cf_cv_term_header in
15138 (term.h)
15139
15140 cat >>confdefs.h <<\EOF
15141 #define HAVE_TERM_H 1
15142 EOF
15143
15144         ;;
15145 (ncurses/term.h)
15146
15147 cat >>confdefs.h <<\EOF
15148 #define HAVE_NCURSES_TERM_H 1
15149 EOF
15150
15151         ;;
15152 (ncursesw/term.h)
15153
15154 cat >>confdefs.h <<\EOF
15155 #define HAVE_NCURSESW_TERM_H 1
15156 EOF
15157
15158         ;;
15159 esac
15160
15161 echo "$as_me:15161: checking for unctrl.h" >&5
15162 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
15163 if test "${cf_cv_unctrl_header+set}" = set; then
15164   echo $ECHO_N "(cached) $ECHO_C" >&6
15165 else
15166
15167 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
15168 # for <unctrl.h> if we do not find the variant.
15169
15170 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
15171
15172 case ${cf_cv_ncurses_header:-curses.h} in
15173 (*/*)
15174         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
15175         cf_header_list="$cf_header_item $cf_header_list"
15176         ;;
15177 esac
15178
15179 for cf_header in $cf_header_list
15180 do
15181         cat >conftest.$ac_ext <<_ACEOF
15182 #line 15182 "configure"
15183 #include "confdefs.h"
15184
15185 #include <${cf_cv_ncurses_header:-curses.h}>
15186 #include <${cf_header}>
15187 int
15188 main ()
15189 {
15190 WINDOW *x
15191   ;
15192   return 0;
15193 }
15194 _ACEOF
15195 rm -f conftest.$ac_objext
15196 if { (eval echo "$as_me:15196: \"$ac_compile\"") >&5
15197   (eval $ac_compile) 2>&5
15198   ac_status=$?
15199   echo "$as_me:15199: \$? = $ac_status" >&5
15200   (exit $ac_status); } &&
15201          { ac_try='test -s conftest.$ac_objext'
15202   { (eval echo "$as_me:15202: \"$ac_try\"") >&5
15203   (eval $ac_try) 2>&5
15204   ac_status=$?
15205   echo "$as_me:15205: \$? = $ac_status" >&5
15206   (exit $ac_status); }; }; then
15207   cf_cv_unctrl_header=$cf_header
15208          break
15209 else
15210   echo "$as_me: failed program was:" >&5
15211 cat conftest.$ac_ext >&5
15212 cf_cv_unctrl_header=no
15213 fi
15214 rm -f conftest.$ac_objext conftest.$ac_ext
15215 done
15216
15217 fi
15218 echo "$as_me:15218: result: $cf_cv_unctrl_header" >&5
15219 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
15220
15221 case $cf_cv_unctrl_header in
15222 (no)
15223         { echo "$as_me:15223: WARNING: unctrl.h header not found" >&5
15224 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
15225         ;;
15226 esac
15227
15228 case $cf_cv_unctrl_header in
15229 (unctrl.h)
15230
15231 cat >>confdefs.h <<\EOF
15232 #define HAVE_UNCTRL_H 1
15233 EOF
15234
15235         ;;
15236 (ncurses/unctrl.h)
15237
15238 cat >>confdefs.h <<\EOF
15239 #define HAVE_NCURSES_UNCTRL_H 1
15240 EOF
15241
15242         ;;
15243 (ncursesw/unctrl.h)
15244
15245 cat >>confdefs.h <<\EOF
15246 #define HAVE_NCURSESW_UNCTRL_H 1
15247 EOF
15248
15249         ;;
15250 esac
15251
15252 for cf_func in \
15253 alloc_pair \
15254 assume_default_colors \
15255 chgat \
15256 color_set \
15257 filter \
15258 getbegx \
15259 getcurx \
15260 getmaxx \
15261 getnstr \
15262 getparx \
15263 getwin \
15264 mvvline \
15265 mvwvline \
15266 napms \
15267 putwin \
15268 resize_term \
15269 resizeterm \
15270 restartterm \
15271 ripoffline \
15272 scr_dump \
15273 setupterm \
15274 slk_color \
15275 slk_init \
15276 termattrs \
15277 tgetent \
15278 tigetnum \
15279 tigetstr \
15280 typeahead \
15281 use_default_colors \
15282 use_env \
15283 use_extended_names \
15284 use_screen \
15285 use_window \
15286 vid_puts \
15287 vidputs \
15288 vsscanf \
15289 vw_printw \
15290 wchgat \
15291 winsstr \
15292 wresize \
15293 wsyncdown \
15294
15295 do
15296
15297 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15298
15299         echo "$as_me:15299: checking for ${cf_func}" >&5
15300 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15301
15302 echo "${as_me:-configure}:15302: testing ${cf_func} ..." 1>&5
15303
15304         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15305   echo $ECHO_N "(cached) $ECHO_C" >&6
15306 else
15307
15308                 eval cf_result='$ac_cv_func_'$cf_func
15309                 if test ".$cf_result" != ".no"; then
15310                         cat >conftest.$ac_ext <<_ACEOF
15311 #line 15311 "configure"
15312 #include "confdefs.h"
15313
15314 #ifdef HAVE_XCURSES
15315 #include <xcurses.h>
15316 char * XCursesProgramName = "test";
15317 #else
15318 #include <${cf_cv_ncurses_header:-curses.h}>
15319 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15320 #include <ncursesw/term.h>
15321 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15322 #include <ncurses/term.h>
15323 #elif defined(HAVE_TERM_H)
15324 #include <term.h>
15325 #endif
15326 #endif
15327
15328 int
15329 main ()
15330 {
15331
15332 #ifndef ${cf_func}
15333 long foo = (long)(&${cf_func});
15334 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15335 if (foo + 1234 > 5678)
15336         ${cf_cv_main_return:-return}(foo);
15337 #endif
15338
15339   ;
15340   return 0;
15341 }
15342 _ACEOF
15343 rm -f conftest.$ac_objext conftest$ac_exeext
15344 if { (eval echo "$as_me:15344: \"$ac_link\"") >&5
15345   (eval $ac_link) 2>&5
15346   ac_status=$?
15347   echo "$as_me:15347: \$? = $ac_status" >&5
15348   (exit $ac_status); } &&
15349          { ac_try='test -s 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_result=yes
15356 else
15357   echo "$as_me: failed program was:" >&5
15358 cat conftest.$ac_ext >&5
15359 cf_result=no
15360 fi
15361 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15362                 fi
15363                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15364
15365 fi
15366
15367         # use the computed/retrieved cache-value:
15368         eval 'cf_result=$cf_cv_func_'$cf_func
15369         echo "$as_me:15369: result: $cf_result" >&5
15370 echo "${ECHO_T}$cf_result" >&6
15371         if test $cf_result != no; then
15372                 cat >>confdefs.h <<EOF
15373 #define HAVE_${cf_tr_func} 1
15374 EOF
15375
15376         fi
15377 done
15378
15379 for cf_func in tputs
15380 do
15381
15382 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15383
15384         echo "$as_me:15384: checking for ${cf_func}" >&5
15385 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15386
15387 echo "${as_me:-configure}:15387: testing ${cf_func} ..." 1>&5
15388
15389         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15390   echo $ECHO_N "(cached) $ECHO_C" >&6
15391 else
15392
15393                 eval cf_result='$ac_cv_func_'$cf_func
15394                 if test ".$cf_result" != ".no"; then
15395                         cat >conftest.$ac_ext <<_ACEOF
15396 #line 15396 "configure"
15397 #include "confdefs.h"
15398
15399 #ifdef HAVE_XCURSES
15400 #include <xcurses.h>
15401 char * XCursesProgramName = "test";
15402 #else
15403 #include <${cf_cv_ncurses_header:-curses.h}>
15404 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15405 #include <ncursesw/term.h>
15406 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15407 #include <ncurses/term.h>
15408 #elif defined(HAVE_TERM_H)
15409 #include <term.h>
15410 #endif
15411 #endif
15412
15413 int
15414 main ()
15415 {
15416
15417 #ifndef ${cf_func}
15418 long foo = (long)(&${cf_func});
15419 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15420 if (foo + 1234 > 5678)
15421         ${cf_cv_main_return:-return}(foo);
15422 #endif
15423
15424   ;
15425   return 0;
15426 }
15427 _ACEOF
15428 rm -f conftest.$ac_objext conftest$ac_exeext
15429 if { (eval echo "$as_me:15429: \"$ac_link\"") >&5
15430   (eval $ac_link) 2>&5
15431   ac_status=$?
15432   echo "$as_me:15432: \$? = $ac_status" >&5
15433   (exit $ac_status); } &&
15434          { ac_try='test -s conftest$ac_exeext'
15435   { (eval echo "$as_me:15435: \"$ac_try\"") >&5
15436   (eval $ac_try) 2>&5
15437   ac_status=$?
15438   echo "$as_me:15438: \$? = $ac_status" >&5
15439   (exit $ac_status); }; }; then
15440   cf_result=yes
15441 else
15442   echo "$as_me: failed program was:" >&5
15443 cat conftest.$ac_ext >&5
15444 cf_result=no
15445 fi
15446 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15447                 fi
15448                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15449
15450 fi
15451
15452         # use the computed/retrieved cache-value:
15453         eval 'cf_result=$cf_cv_func_'$cf_func
15454         echo "$as_me:15454: result: $cf_result" >&5
15455 echo "${ECHO_T}$cf_result" >&6
15456         if test $cf_result != no; then
15457                 cat >>confdefs.h <<EOF
15458 #define HAVE_${cf_tr_func} 1
15459 EOF
15460
15461         fi
15462 done
15463
15464 if test x$cf_cv_func_tputs = xyes
15465 then
15466         cf_done=no
15467         for cf_arg in int char
15468         do
15469                 for cf_ret in int void
15470                 do
15471                         if test $cf_ret = void
15472                         then
15473                                 cf_return="/* nothing */"
15474                         else
15475                                 cf_return="return value"
15476                         fi
15477                         cat >conftest.$ac_ext <<_ACEOF
15478 #line 15478 "configure"
15479 #include "confdefs.h"
15480
15481 #include <${cf_cv_ncurses_header:-curses.h}>
15482 #include <$cf_cv_term_header>
15483
15484 static $cf_ret outc($cf_arg value) { $cf_return; }
15485
15486 int
15487 main ()
15488 {
15489
15490         tputs("hello", 0, outc);
15491         ${cf_cv_main_return:-return}(0);
15492
15493   ;
15494   return 0;
15495 }
15496 _ACEOF
15497 rm -f conftest.$ac_objext
15498 if { (eval echo "$as_me:15498: \"$ac_compile\"") >&5
15499   (eval $ac_compile) 2>&5
15500   ac_status=$?
15501   echo "$as_me:15501: \$? = $ac_status" >&5
15502   (exit $ac_status); } &&
15503          { ac_try='test -s conftest.$ac_objext'
15504   { (eval echo "$as_me:15504: \"$ac_try\"") >&5
15505   (eval $ac_try) 2>&5
15506   ac_status=$?
15507   echo "$as_me:15507: \$? = $ac_status" >&5
15508   (exit $ac_status); }; }; then
15509
15510                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
15511
15512 echo "${as_me:-configure}:15512: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
15513
15514                 cat >>confdefs.h <<EOF
15515 #define TPUTS_ARG               $cf_arg
15516 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
15517 #define TPUTS_RETURN(value)     $cf_return
15518 EOF
15519                 cf_done=yes
15520                 break
15521
15522 else
15523   echo "$as_me: failed program was:" >&5
15524 cat conftest.$ac_ext >&5
15525 fi
15526 rm -f conftest.$ac_objext conftest.$ac_ext
15527                 done
15528                 test $cf_done = yes && break
15529         done
15530 fi
15531
15532 echo "$as_me:15532: checking for ncurses extended functions" >&5
15533 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
15534 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
15535   echo $ECHO_N "(cached) $ECHO_C" >&6
15536 else
15537
15538 cat >conftest.$ac_ext <<_ACEOF
15539 #line 15539 "configure"
15540 #include "confdefs.h"
15541
15542 #include <${cf_cv_ncurses_header:-curses.h}>
15543 int
15544 main ()
15545 {
15546
15547 int x = NCURSES_EXT_FUNCS
15548
15549   ;
15550   return 0;
15551 }
15552 _ACEOF
15553 rm -f conftest.$ac_objext
15554 if { (eval echo "$as_me:15554: \"$ac_compile\"") >&5
15555   (eval $ac_compile) 2>&5
15556   ac_status=$?
15557   echo "$as_me:15557: \$? = $ac_status" >&5
15558   (exit $ac_status); } &&
15559          { ac_try='test -s conftest.$ac_objext'
15560   { (eval echo "$as_me:15560: \"$ac_try\"") >&5
15561   (eval $ac_try) 2>&5
15562   ac_status=$?
15563   echo "$as_me:15563: \$? = $ac_status" >&5
15564   (exit $ac_status); }; }; then
15565   cf_cv_ncurses_ext_funcs=defined
15566 else
15567   echo "$as_me: failed program was:" >&5
15568 cat conftest.$ac_ext >&5
15569
15570 cat >conftest.$ac_ext <<_ACEOF
15571 #line 15571 "configure"
15572 #include "confdefs.h"
15573
15574 #include <${cf_cv_ncurses_header:-curses.h}>
15575 int
15576 main ()
15577 {
15578
15579         (void) assume_default_colors (0, 0);
15580         (void) curses_version ();
15581         (void) define_key (0, 0);
15582         (void) is_term_resized (0, 0);
15583         (void) key_defined (0);
15584         (void) keybound (0, 0);
15585         (void) keyok (0, 0);
15586         (void) resize_term (0, 0);
15587         (void) resizeterm (0, 0);
15588         (void) use_default_colors ();
15589         (void) use_extended_names (0);
15590         (void) wresize (0, 0, 0);
15591   ;
15592   return 0;
15593 }
15594 _ACEOF
15595 rm -f conftest.$ac_objext conftest$ac_exeext
15596 if { (eval echo "$as_me:15596: \"$ac_link\"") >&5
15597   (eval $ac_link) 2>&5
15598   ac_status=$?
15599   echo "$as_me:15599: \$? = $ac_status" >&5
15600   (exit $ac_status); } &&
15601          { ac_try='test -s conftest$ac_exeext'
15602   { (eval echo "$as_me:15602: \"$ac_try\"") >&5
15603   (eval $ac_try) 2>&5
15604   ac_status=$?
15605   echo "$as_me:15605: \$? = $ac_status" >&5
15606   (exit $ac_status); }; }; then
15607   cf_cv_ncurses_ext_funcs=yes
15608 else
15609   echo "$as_me: failed program was:" >&5
15610 cat conftest.$ac_ext >&5
15611 cf_cv_ncurses_ext_funcs=no
15612 fi
15613 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15614
15615 fi
15616 rm -f conftest.$ac_objext conftest.$ac_ext
15617
15618 fi
15619 echo "$as_me:15619: result: $cf_cv_ncurses_ext_funcs" >&5
15620 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
15621 test "$cf_cv_ncurses_ext_funcs" = yes &&
15622 cat >>confdefs.h <<\EOF
15623 #define NCURSES_EXT_FUNCS 1
15624 EOF
15625
15626 if test "$cf_enable_widec" = yes
15627 then
15628         # workaround for systems with ncurses before 20111029, due to change of
15629         # feature test macro from _XPG5 to _XOPEN_SOURCE
15630         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
15631         then
15632                 cf_define_xpg5=no
15633                 echo "$as_me:15633: checking if _XPG5 should be defined to enable wide-characters" >&5
15634 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
15635
15636                 cat >conftest.$ac_ext <<_ACEOF
15637 #line 15637 "configure"
15638 #include "confdefs.h"
15639
15640 #include <${cf_cv_ncurses_header:-curses.h}>
15641 int
15642 main ()
15643 {
15644 int x = _XPG5
15645   ;
15646   return 0;
15647 }
15648 _ACEOF
15649 rm -f conftest.$ac_objext
15650 if { (eval echo "$as_me:15650: \"$ac_compile\"") >&5
15651   (eval $ac_compile) 2>&5
15652   ac_status=$?
15653   echo "$as_me:15653: \$? = $ac_status" >&5
15654   (exit $ac_status); } &&
15655          { ac_try='test -s conftest.$ac_objext'
15656   { (eval echo "$as_me:15656: \"$ac_try\"") >&5
15657   (eval $ac_try) 2>&5
15658   ac_status=$?
15659   echo "$as_me:15659: \$? = $ac_status" >&5
15660   (exit $ac_status); }; }; then
15661   :
15662 else
15663   echo "$as_me: failed program was:" >&5
15664 cat conftest.$ac_ext >&5
15665 cf_save_cppflags="$CPPFLAGS"
15666                          CPPFLAGS="$CPPFLAGS -D_XPG5"
15667                          cat >conftest.$ac_ext <<_ACEOF
15668 #line 15668 "configure"
15669 #include "confdefs.h"
15670
15671 #include <${cf_cv_ncurses_header:-curses.h}>
15672 int
15673 main ()
15674 {
15675 int x = _XPG5
15676   ;
15677   return 0;
15678 }
15679 _ACEOF
15680 rm -f conftest.$ac_objext
15681 if { (eval echo "$as_me:15681: \"$ac_compile\"") >&5
15682   (eval $ac_compile) 2>&5
15683   ac_status=$?
15684   echo "$as_me:15684: \$? = $ac_status" >&5
15685   (exit $ac_status); } &&
15686          { ac_try='test -s conftest.$ac_objext'
15687   { (eval echo "$as_me:15687: \"$ac_try\"") >&5
15688   (eval $ac_try) 2>&5
15689   ac_status=$?
15690   echo "$as_me:15690: \$? = $ac_status" >&5
15691   (exit $ac_status); }; }; then
15692   cf_define_xpg5=yes
15693 else
15694   echo "$as_me: failed program was:" >&5
15695 cat conftest.$ac_ext >&5
15696 fi
15697 rm -f conftest.$ac_objext conftest.$ac_ext
15698                          CPPFLAGS="$cf_save_cppflags"
15699 fi
15700 rm -f conftest.$ac_objext conftest.$ac_ext
15701                 echo "$as_me:15701: result: $cf_define_xpg5" >&5
15702 echo "${ECHO_T}$cf_define_xpg5" >&6
15703
15704                 if test "$cf_define_xpg5" = yes
15705                 then
15706                         CPPFLAGS="$CPPFLAGS -D_XPG5"
15707                 fi
15708         fi
15709
15710         echo "$as_me:15710: checking for wide-character functions" >&5
15711 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
15712 if test "${cf_cv_widechar_funcs+set}" = set; then
15713   echo $ECHO_N "(cached) $ECHO_C" >&6
15714 else
15715
15716         cat >conftest.$ac_ext <<_ACEOF
15717 #line 15717 "configure"
15718 #include "confdefs.h"
15719
15720 #include <${cf_cv_ncurses_header:-curses.h}>
15721 int
15722 main ()
15723 {
15724
15725                 static wchar_t src_wchar[2];
15726                 static cchar_t dst_cchar;
15727                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15728
15729   ;
15730   return 0;
15731 }
15732 _ACEOF
15733 rm -f conftest.$ac_objext conftest$ac_exeext
15734 if { (eval echo "$as_me:15734: \"$ac_link\"") >&5
15735   (eval $ac_link) 2>&5
15736   ac_status=$?
15737   echo "$as_me:15737: \$? = $ac_status" >&5
15738   (exit $ac_status); } &&
15739          { ac_try='test -s conftest$ac_exeext'
15740   { (eval echo "$as_me:15740: \"$ac_try\"") >&5
15741   (eval $ac_try) 2>&5
15742   ac_status=$?
15743   echo "$as_me:15743: \$? = $ac_status" >&5
15744   (exit $ac_status); }; }; then
15745   cf_cv_widechar_funcs=yes
15746 else
15747   echo "$as_me: failed program was:" >&5
15748 cat conftest.$ac_ext >&5
15749 cf_cv_widechar_funcs=no
15750 fi
15751 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15752
15753 fi
15754 echo "$as_me:15754: result: $cf_cv_widechar_funcs" >&5
15755 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15756         if test "$cf_cv_widechar_funcs" != no ; then
15757
15758 cat >>confdefs.h <<\EOF
15759 #define USE_WIDEC_SUPPORT 1
15760 EOF
15761
15762         else
15763                 cat >>confdefs.h <<\EOF
15764 #define USE_WIDEC_SUPPORT 0
15765 EOF
15766
15767         fi
15768 else
15769         cat >>confdefs.h <<\EOF
15770 #define USE_WIDEC_SUPPORT 0
15771 EOF
15772
15773 fi
15774
15775 echo "$as_me:15775: checking if $cf_cv_screen library uses pthreads" >&5
15776 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15777 if test "${cf_cv_use_pthreads+set}" = set; then
15778   echo $ECHO_N "(cached) $ECHO_C" >&6
15779 else
15780
15781 cat >conftest.$ac_ext <<_ACEOF
15782 #line 15782 "configure"
15783 #include "confdefs.h"
15784
15785 #include <${cf_cv_ncurses_header:-curses.h}>
15786 extern void _nc_init_pthreads(void);
15787
15788 int
15789 main ()
15790 {
15791
15792         initscr();
15793         _nc_init_pthreads();
15794
15795   ;
15796   return 0;
15797 }
15798 _ACEOF
15799 rm -f conftest.$ac_objext conftest$ac_exeext
15800 if { (eval echo "$as_me:15800: \"$ac_link\"") >&5
15801   (eval $ac_link) 2>&5
15802   ac_status=$?
15803   echo "$as_me:15803: \$? = $ac_status" >&5
15804   (exit $ac_status); } &&
15805          { ac_try='test -s conftest$ac_exeext'
15806   { (eval echo "$as_me:15806: \"$ac_try\"") >&5
15807   (eval $ac_try) 2>&5
15808   ac_status=$?
15809   echo "$as_me:15809: \$? = $ac_status" >&5
15810   (exit $ac_status); }; }; then
15811   cf_cv_use_pthreads=yes
15812 else
15813   echo "$as_me: failed program was:" >&5
15814 cat conftest.$ac_ext >&5
15815 cf_cv_use_pthreads=no
15816 fi
15817 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15818
15819 fi
15820 echo "$as_me:15820: result: $cf_cv_use_pthreads" >&5
15821 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
15822 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
15823 #define USE_PTHREADS 1
15824 EOF
15825
15826 echo "$as_me:15826: checking if sys/time.h works with sys/select.h" >&5
15827 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
15828 if test "${cf_cv_sys_time_select+set}" = set; then
15829   echo $ECHO_N "(cached) $ECHO_C" >&6
15830 else
15831
15832 cat >conftest.$ac_ext <<_ACEOF
15833 #line 15833 "configure"
15834 #include "confdefs.h"
15835
15836 #include <sys/types.h>
15837 #ifdef HAVE_SYS_TIME_H
15838 #include <sys/time.h>
15839 #endif
15840 #ifdef HAVE_SYS_SELECT_H
15841 #include <sys/select.h>
15842 #endif
15843
15844 int
15845 main ()
15846 {
15847
15848   ;
15849   return 0;
15850 }
15851 _ACEOF
15852 rm -f conftest.$ac_objext
15853 if { (eval echo "$as_me:15853: \"$ac_compile\"") >&5
15854   (eval $ac_compile) 2>&5
15855   ac_status=$?
15856   echo "$as_me:15856: \$? = $ac_status" >&5
15857   (exit $ac_status); } &&
15858          { ac_try='test -s conftest.$ac_objext'
15859   { (eval echo "$as_me:15859: \"$ac_try\"") >&5
15860   (eval $ac_try) 2>&5
15861   ac_status=$?
15862   echo "$as_me:15862: \$? = $ac_status" >&5
15863   (exit $ac_status); }; }; then
15864   cf_cv_sys_time_select=yes
15865 else
15866   echo "$as_me: failed program was:" >&5
15867 cat conftest.$ac_ext >&5
15868 cf_cv_sys_time_select=no
15869 fi
15870 rm -f conftest.$ac_objext conftest.$ac_ext
15871
15872 fi
15873
15874 echo "$as_me:15874: result: $cf_cv_sys_time_select" >&5
15875 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
15876 test "$cf_cv_sys_time_select" = yes &&
15877 cat >>confdefs.h <<\EOF
15878 #define HAVE_SYS_TIME_SELECT 1
15879 EOF
15880
15881 # special check for test/ditto.c
15882
15883 echo "$as_me:15883: checking for openpty in -lutil" >&5
15884 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
15885 if test "${ac_cv_lib_util_openpty+set}" = set; then
15886   echo $ECHO_N "(cached) $ECHO_C" >&6
15887 else
15888   ac_check_lib_save_LIBS=$LIBS
15889 LIBS="-lutil  $LIBS"
15890 cat >conftest.$ac_ext <<_ACEOF
15891 #line 15891 "configure"
15892 #include "confdefs.h"
15893
15894 /* Override any gcc2 internal prototype to avoid an error.  */
15895 #ifdef __cplusplus
15896 extern "C"
15897 #endif
15898 /* We use char because int might match the return type of a gcc2
15899    builtin and then its argument prototype would still apply.  */
15900 char openpty ();
15901 int
15902 main ()
15903 {
15904 openpty ();
15905   ;
15906   return 0;
15907 }
15908 _ACEOF
15909 rm -f conftest.$ac_objext conftest$ac_exeext
15910 if { (eval echo "$as_me:15910: \"$ac_link\"") >&5
15911   (eval $ac_link) 2>&5
15912   ac_status=$?
15913   echo "$as_me:15913: \$? = $ac_status" >&5
15914   (exit $ac_status); } &&
15915          { ac_try='test -s conftest$ac_exeext'
15916   { (eval echo "$as_me:15916: \"$ac_try\"") >&5
15917   (eval $ac_try) 2>&5
15918   ac_status=$?
15919   echo "$as_me:15919: \$? = $ac_status" >&5
15920   (exit $ac_status); }; }; then
15921   ac_cv_lib_util_openpty=yes
15922 else
15923   echo "$as_me: failed program was:" >&5
15924 cat conftest.$ac_ext >&5
15925 ac_cv_lib_util_openpty=no
15926 fi
15927 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15928 LIBS=$ac_check_lib_save_LIBS
15929 fi
15930 echo "$as_me:15930: result: $ac_cv_lib_util_openpty" >&5
15931 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15932 if test $ac_cv_lib_util_openpty = yes; then
15933   cf_cv_lib_util=yes
15934 else
15935   cf_cv_lib_util=no
15936 fi
15937
15938 echo "$as_me:15938: checking for openpty header" >&5
15939 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15940 if test "${cf_cv_func_openpty+set}" = set; then
15941   echo $ECHO_N "(cached) $ECHO_C" >&6
15942 else
15943
15944         cf_save_LIBS="$LIBS"
15945         test $cf_cv_lib_util = yes && {
15946 cf_add_libs="-lutil"
15947 # Filter out duplicates - this happens with badly-designed ".pc" files...
15948 for cf_add_1lib in $LIBS
15949 do
15950         for cf_add_2lib in $cf_add_libs
15951         do
15952                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15953                 then
15954                         cf_add_1lib=
15955                         break
15956                 fi
15957         done
15958         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15959 done
15960 LIBS="$cf_add_libs"
15961  }
15962         for cf_header in pty.h libutil.h util.h
15963         do
15964         cat >conftest.$ac_ext <<_ACEOF
15965 #line 15965 "configure"
15966 #include "confdefs.h"
15967
15968 #include <$cf_header>
15969
15970 int
15971 main ()
15972 {
15973
15974         int x = openpty((int *)0, (int *)0, (char *)0,
15975                                    (struct termios *)0, (struct winsize *)0);
15976
15977   ;
15978   return 0;
15979 }
15980 _ACEOF
15981 rm -f conftest.$ac_objext conftest$ac_exeext
15982 if { (eval echo "$as_me:15982: \"$ac_link\"") >&5
15983   (eval $ac_link) 2>&5
15984   ac_status=$?
15985   echo "$as_me:15985: \$? = $ac_status" >&5
15986   (exit $ac_status); } &&
15987          { ac_try='test -s conftest$ac_exeext'
15988   { (eval echo "$as_me:15988: \"$ac_try\"") >&5
15989   (eval $ac_try) 2>&5
15990   ac_status=$?
15991   echo "$as_me:15991: \$? = $ac_status" >&5
15992   (exit $ac_status); }; }; then
15993
15994                 cf_cv_func_openpty=$cf_header
15995                 break
15996
15997 else
15998   echo "$as_me: failed program was:" >&5
15999 cat conftest.$ac_ext >&5
16000
16001                 cf_cv_func_openpty=no
16002
16003 fi
16004 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16005         done
16006         LIBS="$cf_save_LIBS"
16007
16008 fi
16009 echo "$as_me:16009: result: $cf_cv_func_openpty" >&5
16010 echo "${ECHO_T}$cf_cv_func_openpty" >&6
16011
16012 if test "$cf_cv_func_openpty" != no ; then
16013
16014 cat >>confdefs.h <<EOF
16015 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
16016 EOF
16017
16018 cat >>confdefs.h <<\EOF
16019 #define USE_XTERM_PTY 1
16020 EOF
16021
16022         if test "x$cf_cv_lib_util" = xyes ; then
16023
16024 cf_add_libs="-lutil"
16025 # Filter out duplicates - this happens with badly-designed ".pc" files...
16026 for cf_add_1lib in $TEST_LIBS
16027 do
16028         for cf_add_2lib in $cf_add_libs
16029         do
16030                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16031                 then
16032                         cf_add_1lib=
16033                         break
16034                 fi
16035         done
16036         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16037 done
16038 TEST_LIBS="$cf_add_libs"
16039
16040         fi
16041 fi
16042
16043 echo "$as_me:16043: checking for function curses_version" >&5
16044 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
16045 if test "${cf_cv_func_curses_version+set}" = set; then
16046   echo $ECHO_N "(cached) $ECHO_C" >&6
16047 else
16048
16049 if test "$cross_compiling" = yes; then
16050   cf_cv_func_curses_version=unknown
16051 else
16052   cat >conftest.$ac_ext <<_ACEOF
16053 #line 16053 "configure"
16054 #include "confdefs.h"
16055
16056 #include <${cf_cv_ncurses_header:-curses.h}>
16057 int main()
16058 {
16059         char temp[1024];
16060         sprintf(temp, "%s\n", curses_version());
16061         ${cf_cv_main_return:-return}(0);
16062 }
16063
16064 _ACEOF
16065 rm -f conftest$ac_exeext
16066 if { (eval echo "$as_me:16066: \"$ac_link\"") >&5
16067   (eval $ac_link) 2>&5
16068   ac_status=$?
16069   echo "$as_me:16069: \$? = $ac_status" >&5
16070   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16071   { (eval echo "$as_me:16071: \"$ac_try\"") >&5
16072   (eval $ac_try) 2>&5
16073   ac_status=$?
16074   echo "$as_me:16074: \$? = $ac_status" >&5
16075   (exit $ac_status); }; }; then
16076   cf_cv_func_curses_version=yes
16077
16078 else
16079   echo "$as_me: program exited with status $ac_status" >&5
16080 echo "$as_me: failed program was:" >&5
16081 cat conftest.$ac_ext >&5
16082 cf_cv_func_curses_version=no
16083
16084 fi
16085 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16086 fi
16087 rm -f core
16088 fi
16089 echo "$as_me:16089: result: $cf_cv_func_curses_version" >&5
16090 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
16091 test "$cf_cv_func_curses_version" = yes &&
16092 cat >>confdefs.h <<\EOF
16093 #define HAVE_CURSES_VERSION 1
16094 EOF
16095
16096 echo "$as_me:16096: checking for alternate character set array" >&5
16097 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
16098 if test "${cf_cv_curses_acs_map+set}" = set; then
16099   echo $ECHO_N "(cached) $ECHO_C" >&6
16100 else
16101
16102 cf_cv_curses_acs_map=unknown
16103 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
16104 do
16105 cat >conftest.$ac_ext <<_ACEOF
16106 #line 16106 "configure"
16107 #include "confdefs.h"
16108
16109 #include <${cf_cv_ncurses_header:-curses.h}>
16110
16111 int
16112 main ()
16113 {
16114
16115 $name['k'] = ACS_PLUS
16116
16117   ;
16118   return 0;
16119 }
16120 _ACEOF
16121 rm -f conftest.$ac_objext conftest$ac_exeext
16122 if { (eval echo "$as_me:16122: \"$ac_link\"") >&5
16123   (eval $ac_link) 2>&5
16124   ac_status=$?
16125   echo "$as_me:16125: \$? = $ac_status" >&5
16126   (exit $ac_status); } &&
16127          { ac_try='test -s conftest$ac_exeext'
16128   { (eval echo "$as_me:16128: \"$ac_try\"") >&5
16129   (eval $ac_try) 2>&5
16130   ac_status=$?
16131   echo "$as_me:16131: \$? = $ac_status" >&5
16132   (exit $ac_status); }; }; then
16133   cf_cv_curses_acs_map=$name; break
16134 else
16135   echo "$as_me: failed program was:" >&5
16136 cat conftest.$ac_ext >&5
16137 fi
16138 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16139 done
16140
16141 fi
16142 echo "$as_me:16142: result: $cf_cv_curses_acs_map" >&5
16143 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
16144
16145 test "$cf_cv_curses_acs_map" != unknown &&
16146 cat >>confdefs.h <<EOF
16147 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
16148 EOF
16149
16150 if test "$cf_enable_widec" = yes; then
16151
16152 echo "$as_me:16152: checking for wide alternate character set array" >&5
16153 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
16154 if test "${cf_cv_curses_wacs_map+set}" = set; then
16155   echo $ECHO_N "(cached) $ECHO_C" >&6
16156 else
16157
16158         cf_cv_curses_wacs_map=unknown
16159         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
16160         do
16161         cat >conftest.$ac_ext <<_ACEOF
16162 #line 16162 "configure"
16163 #include "confdefs.h"
16164
16165 #ifndef _XOPEN_SOURCE_EXTENDED
16166 #define _XOPEN_SOURCE_EXTENDED
16167 #endif
16168 #include <${cf_cv_ncurses_header:-curses.h}>
16169 int
16170 main ()
16171 {
16172 void *foo = &($name['k'])
16173   ;
16174   return 0;
16175 }
16176 _ACEOF
16177 rm -f conftest.$ac_objext conftest$ac_exeext
16178 if { (eval echo "$as_me:16178: \"$ac_link\"") >&5
16179   (eval $ac_link) 2>&5
16180   ac_status=$?
16181   echo "$as_me:16181: \$? = $ac_status" >&5
16182   (exit $ac_status); } &&
16183          { ac_try='test -s conftest$ac_exeext'
16184   { (eval echo "$as_me:16184: \"$ac_try\"") >&5
16185   (eval $ac_try) 2>&5
16186   ac_status=$?
16187   echo "$as_me:16187: \$? = $ac_status" >&5
16188   (exit $ac_status); }; }; then
16189   cf_cv_curses_wacs_map=$name
16190          break
16191 else
16192   echo "$as_me: failed program was:" >&5
16193 cat conftest.$ac_ext >&5
16194 fi
16195 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16196         done
16197 fi
16198 echo "$as_me:16198: result: $cf_cv_curses_wacs_map" >&5
16199 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
16200
16201 test "$cf_cv_curses_wacs_map" != unknown &&
16202 cat >>confdefs.h <<EOF
16203 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
16204 EOF
16205
16206 echo "$as_me:16206: checking for wide alternate character constants" >&5
16207 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
16208 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
16209   echo $ECHO_N "(cached) $ECHO_C" >&6
16210 else
16211
16212 cf_cv_curses_wacs_symbols=no
16213 if test "$cf_cv_curses_wacs_map" != unknown
16214 then
16215         cat >conftest.$ac_ext <<_ACEOF
16216 #line 16216 "configure"
16217 #include "confdefs.h"
16218
16219 #ifndef _XOPEN_SOURCE_EXTENDED
16220 #define _XOPEN_SOURCE_EXTENDED
16221 #endif
16222 #include <${cf_cv_ncurses_header:-curses.h}>
16223 int
16224 main ()
16225 {
16226 cchar_t *foo = WACS_PLUS;
16227          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
16228   ;
16229   return 0;
16230 }
16231 _ACEOF
16232 rm -f conftest.$ac_objext conftest$ac_exeext
16233 if { (eval echo "$as_me:16233: \"$ac_link\"") >&5
16234   (eval $ac_link) 2>&5
16235   ac_status=$?
16236   echo "$as_me:16236: \$? = $ac_status" >&5
16237   (exit $ac_status); } &&
16238          { ac_try='test -s conftest$ac_exeext'
16239   { (eval echo "$as_me:16239: \"$ac_try\"") >&5
16240   (eval $ac_try) 2>&5
16241   ac_status=$?
16242   echo "$as_me:16242: \$? = $ac_status" >&5
16243   (exit $ac_status); }; }; then
16244   cf_cv_curses_wacs_symbols=yes
16245 else
16246   echo "$as_me: failed program was:" >&5
16247 cat conftest.$ac_ext >&5
16248 fi
16249 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16250 else
16251         cat >conftest.$ac_ext <<_ACEOF
16252 #line 16252 "configure"
16253 #include "confdefs.h"
16254
16255 #ifndef _XOPEN_SOURCE_EXTENDED
16256 #define _XOPEN_SOURCE_EXTENDED
16257 #endif
16258 #include <${cf_cv_ncurses_header:-curses.h}>
16259 int
16260 main ()
16261 {
16262 cchar_t *foo = WACS_PLUS
16263   ;
16264   return 0;
16265 }
16266 _ACEOF
16267 rm -f conftest.$ac_objext conftest$ac_exeext
16268 if { (eval echo "$as_me:16268: \"$ac_link\"") >&5
16269   (eval $ac_link) 2>&5
16270   ac_status=$?
16271   echo "$as_me:16271: \$? = $ac_status" >&5
16272   (exit $ac_status); } &&
16273          { ac_try='test -s conftest$ac_exeext'
16274   { (eval echo "$as_me:16274: \"$ac_try\"") >&5
16275   (eval $ac_try) 2>&5
16276   ac_status=$?
16277   echo "$as_me:16277: \$? = $ac_status" >&5
16278   (exit $ac_status); }; }; then
16279   cf_cv_curses_wacs_symbols=yes
16280 else
16281   echo "$as_me: failed program was:" >&5
16282 cat conftest.$ac_ext >&5
16283 fi
16284 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16285 fi
16286
16287 fi
16288 echo "$as_me:16288: result: $cf_cv_curses_wacs_symbols" >&5
16289 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
16290
16291 test "$cf_cv_curses_wacs_symbols" != no &&
16292 cat >>confdefs.h <<\EOF
16293 #define CURSES_WACS_SYMBOLS 1
16294 EOF
16295
16296 fi
16297
16298 echo "$as_me:16298: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16299 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16300 cat >conftest.$ac_ext <<_ACEOF
16301 #line 16301 "configure"
16302 #include "confdefs.h"
16303
16304 #ifndef _XOPEN_SOURCE_EXTENDED
16305 #define _XOPEN_SOURCE_EXTENDED
16306 #endif
16307 #include <${cf_cv_ncurses_header:-curses.h}>
16308 int
16309 main ()
16310 {
16311
16312 attr_t foo
16313
16314   ;
16315   return 0;
16316 }
16317 _ACEOF
16318 rm -f conftest.$ac_objext
16319 if { (eval echo "$as_me:16319: \"$ac_compile\"") >&5
16320   (eval $ac_compile) 2>&5
16321   ac_status=$?
16322   echo "$as_me:16322: \$? = $ac_status" >&5
16323   (exit $ac_status); } &&
16324          { ac_try='test -s conftest.$ac_objext'
16325   { (eval echo "$as_me:16325: \"$ac_try\"") >&5
16326   (eval $ac_try) 2>&5
16327   ac_status=$?
16328   echo "$as_me:16328: \$? = $ac_status" >&5
16329   (exit $ac_status); }; }; then
16330   cf_result=yes
16331 else
16332   echo "$as_me: failed program was:" >&5
16333 cat conftest.$ac_ext >&5
16334 cf_result=no
16335 fi
16336 rm -f conftest.$ac_objext conftest.$ac_ext
16337 echo "$as_me:16337: result: $cf_result" >&5
16338 echo "${ECHO_T}$cf_result" >&6
16339 if test $cf_result = yes ; then
16340
16341 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16342
16343 cat >>confdefs.h <<EOF
16344 #define $cf_result 1
16345 EOF
16346
16347 else
16348
16349 cat >>confdefs.h <<EOF
16350 #define attr_t long
16351 EOF
16352
16353 fi
16354
16355 if test "$cf_enable_widec" = yes; then
16356
16357 # This is needed on Tru64 5.0 to declare mbstate_t
16358 echo "$as_me:16358: checking if we must include wchar.h to declare mbstate_t" >&5
16359 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
16360 if test "${cf_cv_mbstate_t+set}" = set; then
16361   echo $ECHO_N "(cached) $ECHO_C" >&6
16362 else
16363
16364 cat >conftest.$ac_ext <<_ACEOF
16365 #line 16365 "configure"
16366 #include "confdefs.h"
16367
16368 #include <stdlib.h>
16369 #include <stdarg.h>
16370 #include <stdio.h>
16371 #ifdef HAVE_LIBUTF8_H
16372 #include <libutf8.h>
16373 #endif
16374 int
16375 main ()
16376 {
16377 mbstate_t state
16378   ;
16379   return 0;
16380 }
16381 _ACEOF
16382 rm -f conftest.$ac_objext
16383 if { (eval echo "$as_me:16383: \"$ac_compile\"") >&5
16384   (eval $ac_compile) 2>&5
16385   ac_status=$?
16386   echo "$as_me:16386: \$? = $ac_status" >&5
16387   (exit $ac_status); } &&
16388          { ac_try='test -s conftest.$ac_objext'
16389   { (eval echo "$as_me:16389: \"$ac_try\"") >&5
16390   (eval $ac_try) 2>&5
16391   ac_status=$?
16392   echo "$as_me:16392: \$? = $ac_status" >&5
16393   (exit $ac_status); }; }; then
16394   cf_cv_mbstate_t=no
16395 else
16396   echo "$as_me: failed program was:" >&5
16397 cat conftest.$ac_ext >&5
16398 cat >conftest.$ac_ext <<_ACEOF
16399 #line 16399 "configure"
16400 #include "confdefs.h"
16401
16402 #include <stdlib.h>
16403 #include <stdarg.h>
16404 #include <stdio.h>
16405 #include <wchar.h>
16406 #ifdef HAVE_LIBUTF8_H
16407 #include <libutf8.h>
16408 #endif
16409 int
16410 main ()
16411 {
16412 mbstate_t value
16413   ;
16414   return 0;
16415 }
16416 _ACEOF
16417 rm -f conftest.$ac_objext
16418 if { (eval echo "$as_me:16418: \"$ac_compile\"") >&5
16419   (eval $ac_compile) 2>&5
16420   ac_status=$?
16421   echo "$as_me:16421: \$? = $ac_status" >&5
16422   (exit $ac_status); } &&
16423          { ac_try='test -s conftest.$ac_objext'
16424   { (eval echo "$as_me:16424: \"$ac_try\"") >&5
16425   (eval $ac_try) 2>&5
16426   ac_status=$?
16427   echo "$as_me:16427: \$? = $ac_status" >&5
16428   (exit $ac_status); }; }; then
16429   cf_cv_mbstate_t=yes
16430 else
16431   echo "$as_me: failed program was:" >&5
16432 cat conftest.$ac_ext >&5
16433 cf_cv_mbstate_t=unknown
16434 fi
16435 rm -f conftest.$ac_objext conftest.$ac_ext
16436 fi
16437 rm -f conftest.$ac_objext conftest.$ac_ext
16438 fi
16439 echo "$as_me:16439: result: $cf_cv_mbstate_t" >&5
16440 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
16441
16442 if test "$cf_cv_mbstate_t" = yes ; then
16443
16444 cat >>confdefs.h <<\EOF
16445 #define NEED_WCHAR_H 1
16446 EOF
16447
16448         NEED_WCHAR_H=1
16449 fi
16450
16451 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
16452 if test "$cf_cv_mbstate_t" = unknown ; then
16453         NCURSES_MBSTATE_T=1
16454 fi
16455
16456 # if we find mbstate_t in either place, use substitution to provide a fallback.
16457 if test "$cf_cv_mbstate_t" != unknown ; then
16458         NCURSES_OK_MBSTATE_T=1
16459 fi
16460
16461 # This is needed on Tru64 5.0 to declare wchar_t
16462 echo "$as_me:16462: checking if we must include wchar.h to declare wchar_t" >&5
16463 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
16464 if test "${cf_cv_wchar_t+set}" = set; then
16465   echo $ECHO_N "(cached) $ECHO_C" >&6
16466 else
16467
16468 cat >conftest.$ac_ext <<_ACEOF
16469 #line 16469 "configure"
16470 #include "confdefs.h"
16471
16472 #include <stdlib.h>
16473 #include <stdarg.h>
16474 #include <stdio.h>
16475 #ifdef HAVE_LIBUTF8_H
16476 #include <libutf8.h>
16477 #endif
16478 int
16479 main ()
16480 {
16481 wchar_t state
16482   ;
16483   return 0;
16484 }
16485 _ACEOF
16486 rm -f conftest.$ac_objext
16487 if { (eval echo "$as_me:16487: \"$ac_compile\"") >&5
16488   (eval $ac_compile) 2>&5
16489   ac_status=$?
16490   echo "$as_me:16490: \$? = $ac_status" >&5
16491   (exit $ac_status); } &&
16492          { ac_try='test -s conftest.$ac_objext'
16493   { (eval echo "$as_me:16493: \"$ac_try\"") >&5
16494   (eval $ac_try) 2>&5
16495   ac_status=$?
16496   echo "$as_me:16496: \$? = $ac_status" >&5
16497   (exit $ac_status); }; }; then
16498   cf_cv_wchar_t=no
16499 else
16500   echo "$as_me: failed program was:" >&5
16501 cat conftest.$ac_ext >&5
16502 cat >conftest.$ac_ext <<_ACEOF
16503 #line 16503 "configure"
16504 #include "confdefs.h"
16505
16506 #include <stdlib.h>
16507 #include <stdarg.h>
16508 #include <stdio.h>
16509 #include <wchar.h>
16510 #ifdef HAVE_LIBUTF8_H
16511 #include <libutf8.h>
16512 #endif
16513 int
16514 main ()
16515 {
16516 wchar_t value
16517   ;
16518   return 0;
16519 }
16520 _ACEOF
16521 rm -f conftest.$ac_objext
16522 if { (eval echo "$as_me:16522: \"$ac_compile\"") >&5
16523   (eval $ac_compile) 2>&5
16524   ac_status=$?
16525   echo "$as_me:16525: \$? = $ac_status" >&5
16526   (exit $ac_status); } &&
16527          { ac_try='test -s conftest.$ac_objext'
16528   { (eval echo "$as_me:16528: \"$ac_try\"") >&5
16529   (eval $ac_try) 2>&5
16530   ac_status=$?
16531   echo "$as_me:16531: \$? = $ac_status" >&5
16532   (exit $ac_status); }; }; then
16533   cf_cv_wchar_t=yes
16534 else
16535   echo "$as_me: failed program was:" >&5
16536 cat conftest.$ac_ext >&5
16537 cf_cv_wchar_t=unknown
16538 fi
16539 rm -f conftest.$ac_objext conftest.$ac_ext
16540 fi
16541 rm -f conftest.$ac_objext conftest.$ac_ext
16542 fi
16543 echo "$as_me:16543: result: $cf_cv_wchar_t" >&5
16544 echo "${ECHO_T}$cf_cv_wchar_t" >&6
16545
16546 if test "$cf_cv_wchar_t" = yes ; then
16547
16548 cat >>confdefs.h <<\EOF
16549 #define NEED_WCHAR_H 1
16550 EOF
16551
16552         NEED_WCHAR_H=1
16553 fi
16554
16555 # if we do not find wchar_t in either place, use substitution to provide a fallback.
16556 if test "$cf_cv_wchar_t" = unknown ; then
16557         NCURSES_WCHAR_T=1
16558 fi
16559
16560 # if we find wchar_t in either place, use substitution to provide a fallback.
16561 if test "$cf_cv_wchar_t" != unknown ; then
16562         NCURSES_OK_WCHAR_T=1
16563 fi
16564
16565 # This is needed on Tru64 5.0 to declare wint_t
16566 echo "$as_me:16566: checking if we must include wchar.h to declare wint_t" >&5
16567 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
16568 if test "${cf_cv_wint_t+set}" = set; then
16569   echo $ECHO_N "(cached) $ECHO_C" >&6
16570 else
16571
16572 cat >conftest.$ac_ext <<_ACEOF
16573 #line 16573 "configure"
16574 #include "confdefs.h"
16575
16576 #include <stdlib.h>
16577 #include <stdarg.h>
16578 #include <stdio.h>
16579 #ifdef HAVE_LIBUTF8_H
16580 #include <libutf8.h>
16581 #endif
16582 int
16583 main ()
16584 {
16585 wint_t state
16586   ;
16587   return 0;
16588 }
16589 _ACEOF
16590 rm -f conftest.$ac_objext
16591 if { (eval echo "$as_me:16591: \"$ac_compile\"") >&5
16592   (eval $ac_compile) 2>&5
16593   ac_status=$?
16594   echo "$as_me:16594: \$? = $ac_status" >&5
16595   (exit $ac_status); } &&
16596          { ac_try='test -s conftest.$ac_objext'
16597   { (eval echo "$as_me:16597: \"$ac_try\"") >&5
16598   (eval $ac_try) 2>&5
16599   ac_status=$?
16600   echo "$as_me:16600: \$? = $ac_status" >&5
16601   (exit $ac_status); }; }; then
16602   cf_cv_wint_t=no
16603 else
16604   echo "$as_me: failed program was:" >&5
16605 cat conftest.$ac_ext >&5
16606 cat >conftest.$ac_ext <<_ACEOF
16607 #line 16607 "configure"
16608 #include "confdefs.h"
16609
16610 #include <stdlib.h>
16611 #include <stdarg.h>
16612 #include <stdio.h>
16613 #include <wchar.h>
16614 #ifdef HAVE_LIBUTF8_H
16615 #include <libutf8.h>
16616 #endif
16617 int
16618 main ()
16619 {
16620 wint_t value
16621   ;
16622   return 0;
16623 }
16624 _ACEOF
16625 rm -f conftest.$ac_objext
16626 if { (eval echo "$as_me:16626: \"$ac_compile\"") >&5
16627   (eval $ac_compile) 2>&5
16628   ac_status=$?
16629   echo "$as_me:16629: \$? = $ac_status" >&5
16630   (exit $ac_status); } &&
16631          { ac_try='test -s conftest.$ac_objext'
16632   { (eval echo "$as_me:16632: \"$ac_try\"") >&5
16633   (eval $ac_try) 2>&5
16634   ac_status=$?
16635   echo "$as_me:16635: \$? = $ac_status" >&5
16636   (exit $ac_status); }; }; then
16637   cf_cv_wint_t=yes
16638 else
16639   echo "$as_me: failed program was:" >&5
16640 cat conftest.$ac_ext >&5
16641 cf_cv_wint_t=unknown
16642 fi
16643 rm -f conftest.$ac_objext conftest.$ac_ext
16644 fi
16645 rm -f conftest.$ac_objext conftest.$ac_ext
16646 fi
16647 echo "$as_me:16647: result: $cf_cv_wint_t" >&5
16648 echo "${ECHO_T}$cf_cv_wint_t" >&6
16649
16650 if test "$cf_cv_wint_t" = yes ; then
16651
16652 cat >>confdefs.h <<\EOF
16653 #define NEED_WCHAR_H 1
16654 EOF
16655
16656         NEED_WCHAR_H=1
16657 fi
16658
16659 # if we do not find wint_t in either place, use substitution to provide a fallback.
16660 if test "$cf_cv_wint_t" = unknown ; then
16661         NCURSES_WINT_T=1
16662 fi
16663
16664 # if we find wint_t in either place, use substitution to provide a fallback.
16665 if test "$cf_cv_wint_t" != unknown ; then
16666         NCURSES_OK_WINT_T=1
16667 fi
16668
16669         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
16670
16671 echo "$as_me:16671: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16672 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16673 cat >conftest.$ac_ext <<_ACEOF
16674 #line 16674 "configure"
16675 #include "confdefs.h"
16676
16677 #ifndef _XOPEN_SOURCE_EXTENDED
16678 #define _XOPEN_SOURCE_EXTENDED
16679 #endif
16680 #include <${cf_cv_ncurses_header:-curses.h}>
16681 int
16682 main ()
16683 {
16684
16685 mbstate_t foo
16686
16687   ;
16688   return 0;
16689 }
16690 _ACEOF
16691 rm -f conftest.$ac_objext
16692 if { (eval echo "$as_me:16692: \"$ac_compile\"") >&5
16693   (eval $ac_compile) 2>&5
16694   ac_status=$?
16695   echo "$as_me:16695: \$? = $ac_status" >&5
16696   (exit $ac_status); } &&
16697          { ac_try='test -s conftest.$ac_objext'
16698   { (eval echo "$as_me:16698: \"$ac_try\"") >&5
16699   (eval $ac_try) 2>&5
16700   ac_status=$?
16701   echo "$as_me:16701: \$? = $ac_status" >&5
16702   (exit $ac_status); }; }; then
16703   cf_result=yes
16704 else
16705   echo "$as_me: failed program was:" >&5
16706 cat conftest.$ac_ext >&5
16707 cf_result=no
16708 fi
16709 rm -f conftest.$ac_objext conftest.$ac_ext
16710 echo "$as_me:16710: result: $cf_result" >&5
16711 echo "${ECHO_T}$cf_result" >&6
16712 if test $cf_result = yes ; then
16713
16714 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16715
16716 cat >>confdefs.h <<EOF
16717 #define $cf_result 1
16718 EOF
16719
16720 else
16721
16722 cat >>confdefs.h <<EOF
16723 #define mbstate_t long
16724 EOF
16725
16726 fi
16727
16728         fi
16729
16730         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16731
16732 echo "$as_me:16732: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16733 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16734 cat >conftest.$ac_ext <<_ACEOF
16735 #line 16735 "configure"
16736 #include "confdefs.h"
16737
16738 #ifndef _XOPEN_SOURCE_EXTENDED
16739 #define _XOPEN_SOURCE_EXTENDED
16740 #endif
16741 #include <${cf_cv_ncurses_header:-curses.h}>
16742 int
16743 main ()
16744 {
16745
16746 wchar_t foo
16747
16748   ;
16749   return 0;
16750 }
16751 _ACEOF
16752 rm -f conftest.$ac_objext
16753 if { (eval echo "$as_me:16753: \"$ac_compile\"") >&5
16754   (eval $ac_compile) 2>&5
16755   ac_status=$?
16756   echo "$as_me:16756: \$? = $ac_status" >&5
16757   (exit $ac_status); } &&
16758          { ac_try='test -s conftest.$ac_objext'
16759   { (eval echo "$as_me:16759: \"$ac_try\"") >&5
16760   (eval $ac_try) 2>&5
16761   ac_status=$?
16762   echo "$as_me:16762: \$? = $ac_status" >&5
16763   (exit $ac_status); }; }; then
16764   cf_result=yes
16765 else
16766   echo "$as_me: failed program was:" >&5
16767 cat conftest.$ac_ext >&5
16768 cf_result=no
16769 fi
16770 rm -f conftest.$ac_objext conftest.$ac_ext
16771 echo "$as_me:16771: result: $cf_result" >&5
16772 echo "${ECHO_T}$cf_result" >&6
16773 if test $cf_result = yes ; then
16774
16775 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16776
16777 cat >>confdefs.h <<EOF
16778 #define $cf_result 1
16779 EOF
16780
16781 else
16782
16783 cat >>confdefs.h <<EOF
16784 #define wchar_t long
16785 EOF
16786
16787 fi
16788
16789         fi
16790
16791         if test "$NCURSES_OK_WINT_T" = 0 ; then
16792
16793 echo "$as_me:16793: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16794 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16795 cat >conftest.$ac_ext <<_ACEOF
16796 #line 16796 "configure"
16797 #include "confdefs.h"
16798
16799 #ifndef _XOPEN_SOURCE_EXTENDED
16800 #define _XOPEN_SOURCE_EXTENDED
16801 #endif
16802 #include <${cf_cv_ncurses_header:-curses.h}>
16803 int
16804 main ()
16805 {
16806
16807 wint_t foo
16808
16809   ;
16810   return 0;
16811 }
16812 _ACEOF
16813 rm -f conftest.$ac_objext
16814 if { (eval echo "$as_me:16814: \"$ac_compile\"") >&5
16815   (eval $ac_compile) 2>&5
16816   ac_status=$?
16817   echo "$as_me:16817: \$? = $ac_status" >&5
16818   (exit $ac_status); } &&
16819          { ac_try='test -s conftest.$ac_objext'
16820   { (eval echo "$as_me:16820: \"$ac_try\"") >&5
16821   (eval $ac_try) 2>&5
16822   ac_status=$?
16823   echo "$as_me:16823: \$? = $ac_status" >&5
16824   (exit $ac_status); }; }; then
16825   cf_result=yes
16826 else
16827   echo "$as_me: failed program was:" >&5
16828 cat conftest.$ac_ext >&5
16829 cf_result=no
16830 fi
16831 rm -f conftest.$ac_objext conftest.$ac_ext
16832 echo "$as_me:16832: result: $cf_result" >&5
16833 echo "${ECHO_T}$cf_result" >&6
16834 if test $cf_result = yes ; then
16835
16836 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16837
16838 cat >>confdefs.h <<EOF
16839 #define $cf_result 1
16840 EOF
16841
16842 else
16843
16844 cat >>confdefs.h <<EOF
16845 #define wint_t long
16846 EOF
16847
16848 fi
16849
16850         fi
16851 fi
16852
16853 echo "$as_me:16853: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16854 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16855
16856 cat >conftest.$ac_ext <<_ACEOF
16857 #line 16857 "configure"
16858 #include "confdefs.h"
16859
16860 #ifdef HAVE_XCURSES
16861 #include <xcurses.h>
16862 char * XCursesProgramName = "test";
16863 #else
16864 #include <${cf_cv_ncurses_header:-curses.h}>
16865 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16866 #include <ncursesw/term.h>
16867 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16868 #include <ncurses/term.h>
16869 #elif defined(HAVE_TERM_H)
16870 #include <term.h>
16871 #endif
16872 #endif
16873
16874 int
16875 main ()
16876 {
16877
16878 void *foo = &(ospeed)
16879
16880   ;
16881   return 0;
16882 }
16883 _ACEOF
16884 rm -f conftest.$ac_objext
16885 if { (eval echo "$as_me:16885: \"$ac_compile\"") >&5
16886   (eval $ac_compile) 2>&5
16887   ac_status=$?
16888   echo "$as_me:16888: \$? = $ac_status" >&5
16889   (exit $ac_status); } &&
16890          { ac_try='test -s conftest.$ac_objext'
16891   { (eval echo "$as_me:16891: \"$ac_try\"") >&5
16892   (eval $ac_try) 2>&5
16893   ac_status=$?
16894   echo "$as_me:16894: \$? = $ac_status" >&5
16895   (exit $ac_status); }; }; then
16896   cf_result=yes
16897 else
16898   echo "$as_me: failed program was:" >&5
16899 cat conftest.$ac_ext >&5
16900 cf_result=no
16901 fi
16902 rm -f conftest.$ac_objext conftest.$ac_ext
16903 echo "$as_me:16903: result: $cf_result" >&5
16904 echo "${ECHO_T}$cf_result" >&6
16905
16906 if test $cf_result = yes ; then
16907
16908 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16909
16910         cat >>confdefs.h <<EOF
16911 #define $cf_result 1
16912 EOF
16913
16914 else
16915         echo "$as_me:16915: checking for data ospeed in library" >&5
16916 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
16917         # BSD linkers insist on making weak linkage, but resolve at runtime.
16918         if test "$cross_compiling" = yes; then
16919
16920         # cross-compiling
16921         cat >conftest.$ac_ext <<_ACEOF
16922 #line 16922 "configure"
16923 #include "confdefs.h"
16924
16925 #ifdef HAVE_XCURSES
16926 #include <xcurses.h>
16927 char * XCursesProgramName = "test";
16928 #else
16929 #include <${cf_cv_ncurses_header:-curses.h}>
16930 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16931 #include <ncursesw/term.h>
16932 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16933 #include <ncurses/term.h>
16934 #elif defined(HAVE_TERM_H)
16935 #include <term.h>
16936 #endif
16937 #endif
16938
16939 extern char ospeed;
16940 int
16941 main ()
16942 {
16943
16944         do {
16945                 void *foo = &(ospeed);
16946                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16947                 ${cf_cv_main_return:-return}(foo == 0);
16948         } while (0)
16949
16950   ;
16951   return 0;
16952 }
16953 _ACEOF
16954 rm -f conftest.$ac_objext conftest$ac_exeext
16955 if { (eval echo "$as_me:16955: \"$ac_link\"") >&5
16956   (eval $ac_link) 2>&5
16957   ac_status=$?
16958   echo "$as_me:16958: \$? = $ac_status" >&5
16959   (exit $ac_status); } &&
16960          { ac_try='test -s conftest$ac_exeext'
16961   { (eval echo "$as_me:16961: \"$ac_try\"") >&5
16962   (eval $ac_try) 2>&5
16963   ac_status=$?
16964   echo "$as_me:16964: \$? = $ac_status" >&5
16965   (exit $ac_status); }; }; then
16966   cf_result=yes
16967 else
16968   echo "$as_me: failed program was:" >&5
16969 cat conftest.$ac_ext >&5
16970 cf_result=no
16971 fi
16972 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16973
16974 else
16975   cat >conftest.$ac_ext <<_ACEOF
16976 #line 16976 "configure"
16977 #include "confdefs.h"
16978
16979 #ifdef HAVE_XCURSES
16980 #include <xcurses.h>
16981 char * XCursesProgramName = "test";
16982 #else
16983 #include <${cf_cv_ncurses_header:-curses.h}>
16984 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16985 #include <ncursesw/term.h>
16986 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16987 #include <ncurses/term.h>
16988 #elif defined(HAVE_TERM_H)
16989 #include <term.h>
16990 #endif
16991 #endif
16992
16993 extern char ospeed;
16994 int main(void)
16995 {
16996         void *foo = &(ospeed);
16997         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16998         ${cf_cv_main_return:-return}(foo == 0);
16999 }
17000 _ACEOF
17001 rm -f conftest$ac_exeext
17002 if { (eval echo "$as_me:17002: \"$ac_link\"") >&5
17003   (eval $ac_link) 2>&5
17004   ac_status=$?
17005   echo "$as_me:17005: \$? = $ac_status" >&5
17006   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17007   { (eval echo "$as_me:17007: \"$ac_try\"") >&5
17008   (eval $ac_try) 2>&5
17009   ac_status=$?
17010   echo "$as_me:17010: \$? = $ac_status" >&5
17011   (exit $ac_status); }; }; then
17012   cf_result=yes
17013 else
17014   echo "$as_me: program exited with status $ac_status" >&5
17015 echo "$as_me: failed program was:" >&5
17016 cat conftest.$ac_ext >&5
17017 cf_result=no
17018 fi
17019 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17020 fi
17021         echo "$as_me:17021: result: $cf_result" >&5
17022 echo "${ECHO_T}$cf_result" >&6
17023         if test $cf_result = yes ; then
17024
17025 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17026
17027                 cat >>confdefs.h <<EOF
17028 #define $cf_result 1
17029 EOF
17030
17031         fi
17032 fi
17033
17034 echo "$as_me:17034: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17035 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17036
17037 cat >conftest.$ac_ext <<_ACEOF
17038 #line 17038 "configure"
17039 #include "confdefs.h"
17040
17041 #ifdef HAVE_XCURSES
17042 #include <xcurses.h>
17043 char * XCursesProgramName = "test";
17044 #else
17045 #include <${cf_cv_ncurses_header:-curses.h}>
17046 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17047 #include <ncursesw/term.h>
17048 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17049 #include <ncurses/term.h>
17050 #elif defined(HAVE_TERM_H)
17051 #include <term.h>
17052 #endif
17053 #endif
17054
17055 int
17056 main ()
17057 {
17058
17059 void *foo = &(boolnames)
17060
17061   ;
17062   return 0;
17063 }
17064 _ACEOF
17065 rm -f conftest.$ac_objext
17066 if { (eval echo "$as_me:17066: \"$ac_compile\"") >&5
17067   (eval $ac_compile) 2>&5
17068   ac_status=$?
17069   echo "$as_me:17069: \$? = $ac_status" >&5
17070   (exit $ac_status); } &&
17071          { ac_try='test -s conftest.$ac_objext'
17072   { (eval echo "$as_me:17072: \"$ac_try\"") >&5
17073   (eval $ac_try) 2>&5
17074   ac_status=$?
17075   echo "$as_me:17075: \$? = $ac_status" >&5
17076   (exit $ac_status); }; }; then
17077   cf_result=yes
17078 else
17079   echo "$as_me: failed program was:" >&5
17080 cat conftest.$ac_ext >&5
17081 cf_result=no
17082 fi
17083 rm -f conftest.$ac_objext conftest.$ac_ext
17084 echo "$as_me:17084: result: $cf_result" >&5
17085 echo "${ECHO_T}$cf_result" >&6
17086
17087 if test $cf_result = yes ; then
17088
17089 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17090
17091         cat >>confdefs.h <<EOF
17092 #define $cf_result 1
17093 EOF
17094
17095 else
17096         echo "$as_me:17096: checking for data boolnames in library" >&5
17097 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
17098         # BSD linkers insist on making weak linkage, but resolve at runtime.
17099         if test "$cross_compiling" = yes; then
17100
17101         # cross-compiling
17102         cat >conftest.$ac_ext <<_ACEOF
17103 #line 17103 "configure"
17104 #include "confdefs.h"
17105
17106 #ifdef HAVE_XCURSES
17107 #include <xcurses.h>
17108 char * XCursesProgramName = "test";
17109 #else
17110 #include <${cf_cv_ncurses_header:-curses.h}>
17111 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17112 #include <ncursesw/term.h>
17113 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17114 #include <ncurses/term.h>
17115 #elif defined(HAVE_TERM_H)
17116 #include <term.h>
17117 #endif
17118 #endif
17119
17120 extern char boolnames;
17121 int
17122 main ()
17123 {
17124
17125         do {
17126                 void *foo = &(boolnames);
17127                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
17128                 ${cf_cv_main_return:-return}(foo == 0);
17129         } while (0)
17130
17131   ;
17132   return 0;
17133 }
17134 _ACEOF
17135 rm -f conftest.$ac_objext conftest$ac_exeext
17136 if { (eval echo "$as_me:17136: \"$ac_link\"") >&5
17137   (eval $ac_link) 2>&5
17138   ac_status=$?
17139   echo "$as_me:17139: \$? = $ac_status" >&5
17140   (exit $ac_status); } &&
17141          { ac_try='test -s conftest$ac_exeext'
17142   { (eval echo "$as_me:17142: \"$ac_try\"") >&5
17143   (eval $ac_try) 2>&5
17144   ac_status=$?
17145   echo "$as_me:17145: \$? = $ac_status" >&5
17146   (exit $ac_status); }; }; then
17147   cf_result=yes
17148 else
17149   echo "$as_me: failed program was:" >&5
17150 cat conftest.$ac_ext >&5
17151 cf_result=no
17152 fi
17153 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17154
17155 else
17156   cat >conftest.$ac_ext <<_ACEOF
17157 #line 17157 "configure"
17158 #include "confdefs.h"
17159
17160 #ifdef HAVE_XCURSES
17161 #include <xcurses.h>
17162 char * XCursesProgramName = "test";
17163 #else
17164 #include <${cf_cv_ncurses_header:-curses.h}>
17165 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17166 #include <ncursesw/term.h>
17167 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17168 #include <ncurses/term.h>
17169 #elif defined(HAVE_TERM_H)
17170 #include <term.h>
17171 #endif
17172 #endif
17173
17174 extern char boolnames;
17175 int main(void)
17176 {
17177         void *foo = &(boolnames);
17178         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
17179         ${cf_cv_main_return:-return}(foo == 0);
17180 }
17181 _ACEOF
17182 rm -f conftest$ac_exeext
17183 if { (eval echo "$as_me:17183: \"$ac_link\"") >&5
17184   (eval $ac_link) 2>&5
17185   ac_status=$?
17186   echo "$as_me:17186: \$? = $ac_status" >&5
17187   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17188   { (eval echo "$as_me:17188: \"$ac_try\"") >&5
17189   (eval $ac_try) 2>&5
17190   ac_status=$?
17191   echo "$as_me:17191: \$? = $ac_status" >&5
17192   (exit $ac_status); }; }; then
17193   cf_result=yes
17194 else
17195   echo "$as_me: program exited with status $ac_status" >&5
17196 echo "$as_me: failed program was:" >&5
17197 cat conftest.$ac_ext >&5
17198 cf_result=no
17199 fi
17200 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17201 fi
17202         echo "$as_me:17202: result: $cf_result" >&5
17203 echo "${ECHO_T}$cf_result" >&6
17204         if test $cf_result = yes ; then
17205
17206 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17207
17208                 cat >>confdefs.h <<EOF
17209 #define $cf_result 1
17210 EOF
17211
17212         fi
17213 fi
17214
17215 echo "$as_me:17215: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17216 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17217
17218 cat >conftest.$ac_ext <<_ACEOF
17219 #line 17219 "configure"
17220 #include "confdefs.h"
17221
17222 #ifdef HAVE_XCURSES
17223 #include <xcurses.h>
17224 char * XCursesProgramName = "test";
17225 #else
17226 #include <${cf_cv_ncurses_header:-curses.h}>
17227 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17228 #include <ncursesw/term.h>
17229 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17230 #include <ncurses/term.h>
17231 #elif defined(HAVE_TERM_H)
17232 #include <term.h>
17233 #endif
17234 #endif
17235
17236 int
17237 main ()
17238 {
17239
17240 void *foo = &(boolfnames)
17241
17242   ;
17243   return 0;
17244 }
17245 _ACEOF
17246 rm -f conftest.$ac_objext
17247 if { (eval echo "$as_me:17247: \"$ac_compile\"") >&5
17248   (eval $ac_compile) 2>&5
17249   ac_status=$?
17250   echo "$as_me:17250: \$? = $ac_status" >&5
17251   (exit $ac_status); } &&
17252          { ac_try='test -s conftest.$ac_objext'
17253   { (eval echo "$as_me:17253: \"$ac_try\"") >&5
17254   (eval $ac_try) 2>&5
17255   ac_status=$?
17256   echo "$as_me:17256: \$? = $ac_status" >&5
17257   (exit $ac_status); }; }; then
17258   cf_result=yes
17259 else
17260   echo "$as_me: failed program was:" >&5
17261 cat conftest.$ac_ext >&5
17262 cf_result=no
17263 fi
17264 rm -f conftest.$ac_objext conftest.$ac_ext
17265 echo "$as_me:17265: result: $cf_result" >&5
17266 echo "${ECHO_T}$cf_result" >&6
17267
17268 if test $cf_result = yes ; then
17269
17270 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17271
17272         cat >>confdefs.h <<EOF
17273 #define $cf_result 1
17274 EOF
17275
17276 else
17277         echo "$as_me:17277: checking for data boolfnames in library" >&5
17278 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
17279         # BSD linkers insist on making weak linkage, but resolve at runtime.
17280         if test "$cross_compiling" = yes; then
17281
17282         # cross-compiling
17283         cat >conftest.$ac_ext <<_ACEOF
17284 #line 17284 "configure"
17285 #include "confdefs.h"
17286
17287 #ifdef HAVE_XCURSES
17288 #include <xcurses.h>
17289 char * XCursesProgramName = "test";
17290 #else
17291 #include <${cf_cv_ncurses_header:-curses.h}>
17292 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17293 #include <ncursesw/term.h>
17294 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17295 #include <ncurses/term.h>
17296 #elif defined(HAVE_TERM_H)
17297 #include <term.h>
17298 #endif
17299 #endif
17300
17301 extern char boolfnames;
17302 int
17303 main ()
17304 {
17305
17306         do {
17307                 void *foo = &(boolfnames);
17308                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
17309                 ${cf_cv_main_return:-return}(foo == 0);
17310         } while (0)
17311
17312   ;
17313   return 0;
17314 }
17315 _ACEOF
17316 rm -f conftest.$ac_objext conftest$ac_exeext
17317 if { (eval echo "$as_me:17317: \"$ac_link\"") >&5
17318   (eval $ac_link) 2>&5
17319   ac_status=$?
17320   echo "$as_me:17320: \$? = $ac_status" >&5
17321   (exit $ac_status); } &&
17322          { ac_try='test -s conftest$ac_exeext'
17323   { (eval echo "$as_me:17323: \"$ac_try\"") >&5
17324   (eval $ac_try) 2>&5
17325   ac_status=$?
17326   echo "$as_me:17326: \$? = $ac_status" >&5
17327   (exit $ac_status); }; }; then
17328   cf_result=yes
17329 else
17330   echo "$as_me: failed program was:" >&5
17331 cat conftest.$ac_ext >&5
17332 cf_result=no
17333 fi
17334 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17335
17336 else
17337   cat >conftest.$ac_ext <<_ACEOF
17338 #line 17338 "configure"
17339 #include "confdefs.h"
17340
17341 #ifdef HAVE_XCURSES
17342 #include <xcurses.h>
17343 char * XCursesProgramName = "test";
17344 #else
17345 #include <${cf_cv_ncurses_header:-curses.h}>
17346 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17347 #include <ncursesw/term.h>
17348 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17349 #include <ncurses/term.h>
17350 #elif defined(HAVE_TERM_H)
17351 #include <term.h>
17352 #endif
17353 #endif
17354
17355 extern char boolfnames;
17356 int main(void)
17357 {
17358         void *foo = &(boolfnames);
17359         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
17360         ${cf_cv_main_return:-return}(foo == 0);
17361 }
17362 _ACEOF
17363 rm -f conftest$ac_exeext
17364 if { (eval echo "$as_me:17364: \"$ac_link\"") >&5
17365   (eval $ac_link) 2>&5
17366   ac_status=$?
17367   echo "$as_me:17367: \$? = $ac_status" >&5
17368   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17369   { (eval echo "$as_me:17369: \"$ac_try\"") >&5
17370   (eval $ac_try) 2>&5
17371   ac_status=$?
17372   echo "$as_me:17372: \$? = $ac_status" >&5
17373   (exit $ac_status); }; }; then
17374   cf_result=yes
17375 else
17376   echo "$as_me: program exited with status $ac_status" >&5
17377 echo "$as_me: failed program was:" >&5
17378 cat conftest.$ac_ext >&5
17379 cf_result=no
17380 fi
17381 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17382 fi
17383         echo "$as_me:17383: result: $cf_result" >&5
17384 echo "${ECHO_T}$cf_result" >&6
17385         if test $cf_result = yes ; then
17386
17387 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17388
17389                 cat >>confdefs.h <<EOF
17390 #define $cf_result 1
17391 EOF
17392
17393         fi
17394 fi
17395
17396 echo "$as_me:17396: checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17397 echo $ECHO_N "checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17398
17399 cat >conftest.$ac_ext <<_ACEOF
17400 #line 17400 "configure"
17401 #include "confdefs.h"
17402
17403 #ifdef HAVE_XCURSES
17404 #include <xcurses.h>
17405 char * XCursesProgramName = "test";
17406 #else
17407 #include <${cf_cv_ncurses_header:-curses.h}>
17408 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17409 #include <ncursesw/term.h>
17410 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17411 #include <ncurses/term.h>
17412 #elif defined(HAVE_TERM_H)
17413 #include <term.h>
17414 #endif
17415 #endif
17416
17417 int
17418 main ()
17419 {
17420
17421 void *foo = &(ttytype)
17422
17423   ;
17424   return 0;
17425 }
17426 _ACEOF
17427 rm -f conftest.$ac_objext
17428 if { (eval echo "$as_me:17428: \"$ac_compile\"") >&5
17429   (eval $ac_compile) 2>&5
17430   ac_status=$?
17431   echo "$as_me:17431: \$? = $ac_status" >&5
17432   (exit $ac_status); } &&
17433          { ac_try='test -s conftest.$ac_objext'
17434   { (eval echo "$as_me:17434: \"$ac_try\"") >&5
17435   (eval $ac_try) 2>&5
17436   ac_status=$?
17437   echo "$as_me:17437: \$? = $ac_status" >&5
17438   (exit $ac_status); }; }; then
17439   cf_result=yes
17440 else
17441   echo "$as_me: failed program was:" >&5
17442 cat conftest.$ac_ext >&5
17443 cf_result=no
17444 fi
17445 rm -f conftest.$ac_objext conftest.$ac_ext
17446 echo "$as_me:17446: result: $cf_result" >&5
17447 echo "${ECHO_T}$cf_result" >&6
17448
17449 if test $cf_result = yes ; then
17450
17451 cf_result=`echo "have_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17452
17453         cat >>confdefs.h <<EOF
17454 #define $cf_result 1
17455 EOF
17456
17457 else
17458         echo "$as_me:17458: checking for data ttytype in library" >&5
17459 echo $ECHO_N "checking for data ttytype in library... $ECHO_C" >&6
17460         # BSD linkers insist on making weak linkage, but resolve at runtime.
17461         if test "$cross_compiling" = yes; then
17462
17463         # cross-compiling
17464         cat >conftest.$ac_ext <<_ACEOF
17465 #line 17465 "configure"
17466 #include "confdefs.h"
17467
17468 #ifdef HAVE_XCURSES
17469 #include <xcurses.h>
17470 char * XCursesProgramName = "test";
17471 #else
17472 #include <${cf_cv_ncurses_header:-curses.h}>
17473 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17474 #include <ncursesw/term.h>
17475 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17476 #include <ncurses/term.h>
17477 #elif defined(HAVE_TERM_H)
17478 #include <term.h>
17479 #endif
17480 #endif
17481
17482 extern char ttytype;
17483 int
17484 main ()
17485 {
17486
17487         do {
17488                 void *foo = &(ttytype);
17489                 fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
17490                 ${cf_cv_main_return:-return}(foo == 0);
17491         } while (0)
17492
17493   ;
17494   return 0;
17495 }
17496 _ACEOF
17497 rm -f conftest.$ac_objext conftest$ac_exeext
17498 if { (eval echo "$as_me:17498: \"$ac_link\"") >&5
17499   (eval $ac_link) 2>&5
17500   ac_status=$?
17501   echo "$as_me:17501: \$? = $ac_status" >&5
17502   (exit $ac_status); } &&
17503          { ac_try='test -s conftest$ac_exeext'
17504   { (eval echo "$as_me:17504: \"$ac_try\"") >&5
17505   (eval $ac_try) 2>&5
17506   ac_status=$?
17507   echo "$as_me:17507: \$? = $ac_status" >&5
17508   (exit $ac_status); }; }; then
17509   cf_result=yes
17510 else
17511   echo "$as_me: failed program was:" >&5
17512 cat conftest.$ac_ext >&5
17513 cf_result=no
17514 fi
17515 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17516
17517 else
17518   cat >conftest.$ac_ext <<_ACEOF
17519 #line 17519 "configure"
17520 #include "confdefs.h"
17521
17522 #ifdef HAVE_XCURSES
17523 #include <xcurses.h>
17524 char * XCursesProgramName = "test";
17525 #else
17526 #include <${cf_cv_ncurses_header:-curses.h}>
17527 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17528 #include <ncursesw/term.h>
17529 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17530 #include <ncurses/term.h>
17531 #elif defined(HAVE_TERM_H)
17532 #include <term.h>
17533 #endif
17534 #endif
17535
17536 extern char ttytype;
17537 int main(void)
17538 {
17539         void *foo = &(ttytype);
17540         fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
17541         ${cf_cv_main_return:-return}(foo == 0);
17542 }
17543 _ACEOF
17544 rm -f conftest$ac_exeext
17545 if { (eval echo "$as_me:17545: \"$ac_link\"") >&5
17546   (eval $ac_link) 2>&5
17547   ac_status=$?
17548   echo "$as_me:17548: \$? = $ac_status" >&5
17549   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17550   { (eval echo "$as_me:17550: \"$ac_try\"") >&5
17551   (eval $ac_try) 2>&5
17552   ac_status=$?
17553   echo "$as_me:17553: \$? = $ac_status" >&5
17554   (exit $ac_status); }; }; then
17555   cf_result=yes
17556 else
17557   echo "$as_me: program exited with status $ac_status" >&5
17558 echo "$as_me: failed program was:" >&5
17559 cat conftest.$ac_ext >&5
17560 cf_result=no
17561 fi
17562 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17563 fi
17564         echo "$as_me:17564: result: $cf_result" >&5
17565 echo "${ECHO_T}$cf_result" >&6
17566         if test $cf_result = yes ; then
17567
17568 cf_result=`echo "decl_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17569
17570                 cat >>confdefs.h <<EOF
17571 #define $cf_result 1
17572 EOF
17573
17574         fi
17575 fi
17576
17577 if ( test "$GCC" = yes || test "$GXX" = yes )
17578 then
17579 echo "$as_me:17579: checking if you want to turn on gcc warnings" >&5
17580 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
17581
17582 # Check whether --enable-warnings or --disable-warnings was given.
17583 if test "${enable_warnings+set}" = set; then
17584   enableval="$enable_warnings"
17585   test "$enableval" != yes && enableval=no
17586         if test "$enableval" != "no" ; then
17587     with_warnings=yes
17588         else
17589                 with_warnings=no
17590         fi
17591 else
17592   enableval=no
17593         with_warnings=no
17594
17595 fi;
17596 echo "$as_me:17596: result: $with_warnings" >&5
17597 echo "${ECHO_T}$with_warnings" >&6
17598 if test "$with_warnings" = "yes"
17599 then
17600
17601 if test "$GCC" = yes
17602 then
17603 cat > conftest.i <<EOF
17604 #ifndef GCC_PRINTF
17605 #define GCC_PRINTF 0
17606 #endif
17607 #ifndef GCC_SCANF
17608 #define GCC_SCANF 0
17609 #endif
17610 #ifndef GCC_NORETURN
17611 #define GCC_NORETURN /* nothing */
17612 #endif
17613 #ifndef GCC_UNUSED
17614 #define GCC_UNUSED /* nothing */
17615 #endif
17616 EOF
17617 if test "$GCC" = yes
17618 then
17619         { echo "$as_me:17619: checking for $CC __attribute__ directives..." >&5
17620 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
17621 cat > conftest.$ac_ext <<EOF
17622 #line 17622 "${as_me:-configure}"
17623 #include "confdefs.h"
17624 #include "conftest.h"
17625 #include "conftest.i"
17626 #if     GCC_PRINTF
17627 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
17628 #else
17629 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
17630 #endif
17631 #if     GCC_SCANF
17632 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
17633 #else
17634 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
17635 #endif
17636 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
17637 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
17638 extern void foo(void) GCC_NORETURN;
17639 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
17640 EOF
17641         cf_printf_attribute=no
17642         cf_scanf_attribute=no
17643         for cf_attribute in scanf printf unused noreturn
17644         do
17645
17646 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17647
17648                 cf_directive="__attribute__(($cf_attribute))"
17649                 echo "checking for $CC $cf_directive" 1>&5
17650
17651                 case $cf_attribute in
17652                 (printf)
17653                         cf_printf_attribute=yes
17654                         cat >conftest.h <<EOF
17655 #define GCC_$cf_ATTRIBUTE 1
17656 EOF
17657                         ;;
17658                 (scanf)
17659                         cf_scanf_attribute=yes
17660                         cat >conftest.h <<EOF
17661 #define GCC_$cf_ATTRIBUTE 1
17662 EOF
17663                         ;;
17664                 (*)
17665                         cat >conftest.h <<EOF
17666 #define GCC_$cf_ATTRIBUTE $cf_directive
17667 EOF
17668                         ;;
17669                 esac
17670
17671                 if { (eval echo "$as_me:17671: \"$ac_compile\"") >&5
17672   (eval $ac_compile) 2>&5
17673   ac_status=$?
17674   echo "$as_me:17674: \$? = $ac_status" >&5
17675   (exit $ac_status); }; then
17676                         test -n "$verbose" && echo "$as_me:17676: result: ... $cf_attribute" >&5
17677 echo "${ECHO_T}... $cf_attribute" >&6
17678                         cat conftest.h >>confdefs.h
17679                         case $cf_attribute in
17680                         (noreturn)
17681
17682 cat >>confdefs.h <<EOF
17683 #define GCC_NORETURN $cf_directive
17684 EOF
17685
17686                                 ;;
17687                         (printf)
17688                                 cf_value='/* nothing */'
17689                                 if test "$cf_printf_attribute" != no ; then
17690                                         cf_value='__attribute__((format(printf,fmt,var)))'
17691
17692 cat >>confdefs.h <<\EOF
17693 #define GCC_PRINTF 1
17694 EOF
17695
17696                                 fi
17697
17698 cat >>confdefs.h <<EOF
17699 #define GCC_PRINTFLIKE(fmt,var) $cf_value
17700 EOF
17701
17702                                 ;;
17703                         (scanf)
17704                                 cf_value='/* nothing */'
17705                                 if test "$cf_scanf_attribute" != no ; then
17706                                         cf_value='__attribute__((format(scanf,fmt,var)))'
17707
17708 cat >>confdefs.h <<\EOF
17709 #define GCC_SCANF 1
17710 EOF
17711
17712                                 fi
17713
17714 cat >>confdefs.h <<EOF
17715 #define GCC_SCANFLIKE(fmt,var) $cf_value
17716 EOF
17717
17718                                 ;;
17719                         (unused)
17720
17721 cat >>confdefs.h <<EOF
17722 #define GCC_UNUSED $cf_directive
17723 EOF
17724
17725                                 ;;
17726                         esac
17727                 fi
17728         done
17729 else
17730         fgrep define conftest.i >>confdefs.h
17731 fi
17732 rm -rf conftest*
17733 fi
17734
17735 INTEL_COMPILER=no
17736
17737 if test "$GCC" = yes ; then
17738         case $host_os in
17739         (linux*|gnu*)
17740                 echo "$as_me:17740: checking if this is really Intel C compiler" >&5
17741 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17742                 cf_save_CFLAGS="$CFLAGS"
17743                 CFLAGS="$CFLAGS -no-gcc"
17744                 cat >conftest.$ac_ext <<_ACEOF
17745 #line 17745 "configure"
17746 #include "confdefs.h"
17747
17748 int
17749 main ()
17750 {
17751
17752 #ifdef __INTEL_COMPILER
17753 #else
17754 make an error
17755 #endif
17756
17757   ;
17758   return 0;
17759 }
17760 _ACEOF
17761 rm -f conftest.$ac_objext
17762 if { (eval echo "$as_me:17762: \"$ac_compile\"") >&5
17763   (eval $ac_compile) 2>&5
17764   ac_status=$?
17765   echo "$as_me:17765: \$? = $ac_status" >&5
17766   (exit $ac_status); } &&
17767          { ac_try='test -s conftest.$ac_objext'
17768   { (eval echo "$as_me:17768: \"$ac_try\"") >&5
17769   (eval $ac_try) 2>&5
17770   ac_status=$?
17771   echo "$as_me:17771: \$? = $ac_status" >&5
17772   (exit $ac_status); }; }; then
17773   INTEL_COMPILER=yes
17774 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17775
17776 else
17777   echo "$as_me: failed program was:" >&5
17778 cat conftest.$ac_ext >&5
17779 fi
17780 rm -f conftest.$ac_objext conftest.$ac_ext
17781                 CFLAGS="$cf_save_CFLAGS"
17782                 echo "$as_me:17782: result: $INTEL_COMPILER" >&5
17783 echo "${ECHO_T}$INTEL_COMPILER" >&6
17784                 ;;
17785         esac
17786 fi
17787
17788 CLANG_COMPILER=no
17789
17790 if test "$GCC" = yes ; then
17791         echo "$as_me:17791: checking if this is really Clang C compiler" >&5
17792 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
17793         cf_save_CFLAGS="$CFLAGS"
17794         CFLAGS="$CFLAGS -Qunused-arguments"
17795         cat >conftest.$ac_ext <<_ACEOF
17796 #line 17796 "configure"
17797 #include "confdefs.h"
17798
17799 int
17800 main ()
17801 {
17802
17803 #ifdef __clang__
17804 #else
17805 make an error
17806 #endif
17807
17808   ;
17809   return 0;
17810 }
17811 _ACEOF
17812 rm -f conftest.$ac_objext
17813 if { (eval echo "$as_me:17813: \"$ac_compile\"") >&5
17814   (eval $ac_compile) 2>&5
17815   ac_status=$?
17816   echo "$as_me:17816: \$? = $ac_status" >&5
17817   (exit $ac_status); } &&
17818          { ac_try='test -s conftest.$ac_objext'
17819   { (eval echo "$as_me:17819: \"$ac_try\"") >&5
17820   (eval $ac_try) 2>&5
17821   ac_status=$?
17822   echo "$as_me:17822: \$? = $ac_status" >&5
17823   (exit $ac_status); }; }; then
17824   CLANG_COMPILER=yes
17825 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
17826
17827 else
17828   echo "$as_me: failed program was:" >&5
17829 cat conftest.$ac_ext >&5
17830 fi
17831 rm -f conftest.$ac_objext conftest.$ac_ext
17832         CFLAGS="$cf_save_CFLAGS"
17833         echo "$as_me:17833: result: $CLANG_COMPILER" >&5
17834 echo "${ECHO_T}$CLANG_COMPILER" >&6
17835 fi
17836
17837 cat > conftest.$ac_ext <<EOF
17838 #line 17838 "${as_me:-configure}"
17839 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
17840 EOF
17841
17842 if test "$INTEL_COMPILER" = yes
17843 then
17844 # The "-wdXXX" options suppress warnings:
17845 # remark #1419: external declaration in primary source file
17846 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
17847 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
17848 # remark #193: zero used for undefined preprocessing identifier
17849 # remark #593: variable "curs_sb_left_arrow" was set but never used
17850 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
17851 # remark #869: parameter "tw" was never referenced
17852 # remark #981: operands are evaluated in unspecified order
17853 # warning #279: controlling expression is constant
17854
17855         { echo "$as_me:17855: checking for $CC warning options..." >&5
17856 echo "$as_me: checking for $CC warning options..." >&6;}
17857         cf_save_CFLAGS="$CFLAGS"
17858         EXTRA_CFLAGS="-Wall"
17859         for cf_opt in \
17860                 wd1419 \
17861                 wd1683 \
17862                 wd1684 \
17863                 wd193 \
17864                 wd593 \
17865                 wd279 \
17866                 wd810 \
17867                 wd869 \
17868                 wd981
17869         do
17870                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17871                 if { (eval echo "$as_me:17871: \"$ac_compile\"") >&5
17872   (eval $ac_compile) 2>&5
17873   ac_status=$?
17874   echo "$as_me:17874: \$? = $ac_status" >&5
17875   (exit $ac_status); }; then
17876                         test -n "$verbose" && echo "$as_me:17876: result: ... -$cf_opt" >&5
17877 echo "${ECHO_T}... -$cf_opt" >&6
17878                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17879                 fi
17880         done
17881         CFLAGS="$cf_save_CFLAGS"
17882
17883 elif test "$GCC" = yes
17884 then
17885         { echo "$as_me:17885: checking for $CC warning options..." >&5
17886 echo "$as_me: checking for $CC warning options..." >&6;}
17887         cf_save_CFLAGS="$CFLAGS"
17888         EXTRA_CFLAGS=
17889         cf_warn_CONST=""
17890         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
17891         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
17892         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
17893         for cf_opt in W Wall \
17894                 Wbad-function-cast \
17895                 Wcast-align \
17896                 Wcast-qual \
17897                 Wdeclaration-after-statement \
17898                 Wextra \
17899                 Winline \
17900                 Wmissing-declarations \
17901                 Wmissing-prototypes \
17902                 Wnested-externs \
17903                 Wpointer-arith \
17904                 Wshadow \
17905                 Wstrict-prototypes \
17906                 Wundef $cf_gcc_warnings $cf_warn_CONST
17907         do
17908                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17909                 if { (eval echo "$as_me:17909: \"$ac_compile\"") >&5
17910   (eval $ac_compile) 2>&5
17911   ac_status=$?
17912   echo "$as_me:17912: \$? = $ac_status" >&5
17913   (exit $ac_status); }; then
17914                         test -n "$verbose" && echo "$as_me:17914: result: ... -$cf_opt" >&5
17915 echo "${ECHO_T}... -$cf_opt" >&6
17916                         case $cf_opt in
17917                         (Wcast-qual)
17918                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17919                                 ;;
17920                         (Winline)
17921                                 case $GCC_VERSION in
17922                                 ([34].*)
17923                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17924
17925 echo "${as_me:-configure}:17925: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17926
17927                                         continue;;
17928                                 esac
17929                                 ;;
17930                         (Wpointer-arith)
17931                                 case $GCC_VERSION in
17932                                 ([12].*)
17933                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17934
17935 echo "${as_me:-configure}:17935: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17936
17937                                         continue;;
17938                                 esac
17939                                 ;;
17940                         esac
17941                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17942                 fi
17943         done
17944         CFLAGS="$cf_save_CFLAGS"
17945 fi
17946 rm -rf conftest*
17947
17948 fi
17949 fi
17950
17951 echo "$as_me:17951: checking if you want to use dmalloc for testing" >&5
17952 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17953
17954 # Check whether --with-dmalloc or --without-dmalloc was given.
17955 if test "${with_dmalloc+set}" = set; then
17956   withval="$with_dmalloc"
17957
17958 cat >>confdefs.h <<EOF
17959 #define USE_DMALLOC 1
17960 EOF
17961
17962         : ${with_cflags:=-g}
17963         : ${with_no_leaks:=yes}
17964          with_dmalloc=yes
17965 else
17966   with_dmalloc=
17967 fi;
17968 echo "$as_me:17968: result: ${with_dmalloc:-no}" >&5
17969 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17970
17971 case .$with_cflags in
17972 (.*-g*)
17973         case .$CFLAGS in
17974         (.*-g*)
17975                 ;;
17976         (*)
17977
17978 cf_fix_cppflags=no
17979 cf_new_cflags=
17980 cf_new_cppflags=
17981 cf_new_extra_cppflags=
17982
17983 for cf_add_cflags in -g
17984 do
17985 case $cf_fix_cppflags in
17986 (no)
17987         case $cf_add_cflags in
17988         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17989                 case $cf_add_cflags in
17990                 (-D*)
17991                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17992
17993                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17994                                 && test -z "${cf_tst_cflags}" \
17995                                 && cf_fix_cppflags=yes
17996
17997                         if test $cf_fix_cppflags = yes ; then
17998
17999         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18000         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18001
18002                                 continue
18003                         elif test "${cf_tst_cflags}" = "\"'" ; then
18004
18005         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18006         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18007
18008                                 continue
18009                         fi
18010                         ;;
18011                 esac
18012                 case "$CPPFLAGS" in
18013                 (*$cf_add_cflags)
18014                         ;;
18015                 (*)
18016                         case $cf_add_cflags in
18017                         (-D*)
18018                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18019
18020 CPPFLAGS=`echo "$CPPFLAGS" | \
18021         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18022                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18023
18024                                 ;;
18025                         esac
18026
18027         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18028         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18029
18030                         ;;
18031                 esac
18032                 ;;
18033         (*)
18034
18035         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18036         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18037
18038                 ;;
18039         esac
18040         ;;
18041 (yes)
18042
18043         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18044         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18045
18046         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18047
18048         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18049                 && test -z "${cf_tst_cflags}" \
18050                 && cf_fix_cppflags=no
18051         ;;
18052 esac
18053 done
18054
18055 if test -n "$cf_new_cflags" ; then
18056
18057         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18058         CFLAGS="${CFLAGS}$cf_new_cflags"
18059
18060 fi
18061
18062 if test -n "$cf_new_cppflags" ; then
18063
18064         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18065         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18066
18067 fi
18068
18069 if test -n "$cf_new_extra_cppflags" ; then
18070
18071         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18072         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18073
18074 fi
18075
18076                 ;;
18077         esac
18078         ;;
18079 esac
18080
18081 if test "$with_dmalloc" = yes ; then
18082         echo "$as_me:18082: checking for dmalloc.h" >&5
18083 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
18084 if test "${ac_cv_header_dmalloc_h+set}" = set; then
18085   echo $ECHO_N "(cached) $ECHO_C" >&6
18086 else
18087   cat >conftest.$ac_ext <<_ACEOF
18088 #line 18088 "configure"
18089 #include "confdefs.h"
18090 #include <dmalloc.h>
18091 _ACEOF
18092 if { (eval echo "$as_me:18092: \"$ac_cpp conftest.$ac_ext\"") >&5
18093   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18094   ac_status=$?
18095   egrep -v '^ *\+' conftest.er1 >conftest.err
18096   rm -f conftest.er1
18097   cat conftest.err >&5
18098   echo "$as_me:18098: \$? = $ac_status" >&5
18099   (exit $ac_status); } >/dev/null; then
18100   if test -s conftest.err; then
18101     ac_cpp_err=$ac_c_preproc_warn_flag
18102   else
18103     ac_cpp_err=
18104   fi
18105 else
18106   ac_cpp_err=yes
18107 fi
18108 if test -z "$ac_cpp_err"; then
18109   ac_cv_header_dmalloc_h=yes
18110 else
18111   echo "$as_me: failed program was:" >&5
18112   cat conftest.$ac_ext >&5
18113   ac_cv_header_dmalloc_h=no
18114 fi
18115 rm -f conftest.err conftest.$ac_ext
18116 fi
18117 echo "$as_me:18117: result: $ac_cv_header_dmalloc_h" >&5
18118 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
18119 if test $ac_cv_header_dmalloc_h = yes; then
18120
18121 echo "$as_me:18121: checking for dmalloc_debug in -ldmalloc" >&5
18122 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
18123 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
18124   echo $ECHO_N "(cached) $ECHO_C" >&6
18125 else
18126   ac_check_lib_save_LIBS=$LIBS
18127 LIBS="-ldmalloc  $LIBS"
18128 cat >conftest.$ac_ext <<_ACEOF
18129 #line 18129 "configure"
18130 #include "confdefs.h"
18131
18132 /* Override any gcc2 internal prototype to avoid an error.  */
18133 #ifdef __cplusplus
18134 extern "C"
18135 #endif
18136 /* We use char because int might match the return type of a gcc2
18137    builtin and then its argument prototype would still apply.  */
18138 char dmalloc_debug ();
18139 int
18140 main ()
18141 {
18142 dmalloc_debug ();
18143   ;
18144   return 0;
18145 }
18146 _ACEOF
18147 rm -f conftest.$ac_objext conftest$ac_exeext
18148 if { (eval echo "$as_me:18148: \"$ac_link\"") >&5
18149   (eval $ac_link) 2>&5
18150   ac_status=$?
18151   echo "$as_me:18151: \$? = $ac_status" >&5
18152   (exit $ac_status); } &&
18153          { ac_try='test -s conftest$ac_exeext'
18154   { (eval echo "$as_me:18154: \"$ac_try\"") >&5
18155   (eval $ac_try) 2>&5
18156   ac_status=$?
18157   echo "$as_me:18157: \$? = $ac_status" >&5
18158   (exit $ac_status); }; }; then
18159   ac_cv_lib_dmalloc_dmalloc_debug=yes
18160 else
18161   echo "$as_me: failed program was:" >&5
18162 cat conftest.$ac_ext >&5
18163 ac_cv_lib_dmalloc_dmalloc_debug=no
18164 fi
18165 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18166 LIBS=$ac_check_lib_save_LIBS
18167 fi
18168 echo "$as_me:18168: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
18169 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
18170 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
18171   cat >>confdefs.h <<EOF
18172 #define HAVE_LIBDMALLOC 1
18173 EOF
18174
18175   LIBS="-ldmalloc $LIBS"
18176
18177 fi
18178
18179 fi
18180
18181 fi
18182
18183 echo "$as_me:18183: checking if you want to use dbmalloc for testing" >&5
18184 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
18185
18186 # Check whether --with-dbmalloc or --without-dbmalloc was given.
18187 if test "${with_dbmalloc+set}" = set; then
18188   withval="$with_dbmalloc"
18189
18190 cat >>confdefs.h <<EOF
18191 #define USE_DBMALLOC 1
18192 EOF
18193
18194         : ${with_cflags:=-g}
18195         : ${with_no_leaks:=yes}
18196          with_dbmalloc=yes
18197 else
18198   with_dbmalloc=
18199 fi;
18200 echo "$as_me:18200: result: ${with_dbmalloc:-no}" >&5
18201 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
18202
18203 case .$with_cflags in
18204 (.*-g*)
18205         case .$CFLAGS in
18206         (.*-g*)
18207                 ;;
18208         (*)
18209
18210 cf_fix_cppflags=no
18211 cf_new_cflags=
18212 cf_new_cppflags=
18213 cf_new_extra_cppflags=
18214
18215 for cf_add_cflags in -g
18216 do
18217 case $cf_fix_cppflags in
18218 (no)
18219         case $cf_add_cflags in
18220         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18221                 case $cf_add_cflags in
18222                 (-D*)
18223                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18224
18225                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18226                                 && test -z "${cf_tst_cflags}" \
18227                                 && cf_fix_cppflags=yes
18228
18229                         if test $cf_fix_cppflags = yes ; then
18230
18231         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18232         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18233
18234                                 continue
18235                         elif test "${cf_tst_cflags}" = "\"'" ; then
18236
18237         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18238         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18239
18240                                 continue
18241                         fi
18242                         ;;
18243                 esac
18244                 case "$CPPFLAGS" in
18245                 (*$cf_add_cflags)
18246                         ;;
18247                 (*)
18248                         case $cf_add_cflags in
18249                         (-D*)
18250                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18251
18252 CPPFLAGS=`echo "$CPPFLAGS" | \
18253         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18254                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18255
18256                                 ;;
18257                         esac
18258
18259         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18260         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18261
18262                         ;;
18263                 esac
18264                 ;;
18265         (*)
18266
18267         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18268         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18269
18270                 ;;
18271         esac
18272         ;;
18273 (yes)
18274
18275         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18276         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18277
18278         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18279
18280         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18281                 && test -z "${cf_tst_cflags}" \
18282                 && cf_fix_cppflags=no
18283         ;;
18284 esac
18285 done
18286
18287 if test -n "$cf_new_cflags" ; then
18288
18289         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18290         CFLAGS="${CFLAGS}$cf_new_cflags"
18291
18292 fi
18293
18294 if test -n "$cf_new_cppflags" ; then
18295
18296         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18297         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18298
18299 fi
18300
18301 if test -n "$cf_new_extra_cppflags" ; then
18302
18303         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18304         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18305
18306 fi
18307
18308                 ;;
18309         esac
18310         ;;
18311 esac
18312
18313 if test "$with_dbmalloc" = yes ; then
18314         echo "$as_me:18314: checking for dbmalloc.h" >&5
18315 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
18316 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
18317   echo $ECHO_N "(cached) $ECHO_C" >&6
18318 else
18319   cat >conftest.$ac_ext <<_ACEOF
18320 #line 18320 "configure"
18321 #include "confdefs.h"
18322 #include <dbmalloc.h>
18323 _ACEOF
18324 if { (eval echo "$as_me:18324: \"$ac_cpp conftest.$ac_ext\"") >&5
18325   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18326   ac_status=$?
18327   egrep -v '^ *\+' conftest.er1 >conftest.err
18328   rm -f conftest.er1
18329   cat conftest.err >&5
18330   echo "$as_me:18330: \$? = $ac_status" >&5
18331   (exit $ac_status); } >/dev/null; then
18332   if test -s conftest.err; then
18333     ac_cpp_err=$ac_c_preproc_warn_flag
18334   else
18335     ac_cpp_err=
18336   fi
18337 else
18338   ac_cpp_err=yes
18339 fi
18340 if test -z "$ac_cpp_err"; then
18341   ac_cv_header_dbmalloc_h=yes
18342 else
18343   echo "$as_me: failed program was:" >&5
18344   cat conftest.$ac_ext >&5
18345   ac_cv_header_dbmalloc_h=no
18346 fi
18347 rm -f conftest.err conftest.$ac_ext
18348 fi
18349 echo "$as_me:18349: result: $ac_cv_header_dbmalloc_h" >&5
18350 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
18351 if test $ac_cv_header_dbmalloc_h = yes; then
18352
18353 echo "$as_me:18353: checking for debug_malloc in -ldbmalloc" >&5
18354 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
18355 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
18356   echo $ECHO_N "(cached) $ECHO_C" >&6
18357 else
18358   ac_check_lib_save_LIBS=$LIBS
18359 LIBS="-ldbmalloc  $LIBS"
18360 cat >conftest.$ac_ext <<_ACEOF
18361 #line 18361 "configure"
18362 #include "confdefs.h"
18363
18364 /* Override any gcc2 internal prototype to avoid an error.  */
18365 #ifdef __cplusplus
18366 extern "C"
18367 #endif
18368 /* We use char because int might match the return type of a gcc2
18369    builtin and then its argument prototype would still apply.  */
18370 char debug_malloc ();
18371 int
18372 main ()
18373 {
18374 debug_malloc ();
18375   ;
18376   return 0;
18377 }
18378 _ACEOF
18379 rm -f conftest.$ac_objext conftest$ac_exeext
18380 if { (eval echo "$as_me:18380: \"$ac_link\"") >&5
18381   (eval $ac_link) 2>&5
18382   ac_status=$?
18383   echo "$as_me:18383: \$? = $ac_status" >&5
18384   (exit $ac_status); } &&
18385          { ac_try='test -s conftest$ac_exeext'
18386   { (eval echo "$as_me:18386: \"$ac_try\"") >&5
18387   (eval $ac_try) 2>&5
18388   ac_status=$?
18389   echo "$as_me:18389: \$? = $ac_status" >&5
18390   (exit $ac_status); }; }; then
18391   ac_cv_lib_dbmalloc_debug_malloc=yes
18392 else
18393   echo "$as_me: failed program was:" >&5
18394 cat conftest.$ac_ext >&5
18395 ac_cv_lib_dbmalloc_debug_malloc=no
18396 fi
18397 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18398 LIBS=$ac_check_lib_save_LIBS
18399 fi
18400 echo "$as_me:18400: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
18401 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
18402 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
18403   cat >>confdefs.h <<EOF
18404 #define HAVE_LIBDBMALLOC 1
18405 EOF
18406
18407   LIBS="-ldbmalloc $LIBS"
18408
18409 fi
18410
18411 fi
18412
18413 fi
18414
18415 echo "$as_me:18415: checking if you want to use valgrind for testing" >&5
18416 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
18417
18418 # Check whether --with-valgrind or --without-valgrind was given.
18419 if test "${with_valgrind+set}" = set; then
18420   withval="$with_valgrind"
18421
18422 cat >>confdefs.h <<EOF
18423 #define USE_VALGRIND 1
18424 EOF
18425
18426         : ${with_cflags:=-g}
18427         : ${with_no_leaks:=yes}
18428          with_valgrind=yes
18429 else
18430   with_valgrind=
18431 fi;
18432 echo "$as_me:18432: result: ${with_valgrind:-no}" >&5
18433 echo "${ECHO_T}${with_valgrind:-no}" >&6
18434
18435 case .$with_cflags in
18436 (.*-g*)
18437         case .$CFLAGS in
18438         (.*-g*)
18439                 ;;
18440         (*)
18441
18442 cf_fix_cppflags=no
18443 cf_new_cflags=
18444 cf_new_cppflags=
18445 cf_new_extra_cppflags=
18446
18447 for cf_add_cflags in -g
18448 do
18449 case $cf_fix_cppflags in
18450 (no)
18451         case $cf_add_cflags in
18452         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18453                 case $cf_add_cflags in
18454                 (-D*)
18455                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18456
18457                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18458                                 && test -z "${cf_tst_cflags}" \
18459                                 && cf_fix_cppflags=yes
18460
18461                         if test $cf_fix_cppflags = yes ; then
18462
18463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18465
18466                                 continue
18467                         elif test "${cf_tst_cflags}" = "\"'" ; then
18468
18469         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18470         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18471
18472                                 continue
18473                         fi
18474                         ;;
18475                 esac
18476                 case "$CPPFLAGS" in
18477                 (*$cf_add_cflags)
18478                         ;;
18479                 (*)
18480                         case $cf_add_cflags in
18481                         (-D*)
18482                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18483
18484 CPPFLAGS=`echo "$CPPFLAGS" | \
18485         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18486                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18487
18488                                 ;;
18489                         esac
18490
18491         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18492         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18493
18494                         ;;
18495                 esac
18496                 ;;
18497         (*)
18498
18499         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18500         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18501
18502                 ;;
18503         esac
18504         ;;
18505 (yes)
18506
18507         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18508         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18509
18510         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18511
18512         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18513                 && test -z "${cf_tst_cflags}" \
18514                 && cf_fix_cppflags=no
18515         ;;
18516 esac
18517 done
18518
18519 if test -n "$cf_new_cflags" ; then
18520
18521         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18522         CFLAGS="${CFLAGS}$cf_new_cflags"
18523
18524 fi
18525
18526 if test -n "$cf_new_cppflags" ; then
18527
18528         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18529         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18530
18531 fi
18532
18533 if test -n "$cf_new_extra_cppflags" ; then
18534
18535         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18536         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18537
18538 fi
18539
18540                 ;;
18541         esac
18542         ;;
18543 esac
18544
18545 echo "$as_me:18545: checking if you want to perform memory-leak testing" >&5
18546 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
18547
18548 # Check whether --enable-leaks or --disable-leaks was given.
18549 if test "${enable_leaks+set}" = set; then
18550   enableval="$enable_leaks"
18551   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
18552 else
18553   : ${with_no_leaks:=no}
18554 fi;
18555 echo "$as_me:18555: result: $with_no_leaks" >&5
18556 echo "${ECHO_T}$with_no_leaks" >&6
18557
18558 if test "$with_no_leaks" = yes ; then
18559
18560 cat >>confdefs.h <<\EOF
18561 #define NO_LEAKS 1
18562 EOF
18563
18564 cat >>confdefs.h <<\EOF
18565 #define YY_NO_LEAKS 1
18566 EOF
18567
18568 fi
18569
18570 LD_RPATH_OPT=
18571 echo "$as_me:18571: checking for an rpath option" >&5
18572 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
18573 case $cf_cv_system_name in
18574 (irix*)
18575         if test "$GCC" = yes; then
18576                 LD_RPATH_OPT="-Wl,-rpath,"
18577         else
18578                 LD_RPATH_OPT="-rpath "
18579         fi
18580         ;;
18581 (linux*|gnu*|k*bsd*-gnu|freebsd*)
18582         LD_RPATH_OPT="-Wl,-rpath,"
18583         ;;
18584 (openbsd[2-9].*|mirbsd*)
18585         LD_RPATH_OPT="-Wl,-rpath,"
18586         ;;
18587 (dragonfly*)
18588         LD_RPATH_OPT="-rpath "
18589         ;;
18590 (netbsd*)
18591         LD_RPATH_OPT="-Wl,-rpath,"
18592         ;;
18593 (osf*|mls+*)
18594         LD_RPATH_OPT="-rpath "
18595         ;;
18596 (solaris2*)
18597         LD_RPATH_OPT="-R"
18598         ;;
18599 (*)
18600         ;;
18601 esac
18602 echo "$as_me:18602: result: $LD_RPATH_OPT" >&5
18603 echo "${ECHO_T}$LD_RPATH_OPT" >&6
18604
18605 case "x$LD_RPATH_OPT" in
18606 (x-R*)
18607         echo "$as_me:18607: checking if we need a space after rpath option" >&5
18608 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
18609         cf_save_LIBS="$LIBS"
18610
18611 cf_add_libs="${LD_RPATH_OPT}$libdir"
18612 # Filter out duplicates - this happens with badly-designed ".pc" files...
18613 for cf_add_1lib in $LIBS
18614 do
18615         for cf_add_2lib in $cf_add_libs
18616         do
18617                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18618                 then
18619                         cf_add_1lib=
18620                         break
18621                 fi
18622         done
18623         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18624 done
18625 LIBS="$cf_add_libs"
18626
18627         cat >conftest.$ac_ext <<_ACEOF
18628 #line 18628 "configure"
18629 #include "confdefs.h"
18630
18631 int
18632 main ()
18633 {
18634
18635   ;
18636   return 0;
18637 }
18638 _ACEOF
18639 rm -f conftest.$ac_objext conftest$ac_exeext
18640 if { (eval echo "$as_me:18640: \"$ac_link\"") >&5
18641   (eval $ac_link) 2>&5
18642   ac_status=$?
18643   echo "$as_me:18643: \$? = $ac_status" >&5
18644   (exit $ac_status); } &&
18645          { ac_try='test -s conftest$ac_exeext'
18646   { (eval echo "$as_me:18646: \"$ac_try\"") >&5
18647   (eval $ac_try) 2>&5
18648   ac_status=$?
18649   echo "$as_me:18649: \$? = $ac_status" >&5
18650   (exit $ac_status); }; }; then
18651   cf_rpath_space=no
18652 else
18653   echo "$as_me: failed program was:" >&5
18654 cat conftest.$ac_ext >&5
18655 cf_rpath_space=yes
18656 fi
18657 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18658         LIBS="$cf_save_LIBS"
18659         echo "$as_me:18659: result: $cf_rpath_space" >&5
18660 echo "${ECHO_T}$cf_rpath_space" >&6
18661         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
18662         ;;
18663 esac
18664
18665 echo "$as_me:18665: checking if rpath-hack should be disabled" >&5
18666 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
18667
18668 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
18669 if test "${enable_rpath_hack+set}" = set; then
18670   enableval="$enable_rpath_hack"
18671   test "$enableval" != no && enableval=yes
18672         if test "$enableval" != "yes" ; then
18673     cf_disable_rpath_hack=yes
18674         else
18675                 cf_disable_rpath_hack=no
18676         fi
18677 else
18678   enableval=yes
18679         cf_disable_rpath_hack=no
18680
18681 fi;
18682 echo "$as_me:18682: result: $cf_disable_rpath_hack" >&5
18683 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
18684 if test "$cf_disable_rpath_hack" = no ; then
18685
18686 echo "$as_me:18686: checking for updated LDFLAGS" >&5
18687 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
18688 if test -n "$LD_RPATH_OPT" ; then
18689         echo "$as_me:18689: result: maybe" >&5
18690 echo "${ECHO_T}maybe" >&6
18691
18692         for ac_prog in ldd
18693 do
18694   # Extract the first word of "$ac_prog", so it can be a program name with args.
18695 set dummy $ac_prog; ac_word=$2
18696 echo "$as_me:18696: checking for $ac_word" >&5
18697 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
18698 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
18699   echo $ECHO_N "(cached) $ECHO_C" >&6
18700 else
18701   if test -n "$cf_ldd_prog"; then
18702   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
18703 else
18704   ac_save_IFS=$IFS; IFS=$ac_path_separator
18705 ac_dummy="$PATH"
18706 for ac_dir in $ac_dummy; do
18707   IFS=$ac_save_IFS
18708   test -z "$ac_dir" && ac_dir=.
18709   $as_executable_p "$ac_dir/$ac_word" || continue
18710 ac_cv_prog_cf_ldd_prog="$ac_prog"
18711 echo "$as_me:18711: found $ac_dir/$ac_word" >&5
18712 break
18713 done
18714
18715 fi
18716 fi
18717 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
18718 if test -n "$cf_ldd_prog"; then
18719   echo "$as_me:18719: result: $cf_ldd_prog" >&5
18720 echo "${ECHO_T}$cf_ldd_prog" >&6
18721 else
18722   echo "$as_me:18722: result: no" >&5
18723 echo "${ECHO_T}no" >&6
18724 fi
18725
18726   test -n "$cf_ldd_prog" && break
18727 done
18728 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
18729
18730         cf_rpath_list="/usr/lib /lib"
18731         if test "$cf_ldd_prog" != no
18732         then
18733                 cf_rpath_oops=
18734
18735 cat >conftest.$ac_ext <<_ACEOF
18736 #line 18736 "configure"
18737 #include "confdefs.h"
18738 #include <stdio.h>
18739 int
18740 main ()
18741 {
18742 printf("Hello");
18743   ;
18744   return 0;
18745 }
18746 _ACEOF
18747 rm -f conftest.$ac_objext conftest$ac_exeext
18748 if { (eval echo "$as_me:18748: \"$ac_link\"") >&5
18749   (eval $ac_link) 2>&5
18750   ac_status=$?
18751   echo "$as_me:18751: \$? = $ac_status" >&5
18752   (exit $ac_status); } &&
18753          { ac_try='test -s conftest$ac_exeext'
18754   { (eval echo "$as_me:18754: \"$ac_try\"") >&5
18755   (eval $ac_try) 2>&5
18756   ac_status=$?
18757   echo "$as_me:18757: \$? = $ac_status" >&5
18758   (exit $ac_status); }; }; then
18759   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
18760                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
18761 else
18762   echo "$as_me: failed program was:" >&5
18763 cat conftest.$ac_ext >&5
18764 fi
18765 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18766
18767                 # If we passed the link-test, but get a "not found" on a given library,
18768                 # this could be due to inept reconfiguration of gcc to make it only
18769                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
18770                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
18771                 # /usr/local libraries.
18772                 if test -n "$cf_rpath_oops"
18773                 then
18774                         for cf_rpath_src in $cf_rpath_oops
18775                         do
18776                                 for cf_rpath_dir in \
18777                                         /usr/local \
18778                                         /usr/pkg \
18779                                         /opt/sfw
18780                                 do
18781                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18782                                         then
18783                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18784
18785 echo "${as_me:-configure}:18785: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18786
18787                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18788                                                 break
18789                                         fi
18790                                 done
18791                         done
18792                 fi
18793         fi
18794
18795         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18796
18797 echo "${as_me:-configure}:18797: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18798
18799 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
18800
18801 echo "${as_me:-configure}:18801: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
18802
18803 cf_rpath_dst=
18804 for cf_rpath_src in $LDFLAGS
18805 do
18806         case $cf_rpath_src in
18807         (-L*)
18808
18809                 # check if this refers to a directory which we will ignore
18810                 cf_rpath_skip=no
18811                 if test -n "$cf_rpath_list"
18812                 then
18813                         for cf_rpath_item in $cf_rpath_list
18814                         do
18815                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18816                                 then
18817                                         cf_rpath_skip=yes
18818                                         break
18819                                 fi
18820                         done
18821                 fi
18822
18823                 if test "$cf_rpath_skip" = no
18824                 then
18825                         # transform the option
18826                         if test "$LD_RPATH_OPT" = "-R " ; then
18827                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18828                         else
18829                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18830                         fi
18831
18832                         # if we have not already added this, add it now
18833                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18834                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18835                         then
18836                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18837
18838 echo "${as_me:-configure}:18838: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18839
18840                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18841                         fi
18842                 fi
18843                 ;;
18844         esac
18845         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18846 done
18847 LDFLAGS=$cf_rpath_dst
18848
18849 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
18850
18851 echo "${as_me:-configure}:18851: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
18852
18853 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
18854
18855 echo "${as_me:-configure}:18855: testing ...checking LIBS $LIBS ..." 1>&5
18856
18857 cf_rpath_dst=
18858 for cf_rpath_src in $LIBS
18859 do
18860         case $cf_rpath_src in
18861         (-L*)
18862
18863                 # check if this refers to a directory which we will ignore
18864                 cf_rpath_skip=no
18865                 if test -n "$cf_rpath_list"
18866                 then
18867                         for cf_rpath_item in $cf_rpath_list
18868                         do
18869                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18870                                 then
18871                                         cf_rpath_skip=yes
18872                                         break
18873                                 fi
18874                         done
18875                 fi
18876
18877                 if test "$cf_rpath_skip" = no
18878                 then
18879                         # transform the option
18880                         if test "$LD_RPATH_OPT" = "-R " ; then
18881                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18882                         else
18883                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18884                         fi
18885
18886                         # if we have not already added this, add it now
18887                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18888                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18889                         then
18890                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18891
18892 echo "${as_me:-configure}:18892: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18893
18894                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18895                         fi
18896                 fi
18897                 ;;
18898         esac
18899         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18900 done
18901 LIBS=$cf_rpath_dst
18902
18903 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
18904
18905 echo "${as_me:-configure}:18905: testing ...checked LIBS $LIBS ..." 1>&5
18906
18907         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18908
18909 echo "${as_me:-configure}:18909: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18910
18911 else
18912         echo "$as_me:18912: result: no" >&5
18913 echo "${ECHO_T}no" >&6
18914 fi
18915
18916 fi
18917
18918 TEST_ARGS="$LIBS"
18919 LIBS=
18920
18921 ac_config_files="$ac_config_files Makefile"
18922 ac_config_commands="$ac_config_commands default"
18923 cat >confcache <<\_ACEOF
18924 # This file is a shell script that caches the results of configure
18925 # tests run on this system so they can be shared between configure
18926 # scripts and configure runs, see configure's option --config-cache.
18927 # It is not useful on other systems.  If it contains results you don't
18928 # want to keep, you may remove or edit it.
18929 #
18930 # config.status only pays attention to the cache file if you give it
18931 # the --recheck option to rerun configure.
18932 #
18933 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18934 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18935 # following values.
18936
18937 _ACEOF
18938
18939 # The following way of writing the cache mishandles newlines in values,
18940 # but we know of no workaround that is simple, portable, and efficient.
18941 # So, don't put newlines in cache variables' values.
18942 # Ultrix sh set writes to stderr and can't be redirected directly,
18943 # and sets the high bit in the cache file unless we assign to the vars.
18944 {
18945   (set) 2>&1 |
18946     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18947     *ac_space=\ *)
18948       # `set' does not quote correctly, so add quotes (double-quote
18949       # substitution turns \\\\ into \\, and sed turns \\ into \).
18950       sed -n \
18951         "s/'/'\\\\''/g;
18952           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18953       ;;
18954     *)
18955       # `set' quotes correctly as required by POSIX, so do not add quotes.
18956       sed -n \
18957         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18958       ;;
18959     esac;
18960 } |
18961   sed '
18962      t clear
18963      : clear
18964      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18965      t end
18966      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18967      : end' >>confcache
18968 if cmp -s $cache_file confcache; then :; else
18969   if test -w $cache_file; then
18970     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18971     cat confcache >$cache_file
18972   else
18973     echo "not updating unwritable cache $cache_file"
18974   fi
18975 fi
18976 rm -f confcache
18977
18978 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18979 # Let make expand exec_prefix.
18980 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18981
18982 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18983 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18984 # trailing colons and then remove the whole line if VPATH becomes empty
18985 # (actually we leave an empty line to preserve line numbers).
18986 if test "x$srcdir" = x.; then
18987   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18988 s/:*\$(srcdir):*/:/;
18989 s/:*\${srcdir}:*/:/;
18990 s/:*@srcdir@:*/:/;
18991 s/^\([^=]*=[    ]*\):*/\1/;
18992 s/:*$//;
18993 s/^[^=]*=[      ]*$//;
18994 }'
18995 fi
18996
18997 DEFS=-DHAVE_CONFIG_H
18998
18999 : ${CONFIG_STATUS=./config.status}
19000 ac_clean_files_save=$ac_clean_files
19001 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
19002 { echo "$as_me:19002: creating $CONFIG_STATUS" >&5
19003 echo "$as_me: creating $CONFIG_STATUS" >&6;}
19004 cat >$CONFIG_STATUS <<_ACEOF
19005 #! $SHELL
19006 # Generated automatically by configure.
19007 # Run this file to recreate the current configuration.
19008 # Compiler output produced by configure, useful for debugging
19009 # configure, is in config.log if it exists.
19010
19011 debug=false
19012 SHELL=\${CONFIG_SHELL-$SHELL}
19013 ac_cs_invocation="\$0 \$@"
19014
19015 _ACEOF
19016
19017 cat >>$CONFIG_STATUS <<\_ACEOF
19018 # Be Bourne compatible
19019 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
19020   emulate sh
19021   NULLCMD=:
19022 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
19023   set -o posix
19024 fi
19025
19026 # Name of the executable.
19027 as_me=`echo "$0" |sed 's,.*[\\/],,'`
19028
19029 if expr a : '\(a\)' >/dev/null 2>&1; then
19030   as_expr=expr
19031 else
19032   as_expr=false
19033 fi
19034
19035 rm -f conf$$ conf$$.exe conf$$.file
19036 echo >conf$$.file
19037 if ln -s conf$$.file conf$$ 2>/dev/null; then
19038   # We could just check for DJGPP; but this test a) works b) is more generic
19039   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
19040   if test -f conf$$.exe; then
19041     # Don't use ln at all; we don't have any links
19042     as_ln_s='cp -p'
19043   else
19044     as_ln_s='ln -s'
19045   fi
19046 elif ln conf$$.file conf$$ 2>/dev/null; then
19047   as_ln_s=ln
19048 else
19049   as_ln_s='cp -p'
19050 fi
19051 rm -f conf$$ conf$$.exe conf$$.file
19052
19053 as_executable_p="test -f"
19054
19055 # Support unset when possible.
19056 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
19057   as_unset=unset
19058 else
19059   as_unset=false
19060 fi
19061
19062 # NLS nuisances.
19063 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
19064 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
19065 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
19066 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
19067 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
19068 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
19069 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
19070 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
19071
19072 # IFS
19073 # We need space, tab and new line, in precisely that order.
19074 as_nl='
19075 '
19076 IFS="   $as_nl"
19077
19078 # CDPATH.
19079 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
19080
19081 exec 6>&1
19082
19083 _ACEOF
19084
19085 # Files that config.status was made for.
19086 if test -n "$ac_config_files"; then
19087   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
19088 fi
19089
19090 if test -n "$ac_config_headers"; then
19091   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
19092 fi
19093
19094 if test -n "$ac_config_links"; then
19095   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
19096 fi
19097
19098 if test -n "$ac_config_commands"; then
19099   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
19100 fi
19101
19102 cat >>$CONFIG_STATUS <<\EOF
19103
19104 ac_cs_usage="\
19105 \`$as_me' instantiates files from templates according to the
19106 current configuration.
19107
19108 Usage: $0 [OPTIONS] [FILE]...
19109
19110   -h, --help       print this help, then exit
19111   -V, --version    print version number, then exit
19112   -d, --debug      don't remove temporary files
19113       --recheck    update $as_me by reconfiguring in the same conditions
19114   --file=FILE[:TEMPLATE]
19115                    instantiate the configuration file FILE
19116   --header=FILE[:TEMPLATE]
19117                    instantiate the configuration header FILE
19118
19119 Configuration files:
19120 $config_files
19121
19122 Configuration headers:
19123 $config_headers
19124
19125 Configuration commands:
19126 $config_commands
19127
19128 Report bugs to <dickey@invisible-island.net>."
19129 EOF
19130
19131 cat >>$CONFIG_STATUS <<EOF
19132 ac_cs_version="\\
19133 config.status
19134 configured by $0, generated by GNU Autoconf 2.52.20150926,
19135   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
19136
19137 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
19138 Free Software Foundation, Inc.
19139 This config.status script is free software; the Free Software Foundation
19140 gives unlimited permission to copy, distribute and modify it."
19141 srcdir=$srcdir
19142 INSTALL="$INSTALL"
19143 EOF
19144
19145 cat >>$CONFIG_STATUS <<\EOF
19146 # If no file are specified by the user, then we need to provide default
19147 # value.  By we need to know if files were specified by the user.
19148 ac_need_defaults=:
19149 while test $# != 0
19150 do
19151   case $1 in
19152   --*=*)
19153     ac_option=`expr "x$1" : 'x\([^=]*\)='`
19154     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
19155     shift
19156     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
19157     shift
19158     ;;
19159   -*);;
19160   *) # This is not an option, so the user has probably given explicit
19161      # arguments.
19162      ac_need_defaults=false;;
19163   esac
19164
19165   case $1 in
19166   # Handling of the options.
19167 EOF
19168 cat >>$CONFIG_STATUS <<EOF
19169   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
19170     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
19171     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
19172 EOF
19173 cat >>$CONFIG_STATUS <<\EOF
19174   --version | --vers* | -V )
19175     echo "$ac_cs_version"; exit 0 ;;
19176   --he | --h)
19177     # Conflict between --help and --header
19178     { { echo "$as_me:19178: error: ambiguous option: $1
19179 Try \`$0 --help' for more information." >&5
19180 echo "$as_me: error: ambiguous option: $1
19181 Try \`$0 --help' for more information." >&2;}
19182    { (exit 1); exit 1; }; };;
19183   --help | --hel | -h )
19184     echo "$ac_cs_usage"; exit 0 ;;
19185   --debug | --d* | -d )
19186     debug=: ;;
19187   --file | --fil | --fi | --f )
19188     shift
19189     CONFIG_FILES="$CONFIG_FILES $1"
19190     ac_need_defaults=false;;
19191   --header | --heade | --head | --hea )
19192     shift
19193     CONFIG_HEADERS="$CONFIG_HEADERS $1"
19194     ac_need_defaults=false;;
19195
19196   # This is an error.
19197   -*) { { echo "$as_me:19197: error: unrecognized option: $1
19198 Try \`$0 --help' for more information." >&5
19199 echo "$as_me: error: unrecognized option: $1
19200 Try \`$0 --help' for more information." >&2;}
19201    { (exit 1); exit 1; }; } ;;
19202
19203   *) ac_config_targets="$ac_config_targets $1" ;;
19204
19205   esac
19206   shift
19207 done
19208
19209 exec 5>>config.log
19210 cat >&5 << _ACEOF
19211
19212 ## ----------------------- ##
19213 ## Running config.status.  ##
19214 ## ----------------------- ##
19215
19216 This file was extended by $as_me 2.52.20150926, executed with
19217   CONFIG_FILES    = $CONFIG_FILES
19218   CONFIG_HEADERS  = $CONFIG_HEADERS
19219   CONFIG_LINKS    = $CONFIG_LINKS
19220   CONFIG_COMMANDS = $CONFIG_COMMANDS
19221   > $ac_cs_invocation
19222 on `(hostname || uname -n) 2>/dev/null | sed 1q`
19223
19224 _ACEOF
19225 EOF
19226
19227 cat >>$CONFIG_STATUS <<EOF
19228 #
19229 # INIT-COMMANDS section.
19230 #
19231
19232 AWK="$AWK"
19233 ECHO_CC="$ECHO_CC"
19234 ECHO_LD="$ECHO_LD"
19235 SHOW_CC="$SHOW_LD"
19236
19237 EOF
19238
19239 cat >>$CONFIG_STATUS <<\EOF
19240 for ac_config_target in $ac_config_targets
19241 do
19242   case "$ac_config_target" in
19243   # Handling of arguments.
19244   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
19245   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
19246   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
19247   *) { { echo "$as_me:19247: error: invalid argument: $ac_config_target" >&5
19248 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
19249    { (exit 1); exit 1; }; };;
19250   esac
19251 done
19252
19253 # If the user did not use the arguments to specify the items to instantiate,
19254 # then the envvar interface is used.  Set only those that are not.
19255 # We use the long form for the default assignment because of an extremely
19256 # bizarre bug on SunOS 4.1.3.
19257 if $ac_need_defaults; then
19258   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
19259   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
19260   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
19261 fi
19262
19263 # Create a temporary directory, and hook for its removal unless debugging.
19264 $debug ||
19265 {
19266   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
19267   trap '{ (exit 1); exit 1; }' 1 2 13 15
19268 }
19269
19270 # Create a (secure) tmp directory for tmp files.
19271 : ${TMPDIR=/tmp}
19272 {
19273   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
19274   test -n "$tmp" && test -d "$tmp"
19275 }  ||
19276 {
19277   tmp=$TMPDIR/cs$$-$RANDOM
19278   (umask 077 && mkdir $tmp)
19279 } ||
19280 {
19281    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
19282    { (exit 1); exit 1; }
19283 }
19284
19285 EOF
19286
19287 cat >>$CONFIG_STATUS <<EOF
19288
19289 #
19290 # CONFIG_FILES section.
19291 #
19292
19293 # No need to generate the scripts if there are no CONFIG_FILES.
19294 # This happens for instance when ./config.status config.h
19295 if test -n "\$CONFIG_FILES"; then
19296   # Protect against being on the right side of a sed subst in config.status.
19297   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
19298    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
19299 s,@SHELL@,$SHELL,;t t
19300 s,@exec_prefix@,$exec_prefix,;t t
19301 s,@prefix@,$prefix,;t t
19302 s,@program_transform_name@,$program_transform_name,;t t
19303 s,@bindir@,$bindir,;t t
19304 s,@sbindir@,$sbindir,;t t
19305 s,@libexecdir@,$libexecdir,;t t
19306 s,@datarootdir@,$datarootdir,;t t
19307 s,@datadir@,$datadir,;t t
19308 s,@sysconfdir@,$sysconfdir,;t t
19309 s,@sharedstatedir@,$sharedstatedir,;t t
19310 s,@localstatedir@,$localstatedir,;t t
19311 s,@libdir@,$libdir,;t t
19312 s,@includedir@,$includedir,;t t
19313 s,@oldincludedir@,$oldincludedir,;t t
19314 s,@infodir@,$infodir,;t t
19315 s,@mandir@,$mandir,;t t
19316 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
19317 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
19318 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
19319 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
19320 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
19321 s,@build_alias@,$build_alias,;t t
19322 s,@host_alias@,$host_alias,;t t
19323 s,@target_alias@,$target_alias,;t t
19324 s,@ECHO_C@,$ECHO_C,;t t
19325 s,@ECHO_N@,$ECHO_N,;t t
19326 s,@ECHO_T@,$ECHO_T,;t t
19327 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
19328 s,@DEFS@,$DEFS,;t t
19329 s,@LIBS@,$LIBS,;t t
19330 s,@build@,$build,;t t
19331 s,@build_cpu@,$build_cpu,;t t
19332 s,@build_vendor@,$build_vendor,;t t
19333 s,@build_os@,$build_os,;t t
19334 s,@host@,$host,;t t
19335 s,@host_cpu@,$host_cpu,;t t
19336 s,@host_vendor@,$host_vendor,;t t
19337 s,@host_os@,$host_os,;t t
19338 s,@SET_MAKE@,$SET_MAKE,;t t
19339 s,@CC@,$CC,;t t
19340 s,@CFLAGS@,$CFLAGS,;t t
19341 s,@LDFLAGS@,$LDFLAGS,;t t
19342 s,@CPPFLAGS@,$CPPFLAGS,;t t
19343 s,@ac_ct_CC@,$ac_ct_CC,;t t
19344 s,@EXEEXT@,$EXEEXT,;t t
19345 s,@OBJEXT@,$OBJEXT,;t t
19346 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
19347 s,@CPP@,$CPP,;t t
19348 s,@AWK@,$AWK,;t t
19349 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
19350 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
19351 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
19352 s,@LINT@,$LINT,;t t
19353 s,@LINT_OPTS@,$LINT_OPTS,;t t
19354 s,@CTAGS@,$CTAGS,;t t
19355 s,@ETAGS@,$ETAGS,;t t
19356 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
19357 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
19358 s,@MATH_LIB@,$MATH_LIB,;t t
19359 s,@top_builddir@,$top_builddir,;t t
19360 s,@CC_G_OPT@,$CC_G_OPT,;t t
19361 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
19362 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
19363 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
19364 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
19365 s,@LD@,$LD,;t t
19366 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
19367 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
19368 s,@LD_MODEL@,$LD_MODEL,;t t
19369 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
19370 s,@LIBTOOL@,$LIBTOOL,;t t
19371 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
19372 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
19373 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
19374 s,@LIB_LINK@,$LIB_LINK,;t t
19375 s,@LINK_TESTS@,$LINK_TESTS,;t t
19376 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
19377 s,@PACKAGE@,$PACKAGE,;t t
19378 s,@PTHREAD@,$PTHREAD,;t t
19379 s,@TEST_ARGS@,$TEST_ARGS,;t t
19380 s,@TEST_DEPS@,$TEST_DEPS,;t t
19381 s,@TEST_LIBS@,$TEST_LIBS,;t t
19382 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
19383 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
19384 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
19385 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
19386 s,@includesubdir@,$includesubdir,;t t
19387 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
19388 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
19389 s,@ECHO_LT@,$ECHO_LT,;t t
19390 s,@ECHO_LD@,$ECHO_LD,;t t
19391 s,@RULE_CC@,$RULE_CC,;t t
19392 s,@SHOW_CC@,$SHOW_CC,;t t
19393 s,@ECHO_CC@,$ECHO_CC,;t t
19394 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
19395 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
19396 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
19397 s,@X_CFLAGS@,$X_CFLAGS,;t t
19398 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
19399 s,@X_LIBS@,$X_LIBS,;t t
19400 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
19401 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
19402 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
19403 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
19404 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
19405 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
19406 CEOF
19407
19408 EOF
19409
19410   cat >>$CONFIG_STATUS <<\EOF
19411   # Split the substitutions into bite-sized pieces for seds with
19412   # small command number limits, like on Digital OSF/1 and HP-UX.
19413   ac_max_sed_lines=48
19414   ac_sed_frag=1 # Number of current file.
19415   ac_beg=1 # First line for current file.
19416   ac_end=$ac_max_sed_lines # Line after last line for current file.
19417   ac_more_lines=:
19418   ac_sed_cmds=
19419   while $ac_more_lines; do
19420     if test $ac_beg -gt 1; then
19421       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19422     else
19423       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19424     fi
19425     if test ! -s $tmp/subs.frag; then
19426       ac_more_lines=false
19427     else
19428       # The purpose of the label and of the branching condition is to
19429       # speed up the sed processing (if there are no `@' at all, there
19430       # is no need to browse any of the substitutions).
19431       # These are the two extra sed commands mentioned above.
19432       (echo ':t
19433   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
19434       # It is possible to make a multiline substitution using escaped newlines.
19435       # Ensure that we do not split the substitution between script fragments.
19436       ac_BEG=$ac_end
19437       ac_END=`expr $ac_end + $ac_max_sed_lines`
19438       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
19439       if test -s $tmp/subs.next; then
19440         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
19441         if test ! -s $tmp/subs.edit; then
19442           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
19443           if test ! -s $tmp/subs.edit; then
19444             if test $ac_beg -gt 1; then
19445               ac_end=`expr $ac_end - 1`
19446               continue
19447             fi
19448           fi
19449         fi
19450       fi
19451
19452       if test -z "$ac_sed_cmds"; then
19453         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
19454       else
19455         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
19456       fi
19457       ac_sed_frag=`expr $ac_sed_frag + 1`
19458       ac_beg=$ac_end
19459       ac_end=`expr $ac_end + $ac_max_sed_lines`
19460     fi
19461   done
19462   if test -z "$ac_sed_cmds"; then
19463     ac_sed_cmds=cat
19464   fi
19465 fi # test -n "$CONFIG_FILES"
19466
19467 EOF
19468 cat >>$CONFIG_STATUS <<\EOF
19469 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19470   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19471   case $ac_file in
19472   - | *:- | *:-:* ) # input from stdin
19473         cat >$tmp/stdin
19474         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19475         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19476   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19477         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19478   * )   ac_file_in=$ac_file.in ;;
19479   esac
19480
19481   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19482   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19483          X"$ac_file" : 'X\(//\)[^/]' \| \
19484          X"$ac_file" : 'X\(//\)$' \| \
19485          X"$ac_file" : 'X\(/\)' \| \
19486          .     : '\(.\)' 2>/dev/null ||
19487 echo X"$ac_file" |
19488     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19489           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19490           /^X\(\/\/\)$/{ s//\1/; q; }
19491           /^X\(\/\).*/{ s//\1/; q; }
19492           s/.*/./; q'`
19493   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19494     { case "$ac_dir" in
19495   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19496   *)                      as_incr_dir=.;;
19497 esac
19498 as_dummy="$ac_dir"
19499 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19500   case $as_mkdir_dir in
19501     # Skip DOS drivespec
19502     ?:) as_incr_dir=$as_mkdir_dir ;;
19503     *)
19504       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19505       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19506     ;;
19507   esac
19508 done; }
19509
19510     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
19511     # A "../" for each directory in $ac_dir_suffix.
19512     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19513   else
19514     ac_dir_suffix= ac_dots=
19515   fi
19516
19517   case $srcdir in
19518   .)  ac_srcdir=.
19519       if test -z "$ac_dots"; then
19520          ac_top_srcdir=.
19521       else
19522          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
19523       fi ;;
19524   [\\/]* | ?:[\\/]* )
19525       ac_srcdir=$srcdir$ac_dir_suffix;
19526       ac_top_srcdir=$srcdir ;;
19527   *) # Relative path.
19528     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
19529     ac_top_srcdir=$ac_dots$srcdir ;;
19530   esac
19531
19532   case $INSTALL in
19533   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19534   *) ac_INSTALL=$ac_dots$INSTALL ;;
19535   esac
19536
19537   if test x"$ac_file" != x-; then
19538     { echo "$as_me:19538: creating $ac_file" >&5
19539 echo "$as_me: creating $ac_file" >&6;}
19540     rm -f "$ac_file"
19541   fi
19542   # Let's still pretend it is `configure' which instantiates (i.e., don't
19543   # use $as_me), people would be surprised to read:
19544   #    /* config.h.  Generated automatically by config.status.  */
19545   configure_input="Generated automatically from `echo $ac_file_in |
19546                                                  sed 's,.*/,,'` by configure."
19547
19548   # First look for the input files in the build tree, otherwise in the
19549   # src tree.
19550   ac_file_inputs=`IFS=:
19551     for f in $ac_file_in; do
19552       case $f in
19553       -) echo $tmp/stdin ;;
19554       [\\/$]*)
19555          # Absolute (can't be DOS-style, as IFS=:)
19556          test -f "$f" || { { echo "$as_me:19556: error: cannot find input file: $f" >&5
19557 echo "$as_me: error: cannot find input file: $f" >&2;}
19558    { (exit 1); exit 1; }; }
19559          echo $f;;
19560       *) # Relative
19561          if test -f "$f"; then
19562            # Build tree
19563            echo $f
19564          elif test -f "$srcdir/$f"; then
19565            # Source tree
19566            echo $srcdir/$f
19567          else
19568            # /dev/null tree
19569            { { echo "$as_me:19569: error: cannot find input file: $f" >&5
19570 echo "$as_me: error: cannot find input file: $f" >&2;}
19571    { (exit 1); exit 1; }; }
19572          fi;;
19573       esac
19574     done` || { (exit 1); exit 1; }
19575 EOF
19576 cat >>$CONFIG_STATUS <<\EOF
19577   ac_warn_datarootdir=no
19578   if test x"$ac_file" != x-; then
19579     for ac_item in $ac_file_inputs
19580     do
19581       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
19582       if test -n "$ac_seen"; then
19583         ac_used=`grep '@datarootdir@' $ac_item`
19584         if test -z "$ac_used"; then
19585           { echo "$as_me:19585: WARNING: datarootdir was used implicitly but not set:
19586 $ac_seen" >&5
19587 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19588 $ac_seen" >&2;}
19589           ac_warn_datarootdir=yes
19590         fi
19591       fi
19592       ac_seen=`grep '${datarootdir}' $ac_item`
19593       if test -n "$ac_seen"; then
19594         { echo "$as_me:19594: WARNING: datarootdir was used explicitly but not set:
19595 $ac_seen" >&5
19596 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19597 $ac_seen" >&2;}
19598         ac_warn_datarootdir=yes
19599       fi
19600     done
19601   fi
19602
19603 if test "x$ac_warn_datarootdir" = xyes; then
19604   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19605 fi
19606
19607 EOF
19608 cat >>$CONFIG_STATUS <<EOF
19609   sed "$ac_vpsub
19610 $extrasub
19611 EOF
19612 cat >>$CONFIG_STATUS <<\EOF
19613 :t
19614 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19615 s,@configure_input@,$configure_input,;t t
19616 s,@srcdir@,$ac_srcdir,;t t
19617 s,@top_srcdir@,$ac_top_srcdir,;t t
19618 s,@INSTALL@,$ac_INSTALL,;t t
19619 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19620   rm -f $tmp/stdin
19621   if test x"$ac_file" != x-; then
19622     cp $tmp/out $ac_file
19623
19624     for ac_name in prefix exec_prefix datarootdir
19625     do
19626         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
19627         if test -n "$ac_seen"; then
19628             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
19629             if test -z "$ac_init"; then
19630               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19631               { echo "$as_me:19631: WARNING: Variable $ac_name is used but was not set:
19632 $ac_seen" >&5
19633 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19634 $ac_seen" >&2;}
19635             fi
19636         fi
19637     done
19638     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
19639     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
19640     if test -s $tmp/out; then
19641       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19642       { echo "$as_me:19642: WARNING: Some variables may not be substituted:
19643 $ac_seen" >&5
19644 echo "$as_me: WARNING: Some variables may not be substituted:
19645 $ac_seen" >&2;}
19646     fi
19647   else
19648     cat $tmp/out
19649   fi
19650   rm -f $tmp/out
19651
19652 done
19653 EOF
19654 cat >>$CONFIG_STATUS <<\EOF
19655
19656 #
19657 # CONFIG_HEADER section.
19658 #
19659
19660 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19661 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19662 #
19663 # ac_d sets the value in "#define NAME VALUE" lines.
19664 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19665 ac_dB='[        ].*$,\1#\2'
19666 ac_dC=' '
19667 ac_dD=',;t'
19668 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19669 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19670 ac_iB='\([      ]\),\1#\2define\3'
19671 ac_iC=' '
19672 ac_iD='\4,;t'
19673 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19674 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19675 ac_uB='$,\1#\2define\3'
19676 ac_uC=' '
19677 ac_uD=',;t'
19678
19679 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19680   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19681   case $ac_file in
19682   - | *:- | *:-:* ) # input from stdin
19683         cat >$tmp/stdin
19684         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19685         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19686   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19687         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19688   * )   ac_file_in=$ac_file.in ;;
19689   esac
19690
19691   test x"$ac_file" != x- && { echo "$as_me:19691: creating $ac_file" >&5
19692 echo "$as_me: creating $ac_file" >&6;}
19693
19694   # First look for the input files in the build tree, otherwise in the
19695   # src tree.
19696   ac_file_inputs=`IFS=:
19697     for f in $ac_file_in; do
19698       case $f in
19699       -) echo $tmp/stdin ;;
19700       [\\/$]*)
19701          # Absolute (can't be DOS-style, as IFS=:)
19702          test -f "$f" || { { echo "$as_me:19702: error: cannot find input file: $f" >&5
19703 echo "$as_me: error: cannot find input file: $f" >&2;}
19704    { (exit 1); exit 1; }; }
19705          echo $f;;
19706       *) # Relative
19707          if test -f "$f"; then
19708            # Build tree
19709            echo $f
19710          elif test -f "$srcdir/$f"; then
19711            # Source tree
19712            echo $srcdir/$f
19713          else
19714            # /dev/null tree
19715            { { echo "$as_me:19715: error: cannot find input file: $f" >&5
19716 echo "$as_me: error: cannot find input file: $f" >&2;}
19717    { (exit 1); exit 1; }; }
19718          fi;;
19719       esac
19720     done` || { (exit 1); exit 1; }
19721   # Remove the trailing spaces.
19722   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19723
19724 EOF
19725
19726 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19727 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19728 # be either 'cat' or 'sort'.
19729 cat confdefs.h | uniq >conftest.vals
19730
19731 # Break up conftest.vals because some shells have a limit on
19732 # the size of here documents, and old seds have small limits too.
19733
19734 rm -f conftest.tail
19735 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
19736 while grep . conftest.vals >/dev/null
19737 do
19738   # Write chunks of a limited-size here document to conftest.frag.
19739   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
19740   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
19741   echo 'CEOF' >> $CONFIG_STATUS
19742   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
19743   rm -f conftest.vals
19744   mv conftest.tail conftest.vals
19745 done
19746 rm -f conftest.vals
19747
19748 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19749 # marker @DEFS@.
19750 echo '  cat >> conftest.edit <<CEOF
19751 /@DEFS@/r conftest.frag
19752 /@DEFS@/d
19753 CEOF
19754 sed -f conftest.edit $tmp/in > $tmp/out
19755 rm -f $tmp/in
19756 mv $tmp/out $tmp/in
19757 rm -f conftest.edit conftest.frag
19758 ' >> $CONFIG_STATUS
19759
19760 cat >>$CONFIG_STATUS <<\EOF
19761   # Let's still pretend it is `configure' which instantiates (i.e., don't
19762   # use $as_me), people would be surprised to read:
19763   #    /* config.h.  Generated automatically by config.status.  */
19764   if test x"$ac_file" = x-; then
19765     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19766   else
19767     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19768   fi
19769   cat $tmp/in >>$tmp/config.h
19770   rm -f $tmp/in
19771   if test x"$ac_file" != x-; then
19772     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19773       { echo "$as_me:19773: $ac_file is unchanged" >&5
19774 echo "$as_me: $ac_file is unchanged" >&6;}
19775     else
19776       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19777          X"$ac_file" : 'X\(//\)[^/]' \| \
19778          X"$ac_file" : 'X\(//\)$' \| \
19779          X"$ac_file" : 'X\(/\)' \| \
19780          .     : '\(.\)' 2>/dev/null ||
19781 echo X"$ac_file" |
19782     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19783           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19784           /^X\(\/\/\)$/{ s//\1/; q; }
19785           /^X\(\/\).*/{ s//\1/; q; }
19786           s/.*/./; q'`
19787       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19788         { case "$ac_dir" in
19789   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19790   *)                      as_incr_dir=.;;
19791 esac
19792 as_dummy="$ac_dir"
19793 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19794   case $as_mkdir_dir in
19795     # Skip DOS drivespec
19796     ?:) as_incr_dir=$as_mkdir_dir ;;
19797     *)
19798       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19799       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19800     ;;
19801   esac
19802 done; }
19803
19804       fi
19805       rm -f $ac_file
19806       mv $tmp/config.h $ac_file
19807     fi
19808   else
19809     cat $tmp/config.h
19810     rm -f $tmp/config.h
19811   fi
19812 done
19813 EOF
19814 cat >>$CONFIG_STATUS <<\EOF
19815 #
19816 # CONFIG_COMMANDS section.
19817 #
19818 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19819   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19820   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19821
19822   case $ac_dest in
19823     default )
19824
19825 for cf_dir in .
19826 do
19827         if test ! -d $srcdir/$cf_dir; then
19828                 continue
19829         elif test -f $srcdir/$cf_dir/programs; then
19830                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
19831         fi
19832 done
19833
19834         cat >>Makefile <<TEST_EOF
19835
19836 # These rules are generated so we do not rely on suffix rules, which do not
19837 # work consistently for different make-programs (the '\$(MODEL)/' confuses
19838 # some, and the '\$x' confuses others).
19839 TEST_EOF
19840
19841 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
19842 for N in $LIST
19843 do
19844         cat >>Makefile <<TEST_EOF
19845
19846 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
19847         \$(srcdir)/test.priv.h \\
19848         ncurses_cfg.h
19849         $SHOW_CC
19850         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
19851 TEST_EOF
19852 done
19853
19854 if test -f ../config.guess && test -f ../config.sub
19855 then
19856         cat >>Makefile <<TEST_EOF
19857
19858 # if we used CF_INHERIT for getting these files, we can remove them
19859 distclean::
19860         rm -f config.guess config.sub
19861 TEST_EOF
19862 fi
19863  ;;
19864   esac
19865 done
19866 EOF
19867
19868 cat >>$CONFIG_STATUS <<\EOF
19869
19870 { (exit 0); exit 0; }
19871 EOF
19872 chmod +x $CONFIG_STATUS
19873 ac_clean_files=$ac_clean_files_save
19874
19875 # configure is writing to config.log, and then calls config.status.
19876 # config.status does its own redirection, appending to config.log.
19877 # Unfortunately, on DOS this fails, as config.log is still kept open
19878 # by configure, so config.status won't be able to write to it; its
19879 # output is simply discarded.  So we exec the FD to /dev/null,
19880 # effectively closing config.log, so it can be properly (re)opened and
19881 # appended to by config.status.  When coming back to configure, we
19882 # need to make the FD available again.
19883 if test "$no_create" != yes; then
19884   ac_cs_success=:
19885   exec 5>/dev/null
19886   $SHELL $CONFIG_STATUS || ac_cs_success=false
19887   exec 5>>config.log
19888   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19889   # would make configure fail if this is the last instruction.
19890   $ac_cs_success || { (exit 1); exit 1; }
19891 fi
19892