]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
3860419c97c86642a18ea10381feefa14e197112
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20170501.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Features:
650   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
651   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
652
653 Optional Packages:
654   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
655   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
656
657 General Options:
658   --disable-stripping     do not strip installed executables
659   --enable-string-hacks   work around bogus compiler/loader warnings
660   --with-pkg-config{=path} enable/disable use of pkg-config
661   --disable-echo          do not display "compiling" commands
662 Curses Version-dependent Options:
663   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
664   --disable-widec         disable checks for wide-character functions
665   --with-curses-dir=DIR   directory in which (n)curses is installed
666   --with-screen=XXX       use specified curses-libraries
667   --with-ncursesw         use wide ncurses-libraries
668   --with-ncurses          use ncurses-libraries
669   --with-pdcurses         compile/link with pdcurses X11 library
670   --with-curses-colr      compile/link with HPUX 10.x color-curses
671   --with-curses-5lib      compile/link with SunOS 5lib curses
672   --with-Xaw3d            link with Xaw 3d library
673   --with-Xaw3dxft         link with Xaw 3d xft library
674   --with-neXtaw           link with neXT Athena library
675   --with-XawPlus          link with Athena-Plus library
676   --with-x                use the X Window System
677   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
678   --disable-panel         disable checks for panel functions
679   --disable-menu          disable checks for menu functions
680   --disable-form          disable checks for form functions
681 Testing/development Options:
682   --enable-warnings       test: turn on gcc compiler warnings
683   --with-dmalloc          test: use Gray Watson's dmalloc library
684   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
685   --with-valgrind         test: use valgrind
686   --disable-leaks         test: free permanent memory, analyze leaks
687   --disable-rpath-hack    don't add rpath options for additional libraries
688
689 Some influential environment variables:
690   CC          C compiler command
691   CFLAGS      C compiler flags
692   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
693               nonstandard directory <lib dir>
694   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
695               headers in a nonstandard directory <include dir>
696   CPP         C preprocessor
697
698 Use these variables to override the choices made by `configure' or to help
699 it to find libraries and programs with nonstandard names/locations.
700
701 EOF
702 fi
703
704 if test "$ac_init_help" = "recursive"; then
705   # If there are subdirs, report their specific --help.
706   ac_popdir=`pwd`
707   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
708     cd $ac_subdir
709     # A "../" for each directory in /$ac_subdir.
710     ac_dots=`echo $ac_subdir |
711              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
712
713     case $srcdir in
714     .) # No --srcdir option.  We are building in place.
715       ac_sub_srcdir=$srcdir ;;
716     [\\/]* | ?:[\\/]* ) # Absolute path.
717       ac_sub_srcdir=$srcdir/$ac_subdir ;;
718     *) # Relative path.
719       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
720     esac
721
722     # Check for guested configure; otherwise get Cygnus style configure.
723     if test -f $ac_sub_srcdir/configure.gnu; then
724       echo
725       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
726     elif test -f $ac_sub_srcdir/configure; then
727       echo
728       $SHELL $ac_sub_srcdir/configure  --help=recursive
729     elif test -f $ac_sub_srcdir/configure.ac ||
730            test -f $ac_sub_srcdir/configure.in; then
731       echo
732       $ac_configure --help
733     else
734       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
735     fi
736     cd $ac_popdir
737   done
738 fi
739
740 test -n "$ac_init_help" && exit 0
741 if $ac_init_version; then
742   cat <<\EOF
743
744 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
745 Free Software Foundation, Inc.
746 This configure script is free software; the Free Software Foundation
747 gives unlimited permission to copy, distribute and modify it.
748 EOF
749   exit 0
750 fi
751 exec 5>config.log
752 cat >&5 <<EOF
753 This file contains any messages produced by compilers while
754 running configure, to aid debugging if configure makes a mistake.
755
756 It was created by $as_me, which was
757 generated by GNU Autoconf 2.52.20170501.  Invocation command line was
758
759   $ $0 $@
760
761 EOF
762 {
763 cat <<_ASUNAME
764 ## ---------- ##
765 ## Platform.  ##
766 ## ---------- ##
767
768 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
769 uname -m = `(uname -m) 2>/dev/null || echo unknown`
770 uname -r = `(uname -r) 2>/dev/null || echo unknown`
771 uname -s = `(uname -s) 2>/dev/null || echo unknown`
772 uname -v = `(uname -v) 2>/dev/null || echo unknown`
773
774 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
775 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
776
777 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
778 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
779 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
780 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
781 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
782 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
783 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
784
785 PATH = $PATH
786
787 _ASUNAME
788 } >&5
789
790 cat >&5 <<EOF
791 ## ------------ ##
792 ## Core tests.  ##
793 ## ------------ ##
794
795 EOF
796
797 # Keep a trace of the command line.
798 # Strip out --no-create and --no-recursion so they do not pile up.
799 # Also quote any args containing shell meta-characters.
800 ac_configure_args=
801 ac_sep=
802 for ac_arg
803 do
804   case $ac_arg in
805   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
806   | --no-cr | --no-c) ;;
807   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
808   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
809   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
810     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
811     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
812     ac_sep=" " ;;
813   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
814      ac_sep=" " ;;
815   esac
816   # Get rid of the leading space.
817 done
818
819 # When interrupted or exit'd, cleanup temporary files, and complete
820 # config.log.  We remove comments because anyway the quotes in there
821 # would cause problems or look ugly.
822 trap 'exit_status=$?
823   # Save into config.log some information that might help in debugging.
824   echo >&5
825   echo "## ----------------- ##" >&5
826   echo "## Cache variables.  ##" >&5
827   echo "## ----------------- ##" >&5
828   echo >&5
829   # The following way of writing the cache mishandles newlines in values,
830 {
831   (set) 2>&1 |
832     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
833     *ac_space=\ *)
834       sed -n \
835         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
836           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
837       ;;
838     *)
839       sed -n \
840         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
841       ;;
842     esac;
843 } >&5
844   sed "/^$/d" confdefs.h >conftest.log
845   if test -s conftest.log; then
846     echo >&5
847     echo "## ------------ ##" >&5
848     echo "## confdefs.h.  ##" >&5
849     echo "## ------------ ##" >&5
850     echo >&5
851     cat conftest.log >&5
852   fi
853   (echo; echo) >&5
854   test "$ac_signal" != 0 &&
855     echo "$as_me: caught signal $ac_signal" >&5
856   echo "$as_me: exit $exit_status" >&5
857   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
858     exit $exit_status
859      ' 0
860 for ac_signal in 1 2 13 15; do
861   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
862 done
863 ac_signal=0
864
865 # confdefs.h avoids OS command line length limits that DEFS can exceed.
866 rm -rf conftest* confdefs.h
867 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
868 echo >confdefs.h
869
870 # Let the site file select an alternate cache file if it wants to.
871 # Prefer explicitly selected file to automatically selected ones.
872 if test -z "$CONFIG_SITE"; then
873   if test "x$prefix" != xNONE; then
874     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
875   else
876     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
877   fi
878 fi
879 for ac_site_file in $CONFIG_SITE; do
880   if test -r "$ac_site_file"; then
881     { echo "$as_me:881: loading site script $ac_site_file" >&5
882 echo "$as_me: loading site script $ac_site_file" >&6;}
883     cat "$ac_site_file" >&5
884     . "$ac_site_file"
885   fi
886 done
887
888 if test -r "$cache_file"; then
889   # Some versions of bash will fail to source /dev/null (special
890   # files actually), so we avoid doing that.
891   if test -f "$cache_file"; then
892     { echo "$as_me:892: loading cache $cache_file" >&5
893 echo "$as_me: loading cache $cache_file" >&6;}
894     case $cache_file in
895       [\\/]* | ?:[\\/]* ) . $cache_file;;
896       *)                      . ./$cache_file;;
897     esac
898   fi
899 else
900   { echo "$as_me:900: creating cache $cache_file" >&5
901 echo "$as_me: creating cache $cache_file" >&6;}
902   >$cache_file
903 fi
904
905 # Check that the precious variables saved in the cache have kept the same
906 # value.
907 ac_cache_corrupted=false
908 for ac_var in `(set) 2>&1 |
909                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
910   eval ac_old_set=\$ac_cv_env_${ac_var}_set
911   eval ac_new_set=\$ac_env_${ac_var}_set
912   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
913   eval ac_new_val="\$ac_env_${ac_var}_value"
914   case $ac_old_set,$ac_new_set in
915     set,)
916       { echo "$as_me:916: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
917 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
918       ac_cache_corrupted=: ;;
919     ,set)
920       { echo "$as_me:920: error: \`$ac_var' was not set in the previous run" >&5
921 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
922       ac_cache_corrupted=: ;;
923     ,);;
924     *)
925       if test "x$ac_old_val" != "x$ac_new_val"; then
926         { echo "$as_me:926: error: \`$ac_var' has changed since the previous run:" >&5
927 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
928         { echo "$as_me:928:   former value:  $ac_old_val" >&5
929 echo "$as_me:   former value:  $ac_old_val" >&2;}
930         { echo "$as_me:930:   current value: $ac_new_val" >&5
931 echo "$as_me:   current value: $ac_new_val" >&2;}
932         ac_cache_corrupted=:
933       fi;;
934   esac
935   # Pass precious variables to config.status.  It doesn't matter if
936   # we pass some twice (in addition to the command line arguments).
937   if test "$ac_new_set" = set; then
938     case $ac_new_val in
939     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
940       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
941       ac_configure_args="$ac_configure_args '$ac_arg'"
942       ;;
943     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
944        ;;
945     esac
946   fi
947 done
948 if $ac_cache_corrupted; then
949   { echo "$as_me:949: error: changes in the environment can compromise the build" >&5
950 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
951   { { echo "$as_me:951: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
952 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
953    { (exit 1); exit 1; }; }
954 fi
955
956 ac_ext=c
957 ac_cpp='$CPP $CPPFLAGS'
958 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
959 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
960 ac_compiler_gnu=$ac_cv_c_compiler_gnu
961 ac_main_return=return
962
963 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
964   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
965                    ECHO_T='     ' ;;
966   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
967   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
968 esac
969 echo "#! $SHELL" >conftest.sh
970 echo  "exit 0"   >>conftest.sh
971 chmod +x conftest.sh
972 if { (echo "$as_me:972: PATH=\".;.\"; conftest.sh") >&5
973   (PATH=".;."; conftest.sh) 2>&5
974   ac_status=$?
975   echo "$as_me:975: \$? = $ac_status" >&5
976   (exit $ac_status); }; then
977   ac_path_separator=';'
978 else
979   ac_path_separator=:
980 fi
981 PATH_SEPARATOR="$ac_path_separator"
982 rm -f conftest.sh
983
984 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
985
986 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
987
988 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
989
990 ac_aux_dir=
991 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
992   if test -f $ac_dir/install-sh; then
993     ac_aux_dir=$ac_dir
994     ac_install_sh="$ac_aux_dir/install-sh -c"
995     break
996   elif test -f $ac_dir/install.sh; then
997     ac_aux_dir=$ac_dir
998     ac_install_sh="$ac_aux_dir/install.sh -c"
999     break
1000   elif test -f $ac_dir/shtool; then
1001     ac_aux_dir=$ac_dir
1002     ac_install_sh="$ac_aux_dir/shtool install -c"
1003     break
1004   fi
1005 done
1006 if test -z "$ac_aux_dir"; then
1007   { { echo "$as_me:1007: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1008 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1009    { (exit 1); exit 1; }; }
1010 fi
1011 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1012 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1013 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1014
1015 # Make sure we can run config.sub.
1016 $ac_config_sub sun4 >/dev/null 2>&1 ||
1017   { { echo "$as_me:1017: error: cannot run $ac_config_sub" >&5
1018 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1019    { (exit 1); exit 1; }; }
1020
1021 echo "$as_me:1021: checking build system type" >&5
1022 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1023 if test "${ac_cv_build+set}" = set; then
1024   echo $ECHO_N "(cached) $ECHO_C" >&6
1025 else
1026   ac_cv_build_alias=$build_alias
1027 test -z "$ac_cv_build_alias" &&
1028   ac_cv_build_alias=`$ac_config_guess`
1029 test -z "$ac_cv_build_alias" &&
1030   { { echo "$as_me:1030: error: cannot guess build type; you must specify one" >&5
1031 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1032    { (exit 1); exit 1; }; }
1033 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1034   { { echo "$as_me:1034: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1035 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1036    { (exit 1); exit 1; }; }
1037
1038 fi
1039 echo "$as_me:1039: result: $ac_cv_build" >&5
1040 echo "${ECHO_T}$ac_cv_build" >&6
1041 build=$ac_cv_build
1042 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1043 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1044 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1045
1046 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1047         echo "$as_me:1047: checking host system type" >&5
1048 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1049 if test "${ac_cv_host+set}" = set; then
1050   echo $ECHO_N "(cached) $ECHO_C" >&6
1051 else
1052   ac_cv_host_alias=$host_alias
1053 test -z "$ac_cv_host_alias" &&
1054   ac_cv_host_alias=$ac_cv_build_alias
1055 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1056   { { echo "$as_me:1056: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1057 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1058    { (exit 1); exit 1; }; }
1059
1060 fi
1061 echo "$as_me:1061: result: $ac_cv_host" >&5
1062 echo "${ECHO_T}$ac_cv_host" >&6
1063 host=$ac_cv_host
1064 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1065 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1066 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1067
1068         system_name="$host_os"
1069 else
1070         system_name="`(uname -s -r) 2>/dev/null`"
1071         if test -z "$system_name" ; then
1072                 system_name="`(hostname) 2>/dev/null`"
1073         fi
1074 fi
1075 test -n "$system_name" &&
1076 cat >>confdefs.h <<EOF
1077 #define SYSTEM_NAME "$system_name"
1078 EOF
1079
1080 if test "${cf_cv_system_name+set}" = set; then
1081   echo $ECHO_N "(cached) $ECHO_C" >&6
1082 else
1083   cf_cv_system_name="$system_name"
1084 fi
1085
1086 test -z "$system_name" && system_name="$cf_cv_system_name"
1087 test -n "$cf_cv_system_name" && echo "$as_me:1087: result: Configuring for $cf_cv_system_name" >&5
1088 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1089
1090 if test ".$system_name" != ".$cf_cv_system_name" ; then
1091         echo "$as_me:1091: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1092 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1093         { { echo "$as_me:1093: error: \"Please remove config.cache and try again.\"" >&5
1094 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1095    { (exit 1); exit 1; }; }
1096 fi
1097
1098 test "$program_prefix" != NONE &&
1099   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1100 # Use a double $ so make ignores it.
1101 test "$program_suffix" != NONE &&
1102   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1103 # Double any \ or $.  echo might interpret backslashes.
1104 # By default was `s,x,x', remove it if useless.
1105 cat <<\_ACEOF >conftest.sed
1106 s/[\\$]/&&/g;s/;s,x,x,$//
1107 _ACEOF
1108 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1109 rm conftest.sed
1110
1111 echo "$as_me:1111: checking whether ${MAKE-make} sets \${MAKE}" >&5
1112 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1113 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1114 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1115   echo $ECHO_N "(cached) $ECHO_C" >&6
1116 else
1117   cat >conftest.make <<\EOF
1118 all:
1119         @echo 'ac_maketemp="${MAKE}"'
1120 EOF
1121 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1122 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1123 if test -n "$ac_maketemp"; then
1124   eval ac_cv_prog_make_${ac_make}_set=yes
1125 else
1126   eval ac_cv_prog_make_${ac_make}_set=no
1127 fi
1128 rm -f conftest.make
1129 fi
1130 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1131   echo "$as_me:1131: result: yes" >&5
1132 echo "${ECHO_T}yes" >&6
1133   SET_MAKE=
1134 else
1135   echo "$as_me:1135: result: no" >&5
1136 echo "${ECHO_T}no" >&6
1137   SET_MAKE="MAKE=${MAKE-make}"
1138 fi
1139
1140 ac_ext=c
1141 ac_cpp='$CPP $CPPFLAGS'
1142 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1143 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1144 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1145 ac_main_return=return
1146 if test -n "$ac_tool_prefix"; then
1147   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1148 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1149 echo "$as_me:1149: checking for $ac_word" >&5
1150 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1151 if test "${ac_cv_prog_CC+set}" = set; then
1152   echo $ECHO_N "(cached) $ECHO_C" >&6
1153 else
1154   if test -n "$CC"; then
1155   ac_cv_prog_CC="$CC" # Let the user override the test.
1156 else
1157   ac_save_IFS=$IFS; IFS=$ac_path_separator
1158 ac_dummy="$PATH"
1159 for ac_dir in $ac_dummy; do
1160   IFS=$ac_save_IFS
1161   test -z "$ac_dir" && ac_dir=.
1162   $as_executable_p "$ac_dir/$ac_word" || continue
1163 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1164 echo "$as_me:1164: found $ac_dir/$ac_word" >&5
1165 break
1166 done
1167
1168 fi
1169 fi
1170 CC=$ac_cv_prog_CC
1171 if test -n "$CC"; then
1172   echo "$as_me:1172: result: $CC" >&5
1173 echo "${ECHO_T}$CC" >&6
1174 else
1175   echo "$as_me:1175: result: no" >&5
1176 echo "${ECHO_T}no" >&6
1177 fi
1178
1179 fi
1180 if test -z "$ac_cv_prog_CC"; then
1181   ac_ct_CC=$CC
1182   # Extract the first word of "gcc", so it can be a program name with args.
1183 set dummy gcc; ac_word=$2
1184 echo "$as_me:1184: checking for $ac_word" >&5
1185 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1186 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1187   echo $ECHO_N "(cached) $ECHO_C" >&6
1188 else
1189   if test -n "$ac_ct_CC"; then
1190   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1191 else
1192   ac_save_IFS=$IFS; IFS=$ac_path_separator
1193 ac_dummy="$PATH"
1194 for ac_dir in $ac_dummy; do
1195   IFS=$ac_save_IFS
1196   test -z "$ac_dir" && ac_dir=.
1197   $as_executable_p "$ac_dir/$ac_word" || continue
1198 ac_cv_prog_ac_ct_CC="gcc"
1199 echo "$as_me:1199: found $ac_dir/$ac_word" >&5
1200 break
1201 done
1202
1203 fi
1204 fi
1205 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1206 if test -n "$ac_ct_CC"; then
1207   echo "$as_me:1207: result: $ac_ct_CC" >&5
1208 echo "${ECHO_T}$ac_ct_CC" >&6
1209 else
1210   echo "$as_me:1210: result: no" >&5
1211 echo "${ECHO_T}no" >&6
1212 fi
1213
1214   CC=$ac_ct_CC
1215 else
1216   CC="$ac_cv_prog_CC"
1217 fi
1218
1219 if test -z "$CC"; then
1220   if test -n "$ac_tool_prefix"; then
1221   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1222 set dummy ${ac_tool_prefix}cc; ac_word=$2
1223 echo "$as_me:1223: checking for $ac_word" >&5
1224 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1225 if test "${ac_cv_prog_CC+set}" = set; then
1226   echo $ECHO_N "(cached) $ECHO_C" >&6
1227 else
1228   if test -n "$CC"; then
1229   ac_cv_prog_CC="$CC" # Let the user override the test.
1230 else
1231   ac_save_IFS=$IFS; IFS=$ac_path_separator
1232 ac_dummy="$PATH"
1233 for ac_dir in $ac_dummy; do
1234   IFS=$ac_save_IFS
1235   test -z "$ac_dir" && ac_dir=.
1236   $as_executable_p "$ac_dir/$ac_word" || continue
1237 ac_cv_prog_CC="${ac_tool_prefix}cc"
1238 echo "$as_me:1238: found $ac_dir/$ac_word" >&5
1239 break
1240 done
1241
1242 fi
1243 fi
1244 CC=$ac_cv_prog_CC
1245 if test -n "$CC"; then
1246   echo "$as_me:1246: result: $CC" >&5
1247 echo "${ECHO_T}$CC" >&6
1248 else
1249   echo "$as_me:1249: result: no" >&5
1250 echo "${ECHO_T}no" >&6
1251 fi
1252
1253 fi
1254 if test -z "$ac_cv_prog_CC"; then
1255   ac_ct_CC=$CC
1256   # Extract the first word of "cc", so it can be a program name with args.
1257 set dummy cc; ac_word=$2
1258 echo "$as_me:1258: checking for $ac_word" >&5
1259 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1260 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1261   echo $ECHO_N "(cached) $ECHO_C" >&6
1262 else
1263   if test -n "$ac_ct_CC"; then
1264   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1265 else
1266   ac_save_IFS=$IFS; IFS=$ac_path_separator
1267 ac_dummy="$PATH"
1268 for ac_dir in $ac_dummy; do
1269   IFS=$ac_save_IFS
1270   test -z "$ac_dir" && ac_dir=.
1271   $as_executable_p "$ac_dir/$ac_word" || continue
1272 ac_cv_prog_ac_ct_CC="cc"
1273 echo "$as_me:1273: found $ac_dir/$ac_word" >&5
1274 break
1275 done
1276
1277 fi
1278 fi
1279 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1280 if test -n "$ac_ct_CC"; then
1281   echo "$as_me:1281: result: $ac_ct_CC" >&5
1282 echo "${ECHO_T}$ac_ct_CC" >&6
1283 else
1284   echo "$as_me:1284: result: no" >&5
1285 echo "${ECHO_T}no" >&6
1286 fi
1287
1288   CC=$ac_ct_CC
1289 else
1290   CC="$ac_cv_prog_CC"
1291 fi
1292
1293 fi
1294 if test -z "$CC"; then
1295   # Extract the first word of "cc", so it can be a program name with args.
1296 set dummy cc; ac_word=$2
1297 echo "$as_me:1297: checking for $ac_word" >&5
1298 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1299 if test "${ac_cv_prog_CC+set}" = set; then
1300   echo $ECHO_N "(cached) $ECHO_C" >&6
1301 else
1302   if test -n "$CC"; then
1303   ac_cv_prog_CC="$CC" # Let the user override the test.
1304 else
1305   ac_prog_rejected=no
1306   ac_save_IFS=$IFS; IFS=$ac_path_separator
1307 ac_dummy="$PATH"
1308 for ac_dir in $ac_dummy; do
1309   IFS=$ac_save_IFS
1310   test -z "$ac_dir" && ac_dir=.
1311   $as_executable_p "$ac_dir/$ac_word" || continue
1312 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1313   ac_prog_rejected=yes
1314   continue
1315 fi
1316 ac_cv_prog_CC="cc"
1317 echo "$as_me:1317: found $ac_dir/$ac_word" >&5
1318 break
1319 done
1320
1321 if test $ac_prog_rejected = yes; then
1322   # We found a bogon in the path, so make sure we never use it.
1323   set dummy $ac_cv_prog_CC
1324   shift
1325   if test $# != 0; then
1326     # We chose a different compiler from the bogus one.
1327     # However, it has the same basename, so the bogon will be chosen
1328     # first if we set CC to just the basename; use the full file name.
1329     shift
1330     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1331     shift
1332     ac_cv_prog_CC="$@"
1333   fi
1334 fi
1335 fi
1336 fi
1337 CC=$ac_cv_prog_CC
1338 if test -n "$CC"; then
1339   echo "$as_me:1339: result: $CC" >&5
1340 echo "${ECHO_T}$CC" >&6
1341 else
1342   echo "$as_me:1342: result: no" >&5
1343 echo "${ECHO_T}no" >&6
1344 fi
1345
1346 fi
1347 if test -z "$CC"; then
1348   if test -n "$ac_tool_prefix"; then
1349   for ac_prog in cl
1350   do
1351     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1352 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1353 echo "$as_me:1353: checking for $ac_word" >&5
1354 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1355 if test "${ac_cv_prog_CC+set}" = set; then
1356   echo $ECHO_N "(cached) $ECHO_C" >&6
1357 else
1358   if test -n "$CC"; then
1359   ac_cv_prog_CC="$CC" # Let the user override the test.
1360 else
1361   ac_save_IFS=$IFS; IFS=$ac_path_separator
1362 ac_dummy="$PATH"
1363 for ac_dir in $ac_dummy; do
1364   IFS=$ac_save_IFS
1365   test -z "$ac_dir" && ac_dir=.
1366   $as_executable_p "$ac_dir/$ac_word" || continue
1367 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1368 echo "$as_me:1368: found $ac_dir/$ac_word" >&5
1369 break
1370 done
1371
1372 fi
1373 fi
1374 CC=$ac_cv_prog_CC
1375 if test -n "$CC"; then
1376   echo "$as_me:1376: result: $CC" >&5
1377 echo "${ECHO_T}$CC" >&6
1378 else
1379   echo "$as_me:1379: result: no" >&5
1380 echo "${ECHO_T}no" >&6
1381 fi
1382
1383     test -n "$CC" && break
1384   done
1385 fi
1386 if test -z "$CC"; then
1387   ac_ct_CC=$CC
1388   for ac_prog in cl
1389 do
1390   # Extract the first word of "$ac_prog", so it can be a program name with args.
1391 set dummy $ac_prog; ac_word=$2
1392 echo "$as_me:1392: checking for $ac_word" >&5
1393 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1394 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1395   echo $ECHO_N "(cached) $ECHO_C" >&6
1396 else
1397   if test -n "$ac_ct_CC"; then
1398   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1399 else
1400   ac_save_IFS=$IFS; IFS=$ac_path_separator
1401 ac_dummy="$PATH"
1402 for ac_dir in $ac_dummy; do
1403   IFS=$ac_save_IFS
1404   test -z "$ac_dir" && ac_dir=.
1405   $as_executable_p "$ac_dir/$ac_word" || continue
1406 ac_cv_prog_ac_ct_CC="$ac_prog"
1407 echo "$as_me:1407: found $ac_dir/$ac_word" >&5
1408 break
1409 done
1410
1411 fi
1412 fi
1413 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1414 if test -n "$ac_ct_CC"; then
1415   echo "$as_me:1415: result: $ac_ct_CC" >&5
1416 echo "${ECHO_T}$ac_ct_CC" >&6
1417 else
1418   echo "$as_me:1418: result: no" >&5
1419 echo "${ECHO_T}no" >&6
1420 fi
1421
1422   test -n "$ac_ct_CC" && break
1423 done
1424
1425   CC=$ac_ct_CC
1426 fi
1427
1428 fi
1429
1430 test -z "$CC" && { { echo "$as_me:1430: error: no acceptable cc found in \$PATH" >&5
1431 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1432    { (exit 1); exit 1; }; }
1433
1434 # Provide some information about the compiler.
1435 echo "$as_me:1435:" \
1436      "checking for C compiler version" >&5
1437 ac_compiler=`set X $ac_compile; echo $2`
1438 { (eval echo "$as_me:1438: \"$ac_compiler --version </dev/null >&5\"") >&5
1439   (eval $ac_compiler --version </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 { (eval echo "$as_me:1448: \"$ac_compiler -V </dev/null >&5\"") >&5
1449   (eval $ac_compiler -V </dev/null >&5) 2>&5
1450   ac_status=$?
1451   echo "$as_me:1451: \$? = $ac_status" >&5
1452   (exit $ac_status); }
1453
1454 cat >conftest.$ac_ext <<_ACEOF
1455 #line 1455 "configure"
1456 #include "confdefs.h"
1457
1458 int
1459 main (void)
1460 {
1461
1462   ;
1463   return 0;
1464 }
1465 _ACEOF
1466 ac_clean_files_save=$ac_clean_files
1467 ac_clean_files="$ac_clean_files a.out a.exe"
1468 # Try to create an executable without -o first, disregard a.out.
1469 # It will help us diagnose broken compilers, and finding out an intuition
1470 # of exeext.
1471 echo "$as_me:1471: checking for C compiler default output" >&5
1472 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1473 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1474 if { (eval echo "$as_me:1474: \"$ac_link_default\"") >&5
1475   (eval $ac_link_default) 2>&5
1476   ac_status=$?
1477   echo "$as_me:1477: \$? = $ac_status" >&5
1478   (exit $ac_status); }; then
1479   # Find the output, starting from the most likely.  This scheme is
1480 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1481 # resort.
1482 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1483                 ls a.out conftest 2>/dev/null;
1484                 ls a.* conftest.* 2>/dev/null`; do
1485   case $ac_file in
1486     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1487     a.out ) # We found the default executable, but exeext='' is most
1488             # certainly right.
1489             break;;
1490     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1491           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1492           export ac_cv_exeext
1493           break;;
1494     * ) break;;
1495   esac
1496 done
1497 else
1498   echo "$as_me: failed program was:" >&5
1499 cat conftest.$ac_ext >&5
1500 { { echo "$as_me:1500: error: C compiler cannot create executables" >&5
1501 echo "$as_me: error: C compiler cannot create executables" >&2;}
1502    { (exit 77); exit 77; }; }
1503 fi
1504
1505 ac_exeext=$ac_cv_exeext
1506 echo "$as_me:1506: result: $ac_file" >&5
1507 echo "${ECHO_T}$ac_file" >&6
1508
1509 # Check the compiler produces executables we can run.  If not, either
1510 # the compiler is broken, or we cross compile.
1511 echo "$as_me:1511: checking whether the C compiler works" >&5
1512 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1513 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1514 # If not cross compiling, check that we can run a simple program.
1515 if test "$cross_compiling" != yes; then
1516   if { ac_try='./$ac_file'
1517   { (eval echo "$as_me:1517: \"$ac_try\"") >&5
1518   (eval $ac_try) 2>&5
1519   ac_status=$?
1520   echo "$as_me:1520: \$? = $ac_status" >&5
1521   (exit $ac_status); }; }; then
1522     cross_compiling=no
1523   else
1524     if test "$cross_compiling" = maybe; then
1525         cross_compiling=yes
1526     else
1527         { { echo "$as_me:1527: error: cannot run C compiled programs.
1528 If you meant to cross compile, use \`--host'." >&5
1529 echo "$as_me: error: cannot run C compiled programs.
1530 If you meant to cross compile, use \`--host'." >&2;}
1531    { (exit 1); exit 1; }; }
1532     fi
1533   fi
1534 fi
1535 echo "$as_me:1535: result: yes" >&5
1536 echo "${ECHO_T}yes" >&6
1537
1538 rm -f a.out a.exe conftest$ac_cv_exeext
1539 ac_clean_files=$ac_clean_files_save
1540 # Check the compiler produces executables we can run.  If not, either
1541 # the compiler is broken, or we cross compile.
1542 echo "$as_me:1542: checking whether we are cross compiling" >&5
1543 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1544 echo "$as_me:1544: result: $cross_compiling" >&5
1545 echo "${ECHO_T}$cross_compiling" >&6
1546
1547 echo "$as_me:1547: checking for executable suffix" >&5
1548 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1549 if { (eval echo "$as_me:1549: \"$ac_link\"") >&5
1550   (eval $ac_link) 2>&5
1551   ac_status=$?
1552   echo "$as_me:1552: \$? = $ac_status" >&5
1553   (exit $ac_status); }; then
1554   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1555 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1556 # work properly (i.e., refer to `conftest.exe'), while it won't with
1557 # `rm'.
1558 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1559   case $ac_file in
1560     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1561     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1562           export ac_cv_exeext
1563           break;;
1564     * ) break;;
1565   esac
1566 done
1567 else
1568   { { echo "$as_me:1568: error: cannot compute EXEEXT: cannot compile and link" >&5
1569 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1570    { (exit 1); exit 1; }; }
1571 fi
1572
1573 rm -f conftest$ac_cv_exeext
1574 echo "$as_me:1574: result: $ac_cv_exeext" >&5
1575 echo "${ECHO_T}$ac_cv_exeext" >&6
1576
1577 rm -f conftest.$ac_ext
1578 EXEEXT=$ac_cv_exeext
1579 ac_exeext=$EXEEXT
1580 echo "$as_me:1580: checking for object suffix" >&5
1581 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1582 if test "${ac_cv_objext+set}" = set; then
1583   echo $ECHO_N "(cached) $ECHO_C" >&6
1584 else
1585   cat >conftest.$ac_ext <<_ACEOF
1586 #line 1586 "configure"
1587 #include "confdefs.h"
1588
1589 int
1590 main (void)
1591 {
1592
1593   ;
1594   return 0;
1595 }
1596 _ACEOF
1597 rm -f conftest.o conftest.obj
1598 if { (eval echo "$as_me:1598: \"$ac_compile\"") >&5
1599   (eval $ac_compile) 2>&5
1600   ac_status=$?
1601   echo "$as_me:1601: \$? = $ac_status" >&5
1602   (exit $ac_status); }; then
1603   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1604   case $ac_file in
1605     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1606     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1607        break;;
1608   esac
1609 done
1610 else
1611   echo "$as_me: failed program was:" >&5
1612 cat conftest.$ac_ext >&5
1613 { { echo "$as_me:1613: error: cannot compute OBJEXT: cannot compile" >&5
1614 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1615    { (exit 1); exit 1; }; }
1616 fi
1617
1618 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1619 fi
1620 echo "$as_me:1620: result: $ac_cv_objext" >&5
1621 echo "${ECHO_T}$ac_cv_objext" >&6
1622 OBJEXT=$ac_cv_objext
1623 ac_objext=$OBJEXT
1624 echo "$as_me:1624: checking whether we are using the GNU C compiler" >&5
1625 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1626 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1627   echo $ECHO_N "(cached) $ECHO_C" >&6
1628 else
1629   cat >conftest.$ac_ext <<_ACEOF
1630 #line 1630 "configure"
1631 #include "confdefs.h"
1632
1633 int
1634 main (void)
1635 {
1636 #ifndef __GNUC__
1637        choke me
1638 #endif
1639
1640   ;
1641   return 0;
1642 }
1643 _ACEOF
1644 rm -f conftest.$ac_objext
1645 if { (eval echo "$as_me:1645: \"$ac_compile\"") >&5
1646   (eval $ac_compile) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); } &&
1650          { ac_try='test -s conftest.$ac_objext'
1651   { (eval echo "$as_me:1651: \"$ac_try\"") >&5
1652   (eval $ac_try) 2>&5
1653   ac_status=$?
1654   echo "$as_me:1654: \$? = $ac_status" >&5
1655   (exit $ac_status); }; }; then
1656   ac_compiler_gnu=yes
1657 else
1658   echo "$as_me: failed program was:" >&5
1659 cat conftest.$ac_ext >&5
1660 ac_compiler_gnu=no
1661 fi
1662 rm -f conftest.$ac_objext conftest.$ac_ext
1663 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1664
1665 fi
1666 echo "$as_me:1666: result: $ac_cv_c_compiler_gnu" >&5
1667 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1668 GCC=`test $ac_compiler_gnu = yes && echo yes`
1669 ac_test_CFLAGS=${CFLAGS+set}
1670 ac_save_CFLAGS=$CFLAGS
1671 CFLAGS="-g"
1672 echo "$as_me:1672: checking whether $CC accepts -g" >&5
1673 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1674 if test "${ac_cv_prog_cc_g+set}" = set; then
1675   echo $ECHO_N "(cached) $ECHO_C" >&6
1676 else
1677   cat >conftest.$ac_ext <<_ACEOF
1678 #line 1678 "configure"
1679 #include "confdefs.h"
1680
1681 int
1682 main (void)
1683 {
1684
1685   ;
1686   return 0;
1687 }
1688 _ACEOF
1689 rm -f conftest.$ac_objext
1690 if { (eval echo "$as_me:1690: \"$ac_compile\"") >&5
1691   (eval $ac_compile) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); } &&
1695          { ac_try='test -s conftest.$ac_objext'
1696   { (eval echo "$as_me:1696: \"$ac_try\"") >&5
1697   (eval $ac_try) 2>&5
1698   ac_status=$?
1699   echo "$as_me:1699: \$? = $ac_status" >&5
1700   (exit $ac_status); }; }; then
1701   ac_cv_prog_cc_g=yes
1702 else
1703   echo "$as_me: failed program was:" >&5
1704 cat conftest.$ac_ext >&5
1705 ac_cv_prog_cc_g=no
1706 fi
1707 rm -f conftest.$ac_objext conftest.$ac_ext
1708 fi
1709 echo "$as_me:1709: result: $ac_cv_prog_cc_g" >&5
1710 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1711 if test "$ac_test_CFLAGS" = set; then
1712   CFLAGS=$ac_save_CFLAGS
1713 elif test $ac_cv_prog_cc_g = yes; then
1714   if test "$GCC" = yes; then
1715     CFLAGS="-g -O2"
1716   else
1717     CFLAGS="-g"
1718   fi
1719 else
1720   if test "$GCC" = yes; then
1721     CFLAGS="-O2"
1722   else
1723     CFLAGS=
1724   fi
1725 fi
1726 # Some people use a C++ compiler to compile C.  Since we use `exit',
1727 # in C++ we need to declare it.  In case someone uses the same compiler
1728 # for both compiling C and C++ we need to have the C++ compiler decide
1729 # the declaration of exit, since it's the most demanding environment.
1730 cat >conftest.$ac_ext <<_ACEOF
1731 #ifndef __cplusplus
1732   choke me
1733 #endif
1734 _ACEOF
1735 rm -f conftest.$ac_objext
1736 if { (eval echo "$as_me:1736: \"$ac_compile\"") >&5
1737   (eval $ac_compile) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); } &&
1741          { ac_try='test -s conftest.$ac_objext'
1742   { (eval echo "$as_me:1742: \"$ac_try\"") >&5
1743   (eval $ac_try) 2>&5
1744   ac_status=$?
1745   echo "$as_me:1745: \$? = $ac_status" >&5
1746   (exit $ac_status); }; }; then
1747   for ac_declaration in \
1748    ''\
1749    '#include <stdlib.h>' \
1750    'extern "C" void std::exit (int) throw (); using std::exit;' \
1751    'extern "C" void std::exit (int); using std::exit;' \
1752    'extern "C" void exit (int) throw ();' \
1753    'extern "C" void exit (int);' \
1754    'void exit (int);'
1755 do
1756   cat >conftest.$ac_ext <<_ACEOF
1757 #line 1757 "configure"
1758 #include "confdefs.h"
1759 #include <stdlib.h>
1760 $ac_declaration
1761 int
1762 main (void)
1763 {
1764 exit (42);
1765   ;
1766   return 0;
1767 }
1768 _ACEOF
1769 rm -f conftest.$ac_objext
1770 if { (eval echo "$as_me:1770: \"$ac_compile\"") >&5
1771   (eval $ac_compile) 2>&5
1772   ac_status=$?
1773   echo "$as_me:1773: \$? = $ac_status" >&5
1774   (exit $ac_status); } &&
1775          { ac_try='test -s conftest.$ac_objext'
1776   { (eval echo "$as_me:1776: \"$ac_try\"") >&5
1777   (eval $ac_try) 2>&5
1778   ac_status=$?
1779   echo "$as_me:1779: \$? = $ac_status" >&5
1780   (exit $ac_status); }; }; then
1781   :
1782 else
1783   echo "$as_me: failed program was:" >&5
1784 cat conftest.$ac_ext >&5
1785 continue
1786 fi
1787 rm -f conftest.$ac_objext conftest.$ac_ext
1788   cat >conftest.$ac_ext <<_ACEOF
1789 #line 1789 "configure"
1790 #include "confdefs.h"
1791 $ac_declaration
1792 int
1793 main (void)
1794 {
1795 exit (42);
1796   ;
1797   return 0;
1798 }
1799 _ACEOF
1800 rm -f conftest.$ac_objext
1801 if { (eval echo "$as_me:1801: \"$ac_compile\"") >&5
1802   (eval $ac_compile) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit $ac_status); } &&
1806          { ac_try='test -s conftest.$ac_objext'
1807   { (eval echo "$as_me:1807: \"$ac_try\"") >&5
1808   (eval $ac_try) 2>&5
1809   ac_status=$?
1810   echo "$as_me:1810: \$? = $ac_status" >&5
1811   (exit $ac_status); }; }; then
1812   break
1813 else
1814   echo "$as_me: failed program was:" >&5
1815 cat conftest.$ac_ext >&5
1816 fi
1817 rm -f conftest.$ac_objext conftest.$ac_ext
1818 done
1819 rm -rf conftest*
1820 if test -n "$ac_declaration"; then
1821   echo '#ifdef __cplusplus' >>confdefs.h
1822   echo $ac_declaration      >>confdefs.h
1823   echo '#endif'             >>confdefs.h
1824 fi
1825
1826 else
1827   echo "$as_me: failed program was:" >&5
1828 cat conftest.$ac_ext >&5
1829 fi
1830 rm -f conftest.$ac_objext conftest.$ac_ext
1831 ac_ext=c
1832 ac_cpp='$CPP $CPPFLAGS'
1833 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1834 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1835 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1836 ac_main_return=return
1837
1838 GCC_VERSION=none
1839 if test "$GCC" = yes ; then
1840         echo "$as_me:1840: checking version of $CC" >&5
1841 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1842         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.].*//'`"
1843         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1844         echo "$as_me:1844: result: $GCC_VERSION" >&5
1845 echo "${ECHO_T}$GCC_VERSION" >&6
1846 fi
1847
1848 echo "$as_me:1848: checking for $CC option to accept ANSI C" >&5
1849 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1850 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1851   echo $ECHO_N "(cached) $ECHO_C" >&6
1852 else
1853   ac_cv_prog_cc_stdc=no
1854 ac_save_CC=$CC
1855 cat >conftest.$ac_ext <<_ACEOF
1856 #line 1856 "configure"
1857 #include "confdefs.h"
1858 #include <stdarg.h>
1859 #include <stdio.h>
1860 #include <sys/types.h>
1861 #include <sys/stat.h>
1862 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1863 struct buf { int x; };
1864 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1865 static char *e (p, i)
1866      char **p;
1867      int i;
1868 {
1869   return p[i];
1870 }
1871 static char *f (char * (*g) (char **, int), char **p, ...)
1872 {
1873   char *s;
1874   va_list v;
1875   va_start (v,p);
1876   s = g (p, va_arg (v,int));
1877   va_end (v);
1878   return s;
1879 }
1880 int test (int i, double x);
1881 struct s1 {int (*f) (int a);};
1882 struct s2 {int (*f) (double a);};
1883 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1884 int argc;
1885 char **argv;
1886 int
1887 main (void)
1888 {
1889 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1890   ;
1891   return 0;
1892 }
1893 _ACEOF
1894 # Don't try gcc -ansi; that turns off useful extensions and
1895 # breaks some systems' header files.
1896 # AIX                   -qlanglvl=ansi
1897 # Ultrix and OSF/1      -std1
1898 # HP-UX 10.20 and later -Ae
1899 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1900 # SVR4                  -Xc -D__EXTENSIONS__
1901 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1902 do
1903   CC="$ac_save_CC $ac_arg"
1904   rm -f conftest.$ac_objext
1905 if { (eval echo "$as_me:1905: \"$ac_compile\"") >&5
1906   (eval $ac_compile) 2>&5
1907   ac_status=$?
1908   echo "$as_me:1908: \$? = $ac_status" >&5
1909   (exit $ac_status); } &&
1910          { ac_try='test -s conftest.$ac_objext'
1911   { (eval echo "$as_me:1911: \"$ac_try\"") >&5
1912   (eval $ac_try) 2>&5
1913   ac_status=$?
1914   echo "$as_me:1914: \$? = $ac_status" >&5
1915   (exit $ac_status); }; }; then
1916   ac_cv_prog_cc_stdc=$ac_arg
1917 break
1918 else
1919   echo "$as_me: failed program was:" >&5
1920 cat conftest.$ac_ext >&5
1921 fi
1922 rm -f conftest.$ac_objext
1923 done
1924 rm -f conftest.$ac_ext conftest.$ac_objext
1925 CC=$ac_save_CC
1926
1927 fi
1928
1929 case "x$ac_cv_prog_cc_stdc" in
1930   x|xno)
1931     echo "$as_me:1931: result: none needed" >&5
1932 echo "${ECHO_T}none needed" >&6 ;;
1933   *)
1934     echo "$as_me:1934: result: $ac_cv_prog_cc_stdc" >&5
1935 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1936     CC="$CC $ac_cv_prog_cc_stdc" ;;
1937 esac
1938
1939 # This should have been defined by AC_PROG_CC
1940 : ${CC:=cc}
1941
1942 echo "$as_me:1942: checking \$CC variable" >&5
1943 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1944 case "$CC" in
1945 (*[\ \  ]-*)
1946         echo "$as_me:1946: result: broken" >&5
1947 echo "${ECHO_T}broken" >&6
1948         { echo "$as_me:1948: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1949 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1950         # humor him...
1951         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1952         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1953         CC="$cf_prog"
1954         for cf_arg in $cf_flags
1955         do
1956                 case "x$cf_arg" in
1957                 (x-[IUDfgOW]*)
1958
1959 cf_fix_cppflags=no
1960 cf_new_cflags=
1961 cf_new_cppflags=
1962 cf_new_extra_cppflags=
1963
1964 for cf_add_cflags in $cf_arg
1965 do
1966 case $cf_fix_cppflags in
1967 (no)
1968         case $cf_add_cflags in
1969         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1970                 case $cf_add_cflags in
1971                 (-D*)
1972                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1973
1974                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1975                                 && test -z "${cf_tst_cflags}" \
1976                                 && cf_fix_cppflags=yes
1977
1978                         if test $cf_fix_cppflags = yes ; then
1979
1980         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1981         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1982
1983                                 continue
1984                         elif test "${cf_tst_cflags}" = "\"'" ; then
1985
1986         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1987         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1988
1989                                 continue
1990                         fi
1991                         ;;
1992                 esac
1993                 case "$CPPFLAGS" in
1994                 (*$cf_add_cflags)
1995                         ;;
1996                 (*)
1997                         case $cf_add_cflags in
1998                         (-D*)
1999                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2000
2001 CPPFLAGS=`echo "$CPPFLAGS" | \
2002         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2003                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2004
2005                                 ;;
2006                         esac
2007
2008         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2009         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2010
2011                         ;;
2012                 esac
2013                 ;;
2014         (*)
2015
2016         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2017         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2018
2019                 ;;
2020         esac
2021         ;;
2022 (yes)
2023
2024         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2025         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2026
2027         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2028
2029         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2030                 && test -z "${cf_tst_cflags}" \
2031                 && cf_fix_cppflags=no
2032         ;;
2033 esac
2034 done
2035
2036 if test -n "$cf_new_cflags" ; then
2037
2038         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2039         CFLAGS="${CFLAGS}$cf_new_cflags"
2040
2041 fi
2042
2043 if test -n "$cf_new_cppflags" ; then
2044
2045         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2046         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2047
2048 fi
2049
2050 if test -n "$cf_new_extra_cppflags" ; then
2051
2052         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2053         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2054
2055 fi
2056
2057                         ;;
2058                 (*)
2059                         CC="$CC $cf_arg"
2060                         ;;
2061                 esac
2062         done
2063         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2064
2065 echo "${as_me:-configure}:2065: testing resulting CC: '$CC' ..." 1>&5
2066
2067         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2068
2069 echo "${as_me:-configure}:2069: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2070
2071         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2072
2073 echo "${as_me:-configure}:2073: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2074
2075         ;;
2076 (*)
2077         echo "$as_me:2077: result: ok" >&5
2078 echo "${ECHO_T}ok" >&6
2079         ;;
2080 esac
2081
2082 echo "$as_me:2082: checking for inline" >&5
2083 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2084 if test "${ac_cv_c_inline+set}" = set; then
2085   echo $ECHO_N "(cached) $ECHO_C" >&6
2086 else
2087   ac_cv_c_inline=no
2088 for ac_kw in inline __inline__ __inline; do
2089   cat >conftest.$ac_ext <<_ACEOF
2090 #line 2090 "configure"
2091 #include "confdefs.h"
2092 #ifndef __cplusplus
2093 static $ac_kw int static_foo () {return 0; }
2094 $ac_kw int foo () {return 0; }
2095 #endif
2096
2097 _ACEOF
2098 rm -f conftest.$ac_objext
2099 if { (eval echo "$as_me:2099: \"$ac_compile\"") >&5
2100   (eval $ac_compile) 2>&5
2101   ac_status=$?
2102   echo "$as_me:2102: \$? = $ac_status" >&5
2103   (exit $ac_status); } &&
2104          { ac_try='test -s conftest.$ac_objext'
2105   { (eval echo "$as_me:2105: \"$ac_try\"") >&5
2106   (eval $ac_try) 2>&5
2107   ac_status=$?
2108   echo "$as_me:2108: \$? = $ac_status" >&5
2109   (exit $ac_status); }; }; then
2110   ac_cv_c_inline=$ac_kw; break
2111 else
2112   echo "$as_me: failed program was:" >&5
2113 cat conftest.$ac_ext >&5
2114 fi
2115 rm -f conftest.$ac_objext conftest.$ac_ext
2116 done
2117
2118 fi
2119 echo "$as_me:2119: result: $ac_cv_c_inline" >&5
2120 echo "${ECHO_T}$ac_cv_c_inline" >&6
2121 case $ac_cv_c_inline in
2122   inline | yes) ;;
2123   no)
2124 cat >>confdefs.h <<\EOF
2125 #define inline
2126 EOF
2127  ;;
2128   *)  cat >>confdefs.h <<EOF
2129 #define inline $ac_cv_c_inline
2130 EOF
2131  ;;
2132 esac
2133
2134 ac_ext=c
2135 ac_cpp='$CPP $CPPFLAGS'
2136 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2137 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2138 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2139 ac_main_return=return
2140 echo "$as_me:2140: checking how to run the C preprocessor" >&5
2141 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2142 # On Suns, sometimes $CPP names a directory.
2143 if test -n "$CPP" && test -d "$CPP"; then
2144   CPP=
2145 fi
2146 if test -z "$CPP"; then
2147   if test "${ac_cv_prog_CPP+set}" = set; then
2148   echo $ECHO_N "(cached) $ECHO_C" >&6
2149 else
2150       # Double quotes because CPP needs to be expanded
2151     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2152     do
2153       ac_preproc_ok=false
2154 for ac_c_preproc_warn_flag in '' yes
2155 do
2156   # Use a header file that comes with gcc, so configuring glibc
2157   # with a fresh cross-compiler works.
2158   # On the NeXT, cc -E runs the code through the compiler's parser,
2159   # not just through cpp. "Syntax error" is here to catch this case.
2160   cat >conftest.$ac_ext <<_ACEOF
2161 #line 2161 "configure"
2162 #include "confdefs.h"
2163 #include <assert.h>
2164                      Syntax error
2165 _ACEOF
2166 if { (eval echo "$as_me:2166: \"$ac_cpp conftest.$ac_ext\"") >&5
2167   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2168   ac_status=$?
2169   egrep -v '^ *\+' conftest.er1 >conftest.err
2170   rm -f conftest.er1
2171   cat conftest.err >&5
2172   echo "$as_me:2172: \$? = $ac_status" >&5
2173   (exit $ac_status); } >/dev/null; then
2174   if test -s conftest.err; then
2175     ac_cpp_err=$ac_c_preproc_warn_flag
2176   else
2177     ac_cpp_err=
2178   fi
2179 else
2180   ac_cpp_err=yes
2181 fi
2182 if test -z "$ac_cpp_err"; then
2183   :
2184 else
2185   echo "$as_me: failed program was:" >&5
2186   cat conftest.$ac_ext >&5
2187   # Broken: fails on valid input.
2188 continue
2189 fi
2190 rm -f conftest.err conftest.$ac_ext
2191
2192   # OK, works on sane cases.  Now check whether non-existent headers
2193   # can be detected and how.
2194   cat >conftest.$ac_ext <<_ACEOF
2195 #line 2195 "configure"
2196 #include "confdefs.h"
2197 #include <ac_nonexistent.h>
2198 _ACEOF
2199 if { (eval echo "$as_me:2199: \"$ac_cpp conftest.$ac_ext\"") >&5
2200   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2201   ac_status=$?
2202   egrep -v '^ *\+' conftest.er1 >conftest.err
2203   rm -f conftest.er1
2204   cat conftest.err >&5
2205   echo "$as_me:2205: \$? = $ac_status" >&5
2206   (exit $ac_status); } >/dev/null; then
2207   if test -s conftest.err; then
2208     ac_cpp_err=$ac_c_preproc_warn_flag
2209   else
2210     ac_cpp_err=
2211   fi
2212 else
2213   ac_cpp_err=yes
2214 fi
2215 if test -z "$ac_cpp_err"; then
2216   # Broken: success on invalid input.
2217 continue
2218 else
2219   echo "$as_me: failed program was:" >&5
2220   cat conftest.$ac_ext >&5
2221   # Passes both tests.
2222 ac_preproc_ok=:
2223 break
2224 fi
2225 rm -f conftest.err conftest.$ac_ext
2226
2227 done
2228 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2229 rm -f conftest.err conftest.$ac_ext
2230 if $ac_preproc_ok; then
2231   break
2232 fi
2233
2234     done
2235     ac_cv_prog_CPP=$CPP
2236
2237 fi
2238   CPP=$ac_cv_prog_CPP
2239 else
2240   ac_cv_prog_CPP=$CPP
2241 fi
2242 echo "$as_me:2242: result: $CPP" >&5
2243 echo "${ECHO_T}$CPP" >&6
2244 ac_preproc_ok=false
2245 for ac_c_preproc_warn_flag in '' yes
2246 do
2247   # Use a header file that comes with gcc, so configuring glibc
2248   # with a fresh cross-compiler works.
2249   # On the NeXT, cc -E runs the code through the compiler's parser,
2250   # not just through cpp. "Syntax error" is here to catch this case.
2251   cat >conftest.$ac_ext <<_ACEOF
2252 #line 2252 "configure"
2253 #include "confdefs.h"
2254 #include <assert.h>
2255                      Syntax error
2256 _ACEOF
2257 if { (eval echo "$as_me:2257: \"$ac_cpp conftest.$ac_ext\"") >&5
2258   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2259   ac_status=$?
2260   egrep -v '^ *\+' conftest.er1 >conftest.err
2261   rm -f conftest.er1
2262   cat conftest.err >&5
2263   echo "$as_me:2263: \$? = $ac_status" >&5
2264   (exit $ac_status); } >/dev/null; then
2265   if test -s conftest.err; then
2266     ac_cpp_err=$ac_c_preproc_warn_flag
2267   else
2268     ac_cpp_err=
2269   fi
2270 else
2271   ac_cpp_err=yes
2272 fi
2273 if test -z "$ac_cpp_err"; then
2274   :
2275 else
2276   echo "$as_me: failed program was:" >&5
2277   cat conftest.$ac_ext >&5
2278   # Broken: fails on valid input.
2279 continue
2280 fi
2281 rm -f conftest.err conftest.$ac_ext
2282
2283   # OK, works on sane cases.  Now check whether non-existent headers
2284   # can be detected and how.
2285   cat >conftest.$ac_ext <<_ACEOF
2286 #line 2286 "configure"
2287 #include "confdefs.h"
2288 #include <ac_nonexistent.h>
2289 _ACEOF
2290 if { (eval echo "$as_me:2290: \"$ac_cpp conftest.$ac_ext\"") >&5
2291   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2292   ac_status=$?
2293   egrep -v '^ *\+' conftest.er1 >conftest.err
2294   rm -f conftest.er1
2295   cat conftest.err >&5
2296   echo "$as_me:2296: \$? = $ac_status" >&5
2297   (exit $ac_status); } >/dev/null; then
2298   if test -s conftest.err; then
2299     ac_cpp_err=$ac_c_preproc_warn_flag
2300   else
2301     ac_cpp_err=
2302   fi
2303 else
2304   ac_cpp_err=yes
2305 fi
2306 if test -z "$ac_cpp_err"; then
2307   # Broken: success on invalid input.
2308 continue
2309 else
2310   echo "$as_me: failed program was:" >&5
2311   cat conftest.$ac_ext >&5
2312   # Passes both tests.
2313 ac_preproc_ok=:
2314 break
2315 fi
2316 rm -f conftest.err conftest.$ac_ext
2317
2318 done
2319 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2320 rm -f conftest.err conftest.$ac_ext
2321 if $ac_preproc_ok; then
2322   :
2323 else
2324   { { echo "$as_me:2324: error: C preprocessor \"$CPP\" fails sanity check" >&5
2325 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2326    { (exit 1); exit 1; }; }
2327 fi
2328
2329 ac_ext=c
2330 ac_cpp='$CPP $CPPFLAGS'
2331 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2332 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2333 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2334 ac_main_return=return
2335
2336 for ac_prog in mawk gawk nawk awk
2337 do
2338   # Extract the first word of "$ac_prog", so it can be a program name with args.
2339 set dummy $ac_prog; ac_word=$2
2340 echo "$as_me:2340: checking for $ac_word" >&5
2341 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2342 if test "${ac_cv_prog_AWK+set}" = set; then
2343   echo $ECHO_N "(cached) $ECHO_C" >&6
2344 else
2345   if test -n "$AWK"; then
2346   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2347 else
2348   ac_save_IFS=$IFS; IFS=$ac_path_separator
2349 ac_dummy="$PATH"
2350 for ac_dir in $ac_dummy; do
2351   IFS=$ac_save_IFS
2352   test -z "$ac_dir" && ac_dir=.
2353   $as_executable_p "$ac_dir/$ac_word" || continue
2354 ac_cv_prog_AWK="$ac_prog"
2355 echo "$as_me:2355: found $ac_dir/$ac_word" >&5
2356 break
2357 done
2358
2359 fi
2360 fi
2361 AWK=$ac_cv_prog_AWK
2362 if test -n "$AWK"; then
2363   echo "$as_me:2363: result: $AWK" >&5
2364 echo "${ECHO_T}$AWK" >&6
2365 else
2366   echo "$as_me:2366: result: no" >&5
2367 echo "${ECHO_T}no" >&6
2368 fi
2369
2370   test -n "$AWK" && break
2371 done
2372
2373 # Find a good install program.  We prefer a C program (faster),
2374 # so one script is as good as another.  But avoid the broken or
2375 # incompatible versions:
2376 # SysV /etc/install, /usr/sbin/install
2377 # SunOS /usr/etc/install
2378 # IRIX /sbin/install
2379 # AIX /bin/install
2380 # AmigaOS /C/install, which installs bootblocks on floppy discs
2381 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2382 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2383 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2384 # ./install, which can be erroneously created by make from ./install.sh.
2385 echo "$as_me:2385: checking for a BSD compatible install" >&5
2386 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2387 if test -z "$INSTALL"; then
2388 if test "${ac_cv_path_install+set}" = set; then
2389   echo $ECHO_N "(cached) $ECHO_C" >&6
2390 else
2391     ac_save_IFS=$IFS; IFS=$ac_path_separator
2392   for ac_dir in $PATH; do
2393     IFS=$ac_save_IFS
2394     # Account for people who put trailing slashes in PATH elements.
2395     case $ac_dir/ in
2396     / | ./ | .// | /cC/* \
2397     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2398     | /usr/ucb/* ) ;;
2399     *)
2400       # OSF1 and SCO ODT 3.0 have their own names for install.
2401       # Don't use installbsd from OSF since it installs stuff as root
2402       # by default.
2403       for ac_prog in ginstall scoinst install; do
2404         if $as_executable_p "$ac_dir/$ac_prog"; then
2405           if test $ac_prog = install &&
2406             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2407             # AIX install.  It has an incompatible calling convention.
2408             :
2409           elif test $ac_prog = install &&
2410             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2411             # program-specific install script used by HP pwplus--don't use.
2412             :
2413           else
2414             ac_cv_path_install="$ac_dir/$ac_prog -c"
2415             break 2
2416           fi
2417         fi
2418       done
2419       ;;
2420     esac
2421   done
2422
2423 fi
2424   if test "${ac_cv_path_install+set}" = set; then
2425     INSTALL=$ac_cv_path_install
2426   else
2427     # As a last resort, use the slow shell script.  We don't cache a
2428     # path for INSTALL within a source directory, because that will
2429     # break other packages using the cache if that directory is
2430     # removed, or if the path is relative.
2431     INSTALL=$ac_install_sh
2432   fi
2433 fi
2434 echo "$as_me:2434: result: $INSTALL" >&5
2435 echo "${ECHO_T}$INSTALL" >&6
2436
2437 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2438 # It thinks the first close brace ends the variable substitution.
2439 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2440
2441 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2442
2443 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2444
2445 case $INSTALL in
2446 (/*)
2447         ;;
2448 (*)
2449         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2450         test -z "$cf_dir" && cf_dir=.
2451         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2452         ;;
2453 esac
2454
2455 echo "$as_me:2455: checking if you want to install stripped executables" >&5
2456 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2457
2458 # Check whether --enable-stripping or --disable-stripping was given.
2459 if test "${enable_stripping+set}" = set; then
2460   enableval="$enable_stripping"
2461   test "$enableval" != no && enableval=yes
2462         if test "$enableval" != "yes" ; then
2463     with_stripping=no
2464         else
2465                 with_stripping=yes
2466         fi
2467 else
2468   enableval=yes
2469         with_stripping=yes
2470
2471 fi;
2472 echo "$as_me:2472: result: $with_stripping" >&5
2473 echo "${ECHO_T}$with_stripping" >&6
2474
2475 if test "$with_stripping" = yes
2476 then
2477         INSTALL_OPT_S="-s"
2478 else
2479         INSTALL_OPT_S=
2480 fi
2481
2482 echo "$as_me:2482: checking if install needs to be told about ownership" >&5
2483 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2484 case `$ac_config_guess` in
2485 (*minix)
2486         with_install_o=yes
2487         ;;
2488 (*)
2489         with_install_o=no
2490         ;;
2491 esac
2492
2493 echo "$as_me:2493: result: $with_install_o" >&5
2494 echo "${ECHO_T}$with_install_o" >&6
2495 if test "x$with_install_o" = xyes
2496 then
2497         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2498 else
2499         INSTALL_OPT_O=
2500 fi
2501
2502 for ac_prog in lint cppcheck splint
2503 do
2504   # Extract the first word of "$ac_prog", so it can be a program name with args.
2505 set dummy $ac_prog; ac_word=$2
2506 echo "$as_me:2506: checking for $ac_word" >&5
2507 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2508 if test "${ac_cv_prog_LINT+set}" = set; then
2509   echo $ECHO_N "(cached) $ECHO_C" >&6
2510 else
2511   if test -n "$LINT"; then
2512   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2513 else
2514   ac_save_IFS=$IFS; IFS=$ac_path_separator
2515 ac_dummy="$PATH"
2516 for ac_dir in $ac_dummy; do
2517   IFS=$ac_save_IFS
2518   test -z "$ac_dir" && ac_dir=.
2519   $as_executable_p "$ac_dir/$ac_word" || continue
2520 ac_cv_prog_LINT="$ac_prog"
2521 echo "$as_me:2521: found $ac_dir/$ac_word" >&5
2522 break
2523 done
2524
2525 fi
2526 fi
2527 LINT=$ac_cv_prog_LINT
2528 if test -n "$LINT"; then
2529   echo "$as_me:2529: result: $LINT" >&5
2530 echo "${ECHO_T}$LINT" >&6
2531 else
2532   echo "$as_me:2532: result: no" >&5
2533 echo "${ECHO_T}no" >&6
2534 fi
2535
2536   test -n "$LINT" && break
2537 done
2538
2539 echo "$as_me:2539: checking if filesystem supports mixed-case filenames" >&5
2540 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2541 if test "${cf_cv_mixedcase+set}" = set; then
2542   echo $ECHO_N "(cached) $ECHO_C" >&6
2543 else
2544
2545 if test "$cross_compiling" = yes ; then
2546         case $target_alias in
2547         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2548                 cf_cv_mixedcase=no
2549                 ;;
2550         (*)
2551                 cf_cv_mixedcase=yes
2552                 ;;
2553         esac
2554 else
2555         rm -f conftest CONFTEST
2556         echo test >conftest
2557         if test -f CONFTEST ; then
2558                 cf_cv_mixedcase=no
2559         else
2560                 cf_cv_mixedcase=yes
2561         fi
2562         rm -f conftest CONFTEST
2563 fi
2564
2565 fi
2566 echo "$as_me:2566: result: $cf_cv_mixedcase" >&5
2567 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2568 test "$cf_cv_mixedcase" = yes &&
2569 cat >>confdefs.h <<\EOF
2570 #define MIXEDCASE_FILENAMES 1
2571 EOF
2572
2573 for ac_prog in exctags ctags
2574 do
2575   # Extract the first word of "$ac_prog", so it can be a program name with args.
2576 set dummy $ac_prog; ac_word=$2
2577 echo "$as_me:2577: checking for $ac_word" >&5
2578 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2579 if test "${ac_cv_prog_CTAGS+set}" = set; then
2580   echo $ECHO_N "(cached) $ECHO_C" >&6
2581 else
2582   if test -n "$CTAGS"; then
2583   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2584 else
2585   ac_save_IFS=$IFS; IFS=$ac_path_separator
2586 ac_dummy="$PATH"
2587 for ac_dir in $ac_dummy; do
2588   IFS=$ac_save_IFS
2589   test -z "$ac_dir" && ac_dir=.
2590   $as_executable_p "$ac_dir/$ac_word" || continue
2591 ac_cv_prog_CTAGS="$ac_prog"
2592 echo "$as_me:2592: found $ac_dir/$ac_word" >&5
2593 break
2594 done
2595
2596 fi
2597 fi
2598 CTAGS=$ac_cv_prog_CTAGS
2599 if test -n "$CTAGS"; then
2600   echo "$as_me:2600: result: $CTAGS" >&5
2601 echo "${ECHO_T}$CTAGS" >&6
2602 else
2603   echo "$as_me:2603: result: no" >&5
2604 echo "${ECHO_T}no" >&6
2605 fi
2606
2607   test -n "$CTAGS" && break
2608 done
2609
2610 for ac_prog in exetags etags
2611 do
2612   # Extract the first word of "$ac_prog", so it can be a program name with args.
2613 set dummy $ac_prog; ac_word=$2
2614 echo "$as_me:2614: checking for $ac_word" >&5
2615 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2616 if test "${ac_cv_prog_ETAGS+set}" = set; then
2617   echo $ECHO_N "(cached) $ECHO_C" >&6
2618 else
2619   if test -n "$ETAGS"; then
2620   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2621 else
2622   ac_save_IFS=$IFS; IFS=$ac_path_separator
2623 ac_dummy="$PATH"
2624 for ac_dir in $ac_dummy; do
2625   IFS=$ac_save_IFS
2626   test -z "$ac_dir" && ac_dir=.
2627   $as_executable_p "$ac_dir/$ac_word" || continue
2628 ac_cv_prog_ETAGS="$ac_prog"
2629 echo "$as_me:2629: found $ac_dir/$ac_word" >&5
2630 break
2631 done
2632
2633 fi
2634 fi
2635 ETAGS=$ac_cv_prog_ETAGS
2636 if test -n "$ETAGS"; then
2637   echo "$as_me:2637: result: $ETAGS" >&5
2638 echo "${ECHO_T}$ETAGS" >&6
2639 else
2640   echo "$as_me:2640: result: no" >&5
2641 echo "${ECHO_T}no" >&6
2642 fi
2643
2644   test -n "$ETAGS" && break
2645 done
2646
2647 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2648 set dummy ${CTAGS:-ctags}; ac_word=$2
2649 echo "$as_me:2649: checking for $ac_word" >&5
2650 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2651 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2652   echo $ECHO_N "(cached) $ECHO_C" >&6
2653 else
2654   if test -n "$MAKE_LOWER_TAGS"; then
2655   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2656 else
2657   ac_save_IFS=$IFS; IFS=$ac_path_separator
2658 ac_dummy="$PATH"
2659 for ac_dir in $ac_dummy; do
2660   IFS=$ac_save_IFS
2661   test -z "$ac_dir" && ac_dir=.
2662   $as_executable_p "$ac_dir/$ac_word" || continue
2663 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2664 echo "$as_me:2664: found $ac_dir/$ac_word" >&5
2665 break
2666 done
2667
2668   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2669 fi
2670 fi
2671 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2672 if test -n "$MAKE_LOWER_TAGS"; then
2673   echo "$as_me:2673: result: $MAKE_LOWER_TAGS" >&5
2674 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2675 else
2676   echo "$as_me:2676: result: no" >&5
2677 echo "${ECHO_T}no" >&6
2678 fi
2679
2680 if test "$cf_cv_mixedcase" = yes ; then
2681         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2682 set dummy ${ETAGS:-etags}; ac_word=$2
2683 echo "$as_me:2683: checking for $ac_word" >&5
2684 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2685 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2686   echo $ECHO_N "(cached) $ECHO_C" >&6
2687 else
2688   if test -n "$MAKE_UPPER_TAGS"; then
2689   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2690 else
2691   ac_save_IFS=$IFS; IFS=$ac_path_separator
2692 ac_dummy="$PATH"
2693 for ac_dir in $ac_dummy; do
2694   IFS=$ac_save_IFS
2695   test -z "$ac_dir" && ac_dir=.
2696   $as_executable_p "$ac_dir/$ac_word" || continue
2697 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2698 echo "$as_me:2698: found $ac_dir/$ac_word" >&5
2699 break
2700 done
2701
2702   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2703 fi
2704 fi
2705 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2706 if test -n "$MAKE_UPPER_TAGS"; then
2707   echo "$as_me:2707: result: $MAKE_UPPER_TAGS" >&5
2708 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2709 else
2710   echo "$as_me:2710: result: no" >&5
2711 echo "${ECHO_T}no" >&6
2712 fi
2713
2714 else
2715         MAKE_UPPER_TAGS=no
2716 fi
2717
2718 if test "$MAKE_UPPER_TAGS" = yes ; then
2719         MAKE_UPPER_TAGS=
2720 else
2721         MAKE_UPPER_TAGS="#"
2722 fi
2723
2724 if test "$MAKE_LOWER_TAGS" = yes ; then
2725         MAKE_LOWER_TAGS=
2726 else
2727         MAKE_LOWER_TAGS="#"
2728 fi
2729
2730 echo "$as_me:2730: checking if -lm needed for math functions" >&5
2731 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2732 if test "${cf_cv_need_libm+set}" = set; then
2733   echo $ECHO_N "(cached) $ECHO_C" >&6
2734 else
2735
2736         cat >conftest.$ac_ext <<_ACEOF
2737 #line 2737 "configure"
2738 #include "confdefs.h"
2739
2740         #include <stdio.h>
2741         #include <stdlib.h>
2742         #include <math.h>
2743
2744 int
2745 main (void)
2746 {
2747 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2748   ;
2749   return 0;
2750 }
2751 _ACEOF
2752 rm -f conftest.$ac_objext conftest$ac_exeext
2753 if { (eval echo "$as_me:2753: \"$ac_link\"") >&5
2754   (eval $ac_link) 2>&5
2755   ac_status=$?
2756   echo "$as_me:2756: \$? = $ac_status" >&5
2757   (exit $ac_status); } &&
2758          { ac_try='test -s conftest$ac_exeext'
2759   { (eval echo "$as_me:2759: \"$ac_try\"") >&5
2760   (eval $ac_try) 2>&5
2761   ac_status=$?
2762   echo "$as_me:2762: \$? = $ac_status" >&5
2763   (exit $ac_status); }; }; then
2764   cf_cv_need_libm=no
2765 else
2766   echo "$as_me: failed program was:" >&5
2767 cat conftest.$ac_ext >&5
2768 cf_cv_need_libm=yes
2769 fi
2770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2771 fi
2772 echo "$as_me:2772: result: $cf_cv_need_libm" >&5
2773 echo "${ECHO_T}$cf_cv_need_libm" >&6
2774 if test "$cf_cv_need_libm" = yes
2775 then
2776 MATH_LIB=-lm
2777 fi
2778
2779 top_builddir=`pwd`
2780
2781 CC_G_OPT="-g"
2782 CC_SHARED_OPTS=unknown
2783 CPPFLAGS="$CPPFLAGS"
2784 DFT_DEP_SUFFIX=""
2785 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2786 DFT_UPR_MODEL="NORMAL"
2787 LD="ld"
2788 LDFLAGS_SHARED=""
2789 LDFLAGS_STATIC=""
2790 LD_MODEL=""
2791 LD_SHARED_OPTS=""
2792 LIBTOOL=""
2793 LIBTOOL_OPTS=""
2794 LIB_CLEAN=""
2795 LIB_COMPILE=""
2796 LIB_LINK='${CC}'
2797 LINK_TESTS=""
2798 LOCAL_LDFLAGS=""
2799 PACKAGE="ncurses-examples"
2800 PTHREAD="-lm"
2801 TEST_ARGS=""
2802 TEST_DEPS=""
2803 TEST_LIBS=""
2804 TINFO_LDFLAGS=''
2805 TINFO_LIBS='$(LIBS_CURSES)'
2806 cf_cv_abi_version=""
2807 cf_cv_rel_version=""
2808 includesubdir=""
2809
2810 cf_cv_screen=curses
2811 cf_cv_libtype=
2812
2813 if test "$GCC" = yes
2814 then
2815 cat > conftest.i <<EOF
2816 #ifndef GCC_PRINTF
2817 #define GCC_PRINTF 0
2818 #endif
2819 #ifndef GCC_SCANF
2820 #define GCC_SCANF 0
2821 #endif
2822 #ifndef GCC_NORETURN
2823 #define GCC_NORETURN /* nothing */
2824 #endif
2825 #ifndef GCC_UNUSED
2826 #define GCC_UNUSED /* nothing */
2827 #endif
2828 EOF
2829 if test "$GCC" = yes
2830 then
2831         { echo "$as_me:2831: checking for $CC __attribute__ directives..." >&5
2832 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2833 cat > conftest.$ac_ext <<EOF
2834 #line 2834 "${as_me:-configure}"
2835 #include "confdefs.h"
2836 #include "conftest.h"
2837 #include "conftest.i"
2838 #if     GCC_PRINTF
2839 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2840 #else
2841 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2842 #endif
2843 #if     GCC_SCANF
2844 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2845 #else
2846 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2847 #endif
2848 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2849 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2850 extern void foo(void) GCC_NORETURN;
2851 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2852 EOF
2853         cf_printf_attribute=no
2854         cf_scanf_attribute=no
2855         for cf_attribute in scanf printf unused noreturn
2856         do
2857
2858 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2859
2860                 cf_directive="__attribute__(($cf_attribute))"
2861                 echo "checking for $CC $cf_directive" 1>&5
2862
2863                 case $cf_attribute in
2864                 (printf)
2865                         cf_printf_attribute=yes
2866                         cat >conftest.h <<EOF
2867 #define GCC_$cf_ATTRIBUTE 1
2868 EOF
2869                         ;;
2870                 (scanf)
2871                         cf_scanf_attribute=yes
2872                         cat >conftest.h <<EOF
2873 #define GCC_$cf_ATTRIBUTE 1
2874 EOF
2875                         ;;
2876                 (*)
2877                         cat >conftest.h <<EOF
2878 #define GCC_$cf_ATTRIBUTE $cf_directive
2879 EOF
2880                         ;;
2881                 esac
2882
2883                 if { (eval echo "$as_me:2883: \"$ac_compile\"") >&5
2884   (eval $ac_compile) 2>&5
2885   ac_status=$?
2886   echo "$as_me:2886: \$? = $ac_status" >&5
2887   (exit $ac_status); }; then
2888                         test -n "$verbose" && echo "$as_me:2888: result: ... $cf_attribute" >&5
2889 echo "${ECHO_T}... $cf_attribute" >&6
2890                         cat conftest.h >>confdefs.h
2891                         case $cf_attribute in
2892                         (noreturn)
2893
2894 cat >>confdefs.h <<EOF
2895 #define GCC_NORETURN $cf_directive
2896 EOF
2897
2898                                 ;;
2899                         (printf)
2900                                 cf_value='/* nothing */'
2901                                 if test "$cf_printf_attribute" != no ; then
2902                                         cf_value='__attribute__((format(printf,fmt,var)))'
2903
2904 cat >>confdefs.h <<\EOF
2905 #define GCC_PRINTF 1
2906 EOF
2907
2908                                 fi
2909
2910 cat >>confdefs.h <<EOF
2911 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2912 EOF
2913
2914                                 ;;
2915                         (scanf)
2916                                 cf_value='/* nothing */'
2917                                 if test "$cf_scanf_attribute" != no ; then
2918                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2919
2920 cat >>confdefs.h <<\EOF
2921 #define GCC_SCANF 1
2922 EOF
2923
2924                                 fi
2925
2926 cat >>confdefs.h <<EOF
2927 #define GCC_SCANFLIKE(fmt,var) $cf_value
2928 EOF
2929
2930                                 ;;
2931                         (unused)
2932
2933 cat >>confdefs.h <<EOF
2934 #define GCC_UNUSED $cf_directive
2935 EOF
2936
2937                                 ;;
2938                         esac
2939                 fi
2940         done
2941 else
2942         fgrep define conftest.i >>confdefs.h
2943 fi
2944 rm -rf conftest*
2945 fi
2946
2947 echo "$as_me:2947: checking if you want to work around bogus compiler/loader warnings" >&5
2948 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
2949
2950 # Check whether --enable-string-hacks or --disable-string-hacks was given.
2951 if test "${enable_string_hacks+set}" = set; then
2952   enableval="$enable_string_hacks"
2953   with_string_hacks=$enableval
2954 else
2955   with_string_hacks=no
2956 fi;
2957 echo "$as_me:2957: result: $with_string_hacks" >&5
2958 echo "${ECHO_T}$with_string_hacks" >&6
2959
2960 if test "x$with_string_hacks" = "xyes"; then
2961
2962 cat >>confdefs.h <<\EOF
2963 #define USE_STRING_HACKS 1
2964 EOF
2965
2966         { echo "$as_me:2966: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
2967 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
2968         echo "$as_me:2968: checking for strlcat" >&5
2969 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
2970 if test "${ac_cv_func_strlcat+set}" = set; then
2971   echo $ECHO_N "(cached) $ECHO_C" >&6
2972 else
2973   cat >conftest.$ac_ext <<_ACEOF
2974 #line 2974 "configure"
2975 #include "confdefs.h"
2976 /* System header to define __stub macros and hopefully few prototypes,
2977     which can conflict with char strlcat (); below.  */
2978 #include <assert.h>
2979 /* Override any gcc2 internal prototype to avoid an error.  */
2980 #ifdef __cplusplus
2981 extern "C"
2982 #endif
2983 /* We use char because int might match the return type of a gcc2
2984    builtin and then its argument prototype would still apply.  */
2985 char strlcat ();
2986 char (*f) ();
2987
2988 int
2989 main (void)
2990 {
2991 /* The GNU C library defines this for functions which it implements
2992     to always fail with ENOSYS.  Some functions are actually named
2993     something starting with __ and the normal name is an alias.  */
2994 #if defined (__stub_strlcat) || defined (__stub___strlcat)
2995 choke me
2996 #else
2997 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
2998 #endif
2999
3000   ;
3001   return 0;
3002 }
3003 _ACEOF
3004 rm -f conftest.$ac_objext conftest$ac_exeext
3005 if { (eval echo "$as_me:3005: \"$ac_link\"") >&5
3006   (eval $ac_link) 2>&5
3007   ac_status=$?
3008   echo "$as_me:3008: \$? = $ac_status" >&5
3009   (exit $ac_status); } &&
3010          { ac_try='test -s conftest$ac_exeext'
3011   { (eval echo "$as_me:3011: \"$ac_try\"") >&5
3012   (eval $ac_try) 2>&5
3013   ac_status=$?
3014   echo "$as_me:3014: \$? = $ac_status" >&5
3015   (exit $ac_status); }; }; then
3016   ac_cv_func_strlcat=yes
3017 else
3018   echo "$as_me: failed program was:" >&5
3019 cat conftest.$ac_ext >&5
3020 ac_cv_func_strlcat=no
3021 fi
3022 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3023 fi
3024 echo "$as_me:3024: result: $ac_cv_func_strlcat" >&5
3025 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3026 if test $ac_cv_func_strlcat = yes; then
3027
3028 cat >>confdefs.h <<\EOF
3029 #define HAVE_STRLCAT 1
3030 EOF
3031
3032 else
3033
3034                 echo "$as_me:3034: checking for strlcat in -lbsd" >&5
3035 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3036 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3037   echo $ECHO_N "(cached) $ECHO_C" >&6
3038 else
3039   ac_check_lib_save_LIBS=$LIBS
3040 LIBS="-lbsd  $LIBS"
3041 cat >conftest.$ac_ext <<_ACEOF
3042 #line 3042 "configure"
3043 #include "confdefs.h"
3044
3045 /* Override any gcc2 internal prototype to avoid an error.  */
3046 #ifdef __cplusplus
3047 extern "C"
3048 #endif
3049 /* We use char because int might match the return type of a gcc2
3050    builtin and then its argument prototype would still apply.  */
3051 char strlcat ();
3052 int
3053 main (void)
3054 {
3055 strlcat ();
3056   ;
3057   return 0;
3058 }
3059 _ACEOF
3060 rm -f conftest.$ac_objext conftest$ac_exeext
3061 if { (eval echo "$as_me:3061: \"$ac_link\"") >&5
3062   (eval $ac_link) 2>&5
3063   ac_status=$?
3064   echo "$as_me:3064: \$? = $ac_status" >&5
3065   (exit $ac_status); } &&
3066          { ac_try='test -s conftest$ac_exeext'
3067   { (eval echo "$as_me:3067: \"$ac_try\"") >&5
3068   (eval $ac_try) 2>&5
3069   ac_status=$?
3070   echo "$as_me:3070: \$? = $ac_status" >&5
3071   (exit $ac_status); }; }; then
3072   ac_cv_lib_bsd_strlcat=yes
3073 else
3074   echo "$as_me: failed program was:" >&5
3075 cat conftest.$ac_ext >&5
3076 ac_cv_lib_bsd_strlcat=no
3077 fi
3078 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3079 LIBS=$ac_check_lib_save_LIBS
3080 fi
3081 echo "$as_me:3081: result: $ac_cv_lib_bsd_strlcat" >&5
3082 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3083 if test $ac_cv_lib_bsd_strlcat = yes; then
3084
3085 cf_add_libs="-lbsd"
3086 # Filter out duplicates - this happens with badly-designed ".pc" files...
3087 for cf_add_1lib in $LIBS
3088 do
3089         for cf_add_2lib in $cf_add_libs
3090         do
3091                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3092                 then
3093                         cf_add_1lib=
3094                         break
3095                 fi
3096         done
3097         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3098 done
3099 LIBS="$cf_add_libs"
3100
3101 for ac_header in bsd/string.h
3102 do
3103 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3104 echo "$as_me:3104: checking for $ac_header" >&5
3105 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3106 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3107   echo $ECHO_N "(cached) $ECHO_C" >&6
3108 else
3109   cat >conftest.$ac_ext <<_ACEOF
3110 #line 3110 "configure"
3111 #include "confdefs.h"
3112 #include <$ac_header>
3113 _ACEOF
3114 if { (eval echo "$as_me:3114: \"$ac_cpp conftest.$ac_ext\"") >&5
3115   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3116   ac_status=$?
3117   egrep -v '^ *\+' conftest.er1 >conftest.err
3118   rm -f conftest.er1
3119   cat conftest.err >&5
3120   echo "$as_me:3120: \$? = $ac_status" >&5
3121   (exit $ac_status); } >/dev/null; then
3122   if test -s conftest.err; then
3123     ac_cpp_err=$ac_c_preproc_warn_flag
3124   else
3125     ac_cpp_err=
3126   fi
3127 else
3128   ac_cpp_err=yes
3129 fi
3130 if test -z "$ac_cpp_err"; then
3131   eval "$as_ac_Header=yes"
3132 else
3133   echo "$as_me: failed program was:" >&5
3134   cat conftest.$ac_ext >&5
3135   eval "$as_ac_Header=no"
3136 fi
3137 rm -f conftest.err conftest.$ac_ext
3138 fi
3139 echo "$as_me:3139: result: `eval echo '${'$as_ac_Header'}'`" >&5
3140 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3141 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3142   cat >>confdefs.h <<EOF
3143 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3144 EOF
3145
3146 fi
3147 done
3148
3149 cat >>confdefs.h <<\EOF
3150 #define HAVE_STRLCAT 1
3151 EOF
3152
3153 fi
3154
3155 fi
3156
3157 for ac_func in strlcpy snprintf
3158 do
3159 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3160 echo "$as_me:3160: checking for $ac_func" >&5
3161 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3162 if eval "test \"\${$as_ac_var+set}\" = set"; then
3163   echo $ECHO_N "(cached) $ECHO_C" >&6
3164 else
3165   cat >conftest.$ac_ext <<_ACEOF
3166 #line 3166 "configure"
3167 #include "confdefs.h"
3168 /* System header to define __stub macros and hopefully few prototypes,
3169     which can conflict with char $ac_func (); below.  */
3170 #include <assert.h>
3171 /* Override any gcc2 internal prototype to avoid an error.  */
3172 #ifdef __cplusplus
3173 extern "C"
3174 #endif
3175 /* We use char because int might match the return type of a gcc2
3176    builtin and then its argument prototype would still apply.  */
3177 char $ac_func ();
3178 char (*f) ();
3179
3180 int
3181 main (void)
3182 {
3183 /* The GNU C library defines this for functions which it implements
3184     to always fail with ENOSYS.  Some functions are actually named
3185     something starting with __ and the normal name is an alias.  */
3186 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3187 choke me
3188 #else
3189 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3190 #endif
3191
3192   ;
3193   return 0;
3194 }
3195 _ACEOF
3196 rm -f conftest.$ac_objext conftest$ac_exeext
3197 if { (eval echo "$as_me:3197: \"$ac_link\"") >&5
3198   (eval $ac_link) 2>&5
3199   ac_status=$?
3200   echo "$as_me:3200: \$? = $ac_status" >&5
3201   (exit $ac_status); } &&
3202          { ac_try='test -s conftest$ac_exeext'
3203   { (eval echo "$as_me:3203: \"$ac_try\"") >&5
3204   (eval $ac_try) 2>&5
3205   ac_status=$?
3206   echo "$as_me:3206: \$? = $ac_status" >&5
3207   (exit $ac_status); }; }; then
3208   eval "$as_ac_var=yes"
3209 else
3210   echo "$as_me: failed program was:" >&5
3211 cat conftest.$ac_ext >&5
3212 eval "$as_ac_var=no"
3213 fi
3214 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3215 fi
3216 echo "$as_me:3216: result: `eval echo '${'$as_ac_var'}'`" >&5
3217 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3218 if test `eval echo '${'$as_ac_var'}'` = yes; then
3219   cat >>confdefs.h <<EOF
3220 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3221 EOF
3222
3223 fi
3224 done
3225
3226 fi
3227
3228 cf_XOPEN_SOURCE=500
3229 cf_POSIX_C_SOURCE=199506L
3230 cf_xopen_source=
3231
3232 case $host_os in
3233 (aix[4-7]*)
3234         cf_xopen_source="-D_ALL_SOURCE"
3235         ;;
3236 (msys)
3237         cf_XOPEN_SOURCE=600
3238         ;;
3239 (darwin[0-8].*)
3240         cf_xopen_source="-D_APPLE_C_SOURCE"
3241         ;;
3242 (darwin*)
3243         cf_xopen_source="-D_DARWIN_C_SOURCE"
3244         cf_XOPEN_SOURCE=
3245         ;;
3246 (freebsd*|dragonfly*)
3247         # 5.x headers associate
3248         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3249         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3250         cf_POSIX_C_SOURCE=200112L
3251         cf_XOPEN_SOURCE=600
3252         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3253         ;;
3254 (hpux11*)
3255         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3256         ;;
3257 (hpux*)
3258         cf_xopen_source="-D_HPUX_SOURCE"
3259         ;;
3260 (irix[56].*)
3261         cf_xopen_source="-D_SGI_SOURCE"
3262         cf_XOPEN_SOURCE=
3263         ;;
3264 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3265
3266 echo "$as_me:3266: checking if we must define _GNU_SOURCE" >&5
3267 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3268 if test "${cf_cv_gnu_source+set}" = set; then
3269   echo $ECHO_N "(cached) $ECHO_C" >&6
3270 else
3271
3272 cat >conftest.$ac_ext <<_ACEOF
3273 #line 3273 "configure"
3274 #include "confdefs.h"
3275 #include <sys/types.h>
3276 int
3277 main (void)
3278 {
3279
3280 #ifndef _XOPEN_SOURCE
3281 make an error
3282 #endif
3283   ;
3284   return 0;
3285 }
3286 _ACEOF
3287 rm -f conftest.$ac_objext
3288 if { (eval echo "$as_me:3288: \"$ac_compile\"") >&5
3289   (eval $ac_compile) 2>&5
3290   ac_status=$?
3291   echo "$as_me:3291: \$? = $ac_status" >&5
3292   (exit $ac_status); } &&
3293          { ac_try='test -s conftest.$ac_objext'
3294   { (eval echo "$as_me:3294: \"$ac_try\"") >&5
3295   (eval $ac_try) 2>&5
3296   ac_status=$?
3297   echo "$as_me:3297: \$? = $ac_status" >&5
3298   (exit $ac_status); }; }; then
3299   cf_cv_gnu_source=no
3300 else
3301   echo "$as_me: failed program was:" >&5
3302 cat conftest.$ac_ext >&5
3303 cf_save="$CPPFLAGS"
3304          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3305          cat >conftest.$ac_ext <<_ACEOF
3306 #line 3306 "configure"
3307 #include "confdefs.h"
3308 #include <sys/types.h>
3309 int
3310 main (void)
3311 {
3312
3313 #ifdef _XOPEN_SOURCE
3314 make an error
3315 #endif
3316   ;
3317   return 0;
3318 }
3319 _ACEOF
3320 rm -f conftest.$ac_objext
3321 if { (eval echo "$as_me:3321: \"$ac_compile\"") >&5
3322   (eval $ac_compile) 2>&5
3323   ac_status=$?
3324   echo "$as_me:3324: \$? = $ac_status" >&5
3325   (exit $ac_status); } &&
3326          { ac_try='test -s conftest.$ac_objext'
3327   { (eval echo "$as_me:3327: \"$ac_try\"") >&5
3328   (eval $ac_try) 2>&5
3329   ac_status=$?
3330   echo "$as_me:3330: \$? = $ac_status" >&5
3331   (exit $ac_status); }; }; then
3332   cf_cv_gnu_source=no
3333 else
3334   echo "$as_me: failed program was:" >&5
3335 cat conftest.$ac_ext >&5
3336 cf_cv_gnu_source=yes
3337 fi
3338 rm -f conftest.$ac_objext conftest.$ac_ext
3339         CPPFLAGS="$cf_save"
3340
3341 fi
3342 rm -f conftest.$ac_objext conftest.$ac_ext
3343
3344 fi
3345 echo "$as_me:3345: result: $cf_cv_gnu_source" >&5
3346 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3347
3348 if test "$cf_cv_gnu_source" = yes
3349 then
3350 echo "$as_me:3350: checking if we should also define _DEFAULT_SOURCE" >&5
3351 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3352 if test "${cf_cv_default_source+set}" = set; then
3353   echo $ECHO_N "(cached) $ECHO_C" >&6
3354 else
3355
3356 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3357         cat >conftest.$ac_ext <<_ACEOF
3358 #line 3358 "configure"
3359 #include "confdefs.h"
3360 #include <sys/types.h>
3361 int
3362 main (void)
3363 {
3364
3365 #ifdef _DEFAULT_SOURCE
3366 make an error
3367 #endif
3368   ;
3369   return 0;
3370 }
3371 _ACEOF
3372 rm -f conftest.$ac_objext
3373 if { (eval echo "$as_me:3373: \"$ac_compile\"") >&5
3374   (eval $ac_compile) 2>&5
3375   ac_status=$?
3376   echo "$as_me:3376: \$? = $ac_status" >&5
3377   (exit $ac_status); } &&
3378          { ac_try='test -s conftest.$ac_objext'
3379   { (eval echo "$as_me:3379: \"$ac_try\"") >&5
3380   (eval $ac_try) 2>&5
3381   ac_status=$?
3382   echo "$as_me:3382: \$? = $ac_status" >&5
3383   (exit $ac_status); }; }; then
3384   cf_cv_default_source=no
3385 else
3386   echo "$as_me: failed program was:" >&5
3387 cat conftest.$ac_ext >&5
3388 cf_cv_default_source=yes
3389 fi
3390 rm -f conftest.$ac_objext conftest.$ac_ext
3391
3392 fi
3393 echo "$as_me:3393: result: $cf_cv_default_source" >&5
3394 echo "${ECHO_T}$cf_cv_default_source" >&6
3395 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3396 fi
3397
3398         ;;
3399 (minix*)
3400         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3401         ;;
3402 (mirbsd*)
3403         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3404         cf_XOPEN_SOURCE=
3405
3406 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3407
3408 cf_save_CFLAGS="$CFLAGS"
3409 cf_save_CPPFLAGS="$CPPFLAGS"
3410
3411 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3412         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3413                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3414
3415 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3416         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3417                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3418
3419 echo "$as_me:3419: checking if we should define _POSIX_C_SOURCE" >&5
3420 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3421 if test "${cf_cv_posix_c_source+set}" = set; then
3422   echo $ECHO_N "(cached) $ECHO_C" >&6
3423 else
3424
3425 echo "${as_me:-configure}:3425: testing if the symbol is already defined go no further ..." 1>&5
3426
3427         cat >conftest.$ac_ext <<_ACEOF
3428 #line 3428 "configure"
3429 #include "confdefs.h"
3430 #include <sys/types.h>
3431 int
3432 main (void)
3433 {
3434
3435 #ifndef _POSIX_C_SOURCE
3436 make an error
3437 #endif
3438   ;
3439   return 0;
3440 }
3441 _ACEOF
3442 rm -f conftest.$ac_objext
3443 if { (eval echo "$as_me:3443: \"$ac_compile\"") >&5
3444   (eval $ac_compile) 2>&5
3445   ac_status=$?
3446   echo "$as_me:3446: \$? = $ac_status" >&5
3447   (exit $ac_status); } &&
3448          { ac_try='test -s conftest.$ac_objext'
3449   { (eval echo "$as_me:3449: \"$ac_try\"") >&5
3450   (eval $ac_try) 2>&5
3451   ac_status=$?
3452   echo "$as_me:3452: \$? = $ac_status" >&5
3453   (exit $ac_status); }; }; then
3454   cf_cv_posix_c_source=no
3455 else
3456   echo "$as_me: failed program was:" >&5
3457 cat conftest.$ac_ext >&5
3458 cf_want_posix_source=no
3459          case .$cf_POSIX_C_SOURCE in
3460          (.[12]??*)
3461                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3462                 ;;
3463          (.2)
3464                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3465                 cf_want_posix_source=yes
3466                 ;;
3467          (.*)
3468                 cf_want_posix_source=yes
3469                 ;;
3470          esac
3471          if test "$cf_want_posix_source" = yes ; then
3472                 cat >conftest.$ac_ext <<_ACEOF
3473 #line 3473 "configure"
3474 #include "confdefs.h"
3475 #include <sys/types.h>
3476 int
3477 main (void)
3478 {
3479
3480 #ifdef _POSIX_SOURCE
3481 make an error
3482 #endif
3483   ;
3484   return 0;
3485 }
3486 _ACEOF
3487 rm -f conftest.$ac_objext
3488 if { (eval echo "$as_me:3488: \"$ac_compile\"") >&5
3489   (eval $ac_compile) 2>&5
3490   ac_status=$?
3491   echo "$as_me:3491: \$? = $ac_status" >&5
3492   (exit $ac_status); } &&
3493          { ac_try='test -s conftest.$ac_objext'
3494   { (eval echo "$as_me:3494: \"$ac_try\"") >&5
3495   (eval $ac_try) 2>&5
3496   ac_status=$?
3497   echo "$as_me:3497: \$? = $ac_status" >&5
3498   (exit $ac_status); }; }; then
3499   :
3500 else
3501   echo "$as_me: failed program was:" >&5
3502 cat conftest.$ac_ext >&5
3503 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3504 fi
3505 rm -f conftest.$ac_objext conftest.$ac_ext
3506          fi
3507
3508 echo "${as_me:-configure}:3508: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3509
3510          CFLAGS="$cf_trim_CFLAGS"
3511          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3512
3513 echo "${as_me:-configure}:3513: testing if the second compile does not leave our definition intact error ..." 1>&5
3514
3515          cat >conftest.$ac_ext <<_ACEOF
3516 #line 3516 "configure"
3517 #include "confdefs.h"
3518 #include <sys/types.h>
3519 int
3520 main (void)
3521 {
3522
3523 #ifndef _POSIX_C_SOURCE
3524 make an error
3525 #endif
3526   ;
3527   return 0;
3528 }
3529 _ACEOF
3530 rm -f conftest.$ac_objext
3531 if { (eval echo "$as_me:3531: \"$ac_compile\"") >&5
3532   (eval $ac_compile) 2>&5
3533   ac_status=$?
3534   echo "$as_me:3534: \$? = $ac_status" >&5
3535   (exit $ac_status); } &&
3536          { ac_try='test -s conftest.$ac_objext'
3537   { (eval echo "$as_me:3537: \"$ac_try\"") >&5
3538   (eval $ac_try) 2>&5
3539   ac_status=$?
3540   echo "$as_me:3540: \$? = $ac_status" >&5
3541   (exit $ac_status); }; }; then
3542   :
3543 else
3544   echo "$as_me: failed program was:" >&5
3545 cat conftest.$ac_ext >&5
3546 cf_cv_posix_c_source=no
3547 fi
3548 rm -f conftest.$ac_objext conftest.$ac_ext
3549          CFLAGS="$cf_save_CFLAGS"
3550          CPPFLAGS="$cf_save_CPPFLAGS"
3551
3552 fi
3553 rm -f conftest.$ac_objext conftest.$ac_ext
3554
3555 fi
3556 echo "$as_me:3556: result: $cf_cv_posix_c_source" >&5
3557 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3558
3559 if test "$cf_cv_posix_c_source" != no ; then
3560         CFLAGS="$cf_trim_CFLAGS"
3561         CPPFLAGS="$cf_trim_CPPFLAGS"
3562
3563 cf_fix_cppflags=no
3564 cf_new_cflags=
3565 cf_new_cppflags=
3566 cf_new_extra_cppflags=
3567
3568 for cf_add_cflags in $cf_cv_posix_c_source
3569 do
3570 case $cf_fix_cppflags in
3571 (no)
3572         case $cf_add_cflags in
3573         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3574                 case $cf_add_cflags in
3575                 (-D*)
3576                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3577
3578                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3579                                 && test -z "${cf_tst_cflags}" \
3580                                 && cf_fix_cppflags=yes
3581
3582                         if test $cf_fix_cppflags = yes ; then
3583
3584         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3585         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3586
3587                                 continue
3588                         elif test "${cf_tst_cflags}" = "\"'" ; then
3589
3590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3592
3593                                 continue
3594                         fi
3595                         ;;
3596                 esac
3597                 case "$CPPFLAGS" in
3598                 (*$cf_add_cflags)
3599                         ;;
3600                 (*)
3601                         case $cf_add_cflags in
3602                         (-D*)
3603                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3604
3605 CPPFLAGS=`echo "$CPPFLAGS" | \
3606         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3607                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3608
3609                                 ;;
3610                         esac
3611
3612         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3613         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3614
3615                         ;;
3616                 esac
3617                 ;;
3618         (*)
3619
3620         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3621         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3622
3623                 ;;
3624         esac
3625         ;;
3626 (yes)
3627
3628         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3629         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3630
3631         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3632
3633         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3634                 && test -z "${cf_tst_cflags}" \
3635                 && cf_fix_cppflags=no
3636         ;;
3637 esac
3638 done
3639
3640 if test -n "$cf_new_cflags" ; then
3641
3642         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3643         CFLAGS="${CFLAGS}$cf_new_cflags"
3644
3645 fi
3646
3647 if test -n "$cf_new_cppflags" ; then
3648
3649         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3650         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3651
3652 fi
3653
3654 if test -n "$cf_new_extra_cppflags" ; then
3655
3656         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3657         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3658
3659 fi
3660
3661 fi
3662
3663         ;;
3664 (netbsd*)
3665         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3666         ;;
3667 (openbsd[4-9]*)
3668         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3669         cf_xopen_source="-D_BSD_SOURCE"
3670         cf_XOPEN_SOURCE=600
3671         ;;
3672 (openbsd*)
3673         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3674         ;;
3675 (osf[45]*)
3676         cf_xopen_source="-D_OSF_SOURCE"
3677         ;;
3678 (nto-qnx*)
3679         cf_xopen_source="-D_QNX_SOURCE"
3680         ;;
3681 (sco*)
3682         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3683         ;;
3684 (solaris2.*)
3685         cf_xopen_source="-D__EXTENSIONS__"
3686         cf_cv_xopen_source=broken
3687         ;;
3688 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3689         cf_XOPEN_SOURCE=
3690         cf_POSIX_C_SOURCE=
3691         ;;
3692 (*)
3693
3694 echo "$as_me:3694: checking if we should define _XOPEN_SOURCE" >&5
3695 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3696 if test "${cf_cv_xopen_source+set}" = set; then
3697   echo $ECHO_N "(cached) $ECHO_C" >&6
3698 else
3699
3700         cat >conftest.$ac_ext <<_ACEOF
3701 #line 3701 "configure"
3702 #include "confdefs.h"
3703
3704 #include <stdlib.h>
3705 #include <string.h>
3706 #include <sys/types.h>
3707
3708 int
3709 main (void)
3710 {
3711
3712 #ifndef _XOPEN_SOURCE
3713 make an error
3714 #endif
3715   ;
3716   return 0;
3717 }
3718 _ACEOF
3719 rm -f conftest.$ac_objext
3720 if { (eval echo "$as_me:3720: \"$ac_compile\"") >&5
3721   (eval $ac_compile) 2>&5
3722   ac_status=$?
3723   echo "$as_me:3723: \$? = $ac_status" >&5
3724   (exit $ac_status); } &&
3725          { ac_try='test -s conftest.$ac_objext'
3726   { (eval echo "$as_me:3726: \"$ac_try\"") >&5
3727   (eval $ac_try) 2>&5
3728   ac_status=$?
3729   echo "$as_me:3729: \$? = $ac_status" >&5
3730   (exit $ac_status); }; }; then
3731   cf_cv_xopen_source=no
3732 else
3733   echo "$as_me: failed program was:" >&5
3734 cat conftest.$ac_ext >&5
3735 cf_save="$CPPFLAGS"
3736          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3737          cat >conftest.$ac_ext <<_ACEOF
3738 #line 3738 "configure"
3739 #include "confdefs.h"
3740
3741 #include <stdlib.h>
3742 #include <string.h>
3743 #include <sys/types.h>
3744
3745 int
3746 main (void)
3747 {
3748
3749 #ifdef _XOPEN_SOURCE
3750 make an error
3751 #endif
3752   ;
3753   return 0;
3754 }
3755 _ACEOF
3756 rm -f conftest.$ac_objext
3757 if { (eval echo "$as_me:3757: \"$ac_compile\"") >&5
3758   (eval $ac_compile) 2>&5
3759   ac_status=$?
3760   echo "$as_me:3760: \$? = $ac_status" >&5
3761   (exit $ac_status); } &&
3762          { ac_try='test -s conftest.$ac_objext'
3763   { (eval echo "$as_me:3763: \"$ac_try\"") >&5
3764   (eval $ac_try) 2>&5
3765   ac_status=$?
3766   echo "$as_me:3766: \$? = $ac_status" >&5
3767   (exit $ac_status); }; }; then
3768   cf_cv_xopen_source=no
3769 else
3770   echo "$as_me: failed program was:" >&5
3771 cat conftest.$ac_ext >&5
3772 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3773 fi
3774 rm -f conftest.$ac_objext conftest.$ac_ext
3775         CPPFLAGS="$cf_save"
3776
3777 fi
3778 rm -f conftest.$ac_objext conftest.$ac_ext
3779
3780 fi
3781 echo "$as_me:3781: result: $cf_cv_xopen_source" >&5
3782 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3783
3784 if test "$cf_cv_xopen_source" != no ; then
3785
3786 CFLAGS=`echo "$CFLAGS" | \
3787         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3788                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3789
3790 CPPFLAGS=`echo "$CPPFLAGS" | \
3791         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3792                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3793
3794         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3795
3796 cf_fix_cppflags=no
3797 cf_new_cflags=
3798 cf_new_cppflags=
3799 cf_new_extra_cppflags=
3800
3801 for cf_add_cflags in $cf_temp_xopen_source
3802 do
3803 case $cf_fix_cppflags in
3804 (no)
3805         case $cf_add_cflags in
3806         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3807                 case $cf_add_cflags in
3808                 (-D*)
3809                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3810
3811                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3812                                 && test -z "${cf_tst_cflags}" \
3813                                 && cf_fix_cppflags=yes
3814
3815                         if test $cf_fix_cppflags = yes ; then
3816
3817         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3818         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3819
3820                                 continue
3821                         elif test "${cf_tst_cflags}" = "\"'" ; then
3822
3823         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3824         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3825
3826                                 continue
3827                         fi
3828                         ;;
3829                 esac
3830                 case "$CPPFLAGS" in
3831                 (*$cf_add_cflags)
3832                         ;;
3833                 (*)
3834                         case $cf_add_cflags in
3835                         (-D*)
3836                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3837
3838 CPPFLAGS=`echo "$CPPFLAGS" | \
3839         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3840                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3841
3842                                 ;;
3843                         esac
3844
3845         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3846         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3847
3848                         ;;
3849                 esac
3850                 ;;
3851         (*)
3852
3853         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3854         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3855
3856                 ;;
3857         esac
3858         ;;
3859 (yes)
3860
3861         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3862         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3863
3864         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3865
3866         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3867                 && test -z "${cf_tst_cflags}" \
3868                 && cf_fix_cppflags=no
3869         ;;
3870 esac
3871 done
3872
3873 if test -n "$cf_new_cflags" ; then
3874
3875         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3876         CFLAGS="${CFLAGS}$cf_new_cflags"
3877
3878 fi
3879
3880 if test -n "$cf_new_cppflags" ; then
3881
3882         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3883         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3884
3885 fi
3886
3887 if test -n "$cf_new_extra_cppflags" ; then
3888
3889         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3890         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3891
3892 fi
3893
3894 fi
3895
3896 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3897
3898 cf_save_CFLAGS="$CFLAGS"
3899 cf_save_CPPFLAGS="$CPPFLAGS"
3900
3901 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3902         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3903                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3904
3905 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3906         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3907                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3908
3909 echo "$as_me:3909: checking if we should define _POSIX_C_SOURCE" >&5
3910 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3911 if test "${cf_cv_posix_c_source+set}" = set; then
3912   echo $ECHO_N "(cached) $ECHO_C" >&6
3913 else
3914
3915 echo "${as_me:-configure}:3915: testing if the symbol is already defined go no further ..." 1>&5
3916
3917         cat >conftest.$ac_ext <<_ACEOF
3918 #line 3918 "configure"
3919 #include "confdefs.h"
3920 #include <sys/types.h>
3921 int
3922 main (void)
3923 {
3924
3925 #ifndef _POSIX_C_SOURCE
3926 make an error
3927 #endif
3928   ;
3929   return 0;
3930 }
3931 _ACEOF
3932 rm -f conftest.$ac_objext
3933 if { (eval echo "$as_me:3933: \"$ac_compile\"") >&5
3934   (eval $ac_compile) 2>&5
3935   ac_status=$?
3936   echo "$as_me:3936: \$? = $ac_status" >&5
3937   (exit $ac_status); } &&
3938          { ac_try='test -s conftest.$ac_objext'
3939   { (eval echo "$as_me:3939: \"$ac_try\"") >&5
3940   (eval $ac_try) 2>&5
3941   ac_status=$?
3942   echo "$as_me:3942: \$? = $ac_status" >&5
3943   (exit $ac_status); }; }; then
3944   cf_cv_posix_c_source=no
3945 else
3946   echo "$as_me: failed program was:" >&5
3947 cat conftest.$ac_ext >&5
3948 cf_want_posix_source=no
3949          case .$cf_POSIX_C_SOURCE in
3950          (.[12]??*)
3951                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3952                 ;;
3953          (.2)
3954                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3955                 cf_want_posix_source=yes
3956                 ;;
3957          (.*)
3958                 cf_want_posix_source=yes
3959                 ;;
3960          esac
3961          if test "$cf_want_posix_source" = yes ; then
3962                 cat >conftest.$ac_ext <<_ACEOF
3963 #line 3963 "configure"
3964 #include "confdefs.h"
3965 #include <sys/types.h>
3966 int
3967 main (void)
3968 {
3969
3970 #ifdef _POSIX_SOURCE
3971 make an error
3972 #endif
3973   ;
3974   return 0;
3975 }
3976 _ACEOF
3977 rm -f conftest.$ac_objext
3978 if { (eval echo "$as_me:3978: \"$ac_compile\"") >&5
3979   (eval $ac_compile) 2>&5
3980   ac_status=$?
3981   echo "$as_me:3981: \$? = $ac_status" >&5
3982   (exit $ac_status); } &&
3983          { ac_try='test -s conftest.$ac_objext'
3984   { (eval echo "$as_me:3984: \"$ac_try\"") >&5
3985   (eval $ac_try) 2>&5
3986   ac_status=$?
3987   echo "$as_me:3987: \$? = $ac_status" >&5
3988   (exit $ac_status); }; }; then
3989   :
3990 else
3991   echo "$as_me: failed program was:" >&5
3992 cat conftest.$ac_ext >&5
3993 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3994 fi
3995 rm -f conftest.$ac_objext conftest.$ac_ext
3996          fi
3997
3998 echo "${as_me:-configure}:3998: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3999
4000          CFLAGS="$cf_trim_CFLAGS"
4001          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
4002
4003 echo "${as_me:-configure}:4003: testing if the second compile does not leave our definition intact error ..." 1>&5
4004
4005          cat >conftest.$ac_ext <<_ACEOF
4006 #line 4006 "configure"
4007 #include "confdefs.h"
4008 #include <sys/types.h>
4009 int
4010 main (void)
4011 {
4012
4013 #ifndef _POSIX_C_SOURCE
4014 make an error
4015 #endif
4016   ;
4017   return 0;
4018 }
4019 _ACEOF
4020 rm -f conftest.$ac_objext
4021 if { (eval echo "$as_me:4021: \"$ac_compile\"") >&5
4022   (eval $ac_compile) 2>&5
4023   ac_status=$?
4024   echo "$as_me:4024: \$? = $ac_status" >&5
4025   (exit $ac_status); } &&
4026          { ac_try='test -s conftest.$ac_objext'
4027   { (eval echo "$as_me:4027: \"$ac_try\"") >&5
4028   (eval $ac_try) 2>&5
4029   ac_status=$?
4030   echo "$as_me:4030: \$? = $ac_status" >&5
4031   (exit $ac_status); }; }; then
4032   :
4033 else
4034   echo "$as_me: failed program was:" >&5
4035 cat conftest.$ac_ext >&5
4036 cf_cv_posix_c_source=no
4037 fi
4038 rm -f conftest.$ac_objext conftest.$ac_ext
4039          CFLAGS="$cf_save_CFLAGS"
4040          CPPFLAGS="$cf_save_CPPFLAGS"
4041
4042 fi
4043 rm -f conftest.$ac_objext conftest.$ac_ext
4044
4045 fi
4046 echo "$as_me:4046: result: $cf_cv_posix_c_source" >&5
4047 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4048
4049 if test "$cf_cv_posix_c_source" != no ; then
4050         CFLAGS="$cf_trim_CFLAGS"
4051         CPPFLAGS="$cf_trim_CPPFLAGS"
4052
4053 cf_fix_cppflags=no
4054 cf_new_cflags=
4055 cf_new_cppflags=
4056 cf_new_extra_cppflags=
4057
4058 for cf_add_cflags in $cf_cv_posix_c_source
4059 do
4060 case $cf_fix_cppflags in
4061 (no)
4062         case $cf_add_cflags in
4063         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4064                 case $cf_add_cflags in
4065                 (-D*)
4066                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4067
4068                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4069                                 && test -z "${cf_tst_cflags}" \
4070                                 && cf_fix_cppflags=yes
4071
4072                         if test $cf_fix_cppflags = yes ; then
4073
4074         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4075         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4076
4077                                 continue
4078                         elif test "${cf_tst_cflags}" = "\"'" ; then
4079
4080         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4081         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4082
4083                                 continue
4084                         fi
4085                         ;;
4086                 esac
4087                 case "$CPPFLAGS" in
4088                 (*$cf_add_cflags)
4089                         ;;
4090                 (*)
4091                         case $cf_add_cflags in
4092                         (-D*)
4093                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4094
4095 CPPFLAGS=`echo "$CPPFLAGS" | \
4096         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4097                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4098
4099                                 ;;
4100                         esac
4101
4102         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4103         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4104
4105                         ;;
4106                 esac
4107                 ;;
4108         (*)
4109
4110         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4111         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4112
4113                 ;;
4114         esac
4115         ;;
4116 (yes)
4117
4118         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4119         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4120
4121         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4122
4123         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4124                 && test -z "${cf_tst_cflags}" \
4125                 && cf_fix_cppflags=no
4126         ;;
4127 esac
4128 done
4129
4130 if test -n "$cf_new_cflags" ; then
4131
4132         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4133         CFLAGS="${CFLAGS}$cf_new_cflags"
4134
4135 fi
4136
4137 if test -n "$cf_new_cppflags" ; then
4138
4139         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4140         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4141
4142 fi
4143
4144 if test -n "$cf_new_extra_cppflags" ; then
4145
4146         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4147         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4148
4149 fi
4150
4151 fi
4152
4153         ;;
4154 esac
4155
4156 if test -n "$cf_xopen_source" ; then
4157
4158 cf_fix_cppflags=no
4159 cf_new_cflags=
4160 cf_new_cppflags=
4161 cf_new_extra_cppflags=
4162
4163 for cf_add_cflags in $cf_xopen_source
4164 do
4165 case $cf_fix_cppflags in
4166 (no)
4167         case $cf_add_cflags in
4168         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4169                 case $cf_add_cflags in
4170                 (-D*)
4171                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4172
4173                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4174                                 && test -z "${cf_tst_cflags}" \
4175                                 && cf_fix_cppflags=yes
4176
4177                         if test $cf_fix_cppflags = yes ; then
4178
4179         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4180         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4181
4182                                 continue
4183                         elif test "${cf_tst_cflags}" = "\"'" ; then
4184
4185         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4186         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4187
4188                                 continue
4189                         fi
4190                         ;;
4191                 esac
4192                 case "$CPPFLAGS" in
4193                 (*$cf_add_cflags)
4194                         ;;
4195                 (*)
4196                         case $cf_add_cflags in
4197                         (-D*)
4198                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4199
4200 CPPFLAGS=`echo "$CPPFLAGS" | \
4201         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4202                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4203
4204                                 ;;
4205                         esac
4206
4207         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4208         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4209
4210                         ;;
4211                 esac
4212                 ;;
4213         (*)
4214
4215         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4216         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4217
4218                 ;;
4219         esac
4220         ;;
4221 (yes)
4222
4223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4225
4226         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4227
4228         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4229                 && test -z "${cf_tst_cflags}" \
4230                 && cf_fix_cppflags=no
4231         ;;
4232 esac
4233 done
4234
4235 if test -n "$cf_new_cflags" ; then
4236         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4237
4238 echo "${as_me:-configure}:4238: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4239
4240         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4241         CFLAGS="${CFLAGS}$cf_new_cflags"
4242
4243 fi
4244
4245 if test -n "$cf_new_cppflags" ; then
4246         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4247
4248 echo "${as_me:-configure}:4248: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4249
4250         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4251         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4252
4253 fi
4254
4255 if test -n "$cf_new_extra_cppflags" ; then
4256         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4257
4258 echo "${as_me:-configure}:4258: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4259
4260         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4261         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4262
4263 fi
4264
4265 fi
4266
4267 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4268         echo "$as_me:4268: checking if _XOPEN_SOURCE really is set" >&5
4269 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4270         cat >conftest.$ac_ext <<_ACEOF
4271 #line 4271 "configure"
4272 #include "confdefs.h"
4273 #include <stdlib.h>
4274 int
4275 main (void)
4276 {
4277
4278 #ifndef _XOPEN_SOURCE
4279 make an error
4280 #endif
4281   ;
4282   return 0;
4283 }
4284 _ACEOF
4285 rm -f conftest.$ac_objext
4286 if { (eval echo "$as_me:4286: \"$ac_compile\"") >&5
4287   (eval $ac_compile) 2>&5
4288   ac_status=$?
4289   echo "$as_me:4289: \$? = $ac_status" >&5
4290   (exit $ac_status); } &&
4291          { ac_try='test -s conftest.$ac_objext'
4292   { (eval echo "$as_me:4292: \"$ac_try\"") >&5
4293   (eval $ac_try) 2>&5
4294   ac_status=$?
4295   echo "$as_me:4295: \$? = $ac_status" >&5
4296   (exit $ac_status); }; }; then
4297   cf_XOPEN_SOURCE_set=yes
4298 else
4299   echo "$as_me: failed program was:" >&5
4300 cat conftest.$ac_ext >&5
4301 cf_XOPEN_SOURCE_set=no
4302 fi
4303 rm -f conftest.$ac_objext conftest.$ac_ext
4304         echo "$as_me:4304: result: $cf_XOPEN_SOURCE_set" >&5
4305 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4306         if test $cf_XOPEN_SOURCE_set = yes
4307         then
4308                 cat >conftest.$ac_ext <<_ACEOF
4309 #line 4309 "configure"
4310 #include "confdefs.h"
4311 #include <stdlib.h>
4312 int
4313 main (void)
4314 {
4315
4316 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4317 make an error
4318 #endif
4319   ;
4320   return 0;
4321 }
4322 _ACEOF
4323 rm -f conftest.$ac_objext
4324 if { (eval echo "$as_me:4324: \"$ac_compile\"") >&5
4325   (eval $ac_compile) 2>&5
4326   ac_status=$?
4327   echo "$as_me:4327: \$? = $ac_status" >&5
4328   (exit $ac_status); } &&
4329          { ac_try='test -s conftest.$ac_objext'
4330   { (eval echo "$as_me:4330: \"$ac_try\"") >&5
4331   (eval $ac_try) 2>&5
4332   ac_status=$?
4333   echo "$as_me:4333: \$? = $ac_status" >&5
4334   (exit $ac_status); }; }; then
4335   cf_XOPEN_SOURCE_set_ok=yes
4336 else
4337   echo "$as_me: failed program was:" >&5
4338 cat conftest.$ac_ext >&5
4339 cf_XOPEN_SOURCE_set_ok=no
4340 fi
4341 rm -f conftest.$ac_objext conftest.$ac_ext
4342                 if test $cf_XOPEN_SOURCE_set_ok = no
4343                 then
4344                         { echo "$as_me:4344: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4345 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4346                 fi
4347         else
4348
4349 echo "$as_me:4349: checking if we should define _XOPEN_SOURCE" >&5
4350 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4351 if test "${cf_cv_xopen_source+set}" = set; then
4352   echo $ECHO_N "(cached) $ECHO_C" >&6
4353 else
4354
4355         cat >conftest.$ac_ext <<_ACEOF
4356 #line 4356 "configure"
4357 #include "confdefs.h"
4358
4359 #include <stdlib.h>
4360 #include <string.h>
4361 #include <sys/types.h>
4362
4363 int
4364 main (void)
4365 {
4366
4367 #ifndef _XOPEN_SOURCE
4368 make an error
4369 #endif
4370   ;
4371   return 0;
4372 }
4373 _ACEOF
4374 rm -f conftest.$ac_objext
4375 if { (eval echo "$as_me:4375: \"$ac_compile\"") >&5
4376   (eval $ac_compile) 2>&5
4377   ac_status=$?
4378   echo "$as_me:4378: \$? = $ac_status" >&5
4379   (exit $ac_status); } &&
4380          { ac_try='test -s conftest.$ac_objext'
4381   { (eval echo "$as_me:4381: \"$ac_try\"") >&5
4382   (eval $ac_try) 2>&5
4383   ac_status=$?
4384   echo "$as_me:4384: \$? = $ac_status" >&5
4385   (exit $ac_status); }; }; then
4386   cf_cv_xopen_source=no
4387 else
4388   echo "$as_me: failed program was:" >&5
4389 cat conftest.$ac_ext >&5
4390 cf_save="$CPPFLAGS"
4391          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4392          cat >conftest.$ac_ext <<_ACEOF
4393 #line 4393 "configure"
4394 #include "confdefs.h"
4395
4396 #include <stdlib.h>
4397 #include <string.h>
4398 #include <sys/types.h>
4399
4400 int
4401 main (void)
4402 {
4403
4404 #ifdef _XOPEN_SOURCE
4405 make an error
4406 #endif
4407   ;
4408   return 0;
4409 }
4410 _ACEOF
4411 rm -f conftest.$ac_objext
4412 if { (eval echo "$as_me:4412: \"$ac_compile\"") >&5
4413   (eval $ac_compile) 2>&5
4414   ac_status=$?
4415   echo "$as_me:4415: \$? = $ac_status" >&5
4416   (exit $ac_status); } &&
4417          { ac_try='test -s conftest.$ac_objext'
4418   { (eval echo "$as_me:4418: \"$ac_try\"") >&5
4419   (eval $ac_try) 2>&5
4420   ac_status=$?
4421   echo "$as_me:4421: \$? = $ac_status" >&5
4422   (exit $ac_status); }; }; then
4423   cf_cv_xopen_source=no
4424 else
4425   echo "$as_me: failed program was:" >&5
4426 cat conftest.$ac_ext >&5
4427 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4428 fi
4429 rm -f conftest.$ac_objext conftest.$ac_ext
4430         CPPFLAGS="$cf_save"
4431
4432 fi
4433 rm -f conftest.$ac_objext conftest.$ac_ext
4434
4435 fi
4436 echo "$as_me:4436: result: $cf_cv_xopen_source" >&5
4437 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4438
4439 if test "$cf_cv_xopen_source" != no ; then
4440
4441 CFLAGS=`echo "$CFLAGS" | \
4442         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4443                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4444
4445 CPPFLAGS=`echo "$CPPFLAGS" | \
4446         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4447                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4448
4449         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4450
4451 cf_fix_cppflags=no
4452 cf_new_cflags=
4453 cf_new_cppflags=
4454 cf_new_extra_cppflags=
4455
4456 for cf_add_cflags in $cf_temp_xopen_source
4457 do
4458 case $cf_fix_cppflags in
4459 (no)
4460         case $cf_add_cflags in
4461         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4462                 case $cf_add_cflags in
4463                 (-D*)
4464                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4465
4466                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4467                                 && test -z "${cf_tst_cflags}" \
4468                                 && cf_fix_cppflags=yes
4469
4470                         if test $cf_fix_cppflags = yes ; then
4471
4472         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4473         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4474
4475                                 continue
4476                         elif test "${cf_tst_cflags}" = "\"'" ; then
4477
4478         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4479         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4480
4481                                 continue
4482                         fi
4483                         ;;
4484                 esac
4485                 case "$CPPFLAGS" in
4486                 (*$cf_add_cflags)
4487                         ;;
4488                 (*)
4489                         case $cf_add_cflags in
4490                         (-D*)
4491                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4492
4493 CPPFLAGS=`echo "$CPPFLAGS" | \
4494         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4495                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4496
4497                                 ;;
4498                         esac
4499
4500         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4501         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4502
4503                         ;;
4504                 esac
4505                 ;;
4506         (*)
4507
4508         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4509         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4510
4511                 ;;
4512         esac
4513         ;;
4514 (yes)
4515
4516         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4517         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4518
4519         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4520
4521         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4522                 && test -z "${cf_tst_cflags}" \
4523                 && cf_fix_cppflags=no
4524         ;;
4525 esac
4526 done
4527
4528 if test -n "$cf_new_cflags" ; then
4529
4530         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4531         CFLAGS="${CFLAGS}$cf_new_cflags"
4532
4533 fi
4534
4535 if test -n "$cf_new_cppflags" ; then
4536
4537         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4538         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4539
4540 fi
4541
4542 if test -n "$cf_new_extra_cppflags" ; then
4543
4544         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4545         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4546
4547 fi
4548
4549 fi
4550
4551         fi
4552 fi
4553
4554 echo "$as_me:4554: checking for signal global datatype" >&5
4555 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4556 if test "${cf_cv_sig_atomic_t+set}" = set; then
4557   echo $ECHO_N "(cached) $ECHO_C" >&6
4558 else
4559
4560         for cf_type in \
4561                 "volatile sig_atomic_t" \
4562                 "sig_atomic_t" \
4563                 "int"
4564         do
4565         cat >conftest.$ac_ext <<_ACEOF
4566 #line 4566 "configure"
4567 #include "confdefs.h"
4568
4569 #include <sys/types.h>
4570 #include <signal.h>
4571 #include <stdio.h>
4572
4573 extern $cf_type x;
4574 $cf_type x;
4575 static void handler(int sig)
4576 {
4577         x = 5;
4578 }
4579 int
4580 main (void)
4581 {
4582 signal(SIGINT, handler);
4583                  x = 1
4584   ;
4585   return 0;
4586 }
4587 _ACEOF
4588 rm -f conftest.$ac_objext
4589 if { (eval echo "$as_me:4589: \"$ac_compile\"") >&5
4590   (eval $ac_compile) 2>&5
4591   ac_status=$?
4592   echo "$as_me:4592: \$? = $ac_status" >&5
4593   (exit $ac_status); } &&
4594          { ac_try='test -s conftest.$ac_objext'
4595   { (eval echo "$as_me:4595: \"$ac_try\"") >&5
4596   (eval $ac_try) 2>&5
4597   ac_status=$?
4598   echo "$as_me:4598: \$? = $ac_status" >&5
4599   (exit $ac_status); }; }; then
4600   cf_cv_sig_atomic_t=$cf_type
4601 else
4602   echo "$as_me: failed program was:" >&5
4603 cat conftest.$ac_ext >&5
4604 cf_cv_sig_atomic_t=no
4605 fi
4606 rm -f conftest.$ac_objext conftest.$ac_ext
4607                 test "$cf_cv_sig_atomic_t" != no && break
4608         done
4609
4610 fi
4611
4612 echo "$as_me:4612: result: $cf_cv_sig_atomic_t" >&5
4613 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4614 test "$cf_cv_sig_atomic_t" != no &&
4615 cat >>confdefs.h <<EOF
4616 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4617 EOF
4618
4619 # Work around breakage on OS X
4620
4621 echo "$as_me:4621: checking if SIGWINCH is defined" >&5
4622 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4623 if test "${cf_cv_define_sigwinch+set}" = set; then
4624   echo $ECHO_N "(cached) $ECHO_C" >&6
4625 else
4626
4627         cat >conftest.$ac_ext <<_ACEOF
4628 #line 4628 "configure"
4629 #include "confdefs.h"
4630
4631 #include <sys/types.h>
4632 #include <sys/signal.h>
4633
4634 int
4635 main (void)
4636 {
4637 int x = SIGWINCH
4638   ;
4639   return 0;
4640 }
4641 _ACEOF
4642 rm -f conftest.$ac_objext
4643 if { (eval echo "$as_me:4643: \"$ac_compile\"") >&5
4644   (eval $ac_compile) 2>&5
4645   ac_status=$?
4646   echo "$as_me:4646: \$? = $ac_status" >&5
4647   (exit $ac_status); } &&
4648          { ac_try='test -s conftest.$ac_objext'
4649   { (eval echo "$as_me:4649: \"$ac_try\"") >&5
4650   (eval $ac_try) 2>&5
4651   ac_status=$?
4652   echo "$as_me:4652: \$? = $ac_status" >&5
4653   (exit $ac_status); }; }; then
4654   cf_cv_define_sigwinch=yes
4655 else
4656   echo "$as_me: failed program was:" >&5
4657 cat conftest.$ac_ext >&5
4658 cat >conftest.$ac_ext <<_ACEOF
4659 #line 4659 "configure"
4660 #include "confdefs.h"
4661
4662 #undef _XOPEN_SOURCE
4663 #undef _POSIX_SOURCE
4664 #undef _POSIX_C_SOURCE
4665 #include <sys/types.h>
4666 #include <sys/signal.h>
4667
4668 int
4669 main (void)
4670 {
4671 int x = SIGWINCH
4672   ;
4673   return 0;
4674 }
4675 _ACEOF
4676 rm -f conftest.$ac_objext
4677 if { (eval echo "$as_me:4677: \"$ac_compile\"") >&5
4678   (eval $ac_compile) 2>&5
4679   ac_status=$?
4680   echo "$as_me:4680: \$? = $ac_status" >&5
4681   (exit $ac_status); } &&
4682          { ac_try='test -s conftest.$ac_objext'
4683   { (eval echo "$as_me:4683: \"$ac_try\"") >&5
4684   (eval $ac_try) 2>&5
4685   ac_status=$?
4686   echo "$as_me:4686: \$? = $ac_status" >&5
4687   (exit $ac_status); }; }; then
4688   cf_cv_define_sigwinch=maybe
4689 else
4690   echo "$as_me: failed program was:" >&5
4691 cat conftest.$ac_ext >&5
4692 cf_cv_define_sigwinch=no
4693 fi
4694 rm -f conftest.$ac_objext conftest.$ac_ext
4695
4696 fi
4697 rm -f conftest.$ac_objext conftest.$ac_ext
4698
4699 fi
4700 echo "$as_me:4700: result: $cf_cv_define_sigwinch" >&5
4701 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4702
4703 if test "$cf_cv_define_sigwinch" = maybe ; then
4704 echo "$as_me:4704: checking for actual SIGWINCH definition" >&5
4705 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4706 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4707   echo $ECHO_N "(cached) $ECHO_C" >&6
4708 else
4709
4710 cf_cv_fixup_sigwinch=unknown
4711 cf_sigwinch=32
4712 while test $cf_sigwinch != 1
4713 do
4714         cat >conftest.$ac_ext <<_ACEOF
4715 #line 4715 "configure"
4716 #include "confdefs.h"
4717
4718 #undef _XOPEN_SOURCE
4719 #undef _POSIX_SOURCE
4720 #undef _POSIX_C_SOURCE
4721 #include <sys/types.h>
4722 #include <sys/signal.h>
4723
4724 int
4725 main (void)
4726 {
4727
4728 #if SIGWINCH != $cf_sigwinch
4729 make an error
4730 #endif
4731 int x = SIGWINCH
4732   ;
4733   return 0;
4734 }
4735 _ACEOF
4736 rm -f conftest.$ac_objext
4737 if { (eval echo "$as_me:4737: \"$ac_compile\"") >&5
4738   (eval $ac_compile) 2>&5
4739   ac_status=$?
4740   echo "$as_me:4740: \$? = $ac_status" >&5
4741   (exit $ac_status); } &&
4742          { ac_try='test -s conftest.$ac_objext'
4743   { (eval echo "$as_me:4743: \"$ac_try\"") >&5
4744   (eval $ac_try) 2>&5
4745   ac_status=$?
4746   echo "$as_me:4746: \$? = $ac_status" >&5
4747   (exit $ac_status); }; }; then
4748   cf_cv_fixup_sigwinch=$cf_sigwinch
4749          break
4750 else
4751   echo "$as_me: failed program was:" >&5
4752 cat conftest.$ac_ext >&5
4753 fi
4754 rm -f conftest.$ac_objext conftest.$ac_ext
4755
4756 cf_sigwinch=`expr $cf_sigwinch - 1`
4757 done
4758
4759 fi
4760 echo "$as_me:4760: result: $cf_cv_fixup_sigwinch" >&5
4761 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4762
4763         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4764                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4765         fi
4766 fi
4767
4768 # Checks for CODESET support.
4769
4770 echo "$as_me:4770: checking for nl_langinfo and CODESET" >&5
4771 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4772 if test "${am_cv_langinfo_codeset+set}" = set; then
4773   echo $ECHO_N "(cached) $ECHO_C" >&6
4774 else
4775   cat >conftest.$ac_ext <<_ACEOF
4776 #line 4776 "configure"
4777 #include "confdefs.h"
4778 #include <langinfo.h>
4779 int
4780 main (void)
4781 {
4782 char* cs = nl_langinfo(CODESET);
4783   ;
4784   return 0;
4785 }
4786 _ACEOF
4787 rm -f conftest.$ac_objext conftest$ac_exeext
4788 if { (eval echo "$as_me:4788: \"$ac_link\"") >&5
4789   (eval $ac_link) 2>&5
4790   ac_status=$?
4791   echo "$as_me:4791: \$? = $ac_status" >&5
4792   (exit $ac_status); } &&
4793          { ac_try='test -s conftest$ac_exeext'
4794   { (eval echo "$as_me:4794: \"$ac_try\"") >&5
4795   (eval $ac_try) 2>&5
4796   ac_status=$?
4797   echo "$as_me:4797: \$? = $ac_status" >&5
4798   (exit $ac_status); }; }; then
4799   am_cv_langinfo_codeset=yes
4800 else
4801   echo "$as_me: failed program was:" >&5
4802 cat conftest.$ac_ext >&5
4803 am_cv_langinfo_codeset=no
4804 fi
4805 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4806
4807 fi
4808 echo "$as_me:4808: result: $am_cv_langinfo_codeset" >&5
4809 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4810         if test $am_cv_langinfo_codeset = yes; then
4811
4812 cat >>confdefs.h <<\EOF
4813 #define HAVE_LANGINFO_CODESET 1
4814 EOF
4815
4816         fi
4817
4818 echo "$as_me:4818: checking if you want to use pkg-config" >&5
4819 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4820
4821 # Check whether --with-pkg-config or --without-pkg-config was given.
4822 if test "${with_pkg_config+set}" = set; then
4823   withval="$with_pkg_config"
4824   cf_pkg_config=$withval
4825 else
4826   cf_pkg_config=yes
4827 fi;
4828 echo "$as_me:4828: result: $cf_pkg_config" >&5
4829 echo "${ECHO_T}$cf_pkg_config" >&6
4830
4831 case $cf_pkg_config in
4832 (no)
4833         PKG_CONFIG=none
4834         ;;
4835 (yes)
4836
4837 if test -n "$ac_tool_prefix"; then
4838   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4839 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4840 echo "$as_me:4840: checking for $ac_word" >&5
4841 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4842 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4843   echo $ECHO_N "(cached) $ECHO_C" >&6
4844 else
4845   case $PKG_CONFIG in
4846   [\\/]* | ?:[\\/]*)
4847   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4848   ;;
4849   *)
4850   ac_save_IFS=$IFS; IFS=$ac_path_separator
4851 ac_dummy="$PATH"
4852 for ac_dir in $ac_dummy; do
4853   IFS=$ac_save_IFS
4854   test -z "$ac_dir" && ac_dir=.
4855   if $as_executable_p "$ac_dir/$ac_word"; then
4856    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4857    echo "$as_me:4857: found $ac_dir/$ac_word" >&5
4858    break
4859 fi
4860 done
4861
4862   ;;
4863 esac
4864 fi
4865 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4866
4867 if test -n "$PKG_CONFIG"; then
4868   echo "$as_me:4868: result: $PKG_CONFIG" >&5
4869 echo "${ECHO_T}$PKG_CONFIG" >&6
4870 else
4871   echo "$as_me:4871: result: no" >&5
4872 echo "${ECHO_T}no" >&6
4873 fi
4874
4875 fi
4876 if test -z "$ac_cv_path_PKG_CONFIG"; then
4877   ac_pt_PKG_CONFIG=$PKG_CONFIG
4878   # Extract the first word of "pkg-config", so it can be a program name with args.
4879 set dummy pkg-config; ac_word=$2
4880 echo "$as_me:4880: checking for $ac_word" >&5
4881 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4882 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4883   echo $ECHO_N "(cached) $ECHO_C" >&6
4884 else
4885   case $ac_pt_PKG_CONFIG in
4886   [\\/]* | ?:[\\/]*)
4887   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4888   ;;
4889   *)
4890   ac_save_IFS=$IFS; IFS=$ac_path_separator
4891 ac_dummy="$PATH"
4892 for ac_dir in $ac_dummy; do
4893   IFS=$ac_save_IFS
4894   test -z "$ac_dir" && ac_dir=.
4895   if $as_executable_p "$ac_dir/$ac_word"; then
4896    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4897    echo "$as_me:4897: found $ac_dir/$ac_word" >&5
4898    break
4899 fi
4900 done
4901
4902   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4903   ;;
4904 esac
4905 fi
4906 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4907
4908 if test -n "$ac_pt_PKG_CONFIG"; then
4909   echo "$as_me:4909: result: $ac_pt_PKG_CONFIG" >&5
4910 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4911 else
4912   echo "$as_me:4912: result: no" >&5
4913 echo "${ECHO_T}no" >&6
4914 fi
4915
4916   PKG_CONFIG=$ac_pt_PKG_CONFIG
4917 else
4918   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4919 fi
4920
4921         ;;
4922 (*)
4923         PKG_CONFIG=$withval
4924         ;;
4925 esac
4926
4927 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4928 if test "$PKG_CONFIG" != none ; then
4929
4930 if test "x$prefix" != xNONE; then
4931         cf_path_syntax="$prefix"
4932 else
4933         cf_path_syntax="$ac_default_prefix"
4934 fi
4935
4936 case ".$PKG_CONFIG" in
4937 (.\$\(*\)*|.\'*\'*)
4938         ;;
4939 (..|./*|.\\*)
4940         ;;
4941 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4942         ;;
4943 (.\${*prefix}*|.\${*dir}*)
4944         eval PKG_CONFIG="$PKG_CONFIG"
4945         case ".$PKG_CONFIG" in
4946         (.NONE/*)
4947                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4948                 ;;
4949         esac
4950         ;;
4951 (.no|.NONE/*)
4952         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4953         ;;
4954 (*)
4955         { { echo "$as_me:4955: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4956 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4957    { (exit 1); exit 1; }; }
4958         ;;
4959 esac
4960
4961 elif test "x$cf_pkg_config" != xno ; then
4962         { echo "$as_me:4962: WARNING: pkg-config is not installed" >&5
4963 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4964 fi
4965
4966 echo "$as_me:4966: checking if you want to see long compiling messages" >&5
4967 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4968
4969 # Check whether --enable-echo or --disable-echo was given.
4970 if test "${enable_echo+set}" = set; then
4971   enableval="$enable_echo"
4972   test "$enableval" != no && enableval=yes
4973         if test "$enableval" != "yes" ; then
4974
4975         ECHO_LT='--silent'
4976         ECHO_LD='@echo linking $@;'
4977         RULE_CC='@echo compiling $<'
4978         SHOW_CC='@echo compiling $@'
4979         ECHO_CC='@'
4980
4981         else
4982
4983         ECHO_LT=''
4984         ECHO_LD=''
4985         RULE_CC=''
4986         SHOW_CC=''
4987         ECHO_CC=''
4988
4989         fi
4990 else
4991   enableval=yes
4992
4993         ECHO_LT=''
4994         ECHO_LD=''
4995         RULE_CC=''
4996         SHOW_CC=''
4997         ECHO_CC=''
4998
4999 fi;
5000 echo "$as_me:5000: result: $enableval" >&5
5001 echo "${ECHO_T}$enableval" >&6
5002
5003 echo "$as_me:5003: checking for ncurses wrap-prefix" >&5
5004 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5005
5006 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5007 if test "${with_ncurses_wrap_prefix+set}" = set; then
5008   withval="$with_ncurses_wrap_prefix"
5009   NCURSES_WRAP_PREFIX=$withval
5010 else
5011   NCURSES_WRAP_PREFIX=_nc_
5012 fi;
5013 echo "$as_me:5013: result: $NCURSES_WRAP_PREFIX" >&5
5014 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5015
5016 echo "$as_me:5016: checking if you want to check for wide-character functions" >&5
5017 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5018
5019 # Check whether --enable-widec or --disable-widec was given.
5020 if test "${enable_widec+set}" = set; then
5021   enableval="$enable_widec"
5022   test "$enableval" != no && enableval=yes
5023         if test "$enableval" != "yes" ; then
5024     cf_enable_widec=no
5025         else
5026                 cf_enable_widec=yes
5027         fi
5028 else
5029   enableval=yes
5030         cf_enable_widec=yes
5031
5032 fi;
5033 echo "$as_me:5033: result: $cf_enable_widec" >&5
5034 echo "${ECHO_T}$cf_enable_widec" >&6
5035
5036 echo "$as_me:5036: checking for specific curses-directory" >&5
5037 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5038
5039 # Check whether --with-curses-dir or --without-curses-dir was given.
5040 if test "${with_curses_dir+set}" = set; then
5041   withval="$with_curses_dir"
5042   cf_cv_curses_dir=$withval
5043 else
5044   cf_cv_curses_dir=no
5045 fi;
5046 echo "$as_me:5046: result: $cf_cv_curses_dir" >&5
5047 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5048
5049 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5050 then
5051
5052 if test "x$prefix" != xNONE; then
5053         cf_path_syntax="$prefix"
5054 else
5055         cf_path_syntax="$ac_default_prefix"
5056 fi
5057
5058 case ".$withval" in
5059 (.\$\(*\)*|.\'*\'*)
5060         ;;
5061 (..|./*|.\\*)
5062         ;;
5063 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5064         ;;
5065 (.\${*prefix}*|.\${*dir}*)
5066         eval withval="$withval"
5067         case ".$withval" in
5068         (.NONE/*)
5069                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5070                 ;;
5071         esac
5072         ;;
5073 (.no|.NONE/*)
5074         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5075         ;;
5076 (*)
5077         { { echo "$as_me:5077: error: expected a pathname, not \"$withval\"" >&5
5078 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5079    { (exit 1); exit 1; }; }
5080         ;;
5081 esac
5082
5083         if test -d "$cf_cv_curses_dir"
5084         then
5085
5086 if test -n "$cf_cv_curses_dir/include" ; then
5087   for cf_add_incdir in $cf_cv_curses_dir/include
5088   do
5089         while test $cf_add_incdir != /usr/include
5090         do
5091           if test -d $cf_add_incdir
5092           then
5093                 cf_have_incdir=no
5094                 if test -n "$CFLAGS$CPPFLAGS" ; then
5095                   # a loop is needed to ensure we can add subdirs of existing dirs
5096                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5097                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5098                           cf_have_incdir=yes; break
5099                         fi
5100                   done
5101                 fi
5102
5103                 if test "$cf_have_incdir" = no ; then
5104                   if test "$cf_add_incdir" = /usr/local/include ; then
5105                         if test "$GCC" = yes
5106                         then
5107                           cf_save_CPPFLAGS=$CPPFLAGS
5108                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5109                           cat >conftest.$ac_ext <<_ACEOF
5110 #line 5110 "configure"
5111 #include "confdefs.h"
5112 #include <stdio.h>
5113 int
5114 main (void)
5115 {
5116 printf("Hello")
5117   ;
5118   return 0;
5119 }
5120 _ACEOF
5121 rm -f conftest.$ac_objext
5122 if { (eval echo "$as_me:5122: \"$ac_compile\"") >&5
5123   (eval $ac_compile) 2>&5
5124   ac_status=$?
5125   echo "$as_me:5125: \$? = $ac_status" >&5
5126   (exit $ac_status); } &&
5127          { ac_try='test -s conftest.$ac_objext'
5128   { (eval echo "$as_me:5128: \"$ac_try\"") >&5
5129   (eval $ac_try) 2>&5
5130   ac_status=$?
5131   echo "$as_me:5131: \$? = $ac_status" >&5
5132   (exit $ac_status); }; }; then
5133   :
5134 else
5135   echo "$as_me: failed program was:" >&5
5136 cat conftest.$ac_ext >&5
5137 cf_have_incdir=yes
5138 fi
5139 rm -f conftest.$ac_objext conftest.$ac_ext
5140                           CPPFLAGS=$cf_save_CPPFLAGS
5141                         fi
5142                   fi
5143                 fi
5144
5145                 if test "$cf_have_incdir" = no ; then
5146                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5147
5148 echo "${as_me:-configure}:5148: testing adding $cf_add_incdir to include-path ..." 1>&5
5149
5150                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5151
5152                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5153                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5154                   cf_add_incdir="$cf_top_incdir"
5155                 else
5156                   break
5157                 fi
5158           else
5159                 break
5160           fi
5161         done
5162   done
5163 fi
5164
5165 if test -n "$cf_cv_curses_dir/lib" ; then
5166         for cf_add_libdir in $cf_cv_curses_dir/lib
5167         do
5168                 if test $cf_add_libdir = /usr/lib ; then
5169                         :
5170                 elif test -d $cf_add_libdir
5171                 then
5172                         cf_have_libdir=no
5173                         if test -n "$LDFLAGS$LIBS" ; then
5174                                 # a loop is needed to ensure we can add subdirs of existing dirs
5175                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5176                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5177                                                 cf_have_libdir=yes; break
5178                                         fi
5179                                 done
5180                         fi
5181                         if test "$cf_have_libdir" = no ; then
5182                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5183
5184 echo "${as_me:-configure}:5184: testing adding $cf_add_libdir to library-path ..." 1>&5
5185
5186                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5187                         fi
5188                 fi
5189         done
5190 fi
5191
5192         fi
5193 fi
5194
5195 cf_cv_screen=curses
5196
5197 echo "$as_me:5197: checking for specified curses library type" >&5
5198 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5199
5200 # Check whether --with-screen or --without-screen was given.
5201 if test "${with_screen+set}" = set; then
5202   withval="$with_screen"
5203   cf_cv_screen=$withval
5204 else
5205
5206 # Check whether --with-ncursesw or --without-ncursesw was given.
5207 if test "${with_ncursesw+set}" = set; then
5208   withval="$with_ncursesw"
5209   cf_cv_screen=ncursesw
5210 else
5211
5212 # Check whether --with-ncurses or --without-ncurses was given.
5213 if test "${with_ncurses+set}" = set; then
5214   withval="$with_ncurses"
5215   cf_cv_screen=ncurses
5216 else
5217
5218 # Check whether --with-pdcurses or --without-pdcurses was given.
5219 if test "${with_pdcurses+set}" = set; then
5220   withval="$with_pdcurses"
5221   cf_cv_screen=pdcurses
5222 else
5223
5224 # Check whether --with-curses-colr or --without-curses-colr was given.
5225 if test "${with_curses_colr+set}" = set; then
5226   withval="$with_curses_colr"
5227   cf_cv_screen=curses_colr
5228 else
5229
5230 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5231 if test "${with_curses_5lib+set}" = set; then
5232   withval="$with_curses_5lib"
5233   cf_cv_screen=curses_5lib
5234 fi;
5235 fi;
5236 fi;
5237 fi;
5238 fi;
5239 fi;
5240
5241 echo "$as_me:5241: result: $cf_cv_screen" >&5
5242 echo "${ECHO_T}$cf_cv_screen" >&6
5243
5244 case $cf_cv_screen in
5245 (curses|curses_*)
5246
5247 echo "$as_me:5247: checking for extra include directories" >&5
5248 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5249 if test "${cf_cv_curses_incdir+set}" = set; then
5250   echo $ECHO_N "(cached) $ECHO_C" >&6
5251 else
5252
5253 cf_cv_curses_incdir=no
5254 case $host_os in
5255 (hpux10.*)
5256         if test "x$cf_cv_screen" = "xcurses_colr"
5257         then
5258                 test -d /usr/include/curses_colr && \
5259                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5260         fi
5261         ;;
5262 (sunos3*|sunos4*)
5263         if test "x$cf_cv_screen" = "xcurses_5lib"
5264         then
5265                 test -d /usr/5lib && \
5266                 test -d /usr/5include && \
5267                 cf_cv_curses_incdir="-I/usr/5include"
5268         fi
5269         ;;
5270 esac
5271
5272 fi
5273 echo "$as_me:5273: result: $cf_cv_curses_incdir" >&5
5274 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5275 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5276
5277 echo "$as_me:5277: checking if we have identified curses headers" >&5
5278 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5279 if test "${cf_cv_ncurses_header+set}" = set; then
5280   echo $ECHO_N "(cached) $ECHO_C" >&6
5281 else
5282
5283 cf_cv_ncurses_header=none
5284 for cf_header in \
5285         ncurses.h  \
5286         curses.h  ncurses/ncurses.h ncurses/curses.h
5287 do
5288 cat >conftest.$ac_ext <<_ACEOF
5289 #line 5289 "configure"
5290 #include "confdefs.h"
5291 #include <${cf_header}>
5292 int
5293 main (void)
5294 {
5295 initscr(); tgoto("?", 0,0)
5296   ;
5297   return 0;
5298 }
5299 _ACEOF
5300 rm -f conftest.$ac_objext
5301 if { (eval echo "$as_me:5301: \"$ac_compile\"") >&5
5302   (eval $ac_compile) 2>&5
5303   ac_status=$?
5304   echo "$as_me:5304: \$? = $ac_status" >&5
5305   (exit $ac_status); } &&
5306          { ac_try='test -s conftest.$ac_objext'
5307   { (eval echo "$as_me:5307: \"$ac_try\"") >&5
5308   (eval $ac_try) 2>&5
5309   ac_status=$?
5310   echo "$as_me:5310: \$? = $ac_status" >&5
5311   (exit $ac_status); }; }; then
5312   cf_cv_ncurses_header=$cf_header; break
5313 else
5314   echo "$as_me: failed program was:" >&5
5315 cat conftest.$ac_ext >&5
5316 fi
5317 rm -f conftest.$ac_objext conftest.$ac_ext
5318 done
5319
5320 fi
5321 echo "$as_me:5321: result: $cf_cv_ncurses_header" >&5
5322 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5323
5324 if test "$cf_cv_ncurses_header" = none ; then
5325         { { echo "$as_me:5325: error: No curses header-files found" >&5
5326 echo "$as_me: error: No curses header-files found" >&2;}
5327    { (exit 1); exit 1; }; }
5328 fi
5329
5330 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5331
5332 for ac_header in $cf_cv_ncurses_header
5333 do
5334 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5335 echo "$as_me:5335: checking for $ac_header" >&5
5336 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5337 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5338   echo $ECHO_N "(cached) $ECHO_C" >&6
5339 else
5340   cat >conftest.$ac_ext <<_ACEOF
5341 #line 5341 "configure"
5342 #include "confdefs.h"
5343 #include <$ac_header>
5344 _ACEOF
5345 if { (eval echo "$as_me:5345: \"$ac_cpp conftest.$ac_ext\"") >&5
5346   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5347   ac_status=$?
5348   egrep -v '^ *\+' conftest.er1 >conftest.err
5349   rm -f conftest.er1
5350   cat conftest.err >&5
5351   echo "$as_me:5351: \$? = $ac_status" >&5
5352   (exit $ac_status); } >/dev/null; then
5353   if test -s conftest.err; then
5354     ac_cpp_err=$ac_c_preproc_warn_flag
5355   else
5356     ac_cpp_err=
5357   fi
5358 else
5359   ac_cpp_err=yes
5360 fi
5361 if test -z "$ac_cpp_err"; then
5362   eval "$as_ac_Header=yes"
5363 else
5364   echo "$as_me: failed program was:" >&5
5365   cat conftest.$ac_ext >&5
5366   eval "$as_ac_Header=no"
5367 fi
5368 rm -f conftest.err conftest.$ac_ext
5369 fi
5370 echo "$as_me:5370: result: `eval echo '${'$as_ac_Header'}'`" >&5
5371 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5372 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5373   cat >>confdefs.h <<EOF
5374 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5375 EOF
5376
5377 fi
5378 done
5379
5380 echo "$as_me:5380: checking for terminfo header" >&5
5381 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5382 if test "${cf_cv_term_header+set}" = set; then
5383   echo $ECHO_N "(cached) $ECHO_C" >&6
5384 else
5385
5386 case ${cf_cv_ncurses_header} in
5387 (*/ncurses.h|*/ncursesw.h)
5388         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5389         ;;
5390 (*)
5391         cf_term_header=term.h
5392         ;;
5393 esac
5394
5395 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5396 do
5397 cat >conftest.$ac_ext <<_ACEOF
5398 #line 5398 "configure"
5399 #include "confdefs.h"
5400 #include <stdio.h>
5401 #include <${cf_cv_ncurses_header:-curses.h}>
5402 #include <$cf_test>
5403
5404 int
5405 main (void)
5406 {
5407 int x = auto_left_margin
5408   ;
5409   return 0;
5410 }
5411 _ACEOF
5412 rm -f conftest.$ac_objext
5413 if { (eval echo "$as_me:5413: \"$ac_compile\"") >&5
5414   (eval $ac_compile) 2>&5
5415   ac_status=$?
5416   echo "$as_me:5416: \$? = $ac_status" >&5
5417   (exit $ac_status); } &&
5418          { ac_try='test -s conftest.$ac_objext'
5419   { (eval echo "$as_me:5419: \"$ac_try\"") >&5
5420   (eval $ac_try) 2>&5
5421   ac_status=$?
5422   echo "$as_me:5422: \$? = $ac_status" >&5
5423   (exit $ac_status); }; }; then
5424
5425         cf_cv_term_header="$cf_test"
5426 else
5427   echo "$as_me: failed program was:" >&5
5428 cat conftest.$ac_ext >&5
5429
5430         cf_cv_term_header=unknown
5431
5432 fi
5433 rm -f conftest.$ac_objext conftest.$ac_ext
5434         test "$cf_cv_term_header" != unknown && break
5435 done
5436
5437 fi
5438 echo "$as_me:5438: result: $cf_cv_term_header" >&5
5439 echo "${ECHO_T}$cf_cv_term_header" >&6
5440
5441 # Set definitions to allow ifdef'ing to accommodate subdirectories
5442
5443 case $cf_cv_term_header in
5444 (*term.h)
5445
5446 cat >>confdefs.h <<\EOF
5447 #define HAVE_TERM_H 1
5448 EOF
5449
5450         ;;
5451 esac
5452
5453 case $cf_cv_term_header in
5454 (ncurses/term.h)
5455
5456 cat >>confdefs.h <<\EOF
5457 #define HAVE_NCURSES_TERM_H 1
5458 EOF
5459
5460         ;;
5461 (ncursesw/term.h)
5462
5463 cat >>confdefs.h <<\EOF
5464 #define HAVE_NCURSESW_TERM_H 1
5465 EOF
5466
5467         ;;
5468 esac
5469
5470 echo "$as_me:5470: checking for ncurses version" >&5
5471 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5472 if test "${cf_cv_ncurses_version+set}" = set; then
5473   echo $ECHO_N "(cached) $ECHO_C" >&6
5474 else
5475
5476         cf_cv_ncurses_version=no
5477         cf_tempfile=out$$
5478         rm -f $cf_tempfile
5479         if test "$cross_compiling" = yes; then
5480
5481         # This will not work if the preprocessor splits the line after the
5482         # Autoconf token.  The 'unproto' program does that.
5483         cat > conftest.$ac_ext <<EOF
5484 #include <${cf_cv_ncurses_header:-curses.h}>
5485 #undef Autoconf
5486 #ifdef NCURSES_VERSION
5487 Autoconf NCURSES_VERSION
5488 #else
5489 #ifdef __NCURSES_H
5490 Autoconf "old"
5491 #endif
5492 ;
5493 #endif
5494 EOF
5495         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5496         { (eval echo "$as_me:5496: \"$cf_try\"") >&5
5497   (eval $cf_try) 2>&5
5498   ac_status=$?
5499   echo "$as_me:5499: \$? = $ac_status" >&5
5500   (exit $ac_status); }
5501         if test -f conftest.out ; then
5502                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5503                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5504                 rm -f conftest.out
5505         fi
5506
5507 else
5508   cat >conftest.$ac_ext <<_ACEOF
5509 #line 5509 "configure"
5510 #include "confdefs.h"
5511
5512 #include <${cf_cv_ncurses_header:-curses.h}>
5513 #include <stdio.h>
5514 int main(void)
5515 {
5516         FILE *fp = fopen("$cf_tempfile", "w");
5517 #ifdef NCURSES_VERSION
5518 # ifdef NCURSES_VERSION_PATCH
5519         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5520 # else
5521         fprintf(fp, "%s\n", NCURSES_VERSION);
5522 # endif
5523 #else
5524 # ifdef __NCURSES_H
5525         fprintf(fp, "old\n");
5526 # else
5527         make an error
5528 # endif
5529 #endif
5530         ${cf_cv_main_return:-return}(0);
5531 }
5532 _ACEOF
5533 rm -f conftest$ac_exeext
5534 if { (eval echo "$as_me:5534: \"$ac_link\"") >&5
5535   (eval $ac_link) 2>&5
5536   ac_status=$?
5537   echo "$as_me:5537: \$? = $ac_status" >&5
5538   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5539   { (eval echo "$as_me:5539: \"$ac_try\"") >&5
5540   (eval $ac_try) 2>&5
5541   ac_status=$?
5542   echo "$as_me:5542: \$? = $ac_status" >&5
5543   (exit $ac_status); }; }; then
5544
5545         cf_cv_ncurses_version=`cat $cf_tempfile`
5546 else
5547   echo "$as_me: program exited with status $ac_status" >&5
5548 echo "$as_me: failed program was:" >&5
5549 cat conftest.$ac_ext >&5
5550 fi
5551 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5552 fi
5553         rm -f $cf_tempfile
5554
5555 fi
5556 echo "$as_me:5556: result: $cf_cv_ncurses_version" >&5
5557 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5558 test "$cf_cv_ncurses_version" = no ||
5559 cat >>confdefs.h <<\EOF
5560 #define NCURSES 1
5561 EOF
5562
5563 echo "$as_me:5563: checking if we have identified curses libraries" >&5
5564 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5565 cat >conftest.$ac_ext <<_ACEOF
5566 #line 5566 "configure"
5567 #include "confdefs.h"
5568 #include <${cf_cv_ncurses_header:-curses.h}>
5569 int
5570 main (void)
5571 {
5572 initscr(); tgoto("?", 0,0)
5573   ;
5574   return 0;
5575 }
5576 _ACEOF
5577 rm -f conftest.$ac_objext conftest$ac_exeext
5578 if { (eval echo "$as_me:5578: \"$ac_link\"") >&5
5579   (eval $ac_link) 2>&5
5580   ac_status=$?
5581   echo "$as_me:5581: \$? = $ac_status" >&5
5582   (exit $ac_status); } &&
5583          { ac_try='test -s conftest$ac_exeext'
5584   { (eval echo "$as_me:5584: \"$ac_try\"") >&5
5585   (eval $ac_try) 2>&5
5586   ac_status=$?
5587   echo "$as_me:5587: \$? = $ac_status" >&5
5588   (exit $ac_status); }; }; then
5589   cf_result=yes
5590 else
5591   echo "$as_me: failed program was:" >&5
5592 cat conftest.$ac_ext >&5
5593 cf_result=no
5594 fi
5595 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5596 echo "$as_me:5596: result: $cf_result" >&5
5597 echo "${ECHO_T}$cf_result" >&6
5598
5599 if test "$cf_result" = no ; then
5600 case $host_os in
5601 (freebsd*)
5602         echo "$as_me:5602: checking for tgoto in -lmytinfo" >&5
5603 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5604 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5605   echo $ECHO_N "(cached) $ECHO_C" >&6
5606 else
5607   ac_check_lib_save_LIBS=$LIBS
5608 LIBS="-lmytinfo  $LIBS"
5609 cat >conftest.$ac_ext <<_ACEOF
5610 #line 5610 "configure"
5611 #include "confdefs.h"
5612
5613 /* Override any gcc2 internal prototype to avoid an error.  */
5614 #ifdef __cplusplus
5615 extern "C"
5616 #endif
5617 /* We use char because int might match the return type of a gcc2
5618    builtin and then its argument prototype would still apply.  */
5619 char tgoto ();
5620 int
5621 main (void)
5622 {
5623 tgoto ();
5624   ;
5625   return 0;
5626 }
5627 _ACEOF
5628 rm -f conftest.$ac_objext conftest$ac_exeext
5629 if { (eval echo "$as_me:5629: \"$ac_link\"") >&5
5630   (eval $ac_link) 2>&5
5631   ac_status=$?
5632   echo "$as_me:5632: \$? = $ac_status" >&5
5633   (exit $ac_status); } &&
5634          { ac_try='test -s conftest$ac_exeext'
5635   { (eval echo "$as_me:5635: \"$ac_try\"") >&5
5636   (eval $ac_try) 2>&5
5637   ac_status=$?
5638   echo "$as_me:5638: \$? = $ac_status" >&5
5639   (exit $ac_status); }; }; then
5640   ac_cv_lib_mytinfo_tgoto=yes
5641 else
5642   echo "$as_me: failed program was:" >&5
5643 cat conftest.$ac_ext >&5
5644 ac_cv_lib_mytinfo_tgoto=no
5645 fi
5646 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5647 LIBS=$ac_check_lib_save_LIBS
5648 fi
5649 echo "$as_me:5649: result: $ac_cv_lib_mytinfo_tgoto" >&5
5650 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5651 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5652
5653 cf_add_libs="-lmytinfo"
5654 # Filter out duplicates - this happens with badly-designed ".pc" files...
5655 for cf_add_1lib in $LIBS
5656 do
5657         for cf_add_2lib in $cf_add_libs
5658         do
5659                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5660                 then
5661                         cf_add_1lib=
5662                         break
5663                 fi
5664         done
5665         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5666 done
5667 LIBS="$cf_add_libs"
5668
5669 fi
5670
5671         ;;
5672 (hpux10.*)
5673         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5674         # next (1998), and xcurses "newer" (2000).  There is no header file for
5675         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5676         # term.h) for cur_colr
5677         if test "x$cf_cv_screen" = "xcurses_colr"
5678         then
5679                 echo "$as_me:5679: checking for initscr in -lcur_colr" >&5
5680 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5681 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5682   echo $ECHO_N "(cached) $ECHO_C" >&6
5683 else
5684   ac_check_lib_save_LIBS=$LIBS
5685 LIBS="-lcur_colr  $LIBS"
5686 cat >conftest.$ac_ext <<_ACEOF
5687 #line 5687 "configure"
5688 #include "confdefs.h"
5689
5690 /* Override any gcc2 internal prototype to avoid an error.  */
5691 #ifdef __cplusplus
5692 extern "C"
5693 #endif
5694 /* We use char because int might match the return type of a gcc2
5695    builtin and then its argument prototype would still apply.  */
5696 char initscr ();
5697 int
5698 main (void)
5699 {
5700 initscr ();
5701   ;
5702   return 0;
5703 }
5704 _ACEOF
5705 rm -f conftest.$ac_objext conftest$ac_exeext
5706 if { (eval echo "$as_me:5706: \"$ac_link\"") >&5
5707   (eval $ac_link) 2>&5
5708   ac_status=$?
5709   echo "$as_me:5709: \$? = $ac_status" >&5
5710   (exit $ac_status); } &&
5711          { ac_try='test -s conftest$ac_exeext'
5712   { (eval echo "$as_me:5712: \"$ac_try\"") >&5
5713   (eval $ac_try) 2>&5
5714   ac_status=$?
5715   echo "$as_me:5715: \$? = $ac_status" >&5
5716   (exit $ac_status); }; }; then
5717   ac_cv_lib_cur_colr_initscr=yes
5718 else
5719   echo "$as_me: failed program was:" >&5
5720 cat conftest.$ac_ext >&5
5721 ac_cv_lib_cur_colr_initscr=no
5722 fi
5723 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5724 LIBS=$ac_check_lib_save_LIBS
5725 fi
5726 echo "$as_me:5726: result: $ac_cv_lib_cur_colr_initscr" >&5
5727 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5728 if test $ac_cv_lib_cur_colr_initscr = yes; then
5729
5730 cf_add_libs="-lcur_colr"
5731 # Filter out duplicates - this happens with badly-designed ".pc" files...
5732 for cf_add_1lib in $LIBS
5733 do
5734         for cf_add_2lib in $cf_add_libs
5735         do
5736                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5737                 then
5738                         cf_add_1lib=
5739                         break
5740                 fi
5741         done
5742         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5743 done
5744 LIBS="$cf_add_libs"
5745
5746                         ac_cv_func_initscr=yes
5747
5748 else
5749
5750                 echo "$as_me:5750: checking for initscr in -lHcurses" >&5
5751 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5752 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5753   echo $ECHO_N "(cached) $ECHO_C" >&6
5754 else
5755   ac_check_lib_save_LIBS=$LIBS
5756 LIBS="-lHcurses  $LIBS"
5757 cat >conftest.$ac_ext <<_ACEOF
5758 #line 5758 "configure"
5759 #include "confdefs.h"
5760
5761 /* Override any gcc2 internal prototype to avoid an error.  */
5762 #ifdef __cplusplus
5763 extern "C"
5764 #endif
5765 /* We use char because int might match the return type of a gcc2
5766    builtin and then its argument prototype would still apply.  */
5767 char initscr ();
5768 int
5769 main (void)
5770 {
5771 initscr ();
5772   ;
5773   return 0;
5774 }
5775 _ACEOF
5776 rm -f conftest.$ac_objext conftest$ac_exeext
5777 if { (eval echo "$as_me:5777: \"$ac_link\"") >&5
5778   (eval $ac_link) 2>&5
5779   ac_status=$?
5780   echo "$as_me:5780: \$? = $ac_status" >&5
5781   (exit $ac_status); } &&
5782          { ac_try='test -s conftest$ac_exeext'
5783   { (eval echo "$as_me:5783: \"$ac_try\"") >&5
5784   (eval $ac_try) 2>&5
5785   ac_status=$?
5786   echo "$as_me:5786: \$? = $ac_status" >&5
5787   (exit $ac_status); }; }; then
5788   ac_cv_lib_Hcurses_initscr=yes
5789 else
5790   echo "$as_me: failed program was:" >&5
5791 cat conftest.$ac_ext >&5
5792 ac_cv_lib_Hcurses_initscr=no
5793 fi
5794 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5795 LIBS=$ac_check_lib_save_LIBS
5796 fi
5797 echo "$as_me:5797: result: $ac_cv_lib_Hcurses_initscr" >&5
5798 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5799 if test $ac_cv_lib_Hcurses_initscr = yes; then
5800
5801                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5802
5803 cf_add_libs="-lHcurses"
5804 # Filter out duplicates - this happens with badly-designed ".pc" files...
5805 for cf_add_1lib in $LIBS
5806 do
5807         for cf_add_2lib in $cf_add_libs
5808         do
5809                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5810                 then
5811                         cf_add_1lib=
5812                         break
5813                 fi
5814         done
5815         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5816 done
5817 LIBS="$cf_add_libs"
5818
5819                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5820                         ac_cv_func_initscr=yes
5821
5822 fi
5823
5824 fi
5825
5826         fi
5827         ;;
5828 (linux*)
5829         case `arch 2>/dev/null` in
5830         (x86_64)
5831                 if test -d /lib64
5832                 then
5833
5834 if test -n "/lib64" ; then
5835         for cf_add_libdir in /lib64
5836         do
5837                 if test $cf_add_libdir = /usr/lib ; then
5838                         :
5839                 elif test -d $cf_add_libdir
5840                 then
5841                         cf_have_libdir=no
5842                         if test -n "$LDFLAGS$LIBS" ; then
5843                                 # a loop is needed to ensure we can add subdirs of existing dirs
5844                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5845                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5846                                                 cf_have_libdir=yes; break
5847                                         fi
5848                                 done
5849                         fi
5850                         if test "$cf_have_libdir" = no ; then
5851                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5852
5853 echo "${as_me:-configure}:5853: testing adding $cf_add_libdir to library-path ..." 1>&5
5854
5855                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5856                         fi
5857                 fi
5858         done
5859 fi
5860
5861                 else
5862
5863 if test -n "/lib" ; then
5864         for cf_add_libdir in /lib
5865         do
5866                 if test $cf_add_libdir = /usr/lib ; then
5867                         :
5868                 elif test -d $cf_add_libdir
5869                 then
5870                         cf_have_libdir=no
5871                         if test -n "$LDFLAGS$LIBS" ; then
5872                                 # a loop is needed to ensure we can add subdirs of existing dirs
5873                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5874                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5875                                                 cf_have_libdir=yes; break
5876                                         fi
5877                                 done
5878                         fi
5879                         if test "$cf_have_libdir" = no ; then
5880                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5881
5882 echo "${as_me:-configure}:5882: testing adding $cf_add_libdir to library-path ..." 1>&5
5883
5884                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5885                         fi
5886                 fi
5887         done
5888 fi
5889
5890                 fi
5891                 ;;
5892         (*)
5893
5894 if test -n "/lib" ; then
5895         for cf_add_libdir in /lib
5896         do
5897                 if test $cf_add_libdir = /usr/lib ; then
5898                         :
5899                 elif test -d $cf_add_libdir
5900                 then
5901                         cf_have_libdir=no
5902                         if test -n "$LDFLAGS$LIBS" ; then
5903                                 # a loop is needed to ensure we can add subdirs of existing dirs
5904                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5905                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5906                                                 cf_have_libdir=yes; break
5907                                         fi
5908                                 done
5909                         fi
5910                         if test "$cf_have_libdir" = no ; then
5911                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5912
5913 echo "${as_me:-configure}:5913: testing adding $cf_add_libdir to library-path ..." 1>&5
5914
5915                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5916                         fi
5917                 fi
5918         done
5919 fi
5920
5921                 ;;
5922         esac
5923         ;;
5924 (sunos3*|sunos4*)
5925         if test "x$cf_cv_screen" = "xcurses_5lib"
5926         then
5927                 if test -d /usr/5lib ; then
5928
5929 if test -n "/usr/5lib" ; then
5930         for cf_add_libdir in /usr/5lib
5931         do
5932                 if test $cf_add_libdir = /usr/lib ; then
5933                         :
5934                 elif test -d $cf_add_libdir
5935                 then
5936                         cf_have_libdir=no
5937                         if test -n "$LDFLAGS$LIBS" ; then
5938                                 # a loop is needed to ensure we can add subdirs of existing dirs
5939                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5940                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5941                                                 cf_have_libdir=yes; break
5942                                         fi
5943                                 done
5944                         fi
5945                         if test "$cf_have_libdir" = no ; then
5946                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5947
5948 echo "${as_me:-configure}:5948: testing adding $cf_add_libdir to library-path ..." 1>&5
5949
5950                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5951                         fi
5952                 fi
5953         done
5954 fi
5955
5956 cf_add_libs="-lcurses -ltermcap"
5957 # Filter out duplicates - this happens with badly-designed ".pc" files...
5958 for cf_add_1lib in $LIBS
5959 do
5960         for cf_add_2lib in $cf_add_libs
5961         do
5962                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5963                 then
5964                         cf_add_1lib=
5965                         break
5966                 fi
5967         done
5968         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5969 done
5970 LIBS="$cf_add_libs"
5971
5972                 fi
5973         fi
5974         ac_cv_func_initscr=yes
5975         ;;
5976 esac
5977
5978 if test ".$ac_cv_func_initscr" != .yes ; then
5979         cf_save_LIBS="$LIBS"
5980
5981         if test ".${cf_cv_ncurses_version:-no}" != .no
5982         then
5983                 cf_check_list="ncurses curses cursesX"
5984         else
5985                 cf_check_list="cursesX curses ncurses"
5986         fi
5987
5988         # Check for library containing tgoto.  Do this before curses library
5989         # because it may be needed to link the test-case for initscr.
5990         if test "x$cf_term_lib" = x
5991         then
5992                 echo "$as_me:5992: checking for tgoto" >&5
5993 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5994 if test "${ac_cv_func_tgoto+set}" = set; then
5995   echo $ECHO_N "(cached) $ECHO_C" >&6
5996 else
5997   cat >conftest.$ac_ext <<_ACEOF
5998 #line 5998 "configure"
5999 #include "confdefs.h"
6000 /* System header to define __stub macros and hopefully few prototypes,
6001     which can conflict with char tgoto (); below.  */
6002 #include <assert.h>
6003 /* Override any gcc2 internal prototype to avoid an error.  */
6004 #ifdef __cplusplus
6005 extern "C"
6006 #endif
6007 /* We use char because int might match the return type of a gcc2
6008    builtin and then its argument prototype would still apply.  */
6009 char tgoto ();
6010 char (*f) ();
6011
6012 int
6013 main (void)
6014 {
6015 /* The GNU C library defines this for functions which it implements
6016     to always fail with ENOSYS.  Some functions are actually named
6017     something starting with __ and the normal name is an alias.  */
6018 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6019 choke me
6020 #else
6021 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6022 #endif
6023
6024   ;
6025   return 0;
6026 }
6027 _ACEOF
6028 rm -f conftest.$ac_objext conftest$ac_exeext
6029 if { (eval echo "$as_me:6029: \"$ac_link\"") >&5
6030   (eval $ac_link) 2>&5
6031   ac_status=$?
6032   echo "$as_me:6032: \$? = $ac_status" >&5
6033   (exit $ac_status); } &&
6034          { ac_try='test -s conftest$ac_exeext'
6035   { (eval echo "$as_me:6035: \"$ac_try\"") >&5
6036   (eval $ac_try) 2>&5
6037   ac_status=$?
6038   echo "$as_me:6038: \$? = $ac_status" >&5
6039   (exit $ac_status); }; }; then
6040   ac_cv_func_tgoto=yes
6041 else
6042   echo "$as_me: failed program was:" >&5
6043 cat conftest.$ac_ext >&5
6044 ac_cv_func_tgoto=no
6045 fi
6046 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6047 fi
6048 echo "$as_me:6048: result: $ac_cv_func_tgoto" >&5
6049 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6050 if test $ac_cv_func_tgoto = yes; then
6051   cf_term_lib=predefined
6052 else
6053
6054                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6055                         do
6056                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6057 echo "$as_me:6057: checking for tgoto in -l$cf_term_lib" >&5
6058 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6059 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6060   echo $ECHO_N "(cached) $ECHO_C" >&6
6061 else
6062   ac_check_lib_save_LIBS=$LIBS
6063 LIBS="-l$cf_term_lib  $LIBS"
6064 cat >conftest.$ac_ext <<_ACEOF
6065 #line 6065 "configure"
6066 #include "confdefs.h"
6067
6068 /* Override any gcc2 internal prototype to avoid an error.  */
6069 #ifdef __cplusplus
6070 extern "C"
6071 #endif
6072 /* We use char because int might match the return type of a gcc2
6073    builtin and then its argument prototype would still apply.  */
6074 char tgoto ();
6075 int
6076 main (void)
6077 {
6078 tgoto ();
6079   ;
6080   return 0;
6081 }
6082 _ACEOF
6083 rm -f conftest.$ac_objext conftest$ac_exeext
6084 if { (eval echo "$as_me:6084: \"$ac_link\"") >&5
6085   (eval $ac_link) 2>&5
6086   ac_status=$?
6087   echo "$as_me:6087: \$? = $ac_status" >&5
6088   (exit $ac_status); } &&
6089          { ac_try='test -s conftest$ac_exeext'
6090   { (eval echo "$as_me:6090: \"$ac_try\"") >&5
6091   (eval $ac_try) 2>&5
6092   ac_status=$?
6093   echo "$as_me:6093: \$? = $ac_status" >&5
6094   (exit $ac_status); }; }; then
6095   eval "$as_ac_Lib=yes"
6096 else
6097   echo "$as_me: failed program was:" >&5
6098 cat conftest.$ac_ext >&5
6099 eval "$as_ac_Lib=no"
6100 fi
6101 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6102 LIBS=$ac_check_lib_save_LIBS
6103 fi
6104 echo "$as_me:6104: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6105 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6106 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6107
6108                                         : ${cf_nculib_root:=$cf_term_lib}
6109                                         break
6110
6111 fi
6112
6113                         done
6114
6115 fi
6116
6117         fi
6118
6119         # Check for library containing initscr
6120         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6121         if test "x$cf_curs_lib" = x
6122         then
6123                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6124                 do
6125                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6126                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6127                                 echo "$as_me:6127: checking if we can link with $cf_curs_lib library" >&5
6128 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6129                                 cat >conftest.$ac_ext <<_ACEOF
6130 #line 6130 "configure"
6131 #include "confdefs.h"
6132 #include <${cf_cv_ncurses_header:-curses.h}>
6133 int
6134 main (void)
6135 {
6136 initscr()
6137   ;
6138   return 0;
6139 }
6140 _ACEOF
6141 rm -f conftest.$ac_objext conftest$ac_exeext
6142 if { (eval echo "$as_me:6142: \"$ac_link\"") >&5
6143   (eval $ac_link) 2>&5
6144   ac_status=$?
6145   echo "$as_me:6145: \$? = $ac_status" >&5
6146   (exit $ac_status); } &&
6147          { ac_try='test -s conftest$ac_exeext'
6148   { (eval echo "$as_me:6148: \"$ac_try\"") >&5
6149   (eval $ac_try) 2>&5
6150   ac_status=$?
6151   echo "$as_me:6151: \$? = $ac_status" >&5
6152   (exit $ac_status); }; }; then
6153   cf_result=yes
6154 else
6155   echo "$as_me: failed program was:" >&5
6156 cat conftest.$ac_ext >&5
6157 cf_result=no
6158 fi
6159 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6160                                 echo "$as_me:6160: result: $cf_result" >&5
6161 echo "${ECHO_T}$cf_result" >&6
6162                                 test $cf_result = yes && break
6163                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6164                                 cf_result=no
6165                         elif test "$cf_term_lib" != predefined ; then
6166                                 echo "$as_me:6166: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6167 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6168                                 cat >conftest.$ac_ext <<_ACEOF
6169 #line 6169 "configure"
6170 #include "confdefs.h"
6171 #include <${cf_cv_ncurses_header:-curses.h}>
6172 int
6173 main (void)
6174 {
6175 initscr(); tgoto((char *)0, 0, 0);
6176   ;
6177   return 0;
6178 }
6179 _ACEOF
6180 rm -f conftest.$ac_objext conftest$ac_exeext
6181 if { (eval echo "$as_me:6181: \"$ac_link\"") >&5
6182   (eval $ac_link) 2>&5
6183   ac_status=$?
6184   echo "$as_me:6184: \$? = $ac_status" >&5
6185   (exit $ac_status); } &&
6186          { ac_try='test -s conftest$ac_exeext'
6187   { (eval echo "$as_me:6187: \"$ac_try\"") >&5
6188   (eval $ac_try) 2>&5
6189   ac_status=$?
6190   echo "$as_me:6190: \$? = $ac_status" >&5
6191   (exit $ac_status); }; }; then
6192   cf_result=no
6193 else
6194   echo "$as_me: failed program was:" >&5
6195 cat conftest.$ac_ext >&5
6196
6197                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6198                                         cat >conftest.$ac_ext <<_ACEOF
6199 #line 6199 "configure"
6200 #include "confdefs.h"
6201 #include <${cf_cv_ncurses_header:-curses.h}>
6202 int
6203 main (void)
6204 {
6205 initscr()
6206   ;
6207   return 0;
6208 }
6209 _ACEOF
6210 rm -f conftest.$ac_objext conftest$ac_exeext
6211 if { (eval echo "$as_me:6211: \"$ac_link\"") >&5
6212   (eval $ac_link) 2>&5
6213   ac_status=$?
6214   echo "$as_me:6214: \$? = $ac_status" >&5
6215   (exit $ac_status); } &&
6216          { ac_try='test -s conftest$ac_exeext'
6217   { (eval echo "$as_me:6217: \"$ac_try\"") >&5
6218   (eval $ac_try) 2>&5
6219   ac_status=$?
6220   echo "$as_me:6220: \$? = $ac_status" >&5
6221   (exit $ac_status); }; }; then
6222   cf_result=yes
6223 else
6224   echo "$as_me: failed program was:" >&5
6225 cat conftest.$ac_ext >&5
6226 cf_result=error
6227 fi
6228 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6229
6230 fi
6231 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6232                                 echo "$as_me:6232: result: $cf_result" >&5
6233 echo "${ECHO_T}$cf_result" >&6
6234                                 test $cf_result != error && break
6235                         fi
6236                 done
6237         fi
6238         test $cf_curs_lib = unknown && { { echo "$as_me:6238: error: no curses library found" >&5
6239 echo "$as_me: error: no curses library found" >&2;}
6240    { (exit 1); exit 1; }; }
6241 fi
6242 fi
6243
6244         ;;
6245 (ncursesw*)
6246
6247 echo "$as_me:6247: checking for multibyte character support" >&5
6248 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6249 if test "${cf_cv_utf8_lib+set}" = set; then
6250   echo $ECHO_N "(cached) $ECHO_C" >&6
6251 else
6252
6253         cf_save_LIBS="$LIBS"
6254         cat >conftest.$ac_ext <<_ACEOF
6255 #line 6255 "configure"
6256 #include "confdefs.h"
6257
6258 #include <stdlib.h>
6259 int
6260 main (void)
6261 {
6262 putwc(0,0);
6263   ;
6264   return 0;
6265 }
6266 _ACEOF
6267 rm -f conftest.$ac_objext conftest$ac_exeext
6268 if { (eval echo "$as_me:6268: \"$ac_link\"") >&5
6269   (eval $ac_link) 2>&5
6270   ac_status=$?
6271   echo "$as_me:6271: \$? = $ac_status" >&5
6272   (exit $ac_status); } &&
6273          { ac_try='test -s conftest$ac_exeext'
6274   { (eval echo "$as_me:6274: \"$ac_try\"") >&5
6275   (eval $ac_try) 2>&5
6276   ac_status=$?
6277   echo "$as_me:6277: \$? = $ac_status" >&5
6278   (exit $ac_status); }; }; then
6279   cf_cv_utf8_lib=yes
6280 else
6281   echo "$as_me: failed program was:" >&5
6282 cat conftest.$ac_ext >&5
6283
6284 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6285 # will be set on completion of the AC_TRY_LINK below.
6286 cf_cv_header_path_utf8=
6287 cf_cv_library_path_utf8=
6288
6289 echo "${as_me:-configure}:6289: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6290
6291 cf_save_LIBS="$LIBS"
6292
6293 cat >conftest.$ac_ext <<_ACEOF
6294 #line 6294 "configure"
6295 #include "confdefs.h"
6296
6297 #include <libutf8.h>
6298 int
6299 main (void)
6300 {
6301 putwc(0,0);
6302   ;
6303   return 0;
6304 }
6305 _ACEOF
6306 rm -f conftest.$ac_objext conftest$ac_exeext
6307 if { (eval echo "$as_me:6307: \"$ac_link\"") >&5
6308   (eval $ac_link) 2>&5
6309   ac_status=$?
6310   echo "$as_me:6310: \$? = $ac_status" >&5
6311   (exit $ac_status); } &&
6312          { ac_try='test -s conftest$ac_exeext'
6313   { (eval echo "$as_me:6313: \"$ac_try\"") >&5
6314   (eval $ac_try) 2>&5
6315   ac_status=$?
6316   echo "$as_me:6316: \$? = $ac_status" >&5
6317   (exit $ac_status); }; }; then
6318
6319         cf_cv_find_linkage_utf8=yes
6320         cf_cv_header_path_utf8=/usr/include
6321         cf_cv_library_path_utf8=/usr/lib
6322
6323 else
6324   echo "$as_me: failed program was:" >&5
6325 cat conftest.$ac_ext >&5
6326
6327 LIBS="-lutf8  $cf_save_LIBS"
6328
6329 cat >conftest.$ac_ext <<_ACEOF
6330 #line 6330 "configure"
6331 #include "confdefs.h"
6332
6333 #include <libutf8.h>
6334 int
6335 main (void)
6336 {
6337 putwc(0,0);
6338   ;
6339   return 0;
6340 }
6341 _ACEOF
6342 rm -f conftest.$ac_objext conftest$ac_exeext
6343 if { (eval echo "$as_me:6343: \"$ac_link\"") >&5
6344   (eval $ac_link) 2>&5
6345   ac_status=$?
6346   echo "$as_me:6346: \$? = $ac_status" >&5
6347   (exit $ac_status); } &&
6348          { ac_try='test -s conftest$ac_exeext'
6349   { (eval echo "$as_me:6349: \"$ac_try\"") >&5
6350   (eval $ac_try) 2>&5
6351   ac_status=$?
6352   echo "$as_me:6352: \$? = $ac_status" >&5
6353   (exit $ac_status); }; }; then
6354
6355         cf_cv_find_linkage_utf8=yes
6356         cf_cv_header_path_utf8=/usr/include
6357         cf_cv_library_path_utf8=/usr/lib
6358         cf_cv_library_file_utf8="-lutf8"
6359
6360 else
6361   echo "$as_me: failed program was:" >&5
6362 cat conftest.$ac_ext >&5
6363
6364         cf_cv_find_linkage_utf8=no
6365         LIBS="$cf_save_LIBS"
6366
6367         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6368
6369 echo "${as_me:-configure}:6369: testing find linkage for utf8 library ..." 1>&5
6370
6371 echo "${as_me:-configure}:6371: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6372
6373         cf_save_CPPFLAGS="$CPPFLAGS"
6374         cf_test_CPPFLAGS="$CPPFLAGS"
6375
6376 cf_search=
6377
6378 # collect the current set of include-directories from compiler flags
6379 cf_header_path_list=""
6380 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6381         for cf_header_path in $CPPFLAGS $CFLAGS
6382         do
6383                 case $cf_header_path in
6384                 (-I*)
6385                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6386
6387 test "x$cf_header_path" != "xNONE" && \
6388 test -d "$cf_header_path" && \
6389  {
6390         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6391         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6392         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6393         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6394         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6395         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6396 }
6397
6398                         cf_header_path_list="$cf_header_path_list $cf_search"
6399                         ;;
6400                 esac
6401         done
6402 fi
6403
6404 # add the variations for the package we are looking for
6405
6406 cf_search=
6407
6408 test "x$prefix" != "xNONE" && \
6409 test -d "$prefix" && \
6410  {
6411         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6412         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6413         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6414         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6415         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6416         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6417 }
6418
6419 for cf_subdir_prefix in \
6420         /usr \
6421         /usr/local \
6422         /usr/pkg \
6423         /opt \
6424         /opt/local \
6425         $HOME
6426 do
6427
6428 test "x$cf_subdir_prefix" != "x$prefix" && \
6429 test -d "$cf_subdir_prefix" && \
6430 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6431         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6432         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6433         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6434         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6435         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6436         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6437 }
6438
6439 done
6440
6441 test "$includedir" != NONE && \
6442 test "$includedir" != "/usr/include" && \
6443 test -d "$includedir" && {
6444         test -d $includedir &&    cf_search="$cf_search $includedir"
6445         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6446 }
6447
6448 test "$oldincludedir" != NONE && \
6449 test "$oldincludedir" != "/usr/include" && \
6450 test -d "$oldincludedir" && {
6451         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6452         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6453 }
6454
6455 cf_search="$cf_search $cf_header_path_list"
6456
6457         for cf_cv_header_path_utf8 in $cf_search
6458         do
6459                 if test -d $cf_cv_header_path_utf8 ; then
6460                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6461
6462 echo "${as_me:-configure}:6462: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6463
6464                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6465                         cat >conftest.$ac_ext <<_ACEOF
6466 #line 6466 "configure"
6467 #include "confdefs.h"
6468
6469 #include <libutf8.h>
6470 int
6471 main (void)
6472 {
6473 putwc(0,0);
6474   ;
6475   return 0;
6476 }
6477 _ACEOF
6478 rm -f conftest.$ac_objext
6479 if { (eval echo "$as_me:6479: \"$ac_compile\"") >&5
6480   (eval $ac_compile) 2>&5
6481   ac_status=$?
6482   echo "$as_me:6482: \$? = $ac_status" >&5
6483   (exit $ac_status); } &&
6484          { ac_try='test -s conftest.$ac_objext'
6485   { (eval echo "$as_me:6485: \"$ac_try\"") >&5
6486   (eval $ac_try) 2>&5
6487   ac_status=$?
6488   echo "$as_me:6488: \$? = $ac_status" >&5
6489   (exit $ac_status); }; }; then
6490
6491                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6492
6493 echo "${as_me:-configure}:6493: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6494
6495                                 cf_cv_find_linkage_utf8=maybe
6496                                 cf_test_CPPFLAGS="$CPPFLAGS"
6497                                 break
6498 else
6499   echo "$as_me: failed program was:" >&5
6500 cat conftest.$ac_ext >&5
6501
6502                                 CPPFLAGS="$cf_save_CPPFLAGS"
6503
6504 fi
6505 rm -f conftest.$ac_objext conftest.$ac_ext
6506                 fi
6507         done
6508
6509         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6510
6511 echo "${as_me:-configure}:6511: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6512
6513                 cf_save_LIBS="$LIBS"
6514                 cf_save_LDFLAGS="$LDFLAGS"
6515
6516                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6517
6518 cf_search=
6519 cf_library_path_list=""
6520 if test -n "${LDFLAGS}${LIBS}" ; then
6521         for cf_library_path in $LDFLAGS $LIBS
6522         do
6523                 case $cf_library_path in
6524                 (-L*)
6525                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6526
6527 test "x$cf_library_path" != "xNONE" && \
6528 test -d "$cf_library_path" && \
6529  {
6530         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6531         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6532         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6533         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6534         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6535         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6536 }
6537
6538                         cf_library_path_list="$cf_library_path_list $cf_search"
6539                         ;;
6540                 esac
6541         done
6542 fi
6543
6544 cf_search=
6545
6546 test "x$prefix" != "xNONE" && \
6547 test -d "$prefix" && \
6548  {
6549         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6550         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6551         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6552         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6553         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6554         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6555 }
6556
6557 for cf_subdir_prefix in \
6558         /usr \
6559         /usr/local \
6560         /usr/pkg \
6561         /opt \
6562         /opt/local \
6563         $HOME
6564 do
6565
6566 test "x$cf_subdir_prefix" != "x$prefix" && \
6567 test -d "$cf_subdir_prefix" && \
6568 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6569         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6570         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6571         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6572         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6573         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6574         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6575 }
6576
6577 done
6578
6579 cf_search="$cf_library_path_list $cf_search"
6580
6581                         for cf_cv_library_path_utf8 in $cf_search
6582                         do
6583                                 if test -d $cf_cv_library_path_utf8 ; then
6584                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6585
6586 echo "${as_me:-configure}:6586: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6587
6588                                         CPPFLAGS="$cf_test_CPPFLAGS"
6589                                         LIBS="-lutf8  $cf_save_LIBS"
6590                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6591                                         cat >conftest.$ac_ext <<_ACEOF
6592 #line 6592 "configure"
6593 #include "confdefs.h"
6594
6595 #include <libutf8.h>
6596 int
6597 main (void)
6598 {
6599 putwc(0,0);
6600   ;
6601   return 0;
6602 }
6603 _ACEOF
6604 rm -f conftest.$ac_objext conftest$ac_exeext
6605 if { (eval echo "$as_me:6605: \"$ac_link\"") >&5
6606   (eval $ac_link) 2>&5
6607   ac_status=$?
6608   echo "$as_me:6608: \$? = $ac_status" >&5
6609   (exit $ac_status); } &&
6610          { ac_try='test -s conftest$ac_exeext'
6611   { (eval echo "$as_me:6611: \"$ac_try\"") >&5
6612   (eval $ac_try) 2>&5
6613   ac_status=$?
6614   echo "$as_me:6614: \$? = $ac_status" >&5
6615   (exit $ac_status); }; }; then
6616
6617                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6618
6619 echo "${as_me:-configure}:6619: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6620
6621                                         cf_cv_find_linkage_utf8=yes
6622                                         cf_cv_library_file_utf8="-lutf8"
6623                                         break
6624 else
6625   echo "$as_me: failed program was:" >&5
6626 cat conftest.$ac_ext >&5
6627
6628                                         CPPFLAGS="$cf_save_CPPFLAGS"
6629                                         LIBS="$cf_save_LIBS"
6630                                         LDFLAGS="$cf_save_LDFLAGS"
6631
6632 fi
6633 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6634                                 fi
6635                         done
6636                         CPPFLAGS="$cf_save_CPPFLAGS"
6637                         LDFLAGS="$cf_save_LDFLAGS"
6638                 fi
6639
6640         else
6641                 cf_cv_find_linkage_utf8=no
6642         fi
6643
6644 fi
6645 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6646
6647 fi
6648 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6649
6650 LIBS="$cf_save_LIBS"
6651
6652 if test "$cf_cv_find_linkage_utf8" = yes ; then
6653 cf_cv_utf8_lib=add-on
6654 else
6655 cf_cv_utf8_lib=no
6656 fi
6657
6658 fi
6659 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6660 fi
6661 echo "$as_me:6661: result: $cf_cv_utf8_lib" >&5
6662 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6663
6664 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6665 # ncurses/ncursesw:
6666 if test "$cf_cv_utf8_lib" = "add-on" ; then
6667
6668 cat >>confdefs.h <<\EOF
6669 #define HAVE_LIBUTF8_H 1
6670 EOF
6671
6672 if test -n "$cf_cv_header_path_utf8" ; then
6673   for cf_add_incdir in $cf_cv_header_path_utf8
6674   do
6675         while test $cf_add_incdir != /usr/include
6676         do
6677           if test -d $cf_add_incdir
6678           then
6679                 cf_have_incdir=no
6680                 if test -n "$CFLAGS$CPPFLAGS" ; then
6681                   # a loop is needed to ensure we can add subdirs of existing dirs
6682                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6683                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6684                           cf_have_incdir=yes; break
6685                         fi
6686                   done
6687                 fi
6688
6689                 if test "$cf_have_incdir" = no ; then
6690                   if test "$cf_add_incdir" = /usr/local/include ; then
6691                         if test "$GCC" = yes
6692                         then
6693                           cf_save_CPPFLAGS=$CPPFLAGS
6694                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6695                           cat >conftest.$ac_ext <<_ACEOF
6696 #line 6696 "configure"
6697 #include "confdefs.h"
6698 #include <stdio.h>
6699 int
6700 main (void)
6701 {
6702 printf("Hello")
6703   ;
6704   return 0;
6705 }
6706 _ACEOF
6707 rm -f conftest.$ac_objext
6708 if { (eval echo "$as_me:6708: \"$ac_compile\"") >&5
6709   (eval $ac_compile) 2>&5
6710   ac_status=$?
6711   echo "$as_me:6711: \$? = $ac_status" >&5
6712   (exit $ac_status); } &&
6713          { ac_try='test -s conftest.$ac_objext'
6714   { (eval echo "$as_me:6714: \"$ac_try\"") >&5
6715   (eval $ac_try) 2>&5
6716   ac_status=$?
6717   echo "$as_me:6717: \$? = $ac_status" >&5
6718   (exit $ac_status); }; }; then
6719   :
6720 else
6721   echo "$as_me: failed program was:" >&5
6722 cat conftest.$ac_ext >&5
6723 cf_have_incdir=yes
6724 fi
6725 rm -f conftest.$ac_objext conftest.$ac_ext
6726                           CPPFLAGS=$cf_save_CPPFLAGS
6727                         fi
6728                   fi
6729                 fi
6730
6731                 if test "$cf_have_incdir" = no ; then
6732                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6733
6734 echo "${as_me:-configure}:6734: testing adding $cf_add_incdir to include-path ..." 1>&5
6735
6736                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6737
6738                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6739                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6740                   cf_add_incdir="$cf_top_incdir"
6741                 else
6742                   break
6743                 fi
6744           else
6745                 break
6746           fi
6747         done
6748   done
6749 fi
6750
6751 if test -n "$cf_cv_library_path_utf8" ; then
6752         for cf_add_libdir in $cf_cv_library_path_utf8
6753         do
6754                 if test $cf_add_libdir = /usr/lib ; then
6755                         :
6756                 elif test -d $cf_add_libdir
6757                 then
6758                         cf_have_libdir=no
6759                         if test -n "$LDFLAGS$LIBS" ; then
6760                                 # a loop is needed to ensure we can add subdirs of existing dirs
6761                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6762                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6763                                                 cf_have_libdir=yes; break
6764                                         fi
6765                                 done
6766                         fi
6767                         if test "$cf_have_libdir" = no ; then
6768                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6769
6770 echo "${as_me:-configure}:6770: testing adding $cf_add_libdir to library-path ..." 1>&5
6771
6772                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6773                         fi
6774                 fi
6775         done
6776 fi
6777
6778 cf_add_libs="$cf_cv_library_file_utf8"
6779 # Filter out duplicates - this happens with badly-designed ".pc" files...
6780 for cf_add_1lib in $LIBS
6781 do
6782         for cf_add_2lib in $cf_add_libs
6783         do
6784                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6785                 then
6786                         cf_add_1lib=
6787                         break
6788                 fi
6789         done
6790         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6791 done
6792 LIBS="$cf_add_libs"
6793
6794 fi
6795
6796 cf_ncuconfig_root=$cf_cv_screen
6797 cf_have_ncuconfig=no
6798
6799 if test "x${PKG_CONFIG:=none}" != xnone; then
6800         echo "$as_me:6800: checking pkg-config for $cf_ncuconfig_root" >&5
6801 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6802         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6803                 echo "$as_me:6803: result: yes" >&5
6804 echo "${ECHO_T}yes" >&6
6805
6806                 echo "$as_me:6806: checking if the $cf_ncuconfig_root package files work" >&5
6807 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6808                 cf_have_ncuconfig=unknown
6809
6810                 cf_save_CPPFLAGS="$CPPFLAGS"
6811                 cf_save_LIBS="$LIBS"
6812
6813                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6814
6815 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6816 # Filter out duplicates - this happens with badly-designed ".pc" files...
6817 for cf_add_1lib in $LIBS
6818 do
6819         for cf_add_2lib in $cf_add_libs
6820         do
6821                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6822                 then
6823                         cf_add_1lib=
6824                         break
6825                 fi
6826         done
6827         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6828 done
6829 LIBS="$cf_add_libs"
6830
6831                 cat >conftest.$ac_ext <<_ACEOF
6832 #line 6832 "configure"
6833 #include "confdefs.h"
6834 #include <${cf_cv_ncurses_header:-curses.h}>
6835 int
6836 main (void)
6837 {
6838 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6839   ;
6840   return 0;
6841 }
6842 _ACEOF
6843 rm -f conftest.$ac_objext conftest$ac_exeext
6844 if { (eval echo "$as_me:6844: \"$ac_link\"") >&5
6845   (eval $ac_link) 2>&5
6846   ac_status=$?
6847   echo "$as_me:6847: \$? = $ac_status" >&5
6848   (exit $ac_status); } &&
6849          { ac_try='test -s conftest$ac_exeext'
6850   { (eval echo "$as_me:6850: \"$ac_try\"") >&5
6851   (eval $ac_try) 2>&5
6852   ac_status=$?
6853   echo "$as_me:6853: \$? = $ac_status" >&5
6854   (exit $ac_status); }; }; then
6855   if test "$cross_compiling" = yes; then
6856   cf_have_ncuconfig=maybe
6857 else
6858   cat >conftest.$ac_ext <<_ACEOF
6859 #line 6859 "configure"
6860 #include "confdefs.h"
6861 #include <${cf_cv_ncurses_header:-curses.h}>
6862                                 int main(void)
6863                                 { char *xx = curses_version(); return (xx == 0); }
6864 _ACEOF
6865 rm -f conftest$ac_exeext
6866 if { (eval echo "$as_me:6866: \"$ac_link\"") >&5
6867   (eval $ac_link) 2>&5
6868   ac_status=$?
6869   echo "$as_me:6869: \$? = $ac_status" >&5
6870   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6871   { (eval echo "$as_me:6871: \"$ac_try\"") >&5
6872   (eval $ac_try) 2>&5
6873   ac_status=$?
6874   echo "$as_me:6874: \$? = $ac_status" >&5
6875   (exit $ac_status); }; }; then
6876   cf_have_ncuconfig=yes
6877 else
6878   echo "$as_me: program exited with status $ac_status" >&5
6879 echo "$as_me: failed program was:" >&5
6880 cat conftest.$ac_ext >&5
6881 cf_have_ncuconfig=no
6882 fi
6883 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6884 fi
6885 else
6886   echo "$as_me: failed program was:" >&5
6887 cat conftest.$ac_ext >&5
6888 cf_have_ncuconfig=no
6889 fi
6890 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6891                 echo "$as_me:6891: result: $cf_have_ncuconfig" >&5
6892 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6893                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6894                 if test "$cf_have_ncuconfig" != "yes"
6895                 then
6896                         CPPFLAGS="$cf_save_CPPFLAGS"
6897                         LIBS="$cf_save_LIBS"
6898                         NCURSES_CONFIG_PKG=none
6899                 else
6900
6901 cat >>confdefs.h <<\EOF
6902 #define NCURSES 1
6903 EOF
6904
6905                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6906
6907 echo "$as_me:6907: checking for terminfo header" >&5
6908 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6909 if test "${cf_cv_term_header+set}" = set; then
6910   echo $ECHO_N "(cached) $ECHO_C" >&6
6911 else
6912
6913 case ${cf_cv_ncurses_header} in
6914 (*/ncurses.h|*/ncursesw.h)
6915         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6916         ;;
6917 (*)
6918         cf_term_header=term.h
6919         ;;
6920 esac
6921
6922 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6923 do
6924 cat >conftest.$ac_ext <<_ACEOF
6925 #line 6925 "configure"
6926 #include "confdefs.h"
6927 #include <stdio.h>
6928 #include <${cf_cv_ncurses_header:-curses.h}>
6929 #include <$cf_test>
6930
6931 int
6932 main (void)
6933 {
6934 int x = auto_left_margin
6935   ;
6936   return 0;
6937 }
6938 _ACEOF
6939 rm -f conftest.$ac_objext
6940 if { (eval echo "$as_me:6940: \"$ac_compile\"") >&5
6941   (eval $ac_compile) 2>&5
6942   ac_status=$?
6943   echo "$as_me:6943: \$? = $ac_status" >&5
6944   (exit $ac_status); } &&
6945          { ac_try='test -s conftest.$ac_objext'
6946   { (eval echo "$as_me:6946: \"$ac_try\"") >&5
6947   (eval $ac_try) 2>&5
6948   ac_status=$?
6949   echo "$as_me:6949: \$? = $ac_status" >&5
6950   (exit $ac_status); }; }; then
6951
6952         cf_cv_term_header="$cf_test"
6953 else
6954   echo "$as_me: failed program was:" >&5
6955 cat conftest.$ac_ext >&5
6956
6957         cf_cv_term_header=unknown
6958
6959 fi
6960 rm -f conftest.$ac_objext conftest.$ac_ext
6961         test "$cf_cv_term_header" != unknown && break
6962 done
6963
6964 fi
6965 echo "$as_me:6965: result: $cf_cv_term_header" >&5
6966 echo "${ECHO_T}$cf_cv_term_header" >&6
6967
6968 # Set definitions to allow ifdef'ing to accommodate subdirectories
6969
6970 case $cf_cv_term_header in
6971 (*term.h)
6972
6973 cat >>confdefs.h <<\EOF
6974 #define HAVE_TERM_H 1
6975 EOF
6976
6977         ;;
6978 esac
6979
6980 case $cf_cv_term_header in
6981 (ncurses/term.h)
6982
6983 cat >>confdefs.h <<\EOF
6984 #define HAVE_NCURSES_TERM_H 1
6985 EOF
6986
6987         ;;
6988 (ncursesw/term.h)
6989
6990 cat >>confdefs.h <<\EOF
6991 #define HAVE_NCURSESW_TERM_H 1
6992 EOF
6993
6994         ;;
6995 esac
6996
6997                 fi
6998
6999         else
7000                 echo "$as_me:7000: result: no" >&5
7001 echo "${ECHO_T}no" >&6
7002                 NCURSES_CONFIG_PKG=none
7003         fi
7004 else
7005         NCURSES_CONFIG_PKG=none
7006 fi
7007
7008 if test "x$cf_have_ncuconfig" = "xno"; then
7009         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7010
7011 if test -n "$ac_tool_prefix"; then
7012   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7013   do
7014     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7015 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7016 echo "$as_me:7016: checking for $ac_word" >&5
7017 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7018 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7019   echo $ECHO_N "(cached) $ECHO_C" >&6
7020 else
7021   if test -n "$NCURSES_CONFIG"; then
7022   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7023 else
7024   ac_save_IFS=$IFS; IFS=$ac_path_separator
7025 ac_dummy="$PATH"
7026 for ac_dir in $ac_dummy; do
7027   IFS=$ac_save_IFS
7028   test -z "$ac_dir" && ac_dir=.
7029   $as_executable_p "$ac_dir/$ac_word" || continue
7030 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7031 echo "$as_me:7031: found $ac_dir/$ac_word" >&5
7032 break
7033 done
7034
7035 fi
7036 fi
7037 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7038 if test -n "$NCURSES_CONFIG"; then
7039   echo "$as_me:7039: result: $NCURSES_CONFIG" >&5
7040 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7041 else
7042   echo "$as_me:7042: result: no" >&5
7043 echo "${ECHO_T}no" >&6
7044 fi
7045
7046     test -n "$NCURSES_CONFIG" && break
7047   done
7048 fi
7049 if test -z "$NCURSES_CONFIG"; then
7050   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7051   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7052 do
7053   # Extract the first word of "$ac_prog", so it can be a program name with args.
7054 set dummy $ac_prog; ac_word=$2
7055 echo "$as_me:7055: checking for $ac_word" >&5
7056 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7057 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7058   echo $ECHO_N "(cached) $ECHO_C" >&6
7059 else
7060   if test -n "$ac_ct_NCURSES_CONFIG"; then
7061   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7062 else
7063   ac_save_IFS=$IFS; IFS=$ac_path_separator
7064 ac_dummy="$PATH"
7065 for ac_dir in $ac_dummy; do
7066   IFS=$ac_save_IFS
7067   test -z "$ac_dir" && ac_dir=.
7068   $as_executable_p "$ac_dir/$ac_word" || continue
7069 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7070 echo "$as_me:7070: found $ac_dir/$ac_word" >&5
7071 break
7072 done
7073
7074 fi
7075 fi
7076 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7077 if test -n "$ac_ct_NCURSES_CONFIG"; then
7078   echo "$as_me:7078: result: $ac_ct_NCURSES_CONFIG" >&5
7079 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7080 else
7081   echo "$as_me:7081: result: no" >&5
7082 echo "${ECHO_T}no" >&6
7083 fi
7084
7085   test -n "$ac_ct_NCURSES_CONFIG" && break
7086 done
7087 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7088
7089   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7090 fi
7091
7092         if test "$NCURSES_CONFIG" != none ; then
7093
7094                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7095
7096 cf_add_libs="`$NCURSES_CONFIG --libs`"
7097 # Filter out duplicates - this happens with badly-designed ".pc" files...
7098 for cf_add_1lib in $LIBS
7099 do
7100         for cf_add_2lib in $cf_add_libs
7101         do
7102                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7103                 then
7104                         cf_add_1lib=
7105                         break
7106                 fi
7107         done
7108         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7109 done
7110 LIBS="$cf_add_libs"
7111
7112                 # even with config script, some packages use no-override for curses.h
7113
7114 echo "$as_me:7114: checking if we have identified curses headers" >&5
7115 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7116 if test "${cf_cv_ncurses_header+set}" = set; then
7117   echo $ECHO_N "(cached) $ECHO_C" >&6
7118 else
7119
7120 cf_cv_ncurses_header=none
7121 for cf_header in \
7122         ncurses.h $cf_cv_screen/ncurses.h \
7123         curses.h $cf_cv_screen/curses.h
7124 do
7125 cat >conftest.$ac_ext <<_ACEOF
7126 #line 7126 "configure"
7127 #include "confdefs.h"
7128 #include <${cf_header}>
7129 int
7130 main (void)
7131 {
7132 initscr(); tgoto("?", 0,0)
7133   ;
7134   return 0;
7135 }
7136 _ACEOF
7137 rm -f conftest.$ac_objext
7138 if { (eval echo "$as_me:7138: \"$ac_compile\"") >&5
7139   (eval $ac_compile) 2>&5
7140   ac_status=$?
7141   echo "$as_me:7141: \$? = $ac_status" >&5
7142   (exit $ac_status); } &&
7143          { ac_try='test -s conftest.$ac_objext'
7144   { (eval echo "$as_me:7144: \"$ac_try\"") >&5
7145   (eval $ac_try) 2>&5
7146   ac_status=$?
7147   echo "$as_me:7147: \$? = $ac_status" >&5
7148   (exit $ac_status); }; }; then
7149   cf_cv_ncurses_header=$cf_header; break
7150 else
7151   echo "$as_me: failed program was:" >&5
7152 cat conftest.$ac_ext >&5
7153 fi
7154 rm -f conftest.$ac_objext conftest.$ac_ext
7155 done
7156
7157 fi
7158 echo "$as_me:7158: result: $cf_cv_ncurses_header" >&5
7159 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7160
7161 if test "$cf_cv_ncurses_header" = none ; then
7162         { { echo "$as_me:7162: error: No curses header-files found" >&5
7163 echo "$as_me: error: No curses header-files found" >&2;}
7164    { (exit 1); exit 1; }; }
7165 fi
7166
7167 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7168
7169 for ac_header in $cf_cv_ncurses_header
7170 do
7171 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7172 echo "$as_me:7172: checking for $ac_header" >&5
7173 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7174 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7175   echo $ECHO_N "(cached) $ECHO_C" >&6
7176 else
7177   cat >conftest.$ac_ext <<_ACEOF
7178 #line 7178 "configure"
7179 #include "confdefs.h"
7180 #include <$ac_header>
7181 _ACEOF
7182 if { (eval echo "$as_me:7182: \"$ac_cpp conftest.$ac_ext\"") >&5
7183   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7184   ac_status=$?
7185   egrep -v '^ *\+' conftest.er1 >conftest.err
7186   rm -f conftest.er1
7187   cat conftest.err >&5
7188   echo "$as_me:7188: \$? = $ac_status" >&5
7189   (exit $ac_status); } >/dev/null; then
7190   if test -s conftest.err; then
7191     ac_cpp_err=$ac_c_preproc_warn_flag
7192   else
7193     ac_cpp_err=
7194   fi
7195 else
7196   ac_cpp_err=yes
7197 fi
7198 if test -z "$ac_cpp_err"; then
7199   eval "$as_ac_Header=yes"
7200 else
7201   echo "$as_me: failed program was:" >&5
7202   cat conftest.$ac_ext >&5
7203   eval "$as_ac_Header=no"
7204 fi
7205 rm -f conftest.err conftest.$ac_ext
7206 fi
7207 echo "$as_me:7207: result: `eval echo '${'$as_ac_Header'}'`" >&5
7208 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7209 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7210   cat >>confdefs.h <<EOF
7211 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7212 EOF
7213
7214 fi
7215 done
7216
7217 cat >>confdefs.h <<\EOF
7218 #define NCURSES 1
7219 EOF
7220
7221 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7222
7223                 cat >>confdefs.h <<EOF
7224 #define $cf_nculib_ROOT 1
7225 EOF
7226
7227                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7228
7229         else
7230
7231 cf_ncuhdr_root=$cf_cv_screen
7232
7233 test -n "$cf_cv_curses_dir" && \
7234 test "$cf_cv_curses_dir" != "no" && { \
7235
7236 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7237   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7238   do
7239         while test $cf_add_incdir != /usr/include
7240         do
7241           if test -d $cf_add_incdir
7242           then
7243                 cf_have_incdir=no
7244                 if test -n "$CFLAGS$CPPFLAGS" ; then
7245                   # a loop is needed to ensure we can add subdirs of existing dirs
7246                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7247                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7248                           cf_have_incdir=yes; break
7249                         fi
7250                   done
7251                 fi
7252
7253                 if test "$cf_have_incdir" = no ; then
7254                   if test "$cf_add_incdir" = /usr/local/include ; then
7255                         if test "$GCC" = yes
7256                         then
7257                           cf_save_CPPFLAGS=$CPPFLAGS
7258                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7259                           cat >conftest.$ac_ext <<_ACEOF
7260 #line 7260 "configure"
7261 #include "confdefs.h"
7262 #include <stdio.h>
7263 int
7264 main (void)
7265 {
7266 printf("Hello")
7267   ;
7268   return 0;
7269 }
7270 _ACEOF
7271 rm -f conftest.$ac_objext
7272 if { (eval echo "$as_me:7272: \"$ac_compile\"") >&5
7273   (eval $ac_compile) 2>&5
7274   ac_status=$?
7275   echo "$as_me:7275: \$? = $ac_status" >&5
7276   (exit $ac_status); } &&
7277          { ac_try='test -s conftest.$ac_objext'
7278   { (eval echo "$as_me:7278: \"$ac_try\"") >&5
7279   (eval $ac_try) 2>&5
7280   ac_status=$?
7281   echo "$as_me:7281: \$? = $ac_status" >&5
7282   (exit $ac_status); }; }; then
7283   :
7284 else
7285   echo "$as_me: failed program was:" >&5
7286 cat conftest.$ac_ext >&5
7287 cf_have_incdir=yes
7288 fi
7289 rm -f conftest.$ac_objext conftest.$ac_ext
7290                           CPPFLAGS=$cf_save_CPPFLAGS
7291                         fi
7292                   fi
7293                 fi
7294
7295                 if test "$cf_have_incdir" = no ; then
7296                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7297
7298 echo "${as_me:-configure}:7298: testing adding $cf_add_incdir to include-path ..." 1>&5
7299
7300                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7301
7302                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7303                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7304                   cf_add_incdir="$cf_top_incdir"
7305                 else
7306                   break
7307                 fi
7308           else
7309                 break
7310           fi
7311         done
7312   done
7313 fi
7314
7315 }
7316
7317 echo "$as_me:7317: checking for $cf_ncuhdr_root header in include-path" >&5
7318 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7319 if test "${cf_cv_ncurses_h+set}" = set; then
7320   echo $ECHO_N "(cached) $ECHO_C" >&6
7321 else
7322
7323         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7324         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7325         for cf_header in $cf_header_list
7326         do
7327
7328         cat >conftest.$ac_ext <<_ACEOF
7329 #line 7329 "configure"
7330 #include "confdefs.h"
7331
7332 #include <$cf_header>
7333 int
7334 main (void)
7335 {
7336
7337 #ifdef NCURSES_VERSION
7338
7339 printf("%s\n", NCURSES_VERSION);
7340 #else
7341 #ifdef __NCURSES_H
7342 printf("old\n");
7343 #else
7344         make an error
7345 #endif
7346 #endif
7347
7348   ;
7349   return 0;
7350 }
7351 _ACEOF
7352 rm -f conftest.$ac_objext
7353 if { (eval echo "$as_me:7353: \"$ac_compile\"") >&5
7354   (eval $ac_compile) 2>&5
7355   ac_status=$?
7356   echo "$as_me:7356: \$? = $ac_status" >&5
7357   (exit $ac_status); } &&
7358          { ac_try='test -s conftest.$ac_objext'
7359   { (eval echo "$as_me:7359: \"$ac_try\"") >&5
7360   (eval $ac_try) 2>&5
7361   ac_status=$?
7362   echo "$as_me:7362: \$? = $ac_status" >&5
7363   (exit $ac_status); }; }; then
7364   cf_cv_ncurses_h=$cf_header
7365
7366 else
7367   echo "$as_me: failed program was:" >&5
7368 cat conftest.$ac_ext >&5
7369 cf_cv_ncurses_h=no
7370 fi
7371 rm -f conftest.$ac_objext conftest.$ac_ext
7372
7373                 test "$cf_cv_ncurses_h" != no && break
7374         done
7375
7376 fi
7377 echo "$as_me:7377: result: $cf_cv_ncurses_h" >&5
7378 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7379
7380 if test "$cf_cv_ncurses_h" != no ; then
7381         cf_cv_ncurses_header=$cf_cv_ncurses_h
7382 else
7383
7384 echo "$as_me:7384: checking for $cf_ncuhdr_root include-path" >&5
7385 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7386 if test "${cf_cv_ncurses_h2+set}" = set; then
7387   echo $ECHO_N "(cached) $ECHO_C" >&6
7388 else
7389
7390         test -n "$verbose" && echo
7391
7392 cf_search=
7393
7394 # collect the current set of include-directories from compiler flags
7395 cf_header_path_list=""
7396 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7397         for cf_header_path in $CPPFLAGS $CFLAGS
7398         do
7399                 case $cf_header_path in
7400                 (-I*)
7401                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7402
7403 test "x$cf_header_path" != "xNONE" && \
7404 test -d "$cf_header_path" && \
7405  {
7406         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7407         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7408         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7409         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7410         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7411         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"
7412 }
7413
7414                         cf_header_path_list="$cf_header_path_list $cf_search"
7415                         ;;
7416                 esac
7417         done
7418 fi
7419
7420 # add the variations for the package we are looking for
7421
7422 cf_search=
7423
7424 test "x$prefix" != "xNONE" && \
7425 test -d "$prefix" && \
7426  {
7427         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7428         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7429         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7430         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7431         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7432         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7433 }
7434
7435 for cf_subdir_prefix in \
7436         /usr \
7437         /usr/local \
7438         /usr/pkg \
7439         /opt \
7440         /opt/local \
7441         $HOME
7442 do
7443
7444 test "x$cf_subdir_prefix" != "x$prefix" && \
7445 test -d "$cf_subdir_prefix" && \
7446 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7447         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7448         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7449         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7450         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7451         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7452         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"
7453 }
7454
7455 done
7456
7457 test "$includedir" != NONE && \
7458 test "$includedir" != "/usr/include" && \
7459 test -d "$includedir" && {
7460         test -d $includedir &&    cf_search="$cf_search $includedir"
7461         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7462 }
7463
7464 test "$oldincludedir" != NONE && \
7465 test "$oldincludedir" != "/usr/include" && \
7466 test -d "$oldincludedir" && {
7467         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7468         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7469 }
7470
7471 cf_search="$cf_search $cf_header_path_list"
7472
7473         test -n "$verbose" && echo search path $cf_search
7474         cf_save2_CPPFLAGS="$CPPFLAGS"
7475         for cf_incdir in $cf_search
7476         do
7477
7478 if test -n "$cf_incdir" ; then
7479   for cf_add_incdir in $cf_incdir
7480   do
7481         while test $cf_add_incdir != /usr/include
7482         do
7483           if test -d $cf_add_incdir
7484           then
7485                 cf_have_incdir=no
7486                 if test -n "$CFLAGS$CPPFLAGS" ; then
7487                   # a loop is needed to ensure we can add subdirs of existing dirs
7488                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7489                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7490                           cf_have_incdir=yes; break
7491                         fi
7492                   done
7493                 fi
7494
7495                 if test "$cf_have_incdir" = no ; then
7496                   if test "$cf_add_incdir" = /usr/local/include ; then
7497                         if test "$GCC" = yes
7498                         then
7499                           cf_save_CPPFLAGS=$CPPFLAGS
7500                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7501                           cat >conftest.$ac_ext <<_ACEOF
7502 #line 7502 "configure"
7503 #include "confdefs.h"
7504 #include <stdio.h>
7505 int
7506 main (void)
7507 {
7508 printf("Hello")
7509   ;
7510   return 0;
7511 }
7512 _ACEOF
7513 rm -f conftest.$ac_objext
7514 if { (eval echo "$as_me:7514: \"$ac_compile\"") >&5
7515   (eval $ac_compile) 2>&5
7516   ac_status=$?
7517   echo "$as_me:7517: \$? = $ac_status" >&5
7518   (exit $ac_status); } &&
7519          { ac_try='test -s conftest.$ac_objext'
7520   { (eval echo "$as_me:7520: \"$ac_try\"") >&5
7521   (eval $ac_try) 2>&5
7522   ac_status=$?
7523   echo "$as_me:7523: \$? = $ac_status" >&5
7524   (exit $ac_status); }; }; then
7525   :
7526 else
7527   echo "$as_me: failed program was:" >&5
7528 cat conftest.$ac_ext >&5
7529 cf_have_incdir=yes
7530 fi
7531 rm -f conftest.$ac_objext conftest.$ac_ext
7532                           CPPFLAGS=$cf_save_CPPFLAGS
7533                         fi
7534                   fi
7535                 fi
7536
7537                 if test "$cf_have_incdir" = no ; then
7538                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7539
7540 echo "${as_me:-configure}:7540: testing adding $cf_add_incdir to include-path ..." 1>&5
7541
7542                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7543
7544                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7545                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7546                   cf_add_incdir="$cf_top_incdir"
7547                 else
7548                   break
7549                 fi
7550           else
7551                 break
7552           fi
7553         done
7554   done
7555 fi
7556
7557                 for cf_header in \
7558                         ncurses.h \
7559                         curses.h
7560                 do
7561
7562         cat >conftest.$ac_ext <<_ACEOF
7563 #line 7563 "configure"
7564 #include "confdefs.h"
7565
7566 #include <$cf_header>
7567 int
7568 main (void)
7569 {
7570
7571 #ifdef NCURSES_VERSION
7572
7573 printf("%s\n", NCURSES_VERSION);
7574 #else
7575 #ifdef __NCURSES_H
7576 printf("old\n");
7577 #else
7578         make an error
7579 #endif
7580 #endif
7581
7582   ;
7583   return 0;
7584 }
7585 _ACEOF
7586 rm -f conftest.$ac_objext
7587 if { (eval echo "$as_me:7587: \"$ac_compile\"") >&5
7588   (eval $ac_compile) 2>&5
7589   ac_status=$?
7590   echo "$as_me:7590: \$? = $ac_status" >&5
7591   (exit $ac_status); } &&
7592          { ac_try='test -s conftest.$ac_objext'
7593   { (eval echo "$as_me:7593: \"$ac_try\"") >&5
7594   (eval $ac_try) 2>&5
7595   ac_status=$?
7596   echo "$as_me:7596: \$? = $ac_status" >&5
7597   (exit $ac_status); }; }; then
7598   cf_cv_ncurses_h2=$cf_header
7599
7600 else
7601   echo "$as_me: failed program was:" >&5
7602 cat conftest.$ac_ext >&5
7603 cf_cv_ncurses_h2=no
7604 fi
7605 rm -f conftest.$ac_objext conftest.$ac_ext
7606
7607                         if test "$cf_cv_ncurses_h2" != no ; then
7608                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7609                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7610                                 break
7611                         fi
7612                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7613                 done
7614                 CPPFLAGS="$cf_save2_CPPFLAGS"
7615                 test "$cf_cv_ncurses_h2" != no && break
7616         done
7617         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7617: error: not found" >&5
7618 echo "$as_me: error: not found" >&2;}
7619    { (exit 1); exit 1; }; }
7620
7621 fi
7622 echo "$as_me:7622: result: $cf_cv_ncurses_h2" >&5
7623 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7624
7625         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7626         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7627         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7628                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7629         fi
7630
7631 if test -n "$cf_1st_incdir" ; then
7632   for cf_add_incdir in $cf_1st_incdir
7633   do
7634         while test $cf_add_incdir != /usr/include
7635         do
7636           if test -d $cf_add_incdir
7637           then
7638                 cf_have_incdir=no
7639                 if test -n "$CFLAGS$CPPFLAGS" ; then
7640                   # a loop is needed to ensure we can add subdirs of existing dirs
7641                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7642                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7643                           cf_have_incdir=yes; break
7644                         fi
7645                   done
7646                 fi
7647
7648                 if test "$cf_have_incdir" = no ; then
7649                   if test "$cf_add_incdir" = /usr/local/include ; then
7650                         if test "$GCC" = yes
7651                         then
7652                           cf_save_CPPFLAGS=$CPPFLAGS
7653                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7654                           cat >conftest.$ac_ext <<_ACEOF
7655 #line 7655 "configure"
7656 #include "confdefs.h"
7657 #include <stdio.h>
7658 int
7659 main (void)
7660 {
7661 printf("Hello")
7662   ;
7663   return 0;
7664 }
7665 _ACEOF
7666 rm -f conftest.$ac_objext
7667 if { (eval echo "$as_me:7667: \"$ac_compile\"") >&5
7668   (eval $ac_compile) 2>&5
7669   ac_status=$?
7670   echo "$as_me:7670: \$? = $ac_status" >&5
7671   (exit $ac_status); } &&
7672          { ac_try='test -s conftest.$ac_objext'
7673   { (eval echo "$as_me:7673: \"$ac_try\"") >&5
7674   (eval $ac_try) 2>&5
7675   ac_status=$?
7676   echo "$as_me:7676: \$? = $ac_status" >&5
7677   (exit $ac_status); }; }; then
7678   :
7679 else
7680   echo "$as_me: failed program was:" >&5
7681 cat conftest.$ac_ext >&5
7682 cf_have_incdir=yes
7683 fi
7684 rm -f conftest.$ac_objext conftest.$ac_ext
7685                           CPPFLAGS=$cf_save_CPPFLAGS
7686                         fi
7687                   fi
7688                 fi
7689
7690                 if test "$cf_have_incdir" = no ; then
7691                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7692
7693 echo "${as_me:-configure}:7693: testing adding $cf_add_incdir to include-path ..." 1>&5
7694
7695                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7696
7697                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7698                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7699                   cf_add_incdir="$cf_top_incdir"
7700                 else
7701                   break
7702                 fi
7703           else
7704                 break
7705           fi
7706         done
7707   done
7708 fi
7709
7710 fi
7711
7712 # Set definitions to allow ifdef'ing for ncurses.h
7713
7714 case $cf_cv_ncurses_header in
7715 (*ncurses.h)
7716
7717 cat >>confdefs.h <<\EOF
7718 #define HAVE_NCURSES_H 1
7719 EOF
7720
7721         ;;
7722 esac
7723
7724 case $cf_cv_ncurses_header in
7725 (ncurses/curses.h|ncurses/ncurses.h)
7726
7727 cat >>confdefs.h <<\EOF
7728 #define HAVE_NCURSES_NCURSES_H 1
7729 EOF
7730
7731         ;;
7732 (ncursesw/curses.h|ncursesw/ncurses.h)
7733
7734 cat >>confdefs.h <<\EOF
7735 #define HAVE_NCURSESW_NCURSES_H 1
7736 EOF
7737
7738         ;;
7739 esac
7740
7741 echo "$as_me:7741: checking for terminfo header" >&5
7742 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7743 if test "${cf_cv_term_header+set}" = set; then
7744   echo $ECHO_N "(cached) $ECHO_C" >&6
7745 else
7746
7747 case ${cf_cv_ncurses_header} in
7748 (*/ncurses.h|*/ncursesw.h)
7749         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7750         ;;
7751 (*)
7752         cf_term_header=term.h
7753         ;;
7754 esac
7755
7756 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7757 do
7758 cat >conftest.$ac_ext <<_ACEOF
7759 #line 7759 "configure"
7760 #include "confdefs.h"
7761 #include <stdio.h>
7762 #include <${cf_cv_ncurses_header:-curses.h}>
7763 #include <$cf_test>
7764
7765 int
7766 main (void)
7767 {
7768 int x = auto_left_margin
7769   ;
7770   return 0;
7771 }
7772 _ACEOF
7773 rm -f conftest.$ac_objext
7774 if { (eval echo "$as_me:7774: \"$ac_compile\"") >&5
7775   (eval $ac_compile) 2>&5
7776   ac_status=$?
7777   echo "$as_me:7777: \$? = $ac_status" >&5
7778   (exit $ac_status); } &&
7779          { ac_try='test -s conftest.$ac_objext'
7780   { (eval echo "$as_me:7780: \"$ac_try\"") >&5
7781   (eval $ac_try) 2>&5
7782   ac_status=$?
7783   echo "$as_me:7783: \$? = $ac_status" >&5
7784   (exit $ac_status); }; }; then
7785
7786         cf_cv_term_header="$cf_test"
7787 else
7788   echo "$as_me: failed program was:" >&5
7789 cat conftest.$ac_ext >&5
7790
7791         cf_cv_term_header=unknown
7792
7793 fi
7794 rm -f conftest.$ac_objext conftest.$ac_ext
7795         test "$cf_cv_term_header" != unknown && break
7796 done
7797
7798 fi
7799 echo "$as_me:7799: result: $cf_cv_term_header" >&5
7800 echo "${ECHO_T}$cf_cv_term_header" >&6
7801
7802 # Set definitions to allow ifdef'ing to accommodate subdirectories
7803
7804 case $cf_cv_term_header in
7805 (*term.h)
7806
7807 cat >>confdefs.h <<\EOF
7808 #define HAVE_TERM_H 1
7809 EOF
7810
7811         ;;
7812 esac
7813
7814 case $cf_cv_term_header in
7815 (ncurses/term.h)
7816
7817 cat >>confdefs.h <<\EOF
7818 #define HAVE_NCURSES_TERM_H 1
7819 EOF
7820
7821         ;;
7822 (ncursesw/term.h)
7823
7824 cat >>confdefs.h <<\EOF
7825 #define HAVE_NCURSESW_TERM_H 1
7826 EOF
7827
7828         ;;
7829 esac
7830
7831 # some applications need this, but should check for NCURSES_VERSION
7832
7833 cat >>confdefs.h <<\EOF
7834 #define NCURSES 1
7835 EOF
7836
7837 echo "$as_me:7837: checking for ncurses version" >&5
7838 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7839 if test "${cf_cv_ncurses_version+set}" = set; then
7840   echo $ECHO_N "(cached) $ECHO_C" >&6
7841 else
7842
7843         cf_cv_ncurses_version=no
7844         cf_tempfile=out$$
7845         rm -f $cf_tempfile
7846         if test "$cross_compiling" = yes; then
7847
7848         # This will not work if the preprocessor splits the line after the
7849         # Autoconf token.  The 'unproto' program does that.
7850         cat > conftest.$ac_ext <<EOF
7851 #include <${cf_cv_ncurses_header:-curses.h}>
7852 #undef Autoconf
7853 #ifdef NCURSES_VERSION
7854 Autoconf NCURSES_VERSION
7855 #else
7856 #ifdef __NCURSES_H
7857 Autoconf "old"
7858 #endif
7859 ;
7860 #endif
7861 EOF
7862         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7863         { (eval echo "$as_me:7863: \"$cf_try\"") >&5
7864   (eval $cf_try) 2>&5
7865   ac_status=$?
7866   echo "$as_me:7866: \$? = $ac_status" >&5
7867   (exit $ac_status); }
7868         if test -f conftest.out ; then
7869                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7870                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7871                 rm -f conftest.out
7872         fi
7873
7874 else
7875   cat >conftest.$ac_ext <<_ACEOF
7876 #line 7876 "configure"
7877 #include "confdefs.h"
7878
7879 #include <${cf_cv_ncurses_header:-curses.h}>
7880 #include <stdio.h>
7881 int main(void)
7882 {
7883         FILE *fp = fopen("$cf_tempfile", "w");
7884 #ifdef NCURSES_VERSION
7885 # ifdef NCURSES_VERSION_PATCH
7886         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7887 # else
7888         fprintf(fp, "%s\n", NCURSES_VERSION);
7889 # endif
7890 #else
7891 # ifdef __NCURSES_H
7892         fprintf(fp, "old\n");
7893 # else
7894         make an error
7895 # endif
7896 #endif
7897         ${cf_cv_main_return:-return}(0);
7898 }
7899 _ACEOF
7900 rm -f conftest$ac_exeext
7901 if { (eval echo "$as_me:7901: \"$ac_link\"") >&5
7902   (eval $ac_link) 2>&5
7903   ac_status=$?
7904   echo "$as_me:7904: \$? = $ac_status" >&5
7905   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7906   { (eval echo "$as_me:7906: \"$ac_try\"") >&5
7907   (eval $ac_try) 2>&5
7908   ac_status=$?
7909   echo "$as_me:7909: \$? = $ac_status" >&5
7910   (exit $ac_status); }; }; then
7911
7912         cf_cv_ncurses_version=`cat $cf_tempfile`
7913 else
7914   echo "$as_me: program exited with status $ac_status" >&5
7915 echo "$as_me: failed program was:" >&5
7916 cat conftest.$ac_ext >&5
7917 fi
7918 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7919 fi
7920         rm -f $cf_tempfile
7921
7922 fi
7923 echo "$as_me:7923: result: $cf_cv_ncurses_version" >&5
7924 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7925 test "$cf_cv_ncurses_version" = no ||
7926 cat >>confdefs.h <<\EOF
7927 #define NCURSES 1
7928 EOF
7929
7930 cf_nculib_root=$cf_cv_screen
7931         # This works, except for the special case where we find gpm, but
7932         # ncurses is in a nonstandard location via $LIBS, and we really want
7933         # to link gpm.
7934 cf_ncurses_LIBS=""
7935 cf_ncurses_SAVE="$LIBS"
7936 echo "$as_me:7936: checking for Gpm_Open in -lgpm" >&5
7937 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7938 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7939   echo $ECHO_N "(cached) $ECHO_C" >&6
7940 else
7941   ac_check_lib_save_LIBS=$LIBS
7942 LIBS="-lgpm  $LIBS"
7943 cat >conftest.$ac_ext <<_ACEOF
7944 #line 7944 "configure"
7945 #include "confdefs.h"
7946
7947 /* Override any gcc2 internal prototype to avoid an error.  */
7948 #ifdef __cplusplus
7949 extern "C"
7950 #endif
7951 /* We use char because int might match the return type of a gcc2
7952    builtin and then its argument prototype would still apply.  */
7953 char Gpm_Open ();
7954 int
7955 main (void)
7956 {
7957 Gpm_Open ();
7958   ;
7959   return 0;
7960 }
7961 _ACEOF
7962 rm -f conftest.$ac_objext conftest$ac_exeext
7963 if { (eval echo "$as_me:7963: \"$ac_link\"") >&5
7964   (eval $ac_link) 2>&5
7965   ac_status=$?
7966   echo "$as_me:7966: \$? = $ac_status" >&5
7967   (exit $ac_status); } &&
7968          { ac_try='test -s conftest$ac_exeext'
7969   { (eval echo "$as_me:7969: \"$ac_try\"") >&5
7970   (eval $ac_try) 2>&5
7971   ac_status=$?
7972   echo "$as_me:7972: \$? = $ac_status" >&5
7973   (exit $ac_status); }; }; then
7974   ac_cv_lib_gpm_Gpm_Open=yes
7975 else
7976   echo "$as_me: failed program was:" >&5
7977 cat conftest.$ac_ext >&5
7978 ac_cv_lib_gpm_Gpm_Open=no
7979 fi
7980 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7981 LIBS=$ac_check_lib_save_LIBS
7982 fi
7983 echo "$as_me:7983: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7984 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7985 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7986   echo "$as_me:7986: checking for initscr in -lgpm" >&5
7987 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7988 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7989   echo $ECHO_N "(cached) $ECHO_C" >&6
7990 else
7991   ac_check_lib_save_LIBS=$LIBS
7992 LIBS="-lgpm  $LIBS"
7993 cat >conftest.$ac_ext <<_ACEOF
7994 #line 7994 "configure"
7995 #include "confdefs.h"
7996
7997 /* Override any gcc2 internal prototype to avoid an error.  */
7998 #ifdef __cplusplus
7999 extern "C"
8000 #endif
8001 /* We use char because int might match the return type of a gcc2
8002    builtin and then its argument prototype would still apply.  */
8003 char initscr ();
8004 int
8005 main (void)
8006 {
8007 initscr ();
8008   ;
8009   return 0;
8010 }
8011 _ACEOF
8012 rm -f conftest.$ac_objext conftest$ac_exeext
8013 if { (eval echo "$as_me:8013: \"$ac_link\"") >&5
8014   (eval $ac_link) 2>&5
8015   ac_status=$?
8016   echo "$as_me:8016: \$? = $ac_status" >&5
8017   (exit $ac_status); } &&
8018          { ac_try='test -s conftest$ac_exeext'
8019   { (eval echo "$as_me:8019: \"$ac_try\"") >&5
8020   (eval $ac_try) 2>&5
8021   ac_status=$?
8022   echo "$as_me:8022: \$? = $ac_status" >&5
8023   (exit $ac_status); }; }; then
8024   ac_cv_lib_gpm_initscr=yes
8025 else
8026   echo "$as_me: failed program was:" >&5
8027 cat conftest.$ac_ext >&5
8028 ac_cv_lib_gpm_initscr=no
8029 fi
8030 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8031 LIBS=$ac_check_lib_save_LIBS
8032 fi
8033 echo "$as_me:8033: result: $ac_cv_lib_gpm_initscr" >&5
8034 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8035 if test $ac_cv_lib_gpm_initscr = yes; then
8036   LIBS="$cf_ncurses_SAVE"
8037 else
8038   cf_ncurses_LIBS="-lgpm"
8039 fi
8040
8041 fi
8042
8043 case $host_os in
8044 (freebsd*)
8045         # This is only necessary if you are linking against an obsolete
8046         # version of ncurses (but it should do no harm, since it's static).
8047         if test "$cf_nculib_root" = ncurses ; then
8048                 echo "$as_me:8048: checking for tgoto in -lmytinfo" >&5
8049 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8050 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8051   echo $ECHO_N "(cached) $ECHO_C" >&6
8052 else
8053   ac_check_lib_save_LIBS=$LIBS
8054 LIBS="-lmytinfo  $LIBS"
8055 cat >conftest.$ac_ext <<_ACEOF
8056 #line 8056 "configure"
8057 #include "confdefs.h"
8058
8059 /* Override any gcc2 internal prototype to avoid an error.  */
8060 #ifdef __cplusplus
8061 extern "C"
8062 #endif
8063 /* We use char because int might match the return type of a gcc2
8064    builtin and then its argument prototype would still apply.  */
8065 char tgoto ();
8066 int
8067 main (void)
8068 {
8069 tgoto ();
8070   ;
8071   return 0;
8072 }
8073 _ACEOF
8074 rm -f conftest.$ac_objext conftest$ac_exeext
8075 if { (eval echo "$as_me:8075: \"$ac_link\"") >&5
8076   (eval $ac_link) 2>&5
8077   ac_status=$?
8078   echo "$as_me:8078: \$? = $ac_status" >&5
8079   (exit $ac_status); } &&
8080          { ac_try='test -s conftest$ac_exeext'
8081   { (eval echo "$as_me:8081: \"$ac_try\"") >&5
8082   (eval $ac_try) 2>&5
8083   ac_status=$?
8084   echo "$as_me:8084: \$? = $ac_status" >&5
8085   (exit $ac_status); }; }; then
8086   ac_cv_lib_mytinfo_tgoto=yes
8087 else
8088   echo "$as_me: failed program was:" >&5
8089 cat conftest.$ac_ext >&5
8090 ac_cv_lib_mytinfo_tgoto=no
8091 fi
8092 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8093 LIBS=$ac_check_lib_save_LIBS
8094 fi
8095 echo "$as_me:8095: result: $ac_cv_lib_mytinfo_tgoto" >&5
8096 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8097 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8098   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8099 fi
8100
8101         fi
8102         ;;
8103 esac
8104
8105 cf_add_libs="$cf_ncurses_LIBS"
8106 # Filter out duplicates - this happens with badly-designed ".pc" files...
8107 for cf_add_1lib in $LIBS
8108 do
8109         for cf_add_2lib in $cf_add_libs
8110         do
8111                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8112                 then
8113                         cf_add_1lib=
8114                         break
8115                 fi
8116         done
8117         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8118 done
8119 LIBS="$cf_add_libs"
8120
8121 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8122 then
8123
8124 cf_add_libs="-l$cf_nculib_root"
8125 # Filter out duplicates - this happens with badly-designed ".pc" files...
8126 for cf_add_1lib in $LIBS
8127 do
8128         for cf_add_2lib in $cf_add_libs
8129         do
8130                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8131                 then
8132                         cf_add_1lib=
8133                         break
8134                 fi
8135         done
8136         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8137 done
8138 LIBS="$cf_add_libs"
8139
8140 else
8141
8142         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8143         cf_libdir=""
8144         echo "$as_me:8144: checking for initscr" >&5
8145 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8146 if test "${ac_cv_func_initscr+set}" = set; then
8147   echo $ECHO_N "(cached) $ECHO_C" >&6
8148 else
8149   cat >conftest.$ac_ext <<_ACEOF
8150 #line 8150 "configure"
8151 #include "confdefs.h"
8152 /* System header to define __stub macros and hopefully few prototypes,
8153     which can conflict with char initscr (); below.  */
8154 #include <assert.h>
8155 /* Override any gcc2 internal prototype to avoid an error.  */
8156 #ifdef __cplusplus
8157 extern "C"
8158 #endif
8159 /* We use char because int might match the return type of a gcc2
8160    builtin and then its argument prototype would still apply.  */
8161 char initscr ();
8162 char (*f) ();
8163
8164 int
8165 main (void)
8166 {
8167 /* The GNU C library defines this for functions which it implements
8168     to always fail with ENOSYS.  Some functions are actually named
8169     something starting with __ and the normal name is an alias.  */
8170 #if defined (__stub_initscr) || defined (__stub___initscr)
8171 choke me
8172 #else
8173 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8174 #endif
8175
8176   ;
8177   return 0;
8178 }
8179 _ACEOF
8180 rm -f conftest.$ac_objext conftest$ac_exeext
8181 if { (eval echo "$as_me:8181: \"$ac_link\"") >&5
8182   (eval $ac_link) 2>&5
8183   ac_status=$?
8184   echo "$as_me:8184: \$? = $ac_status" >&5
8185   (exit $ac_status); } &&
8186          { ac_try='test -s conftest$ac_exeext'
8187   { (eval echo "$as_me:8187: \"$ac_try\"") >&5
8188   (eval $ac_try) 2>&5
8189   ac_status=$?
8190   echo "$as_me:8190: \$? = $ac_status" >&5
8191   (exit $ac_status); }; }; then
8192   ac_cv_func_initscr=yes
8193 else
8194   echo "$as_me: failed program was:" >&5
8195 cat conftest.$ac_ext >&5
8196 ac_cv_func_initscr=no
8197 fi
8198 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8199 fi
8200 echo "$as_me:8200: result: $ac_cv_func_initscr" >&5
8201 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8202 if test $ac_cv_func_initscr = yes; then
8203   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8204 else
8205
8206                 cf_save_LIBS="$LIBS"
8207                 echo "$as_me:8207: checking for initscr in -l$cf_nculib_root" >&5
8208 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8209                 LIBS="-l$cf_nculib_root $LIBS"
8210                 cat >conftest.$ac_ext <<_ACEOF
8211 #line 8211 "configure"
8212 #include "confdefs.h"
8213 #include <${cf_cv_ncurses_header:-curses.h}>
8214 int
8215 main (void)
8216 {
8217 initscr()
8218   ;
8219   return 0;
8220 }
8221 _ACEOF
8222 rm -f conftest.$ac_objext conftest$ac_exeext
8223 if { (eval echo "$as_me:8223: \"$ac_link\"") >&5
8224   (eval $ac_link) 2>&5
8225   ac_status=$?
8226   echo "$as_me:8226: \$? = $ac_status" >&5
8227   (exit $ac_status); } &&
8228          { ac_try='test -s conftest$ac_exeext'
8229   { (eval echo "$as_me:8229: \"$ac_try\"") >&5
8230   (eval $ac_try) 2>&5
8231   ac_status=$?
8232   echo "$as_me:8232: \$? = $ac_status" >&5
8233   (exit $ac_status); }; }; then
8234   echo "$as_me:8234: result: yes" >&5
8235 echo "${ECHO_T}yes" >&6
8236                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8237
8238 else
8239   echo "$as_me: failed program was:" >&5
8240 cat conftest.$ac_ext >&5
8241 echo "$as_me:8241: result: no" >&5
8242 echo "${ECHO_T}no" >&6
8243
8244 cf_search=
8245 cf_library_path_list=""
8246 if test -n "${LDFLAGS}${LIBS}" ; then
8247         for cf_library_path in $LDFLAGS $LIBS
8248         do
8249                 case $cf_library_path in
8250                 (-L*)
8251                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8252
8253 test "x$cf_library_path" != "xNONE" && \
8254 test -d "$cf_library_path" && \
8255  {
8256         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8257         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8258         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8259         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8260         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8261         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"
8262 }
8263
8264                         cf_library_path_list="$cf_library_path_list $cf_search"
8265                         ;;
8266                 esac
8267         done
8268 fi
8269
8270 cf_search=
8271
8272 test "x$prefix" != "xNONE" && \
8273 test -d "$prefix" && \
8274  {
8275         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8276         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8277         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8278         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8279         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8280         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8281 }
8282
8283 for cf_subdir_prefix in \
8284         /usr \
8285         /usr/local \
8286         /usr/pkg \
8287         /opt \
8288         /opt/local \
8289         $HOME
8290 do
8291
8292 test "x$cf_subdir_prefix" != "x$prefix" && \
8293 test -d "$cf_subdir_prefix" && \
8294 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8295         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8296         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8297         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8298         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8299         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8300         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"
8301 }
8302
8303 done
8304
8305 cf_search="$cf_library_path_list $cf_search"
8306
8307                         for cf_libdir in $cf_search
8308                         do
8309                                 echo "$as_me:8309: checking for -l$cf_nculib_root in $cf_libdir" >&5
8310 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8311                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8312                                 cat >conftest.$ac_ext <<_ACEOF
8313 #line 8313 "configure"
8314 #include "confdefs.h"
8315 #include <${cf_cv_ncurses_header:-curses.h}>
8316 int
8317 main (void)
8318 {
8319 initscr()
8320   ;
8321   return 0;
8322 }
8323 _ACEOF
8324 rm -f conftest.$ac_objext conftest$ac_exeext
8325 if { (eval echo "$as_me:8325: \"$ac_link\"") >&5
8326   (eval $ac_link) 2>&5
8327   ac_status=$?
8328   echo "$as_me:8328: \$? = $ac_status" >&5
8329   (exit $ac_status); } &&
8330          { ac_try='test -s conftest$ac_exeext'
8331   { (eval echo "$as_me:8331: \"$ac_try\"") >&5
8332   (eval $ac_try) 2>&5
8333   ac_status=$?
8334   echo "$as_me:8334: \$? = $ac_status" >&5
8335   (exit $ac_status); }; }; then
8336   echo "$as_me:8336: result: yes" >&5
8337 echo "${ECHO_T}yes" >&6
8338                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8339                                          break
8340 else
8341   echo "$as_me: failed program was:" >&5
8342 cat conftest.$ac_ext >&5
8343 echo "$as_me:8343: result: no" >&5
8344 echo "${ECHO_T}no" >&6
8345                                          LIBS="$cf_save_LIBS"
8346 fi
8347 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8348                         done
8349
8350 fi
8351 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8352
8353 fi
8354
8355 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8356
8357 if test $cf_found_library = no ; then
8358         { { echo "$as_me:8358: error: Cannot link $cf_nculib_root library" >&5
8359 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8360    { (exit 1); exit 1; }; }
8361 fi
8362
8363 fi
8364
8365 if test -n "$cf_ncurses_LIBS" ; then
8366         echo "$as_me:8366: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8367 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8368         cf_ncurses_SAVE="$LIBS"
8369         for p in $cf_ncurses_LIBS ; do
8370                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8371                 if test "$q" != "$LIBS" ; then
8372                         LIBS="$q"
8373                 fi
8374         done
8375         cat >conftest.$ac_ext <<_ACEOF
8376 #line 8376 "configure"
8377 #include "confdefs.h"
8378 #include <${cf_cv_ncurses_header:-curses.h}>
8379 int
8380 main (void)
8381 {
8382 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8383   ;
8384   return 0;
8385 }
8386 _ACEOF
8387 rm -f conftest.$ac_objext conftest$ac_exeext
8388 if { (eval echo "$as_me:8388: \"$ac_link\"") >&5
8389   (eval $ac_link) 2>&5
8390   ac_status=$?
8391   echo "$as_me:8391: \$? = $ac_status" >&5
8392   (exit $ac_status); } &&
8393          { ac_try='test -s conftest$ac_exeext'
8394   { (eval echo "$as_me:8394: \"$ac_try\"") >&5
8395   (eval $ac_try) 2>&5
8396   ac_status=$?
8397   echo "$as_me:8397: \$? = $ac_status" >&5
8398   (exit $ac_status); }; }; then
8399   echo "$as_me:8399: result: yes" >&5
8400 echo "${ECHO_T}yes" >&6
8401 else
8402   echo "$as_me: failed program was:" >&5
8403 cat conftest.$ac_ext >&5
8404 echo "$as_me:8404: result: no" >&5
8405 echo "${ECHO_T}no" >&6
8406                  LIBS="$cf_ncurses_SAVE"
8407 fi
8408 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8409 fi
8410
8411 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8412
8413 cat >>confdefs.h <<EOF
8414 #define $cf_nculib_ROOT 1
8415 EOF
8416
8417         fi
8418 else
8419         NCURSES_CONFIG=none
8420 fi
8421
8422         ;;
8423 (ncurses*)
8424
8425 cf_ncuconfig_root=$cf_cv_screen
8426 cf_have_ncuconfig=no
8427
8428 if test "x${PKG_CONFIG:=none}" != xnone; then
8429         echo "$as_me:8429: checking pkg-config for $cf_ncuconfig_root" >&5
8430 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8431         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8432                 echo "$as_me:8432: result: yes" >&5
8433 echo "${ECHO_T}yes" >&6
8434
8435                 echo "$as_me:8435: checking if the $cf_ncuconfig_root package files work" >&5
8436 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8437                 cf_have_ncuconfig=unknown
8438
8439                 cf_save_CPPFLAGS="$CPPFLAGS"
8440                 cf_save_LIBS="$LIBS"
8441
8442                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8443
8444 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8445 # Filter out duplicates - this happens with badly-designed ".pc" files...
8446 for cf_add_1lib in $LIBS
8447 do
8448         for cf_add_2lib in $cf_add_libs
8449         do
8450                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8451                 then
8452                         cf_add_1lib=
8453                         break
8454                 fi
8455         done
8456         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8457 done
8458 LIBS="$cf_add_libs"
8459
8460                 cat >conftest.$ac_ext <<_ACEOF
8461 #line 8461 "configure"
8462 #include "confdefs.h"
8463 #include <${cf_cv_ncurses_header:-curses.h}>
8464 int
8465 main (void)
8466 {
8467 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8468   ;
8469   return 0;
8470 }
8471 _ACEOF
8472 rm -f conftest.$ac_objext conftest$ac_exeext
8473 if { (eval echo "$as_me:8473: \"$ac_link\"") >&5
8474   (eval $ac_link) 2>&5
8475   ac_status=$?
8476   echo "$as_me:8476: \$? = $ac_status" >&5
8477   (exit $ac_status); } &&
8478          { ac_try='test -s conftest$ac_exeext'
8479   { (eval echo "$as_me:8479: \"$ac_try\"") >&5
8480   (eval $ac_try) 2>&5
8481   ac_status=$?
8482   echo "$as_me:8482: \$? = $ac_status" >&5
8483   (exit $ac_status); }; }; then
8484   if test "$cross_compiling" = yes; then
8485   cf_have_ncuconfig=maybe
8486 else
8487   cat >conftest.$ac_ext <<_ACEOF
8488 #line 8488 "configure"
8489 #include "confdefs.h"
8490 #include <${cf_cv_ncurses_header:-curses.h}>
8491                                 int main(void)
8492                                 { char *xx = curses_version(); return (xx == 0); }
8493 _ACEOF
8494 rm -f conftest$ac_exeext
8495 if { (eval echo "$as_me:8495: \"$ac_link\"") >&5
8496   (eval $ac_link) 2>&5
8497   ac_status=$?
8498   echo "$as_me:8498: \$? = $ac_status" >&5
8499   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8500   { (eval echo "$as_me:8500: \"$ac_try\"") >&5
8501   (eval $ac_try) 2>&5
8502   ac_status=$?
8503   echo "$as_me:8503: \$? = $ac_status" >&5
8504   (exit $ac_status); }; }; then
8505   cf_have_ncuconfig=yes
8506 else
8507   echo "$as_me: program exited with status $ac_status" >&5
8508 echo "$as_me: failed program was:" >&5
8509 cat conftest.$ac_ext >&5
8510 cf_have_ncuconfig=no
8511 fi
8512 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8513 fi
8514 else
8515   echo "$as_me: failed program was:" >&5
8516 cat conftest.$ac_ext >&5
8517 cf_have_ncuconfig=no
8518 fi
8519 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8520                 echo "$as_me:8520: result: $cf_have_ncuconfig" >&5
8521 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8522                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8523                 if test "$cf_have_ncuconfig" != "yes"
8524                 then
8525                         CPPFLAGS="$cf_save_CPPFLAGS"
8526                         LIBS="$cf_save_LIBS"
8527                         NCURSES_CONFIG_PKG=none
8528                 else
8529
8530 cat >>confdefs.h <<\EOF
8531 #define NCURSES 1
8532 EOF
8533
8534                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8535
8536 echo "$as_me:8536: checking for terminfo header" >&5
8537 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8538 if test "${cf_cv_term_header+set}" = set; then
8539   echo $ECHO_N "(cached) $ECHO_C" >&6
8540 else
8541
8542 case ${cf_cv_ncurses_header} in
8543 (*/ncurses.h|*/ncursesw.h)
8544         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8545         ;;
8546 (*)
8547         cf_term_header=term.h
8548         ;;
8549 esac
8550
8551 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8552 do
8553 cat >conftest.$ac_ext <<_ACEOF
8554 #line 8554 "configure"
8555 #include "confdefs.h"
8556 #include <stdio.h>
8557 #include <${cf_cv_ncurses_header:-curses.h}>
8558 #include <$cf_test>
8559
8560 int
8561 main (void)
8562 {
8563 int x = auto_left_margin
8564   ;
8565   return 0;
8566 }
8567 _ACEOF
8568 rm -f conftest.$ac_objext
8569 if { (eval echo "$as_me:8569: \"$ac_compile\"") >&5
8570   (eval $ac_compile) 2>&5
8571   ac_status=$?
8572   echo "$as_me:8572: \$? = $ac_status" >&5
8573   (exit $ac_status); } &&
8574          { ac_try='test -s conftest.$ac_objext'
8575   { (eval echo "$as_me:8575: \"$ac_try\"") >&5
8576   (eval $ac_try) 2>&5
8577   ac_status=$?
8578   echo "$as_me:8578: \$? = $ac_status" >&5
8579   (exit $ac_status); }; }; then
8580
8581         cf_cv_term_header="$cf_test"
8582 else
8583   echo "$as_me: failed program was:" >&5
8584 cat conftest.$ac_ext >&5
8585
8586         cf_cv_term_header=unknown
8587
8588 fi
8589 rm -f conftest.$ac_objext conftest.$ac_ext
8590         test "$cf_cv_term_header" != unknown && break
8591 done
8592
8593 fi
8594 echo "$as_me:8594: result: $cf_cv_term_header" >&5
8595 echo "${ECHO_T}$cf_cv_term_header" >&6
8596
8597 # Set definitions to allow ifdef'ing to accommodate subdirectories
8598
8599 case $cf_cv_term_header in
8600 (*term.h)
8601
8602 cat >>confdefs.h <<\EOF
8603 #define HAVE_TERM_H 1
8604 EOF
8605
8606         ;;
8607 esac
8608
8609 case $cf_cv_term_header in
8610 (ncurses/term.h)
8611
8612 cat >>confdefs.h <<\EOF
8613 #define HAVE_NCURSES_TERM_H 1
8614 EOF
8615
8616         ;;
8617 (ncursesw/term.h)
8618
8619 cat >>confdefs.h <<\EOF
8620 #define HAVE_NCURSESW_TERM_H 1
8621 EOF
8622
8623         ;;
8624 esac
8625
8626                 fi
8627
8628         else
8629                 echo "$as_me:8629: result: no" >&5
8630 echo "${ECHO_T}no" >&6
8631                 NCURSES_CONFIG_PKG=none
8632         fi
8633 else
8634         NCURSES_CONFIG_PKG=none
8635 fi
8636
8637 if test "x$cf_have_ncuconfig" = "xno"; then
8638         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8639
8640 if test -n "$ac_tool_prefix"; then
8641   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8642   do
8643     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8644 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8645 echo "$as_me:8645: checking for $ac_word" >&5
8646 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8647 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8648   echo $ECHO_N "(cached) $ECHO_C" >&6
8649 else
8650   if test -n "$NCURSES_CONFIG"; then
8651   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8652 else
8653   ac_save_IFS=$IFS; IFS=$ac_path_separator
8654 ac_dummy="$PATH"
8655 for ac_dir in $ac_dummy; do
8656   IFS=$ac_save_IFS
8657   test -z "$ac_dir" && ac_dir=.
8658   $as_executable_p "$ac_dir/$ac_word" || continue
8659 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8660 echo "$as_me:8660: found $ac_dir/$ac_word" >&5
8661 break
8662 done
8663
8664 fi
8665 fi
8666 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8667 if test -n "$NCURSES_CONFIG"; then
8668   echo "$as_me:8668: result: $NCURSES_CONFIG" >&5
8669 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8670 else
8671   echo "$as_me:8671: result: no" >&5
8672 echo "${ECHO_T}no" >&6
8673 fi
8674
8675     test -n "$NCURSES_CONFIG" && break
8676   done
8677 fi
8678 if test -z "$NCURSES_CONFIG"; then
8679   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8680   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8681 do
8682   # Extract the first word of "$ac_prog", so it can be a program name with args.
8683 set dummy $ac_prog; ac_word=$2
8684 echo "$as_me:8684: checking for $ac_word" >&5
8685 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8686 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8687   echo $ECHO_N "(cached) $ECHO_C" >&6
8688 else
8689   if test -n "$ac_ct_NCURSES_CONFIG"; then
8690   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8691 else
8692   ac_save_IFS=$IFS; IFS=$ac_path_separator
8693 ac_dummy="$PATH"
8694 for ac_dir in $ac_dummy; do
8695   IFS=$ac_save_IFS
8696   test -z "$ac_dir" && ac_dir=.
8697   $as_executable_p "$ac_dir/$ac_word" || continue
8698 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8699 echo "$as_me:8699: found $ac_dir/$ac_word" >&5
8700 break
8701 done
8702
8703 fi
8704 fi
8705 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8706 if test -n "$ac_ct_NCURSES_CONFIG"; then
8707   echo "$as_me:8707: result: $ac_ct_NCURSES_CONFIG" >&5
8708 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8709 else
8710   echo "$as_me:8710: result: no" >&5
8711 echo "${ECHO_T}no" >&6
8712 fi
8713
8714   test -n "$ac_ct_NCURSES_CONFIG" && break
8715 done
8716 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8717
8718   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8719 fi
8720
8721         if test "$NCURSES_CONFIG" != none ; then
8722
8723                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8724
8725 cf_add_libs="`$NCURSES_CONFIG --libs`"
8726 # Filter out duplicates - this happens with badly-designed ".pc" files...
8727 for cf_add_1lib in $LIBS
8728 do
8729         for cf_add_2lib in $cf_add_libs
8730         do
8731                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8732                 then
8733                         cf_add_1lib=
8734                         break
8735                 fi
8736         done
8737         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8738 done
8739 LIBS="$cf_add_libs"
8740
8741                 # even with config script, some packages use no-override for curses.h
8742
8743 echo "$as_me:8743: checking if we have identified curses headers" >&5
8744 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8745 if test "${cf_cv_ncurses_header+set}" = set; then
8746   echo $ECHO_N "(cached) $ECHO_C" >&6
8747 else
8748
8749 cf_cv_ncurses_header=none
8750 for cf_header in \
8751         ncurses.h $cf_cv_screen/ncurses.h \
8752         curses.h $cf_cv_screen/curses.h
8753 do
8754 cat >conftest.$ac_ext <<_ACEOF
8755 #line 8755 "configure"
8756 #include "confdefs.h"
8757 #include <${cf_header}>
8758 int
8759 main (void)
8760 {
8761 initscr(); tgoto("?", 0,0)
8762   ;
8763   return 0;
8764 }
8765 _ACEOF
8766 rm -f conftest.$ac_objext
8767 if { (eval echo "$as_me:8767: \"$ac_compile\"") >&5
8768   (eval $ac_compile) 2>&5
8769   ac_status=$?
8770   echo "$as_me:8770: \$? = $ac_status" >&5
8771   (exit $ac_status); } &&
8772          { ac_try='test -s conftest.$ac_objext'
8773   { (eval echo "$as_me:8773: \"$ac_try\"") >&5
8774   (eval $ac_try) 2>&5
8775   ac_status=$?
8776   echo "$as_me:8776: \$? = $ac_status" >&5
8777   (exit $ac_status); }; }; then
8778   cf_cv_ncurses_header=$cf_header; break
8779 else
8780   echo "$as_me: failed program was:" >&5
8781 cat conftest.$ac_ext >&5
8782 fi
8783 rm -f conftest.$ac_objext conftest.$ac_ext
8784 done
8785
8786 fi
8787 echo "$as_me:8787: result: $cf_cv_ncurses_header" >&5
8788 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8789
8790 if test "$cf_cv_ncurses_header" = none ; then
8791         { { echo "$as_me:8791: error: No curses header-files found" >&5
8792 echo "$as_me: error: No curses header-files found" >&2;}
8793    { (exit 1); exit 1; }; }
8794 fi
8795
8796 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8797
8798 for ac_header in $cf_cv_ncurses_header
8799 do
8800 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8801 echo "$as_me:8801: checking for $ac_header" >&5
8802 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8803 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8804   echo $ECHO_N "(cached) $ECHO_C" >&6
8805 else
8806   cat >conftest.$ac_ext <<_ACEOF
8807 #line 8807 "configure"
8808 #include "confdefs.h"
8809 #include <$ac_header>
8810 _ACEOF
8811 if { (eval echo "$as_me:8811: \"$ac_cpp conftest.$ac_ext\"") >&5
8812   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8813   ac_status=$?
8814   egrep -v '^ *\+' conftest.er1 >conftest.err
8815   rm -f conftest.er1
8816   cat conftest.err >&5
8817   echo "$as_me:8817: \$? = $ac_status" >&5
8818   (exit $ac_status); } >/dev/null; then
8819   if test -s conftest.err; then
8820     ac_cpp_err=$ac_c_preproc_warn_flag
8821   else
8822     ac_cpp_err=
8823   fi
8824 else
8825   ac_cpp_err=yes
8826 fi
8827 if test -z "$ac_cpp_err"; then
8828   eval "$as_ac_Header=yes"
8829 else
8830   echo "$as_me: failed program was:" >&5
8831   cat conftest.$ac_ext >&5
8832   eval "$as_ac_Header=no"
8833 fi
8834 rm -f conftest.err conftest.$ac_ext
8835 fi
8836 echo "$as_me:8836: result: `eval echo '${'$as_ac_Header'}'`" >&5
8837 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8838 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8839   cat >>confdefs.h <<EOF
8840 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8841 EOF
8842
8843 fi
8844 done
8845
8846 cat >>confdefs.h <<\EOF
8847 #define NCURSES 1
8848 EOF
8849
8850 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8851
8852                 cat >>confdefs.h <<EOF
8853 #define $cf_nculib_ROOT 1
8854 EOF
8855
8856                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8857
8858         else
8859
8860 cf_ncuhdr_root=$cf_cv_screen
8861
8862 test -n "$cf_cv_curses_dir" && \
8863 test "$cf_cv_curses_dir" != "no" && { \
8864
8865 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8866   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8867   do
8868         while test $cf_add_incdir != /usr/include
8869         do
8870           if test -d $cf_add_incdir
8871           then
8872                 cf_have_incdir=no
8873                 if test -n "$CFLAGS$CPPFLAGS" ; then
8874                   # a loop is needed to ensure we can add subdirs of existing dirs
8875                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8876                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8877                           cf_have_incdir=yes; break
8878                         fi
8879                   done
8880                 fi
8881
8882                 if test "$cf_have_incdir" = no ; then
8883                   if test "$cf_add_incdir" = /usr/local/include ; then
8884                         if test "$GCC" = yes
8885                         then
8886                           cf_save_CPPFLAGS=$CPPFLAGS
8887                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8888                           cat >conftest.$ac_ext <<_ACEOF
8889 #line 8889 "configure"
8890 #include "confdefs.h"
8891 #include <stdio.h>
8892 int
8893 main (void)
8894 {
8895 printf("Hello")
8896   ;
8897   return 0;
8898 }
8899 _ACEOF
8900 rm -f conftest.$ac_objext
8901 if { (eval echo "$as_me:8901: \"$ac_compile\"") >&5
8902   (eval $ac_compile) 2>&5
8903   ac_status=$?
8904   echo "$as_me:8904: \$? = $ac_status" >&5
8905   (exit $ac_status); } &&
8906          { ac_try='test -s conftest.$ac_objext'
8907   { (eval echo "$as_me:8907: \"$ac_try\"") >&5
8908   (eval $ac_try) 2>&5
8909   ac_status=$?
8910   echo "$as_me:8910: \$? = $ac_status" >&5
8911   (exit $ac_status); }; }; then
8912   :
8913 else
8914   echo "$as_me: failed program was:" >&5
8915 cat conftest.$ac_ext >&5
8916 cf_have_incdir=yes
8917 fi
8918 rm -f conftest.$ac_objext conftest.$ac_ext
8919                           CPPFLAGS=$cf_save_CPPFLAGS
8920                         fi
8921                   fi
8922                 fi
8923
8924                 if test "$cf_have_incdir" = no ; then
8925                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8926
8927 echo "${as_me:-configure}:8927: testing adding $cf_add_incdir to include-path ..." 1>&5
8928
8929                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8930
8931                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8932                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8933                   cf_add_incdir="$cf_top_incdir"
8934                 else
8935                   break
8936                 fi
8937           else
8938                 break
8939           fi
8940         done
8941   done
8942 fi
8943
8944 }
8945
8946 echo "$as_me:8946: checking for $cf_ncuhdr_root header in include-path" >&5
8947 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8948 if test "${cf_cv_ncurses_h+set}" = set; then
8949   echo $ECHO_N "(cached) $ECHO_C" >&6
8950 else
8951
8952         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8953         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8954         for cf_header in $cf_header_list
8955         do
8956
8957         cat >conftest.$ac_ext <<_ACEOF
8958 #line 8958 "configure"
8959 #include "confdefs.h"
8960
8961 #include <$cf_header>
8962 int
8963 main (void)
8964 {
8965
8966 #ifdef NCURSES_VERSION
8967
8968 printf("%s\n", NCURSES_VERSION);
8969 #else
8970 #ifdef __NCURSES_H
8971 printf("old\n");
8972 #else
8973         make an error
8974 #endif
8975 #endif
8976
8977   ;
8978   return 0;
8979 }
8980 _ACEOF
8981 rm -f conftest.$ac_objext
8982 if { (eval echo "$as_me:8982: \"$ac_compile\"") >&5
8983   (eval $ac_compile) 2>&5
8984   ac_status=$?
8985   echo "$as_me:8985: \$? = $ac_status" >&5
8986   (exit $ac_status); } &&
8987          { ac_try='test -s conftest.$ac_objext'
8988   { (eval echo "$as_me:8988: \"$ac_try\"") >&5
8989   (eval $ac_try) 2>&5
8990   ac_status=$?
8991   echo "$as_me:8991: \$? = $ac_status" >&5
8992   (exit $ac_status); }; }; then
8993   cf_cv_ncurses_h=$cf_header
8994
8995 else
8996   echo "$as_me: failed program was:" >&5
8997 cat conftest.$ac_ext >&5
8998 cf_cv_ncurses_h=no
8999 fi
9000 rm -f conftest.$ac_objext conftest.$ac_ext
9001
9002                 test "$cf_cv_ncurses_h" != no && break
9003         done
9004
9005 fi
9006 echo "$as_me:9006: result: $cf_cv_ncurses_h" >&5
9007 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9008
9009 if test "$cf_cv_ncurses_h" != no ; then
9010         cf_cv_ncurses_header=$cf_cv_ncurses_h
9011 else
9012
9013 echo "$as_me:9013: checking for $cf_ncuhdr_root include-path" >&5
9014 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9015 if test "${cf_cv_ncurses_h2+set}" = set; then
9016   echo $ECHO_N "(cached) $ECHO_C" >&6
9017 else
9018
9019         test -n "$verbose" && echo
9020
9021 cf_search=
9022
9023 # collect the current set of include-directories from compiler flags
9024 cf_header_path_list=""
9025 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9026         for cf_header_path in $CPPFLAGS $CFLAGS
9027         do
9028                 case $cf_header_path in
9029                 (-I*)
9030                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9031
9032 test "x$cf_header_path" != "xNONE" && \
9033 test -d "$cf_header_path" && \
9034  {
9035         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9036         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9037         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9038         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9039         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9040         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"
9041 }
9042
9043                         cf_header_path_list="$cf_header_path_list $cf_search"
9044                         ;;
9045                 esac
9046         done
9047 fi
9048
9049 # add the variations for the package we are looking for
9050
9051 cf_search=
9052
9053 test "x$prefix" != "xNONE" && \
9054 test -d "$prefix" && \
9055  {
9056         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9057         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9058         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9059         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9060         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9061         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9062 }
9063
9064 for cf_subdir_prefix in \
9065         /usr \
9066         /usr/local \
9067         /usr/pkg \
9068         /opt \
9069         /opt/local \
9070         $HOME
9071 do
9072
9073 test "x$cf_subdir_prefix" != "x$prefix" && \
9074 test -d "$cf_subdir_prefix" && \
9075 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9076         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9077         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9078         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9079         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9080         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9081         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"
9082 }
9083
9084 done
9085
9086 test "$includedir" != NONE && \
9087 test "$includedir" != "/usr/include" && \
9088 test -d "$includedir" && {
9089         test -d $includedir &&    cf_search="$cf_search $includedir"
9090         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9091 }
9092
9093 test "$oldincludedir" != NONE && \
9094 test "$oldincludedir" != "/usr/include" && \
9095 test -d "$oldincludedir" && {
9096         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9097         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9098 }
9099
9100 cf_search="$cf_search $cf_header_path_list"
9101
9102         test -n "$verbose" && echo search path $cf_search
9103         cf_save2_CPPFLAGS="$CPPFLAGS"
9104         for cf_incdir in $cf_search
9105         do
9106
9107 if test -n "$cf_incdir" ; then
9108   for cf_add_incdir in $cf_incdir
9109   do
9110         while test $cf_add_incdir != /usr/include
9111         do
9112           if test -d $cf_add_incdir
9113           then
9114                 cf_have_incdir=no
9115                 if test -n "$CFLAGS$CPPFLAGS" ; then
9116                   # a loop is needed to ensure we can add subdirs of existing dirs
9117                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9118                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9119                           cf_have_incdir=yes; break
9120                         fi
9121                   done
9122                 fi
9123
9124                 if test "$cf_have_incdir" = no ; then
9125                   if test "$cf_add_incdir" = /usr/local/include ; then
9126                         if test "$GCC" = yes
9127                         then
9128                           cf_save_CPPFLAGS=$CPPFLAGS
9129                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9130                           cat >conftest.$ac_ext <<_ACEOF
9131 #line 9131 "configure"
9132 #include "confdefs.h"
9133 #include <stdio.h>
9134 int
9135 main (void)
9136 {
9137 printf("Hello")
9138   ;
9139   return 0;
9140 }
9141 _ACEOF
9142 rm -f conftest.$ac_objext
9143 if { (eval echo "$as_me:9143: \"$ac_compile\"") >&5
9144   (eval $ac_compile) 2>&5
9145   ac_status=$?
9146   echo "$as_me:9146: \$? = $ac_status" >&5
9147   (exit $ac_status); } &&
9148          { ac_try='test -s conftest.$ac_objext'
9149   { (eval echo "$as_me:9149: \"$ac_try\"") >&5
9150   (eval $ac_try) 2>&5
9151   ac_status=$?
9152   echo "$as_me:9152: \$? = $ac_status" >&5
9153   (exit $ac_status); }; }; then
9154   :
9155 else
9156   echo "$as_me: failed program was:" >&5
9157 cat conftest.$ac_ext >&5
9158 cf_have_incdir=yes
9159 fi
9160 rm -f conftest.$ac_objext conftest.$ac_ext
9161                           CPPFLAGS=$cf_save_CPPFLAGS
9162                         fi
9163                   fi
9164                 fi
9165
9166                 if test "$cf_have_incdir" = no ; then
9167                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9168
9169 echo "${as_me:-configure}:9169: testing adding $cf_add_incdir to include-path ..." 1>&5
9170
9171                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9172
9173                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9174                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9175                   cf_add_incdir="$cf_top_incdir"
9176                 else
9177                   break
9178                 fi
9179           else
9180                 break
9181           fi
9182         done
9183   done
9184 fi
9185
9186                 for cf_header in \
9187                         ncurses.h \
9188                         curses.h
9189                 do
9190
9191         cat >conftest.$ac_ext <<_ACEOF
9192 #line 9192 "configure"
9193 #include "confdefs.h"
9194
9195 #include <$cf_header>
9196 int
9197 main (void)
9198 {
9199
9200 #ifdef NCURSES_VERSION
9201
9202 printf("%s\n", NCURSES_VERSION);
9203 #else
9204 #ifdef __NCURSES_H
9205 printf("old\n");
9206 #else
9207         make an error
9208 #endif
9209 #endif
9210
9211   ;
9212   return 0;
9213 }
9214 _ACEOF
9215 rm -f conftest.$ac_objext
9216 if { (eval echo "$as_me:9216: \"$ac_compile\"") >&5
9217   (eval $ac_compile) 2>&5
9218   ac_status=$?
9219   echo "$as_me:9219: \$? = $ac_status" >&5
9220   (exit $ac_status); } &&
9221          { ac_try='test -s conftest.$ac_objext'
9222   { (eval echo "$as_me:9222: \"$ac_try\"") >&5
9223   (eval $ac_try) 2>&5
9224   ac_status=$?
9225   echo "$as_me:9225: \$? = $ac_status" >&5
9226   (exit $ac_status); }; }; then
9227   cf_cv_ncurses_h2=$cf_header
9228
9229 else
9230   echo "$as_me: failed program was:" >&5
9231 cat conftest.$ac_ext >&5
9232 cf_cv_ncurses_h2=no
9233 fi
9234 rm -f conftest.$ac_objext conftest.$ac_ext
9235
9236                         if test "$cf_cv_ncurses_h2" != no ; then
9237                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9238                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9239                                 break
9240                         fi
9241                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9242                 done
9243                 CPPFLAGS="$cf_save2_CPPFLAGS"
9244                 test "$cf_cv_ncurses_h2" != no && break
9245         done
9246         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9246: error: not found" >&5
9247 echo "$as_me: error: not found" >&2;}
9248    { (exit 1); exit 1; }; }
9249
9250 fi
9251 echo "$as_me:9251: result: $cf_cv_ncurses_h2" >&5
9252 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9253
9254         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9255         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9256         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9257                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9258         fi
9259
9260 if test -n "$cf_1st_incdir" ; then
9261   for cf_add_incdir in $cf_1st_incdir
9262   do
9263         while test $cf_add_incdir != /usr/include
9264         do
9265           if test -d $cf_add_incdir
9266           then
9267                 cf_have_incdir=no
9268                 if test -n "$CFLAGS$CPPFLAGS" ; then
9269                   # a loop is needed to ensure we can add subdirs of existing dirs
9270                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9271                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9272                           cf_have_incdir=yes; break
9273                         fi
9274                   done
9275                 fi
9276
9277                 if test "$cf_have_incdir" = no ; then
9278                   if test "$cf_add_incdir" = /usr/local/include ; then
9279                         if test "$GCC" = yes
9280                         then
9281                           cf_save_CPPFLAGS=$CPPFLAGS
9282                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9283                           cat >conftest.$ac_ext <<_ACEOF
9284 #line 9284 "configure"
9285 #include "confdefs.h"
9286 #include <stdio.h>
9287 int
9288 main (void)
9289 {
9290 printf("Hello")
9291   ;
9292   return 0;
9293 }
9294 _ACEOF
9295 rm -f conftest.$ac_objext
9296 if { (eval echo "$as_me:9296: \"$ac_compile\"") >&5
9297   (eval $ac_compile) 2>&5
9298   ac_status=$?
9299   echo "$as_me:9299: \$? = $ac_status" >&5
9300   (exit $ac_status); } &&
9301          { ac_try='test -s conftest.$ac_objext'
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 else
9309   echo "$as_me: failed program was:" >&5
9310 cat conftest.$ac_ext >&5
9311 cf_have_incdir=yes
9312 fi
9313 rm -f conftest.$ac_objext conftest.$ac_ext
9314                           CPPFLAGS=$cf_save_CPPFLAGS
9315                         fi
9316                   fi
9317                 fi
9318
9319                 if test "$cf_have_incdir" = no ; then
9320                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9321
9322 echo "${as_me:-configure}:9322: testing adding $cf_add_incdir to include-path ..." 1>&5
9323
9324                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9325
9326                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9327                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9328                   cf_add_incdir="$cf_top_incdir"
9329                 else
9330                   break
9331                 fi
9332           else
9333                 break
9334           fi
9335         done
9336   done
9337 fi
9338
9339 fi
9340
9341 # Set definitions to allow ifdef'ing for ncurses.h
9342
9343 case $cf_cv_ncurses_header in
9344 (*ncurses.h)
9345
9346 cat >>confdefs.h <<\EOF
9347 #define HAVE_NCURSES_H 1
9348 EOF
9349
9350         ;;
9351 esac
9352
9353 case $cf_cv_ncurses_header in
9354 (ncurses/curses.h|ncurses/ncurses.h)
9355
9356 cat >>confdefs.h <<\EOF
9357 #define HAVE_NCURSES_NCURSES_H 1
9358 EOF
9359
9360         ;;
9361 (ncursesw/curses.h|ncursesw/ncurses.h)
9362
9363 cat >>confdefs.h <<\EOF
9364 #define HAVE_NCURSESW_NCURSES_H 1
9365 EOF
9366
9367         ;;
9368 esac
9369
9370 echo "$as_me:9370: checking for terminfo header" >&5
9371 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9372 if test "${cf_cv_term_header+set}" = set; then
9373   echo $ECHO_N "(cached) $ECHO_C" >&6
9374 else
9375
9376 case ${cf_cv_ncurses_header} in
9377 (*/ncurses.h|*/ncursesw.h)
9378         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9379         ;;
9380 (*)
9381         cf_term_header=term.h
9382         ;;
9383 esac
9384
9385 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9386 do
9387 cat >conftest.$ac_ext <<_ACEOF
9388 #line 9388 "configure"
9389 #include "confdefs.h"
9390 #include <stdio.h>
9391 #include <${cf_cv_ncurses_header:-curses.h}>
9392 #include <$cf_test>
9393
9394 int
9395 main (void)
9396 {
9397 int x = auto_left_margin
9398   ;
9399   return 0;
9400 }
9401 _ACEOF
9402 rm -f conftest.$ac_objext
9403 if { (eval echo "$as_me:9403: \"$ac_compile\"") >&5
9404   (eval $ac_compile) 2>&5
9405   ac_status=$?
9406   echo "$as_me:9406: \$? = $ac_status" >&5
9407   (exit $ac_status); } &&
9408          { ac_try='test -s conftest.$ac_objext'
9409   { (eval echo "$as_me:9409: \"$ac_try\"") >&5
9410   (eval $ac_try) 2>&5
9411   ac_status=$?
9412   echo "$as_me:9412: \$? = $ac_status" >&5
9413   (exit $ac_status); }; }; then
9414
9415         cf_cv_term_header="$cf_test"
9416 else
9417   echo "$as_me: failed program was:" >&5
9418 cat conftest.$ac_ext >&5
9419
9420         cf_cv_term_header=unknown
9421
9422 fi
9423 rm -f conftest.$ac_objext conftest.$ac_ext
9424         test "$cf_cv_term_header" != unknown && break
9425 done
9426
9427 fi
9428 echo "$as_me:9428: result: $cf_cv_term_header" >&5
9429 echo "${ECHO_T}$cf_cv_term_header" >&6
9430
9431 # Set definitions to allow ifdef'ing to accommodate subdirectories
9432
9433 case $cf_cv_term_header in
9434 (*term.h)
9435
9436 cat >>confdefs.h <<\EOF
9437 #define HAVE_TERM_H 1
9438 EOF
9439
9440         ;;
9441 esac
9442
9443 case $cf_cv_term_header in
9444 (ncurses/term.h)
9445
9446 cat >>confdefs.h <<\EOF
9447 #define HAVE_NCURSES_TERM_H 1
9448 EOF
9449
9450         ;;
9451 (ncursesw/term.h)
9452
9453 cat >>confdefs.h <<\EOF
9454 #define HAVE_NCURSESW_TERM_H 1
9455 EOF
9456
9457         ;;
9458 esac
9459
9460 # some applications need this, but should check for NCURSES_VERSION
9461
9462 cat >>confdefs.h <<\EOF
9463 #define NCURSES 1
9464 EOF
9465
9466 echo "$as_me:9466: checking for ncurses version" >&5
9467 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9468 if test "${cf_cv_ncurses_version+set}" = set; then
9469   echo $ECHO_N "(cached) $ECHO_C" >&6
9470 else
9471
9472         cf_cv_ncurses_version=no
9473         cf_tempfile=out$$
9474         rm -f $cf_tempfile
9475         if test "$cross_compiling" = yes; then
9476
9477         # This will not work if the preprocessor splits the line after the
9478         # Autoconf token.  The 'unproto' program does that.
9479         cat > conftest.$ac_ext <<EOF
9480 #include <${cf_cv_ncurses_header:-curses.h}>
9481 #undef Autoconf
9482 #ifdef NCURSES_VERSION
9483 Autoconf NCURSES_VERSION
9484 #else
9485 #ifdef __NCURSES_H
9486 Autoconf "old"
9487 #endif
9488 ;
9489 #endif
9490 EOF
9491         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9492         { (eval echo "$as_me:9492: \"$cf_try\"") >&5
9493   (eval $cf_try) 2>&5
9494   ac_status=$?
9495   echo "$as_me:9495: \$? = $ac_status" >&5
9496   (exit $ac_status); }
9497         if test -f conftest.out ; then
9498                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9499                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9500                 rm -f conftest.out
9501         fi
9502
9503 else
9504   cat >conftest.$ac_ext <<_ACEOF
9505 #line 9505 "configure"
9506 #include "confdefs.h"
9507
9508 #include <${cf_cv_ncurses_header:-curses.h}>
9509 #include <stdio.h>
9510 int main(void)
9511 {
9512         FILE *fp = fopen("$cf_tempfile", "w");
9513 #ifdef NCURSES_VERSION
9514 # ifdef NCURSES_VERSION_PATCH
9515         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9516 # else
9517         fprintf(fp, "%s\n", NCURSES_VERSION);
9518 # endif
9519 #else
9520 # ifdef __NCURSES_H
9521         fprintf(fp, "old\n");
9522 # else
9523         make an error
9524 # endif
9525 #endif
9526         ${cf_cv_main_return:-return}(0);
9527 }
9528 _ACEOF
9529 rm -f conftest$ac_exeext
9530 if { (eval echo "$as_me:9530: \"$ac_link\"") >&5
9531   (eval $ac_link) 2>&5
9532   ac_status=$?
9533   echo "$as_me:9533: \$? = $ac_status" >&5
9534   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9535   { (eval echo "$as_me:9535: \"$ac_try\"") >&5
9536   (eval $ac_try) 2>&5
9537   ac_status=$?
9538   echo "$as_me:9538: \$? = $ac_status" >&5
9539   (exit $ac_status); }; }; then
9540
9541         cf_cv_ncurses_version=`cat $cf_tempfile`
9542 else
9543   echo "$as_me: program exited with status $ac_status" >&5
9544 echo "$as_me: failed program was:" >&5
9545 cat conftest.$ac_ext >&5
9546 fi
9547 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9548 fi
9549         rm -f $cf_tempfile
9550
9551 fi
9552 echo "$as_me:9552: result: $cf_cv_ncurses_version" >&5
9553 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9554 test "$cf_cv_ncurses_version" = no ||
9555 cat >>confdefs.h <<\EOF
9556 #define NCURSES 1
9557 EOF
9558
9559 cf_nculib_root=$cf_cv_screen
9560         # This works, except for the special case where we find gpm, but
9561         # ncurses is in a nonstandard location via $LIBS, and we really want
9562         # to link gpm.
9563 cf_ncurses_LIBS=""
9564 cf_ncurses_SAVE="$LIBS"
9565 echo "$as_me:9565: checking for Gpm_Open in -lgpm" >&5
9566 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9567 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9568   echo $ECHO_N "(cached) $ECHO_C" >&6
9569 else
9570   ac_check_lib_save_LIBS=$LIBS
9571 LIBS="-lgpm  $LIBS"
9572 cat >conftest.$ac_ext <<_ACEOF
9573 #line 9573 "configure"
9574 #include "confdefs.h"
9575
9576 /* Override any gcc2 internal prototype to avoid an error.  */
9577 #ifdef __cplusplus
9578 extern "C"
9579 #endif
9580 /* We use char because int might match the return type of a gcc2
9581    builtin and then its argument prototype would still apply.  */
9582 char Gpm_Open ();
9583 int
9584 main (void)
9585 {
9586 Gpm_Open ();
9587   ;
9588   return 0;
9589 }
9590 _ACEOF
9591 rm -f conftest.$ac_objext conftest$ac_exeext
9592 if { (eval echo "$as_me:9592: \"$ac_link\"") >&5
9593   (eval $ac_link) 2>&5
9594   ac_status=$?
9595   echo "$as_me:9595: \$? = $ac_status" >&5
9596   (exit $ac_status); } &&
9597          { ac_try='test -s conftest$ac_exeext'
9598   { (eval echo "$as_me:9598: \"$ac_try\"") >&5
9599   (eval $ac_try) 2>&5
9600   ac_status=$?
9601   echo "$as_me:9601: \$? = $ac_status" >&5
9602   (exit $ac_status); }; }; then
9603   ac_cv_lib_gpm_Gpm_Open=yes
9604 else
9605   echo "$as_me: failed program was:" >&5
9606 cat conftest.$ac_ext >&5
9607 ac_cv_lib_gpm_Gpm_Open=no
9608 fi
9609 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9610 LIBS=$ac_check_lib_save_LIBS
9611 fi
9612 echo "$as_me:9612: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9613 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9614 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9615   echo "$as_me:9615: checking for initscr in -lgpm" >&5
9616 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9617 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9618   echo $ECHO_N "(cached) $ECHO_C" >&6
9619 else
9620   ac_check_lib_save_LIBS=$LIBS
9621 LIBS="-lgpm  $LIBS"
9622 cat >conftest.$ac_ext <<_ACEOF
9623 #line 9623 "configure"
9624 #include "confdefs.h"
9625
9626 /* Override any gcc2 internal prototype to avoid an error.  */
9627 #ifdef __cplusplus
9628 extern "C"
9629 #endif
9630 /* We use char because int might match the return type of a gcc2
9631    builtin and then its argument prototype would still apply.  */
9632 char initscr ();
9633 int
9634 main (void)
9635 {
9636 initscr ();
9637   ;
9638   return 0;
9639 }
9640 _ACEOF
9641 rm -f conftest.$ac_objext conftest$ac_exeext
9642 if { (eval echo "$as_me:9642: \"$ac_link\"") >&5
9643   (eval $ac_link) 2>&5
9644   ac_status=$?
9645   echo "$as_me:9645: \$? = $ac_status" >&5
9646   (exit $ac_status); } &&
9647          { ac_try='test -s conftest$ac_exeext'
9648   { (eval echo "$as_me:9648: \"$ac_try\"") >&5
9649   (eval $ac_try) 2>&5
9650   ac_status=$?
9651   echo "$as_me:9651: \$? = $ac_status" >&5
9652   (exit $ac_status); }; }; then
9653   ac_cv_lib_gpm_initscr=yes
9654 else
9655   echo "$as_me: failed program was:" >&5
9656 cat conftest.$ac_ext >&5
9657 ac_cv_lib_gpm_initscr=no
9658 fi
9659 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9660 LIBS=$ac_check_lib_save_LIBS
9661 fi
9662 echo "$as_me:9662: result: $ac_cv_lib_gpm_initscr" >&5
9663 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9664 if test $ac_cv_lib_gpm_initscr = yes; then
9665   LIBS="$cf_ncurses_SAVE"
9666 else
9667   cf_ncurses_LIBS="-lgpm"
9668 fi
9669
9670 fi
9671
9672 case $host_os in
9673 (freebsd*)
9674         # This is only necessary if you are linking against an obsolete
9675         # version of ncurses (but it should do no harm, since it's static).
9676         if test "$cf_nculib_root" = ncurses ; then
9677                 echo "$as_me:9677: checking for tgoto in -lmytinfo" >&5
9678 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9679 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9680   echo $ECHO_N "(cached) $ECHO_C" >&6
9681 else
9682   ac_check_lib_save_LIBS=$LIBS
9683 LIBS="-lmytinfo  $LIBS"
9684 cat >conftest.$ac_ext <<_ACEOF
9685 #line 9685 "configure"
9686 #include "confdefs.h"
9687
9688 /* Override any gcc2 internal prototype to avoid an error.  */
9689 #ifdef __cplusplus
9690 extern "C"
9691 #endif
9692 /* We use char because int might match the return type of a gcc2
9693    builtin and then its argument prototype would still apply.  */
9694 char tgoto ();
9695 int
9696 main (void)
9697 {
9698 tgoto ();
9699   ;
9700   return 0;
9701 }
9702 _ACEOF
9703 rm -f conftest.$ac_objext conftest$ac_exeext
9704 if { (eval echo "$as_me:9704: \"$ac_link\"") >&5
9705   (eval $ac_link) 2>&5
9706   ac_status=$?
9707   echo "$as_me:9707: \$? = $ac_status" >&5
9708   (exit $ac_status); } &&
9709          { ac_try='test -s conftest$ac_exeext'
9710   { (eval echo "$as_me:9710: \"$ac_try\"") >&5
9711   (eval $ac_try) 2>&5
9712   ac_status=$?
9713   echo "$as_me:9713: \$? = $ac_status" >&5
9714   (exit $ac_status); }; }; then
9715   ac_cv_lib_mytinfo_tgoto=yes
9716 else
9717   echo "$as_me: failed program was:" >&5
9718 cat conftest.$ac_ext >&5
9719 ac_cv_lib_mytinfo_tgoto=no
9720 fi
9721 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9722 LIBS=$ac_check_lib_save_LIBS
9723 fi
9724 echo "$as_me:9724: result: $ac_cv_lib_mytinfo_tgoto" >&5
9725 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9726 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9727   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9728 fi
9729
9730         fi
9731         ;;
9732 esac
9733
9734 cf_add_libs="$cf_ncurses_LIBS"
9735 # Filter out duplicates - this happens with badly-designed ".pc" files...
9736 for cf_add_1lib in $LIBS
9737 do
9738         for cf_add_2lib in $cf_add_libs
9739         do
9740                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9741                 then
9742                         cf_add_1lib=
9743                         break
9744                 fi
9745         done
9746         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9747 done
9748 LIBS="$cf_add_libs"
9749
9750 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9751 then
9752
9753 cf_add_libs="-l$cf_nculib_root"
9754 # Filter out duplicates - this happens with badly-designed ".pc" files...
9755 for cf_add_1lib in $LIBS
9756 do
9757         for cf_add_2lib in $cf_add_libs
9758         do
9759                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9760                 then
9761                         cf_add_1lib=
9762                         break
9763                 fi
9764         done
9765         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9766 done
9767 LIBS="$cf_add_libs"
9768
9769 else
9770
9771         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9772         cf_libdir=""
9773         echo "$as_me:9773: checking for initscr" >&5
9774 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9775 if test "${ac_cv_func_initscr+set}" = set; then
9776   echo $ECHO_N "(cached) $ECHO_C" >&6
9777 else
9778   cat >conftest.$ac_ext <<_ACEOF
9779 #line 9779 "configure"
9780 #include "confdefs.h"
9781 /* System header to define __stub macros and hopefully few prototypes,
9782     which can conflict with char initscr (); below.  */
9783 #include <assert.h>
9784 /* Override any gcc2 internal prototype to avoid an error.  */
9785 #ifdef __cplusplus
9786 extern "C"
9787 #endif
9788 /* We use char because int might match the return type of a gcc2
9789    builtin and then its argument prototype would still apply.  */
9790 char initscr ();
9791 char (*f) ();
9792
9793 int
9794 main (void)
9795 {
9796 /* The GNU C library defines this for functions which it implements
9797     to always fail with ENOSYS.  Some functions are actually named
9798     something starting with __ and the normal name is an alias.  */
9799 #if defined (__stub_initscr) || defined (__stub___initscr)
9800 choke me
9801 #else
9802 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9803 #endif
9804
9805   ;
9806   return 0;
9807 }
9808 _ACEOF
9809 rm -f conftest.$ac_objext conftest$ac_exeext
9810 if { (eval echo "$as_me:9810: \"$ac_link\"") >&5
9811   (eval $ac_link) 2>&5
9812   ac_status=$?
9813   echo "$as_me:9813: \$? = $ac_status" >&5
9814   (exit $ac_status); } &&
9815          { ac_try='test -s conftest$ac_exeext'
9816   { (eval echo "$as_me:9816: \"$ac_try\"") >&5
9817   (eval $ac_try) 2>&5
9818   ac_status=$?
9819   echo "$as_me:9819: \$? = $ac_status" >&5
9820   (exit $ac_status); }; }; then
9821   ac_cv_func_initscr=yes
9822 else
9823   echo "$as_me: failed program was:" >&5
9824 cat conftest.$ac_ext >&5
9825 ac_cv_func_initscr=no
9826 fi
9827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9828 fi
9829 echo "$as_me:9829: result: $ac_cv_func_initscr" >&5
9830 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9831 if test $ac_cv_func_initscr = yes; then
9832   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9833 else
9834
9835                 cf_save_LIBS="$LIBS"
9836                 echo "$as_me:9836: checking for initscr in -l$cf_nculib_root" >&5
9837 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9838                 LIBS="-l$cf_nculib_root $LIBS"
9839                 cat >conftest.$ac_ext <<_ACEOF
9840 #line 9840 "configure"
9841 #include "confdefs.h"
9842 #include <${cf_cv_ncurses_header:-curses.h}>
9843 int
9844 main (void)
9845 {
9846 initscr()
9847   ;
9848   return 0;
9849 }
9850 _ACEOF
9851 rm -f conftest.$ac_objext conftest$ac_exeext
9852 if { (eval echo "$as_me:9852: \"$ac_link\"") >&5
9853   (eval $ac_link) 2>&5
9854   ac_status=$?
9855   echo "$as_me:9855: \$? = $ac_status" >&5
9856   (exit $ac_status); } &&
9857          { ac_try='test -s conftest$ac_exeext'
9858   { (eval echo "$as_me:9858: \"$ac_try\"") >&5
9859   (eval $ac_try) 2>&5
9860   ac_status=$?
9861   echo "$as_me:9861: \$? = $ac_status" >&5
9862   (exit $ac_status); }; }; then
9863   echo "$as_me:9863: result: yes" >&5
9864 echo "${ECHO_T}yes" >&6
9865                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9866
9867 else
9868   echo "$as_me: failed program was:" >&5
9869 cat conftest.$ac_ext >&5
9870 echo "$as_me:9870: result: no" >&5
9871 echo "${ECHO_T}no" >&6
9872
9873 cf_search=
9874 cf_library_path_list=""
9875 if test -n "${LDFLAGS}${LIBS}" ; then
9876         for cf_library_path in $LDFLAGS $LIBS
9877         do
9878                 case $cf_library_path in
9879                 (-L*)
9880                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9881
9882 test "x$cf_library_path" != "xNONE" && \
9883 test -d "$cf_library_path" && \
9884  {
9885         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9886         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9887         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9888         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9889         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9890         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"
9891 }
9892
9893                         cf_library_path_list="$cf_library_path_list $cf_search"
9894                         ;;
9895                 esac
9896         done
9897 fi
9898
9899 cf_search=
9900
9901 test "x$prefix" != "xNONE" && \
9902 test -d "$prefix" && \
9903  {
9904         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9905         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9906         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9907         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9908         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9909         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9910 }
9911
9912 for cf_subdir_prefix in \
9913         /usr \
9914         /usr/local \
9915         /usr/pkg \
9916         /opt \
9917         /opt/local \
9918         $HOME
9919 do
9920
9921 test "x$cf_subdir_prefix" != "x$prefix" && \
9922 test -d "$cf_subdir_prefix" && \
9923 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9924         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9925         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9926         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9927         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9928         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9929         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"
9930 }
9931
9932 done
9933
9934 cf_search="$cf_library_path_list $cf_search"
9935
9936                         for cf_libdir in $cf_search
9937                         do
9938                                 echo "$as_me:9938: checking for -l$cf_nculib_root in $cf_libdir" >&5
9939 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9940                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9941                                 cat >conftest.$ac_ext <<_ACEOF
9942 #line 9942 "configure"
9943 #include "confdefs.h"
9944 #include <${cf_cv_ncurses_header:-curses.h}>
9945 int
9946 main (void)
9947 {
9948 initscr()
9949   ;
9950   return 0;
9951 }
9952 _ACEOF
9953 rm -f conftest.$ac_objext conftest$ac_exeext
9954 if { (eval echo "$as_me:9954: \"$ac_link\"") >&5
9955   (eval $ac_link) 2>&5
9956   ac_status=$?
9957   echo "$as_me:9957: \$? = $ac_status" >&5
9958   (exit $ac_status); } &&
9959          { ac_try='test -s conftest$ac_exeext'
9960   { (eval echo "$as_me:9960: \"$ac_try\"") >&5
9961   (eval $ac_try) 2>&5
9962   ac_status=$?
9963   echo "$as_me:9963: \$? = $ac_status" >&5
9964   (exit $ac_status); }; }; then
9965   echo "$as_me:9965: result: yes" >&5
9966 echo "${ECHO_T}yes" >&6
9967                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9968                                          break
9969 else
9970   echo "$as_me: failed program was:" >&5
9971 cat conftest.$ac_ext >&5
9972 echo "$as_me:9972: result: no" >&5
9973 echo "${ECHO_T}no" >&6
9974                                          LIBS="$cf_save_LIBS"
9975 fi
9976 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9977                         done
9978
9979 fi
9980 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9981
9982 fi
9983
9984 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9985
9986 if test $cf_found_library = no ; then
9987         { { echo "$as_me:9987: error: Cannot link $cf_nculib_root library" >&5
9988 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9989    { (exit 1); exit 1; }; }
9990 fi
9991
9992 fi
9993
9994 if test -n "$cf_ncurses_LIBS" ; then
9995         echo "$as_me:9995: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9996 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9997         cf_ncurses_SAVE="$LIBS"
9998         for p in $cf_ncurses_LIBS ; do
9999                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10000                 if test "$q" != "$LIBS" ; then
10001                         LIBS="$q"
10002                 fi
10003         done
10004         cat >conftest.$ac_ext <<_ACEOF
10005 #line 10005 "configure"
10006 #include "confdefs.h"
10007 #include <${cf_cv_ncurses_header:-curses.h}>
10008 int
10009 main (void)
10010 {
10011 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10012   ;
10013   return 0;
10014 }
10015 _ACEOF
10016 rm -f conftest.$ac_objext conftest$ac_exeext
10017 if { (eval echo "$as_me:10017: \"$ac_link\"") >&5
10018   (eval $ac_link) 2>&5
10019   ac_status=$?
10020   echo "$as_me:10020: \$? = $ac_status" >&5
10021   (exit $ac_status); } &&
10022          { ac_try='test -s conftest$ac_exeext'
10023   { (eval echo "$as_me:10023: \"$ac_try\"") >&5
10024   (eval $ac_try) 2>&5
10025   ac_status=$?
10026   echo "$as_me:10026: \$? = $ac_status" >&5
10027   (exit $ac_status); }; }; then
10028   echo "$as_me:10028: result: yes" >&5
10029 echo "${ECHO_T}yes" >&6
10030 else
10031   echo "$as_me: failed program was:" >&5
10032 cat conftest.$ac_ext >&5
10033 echo "$as_me:10033: result: no" >&5
10034 echo "${ECHO_T}no" >&6
10035                  LIBS="$cf_ncurses_SAVE"
10036 fi
10037 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10038 fi
10039
10040 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10041
10042 cat >>confdefs.h <<EOF
10043 #define $cf_nculib_ROOT 1
10044 EOF
10045
10046         fi
10047 else
10048         NCURSES_CONFIG=none
10049 fi
10050
10051         ;;
10052 (pdcurses)
10053         echo "$as_me:10053: checking for X" >&5
10054 echo $ECHO_N "checking for X... $ECHO_C" >&6
10055
10056 # Check whether --with-x or --without-x was given.
10057 if test "${with_x+set}" = set; then
10058   withval="$with_x"
10059
10060 fi;
10061 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10062 if test "x$with_x" = xno; then
10063   # The user explicitly disabled X.
10064   have_x=disabled
10065 else
10066   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10067     # Both variables are already set.
10068     have_x=yes
10069   else
10070     if test "${ac_cv_have_x+set}" = set; then
10071   echo $ECHO_N "(cached) $ECHO_C" >&6
10072 else
10073   # One or both of the vars are not set, and there is no cached value.
10074 ac_x_includes=no ac_x_libraries=no
10075 rm -fr conftest.dir
10076 if mkdir conftest.dir; then
10077   cd conftest.dir
10078   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10079   cat >Imakefile <<'EOF'
10080 acfindx:
10081         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10082 EOF
10083   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10084     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10085     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10086     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10087     for ac_extension in a so sl dylib dll; do
10088       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10089          test -f $ac_im_libdir/libX11.$ac_extension; then
10090         ac_im_usrlibdir=$ac_im_libdir; break
10091       fi
10092     done
10093     # Screen out bogus values from the imake configuration.  They are
10094     # bogus both because they are the default anyway, and because
10095     # using them would break gcc on systems where it needs fixed includes.
10096     case $ac_im_incroot in
10097         /usr/include) ;;
10098         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10099     esac
10100     case $ac_im_usrlibdir in
10101         /usr/lib | /lib) ;;
10102         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10103     esac
10104   fi
10105   cd ..
10106   rm -fr conftest.dir
10107 fi
10108
10109 # Standard set of common directories for X headers.
10110 # Check X11 before X11Rn because it is often a symlink to the current release.
10111 ac_x_header_dirs='
10112 /usr/X11/include
10113 /usr/X11R6/include
10114 /usr/X11R5/include
10115 /usr/X11R4/include
10116
10117 /usr/include/X11
10118 /usr/include/X11R6
10119 /usr/include/X11R5
10120 /usr/include/X11R4
10121
10122 /usr/local/X11/include
10123 /usr/local/X11R6/include
10124 /usr/local/X11R5/include
10125 /usr/local/X11R4/include
10126
10127 /usr/local/include/X11
10128 /usr/local/include/X11R6
10129 /usr/local/include/X11R5
10130 /usr/local/include/X11R4
10131
10132 /usr/X386/include
10133 /usr/x386/include
10134 /usr/XFree86/include/X11
10135
10136 /usr/include
10137 /usr/local/include
10138 /usr/unsupported/include
10139 /usr/athena/include
10140 /usr/local/x11r5/include
10141 /usr/lpp/Xamples/include
10142
10143 /usr/openwin/include
10144 /usr/openwin/share/include'
10145
10146 if test "$ac_x_includes" = no; then
10147   # Guess where to find include files, by looking for Intrinsic.h.
10148   # First, try using that file with no special directory specified.
10149   cat >conftest.$ac_ext <<_ACEOF
10150 #line 10150 "configure"
10151 #include "confdefs.h"
10152 #include <X11/Intrinsic.h>
10153 _ACEOF
10154 if { (eval echo "$as_me:10154: \"$ac_cpp conftest.$ac_ext\"") >&5
10155   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10156   ac_status=$?
10157   egrep -v '^ *\+' conftest.er1 >conftest.err
10158   rm -f conftest.er1
10159   cat conftest.err >&5
10160   echo "$as_me:10160: \$? = $ac_status" >&5
10161   (exit $ac_status); } >/dev/null; then
10162   if test -s conftest.err; then
10163     ac_cpp_err=$ac_c_preproc_warn_flag
10164   else
10165     ac_cpp_err=
10166   fi
10167 else
10168   ac_cpp_err=yes
10169 fi
10170 if test -z "$ac_cpp_err"; then
10171   # We can compile using X headers with no special include directory.
10172 ac_x_includes=
10173 else
10174   echo "$as_me: failed program was:" >&5
10175   cat conftest.$ac_ext >&5
10176   for ac_dir in $ac_x_header_dirs; do
10177   if test -r "$ac_dir/X11/Intrinsic.h"; then
10178     ac_x_includes=$ac_dir
10179     break
10180   fi
10181 done
10182 fi
10183 rm -f conftest.err conftest.$ac_ext
10184 fi # $ac_x_includes = no
10185
10186 if test "$ac_x_libraries" = no; then
10187   # Check for the libraries.
10188   # See if we find them without any special options.
10189   # Don't add to $LIBS permanently.
10190   ac_save_LIBS=$LIBS
10191   LIBS="-lXt $LIBS"
10192   cat >conftest.$ac_ext <<_ACEOF
10193 #line 10193 "configure"
10194 #include "confdefs.h"
10195 #include <X11/Intrinsic.h>
10196 int
10197 main (void)
10198 {
10199 XtMalloc (0)
10200   ;
10201   return 0;
10202 }
10203 _ACEOF
10204 rm -f conftest.$ac_objext conftest$ac_exeext
10205 if { (eval echo "$as_me:10205: \"$ac_link\"") >&5
10206   (eval $ac_link) 2>&5
10207   ac_status=$?
10208   echo "$as_me:10208: \$? = $ac_status" >&5
10209   (exit $ac_status); } &&
10210          { ac_try='test -s conftest$ac_exeext'
10211   { (eval echo "$as_me:10211: \"$ac_try\"") >&5
10212   (eval $ac_try) 2>&5
10213   ac_status=$?
10214   echo "$as_me:10214: \$? = $ac_status" >&5
10215   (exit $ac_status); }; }; then
10216   LIBS=$ac_save_LIBS
10217 # We can link X programs with no special library path.
10218 ac_x_libraries=
10219 else
10220   echo "$as_me: failed program was:" >&5
10221 cat conftest.$ac_ext >&5
10222 LIBS=$ac_save_LIBS
10223 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10224 do
10225   # Don't even attempt the hair of trying to link an X program!
10226   for ac_extension in a so sl dylib dll; do
10227     if test -r $ac_dir/libXt.$ac_extension; then
10228       ac_x_libraries=$ac_dir
10229       break 2
10230     fi
10231   done
10232 done
10233 fi
10234 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10235 fi # $ac_x_libraries = no
10236
10237 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10238   # Didn't find X anywhere.  Cache the known absence of X.
10239   ac_cv_have_x="have_x=no"
10240 else
10241   # Record where we found X for the cache.
10242   ac_cv_have_x="have_x=yes \
10243                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10244 fi
10245 fi
10246
10247   fi
10248   eval "$ac_cv_have_x"
10249 fi # $with_x != no
10250
10251 if test "$have_x" != yes; then
10252   echo "$as_me:10252: result: $have_x" >&5
10253 echo "${ECHO_T}$have_x" >&6
10254   no_x=yes
10255 else
10256   # If each of the values was on the command line, it overrides each guess.
10257   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10258   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10259   # Update the cache value to reflect the command line values.
10260   ac_cv_have_x="have_x=yes \
10261                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10262   echo "$as_me:10262: result: libraries $x_libraries, headers $x_includes" >&5
10263 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10264 fi
10265
10266 if test "$no_x" = yes; then
10267   # Not all programs may use this symbol, but it does not hurt to define it.
10268
10269 cat >>confdefs.h <<\EOF
10270 #define X_DISPLAY_MISSING 1
10271 EOF
10272
10273   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10274 else
10275   if test -n "$x_includes"; then
10276     X_CFLAGS="$X_CFLAGS -I$x_includes"
10277   fi
10278
10279   # It would also be nice to do this for all -L options, not just this one.
10280   if test -n "$x_libraries"; then
10281     X_LIBS="$X_LIBS -L$x_libraries"
10282     # For Solaris; some versions of Sun CC require a space after -R and
10283     # others require no space.  Words are not sufficient . . . .
10284     case `(uname -sr) 2>/dev/null` in
10285     "SunOS 5"*)
10286       echo "$as_me:10286: checking whether -R must be followed by a space" >&5
10287 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10288       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10289       cat >conftest.$ac_ext <<_ACEOF
10290 #line 10290 "configure"
10291 #include "confdefs.h"
10292
10293 int
10294 main (void)
10295 {
10296
10297   ;
10298   return 0;
10299 }
10300 _ACEOF
10301 rm -f conftest.$ac_objext conftest$ac_exeext
10302 if { (eval echo "$as_me:10302: \"$ac_link\"") >&5
10303   (eval $ac_link) 2>&5
10304   ac_status=$?
10305   echo "$as_me:10305: \$? = $ac_status" >&5
10306   (exit $ac_status); } &&
10307          { ac_try='test -s conftest$ac_exeext'
10308   { (eval echo "$as_me:10308: \"$ac_try\"") >&5
10309   (eval $ac_try) 2>&5
10310   ac_status=$?
10311   echo "$as_me:10311: \$? = $ac_status" >&5
10312   (exit $ac_status); }; }; then
10313   ac_R_nospace=yes
10314 else
10315   echo "$as_me: failed program was:" >&5
10316 cat conftest.$ac_ext >&5
10317 ac_R_nospace=no
10318 fi
10319 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10320       if test $ac_R_nospace = yes; then
10321         echo "$as_me:10321: result: no" >&5
10322 echo "${ECHO_T}no" >&6
10323         X_LIBS="$X_LIBS -R$x_libraries"
10324       else
10325         LIBS="$ac_xsave_LIBS -R $x_libraries"
10326         cat >conftest.$ac_ext <<_ACEOF
10327 #line 10327 "configure"
10328 #include "confdefs.h"
10329
10330 int
10331 main (void)
10332 {
10333
10334   ;
10335   return 0;
10336 }
10337 _ACEOF
10338 rm -f conftest.$ac_objext conftest$ac_exeext
10339 if { (eval echo "$as_me:10339: \"$ac_link\"") >&5
10340   (eval $ac_link) 2>&5
10341   ac_status=$?
10342   echo "$as_me:10342: \$? = $ac_status" >&5
10343   (exit $ac_status); } &&
10344          { ac_try='test -s conftest$ac_exeext'
10345   { (eval echo "$as_me:10345: \"$ac_try\"") >&5
10346   (eval $ac_try) 2>&5
10347   ac_status=$?
10348   echo "$as_me:10348: \$? = $ac_status" >&5
10349   (exit $ac_status); }; }; then
10350   ac_R_space=yes
10351 else
10352   echo "$as_me: failed program was:" >&5
10353 cat conftest.$ac_ext >&5
10354 ac_R_space=no
10355 fi
10356 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10357         if test $ac_R_space = yes; then
10358           echo "$as_me:10358: result: yes" >&5
10359 echo "${ECHO_T}yes" >&6
10360           X_LIBS="$X_LIBS -R $x_libraries"
10361         else
10362           echo "$as_me:10362: result: neither works" >&5
10363 echo "${ECHO_T}neither works" >&6
10364         fi
10365       fi
10366       LIBS=$ac_xsave_LIBS
10367     esac
10368   fi
10369
10370   # Check for system-dependent libraries X programs must link with.
10371   # Do this before checking for the system-independent R6 libraries
10372   # (-lICE), since we may need -lsocket or whatever for X linking.
10373
10374   if test "$ISC" = yes; then
10375     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10376   else
10377     # Martyn Johnson says this is needed for Ultrix, if the X
10378     # libraries were built with DECnet support.  And Karl Berry says
10379     # the Alpha needs dnet_stub (dnet does not exist).
10380     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10381     cat >conftest.$ac_ext <<_ACEOF
10382 #line 10382 "configure"
10383 #include "confdefs.h"
10384
10385 /* Override any gcc2 internal prototype to avoid an error.  */
10386 #ifdef __cplusplus
10387 extern "C"
10388 #endif
10389 /* We use char because int might match the return type of a gcc2
10390    builtin and then its argument prototype would still apply.  */
10391 char XOpenDisplay ();
10392 int
10393 main (void)
10394 {
10395 XOpenDisplay ();
10396   ;
10397   return 0;
10398 }
10399 _ACEOF
10400 rm -f conftest.$ac_objext conftest$ac_exeext
10401 if { (eval echo "$as_me:10401: \"$ac_link\"") >&5
10402   (eval $ac_link) 2>&5
10403   ac_status=$?
10404   echo "$as_me:10404: \$? = $ac_status" >&5
10405   (exit $ac_status); } &&
10406          { ac_try='test -s conftest$ac_exeext'
10407   { (eval echo "$as_me:10407: \"$ac_try\"") >&5
10408   (eval $ac_try) 2>&5
10409   ac_status=$?
10410   echo "$as_me:10410: \$? = $ac_status" >&5
10411   (exit $ac_status); }; }; then
10412   :
10413 else
10414   echo "$as_me: failed program was:" >&5
10415 cat conftest.$ac_ext >&5
10416 echo "$as_me:10416: checking for dnet_ntoa in -ldnet" >&5
10417 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10418 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10419   echo $ECHO_N "(cached) $ECHO_C" >&6
10420 else
10421   ac_check_lib_save_LIBS=$LIBS
10422 LIBS="-ldnet  $LIBS"
10423 cat >conftest.$ac_ext <<_ACEOF
10424 #line 10424 "configure"
10425 #include "confdefs.h"
10426
10427 /* Override any gcc2 internal prototype to avoid an error.  */
10428 #ifdef __cplusplus
10429 extern "C"
10430 #endif
10431 /* We use char because int might match the return type of a gcc2
10432    builtin and then its argument prototype would still apply.  */
10433 char dnet_ntoa ();
10434 int
10435 main (void)
10436 {
10437 dnet_ntoa ();
10438   ;
10439   return 0;
10440 }
10441 _ACEOF
10442 rm -f conftest.$ac_objext conftest$ac_exeext
10443 if { (eval echo "$as_me:10443: \"$ac_link\"") >&5
10444   (eval $ac_link) 2>&5
10445   ac_status=$?
10446   echo "$as_me:10446: \$? = $ac_status" >&5
10447   (exit $ac_status); } &&
10448          { ac_try='test -s conftest$ac_exeext'
10449   { (eval echo "$as_me:10449: \"$ac_try\"") >&5
10450   (eval $ac_try) 2>&5
10451   ac_status=$?
10452   echo "$as_me:10452: \$? = $ac_status" >&5
10453   (exit $ac_status); }; }; then
10454   ac_cv_lib_dnet_dnet_ntoa=yes
10455 else
10456   echo "$as_me: failed program was:" >&5
10457 cat conftest.$ac_ext >&5
10458 ac_cv_lib_dnet_dnet_ntoa=no
10459 fi
10460 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10461 LIBS=$ac_check_lib_save_LIBS
10462 fi
10463 echo "$as_me:10463: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10464 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10465 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10466   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10467 fi
10468
10469     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10470       echo "$as_me:10470: checking for dnet_ntoa in -ldnet_stub" >&5
10471 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10472 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10473   echo $ECHO_N "(cached) $ECHO_C" >&6
10474 else
10475   ac_check_lib_save_LIBS=$LIBS
10476 LIBS="-ldnet_stub  $LIBS"
10477 cat >conftest.$ac_ext <<_ACEOF
10478 #line 10478 "configure"
10479 #include "confdefs.h"
10480
10481 /* Override any gcc2 internal prototype to avoid an error.  */
10482 #ifdef __cplusplus
10483 extern "C"
10484 #endif
10485 /* We use char because int might match the return type of a gcc2
10486    builtin and then its argument prototype would still apply.  */
10487 char dnet_ntoa ();
10488 int
10489 main (void)
10490 {
10491 dnet_ntoa ();
10492   ;
10493   return 0;
10494 }
10495 _ACEOF
10496 rm -f conftest.$ac_objext conftest$ac_exeext
10497 if { (eval echo "$as_me:10497: \"$ac_link\"") >&5
10498   (eval $ac_link) 2>&5
10499   ac_status=$?
10500   echo "$as_me:10500: \$? = $ac_status" >&5
10501   (exit $ac_status); } &&
10502          { ac_try='test -s conftest$ac_exeext'
10503   { (eval echo "$as_me:10503: \"$ac_try\"") >&5
10504   (eval $ac_try) 2>&5
10505   ac_status=$?
10506   echo "$as_me:10506: \$? = $ac_status" >&5
10507   (exit $ac_status); }; }; then
10508   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10509 else
10510   echo "$as_me: failed program was:" >&5
10511 cat conftest.$ac_ext >&5
10512 ac_cv_lib_dnet_stub_dnet_ntoa=no
10513 fi
10514 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10515 LIBS=$ac_check_lib_save_LIBS
10516 fi
10517 echo "$as_me:10517: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10518 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10519 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10520   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10521 fi
10522
10523     fi
10524 fi
10525 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10526     LIBS="$ac_xsave_LIBS"
10527
10528     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10529     # to get the SysV transport functions.
10530     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10531     # needs -lnsl.
10532     # The nsl library prevents programs from opening the X display
10533     # on Irix 5.2, according to T.E. Dickey.
10534     # The functions gethostbyname, getservbyname, and inet_addr are
10535     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10536     echo "$as_me:10536: checking for gethostbyname" >&5
10537 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10538 if test "${ac_cv_func_gethostbyname+set}" = set; then
10539   echo $ECHO_N "(cached) $ECHO_C" >&6
10540 else
10541   cat >conftest.$ac_ext <<_ACEOF
10542 #line 10542 "configure"
10543 #include "confdefs.h"
10544 /* System header to define __stub macros and hopefully few prototypes,
10545     which can conflict with char gethostbyname (); below.  */
10546 #include <assert.h>
10547 /* Override any gcc2 internal prototype to avoid an error.  */
10548 #ifdef __cplusplus
10549 extern "C"
10550 #endif
10551 /* We use char because int might match the return type of a gcc2
10552    builtin and then its argument prototype would still apply.  */
10553 char gethostbyname ();
10554 char (*f) ();
10555
10556 int
10557 main (void)
10558 {
10559 /* The GNU C library defines this for functions which it implements
10560     to always fail with ENOSYS.  Some functions are actually named
10561     something starting with __ and the normal name is an alias.  */
10562 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10563 choke me
10564 #else
10565 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10566 #endif
10567
10568   ;
10569   return 0;
10570 }
10571 _ACEOF
10572 rm -f conftest.$ac_objext conftest$ac_exeext
10573 if { (eval echo "$as_me:10573: \"$ac_link\"") >&5
10574   (eval $ac_link) 2>&5
10575   ac_status=$?
10576   echo "$as_me:10576: \$? = $ac_status" >&5
10577   (exit $ac_status); } &&
10578          { ac_try='test -s conftest$ac_exeext'
10579   { (eval echo "$as_me:10579: \"$ac_try\"") >&5
10580   (eval $ac_try) 2>&5
10581   ac_status=$?
10582   echo "$as_me:10582: \$? = $ac_status" >&5
10583   (exit $ac_status); }; }; then
10584   ac_cv_func_gethostbyname=yes
10585 else
10586   echo "$as_me: failed program was:" >&5
10587 cat conftest.$ac_ext >&5
10588 ac_cv_func_gethostbyname=no
10589 fi
10590 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10591 fi
10592 echo "$as_me:10592: result: $ac_cv_func_gethostbyname" >&5
10593 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10594
10595     if test $ac_cv_func_gethostbyname = no; then
10596       echo "$as_me:10596: checking for gethostbyname in -lnsl" >&5
10597 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10598 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10599   echo $ECHO_N "(cached) $ECHO_C" >&6
10600 else
10601   ac_check_lib_save_LIBS=$LIBS
10602 LIBS="-lnsl  $LIBS"
10603 cat >conftest.$ac_ext <<_ACEOF
10604 #line 10604 "configure"
10605 #include "confdefs.h"
10606
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 gethostbyname ();
10614 int
10615 main (void)
10616 {
10617 gethostbyname ();
10618   ;
10619   return 0;
10620 }
10621 _ACEOF
10622 rm -f conftest.$ac_objext conftest$ac_exeext
10623 if { (eval echo "$as_me:10623: \"$ac_link\"") >&5
10624   (eval $ac_link) 2>&5
10625   ac_status=$?
10626   echo "$as_me:10626: \$? = $ac_status" >&5
10627   (exit $ac_status); } &&
10628          { ac_try='test -s conftest$ac_exeext'
10629   { (eval echo "$as_me:10629: \"$ac_try\"") >&5
10630   (eval $ac_try) 2>&5
10631   ac_status=$?
10632   echo "$as_me:10632: \$? = $ac_status" >&5
10633   (exit $ac_status); }; }; then
10634   ac_cv_lib_nsl_gethostbyname=yes
10635 else
10636   echo "$as_me: failed program was:" >&5
10637 cat conftest.$ac_ext >&5
10638 ac_cv_lib_nsl_gethostbyname=no
10639 fi
10640 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10641 LIBS=$ac_check_lib_save_LIBS
10642 fi
10643 echo "$as_me:10643: result: $ac_cv_lib_nsl_gethostbyname" >&5
10644 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10645 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10646   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10647 fi
10648
10649       if test $ac_cv_lib_nsl_gethostbyname = no; then
10650         echo "$as_me:10650: checking for gethostbyname in -lbsd" >&5
10651 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10652 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10653   echo $ECHO_N "(cached) $ECHO_C" >&6
10654 else
10655   ac_check_lib_save_LIBS=$LIBS
10656 LIBS="-lbsd  $LIBS"
10657 cat >conftest.$ac_ext <<_ACEOF
10658 #line 10658 "configure"
10659 #include "confdefs.h"
10660
10661 /* Override any gcc2 internal prototype to avoid an error.  */
10662 #ifdef __cplusplus
10663 extern "C"
10664 #endif
10665 /* We use char because int might match the return type of a gcc2
10666    builtin and then its argument prototype would still apply.  */
10667 char gethostbyname ();
10668 int
10669 main (void)
10670 {
10671 gethostbyname ();
10672   ;
10673   return 0;
10674 }
10675 _ACEOF
10676 rm -f conftest.$ac_objext conftest$ac_exeext
10677 if { (eval echo "$as_me:10677: \"$ac_link\"") >&5
10678   (eval $ac_link) 2>&5
10679   ac_status=$?
10680   echo "$as_me:10680: \$? = $ac_status" >&5
10681   (exit $ac_status); } &&
10682          { ac_try='test -s conftest$ac_exeext'
10683   { (eval echo "$as_me:10683: \"$ac_try\"") >&5
10684   (eval $ac_try) 2>&5
10685   ac_status=$?
10686   echo "$as_me:10686: \$? = $ac_status" >&5
10687   (exit $ac_status); }; }; then
10688   ac_cv_lib_bsd_gethostbyname=yes
10689 else
10690   echo "$as_me: failed program was:" >&5
10691 cat conftest.$ac_ext >&5
10692 ac_cv_lib_bsd_gethostbyname=no
10693 fi
10694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10695 LIBS=$ac_check_lib_save_LIBS
10696 fi
10697 echo "$as_me:10697: result: $ac_cv_lib_bsd_gethostbyname" >&5
10698 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10699 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10700   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10701 fi
10702
10703       fi
10704     fi
10705
10706     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10707     # socket/setsockopt and other routines are undefined under SCO ODT
10708     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10709     # on later versions), says Simon Leinen: it contains gethostby*
10710     # variants that don't use the nameserver (or something).  -lsocket
10711     # must be given before -lnsl if both are needed.  We assume that
10712     # if connect needs -lnsl, so does gethostbyname.
10713     echo "$as_me:10713: checking for connect" >&5
10714 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10715 if test "${ac_cv_func_connect+set}" = set; then
10716   echo $ECHO_N "(cached) $ECHO_C" >&6
10717 else
10718   cat >conftest.$ac_ext <<_ACEOF
10719 #line 10719 "configure"
10720 #include "confdefs.h"
10721 /* System header to define __stub macros and hopefully few prototypes,
10722     which can conflict with char connect (); below.  */
10723 #include <assert.h>
10724 /* Override any gcc2 internal prototype to avoid an error.  */
10725 #ifdef __cplusplus
10726 extern "C"
10727 #endif
10728 /* We use char because int might match the return type of a gcc2
10729    builtin and then its argument prototype would still apply.  */
10730 char connect ();
10731 char (*f) ();
10732
10733 int
10734 main (void)
10735 {
10736 /* The GNU C library defines this for functions which it implements
10737     to always fail with ENOSYS.  Some functions are actually named
10738     something starting with __ and the normal name is an alias.  */
10739 #if defined (__stub_connect) || defined (__stub___connect)
10740 choke me
10741 #else
10742 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10743 #endif
10744
10745   ;
10746   return 0;
10747 }
10748 _ACEOF
10749 rm -f conftest.$ac_objext conftest$ac_exeext
10750 if { (eval echo "$as_me:10750: \"$ac_link\"") >&5
10751   (eval $ac_link) 2>&5
10752   ac_status=$?
10753   echo "$as_me:10753: \$? = $ac_status" >&5
10754   (exit $ac_status); } &&
10755          { ac_try='test -s conftest$ac_exeext'
10756   { (eval echo "$as_me:10756: \"$ac_try\"") >&5
10757   (eval $ac_try) 2>&5
10758   ac_status=$?
10759   echo "$as_me:10759: \$? = $ac_status" >&5
10760   (exit $ac_status); }; }; then
10761   ac_cv_func_connect=yes
10762 else
10763   echo "$as_me: failed program was:" >&5
10764 cat conftest.$ac_ext >&5
10765 ac_cv_func_connect=no
10766 fi
10767 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10768 fi
10769 echo "$as_me:10769: result: $ac_cv_func_connect" >&5
10770 echo "${ECHO_T}$ac_cv_func_connect" >&6
10771
10772     if test $ac_cv_func_connect = no; then
10773       echo "$as_me:10773: checking for connect in -lsocket" >&5
10774 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10775 if test "${ac_cv_lib_socket_connect+set}" = set; then
10776   echo $ECHO_N "(cached) $ECHO_C" >&6
10777 else
10778   ac_check_lib_save_LIBS=$LIBS
10779 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10780 cat >conftest.$ac_ext <<_ACEOF
10781 #line 10781 "configure"
10782 #include "confdefs.h"
10783
10784 /* Override any gcc2 internal prototype to avoid an error.  */
10785 #ifdef __cplusplus
10786 extern "C"
10787 #endif
10788 /* We use char because int might match the return type of a gcc2
10789    builtin and then its argument prototype would still apply.  */
10790 char connect ();
10791 int
10792 main (void)
10793 {
10794 connect ();
10795   ;
10796   return 0;
10797 }
10798 _ACEOF
10799 rm -f conftest.$ac_objext conftest$ac_exeext
10800 if { (eval echo "$as_me:10800: \"$ac_link\"") >&5
10801   (eval $ac_link) 2>&5
10802   ac_status=$?
10803   echo "$as_me:10803: \$? = $ac_status" >&5
10804   (exit $ac_status); } &&
10805          { ac_try='test -s conftest$ac_exeext'
10806   { (eval echo "$as_me:10806: \"$ac_try\"") >&5
10807   (eval $ac_try) 2>&5
10808   ac_status=$?
10809   echo "$as_me:10809: \$? = $ac_status" >&5
10810   (exit $ac_status); }; }; then
10811   ac_cv_lib_socket_connect=yes
10812 else
10813   echo "$as_me: failed program was:" >&5
10814 cat conftest.$ac_ext >&5
10815 ac_cv_lib_socket_connect=no
10816 fi
10817 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10818 LIBS=$ac_check_lib_save_LIBS
10819 fi
10820 echo "$as_me:10820: result: $ac_cv_lib_socket_connect" >&5
10821 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10822 if test $ac_cv_lib_socket_connect = yes; then
10823   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10824 fi
10825
10826     fi
10827
10828     # Guillermo Gomez says -lposix is necessary on A/UX.
10829     echo "$as_me:10829: checking for remove" >&5
10830 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10831 if test "${ac_cv_func_remove+set}" = set; then
10832   echo $ECHO_N "(cached) $ECHO_C" >&6
10833 else
10834   cat >conftest.$ac_ext <<_ACEOF
10835 #line 10835 "configure"
10836 #include "confdefs.h"
10837 /* System header to define __stub macros and hopefully few prototypes,
10838     which can conflict with char remove (); below.  */
10839 #include <assert.h>
10840 /* Override any gcc2 internal prototype to avoid an error.  */
10841 #ifdef __cplusplus
10842 extern "C"
10843 #endif
10844 /* We use char because int might match the return type of a gcc2
10845    builtin and then its argument prototype would still apply.  */
10846 char remove ();
10847 char (*f) ();
10848
10849 int
10850 main (void)
10851 {
10852 /* The GNU C library defines this for functions which it implements
10853     to always fail with ENOSYS.  Some functions are actually named
10854     something starting with __ and the normal name is an alias.  */
10855 #if defined (__stub_remove) || defined (__stub___remove)
10856 choke me
10857 #else
10858 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10859 #endif
10860
10861   ;
10862   return 0;
10863 }
10864 _ACEOF
10865 rm -f conftest.$ac_objext conftest$ac_exeext
10866 if { (eval echo "$as_me:10866: \"$ac_link\"") >&5
10867   (eval $ac_link) 2>&5
10868   ac_status=$?
10869   echo "$as_me:10869: \$? = $ac_status" >&5
10870   (exit $ac_status); } &&
10871          { ac_try='test -s conftest$ac_exeext'
10872   { (eval echo "$as_me:10872: \"$ac_try\"") >&5
10873   (eval $ac_try) 2>&5
10874   ac_status=$?
10875   echo "$as_me:10875: \$? = $ac_status" >&5
10876   (exit $ac_status); }; }; then
10877   ac_cv_func_remove=yes
10878 else
10879   echo "$as_me: failed program was:" >&5
10880 cat conftest.$ac_ext >&5
10881 ac_cv_func_remove=no
10882 fi
10883 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10884 fi
10885 echo "$as_me:10885: result: $ac_cv_func_remove" >&5
10886 echo "${ECHO_T}$ac_cv_func_remove" >&6
10887
10888     if test $ac_cv_func_remove = no; then
10889       echo "$as_me:10889: checking for remove in -lposix" >&5
10890 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10891 if test "${ac_cv_lib_posix_remove+set}" = set; then
10892   echo $ECHO_N "(cached) $ECHO_C" >&6
10893 else
10894   ac_check_lib_save_LIBS=$LIBS
10895 LIBS="-lposix  $LIBS"
10896 cat >conftest.$ac_ext <<_ACEOF
10897 #line 10897 "configure"
10898 #include "confdefs.h"
10899
10900 /* Override any gcc2 internal prototype to avoid an error.  */
10901 #ifdef __cplusplus
10902 extern "C"
10903 #endif
10904 /* We use char because int might match the return type of a gcc2
10905    builtin and then its argument prototype would still apply.  */
10906 char remove ();
10907 int
10908 main (void)
10909 {
10910 remove ();
10911   ;
10912   return 0;
10913 }
10914 _ACEOF
10915 rm -f conftest.$ac_objext conftest$ac_exeext
10916 if { (eval echo "$as_me:10916: \"$ac_link\"") >&5
10917   (eval $ac_link) 2>&5
10918   ac_status=$?
10919   echo "$as_me:10919: \$? = $ac_status" >&5
10920   (exit $ac_status); } &&
10921          { ac_try='test -s conftest$ac_exeext'
10922   { (eval echo "$as_me:10922: \"$ac_try\"") >&5
10923   (eval $ac_try) 2>&5
10924   ac_status=$?
10925   echo "$as_me:10925: \$? = $ac_status" >&5
10926   (exit $ac_status); }; }; then
10927   ac_cv_lib_posix_remove=yes
10928 else
10929   echo "$as_me: failed program was:" >&5
10930 cat conftest.$ac_ext >&5
10931 ac_cv_lib_posix_remove=no
10932 fi
10933 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10934 LIBS=$ac_check_lib_save_LIBS
10935 fi
10936 echo "$as_me:10936: result: $ac_cv_lib_posix_remove" >&5
10937 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10938 if test $ac_cv_lib_posix_remove = yes; then
10939   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10940 fi
10941
10942     fi
10943
10944     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10945     echo "$as_me:10945: checking for shmat" >&5
10946 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10947 if test "${ac_cv_func_shmat+set}" = set; then
10948   echo $ECHO_N "(cached) $ECHO_C" >&6
10949 else
10950   cat >conftest.$ac_ext <<_ACEOF
10951 #line 10951 "configure"
10952 #include "confdefs.h"
10953 /* System header to define __stub macros and hopefully few prototypes,
10954     which can conflict with char shmat (); below.  */
10955 #include <assert.h>
10956 /* Override any gcc2 internal prototype to avoid an error.  */
10957 #ifdef __cplusplus
10958 extern "C"
10959 #endif
10960 /* We use char because int might match the return type of a gcc2
10961    builtin and then its argument prototype would still apply.  */
10962 char shmat ();
10963 char (*f) ();
10964
10965 int
10966 main (void)
10967 {
10968 /* The GNU C library defines this for functions which it implements
10969     to always fail with ENOSYS.  Some functions are actually named
10970     something starting with __ and the normal name is an alias.  */
10971 #if defined (__stub_shmat) || defined (__stub___shmat)
10972 choke me
10973 #else
10974 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10975 #endif
10976
10977   ;
10978   return 0;
10979 }
10980 _ACEOF
10981 rm -f conftest.$ac_objext conftest$ac_exeext
10982 if { (eval echo "$as_me:10982: \"$ac_link\"") >&5
10983   (eval $ac_link) 2>&5
10984   ac_status=$?
10985   echo "$as_me:10985: \$? = $ac_status" >&5
10986   (exit $ac_status); } &&
10987          { ac_try='test -s conftest$ac_exeext'
10988   { (eval echo "$as_me:10988: \"$ac_try\"") >&5
10989   (eval $ac_try) 2>&5
10990   ac_status=$?
10991   echo "$as_me:10991: \$? = $ac_status" >&5
10992   (exit $ac_status); }; }; then
10993   ac_cv_func_shmat=yes
10994 else
10995   echo "$as_me: failed program was:" >&5
10996 cat conftest.$ac_ext >&5
10997 ac_cv_func_shmat=no
10998 fi
10999 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11000 fi
11001 echo "$as_me:11001: result: $ac_cv_func_shmat" >&5
11002 echo "${ECHO_T}$ac_cv_func_shmat" >&6
11003
11004     if test $ac_cv_func_shmat = no; then
11005       echo "$as_me:11005: checking for shmat in -lipc" >&5
11006 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
11007 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
11008   echo $ECHO_N "(cached) $ECHO_C" >&6
11009 else
11010   ac_check_lib_save_LIBS=$LIBS
11011 LIBS="-lipc  $LIBS"
11012 cat >conftest.$ac_ext <<_ACEOF
11013 #line 11013 "configure"
11014 #include "confdefs.h"
11015
11016 /* Override any gcc2 internal prototype to avoid an error.  */
11017 #ifdef __cplusplus
11018 extern "C"
11019 #endif
11020 /* We use char because int might match the return type of a gcc2
11021    builtin and then its argument prototype would still apply.  */
11022 char shmat ();
11023 int
11024 main (void)
11025 {
11026 shmat ();
11027   ;
11028   return 0;
11029 }
11030 _ACEOF
11031 rm -f conftest.$ac_objext conftest$ac_exeext
11032 if { (eval echo "$as_me:11032: \"$ac_link\"") >&5
11033   (eval $ac_link) 2>&5
11034   ac_status=$?
11035   echo "$as_me:11035: \$? = $ac_status" >&5
11036   (exit $ac_status); } &&
11037          { ac_try='test -s conftest$ac_exeext'
11038   { (eval echo "$as_me:11038: \"$ac_try\"") >&5
11039   (eval $ac_try) 2>&5
11040   ac_status=$?
11041   echo "$as_me:11041: \$? = $ac_status" >&5
11042   (exit $ac_status); }; }; then
11043   ac_cv_lib_ipc_shmat=yes
11044 else
11045   echo "$as_me: failed program was:" >&5
11046 cat conftest.$ac_ext >&5
11047 ac_cv_lib_ipc_shmat=no
11048 fi
11049 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11050 LIBS=$ac_check_lib_save_LIBS
11051 fi
11052 echo "$as_me:11052: result: $ac_cv_lib_ipc_shmat" >&5
11053 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11054 if test $ac_cv_lib_ipc_shmat = yes; then
11055   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11056 fi
11057
11058     fi
11059   fi
11060
11061   # Check for libraries that X11R6 Xt/Xaw programs need.
11062   ac_save_LDFLAGS=$LDFLAGS
11063   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11064   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11065   # check for ICE first), but we must link in the order -lSM -lICE or
11066   # we get undefined symbols.  So assume we have SM if we have ICE.
11067   # These have to be linked with before -lX11, unlike the other
11068   # libraries we check for below, so use a different variable.
11069   # John Interrante, Karl Berry
11070   echo "$as_me:11070: checking for IceConnectionNumber in -lICE" >&5
11071 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11072 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11073   echo $ECHO_N "(cached) $ECHO_C" >&6
11074 else
11075   ac_check_lib_save_LIBS=$LIBS
11076 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11077 cat >conftest.$ac_ext <<_ACEOF
11078 #line 11078 "configure"
11079 #include "confdefs.h"
11080
11081 /* Override any gcc2 internal prototype to avoid an error.  */
11082 #ifdef __cplusplus
11083 extern "C"
11084 #endif
11085 /* We use char because int might match the return type of a gcc2
11086    builtin and then its argument prototype would still apply.  */
11087 char IceConnectionNumber ();
11088 int
11089 main (void)
11090 {
11091 IceConnectionNumber ();
11092   ;
11093   return 0;
11094 }
11095 _ACEOF
11096 rm -f conftest.$ac_objext conftest$ac_exeext
11097 if { (eval echo "$as_me:11097: \"$ac_link\"") >&5
11098   (eval $ac_link) 2>&5
11099   ac_status=$?
11100   echo "$as_me:11100: \$? = $ac_status" >&5
11101   (exit $ac_status); } &&
11102          { ac_try='test -s conftest$ac_exeext'
11103   { (eval echo "$as_me:11103: \"$ac_try\"") >&5
11104   (eval $ac_try) 2>&5
11105   ac_status=$?
11106   echo "$as_me:11106: \$? = $ac_status" >&5
11107   (exit $ac_status); }; }; then
11108   ac_cv_lib_ICE_IceConnectionNumber=yes
11109 else
11110   echo "$as_me: failed program was:" >&5
11111 cat conftest.$ac_ext >&5
11112 ac_cv_lib_ICE_IceConnectionNumber=no
11113 fi
11114 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11115 LIBS=$ac_check_lib_save_LIBS
11116 fi
11117 echo "$as_me:11117: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11118 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11119 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11120   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11121 fi
11122
11123   LDFLAGS=$ac_save_LDFLAGS
11124
11125 fi
11126
11127 cf_x_athena=${cf_x_athena:-Xaw}
11128
11129 echo "$as_me:11129: checking if you want to link with Xaw 3d library" >&5
11130 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11131 withval=
11132
11133 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11134 if test "${with_Xaw3d+set}" = set; then
11135   withval="$with_Xaw3d"
11136
11137 fi;
11138 if test "$withval" = yes ; then
11139         cf_x_athena=Xaw3d
11140         echo "$as_me:11140: result: yes" >&5
11141 echo "${ECHO_T}yes" >&6
11142 else
11143         echo "$as_me:11143: result: no" >&5
11144 echo "${ECHO_T}no" >&6
11145 fi
11146
11147 echo "$as_me:11147: checking if you want to link with Xaw 3d xft library" >&5
11148 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
11149 withval=
11150
11151 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
11152 if test "${with_Xaw3dxft+set}" = set; then
11153   withval="$with_Xaw3dxft"
11154
11155 fi;
11156 if test "$withval" = yes ; then
11157         cf_x_athena=Xaw3dxft
11158         echo "$as_me:11158: result: yes" >&5
11159 echo "${ECHO_T}yes" >&6
11160 else
11161         echo "$as_me:11161: result: no" >&5
11162 echo "${ECHO_T}no" >&6
11163 fi
11164
11165 echo "$as_me:11165: checking if you want to link with neXT Athena library" >&5
11166 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11167 withval=
11168
11169 # Check whether --with-neXtaw or --without-neXtaw was given.
11170 if test "${with_neXtaw+set}" = set; then
11171   withval="$with_neXtaw"
11172
11173 fi;
11174 if test "$withval" = yes ; then
11175         cf_x_athena=neXtaw
11176         echo "$as_me:11176: result: yes" >&5
11177 echo "${ECHO_T}yes" >&6
11178 else
11179         echo "$as_me:11179: result: no" >&5
11180 echo "${ECHO_T}no" >&6
11181 fi
11182
11183 echo "$as_me:11183: checking if you want to link with Athena-Plus library" >&5
11184 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11185 withval=
11186
11187 # Check whether --with-XawPlus or --without-XawPlus was given.
11188 if test "${with_XawPlus+set}" = set; then
11189   withval="$with_XawPlus"
11190
11191 fi;
11192 if test "$withval" = yes ; then
11193         cf_x_athena=XawPlus
11194         echo "$as_me:11194: result: yes" >&5
11195 echo "${ECHO_T}yes" >&6
11196 else
11197         echo "$as_me:11197: result: no" >&5
11198 echo "${ECHO_T}no" >&6
11199 fi
11200
11201 cf_x_athena_lib=""
11202
11203 if test "$PKG_CONFIG" != none ; then
11204         cf_athena_list=
11205         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11206         for cf_athena_pkg in \
11207                 $cf_athena_list \
11208                 ${cf_x_athena} \
11209                 ${cf_x_athena}-devel \
11210                 lib${cf_x_athena} \
11211                 lib${cf_x_athena}-devel
11212         do
11213
11214 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11215         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11216
11217 echo "${as_me:-configure}:11217: testing found package $cf_athena_pkg ..." 1>&5
11218
11219         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11220         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11221         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11222
11223 echo "${as_me:-configure}:11223: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11224
11225         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11226
11227 echo "${as_me:-configure}:11227: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11228
11229 cf_fix_cppflags=no
11230 cf_new_cflags=
11231 cf_new_cppflags=
11232 cf_new_extra_cppflags=
11233
11234 for cf_add_cflags in $cf_pkgconfig_incs
11235 do
11236 case $cf_fix_cppflags in
11237 (no)
11238         case $cf_add_cflags in
11239         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11240                 case $cf_add_cflags in
11241                 (-D*)
11242                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11243
11244                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11245                                 && test -z "${cf_tst_cflags}" \
11246                                 && cf_fix_cppflags=yes
11247
11248                         if test $cf_fix_cppflags = yes ; then
11249
11250         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11251         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11252
11253                                 continue
11254                         elif test "${cf_tst_cflags}" = "\"'" ; then
11255
11256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11258
11259                                 continue
11260                         fi
11261                         ;;
11262                 esac
11263                 case "$CPPFLAGS" in
11264                 (*$cf_add_cflags)
11265                         ;;
11266                 (*)
11267                         case $cf_add_cflags in
11268                         (-D*)
11269                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11270
11271 CPPFLAGS=`echo "$CPPFLAGS" | \
11272         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11273                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11274
11275                                 ;;
11276                         esac
11277
11278         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11279         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11280
11281                         ;;
11282                 esac
11283                 ;;
11284         (*)
11285
11286         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11287         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11288
11289                 ;;
11290         esac
11291         ;;
11292 (yes)
11293
11294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11296
11297         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11298
11299         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11300                 && test -z "${cf_tst_cflags}" \
11301                 && cf_fix_cppflags=no
11302         ;;
11303 esac
11304 done
11305
11306 if test -n "$cf_new_cflags" ; then
11307
11308         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11309         CFLAGS="${CFLAGS}$cf_new_cflags"
11310
11311 fi
11312
11313 if test -n "$cf_new_cppflags" ; then
11314
11315         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11316         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11317
11318 fi
11319
11320 if test -n "$cf_new_extra_cppflags" ; then
11321
11322         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11323         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11324
11325 fi
11326
11327 cf_add_libs="$cf_pkgconfig_libs"
11328 # Filter out duplicates - this happens with badly-designed ".pc" files...
11329 for cf_add_1lib in $LIBS
11330 do
11331         for cf_add_2lib in $cf_add_libs
11332         do
11333                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11334                 then
11335                         cf_add_1lib=
11336                         break
11337                 fi
11338         done
11339         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11340 done
11341 LIBS="$cf_add_libs"
11342
11343                         cf_x_athena_lib="$cf_pkgconfig_libs"
11344
11345 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11346
11347                         cat >>confdefs.h <<EOF
11348 #define $cf_x_athena_LIBS 1
11349 EOF
11350
11351         for cf_trim_lib in Xmu Xt X11
11352         do
11353                 case "$LIBS" in
11354                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11355                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11356                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11357
11358 echo "${as_me:-configure}:11358: testing ..trimmed $LIBS ..." 1>&5
11359
11360                         ;;
11361                 esac
11362         done
11363
11364 echo "$as_me:11364: checking for usable $cf_x_athena/Xmu package" >&5
11365 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11366 if test "${cf_cv_xaw_compat+set}" = set; then
11367   echo $ECHO_N "(cached) $ECHO_C" >&6
11368 else
11369
11370 cat >conftest.$ac_ext <<_ACEOF
11371 #line 11371 "configure"
11372 #include "confdefs.h"
11373
11374 #include <X11/Xmu/CharSet.h>
11375
11376 int
11377 main (void)
11378 {
11379
11380 int check = XmuCompareISOLatin1("big", "small")
11381
11382   ;
11383   return 0;
11384 }
11385 _ACEOF
11386 rm -f conftest.$ac_objext conftest$ac_exeext
11387 if { (eval echo "$as_me:11387: \"$ac_link\"") >&5
11388   (eval $ac_link) 2>&5
11389   ac_status=$?
11390   echo "$as_me:11390: \$? = $ac_status" >&5
11391   (exit $ac_status); } &&
11392          { ac_try='test -s conftest$ac_exeext'
11393   { (eval echo "$as_me:11393: \"$ac_try\"") >&5
11394   (eval $ac_try) 2>&5
11395   ac_status=$?
11396   echo "$as_me:11396: \$? = $ac_status" >&5
11397   (exit $ac_status); }; }; then
11398   cf_cv_xaw_compat=yes
11399 else
11400   echo "$as_me: failed program was:" >&5
11401 cat conftest.$ac_ext >&5
11402 cf_cv_xaw_compat=no
11403 fi
11404 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11405 fi
11406 echo "$as_me:11406: result: $cf_cv_xaw_compat" >&5
11407 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11408
11409                         if test "$cf_cv_xaw_compat" = no
11410                         then
11411                                 # workaround for broken ".pc" files...
11412                                 case "$cf_x_athena_lib" in
11413                                 (*-lXmu*)
11414                                         ;;
11415                                 (*)
11416                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11417
11418 echo "${as_me:-configure}:11418: testing work around broken package ..." 1>&5
11419
11420                                         cf_save_xmu="$LIBS"
11421                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11422
11423 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11424         test -n "$verbose" && echo "    found package xmu" 1>&6
11425
11426 echo "${as_me:-configure}:11426: testing found package xmu ..." 1>&5
11427
11428         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11429         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11430         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11431
11432 echo "${as_me:-configure}:11432: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11433
11434         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11435
11436 echo "${as_me:-configure}:11436: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11437
11438 cf_fix_cppflags=no
11439 cf_new_cflags=
11440 cf_new_cppflags=
11441 cf_new_extra_cppflags=
11442
11443 for cf_add_cflags in $cf_pkgconfig_incs
11444 do
11445 case $cf_fix_cppflags in
11446 (no)
11447         case $cf_add_cflags in
11448         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11449                 case $cf_add_cflags in
11450                 (-D*)
11451                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11452
11453                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11454                                 && test -z "${cf_tst_cflags}" \
11455                                 && cf_fix_cppflags=yes
11456
11457                         if test $cf_fix_cppflags = yes ; then
11458
11459         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11460         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11461
11462                                 continue
11463                         elif test "${cf_tst_cflags}" = "\"'" ; then
11464
11465         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11466         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11467
11468                                 continue
11469                         fi
11470                         ;;
11471                 esac
11472                 case "$CPPFLAGS" in
11473                 (*$cf_add_cflags)
11474                         ;;
11475                 (*)
11476                         case $cf_add_cflags in
11477                         (-D*)
11478                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11479
11480 CPPFLAGS=`echo "$CPPFLAGS" | \
11481         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11482                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11483
11484                                 ;;
11485                         esac
11486
11487         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11488         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11489
11490                         ;;
11491                 esac
11492                 ;;
11493         (*)
11494
11495         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11496         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11497
11498                 ;;
11499         esac
11500         ;;
11501 (yes)
11502
11503         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11504         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11505
11506         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11507
11508         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11509                 && test -z "${cf_tst_cflags}" \
11510                 && cf_fix_cppflags=no
11511         ;;
11512 esac
11513 done
11514
11515 if test -n "$cf_new_cflags" ; then
11516
11517         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11518         CFLAGS="${CFLAGS}$cf_new_cflags"
11519
11520 fi
11521
11522 if test -n "$cf_new_cppflags" ; then
11523
11524         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11525         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11526
11527 fi
11528
11529 if test -n "$cf_new_extra_cppflags" ; then
11530
11531         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11532         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11533
11534 fi
11535
11536 cf_add_libs="$cf_pkgconfig_libs"
11537 # Filter out duplicates - this happens with badly-designed ".pc" files...
11538 for cf_add_1lib in $LIBS
11539 do
11540         for cf_add_2lib in $cf_add_libs
11541         do
11542                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11543                 then
11544                         cf_add_1lib=
11545                         break
11546                 fi
11547         done
11548         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11549 done
11550 LIBS="$cf_add_libs"
11551
11552                                                         LIBS="$cf_save_xmu"
11553
11554 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11555
11556 echo "${as_me:-configure}:11556: testing ...before $LIBS ..." 1>&5
11557
11558 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11559 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11560
11561 echo "${as_me:-configure}:11561: testing ...after  $LIBS ..." 1>&5
11562
11563 else
11564         cf_pkgconfig_incs=
11565         cf_pkgconfig_libs=
11566
11567 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11568
11569 echo "${as_me:-configure}:11569: testing ...before $LIBS ..." 1>&5
11570
11571 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11572 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11573
11574 echo "${as_me:-configure}:11574: testing ...after  $LIBS ..." 1>&5
11575
11576 fi
11577
11578         for cf_trim_lib in Xmu Xt X11
11579         do
11580                 case "$LIBS" in
11581                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11582                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11583                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11584
11585 echo "${as_me:-configure}:11585: testing ..trimmed $LIBS ..." 1>&5
11586
11587                         ;;
11588                 esac
11589         done
11590
11591                                         ;;
11592                                 esac
11593                         fi
11594
11595                         break
11596 else
11597         cf_pkgconfig_incs=
11598         cf_pkgconfig_libs=
11599         :
11600 fi
11601
11602         done
11603 fi
11604
11605 if test -z "$cf_x_athena_lib" ; then
11606
11607 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11608         test -n "$verbose" && echo "    found package Xext" 1>&6
11609
11610 echo "${as_me:-configure}:11610: testing found package Xext ..." 1>&5
11611
11612         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11613         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11614         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11615
11616 echo "${as_me:-configure}:11616: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11617
11618         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11619
11620 echo "${as_me:-configure}:11620: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11621
11622 cf_fix_cppflags=no
11623 cf_new_cflags=
11624 cf_new_cppflags=
11625 cf_new_extra_cppflags=
11626
11627 for cf_add_cflags in $cf_pkgconfig_incs
11628 do
11629 case $cf_fix_cppflags in
11630 (no)
11631         case $cf_add_cflags in
11632         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11633                 case $cf_add_cflags in
11634                 (-D*)
11635                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11636
11637                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11638                                 && test -z "${cf_tst_cflags}" \
11639                                 && cf_fix_cppflags=yes
11640
11641                         if test $cf_fix_cppflags = yes ; then
11642
11643         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11644         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11645
11646                                 continue
11647                         elif test "${cf_tst_cflags}" = "\"'" ; then
11648
11649         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11650         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11651
11652                                 continue
11653                         fi
11654                         ;;
11655                 esac
11656                 case "$CPPFLAGS" in
11657                 (*$cf_add_cflags)
11658                         ;;
11659                 (*)
11660                         case $cf_add_cflags in
11661                         (-D*)
11662                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11663
11664 CPPFLAGS=`echo "$CPPFLAGS" | \
11665         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11666                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11667
11668                                 ;;
11669                         esac
11670
11671         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11672         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11673
11674                         ;;
11675                 esac
11676                 ;;
11677         (*)
11678
11679         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11680         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11681
11682                 ;;
11683         esac
11684         ;;
11685 (yes)
11686
11687         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11688         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11689
11690         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11691
11692         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11693                 && test -z "${cf_tst_cflags}" \
11694                 && cf_fix_cppflags=no
11695         ;;
11696 esac
11697 done
11698
11699 if test -n "$cf_new_cflags" ; then
11700
11701         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11702         CFLAGS="${CFLAGS}$cf_new_cflags"
11703
11704 fi
11705
11706 if test -n "$cf_new_cppflags" ; then
11707
11708         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11709         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11710
11711 fi
11712
11713 if test -n "$cf_new_extra_cppflags" ; then
11714
11715         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11716         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11717
11718 fi
11719
11720 cf_add_libs="$cf_pkgconfig_libs"
11721 # Filter out duplicates - this happens with badly-designed ".pc" files...
11722 for cf_add_1lib in $LIBS
11723 do
11724         for cf_add_2lib in $cf_add_libs
11725         do
11726                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11727                 then
11728                         cf_add_1lib=
11729                         break
11730                 fi
11731         done
11732         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11733 done
11734 LIBS="$cf_add_libs"
11735
11736         :
11737 else
11738         cf_pkgconfig_incs=
11739         cf_pkgconfig_libs=
11740
11741         echo "$as_me:11741: checking for XextCreateExtension in -lXext" >&5
11742 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11743 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11744   echo $ECHO_N "(cached) $ECHO_C" >&6
11745 else
11746   ac_check_lib_save_LIBS=$LIBS
11747 LIBS="-lXext  $LIBS"
11748 cat >conftest.$ac_ext <<_ACEOF
11749 #line 11749 "configure"
11750 #include "confdefs.h"
11751
11752 /* Override any gcc2 internal prototype to avoid an error.  */
11753 #ifdef __cplusplus
11754 extern "C"
11755 #endif
11756 /* We use char because int might match the return type of a gcc2
11757    builtin and then its argument prototype would still apply.  */
11758 char XextCreateExtension ();
11759 int
11760 main (void)
11761 {
11762 XextCreateExtension ();
11763   ;
11764   return 0;
11765 }
11766 _ACEOF
11767 rm -f conftest.$ac_objext conftest$ac_exeext
11768 if { (eval echo "$as_me:11768: \"$ac_link\"") >&5
11769   (eval $ac_link) 2>&5
11770   ac_status=$?
11771   echo "$as_me:11771: \$? = $ac_status" >&5
11772   (exit $ac_status); } &&
11773          { ac_try='test -s conftest$ac_exeext'
11774   { (eval echo "$as_me:11774: \"$ac_try\"") >&5
11775   (eval $ac_try) 2>&5
11776   ac_status=$?
11777   echo "$as_me:11777: \$? = $ac_status" >&5
11778   (exit $ac_status); }; }; then
11779   ac_cv_lib_Xext_XextCreateExtension=yes
11780 else
11781   echo "$as_me: failed program was:" >&5
11782 cat conftest.$ac_ext >&5
11783 ac_cv_lib_Xext_XextCreateExtension=no
11784 fi
11785 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11786 LIBS=$ac_check_lib_save_LIBS
11787 fi
11788 echo "$as_me:11788: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11789 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11790 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11791
11792 cf_add_libs="-lXext"
11793 # Filter out duplicates - this happens with badly-designed ".pc" files...
11794 for cf_add_1lib in $LIBS
11795 do
11796         for cf_add_2lib in $cf_add_libs
11797         do
11798                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11799                 then
11800                         cf_add_1lib=
11801                         break
11802                 fi
11803         done
11804         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11805 done
11806 LIBS="$cf_add_libs"
11807
11808 fi
11809
11810 fi
11811
11812 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11813 # in some cases has installed dummy files in the former, other cases replaced
11814 # it with a link to the new location).  This complicates the configure script.
11815 # Check for that pitfall, and recover using pkg-config
11816 #
11817 # If none of these are set, the configuration is almost certainly broken.
11818 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11819 then
11820
11821 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11822         test -n "$verbose" && echo "    found package x11" 1>&6
11823
11824 echo "${as_me:-configure}:11824: testing found package x11 ..." 1>&5
11825
11826         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11827         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11828         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11829
11830 echo "${as_me:-configure}:11830: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11831
11832         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11833
11834 echo "${as_me:-configure}:11834: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11835
11836 cf_fix_cppflags=no
11837 cf_new_cflags=
11838 cf_new_cppflags=
11839 cf_new_extra_cppflags=
11840
11841 for cf_add_cflags in $cf_pkgconfig_incs
11842 do
11843 case $cf_fix_cppflags in
11844 (no)
11845         case $cf_add_cflags in
11846         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11847                 case $cf_add_cflags in
11848                 (-D*)
11849                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11850
11851                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11852                                 && test -z "${cf_tst_cflags}" \
11853                                 && cf_fix_cppflags=yes
11854
11855                         if test $cf_fix_cppflags = yes ; then
11856
11857         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11858         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11859
11860                                 continue
11861                         elif test "${cf_tst_cflags}" = "\"'" ; then
11862
11863         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11864         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11865
11866                                 continue
11867                         fi
11868                         ;;
11869                 esac
11870                 case "$CPPFLAGS" in
11871                 (*$cf_add_cflags)
11872                         ;;
11873                 (*)
11874                         case $cf_add_cflags in
11875                         (-D*)
11876                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11877
11878 CPPFLAGS=`echo "$CPPFLAGS" | \
11879         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11880                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11881
11882                                 ;;
11883                         esac
11884
11885         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11886         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11887
11888                         ;;
11889                 esac
11890                 ;;
11891         (*)
11892
11893         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11894         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11895
11896                 ;;
11897         esac
11898         ;;
11899 (yes)
11900
11901         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11902         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11903
11904         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11905
11906         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11907                 && test -z "${cf_tst_cflags}" \
11908                 && cf_fix_cppflags=no
11909         ;;
11910 esac
11911 done
11912
11913 if test -n "$cf_new_cflags" ; then
11914
11915         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11916         CFLAGS="${CFLAGS}$cf_new_cflags"
11917
11918 fi
11919
11920 if test -n "$cf_new_cppflags" ; then
11921
11922         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11923         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11924
11925 fi
11926
11927 if test -n "$cf_new_extra_cppflags" ; then
11928
11929         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11930         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11931
11932 fi
11933
11934 cf_add_libs="$cf_pkgconfig_libs"
11935 # Filter out duplicates - this happens with badly-designed ".pc" files...
11936 for cf_add_1lib in $LIBS
11937 do
11938         for cf_add_2lib in $cf_add_libs
11939         do
11940                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11941                 then
11942                         cf_add_1lib=
11943                         break
11944                 fi
11945         done
11946         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11947 done
11948 LIBS="$cf_add_libs"
11949
11950         :
11951 else
11952         cf_pkgconfig_incs=
11953         cf_pkgconfig_libs=
11954         { echo "$as_me:11954: WARNING: unable to find X11 library" >&5
11955 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11956 fi
11957
11958 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11959         test -n "$verbose" && echo "    found package ice" 1>&6
11960
11961 echo "${as_me:-configure}:11961: testing found package ice ..." 1>&5
11962
11963         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11964         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11965         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11966
11967 echo "${as_me:-configure}:11967: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11968
11969         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11970
11971 echo "${as_me:-configure}:11971: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11972
11973 cf_fix_cppflags=no
11974 cf_new_cflags=
11975 cf_new_cppflags=
11976 cf_new_extra_cppflags=
11977
11978 for cf_add_cflags in $cf_pkgconfig_incs
11979 do
11980 case $cf_fix_cppflags in
11981 (no)
11982         case $cf_add_cflags in
11983         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11984                 case $cf_add_cflags in
11985                 (-D*)
11986                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11987
11988                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11989                                 && test -z "${cf_tst_cflags}" \
11990                                 && cf_fix_cppflags=yes
11991
11992                         if test $cf_fix_cppflags = yes ; then
11993
11994         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11995         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11996
11997                                 continue
11998                         elif test "${cf_tst_cflags}" = "\"'" ; then
11999
12000         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12001         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12002
12003                                 continue
12004                         fi
12005                         ;;
12006                 esac
12007                 case "$CPPFLAGS" in
12008                 (*$cf_add_cflags)
12009                         ;;
12010                 (*)
12011                         case $cf_add_cflags in
12012                         (-D*)
12013                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12014
12015 CPPFLAGS=`echo "$CPPFLAGS" | \
12016         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12017                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12018
12019                                 ;;
12020                         esac
12021
12022         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12023         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12024
12025                         ;;
12026                 esac
12027                 ;;
12028         (*)
12029
12030         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12031         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12032
12033                 ;;
12034         esac
12035         ;;
12036 (yes)
12037
12038         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12039         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12040
12041         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12042
12043         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12044                 && test -z "${cf_tst_cflags}" \
12045                 && cf_fix_cppflags=no
12046         ;;
12047 esac
12048 done
12049
12050 if test -n "$cf_new_cflags" ; then
12051
12052         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12053         CFLAGS="${CFLAGS}$cf_new_cflags"
12054
12055 fi
12056
12057 if test -n "$cf_new_cppflags" ; then
12058
12059         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12060         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12061
12062 fi
12063
12064 if test -n "$cf_new_extra_cppflags" ; then
12065
12066         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12067         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12068
12069 fi
12070
12071 cf_add_libs="$cf_pkgconfig_libs"
12072 # Filter out duplicates - this happens with badly-designed ".pc" files...
12073 for cf_add_1lib in $LIBS
12074 do
12075         for cf_add_2lib in $cf_add_libs
12076         do
12077                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12078                 then
12079                         cf_add_1lib=
12080                         break
12081                 fi
12082         done
12083         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12084 done
12085 LIBS="$cf_add_libs"
12086
12087         :
12088 else
12089         cf_pkgconfig_incs=
12090         cf_pkgconfig_libs=
12091         { echo "$as_me:12091: WARNING: unable to find ICE library" >&5
12092 echo "$as_me: WARNING: unable to find ICE library" >&2;}
12093 fi
12094
12095 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12096         test -n "$verbose" && echo "    found package sm" 1>&6
12097
12098 echo "${as_me:-configure}:12098: testing found package sm ..." 1>&5
12099
12100         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12101         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12102         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12103
12104 echo "${as_me:-configure}:12104: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12105
12106         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12107
12108 echo "${as_me:-configure}:12108: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12109
12110 cf_fix_cppflags=no
12111 cf_new_cflags=
12112 cf_new_cppflags=
12113 cf_new_extra_cppflags=
12114
12115 for cf_add_cflags in $cf_pkgconfig_incs
12116 do
12117 case $cf_fix_cppflags in
12118 (no)
12119         case $cf_add_cflags in
12120         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12121                 case $cf_add_cflags in
12122                 (-D*)
12123                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12124
12125                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12126                                 && test -z "${cf_tst_cflags}" \
12127                                 && cf_fix_cppflags=yes
12128
12129                         if test $cf_fix_cppflags = yes ; then
12130
12131         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12132         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12133
12134                                 continue
12135                         elif test "${cf_tst_cflags}" = "\"'" ; then
12136
12137         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12138         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12139
12140                                 continue
12141                         fi
12142                         ;;
12143                 esac
12144                 case "$CPPFLAGS" in
12145                 (*$cf_add_cflags)
12146                         ;;
12147                 (*)
12148                         case $cf_add_cflags in
12149                         (-D*)
12150                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12151
12152 CPPFLAGS=`echo "$CPPFLAGS" | \
12153         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12154                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12155
12156                                 ;;
12157                         esac
12158
12159         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12160         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12161
12162                         ;;
12163                 esac
12164                 ;;
12165         (*)
12166
12167         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12168         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12169
12170                 ;;
12171         esac
12172         ;;
12173 (yes)
12174
12175         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12176         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12177
12178         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12179
12180         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12181                 && test -z "${cf_tst_cflags}" \
12182                 && cf_fix_cppflags=no
12183         ;;
12184 esac
12185 done
12186
12187 if test -n "$cf_new_cflags" ; then
12188
12189         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12190         CFLAGS="${CFLAGS}$cf_new_cflags"
12191
12192 fi
12193
12194 if test -n "$cf_new_cppflags" ; then
12195
12196         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12197         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12198
12199 fi
12200
12201 if test -n "$cf_new_extra_cppflags" ; then
12202
12203         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12204         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12205
12206 fi
12207
12208 cf_add_libs="$cf_pkgconfig_libs"
12209 # Filter out duplicates - this happens with badly-designed ".pc" files...
12210 for cf_add_1lib in $LIBS
12211 do
12212         for cf_add_2lib in $cf_add_libs
12213         do
12214                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12215                 then
12216                         cf_add_1lib=
12217                         break
12218                 fi
12219         done
12220         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12221 done
12222 LIBS="$cf_add_libs"
12223
12224         :
12225 else
12226         cf_pkgconfig_incs=
12227         cf_pkgconfig_libs=
12228         { echo "$as_me:12228: WARNING: unable to find SM library" >&5
12229 echo "$as_me: WARNING: unable to find SM library" >&2;}
12230 fi
12231
12232 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12233         test -n "$verbose" && echo "    found package xt" 1>&6
12234
12235 echo "${as_me:-configure}:12235: testing found package xt ..." 1>&5
12236
12237         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12238         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12239         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12240
12241 echo "${as_me:-configure}:12241: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12242
12243         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12244
12245 echo "${as_me:-configure}:12245: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12246
12247 cf_fix_cppflags=no
12248 cf_new_cflags=
12249 cf_new_cppflags=
12250 cf_new_extra_cppflags=
12251
12252 for cf_add_cflags in $cf_pkgconfig_incs
12253 do
12254 case $cf_fix_cppflags in
12255 (no)
12256         case $cf_add_cflags in
12257         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12258                 case $cf_add_cflags in
12259                 (-D*)
12260                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12261
12262                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12263                                 && test -z "${cf_tst_cflags}" \
12264                                 && cf_fix_cppflags=yes
12265
12266                         if test $cf_fix_cppflags = yes ; then
12267
12268         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12269         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12270
12271                                 continue
12272                         elif test "${cf_tst_cflags}" = "\"'" ; then
12273
12274         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12275         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12276
12277                                 continue
12278                         fi
12279                         ;;
12280                 esac
12281                 case "$CPPFLAGS" in
12282                 (*$cf_add_cflags)
12283                         ;;
12284                 (*)
12285                         case $cf_add_cflags in
12286                         (-D*)
12287                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12288
12289 CPPFLAGS=`echo "$CPPFLAGS" | \
12290         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12291                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12292
12293                                 ;;
12294                         esac
12295
12296         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12297         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12298
12299                         ;;
12300                 esac
12301                 ;;
12302         (*)
12303
12304         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12305         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12306
12307                 ;;
12308         esac
12309         ;;
12310 (yes)
12311
12312         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12313         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12314
12315         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12316
12317         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12318                 && test -z "${cf_tst_cflags}" \
12319                 && cf_fix_cppflags=no
12320         ;;
12321 esac
12322 done
12323
12324 if test -n "$cf_new_cflags" ; then
12325
12326         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12327         CFLAGS="${CFLAGS}$cf_new_cflags"
12328
12329 fi
12330
12331 if test -n "$cf_new_cppflags" ; then
12332
12333         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12334         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12335
12336 fi
12337
12338 if test -n "$cf_new_extra_cppflags" ; then
12339
12340         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12341         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12342
12343 fi
12344
12345 cf_add_libs="$cf_pkgconfig_libs"
12346 # Filter out duplicates - this happens with badly-designed ".pc" files...
12347 for cf_add_1lib in $LIBS
12348 do
12349         for cf_add_2lib in $cf_add_libs
12350         do
12351                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12352                 then
12353                         cf_add_1lib=
12354                         break
12355                 fi
12356         done
12357         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12358 done
12359 LIBS="$cf_add_libs"
12360
12361         :
12362 else
12363         cf_pkgconfig_incs=
12364         cf_pkgconfig_libs=
12365         { echo "$as_me:12365: WARNING: unable to find Xt library" >&5
12366 echo "$as_me: WARNING: unable to find Xt library" >&2;}
12367 fi
12368
12369 fi
12370
12371 cf_have_X_LIBS=no
12372
12373 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12374         test -n "$verbose" && echo "    found package xt" 1>&6
12375
12376 echo "${as_me:-configure}:12376: testing found package xt ..." 1>&5
12377
12378         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12379         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12380         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12381
12382 echo "${as_me:-configure}:12382: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12383
12384         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12385
12386 echo "${as_me:-configure}:12386: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12387
12388 cf_fix_cppflags=no
12389 cf_new_cflags=
12390 cf_new_cppflags=
12391 cf_new_extra_cppflags=
12392
12393 for cf_add_cflags in $cf_pkgconfig_incs
12394 do
12395 case $cf_fix_cppflags in
12396 (no)
12397         case $cf_add_cflags in
12398         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12399                 case $cf_add_cflags in
12400                 (-D*)
12401                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12402
12403                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12404                                 && test -z "${cf_tst_cflags}" \
12405                                 && cf_fix_cppflags=yes
12406
12407                         if test $cf_fix_cppflags = yes ; then
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                                 continue
12413                         elif test "${cf_tst_cflags}" = "\"'" ; then
12414
12415         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12416         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12417
12418                                 continue
12419                         fi
12420                         ;;
12421                 esac
12422                 case "$CPPFLAGS" in
12423                 (*$cf_add_cflags)
12424                         ;;
12425                 (*)
12426                         case $cf_add_cflags in
12427                         (-D*)
12428                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12429
12430 CPPFLAGS=`echo "$CPPFLAGS" | \
12431         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12432                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12433
12434                                 ;;
12435                         esac
12436
12437         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12438         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12439
12440                         ;;
12441                 esac
12442                 ;;
12443         (*)
12444
12445         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12446         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12447
12448                 ;;
12449         esac
12450         ;;
12451 (yes)
12452
12453         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12454         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12455
12456         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12457
12458         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12459                 && test -z "${cf_tst_cflags}" \
12460                 && cf_fix_cppflags=no
12461         ;;
12462 esac
12463 done
12464
12465 if test -n "$cf_new_cflags" ; then
12466
12467         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12468         CFLAGS="${CFLAGS}$cf_new_cflags"
12469
12470 fi
12471
12472 if test -n "$cf_new_cppflags" ; then
12473
12474         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12475         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12476
12477 fi
12478
12479 if test -n "$cf_new_extra_cppflags" ; then
12480
12481         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12482         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12483
12484 fi
12485
12486 cf_add_libs="$cf_pkgconfig_libs"
12487 # Filter out duplicates - this happens with badly-designed ".pc" files...
12488 for cf_add_1lib in $LIBS
12489 do
12490         for cf_add_2lib in $cf_add_libs
12491         do
12492                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12493                 then
12494                         cf_add_1lib=
12495                         break
12496                 fi
12497         done
12498         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12499 done
12500 LIBS="$cf_add_libs"
12501
12502         case "x$LIBS" in
12503         (*-lX11*)
12504                 ;;
12505         (*)
12506 # we have an "xt" package, but it may omit Xt's dependency on X11
12507 echo "$as_me:12507: checking for usable X dependency" >&5
12508 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
12509 if test "${cf_cv_xt_x11_compat+set}" = set; then
12510   echo $ECHO_N "(cached) $ECHO_C" >&6
12511 else
12512
12513 cat >conftest.$ac_ext <<_ACEOF
12514 #line 12514 "configure"
12515 #include "confdefs.h"
12516
12517 #include <X11/Xlib.h>
12518
12519 int
12520 main (void)
12521 {
12522
12523         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12524         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12525         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12526         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12527
12528   ;
12529   return 0;
12530 }
12531 _ACEOF
12532 rm -f conftest.$ac_objext conftest$ac_exeext
12533 if { (eval echo "$as_me:12533: \"$ac_link\"") >&5
12534   (eval $ac_link) 2>&5
12535   ac_status=$?
12536   echo "$as_me:12536: \$? = $ac_status" >&5
12537   (exit $ac_status); } &&
12538          { ac_try='test -s conftest$ac_exeext'
12539   { (eval echo "$as_me:12539: \"$ac_try\"") >&5
12540   (eval $ac_try) 2>&5
12541   ac_status=$?
12542   echo "$as_me:12542: \$? = $ac_status" >&5
12543   (exit $ac_status); }; }; then
12544   cf_cv_xt_x11_compat=yes
12545 else
12546   echo "$as_me: failed program was:" >&5
12547 cat conftest.$ac_ext >&5
12548 cf_cv_xt_x11_compat=no
12549 fi
12550 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12551 fi
12552 echo "$as_me:12552: result: $cf_cv_xt_x11_compat" >&5
12553 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12554                 if test "$cf_cv_xt_x11_compat" = no
12555                 then
12556                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12557
12558 echo "${as_me:-configure}:12558: testing work around broken X11 dependency ..." 1>&5
12559
12560                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12561
12562 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12563         test -n "$verbose" && echo "    found package x11" 1>&6
12564
12565 echo "${as_me:-configure}:12565: testing found package x11 ..." 1>&5
12566
12567         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12568         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12569         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12570
12571 echo "${as_me:-configure}:12571: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12572
12573         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12574
12575 echo "${as_me:-configure}:12575: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12576
12577 cf_fix_cppflags=no
12578 cf_new_cflags=
12579 cf_new_cppflags=
12580 cf_new_extra_cppflags=
12581
12582 for cf_add_cflags in $cf_pkgconfig_incs
12583 do
12584 case $cf_fix_cppflags in
12585 (no)
12586         case $cf_add_cflags in
12587         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12588                 case $cf_add_cflags in
12589                 (-D*)
12590                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12591
12592                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12593                                 && test -z "${cf_tst_cflags}" \
12594                                 && cf_fix_cppflags=yes
12595
12596                         if test $cf_fix_cppflags = yes ; then
12597
12598         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12599         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12600
12601                                 continue
12602                         elif test "${cf_tst_cflags}" = "\"'" ; then
12603
12604         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12605         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12606
12607                                 continue
12608                         fi
12609                         ;;
12610                 esac
12611                 case "$CPPFLAGS" in
12612                 (*$cf_add_cflags)
12613                         ;;
12614                 (*)
12615                         case $cf_add_cflags in
12616                         (-D*)
12617                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12618
12619 CPPFLAGS=`echo "$CPPFLAGS" | \
12620         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12621                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12622
12623                                 ;;
12624                         esac
12625
12626         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12627         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12628
12629                         ;;
12630                 esac
12631                 ;;
12632         (*)
12633
12634         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12635         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12636
12637                 ;;
12638         esac
12639         ;;
12640 (yes)
12641
12642         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12643         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12644
12645         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12646
12647         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12648                 && test -z "${cf_tst_cflags}" \
12649                 && cf_fix_cppflags=no
12650         ;;
12651 esac
12652 done
12653
12654 if test -n "$cf_new_cflags" ; then
12655
12656         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12657         CFLAGS="${CFLAGS}$cf_new_cflags"
12658
12659 fi
12660
12661 if test -n "$cf_new_cppflags" ; then
12662
12663         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12664         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12665
12666 fi
12667
12668 if test -n "$cf_new_extra_cppflags" ; then
12669
12670         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12671         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12672
12673 fi
12674
12675 cf_add_libs="$cf_pkgconfig_libs"
12676 # Filter out duplicates - this happens with badly-designed ".pc" files...
12677 for cf_add_1lib in $LIBS
12678 do
12679         for cf_add_2lib in $cf_add_libs
12680         do
12681                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12682                 then
12683                         cf_add_1lib=
12684                         break
12685                 fi
12686         done
12687         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12688 done
12689 LIBS="$cf_add_libs"
12690
12691         :
12692 else
12693         cf_pkgconfig_incs=
12694         cf_pkgconfig_libs=
12695
12696 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12697
12698 echo "${as_me:-configure}:12698: testing ...before $LIBS ..." 1>&5
12699
12700 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12701 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12702
12703 echo "${as_me:-configure}:12703: testing ...after  $LIBS ..." 1>&5
12704
12705 fi
12706
12707                 fi
12708                 ;;
12709         esac
12710
12711 echo "$as_me:12711: checking for usable X Toolkit package" >&5
12712 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12713 if test "${cf_cv_xt_ice_compat+set}" = set; then
12714   echo $ECHO_N "(cached) $ECHO_C" >&6
12715 else
12716
12717 cat >conftest.$ac_ext <<_ACEOF
12718 #line 12718 "configure"
12719 #include "confdefs.h"
12720
12721 #include <X11/Shell.h>
12722
12723 int
12724 main (void)
12725 {
12726 int num = IceConnectionNumber(0)
12727
12728   ;
12729   return 0;
12730 }
12731 _ACEOF
12732 rm -f conftest.$ac_objext conftest$ac_exeext
12733 if { (eval echo "$as_me:12733: \"$ac_link\"") >&5
12734   (eval $ac_link) 2>&5
12735   ac_status=$?
12736   echo "$as_me:12736: \$? = $ac_status" >&5
12737   (exit $ac_status); } &&
12738          { ac_try='test -s conftest$ac_exeext'
12739   { (eval echo "$as_me:12739: \"$ac_try\"") >&5
12740   (eval $ac_try) 2>&5
12741   ac_status=$?
12742   echo "$as_me:12742: \$? = $ac_status" >&5
12743   (exit $ac_status); }; }; then
12744   cf_cv_xt_ice_compat=yes
12745 else
12746   echo "$as_me: failed program was:" >&5
12747 cat conftest.$ac_ext >&5
12748 cf_cv_xt_ice_compat=no
12749 fi
12750 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12751 fi
12752 echo "$as_me:12752: result: $cf_cv_xt_ice_compat" >&5
12753 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12754
12755         if test "$cf_cv_xt_ice_compat" = no
12756         then
12757                 # workaround for broken ".pc" files used for X Toolkit.
12758                 case "x$X_PRE_LIBS" in
12759                 (*-lICE*)
12760                         case "x$LIBS" in
12761                         (*-lICE*)
12762                                 ;;
12763                         (*)
12764                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12765
12766 echo "${as_me:-configure}:12766: testing work around broken ICE dependency ..." 1>&5
12767
12768 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12769         test -n "$verbose" && echo "    found package ice" 1>&6
12770
12771 echo "${as_me:-configure}:12771: testing found package ice ..." 1>&5
12772
12773         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12774         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12775         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12776
12777 echo "${as_me:-configure}:12777: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12778
12779         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12780
12781 echo "${as_me:-configure}:12781: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12782
12783 cf_fix_cppflags=no
12784 cf_new_cflags=
12785 cf_new_cppflags=
12786 cf_new_extra_cppflags=
12787
12788 for cf_add_cflags in $cf_pkgconfig_incs
12789 do
12790 case $cf_fix_cppflags in
12791 (no)
12792         case $cf_add_cflags in
12793         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12794                 case $cf_add_cflags in
12795                 (-D*)
12796                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12797
12798                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12799                                 && test -z "${cf_tst_cflags}" \
12800                                 && cf_fix_cppflags=yes
12801
12802                         if test $cf_fix_cppflags = yes ; then
12803
12804         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12805         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12806
12807                                 continue
12808                         elif test "${cf_tst_cflags}" = "\"'" ; then
12809
12810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12812
12813                                 continue
12814                         fi
12815                         ;;
12816                 esac
12817                 case "$CPPFLAGS" in
12818                 (*$cf_add_cflags)
12819                         ;;
12820                 (*)
12821                         case $cf_add_cflags in
12822                         (-D*)
12823                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12824
12825 CPPFLAGS=`echo "$CPPFLAGS" | \
12826         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12827                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12828
12829                                 ;;
12830                         esac
12831
12832         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12833         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12834
12835                         ;;
12836                 esac
12837                 ;;
12838         (*)
12839
12840         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12841         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12842
12843                 ;;
12844         esac
12845         ;;
12846 (yes)
12847
12848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12850
12851         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12852
12853         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12854                 && test -z "${cf_tst_cflags}" \
12855                 && cf_fix_cppflags=no
12856         ;;
12857 esac
12858 done
12859
12860 if test -n "$cf_new_cflags" ; then
12861
12862         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12863         CFLAGS="${CFLAGS}$cf_new_cflags"
12864
12865 fi
12866
12867 if test -n "$cf_new_cppflags" ; then
12868
12869         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12870         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12871
12872 fi
12873
12874 if test -n "$cf_new_extra_cppflags" ; then
12875
12876         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12877         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12878
12879 fi
12880
12881 cf_add_libs="$cf_pkgconfig_libs"
12882 # Filter out duplicates - this happens with badly-designed ".pc" files...
12883 for cf_add_1lib in $LIBS
12884 do
12885         for cf_add_2lib in $cf_add_libs
12886         do
12887                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12888                 then
12889                         cf_add_1lib=
12890                         break
12891                 fi
12892         done
12893         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12894 done
12895 LIBS="$cf_add_libs"
12896
12897 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12898         test -n "$verbose" && echo "    found package sm" 1>&6
12899
12900 echo "${as_me:-configure}:12900: testing found package sm ..." 1>&5
12901
12902         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12903         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12904         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12905
12906 echo "${as_me:-configure}:12906: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12907
12908         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12909
12910 echo "${as_me:-configure}:12910: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12911
12912 cf_fix_cppflags=no
12913 cf_new_cflags=
12914 cf_new_cppflags=
12915 cf_new_extra_cppflags=
12916
12917 for cf_add_cflags in $cf_pkgconfig_incs
12918 do
12919 case $cf_fix_cppflags in
12920 (no)
12921         case $cf_add_cflags in
12922         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12923                 case $cf_add_cflags in
12924                 (-D*)
12925                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12926
12927                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12928                                 && test -z "${cf_tst_cflags}" \
12929                                 && cf_fix_cppflags=yes
12930
12931                         if test $cf_fix_cppflags = yes ; then
12932
12933         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12934         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12935
12936                                 continue
12937                         elif test "${cf_tst_cflags}" = "\"'" ; then
12938
12939         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12940         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12941
12942                                 continue
12943                         fi
12944                         ;;
12945                 esac
12946                 case "$CPPFLAGS" in
12947                 (*$cf_add_cflags)
12948                         ;;
12949                 (*)
12950                         case $cf_add_cflags in
12951                         (-D*)
12952                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12953
12954 CPPFLAGS=`echo "$CPPFLAGS" | \
12955         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12956                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12957
12958                                 ;;
12959                         esac
12960
12961         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12962         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12963
12964                         ;;
12965                 esac
12966                 ;;
12967         (*)
12968
12969         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12970         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12971
12972                 ;;
12973         esac
12974         ;;
12975 (yes)
12976
12977         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12978         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12979
12980         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12981
12982         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12983                 && test -z "${cf_tst_cflags}" \
12984                 && cf_fix_cppflags=no
12985         ;;
12986 esac
12987 done
12988
12989 if test -n "$cf_new_cflags" ; then
12990
12991         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12992         CFLAGS="${CFLAGS}$cf_new_cflags"
12993
12994 fi
12995
12996 if test -n "$cf_new_cppflags" ; then
12997
12998         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12999         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13000
13001 fi
13002
13003 if test -n "$cf_new_extra_cppflags" ; then
13004
13005         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13006         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13007
13008 fi
13009
13010 cf_add_libs="$cf_pkgconfig_libs"
13011 # Filter out duplicates - this happens with badly-designed ".pc" files...
13012 for cf_add_1lib in $LIBS
13013 do
13014         for cf_add_2lib in $cf_add_libs
13015         do
13016                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13017                 then
13018                         cf_add_1lib=
13019                         break
13020                 fi
13021         done
13022         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13023 done
13024 LIBS="$cf_add_libs"
13025
13026         :
13027 else
13028         cf_pkgconfig_incs=
13029         cf_pkgconfig_libs=
13030         :
13031 fi
13032
13033 else
13034         cf_pkgconfig_incs=
13035         cf_pkgconfig_libs=
13036
13037 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13038
13039 echo "${as_me:-configure}:13039: testing ...before $LIBS ..." 1>&5
13040
13041 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
13042 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13043
13044 echo "${as_me:-configure}:13044: testing ...after  $LIBS ..." 1>&5
13045
13046 fi
13047
13048                                 ;;
13049                         esac
13050                         ;;
13051                 esac
13052         fi
13053
13054         cf_have_X_LIBS=yes
13055
13056 else
13057         cf_pkgconfig_incs=
13058         cf_pkgconfig_libs=
13059
13060         LDFLAGS="$X_LIBS $LDFLAGS"
13061
13062 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13063
13064 echo "${as_me:-configure}:13064: testing checking additions to CFLAGS ..." 1>&5
13065
13066 cf_check_cflags="$CFLAGS"
13067 cf_check_cppflags="$CPPFLAGS"
13068
13069 cf_fix_cppflags=no
13070 cf_new_cflags=
13071 cf_new_cppflags=
13072 cf_new_extra_cppflags=
13073
13074 for cf_add_cflags in $X_CFLAGS
13075 do
13076 case $cf_fix_cppflags in
13077 (no)
13078         case $cf_add_cflags in
13079         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13080                 case $cf_add_cflags in
13081                 (-D*)
13082                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13083
13084                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13085                                 && test -z "${cf_tst_cflags}" \
13086                                 && cf_fix_cppflags=yes
13087
13088                         if test $cf_fix_cppflags = yes ; then
13089
13090         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13091         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13092
13093                                 continue
13094                         elif test "${cf_tst_cflags}" = "\"'" ; then
13095
13096         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13097         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13098
13099                                 continue
13100                         fi
13101                         ;;
13102                 esac
13103                 case "$CPPFLAGS" in
13104                 (*$cf_add_cflags)
13105                         ;;
13106                 (*)
13107                         case $cf_add_cflags in
13108                         (-D*)
13109                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13110
13111 CPPFLAGS=`echo "$CPPFLAGS" | \
13112         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13113                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13114
13115                                 ;;
13116                         esac
13117
13118         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13119         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13120
13121                         ;;
13122                 esac
13123                 ;;
13124         (*)
13125
13126         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13127         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13128
13129                 ;;
13130         esac
13131         ;;
13132 (yes)
13133
13134         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13135         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13136
13137         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13138
13139         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13140                 && test -z "${cf_tst_cflags}" \
13141                 && cf_fix_cppflags=no
13142         ;;
13143 esac
13144 done
13145
13146 if test -n "$cf_new_cflags" ; then
13147         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13148
13149 echo "${as_me:-configure}:13149: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13150
13151         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13152         CFLAGS="${CFLAGS}$cf_new_cflags"
13153
13154 fi
13155
13156 if test -n "$cf_new_cppflags" ; then
13157         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13158
13159 echo "${as_me:-configure}:13159: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13160
13161         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13162         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13163
13164 fi
13165
13166 if test -n "$cf_new_extra_cppflags" ; then
13167         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13168
13169 echo "${as_me:-configure}:13169: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13170
13171         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13172         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13173
13174 fi
13175
13176 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13177 cat >conftest.$ac_ext <<_ACEOF
13178 #line 13178 "configure"
13179 #include "confdefs.h"
13180 #include <stdio.h>
13181 int
13182 main (void)
13183 {
13184 printf("Hello world");
13185   ;
13186   return 0;
13187 }
13188 _ACEOF
13189 rm -f conftest.$ac_objext conftest$ac_exeext
13190 if { (eval echo "$as_me:13190: \"$ac_link\"") >&5
13191   (eval $ac_link) 2>&5
13192   ac_status=$?
13193   echo "$as_me:13193: \$? = $ac_status" >&5
13194   (exit $ac_status); } &&
13195          { ac_try='test -s conftest$ac_exeext'
13196   { (eval echo "$as_me:13196: \"$ac_try\"") >&5
13197   (eval $ac_try) 2>&5
13198   ac_status=$?
13199   echo "$as_me:13199: \$? = $ac_status" >&5
13200   (exit $ac_status); }; }; then
13201   :
13202 else
13203   echo "$as_me: failed program was:" >&5
13204 cat conftest.$ac_ext >&5
13205 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13206
13207 echo "${as_me:-configure}:13207: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13208
13209          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13210                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13211
13212 echo "${as_me:-configure}:13212: testing but keeping change to \$CPPFLAGS ..." 1>&5
13213
13214          fi
13215          CFLAGS="$cf_check_flags"
13216 fi
13217 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13218 fi
13219
13220         echo "$as_me:13220: checking for XOpenDisplay" >&5
13221 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
13222 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
13223   echo $ECHO_N "(cached) $ECHO_C" >&6
13224 else
13225   cat >conftest.$ac_ext <<_ACEOF
13226 #line 13226 "configure"
13227 #include "confdefs.h"
13228 /* System header to define __stub macros and hopefully few prototypes,
13229     which can conflict with char XOpenDisplay (); below.  */
13230 #include <assert.h>
13231 /* Override any gcc2 internal prototype to avoid an error.  */
13232 #ifdef __cplusplus
13233 extern "C"
13234 #endif
13235 /* We use char because int might match the return type of a gcc2
13236    builtin and then its argument prototype would still apply.  */
13237 char XOpenDisplay ();
13238 char (*f) ();
13239
13240 int
13241 main (void)
13242 {
13243 /* The GNU C library defines this for functions which it implements
13244     to always fail with ENOSYS.  Some functions are actually named
13245     something starting with __ and the normal name is an alias.  */
13246 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
13247 choke me
13248 #else
13249 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13250 #endif
13251
13252   ;
13253   return 0;
13254 }
13255 _ACEOF
13256 rm -f conftest.$ac_objext conftest$ac_exeext
13257 if { (eval echo "$as_me:13257: \"$ac_link\"") >&5
13258   (eval $ac_link) 2>&5
13259   ac_status=$?
13260   echo "$as_me:13260: \$? = $ac_status" >&5
13261   (exit $ac_status); } &&
13262          { ac_try='test -s conftest$ac_exeext'
13263   { (eval echo "$as_me:13263: \"$ac_try\"") >&5
13264   (eval $ac_try) 2>&5
13265   ac_status=$?
13266   echo "$as_me:13266: \$? = $ac_status" >&5
13267   (exit $ac_status); }; }; then
13268   ac_cv_func_XOpenDisplay=yes
13269 else
13270   echo "$as_me: failed program was:" >&5
13271 cat conftest.$ac_ext >&5
13272 ac_cv_func_XOpenDisplay=no
13273 fi
13274 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13275 fi
13276 echo "$as_me:13276: result: $ac_cv_func_XOpenDisplay" >&5
13277 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
13278 if test $ac_cv_func_XOpenDisplay = yes; then
13279   :
13280 else
13281
13282         echo "$as_me:13282: checking for XOpenDisplay in -lX11" >&5
13283 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13284 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13285   echo $ECHO_N "(cached) $ECHO_C" >&6
13286 else
13287   ac_check_lib_save_LIBS=$LIBS
13288 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13289 cat >conftest.$ac_ext <<_ACEOF
13290 #line 13290 "configure"
13291 #include "confdefs.h"
13292
13293 /* Override any gcc2 internal prototype to avoid an error.  */
13294 #ifdef __cplusplus
13295 extern "C"
13296 #endif
13297 /* We use char because int might match the return type of a gcc2
13298    builtin and then its argument prototype would still apply.  */
13299 char XOpenDisplay ();
13300 int
13301 main (void)
13302 {
13303 XOpenDisplay ();
13304   ;
13305   return 0;
13306 }
13307 _ACEOF
13308 rm -f conftest.$ac_objext conftest$ac_exeext
13309 if { (eval echo "$as_me:13309: \"$ac_link\"") >&5
13310   (eval $ac_link) 2>&5
13311   ac_status=$?
13312   echo "$as_me:13312: \$? = $ac_status" >&5
13313   (exit $ac_status); } &&
13314          { ac_try='test -s conftest$ac_exeext'
13315   { (eval echo "$as_me:13315: \"$ac_try\"") >&5
13316   (eval $ac_try) 2>&5
13317   ac_status=$?
13318   echo "$as_me:13318: \$? = $ac_status" >&5
13319   (exit $ac_status); }; }; then
13320   ac_cv_lib_X11_XOpenDisplay=yes
13321 else
13322   echo "$as_me: failed program was:" >&5
13323 cat conftest.$ac_ext >&5
13324 ac_cv_lib_X11_XOpenDisplay=no
13325 fi
13326 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13327 LIBS=$ac_check_lib_save_LIBS
13328 fi
13329 echo "$as_me:13329: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13330 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13331 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13332
13333 cf_add_libs="-lX11"
13334 # Filter out duplicates - this happens with badly-designed ".pc" files...
13335 for cf_add_1lib in $LIBS
13336 do
13337         for cf_add_2lib in $cf_add_libs
13338         do
13339                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13340                 then
13341                         cf_add_1lib=
13342                         break
13343                 fi
13344         done
13345         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13346 done
13347 LIBS="$cf_add_libs"
13348
13349 fi
13350
13351 fi
13352
13353         echo "$as_me:13353: checking for XtAppInitialize" >&5
13354 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
13355 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
13356   echo $ECHO_N "(cached) $ECHO_C" >&6
13357 else
13358   cat >conftest.$ac_ext <<_ACEOF
13359 #line 13359 "configure"
13360 #include "confdefs.h"
13361 /* System header to define __stub macros and hopefully few prototypes,
13362     which can conflict with char XtAppInitialize (); below.  */
13363 #include <assert.h>
13364 /* Override any gcc2 internal prototype to avoid an error.  */
13365 #ifdef __cplusplus
13366 extern "C"
13367 #endif
13368 /* We use char because int might match the return type of a gcc2
13369    builtin and then its argument prototype would still apply.  */
13370 char XtAppInitialize ();
13371 char (*f) ();
13372
13373 int
13374 main (void)
13375 {
13376 /* The GNU C library defines this for functions which it implements
13377     to always fail with ENOSYS.  Some functions are actually named
13378     something starting with __ and the normal name is an alias.  */
13379 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
13380 choke me
13381 #else
13382 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13383 #endif
13384
13385   ;
13386   return 0;
13387 }
13388 _ACEOF
13389 rm -f conftest.$ac_objext conftest$ac_exeext
13390 if { (eval echo "$as_me:13390: \"$ac_link\"") >&5
13391   (eval $ac_link) 2>&5
13392   ac_status=$?
13393   echo "$as_me:13393: \$? = $ac_status" >&5
13394   (exit $ac_status); } &&
13395          { ac_try='test -s conftest$ac_exeext'
13396   { (eval echo "$as_me:13396: \"$ac_try\"") >&5
13397   (eval $ac_try) 2>&5
13398   ac_status=$?
13399   echo "$as_me:13399: \$? = $ac_status" >&5
13400   (exit $ac_status); }; }; then
13401   ac_cv_func_XtAppInitialize=yes
13402 else
13403   echo "$as_me: failed program was:" >&5
13404 cat conftest.$ac_ext >&5
13405 ac_cv_func_XtAppInitialize=no
13406 fi
13407 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13408 fi
13409 echo "$as_me:13409: result: $ac_cv_func_XtAppInitialize" >&5
13410 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
13411 if test $ac_cv_func_XtAppInitialize = yes; then
13412   :
13413 else
13414
13415         echo "$as_me:13415: checking for XtAppInitialize in -lXt" >&5
13416 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
13417 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
13418   echo $ECHO_N "(cached) $ECHO_C" >&6
13419 else
13420   ac_check_lib_save_LIBS=$LIBS
13421 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13422 cat >conftest.$ac_ext <<_ACEOF
13423 #line 13423 "configure"
13424 #include "confdefs.h"
13425
13426 /* Override any gcc2 internal prototype to avoid an error.  */
13427 #ifdef __cplusplus
13428 extern "C"
13429 #endif
13430 /* We use char because int might match the return type of a gcc2
13431    builtin and then its argument prototype would still apply.  */
13432 char XtAppInitialize ();
13433 int
13434 main (void)
13435 {
13436 XtAppInitialize ();
13437   ;
13438   return 0;
13439 }
13440 _ACEOF
13441 rm -f conftest.$ac_objext conftest$ac_exeext
13442 if { (eval echo "$as_me:13442: \"$ac_link\"") >&5
13443   (eval $ac_link) 2>&5
13444   ac_status=$?
13445   echo "$as_me:13445: \$? = $ac_status" >&5
13446   (exit $ac_status); } &&
13447          { ac_try='test -s conftest$ac_exeext'
13448   { (eval echo "$as_me:13448: \"$ac_try\"") >&5
13449   (eval $ac_try) 2>&5
13450   ac_status=$?
13451   echo "$as_me:13451: \$? = $ac_status" >&5
13452   (exit $ac_status); }; }; then
13453   ac_cv_lib_Xt_XtAppInitialize=yes
13454 else
13455   echo "$as_me: failed program was:" >&5
13456 cat conftest.$ac_ext >&5
13457 ac_cv_lib_Xt_XtAppInitialize=no
13458 fi
13459 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13460 LIBS=$ac_check_lib_save_LIBS
13461 fi
13462 echo "$as_me:13462: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
13463 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
13464 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
13465
13466 cat >>confdefs.h <<\EOF
13467 #define HAVE_LIBXT 1
13468 EOF
13469
13470                  cf_have_X_LIBS=Xt
13471                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13472 fi
13473
13474 fi
13475
13476 fi
13477
13478 if test $cf_have_X_LIBS = no ; then
13479         { echo "$as_me:13479: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13480 test program.  You will have to check and add the proper libraries by hand
13481 to makefile." >&5
13482 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13483 test program.  You will have to check and add the proper libraries by hand
13484 to makefile." >&2;}
13485 fi
13486
13487 cf_x_athena_root=$cf_x_athena
13488 cf_x_athena_inc=""
13489
13490 for cf_path in default \
13491         /usr/contrib/X11R6 \
13492         /usr/contrib/X11R5 \
13493         /usr/lib/X11R5 \
13494         /usr/local
13495 do
13496         if test -z "$cf_x_athena_inc" ; then
13497                 cf_save="$CPPFLAGS"
13498                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
13499                 if test $cf_path != default ; then
13500                         CPPFLAGS="$cf_save -I$cf_path/include"
13501                         echo "$as_me:13501: checking for $cf_test in $cf_path" >&5
13502 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
13503                 else
13504                         echo "$as_me:13504: checking for $cf_test" >&5
13505 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
13506                 fi
13507                 cat >conftest.$ac_ext <<_ACEOF
13508 #line 13508 "configure"
13509 #include "confdefs.h"
13510
13511 #include <X11/Intrinsic.h>
13512 #include <$cf_test>
13513 int
13514 main (void)
13515 {
13516
13517   ;
13518   return 0;
13519 }
13520 _ACEOF
13521 rm -f conftest.$ac_objext
13522 if { (eval echo "$as_me:13522: \"$ac_compile\"") >&5
13523   (eval $ac_compile) 2>&5
13524   ac_status=$?
13525   echo "$as_me:13525: \$? = $ac_status" >&5
13526   (exit $ac_status); } &&
13527          { ac_try='test -s conftest.$ac_objext'
13528   { (eval echo "$as_me:13528: \"$ac_try\"") >&5
13529   (eval $ac_try) 2>&5
13530   ac_status=$?
13531   echo "$as_me:13531: \$? = $ac_status" >&5
13532   (exit $ac_status); }; }; then
13533   cf_result=yes
13534 else
13535   echo "$as_me: failed program was:" >&5
13536 cat conftest.$ac_ext >&5
13537 cf_result=no
13538 fi
13539 rm -f conftest.$ac_objext conftest.$ac_ext
13540                 echo "$as_me:13540: result: $cf_result" >&5
13541 echo "${ECHO_T}$cf_result" >&6
13542                 if test "$cf_result" = yes ; then
13543                         cf_x_athena_inc=$cf_path
13544                         break
13545                 else
13546                         CPPFLAGS="$cf_save"
13547                 fi
13548         fi
13549 done
13550
13551 if test -z "$cf_x_athena_inc" ; then
13552         { echo "$as_me:13552: WARNING: Unable to successfully find Athena header files with test program" >&5
13553 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
13554 elif test "$cf_x_athena_inc" != default ; then
13555         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
13556 fi
13557
13558 cf_x_athena_root=$cf_x_athena
13559 cf_x_athena_lib=""
13560
13561 for cf_path in default \
13562         /usr/contrib/X11R6 \
13563         /usr/contrib/X11R5 \
13564         /usr/lib/X11R5 \
13565         /usr/local
13566 do
13567         for cf_lib in \
13568                 ${cf_x_athena_root} \
13569                 ${cf_x_athena_root}7 \
13570                 ${cf_x_athena_root}6
13571         do
13572         for cf_libs in \
13573                 "-l$cf_lib -lXmu" \
13574                 "-l$cf_lib -lXpm -lXmu" \
13575                 "-l${cf_lib}_s -lXmu_s"
13576         do
13577                 if test -z "$cf_x_athena_lib" ; then
13578                         cf_save="$LIBS"
13579                         cf_test=XawSimpleMenuAddGlobalActions
13580                         if test $cf_path != default ; then
13581
13582 cf_add_libs="-L$cf_path/lib $cf_libs"
13583 # Filter out duplicates - this happens with badly-designed ".pc" files...
13584 for cf_add_1lib in $LIBS
13585 do
13586         for cf_add_2lib in $cf_add_libs
13587         do
13588                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13589                 then
13590                         cf_add_1lib=
13591                         break
13592                 fi
13593         done
13594         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13595 done
13596 LIBS="$cf_add_libs"
13597
13598                                 echo "$as_me:13598: checking for $cf_libs in $cf_path" >&5
13599 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13600                         else
13601
13602 cf_add_libs="$cf_libs"
13603 # Filter out duplicates - this happens with badly-designed ".pc" files...
13604 for cf_add_1lib in $LIBS
13605 do
13606         for cf_add_2lib in $cf_add_libs
13607         do
13608                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13609                 then
13610                         cf_add_1lib=
13611                         break
13612                 fi
13613         done
13614         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13615 done
13616 LIBS="$cf_add_libs"
13617
13618                                 echo "$as_me:13618: checking for $cf_test in $cf_libs" >&5
13619 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13620                         fi
13621                         cat >conftest.$ac_ext <<_ACEOF
13622 #line 13622 "configure"
13623 #include "confdefs.h"
13624
13625 #include <X11/Intrinsic.h>
13626 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13627
13628 int
13629 main (void)
13630 {
13631
13632 $cf_test((XtAppContext) 0)
13633   ;
13634   return 0;
13635 }
13636 _ACEOF
13637 rm -f conftest.$ac_objext conftest$ac_exeext
13638 if { (eval echo "$as_me:13638: \"$ac_link\"") >&5
13639   (eval $ac_link) 2>&5
13640   ac_status=$?
13641   echo "$as_me:13641: \$? = $ac_status" >&5
13642   (exit $ac_status); } &&
13643          { ac_try='test -s conftest$ac_exeext'
13644   { (eval echo "$as_me:13644: \"$ac_try\"") >&5
13645   (eval $ac_try) 2>&5
13646   ac_status=$?
13647   echo "$as_me:13647: \$? = $ac_status" >&5
13648   (exit $ac_status); }; }; then
13649   cf_result=yes
13650 else
13651   echo "$as_me: failed program was:" >&5
13652 cat conftest.$ac_ext >&5
13653 cf_result=no
13654 fi
13655 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13656                         echo "$as_me:13656: result: $cf_result" >&5
13657 echo "${ECHO_T}$cf_result" >&6
13658                         if test "$cf_result" = yes ; then
13659                                 cf_x_athena_lib="$cf_libs"
13660                                 break
13661                         fi
13662                         LIBS="$cf_save"
13663                 fi
13664         done # cf_libs
13665                 test -n "$cf_x_athena_lib" && break
13666         done # cf_lib
13667 done
13668
13669 if test -z "$cf_x_athena_lib" ; then
13670         { { echo "$as_me:13670: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13671 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13672    { (exit 1); exit 1; }; }
13673 fi
13674
13675 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13676
13677 cat >>confdefs.h <<EOF
13678 #define $cf_x_athena_LIBS 1
13679 EOF
13680
13681 fi
13682
13683 if test -n "$ac_tool_prefix"; then
13684   for ac_prog in xcurses-config
13685   do
13686     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13687 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13688 echo "$as_me:13688: checking for $ac_word" >&5
13689 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13690 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13691   echo $ECHO_N "(cached) $ECHO_C" >&6
13692 else
13693   if test -n "$XCURSES_CONFIG"; then
13694   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13695 else
13696   ac_save_IFS=$IFS; IFS=$ac_path_separator
13697 ac_dummy="$PATH"
13698 for ac_dir in $ac_dummy; do
13699   IFS=$ac_save_IFS
13700   test -z "$ac_dir" && ac_dir=.
13701   $as_executable_p "$ac_dir/$ac_word" || continue
13702 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13703 echo "$as_me:13703: found $ac_dir/$ac_word" >&5
13704 break
13705 done
13706
13707 fi
13708 fi
13709 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13710 if test -n "$XCURSES_CONFIG"; then
13711   echo "$as_me:13711: result: $XCURSES_CONFIG" >&5
13712 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13713 else
13714   echo "$as_me:13714: result: no" >&5
13715 echo "${ECHO_T}no" >&6
13716 fi
13717
13718     test -n "$XCURSES_CONFIG" && break
13719   done
13720 fi
13721 if test -z "$XCURSES_CONFIG"; then
13722   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13723   for ac_prog in xcurses-config
13724 do
13725   # Extract the first word of "$ac_prog", so it can be a program name with args.
13726 set dummy $ac_prog; ac_word=$2
13727 echo "$as_me:13727: checking for $ac_word" >&5
13728 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13729 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13730   echo $ECHO_N "(cached) $ECHO_C" >&6
13731 else
13732   if test -n "$ac_ct_XCURSES_CONFIG"; then
13733   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13734 else
13735   ac_save_IFS=$IFS; IFS=$ac_path_separator
13736 ac_dummy="$PATH"
13737 for ac_dir in $ac_dummy; do
13738   IFS=$ac_save_IFS
13739   test -z "$ac_dir" && ac_dir=.
13740   $as_executable_p "$ac_dir/$ac_word" || continue
13741 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13742 echo "$as_me:13742: found $ac_dir/$ac_word" >&5
13743 break
13744 done
13745
13746 fi
13747 fi
13748 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13749 if test -n "$ac_ct_XCURSES_CONFIG"; then
13750   echo "$as_me:13750: result: $ac_ct_XCURSES_CONFIG" >&5
13751 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13752 else
13753   echo "$as_me:13753: result: no" >&5
13754 echo "${ECHO_T}no" >&6
13755 fi
13756
13757   test -n "$ac_ct_XCURSES_CONFIG" && break
13758 done
13759 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13760
13761   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13762 fi
13763
13764 if test "$XCURSES_CONFIG" != none ; then
13765
13766 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13767
13768 cf_add_libs="`$XCURSES_CONFIG --libs`"
13769 # Filter out duplicates - this happens with badly-designed ".pc" files...
13770 for cf_add_1lib in $LIBS
13771 do
13772         for cf_add_2lib in $cf_add_libs
13773         do
13774                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13775                 then
13776                         cf_add_1lib=
13777                         break
13778                 fi
13779         done
13780         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13781 done
13782 LIBS="$cf_add_libs"
13783
13784 cf_cv_lib_XCurses=yes
13785
13786 else
13787
13788 LDFLAGS="$LDFLAGS $X_LIBS"
13789
13790 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13791
13792 echo "${as_me:-configure}:13792: testing checking additions to CFLAGS ..." 1>&5
13793
13794 cf_check_cflags="$CFLAGS"
13795 cf_check_cppflags="$CPPFLAGS"
13796
13797 cf_fix_cppflags=no
13798 cf_new_cflags=
13799 cf_new_cppflags=
13800 cf_new_extra_cppflags=
13801
13802 for cf_add_cflags in $X_CFLAGS
13803 do
13804 case $cf_fix_cppflags in
13805 (no)
13806         case $cf_add_cflags in
13807         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13808                 case $cf_add_cflags in
13809                 (-D*)
13810                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13811
13812                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13813                                 && test -z "${cf_tst_cflags}" \
13814                                 && cf_fix_cppflags=yes
13815
13816                         if test $cf_fix_cppflags = yes ; then
13817
13818         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13819         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13820
13821                                 continue
13822                         elif test "${cf_tst_cflags}" = "\"'" ; then
13823
13824         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13825         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13826
13827                                 continue
13828                         fi
13829                         ;;
13830                 esac
13831                 case "$CPPFLAGS" in
13832                 (*$cf_add_cflags)
13833                         ;;
13834                 (*)
13835                         case $cf_add_cflags in
13836                         (-D*)
13837                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13838
13839 CPPFLAGS=`echo "$CPPFLAGS" | \
13840         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13841                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13842
13843                                 ;;
13844                         esac
13845
13846         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13847         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13848
13849                         ;;
13850                 esac
13851                 ;;
13852         (*)
13853
13854         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13855         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13856
13857                 ;;
13858         esac
13859         ;;
13860 (yes)
13861
13862         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13863         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13864
13865         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13866
13867         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13868                 && test -z "${cf_tst_cflags}" \
13869                 && cf_fix_cppflags=no
13870         ;;
13871 esac
13872 done
13873
13874 if test -n "$cf_new_cflags" ; then
13875         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13876
13877 echo "${as_me:-configure}:13877: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13878
13879         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13880         CFLAGS="${CFLAGS}$cf_new_cflags"
13881
13882 fi
13883
13884 if test -n "$cf_new_cppflags" ; then
13885         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13886
13887 echo "${as_me:-configure}:13887: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13888
13889         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13890         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13891
13892 fi
13893
13894 if test -n "$cf_new_extra_cppflags" ; then
13895         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13896
13897 echo "${as_me:-configure}:13897: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13898
13899         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13900         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13901
13902 fi
13903
13904 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13905 cat >conftest.$ac_ext <<_ACEOF
13906 #line 13906 "configure"
13907 #include "confdefs.h"
13908 #include <stdio.h>
13909 int
13910 main (void)
13911 {
13912 printf("Hello world");
13913   ;
13914   return 0;
13915 }
13916 _ACEOF
13917 rm -f conftest.$ac_objext conftest$ac_exeext
13918 if { (eval echo "$as_me:13918: \"$ac_link\"") >&5
13919   (eval $ac_link) 2>&5
13920   ac_status=$?
13921   echo "$as_me:13921: \$? = $ac_status" >&5
13922   (exit $ac_status); } &&
13923          { ac_try='test -s conftest$ac_exeext'
13924   { (eval echo "$as_me:13924: \"$ac_try\"") >&5
13925   (eval $ac_try) 2>&5
13926   ac_status=$?
13927   echo "$as_me:13927: \$? = $ac_status" >&5
13928   (exit $ac_status); }; }; then
13929   :
13930 else
13931   echo "$as_me: failed program was:" >&5
13932 cat conftest.$ac_ext >&5
13933 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13934
13935 echo "${as_me:-configure}:13935: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13936
13937          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13938                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13939
13940 echo "${as_me:-configure}:13940: testing but keeping change to \$CPPFLAGS ..." 1>&5
13941
13942          fi
13943          CFLAGS="$cf_check_flags"
13944 fi
13945 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13946 fi
13947
13948 echo "$as_me:13948: checking for XOpenDisplay in -lX11" >&5
13949 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13950 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13951   echo $ECHO_N "(cached) $ECHO_C" >&6
13952 else
13953   ac_check_lib_save_LIBS=$LIBS
13954 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13955 cat >conftest.$ac_ext <<_ACEOF
13956 #line 13956 "configure"
13957 #include "confdefs.h"
13958
13959 /* Override any gcc2 internal prototype to avoid an error.  */
13960 #ifdef __cplusplus
13961 extern "C"
13962 #endif
13963 /* We use char because int might match the return type of a gcc2
13964    builtin and then its argument prototype would still apply.  */
13965 char XOpenDisplay ();
13966 int
13967 main (void)
13968 {
13969 XOpenDisplay ();
13970   ;
13971   return 0;
13972 }
13973 _ACEOF
13974 rm -f conftest.$ac_objext conftest$ac_exeext
13975 if { (eval echo "$as_me:13975: \"$ac_link\"") >&5
13976   (eval $ac_link) 2>&5
13977   ac_status=$?
13978   echo "$as_me:13978: \$? = $ac_status" >&5
13979   (exit $ac_status); } &&
13980          { ac_try='test -s conftest$ac_exeext'
13981   { (eval echo "$as_me:13981: \"$ac_try\"") >&5
13982   (eval $ac_try) 2>&5
13983   ac_status=$?
13984   echo "$as_me:13984: \$? = $ac_status" >&5
13985   (exit $ac_status); }; }; then
13986   ac_cv_lib_X11_XOpenDisplay=yes
13987 else
13988   echo "$as_me: failed program was:" >&5
13989 cat conftest.$ac_ext >&5
13990 ac_cv_lib_X11_XOpenDisplay=no
13991 fi
13992 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13993 LIBS=$ac_check_lib_save_LIBS
13994 fi
13995 echo "$as_me:13995: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13996 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13997 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13998
13999 cf_add_libs="-lX11"
14000 # Filter out duplicates - this happens with badly-designed ".pc" files...
14001 for cf_add_1lib in $LIBS
14002 do
14003         for cf_add_2lib in $cf_add_libs
14004         do
14005                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14006                 then
14007                         cf_add_1lib=
14008                         break
14009                 fi
14010         done
14011         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14012 done
14013 LIBS="$cf_add_libs"
14014
14015 fi
14016
14017 echo "$as_me:14017: checking for XCurses library" >&5
14018 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
14019 if test "${cf_cv_lib_XCurses+set}" = set; then
14020   echo $ECHO_N "(cached) $ECHO_C" >&6
14021 else
14022
14023 cf_add_libs="-lXCurses"
14024 # Filter out duplicates - this happens with badly-designed ".pc" files...
14025 for cf_add_1lib in $LIBS
14026 do
14027         for cf_add_2lib in $cf_add_libs
14028         do
14029                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14030                 then
14031                         cf_add_1lib=
14032                         break
14033                 fi
14034         done
14035         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14036 done
14037 LIBS="$cf_add_libs"
14038
14039 cat >conftest.$ac_ext <<_ACEOF
14040 #line 14040 "configure"
14041 #include "confdefs.h"
14042
14043 #include <xcurses.h>
14044 char *XCursesProgramName = "test";
14045
14046 int
14047 main (void)
14048 {
14049 XCursesExit();
14050   ;
14051   return 0;
14052 }
14053 _ACEOF
14054 rm -f conftest.$ac_objext conftest$ac_exeext
14055 if { (eval echo "$as_me:14055: \"$ac_link\"") >&5
14056   (eval $ac_link) 2>&5
14057   ac_status=$?
14058   echo "$as_me:14058: \$? = $ac_status" >&5
14059   (exit $ac_status); } &&
14060          { ac_try='test -s conftest$ac_exeext'
14061   { (eval echo "$as_me:14061: \"$ac_try\"") >&5
14062   (eval $ac_try) 2>&5
14063   ac_status=$?
14064   echo "$as_me:14064: \$? = $ac_status" >&5
14065   (exit $ac_status); }; }; then
14066   cf_cv_lib_XCurses=yes
14067 else
14068   echo "$as_me: failed program was:" >&5
14069 cat conftest.$ac_ext >&5
14070 cf_cv_lib_XCurses=no
14071 fi
14072 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14073
14074 fi
14075 echo "$as_me:14075: result: $cf_cv_lib_XCurses" >&5
14076 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
14077
14078 fi
14079
14080 if test $cf_cv_lib_XCurses = yes ; then
14081
14082 cat >>confdefs.h <<\EOF
14083 #define UNIX 1
14084 EOF
14085
14086 cat >>confdefs.h <<\EOF
14087 #define XCURSES 1
14088 EOF
14089
14090         echo "$as_me:14090: checking for xcurses.h" >&5
14091 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
14092 if test "${ac_cv_header_xcurses_h+set}" = set; then
14093   echo $ECHO_N "(cached) $ECHO_C" >&6
14094 else
14095   cat >conftest.$ac_ext <<_ACEOF
14096 #line 14096 "configure"
14097 #include "confdefs.h"
14098 #include <xcurses.h>
14099 _ACEOF
14100 if { (eval echo "$as_me:14100: \"$ac_cpp conftest.$ac_ext\"") >&5
14101   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14102   ac_status=$?
14103   egrep -v '^ *\+' conftest.er1 >conftest.err
14104   rm -f conftest.er1
14105   cat conftest.err >&5
14106   echo "$as_me:14106: \$? = $ac_status" >&5
14107   (exit $ac_status); } >/dev/null; then
14108   if test -s conftest.err; then
14109     ac_cpp_err=$ac_c_preproc_warn_flag
14110   else
14111     ac_cpp_err=
14112   fi
14113 else
14114   ac_cpp_err=yes
14115 fi
14116 if test -z "$ac_cpp_err"; then
14117   ac_cv_header_xcurses_h=yes
14118 else
14119   echo "$as_me: failed program was:" >&5
14120   cat conftest.$ac_ext >&5
14121   ac_cv_header_xcurses_h=no
14122 fi
14123 rm -f conftest.err conftest.$ac_ext
14124 fi
14125 echo "$as_me:14125: result: $ac_cv_header_xcurses_h" >&5
14126 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
14127 if test $ac_cv_header_xcurses_h = yes; then
14128
14129 cat >>confdefs.h <<\EOF
14130 #define HAVE_XCURSES 1
14131 EOF
14132
14133 fi
14134
14135 else
14136         { { echo "$as_me:14136: error: Cannot link with XCurses" >&5
14137 echo "$as_me: error: Cannot link with XCurses" >&2;}
14138    { (exit 1); exit 1; }; }
14139 fi
14140
14141         ;;
14142 (*)
14143         { { echo "$as_me:14143: error: unexpected screen-value: $cf_cv_screen" >&5
14144 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
14145    { (exit 1); exit 1; }; }
14146         ;;
14147 esac
14148
14149 : ${cf_nculib_root:=$cf_cv_screen}
14150 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
14151 echo "$as_me:14151: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
14152 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
14153 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14154   echo $ECHO_N "(cached) $ECHO_C" >&6
14155 else
14156   ac_check_lib_save_LIBS=$LIBS
14157 LIBS="-l$cf_nculib_root  $LIBS"
14158 cat >conftest.$ac_ext <<_ACEOF
14159 #line 14159 "configure"
14160 #include "confdefs.h"
14161
14162 /* Override any gcc2 internal prototype to avoid an error.  */
14163 #ifdef __cplusplus
14164 extern "C"
14165 #endif
14166 /* We use char because int might match the return type of a gcc2
14167    builtin and then its argument prototype would still apply.  */
14168 char _nc_init_pthreads ();
14169 int
14170 main (void)
14171 {
14172 _nc_init_pthreads ();
14173   ;
14174   return 0;
14175 }
14176 _ACEOF
14177 rm -f conftest.$ac_objext conftest$ac_exeext
14178 if { (eval echo "$as_me:14178: \"$ac_link\"") >&5
14179   (eval $ac_link) 2>&5
14180   ac_status=$?
14181   echo "$as_me:14181: \$? = $ac_status" >&5
14182   (exit $ac_status); } &&
14183          { ac_try='test -s conftest$ac_exeext'
14184   { (eval echo "$as_me:14184: \"$ac_try\"") >&5
14185   (eval $ac_try) 2>&5
14186   ac_status=$?
14187   echo "$as_me:14187: \$? = $ac_status" >&5
14188   (exit $ac_status); }; }; then
14189   eval "$as_ac_Lib=yes"
14190 else
14191   echo "$as_me: failed program was:" >&5
14192 cat conftest.$ac_ext >&5
14193 eval "$as_ac_Lib=no"
14194 fi
14195 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14196 LIBS=$ac_check_lib_save_LIBS
14197 fi
14198 echo "$as_me:14198: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14199 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14200 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14201   cf_cv_ncurses_pthreads=yes
14202 else
14203   cf_cv_ncurses_pthreads=no
14204 fi
14205
14206 if test "$cf_cv_ncurses_pthreads" = yes
14207 then
14208
14209 cf_add_libs="-lpthread"
14210 # Filter out duplicates - this happens with badly-designed ".pc" files...
14211 for cf_add_1lib in $LIBS
14212 do
14213         for cf_add_2lib in $cf_add_libs
14214         do
14215                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14216                 then
14217                         cf_add_1lib=
14218                         break
14219                 fi
14220         done
14221         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14222 done
14223 LIBS="$cf_add_libs"
14224
14225 fi
14226
14227 case $cf_cv_screen in
14228 (ncurses*)
14229         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
14230         ;;
14231 esac
14232
14233 echo "$as_me:14233: checking for X11 rgb file" >&5
14234 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
14235
14236 # Check whether --with-x11-rgb or --without-x11-rgb was given.
14237 if test "${with_x11_rgb+set}" = set; then
14238   withval="$with_x11_rgb"
14239   RGB_PATH=$withval
14240 else
14241   RGB_PATH=auto
14242 fi;
14243
14244 if test "x$RGB_PATH" = xauto
14245 then
14246         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
14247         for cf_path in \
14248                 /opt/local/share/X11/rgb.txt \
14249                 /opt/X11/share/X11/rgb.txt \
14250                 /usr/share/X11/rgb.txt \
14251                 /usr/X11/share/X11/rgb.txt \
14252                 /usr/X11/lib/X11/rgb.txt \
14253                 /usr/lib/X11/rgb.txt \
14254                 /etc/X11/rgb.txt \
14255                 /usr/pkg/lib/X11/rgb.txt \
14256                 /usr/X11R7/lib/X11/rgb.txt \
14257                 /usr/X11R6/lib/X11/rgb.txt \
14258                 /usr/X11R5/lib/X11/rgb.txt \
14259                 /usr/X11R4/lib/X11/rgb.txt \
14260                 /usr/local/lib/X11/rgb.txt \
14261                 /usr/local/share/X11/rgb.txt \
14262                 /usr/lib64/X11/rgb.txt
14263         do
14264                 if test -f "$cf_path" ; then
14265                         RGB_PATH="$cf_path"
14266                         break
14267                 fi
14268         done
14269 else
14270         cf_path=$RGB_PATH
14271
14272 if test "x$prefix" != xNONE; then
14273         cf_path_syntax="$prefix"
14274 else
14275         cf_path_syntax="$ac_default_prefix"
14276 fi
14277
14278 case ".$cf_path" in
14279 (.\$\(*\)*|.\'*\'*)
14280         ;;
14281 (..|./*|.\\*)
14282         ;;
14283 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14284         ;;
14285 (.\${*prefix}*|.\${*dir}*)
14286         eval cf_path="$cf_path"
14287         case ".$cf_path" in
14288         (.NONE/*)
14289                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
14290                 ;;
14291         esac
14292         ;;
14293 (.no|.NONE/*)
14294         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
14295         ;;
14296 (*)
14297         { { echo "$as_me:14297: error: expected a pathname, not \"$cf_path\"" >&5
14298 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
14299    { (exit 1); exit 1; }; }
14300         ;;
14301 esac
14302
14303 fi
14304
14305 echo "$as_me:14305: result: $RGB_PATH" >&5
14306 echo "${ECHO_T}$RGB_PATH" >&6
14307
14308 cat >>confdefs.h <<EOF
14309 #define RGB_PATH "$cf_path"
14310 EOF
14311
14312 no_x11_rgb=
14313 if test "$RGB_PATH" = no
14314 then
14315         no_x11_rgb="#"
14316 fi
14317
14318 cf_curses_headers=
14319
14320 case $cf_cv_screen in
14321 (pdcurses)
14322         cf_default_panel=no
14323         cf_default_form=no
14324         cf_default_menu=no
14325         cf_default_tinfo=no
14326         ;;
14327 (xcurses|bsdcurses)
14328         cf_default_panel=no
14329         cf_default_form=no
14330         cf_default_menu=no
14331         cf_default_tinfo=yes
14332         ;;
14333 (*)
14334         cf_default_panel=yes
14335         cf_default_form=yes
14336         cf_default_menu=yes
14337         cf_default_tinfo=yes
14338         case $cf_cv_screen in
14339         (ncurses*)
14340                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
14341                 ;;
14342         esac
14343         ;;
14344 esac
14345
14346 echo "$as_me:14346: checking if you want to check for panel functions" >&5
14347 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
14348
14349 # Check whether --enable-panel or --disable-panel was given.
14350 if test "${enable_panel+set}" = set; then
14351   enableval="$enable_panel"
14352   test "$enableval" != no && enableval=yes
14353         if test "$enableval" != "yes" ; then
14354     cf_enable_panel=no
14355         else
14356                 cf_enable_panel=$cf_default_panel
14357         fi
14358 else
14359   enableval=yes
14360         cf_enable_panel=$cf_default_panel
14361
14362 fi;
14363 echo "$as_me:14363: result: $cf_enable_panel" >&5
14364 echo "${ECHO_T}$cf_enable_panel" >&6
14365 if test $cf_enable_panel = yes
14366 then
14367
14368 cf_have_curses_lib=no
14369
14370 : ${NCURSES_CONFIG_PKG:=none}
14371 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
14372         :
14373 elif test "x${PKG_CONFIG:=none}" != xnone; then
14374         echo "$as_me:14374: checking pkg-config for panel$cf_cv_libtype" >&5
14375 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
14376         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
14377                 echo "$as_me:14377: result: yes" >&5
14378 echo "${ECHO_T}yes" >&6
14379
14380                 echo "$as_me:14380: checking if the panel$cf_cv_libtype package files work" >&5
14381 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
14382
14383                 cf_save_CPPFLAGS="$CPPFLAGS"
14384                 cf_save_LIBS="$LIBS"
14385
14386 cf_fix_cppflags=no
14387 cf_new_cflags=
14388 cf_new_cppflags=
14389 cf_new_extra_cppflags=
14390
14391 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
14392 do
14393 case $cf_fix_cppflags in
14394 (no)
14395         case $cf_add_cflags in
14396         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14397                 case $cf_add_cflags in
14398                 (-D*)
14399                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14400
14401                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14402                                 && test -z "${cf_tst_cflags}" \
14403                                 && cf_fix_cppflags=yes
14404
14405                         if test $cf_fix_cppflags = yes ; then
14406
14407         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14408         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14409
14410                                 continue
14411                         elif test "${cf_tst_cflags}" = "\"'" ; then
14412
14413         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14414         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14415
14416                                 continue
14417                         fi
14418                         ;;
14419                 esac
14420                 case "$CPPFLAGS" in
14421                 (*$cf_add_cflags)
14422                         ;;
14423                 (*)
14424                         case $cf_add_cflags in
14425                         (-D*)
14426                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14427
14428 CPPFLAGS=`echo "$CPPFLAGS" | \
14429         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14430                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14431
14432                                 ;;
14433                         esac
14434
14435         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14436         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14437
14438                         ;;
14439                 esac
14440                 ;;
14441         (*)
14442
14443         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14444         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14445
14446                 ;;
14447         esac
14448         ;;
14449 (yes)
14450
14451         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14452         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14453
14454         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14455
14456         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14457                 && test -z "${cf_tst_cflags}" \
14458                 && cf_fix_cppflags=no
14459         ;;
14460 esac
14461 done
14462
14463 if test -n "$cf_new_cflags" ; then
14464
14465         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14466         CFLAGS="${CFLAGS}$cf_new_cflags"
14467
14468 fi
14469
14470 if test -n "$cf_new_cppflags" ; then
14471
14472         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14473         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14474
14475 fi
14476
14477 if test -n "$cf_new_extra_cppflags" ; then
14478
14479         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14480         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14481
14482 fi
14483
14484 cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
14485 # Filter out duplicates - this happens with badly-designed ".pc" files...
14486 for cf_add_1lib in $LIBS
14487 do
14488         for cf_add_2lib in $cf_add_libs
14489         do
14490                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14491                 then
14492                         cf_add_1lib=
14493                         break
14494                 fi
14495         done
14496         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14497 done
14498 LIBS="$cf_add_libs"
14499
14500                 cat >conftest.$ac_ext <<_ACEOF
14501 #line 14501 "configure"
14502 #include "confdefs.h"
14503 #include <panel.h>
14504 int
14505 main (void)
14506 {
14507 (void) new_panel ( 0 );
14508   ;
14509   return 0;
14510 }
14511 _ACEOF
14512 rm -f conftest.$ac_objext 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); } &&
14518          { ac_try='test -s conftest$ac_exeext'
14519   { (eval echo "$as_me:14519: \"$ac_try\"") >&5
14520   (eval $ac_try) 2>&5
14521   ac_status=$?
14522   echo "$as_me:14522: \$? = $ac_status" >&5
14523   (exit $ac_status); }; }; then
14524   if test "$cross_compiling" = yes; then
14525   cf_have_curses_lib=maybe
14526 else
14527   cat >conftest.$ac_ext <<_ACEOF
14528 #line 14528 "configure"
14529 #include "confdefs.h"
14530 #include <panel.h>
14531                                 int main(void)
14532                                 { (void) new_panel ( 0 ); return 0; }
14533 _ACEOF
14534 rm -f conftest$ac_exeext
14535 if { (eval echo "$as_me:14535: \"$ac_link\"") >&5
14536   (eval $ac_link) 2>&5
14537   ac_status=$?
14538   echo "$as_me:14538: \$? = $ac_status" >&5
14539   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14540   { (eval echo "$as_me:14540: \"$ac_try\"") >&5
14541   (eval $ac_try) 2>&5
14542   ac_status=$?
14543   echo "$as_me:14543: \$? = $ac_status" >&5
14544   (exit $ac_status); }; }; then
14545   cf_have_curses_lib=yes
14546 else
14547   echo "$as_me: program exited with status $ac_status" >&5
14548 echo "$as_me: failed program was:" >&5
14549 cat conftest.$ac_ext >&5
14550 cf_have_curses_lib=no
14551 fi
14552 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14553 fi
14554 else
14555   echo "$as_me: failed program was:" >&5
14556 cat conftest.$ac_ext >&5
14557 cf_have_curses_lib=no
14558 fi
14559 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14560                 echo "$as_me:14560: result: $cf_have_curses_lib" >&5
14561 echo "${ECHO_T}$cf_have_curses_lib" >&6
14562                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
14563                 if test "$cf_have_curses_lib" != "yes"
14564                 then
14565                         CPPFLAGS="$cf_save_CPPFLAGS"
14566                         LIBS="$cf_save_LIBS"
14567                 else
14568
14569 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14570
14571                         cat >>confdefs.h <<EOF
14572 #define $cf_upper 1
14573 EOF
14574
14575                 fi
14576         fi
14577 fi
14578 if test "$cf_have_curses_lib" = no; then
14579         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
14580 echo "$as_me:14580: checking for new_panel in -lpanel$cf_cv_libtype" >&5
14581 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
14582 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14583   echo $ECHO_N "(cached) $ECHO_C" >&6
14584 else
14585   ac_check_lib_save_LIBS=$LIBS
14586 LIBS="-lpanel$cf_cv_libtype  $LIBS"
14587 cat >conftest.$ac_ext <<_ACEOF
14588 #line 14588 "configure"
14589 #include "confdefs.h"
14590
14591 /* Override any gcc2 internal prototype to avoid an error.  */
14592 #ifdef __cplusplus
14593 extern "C"
14594 #endif
14595 /* We use char because int might match the return type of a gcc2
14596    builtin and then its argument prototype would still apply.  */
14597 char new_panel ();
14598 int
14599 main (void)
14600 {
14601 new_panel ();
14602   ;
14603   return 0;
14604 }
14605 _ACEOF
14606 rm -f conftest.$ac_objext conftest$ac_exeext
14607 if { (eval echo "$as_me:14607: \"$ac_link\"") >&5
14608   (eval $ac_link) 2>&5
14609   ac_status=$?
14610   echo "$as_me:14610: \$? = $ac_status" >&5
14611   (exit $ac_status); } &&
14612          { ac_try='test -s conftest$ac_exeext'
14613   { (eval echo "$as_me:14613: \"$ac_try\"") >&5
14614   (eval $ac_try) 2>&5
14615   ac_status=$?
14616   echo "$as_me:14616: \$? = $ac_status" >&5
14617   (exit $ac_status); }; }; then
14618   eval "$as_ac_Lib=yes"
14619 else
14620   echo "$as_me: failed program was:" >&5
14621 cat conftest.$ac_ext >&5
14622 eval "$as_ac_Lib=no"
14623 fi
14624 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14625 LIBS=$ac_check_lib_save_LIBS
14626 fi
14627 echo "$as_me:14627: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14628 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14629 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14630
14631 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14632
14633 cf_add_libs="-lpanel$cf_cv_libtype"
14634 # Filter out duplicates - this happens with badly-designed ".pc" files...
14635 for cf_add_1lib in $LIBS
14636 do
14637         for cf_add_2lib in $cf_add_libs
14638         do
14639                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14640                 then
14641                         cf_add_1lib=
14642                         break
14643                 fi
14644         done
14645         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14646 done
14647 LIBS="$cf_add_libs"
14648
14649                 cat >>confdefs.h <<EOF
14650 #define $cf_upper 1
14651 EOF
14652
14653 fi
14654
14655 fi
14656
14657         cf_curses_headers="$cf_curses_headers panel.h"
14658 fi
14659
14660 echo "$as_me:14660: checking if you want to check for menu functions" >&5
14661 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
14662
14663 # Check whether --enable-menu or --disable-menu was given.
14664 if test "${enable_menu+set}" = set; then
14665   enableval="$enable_menu"
14666   test "$enableval" != no && enableval=yes
14667         if test "$enableval" != "yes" ; then
14668     cf_enable_menu=no
14669         else
14670                 cf_enable_menu=$cf_default_menu
14671         fi
14672 else
14673   enableval=yes
14674         cf_enable_menu=$cf_default_menu
14675
14676 fi;
14677 echo "$as_me:14677: result: $cf_enable_menu" >&5
14678 echo "${ECHO_T}$cf_enable_menu" >&6
14679 if test $cf_enable_menu = yes
14680 then
14681         case $cf_cv_screen in
14682         (ncurses*)
14683                 ;;
14684         (curses*)
14685
14686 echo "$as_me:14686: checking for NetBSD menu.h" >&5
14687 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
14688 if test "${cf_cv_netbsd_menu_h+set}" = set; then
14689   echo $ECHO_N "(cached) $ECHO_C" >&6
14690 else
14691
14692 cat >conftest.$ac_ext <<_ACEOF
14693 #line 14693 "configure"
14694 #include "confdefs.h"
14695
14696 #include <${cf_cv_ncurses_header:-curses.h}>
14697 #include <menu.h>
14698
14699 int
14700 main (void)
14701 {
14702
14703         MENU *menu;
14704         int y = menu->max_item_width;
14705
14706   ;
14707   return 0;
14708 }
14709 _ACEOF
14710 rm -f conftest.$ac_objext
14711 if { (eval echo "$as_me:14711: \"$ac_compile\"") >&5
14712   (eval $ac_compile) 2>&5
14713   ac_status=$?
14714   echo "$as_me:14714: \$? = $ac_status" >&5
14715   (exit $ac_status); } &&
14716          { ac_try='test -s conftest.$ac_objext'
14717   { (eval echo "$as_me:14717: \"$ac_try\"") >&5
14718   (eval $ac_try) 2>&5
14719   ac_status=$?
14720   echo "$as_me:14720: \$? = $ac_status" >&5
14721   (exit $ac_status); }; }; then
14722   cf_cv_netbsd_menu_h=yes
14723
14724 else
14725   echo "$as_me: failed program was:" >&5
14726 cat conftest.$ac_ext >&5
14727 cf_cv_netbsd_menu_h=no
14728 fi
14729 rm -f conftest.$ac_objext conftest.$ac_ext
14730
14731 fi
14732 echo "$as_me:14732: result: $cf_cv_netbsd_menu_h" >&5
14733 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
14734
14735 test "$cf_cv_netbsd_menu_h" = yes &&
14736 cat >>confdefs.h <<\EOF
14737 #define HAVE_NETBSD_MENU_H 1
14738 EOF
14739
14740                 ;;
14741         esac
14742
14743 cf_have_curses_lib=no
14744
14745 : ${NCURSES_CONFIG_PKG:=none}
14746 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
14747         :
14748 elif test "x${PKG_CONFIG:=none}" != xnone; then
14749         echo "$as_me:14749: checking pkg-config for menu$cf_cv_libtype" >&5
14750 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
14751         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
14752                 echo "$as_me:14752: result: yes" >&5
14753 echo "${ECHO_T}yes" >&6
14754
14755                 echo "$as_me:14755: checking if the menu$cf_cv_libtype package files work" >&5
14756 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
14757
14758                 cf_save_CPPFLAGS="$CPPFLAGS"
14759                 cf_save_LIBS="$LIBS"
14760
14761 cf_fix_cppflags=no
14762 cf_new_cflags=
14763 cf_new_cppflags=
14764 cf_new_extra_cppflags=
14765
14766 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
14767 do
14768 case $cf_fix_cppflags in
14769 (no)
14770         case $cf_add_cflags in
14771         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14772                 case $cf_add_cflags in
14773                 (-D*)
14774                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14775
14776                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14777                                 && test -z "${cf_tst_cflags}" \
14778                                 && cf_fix_cppflags=yes
14779
14780                         if test $cf_fix_cppflags = yes ; then
14781
14782         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14783         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14784
14785                                 continue
14786                         elif test "${cf_tst_cflags}" = "\"'" ; then
14787
14788         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14789         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14790
14791                                 continue
14792                         fi
14793                         ;;
14794                 esac
14795                 case "$CPPFLAGS" in
14796                 (*$cf_add_cflags)
14797                         ;;
14798                 (*)
14799                         case $cf_add_cflags in
14800                         (-D*)
14801                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14802
14803 CPPFLAGS=`echo "$CPPFLAGS" | \
14804         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14805                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14806
14807                                 ;;
14808                         esac
14809
14810         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14811         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14812
14813                         ;;
14814                 esac
14815                 ;;
14816         (*)
14817
14818         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14819         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14820
14821                 ;;
14822         esac
14823         ;;
14824 (yes)
14825
14826         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14827         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14828
14829         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14830
14831         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14832                 && test -z "${cf_tst_cflags}" \
14833                 && cf_fix_cppflags=no
14834         ;;
14835 esac
14836 done
14837
14838 if test -n "$cf_new_cflags" ; then
14839
14840         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14841         CFLAGS="${CFLAGS}$cf_new_cflags"
14842
14843 fi
14844
14845 if test -n "$cf_new_cppflags" ; then
14846
14847         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14848         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14849
14850 fi
14851
14852 if test -n "$cf_new_extra_cppflags" ; then
14853
14854         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14855         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14856
14857 fi
14858
14859 cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
14860 # Filter out duplicates - this happens with badly-designed ".pc" files...
14861 for cf_add_1lib in $LIBS
14862 do
14863         for cf_add_2lib in $cf_add_libs
14864         do
14865                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14866                 then
14867                         cf_add_1lib=
14868                         break
14869                 fi
14870         done
14871         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14872 done
14873 LIBS="$cf_add_libs"
14874
14875                 cat >conftest.$ac_ext <<_ACEOF
14876 #line 14876 "configure"
14877 #include "confdefs.h"
14878 #include <menu.h>
14879 int
14880 main (void)
14881 {
14882 (void) menu_driver ( 0,0 );
14883   ;
14884   return 0;
14885 }
14886 _ACEOF
14887 rm -f conftest.$ac_objext conftest$ac_exeext
14888 if { (eval echo "$as_me:14888: \"$ac_link\"") >&5
14889   (eval $ac_link) 2>&5
14890   ac_status=$?
14891   echo "$as_me:14891: \$? = $ac_status" >&5
14892   (exit $ac_status); } &&
14893          { ac_try='test -s conftest$ac_exeext'
14894   { (eval echo "$as_me:14894: \"$ac_try\"") >&5
14895   (eval $ac_try) 2>&5
14896   ac_status=$?
14897   echo "$as_me:14897: \$? = $ac_status" >&5
14898   (exit $ac_status); }; }; then
14899   if test "$cross_compiling" = yes; then
14900   cf_have_curses_lib=maybe
14901 else
14902   cat >conftest.$ac_ext <<_ACEOF
14903 #line 14903 "configure"
14904 #include "confdefs.h"
14905 #include <menu.h>
14906                                 int main(void)
14907                                 { (void) menu_driver ( 0,0 ); return 0; }
14908 _ACEOF
14909 rm -f conftest$ac_exeext
14910 if { (eval echo "$as_me:14910: \"$ac_link\"") >&5
14911   (eval $ac_link) 2>&5
14912   ac_status=$?
14913   echo "$as_me:14913: \$? = $ac_status" >&5
14914   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14915   { (eval echo "$as_me:14915: \"$ac_try\"") >&5
14916   (eval $ac_try) 2>&5
14917   ac_status=$?
14918   echo "$as_me:14918: \$? = $ac_status" >&5
14919   (exit $ac_status); }; }; then
14920   cf_have_curses_lib=yes
14921 else
14922   echo "$as_me: program exited with status $ac_status" >&5
14923 echo "$as_me: failed program was:" >&5
14924 cat conftest.$ac_ext >&5
14925 cf_have_curses_lib=no
14926 fi
14927 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14928 fi
14929 else
14930   echo "$as_me: failed program was:" >&5
14931 cat conftest.$ac_ext >&5
14932 cf_have_curses_lib=no
14933 fi
14934 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14935                 echo "$as_me:14935: result: $cf_have_curses_lib" >&5
14936 echo "${ECHO_T}$cf_have_curses_lib" >&6
14937                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
14938                 if test "$cf_have_curses_lib" != "yes"
14939                 then
14940                         CPPFLAGS="$cf_save_CPPFLAGS"
14941                         LIBS="$cf_save_LIBS"
14942                 else
14943
14944 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14945
14946                         cat >>confdefs.h <<EOF
14947 #define $cf_upper 1
14948 EOF
14949
14950                 fi
14951         fi
14952 fi
14953 if test "$cf_have_curses_lib" = no; then
14954         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
14955 echo "$as_me:14955: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
14956 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
14957 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14958   echo $ECHO_N "(cached) $ECHO_C" >&6
14959 else
14960   ac_check_lib_save_LIBS=$LIBS
14961 LIBS="-lmenu$cf_cv_libtype  $LIBS"
14962 cat >conftest.$ac_ext <<_ACEOF
14963 #line 14963 "configure"
14964 #include "confdefs.h"
14965
14966 /* Override any gcc2 internal prototype to avoid an error.  */
14967 #ifdef __cplusplus
14968 extern "C"
14969 #endif
14970 /* We use char because int might match the return type of a gcc2
14971    builtin and then its argument prototype would still apply.  */
14972 char menu_driver ();
14973 int
14974 main (void)
14975 {
14976 menu_driver ();
14977   ;
14978   return 0;
14979 }
14980 _ACEOF
14981 rm -f conftest.$ac_objext conftest$ac_exeext
14982 if { (eval echo "$as_me:14982: \"$ac_link\"") >&5
14983   (eval $ac_link) 2>&5
14984   ac_status=$?
14985   echo "$as_me:14985: \$? = $ac_status" >&5
14986   (exit $ac_status); } &&
14987          { ac_try='test -s conftest$ac_exeext'
14988   { (eval echo "$as_me:14988: \"$ac_try\"") >&5
14989   (eval $ac_try) 2>&5
14990   ac_status=$?
14991   echo "$as_me:14991: \$? = $ac_status" >&5
14992   (exit $ac_status); }; }; then
14993   eval "$as_ac_Lib=yes"
14994 else
14995   echo "$as_me: failed program was:" >&5
14996 cat conftest.$ac_ext >&5
14997 eval "$as_ac_Lib=no"
14998 fi
14999 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15000 LIBS=$ac_check_lib_save_LIBS
15001 fi
15002 echo "$as_me:15002: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15003 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15004 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15005
15006 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15007
15008 cf_add_libs="-lmenu$cf_cv_libtype"
15009 # Filter out duplicates - this happens with badly-designed ".pc" files...
15010 for cf_add_1lib in $LIBS
15011 do
15012         for cf_add_2lib in $cf_add_libs
15013         do
15014                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15015                 then
15016                         cf_add_1lib=
15017                         break
15018                 fi
15019         done
15020         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15021 done
15022 LIBS="$cf_add_libs"
15023
15024                 cat >>confdefs.h <<EOF
15025 #define $cf_upper 1
15026 EOF
15027
15028 fi
15029
15030 fi
15031
15032         cf_curses_headers="$cf_curses_headers menu.h"
15033 fi
15034
15035 echo "$as_me:15035: checking if you want to check for form functions" >&5
15036 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
15037
15038 # Check whether --enable-form or --disable-form was given.
15039 if test "${enable_form+set}" = set; then
15040   enableval="$enable_form"
15041   test "$enableval" != no && enableval=yes
15042         if test "$enableval" != "yes" ; then
15043     cf_enable_form=no
15044         else
15045                 cf_enable_form=$cf_default_form
15046         fi
15047 else
15048   enableval=yes
15049         cf_enable_form=$cf_default_form
15050
15051 fi;
15052 echo "$as_me:15052: result: $cf_enable_form" >&5
15053 echo "${ECHO_T}$cf_enable_form" >&6
15054 if test $cf_enable_form = yes
15055 then
15056         case $cf_cv_screen in
15057         (ncurses*)
15058                 ;;
15059         (curses*)
15060
15061 echo "$as_me:15061: checking for NetBSD form.h" >&5
15062 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
15063 if test "${cf_cv_netbsd_form_h+set}" = set; then
15064   echo $ECHO_N "(cached) $ECHO_C" >&6
15065 else
15066
15067 cat >conftest.$ac_ext <<_ACEOF
15068 #line 15068 "configure"
15069 #include "confdefs.h"
15070
15071 #include <${cf_cv_ncurses_header:-curses.h}>
15072 #include <form.h>
15073
15074 int
15075 main (void)
15076 {
15077
15078         FORM *form;
15079         int y = current_field(form)->cursor_ypos;
15080         int x = current_field(form)->cursor_xpos;
15081
15082   ;
15083   return 0;
15084 }
15085 _ACEOF
15086 rm -f conftest.$ac_objext
15087 if { (eval echo "$as_me:15087: \"$ac_compile\"") >&5
15088   (eval $ac_compile) 2>&5
15089   ac_status=$?
15090   echo "$as_me:15090: \$? = $ac_status" >&5
15091   (exit $ac_status); } &&
15092          { ac_try='test -s conftest.$ac_objext'
15093   { (eval echo "$as_me:15093: \"$ac_try\"") >&5
15094   (eval $ac_try) 2>&5
15095   ac_status=$?
15096   echo "$as_me:15096: \$? = $ac_status" >&5
15097   (exit $ac_status); }; }; then
15098   cf_cv_netbsd_form_h=yes
15099
15100 else
15101   echo "$as_me: failed program was:" >&5
15102 cat conftest.$ac_ext >&5
15103 cf_cv_netbsd_form_h=no
15104 fi
15105 rm -f conftest.$ac_objext conftest.$ac_ext
15106
15107 fi
15108 echo "$as_me:15108: result: $cf_cv_netbsd_form_h" >&5
15109 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
15110
15111 test "$cf_cv_netbsd_form_h" = yes &&
15112 cat >>confdefs.h <<\EOF
15113 #define HAVE_NETBSD_FORM_H 1
15114 EOF
15115
15116                 ;;
15117         esac
15118
15119 cf_have_curses_lib=no
15120
15121 : ${NCURSES_CONFIG_PKG:=none}
15122 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15123         :
15124 elif test "x${PKG_CONFIG:=none}" != xnone; then
15125         echo "$as_me:15125: checking pkg-config for form$cf_cv_libtype" >&5
15126 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
15127         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
15128                 echo "$as_me:15128: result: yes" >&5
15129 echo "${ECHO_T}yes" >&6
15130
15131                 echo "$as_me:15131: checking if the form$cf_cv_libtype package files work" >&5
15132 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
15133
15134                 cf_save_CPPFLAGS="$CPPFLAGS"
15135                 cf_save_LIBS="$LIBS"
15136
15137 cf_fix_cppflags=no
15138 cf_new_cflags=
15139 cf_new_cppflags=
15140 cf_new_extra_cppflags=
15141
15142 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
15143 do
15144 case $cf_fix_cppflags in
15145 (no)
15146         case $cf_add_cflags in
15147         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15148                 case $cf_add_cflags in
15149                 (-D*)
15150                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15151
15152                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15153                                 && test -z "${cf_tst_cflags}" \
15154                                 && cf_fix_cppflags=yes
15155
15156                         if test $cf_fix_cppflags = yes ; then
15157
15158         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15159         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15160
15161                                 continue
15162                         elif test "${cf_tst_cflags}" = "\"'" ; then
15163
15164         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15165         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15166
15167                                 continue
15168                         fi
15169                         ;;
15170                 esac
15171                 case "$CPPFLAGS" in
15172                 (*$cf_add_cflags)
15173                         ;;
15174                 (*)
15175                         case $cf_add_cflags in
15176                         (-D*)
15177                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15178
15179 CPPFLAGS=`echo "$CPPFLAGS" | \
15180         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15181                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15182
15183                                 ;;
15184                         esac
15185
15186         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15187         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15188
15189                         ;;
15190                 esac
15191                 ;;
15192         (*)
15193
15194         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15195         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15196
15197                 ;;
15198         esac
15199         ;;
15200 (yes)
15201
15202         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15203         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15204
15205         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15206
15207         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15208                 && test -z "${cf_tst_cflags}" \
15209                 && cf_fix_cppflags=no
15210         ;;
15211 esac
15212 done
15213
15214 if test -n "$cf_new_cflags" ; then
15215
15216         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15217         CFLAGS="${CFLAGS}$cf_new_cflags"
15218
15219 fi
15220
15221 if test -n "$cf_new_cppflags" ; then
15222
15223         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15224         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15225
15226 fi
15227
15228 if test -n "$cf_new_extra_cppflags" ; then
15229
15230         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15231         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15232
15233 fi
15234
15235 cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
15236 # Filter out duplicates - this happens with badly-designed ".pc" files...
15237 for cf_add_1lib in $LIBS
15238 do
15239         for cf_add_2lib in $cf_add_libs
15240         do
15241                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15242                 then
15243                         cf_add_1lib=
15244                         break
15245                 fi
15246         done
15247         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15248 done
15249 LIBS="$cf_add_libs"
15250
15251                 cat >conftest.$ac_ext <<_ACEOF
15252 #line 15252 "configure"
15253 #include "confdefs.h"
15254 #include <form.h>
15255 int
15256 main (void)
15257 {
15258 (void) form_driver ( 0,0 );
15259   ;
15260   return 0;
15261 }
15262 _ACEOF
15263 rm -f conftest.$ac_objext conftest$ac_exeext
15264 if { (eval echo "$as_me:15264: \"$ac_link\"") >&5
15265   (eval $ac_link) 2>&5
15266   ac_status=$?
15267   echo "$as_me:15267: \$? = $ac_status" >&5
15268   (exit $ac_status); } &&
15269          { ac_try='test -s conftest$ac_exeext'
15270   { (eval echo "$as_me:15270: \"$ac_try\"") >&5
15271   (eval $ac_try) 2>&5
15272   ac_status=$?
15273   echo "$as_me:15273: \$? = $ac_status" >&5
15274   (exit $ac_status); }; }; then
15275   if test "$cross_compiling" = yes; then
15276   cf_have_curses_lib=maybe
15277 else
15278   cat >conftest.$ac_ext <<_ACEOF
15279 #line 15279 "configure"
15280 #include "confdefs.h"
15281 #include <form.h>
15282                                 int main(void)
15283                                 { (void) form_driver ( 0,0 ); return 0; }
15284 _ACEOF
15285 rm -f conftest$ac_exeext
15286 if { (eval echo "$as_me:15286: \"$ac_link\"") >&5
15287   (eval $ac_link) 2>&5
15288   ac_status=$?
15289   echo "$as_me:15289: \$? = $ac_status" >&5
15290   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15291   { (eval echo "$as_me:15291: \"$ac_try\"") >&5
15292   (eval $ac_try) 2>&5
15293   ac_status=$?
15294   echo "$as_me:15294: \$? = $ac_status" >&5
15295   (exit $ac_status); }; }; then
15296   cf_have_curses_lib=yes
15297 else
15298   echo "$as_me: program exited with status $ac_status" >&5
15299 echo "$as_me: failed program was:" >&5
15300 cat conftest.$ac_ext >&5
15301 cf_have_curses_lib=no
15302 fi
15303 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15304 fi
15305 else
15306   echo "$as_me: failed program was:" >&5
15307 cat conftest.$ac_ext >&5
15308 cf_have_curses_lib=no
15309 fi
15310 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15311                 echo "$as_me:15311: result: $cf_have_curses_lib" >&5
15312 echo "${ECHO_T}$cf_have_curses_lib" >&6
15313                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15314                 if test "$cf_have_curses_lib" != "yes"
15315                 then
15316                         CPPFLAGS="$cf_save_CPPFLAGS"
15317                         LIBS="$cf_save_LIBS"
15318                 else
15319
15320 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15321
15322                         cat >>confdefs.h <<EOF
15323 #define $cf_upper 1
15324 EOF
15325
15326                 fi
15327         fi
15328 fi
15329 if test "$cf_have_curses_lib" = no; then
15330         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
15331 echo "$as_me:15331: checking for form_driver in -lform$cf_cv_libtype" >&5
15332 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
15333 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15334   echo $ECHO_N "(cached) $ECHO_C" >&6
15335 else
15336   ac_check_lib_save_LIBS=$LIBS
15337 LIBS="-lform$cf_cv_libtype  $LIBS"
15338 cat >conftest.$ac_ext <<_ACEOF
15339 #line 15339 "configure"
15340 #include "confdefs.h"
15341
15342 /* Override any gcc2 internal prototype to avoid an error.  */
15343 #ifdef __cplusplus
15344 extern "C"
15345 #endif
15346 /* We use char because int might match the return type of a gcc2
15347    builtin and then its argument prototype would still apply.  */
15348 char form_driver ();
15349 int
15350 main (void)
15351 {
15352 form_driver ();
15353   ;
15354   return 0;
15355 }
15356 _ACEOF
15357 rm -f conftest.$ac_objext conftest$ac_exeext
15358 if { (eval echo "$as_me:15358: \"$ac_link\"") >&5
15359   (eval $ac_link) 2>&5
15360   ac_status=$?
15361   echo "$as_me:15361: \$? = $ac_status" >&5
15362   (exit $ac_status); } &&
15363          { ac_try='test -s conftest$ac_exeext'
15364   { (eval echo "$as_me:15364: \"$ac_try\"") >&5
15365   (eval $ac_try) 2>&5
15366   ac_status=$?
15367   echo "$as_me:15367: \$? = $ac_status" >&5
15368   (exit $ac_status); }; }; then
15369   eval "$as_ac_Lib=yes"
15370 else
15371   echo "$as_me: failed program was:" >&5
15372 cat conftest.$ac_ext >&5
15373 eval "$as_ac_Lib=no"
15374 fi
15375 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15376 LIBS=$ac_check_lib_save_LIBS
15377 fi
15378 echo "$as_me:15378: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15379 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15380 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15381
15382 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15383
15384 cf_add_libs="-lform$cf_cv_libtype"
15385 # Filter out duplicates - this happens with badly-designed ".pc" files...
15386 for cf_add_1lib in $LIBS
15387 do
15388         for cf_add_2lib in $cf_add_libs
15389         do
15390                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15391                 then
15392                         cf_add_1lib=
15393                         break
15394                 fi
15395         done
15396         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15397 done
15398 LIBS="$cf_add_libs"
15399
15400                 cat >>confdefs.h <<EOF
15401 #define $cf_upper 1
15402 EOF
15403
15404 fi
15405
15406 fi
15407
15408         cf_curses_headers="$cf_curses_headers form.h"
15409 fi
15410
15411 # look for curses-related headers
15412
15413 for ac_header in $cf_curses_headers
15414 do
15415 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15416 echo "$as_me:15416: checking for $ac_header" >&5
15417 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15418 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15419   echo $ECHO_N "(cached) $ECHO_C" >&6
15420 else
15421   cat >conftest.$ac_ext <<_ACEOF
15422 #line 15422 "configure"
15423 #include "confdefs.h"
15424 #include <$ac_header>
15425 _ACEOF
15426 if { (eval echo "$as_me:15426: \"$ac_cpp conftest.$ac_ext\"") >&5
15427   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15428   ac_status=$?
15429   egrep -v '^ *\+' conftest.er1 >conftest.err
15430   rm -f conftest.er1
15431   cat conftest.err >&5
15432   echo "$as_me:15432: \$? = $ac_status" >&5
15433   (exit $ac_status); } >/dev/null; then
15434   if test -s conftest.err; then
15435     ac_cpp_err=$ac_c_preproc_warn_flag
15436   else
15437     ac_cpp_err=
15438   fi
15439 else
15440   ac_cpp_err=yes
15441 fi
15442 if test -z "$ac_cpp_err"; then
15443   eval "$as_ac_Header=yes"
15444 else
15445   echo "$as_me: failed program was:" >&5
15446   cat conftest.$ac_ext >&5
15447   eval "$as_ac_Header=no"
15448 fi
15449 rm -f conftest.err conftest.$ac_ext
15450 fi
15451 echo "$as_me:15451: result: `eval echo '${'$as_ac_Header'}'`" >&5
15452 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15453 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15454   cat >>confdefs.h <<EOF
15455 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15456 EOF
15457
15458 fi
15459 done
15460
15461 echo "$as_me:15461: checking for ANSI C header files" >&5
15462 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15463 if test "${ac_cv_header_stdc+set}" = set; then
15464   echo $ECHO_N "(cached) $ECHO_C" >&6
15465 else
15466   cat >conftest.$ac_ext <<_ACEOF
15467 #line 15467 "configure"
15468 #include "confdefs.h"
15469 #include <stdlib.h>
15470 #include <stdarg.h>
15471 #include <string.h>
15472 #include <float.h>
15473
15474 _ACEOF
15475 if { (eval echo "$as_me:15475: \"$ac_cpp conftest.$ac_ext\"") >&5
15476   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15477   ac_status=$?
15478   egrep -v '^ *\+' conftest.er1 >conftest.err
15479   rm -f conftest.er1
15480   cat conftest.err >&5
15481   echo "$as_me:15481: \$? = $ac_status" >&5
15482   (exit $ac_status); } >/dev/null; then
15483   if test -s conftest.err; then
15484     ac_cpp_err=$ac_c_preproc_warn_flag
15485   else
15486     ac_cpp_err=
15487   fi
15488 else
15489   ac_cpp_err=yes
15490 fi
15491 if test -z "$ac_cpp_err"; then
15492   ac_cv_header_stdc=yes
15493 else
15494   echo "$as_me: failed program was:" >&5
15495   cat conftest.$ac_ext >&5
15496   ac_cv_header_stdc=no
15497 fi
15498 rm -f conftest.err conftest.$ac_ext
15499
15500 if test $ac_cv_header_stdc = yes; then
15501   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15502   cat >conftest.$ac_ext <<_ACEOF
15503 #line 15503 "configure"
15504 #include "confdefs.h"
15505 #include <string.h>
15506
15507 _ACEOF
15508 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15509   egrep "memchr" >/dev/null 2>&1; then
15510   :
15511 else
15512   ac_cv_header_stdc=no
15513 fi
15514 rm -rf conftest*
15515
15516 fi
15517
15518 if test $ac_cv_header_stdc = yes; then
15519   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15520   cat >conftest.$ac_ext <<_ACEOF
15521 #line 15521 "configure"
15522 #include "confdefs.h"
15523 #include <stdlib.h>
15524
15525 _ACEOF
15526 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15527   egrep "free" >/dev/null 2>&1; then
15528   :
15529 else
15530   ac_cv_header_stdc=no
15531 fi
15532 rm -rf conftest*
15533
15534 fi
15535
15536 if test $ac_cv_header_stdc = yes; then
15537   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15538   if test "$cross_compiling" = yes; then
15539   :
15540 else
15541   cat >conftest.$ac_ext <<_ACEOF
15542 #line 15542 "configure"
15543 #include "confdefs.h"
15544 #include <ctype.h>
15545 #if ((' ' & 0x0FF) == 0x020)
15546 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15547 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15548 #else
15549 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15550                      || ('j' <= (c) && (c) <= 'r') \
15551                      || ('s' <= (c) && (c) <= 'z'))
15552 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15553 #endif
15554
15555 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15556 int
15557 main (void)
15558 {
15559   int i;
15560   for (i = 0; i < 256; i++)
15561     if (XOR (islower (i), ISLOWER (i))
15562         || toupper (i) != TOUPPER (i))
15563       $ac_main_return(2);
15564   $ac_main_return (0);
15565 }
15566 _ACEOF
15567 rm -f conftest$ac_exeext
15568 if { (eval echo "$as_me:15568: \"$ac_link\"") >&5
15569   (eval $ac_link) 2>&5
15570   ac_status=$?
15571   echo "$as_me:15571: \$? = $ac_status" >&5
15572   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15573   { (eval echo "$as_me:15573: \"$ac_try\"") >&5
15574   (eval $ac_try) 2>&5
15575   ac_status=$?
15576   echo "$as_me:15576: \$? = $ac_status" >&5
15577   (exit $ac_status); }; }; then
15578   :
15579 else
15580   echo "$as_me: program exited with status $ac_status" >&5
15581 echo "$as_me: failed program was:" >&5
15582 cat conftest.$ac_ext >&5
15583 ac_cv_header_stdc=no
15584 fi
15585 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15586 fi
15587 fi
15588 fi
15589 echo "$as_me:15589: result: $ac_cv_header_stdc" >&5
15590 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15591 if test $ac_cv_header_stdc = yes; then
15592
15593 cat >>confdefs.h <<\EOF
15594 #define STDC_HEADERS 1
15595 EOF
15596
15597 fi
15598
15599 echo "$as_me:15599: checking whether time.h and sys/time.h may both be included" >&5
15600 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
15601 if test "${ac_cv_header_time+set}" = set; then
15602   echo $ECHO_N "(cached) $ECHO_C" >&6
15603 else
15604   cat >conftest.$ac_ext <<_ACEOF
15605 #line 15605 "configure"
15606 #include "confdefs.h"
15607 #include <sys/types.h>
15608 #include <sys/time.h>
15609 #include <time.h>
15610
15611 int
15612 main (void)
15613 {
15614 if ((struct tm *) 0)
15615 return 0;
15616   ;
15617   return 0;
15618 }
15619 _ACEOF
15620 rm -f conftest.$ac_objext
15621 if { (eval echo "$as_me:15621: \"$ac_compile\"") >&5
15622   (eval $ac_compile) 2>&5
15623   ac_status=$?
15624   echo "$as_me:15624: \$? = $ac_status" >&5
15625   (exit $ac_status); } &&
15626          { ac_try='test -s conftest.$ac_objext'
15627   { (eval echo "$as_me:15627: \"$ac_try\"") >&5
15628   (eval $ac_try) 2>&5
15629   ac_status=$?
15630   echo "$as_me:15630: \$? = $ac_status" >&5
15631   (exit $ac_status); }; }; then
15632   ac_cv_header_time=yes
15633 else
15634   echo "$as_me: failed program was:" >&5
15635 cat conftest.$ac_ext >&5
15636 ac_cv_header_time=no
15637 fi
15638 rm -f conftest.$ac_objext conftest.$ac_ext
15639 fi
15640 echo "$as_me:15640: result: $ac_cv_header_time" >&5
15641 echo "${ECHO_T}$ac_cv_header_time" >&6
15642 if test $ac_cv_header_time = yes; then
15643
15644 cat >>confdefs.h <<\EOF
15645 #define TIME_WITH_SYS_TIME 1
15646 EOF
15647
15648 fi
15649
15650 for ac_header in \
15651 getopt.h \
15652 locale.h \
15653 math.h \
15654 stdarg.h \
15655 stdint.h \
15656 sys/ioctl.h \
15657 sys/select.h \
15658 sys/time.h \
15659 termios.h \
15660 unistd.h \
15661
15662 do
15663 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15664 echo "$as_me:15664: checking for $ac_header" >&5
15665 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15666 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15667   echo $ECHO_N "(cached) $ECHO_C" >&6
15668 else
15669   cat >conftest.$ac_ext <<_ACEOF
15670 #line 15670 "configure"
15671 #include "confdefs.h"
15672 #include <$ac_header>
15673 _ACEOF
15674 if { (eval echo "$as_me:15674: \"$ac_cpp conftest.$ac_ext\"") >&5
15675   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15676   ac_status=$?
15677   egrep -v '^ *\+' conftest.er1 >conftest.err
15678   rm -f conftest.er1
15679   cat conftest.err >&5
15680   echo "$as_me:15680: \$? = $ac_status" >&5
15681   (exit $ac_status); } >/dev/null; then
15682   if test -s conftest.err; then
15683     ac_cpp_err=$ac_c_preproc_warn_flag
15684   else
15685     ac_cpp_err=
15686   fi
15687 else
15688   ac_cpp_err=yes
15689 fi
15690 if test -z "$ac_cpp_err"; then
15691   eval "$as_ac_Header=yes"
15692 else
15693   echo "$as_me: failed program was:" >&5
15694   cat conftest.$ac_ext >&5
15695   eval "$as_ac_Header=no"
15696 fi
15697 rm -f conftest.err conftest.$ac_ext
15698 fi
15699 echo "$as_me:15699: result: `eval echo '${'$as_ac_Header'}'`" >&5
15700 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15701 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15702   cat >>confdefs.h <<EOF
15703 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15704 EOF
15705
15706 fi
15707 done
15708
15709 for ac_header in unistd.h getopt.h
15710 do
15711 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15712 echo "$as_me:15712: checking for $ac_header" >&5
15713 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15714 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15715   echo $ECHO_N "(cached) $ECHO_C" >&6
15716 else
15717   cat >conftest.$ac_ext <<_ACEOF
15718 #line 15718 "configure"
15719 #include "confdefs.h"
15720 #include <$ac_header>
15721 _ACEOF
15722 if { (eval echo "$as_me:15722: \"$ac_cpp conftest.$ac_ext\"") >&5
15723   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15724   ac_status=$?
15725   egrep -v '^ *\+' conftest.er1 >conftest.err
15726   rm -f conftest.er1
15727   cat conftest.err >&5
15728   echo "$as_me:15728: \$? = $ac_status" >&5
15729   (exit $ac_status); } >/dev/null; then
15730   if test -s conftest.err; then
15731     ac_cpp_err=$ac_c_preproc_warn_flag
15732   else
15733     ac_cpp_err=
15734   fi
15735 else
15736   ac_cpp_err=yes
15737 fi
15738 if test -z "$ac_cpp_err"; then
15739   eval "$as_ac_Header=yes"
15740 else
15741   echo "$as_me: failed program was:" >&5
15742   cat conftest.$ac_ext >&5
15743   eval "$as_ac_Header=no"
15744 fi
15745 rm -f conftest.err conftest.$ac_ext
15746 fi
15747 echo "$as_me:15747: result: `eval echo '${'$as_ac_Header'}'`" >&5
15748 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15749 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15750   cat >>confdefs.h <<EOF
15751 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15752 EOF
15753
15754 fi
15755 done
15756
15757 echo "$as_me:15757: checking for header declaring getopt variables" >&5
15758 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
15759 if test "${cf_cv_getopt_header+set}" = set; then
15760   echo $ECHO_N "(cached) $ECHO_C" >&6
15761 else
15762
15763 cf_cv_getopt_header=none
15764 for cf_header in stdio.h stdlib.h unistd.h getopt.h
15765 do
15766 cat >conftest.$ac_ext <<_ACEOF
15767 #line 15767 "configure"
15768 #include "confdefs.h"
15769
15770 #include <$cf_header>
15771 int
15772 main (void)
15773 {
15774 int x = optind; char *y = optarg
15775   ;
15776   return 0;
15777 }
15778 _ACEOF
15779 rm -f conftest.$ac_objext
15780 if { (eval echo "$as_me:15780: \"$ac_compile\"") >&5
15781   (eval $ac_compile) 2>&5
15782   ac_status=$?
15783   echo "$as_me:15783: \$? = $ac_status" >&5
15784   (exit $ac_status); } &&
15785          { ac_try='test -s conftest.$ac_objext'
15786   { (eval echo "$as_me:15786: \"$ac_try\"") >&5
15787   (eval $ac_try) 2>&5
15788   ac_status=$?
15789   echo "$as_me:15789: \$? = $ac_status" >&5
15790   (exit $ac_status); }; }; then
15791   cf_cv_getopt_header=$cf_header
15792  break
15793 else
15794   echo "$as_me: failed program was:" >&5
15795 cat conftest.$ac_ext >&5
15796 fi
15797 rm -f conftest.$ac_objext conftest.$ac_ext
15798 done
15799
15800 fi
15801 echo "$as_me:15801: result: $cf_cv_getopt_header" >&5
15802 echo "${ECHO_T}$cf_cv_getopt_header" >&6
15803 if test $cf_cv_getopt_header != none ; then
15804
15805 cat >>confdefs.h <<\EOF
15806 #define HAVE_GETOPT_HEADER 1
15807 EOF
15808
15809 fi
15810 if test $cf_cv_getopt_header = getopt.h ; then
15811
15812 cat >>confdefs.h <<\EOF
15813 #define NEED_GETOPT_H 1
15814 EOF
15815
15816 fi
15817
15818 for ac_func in \
15819 getopt \
15820 gettimeofday \
15821 tdestroy \
15822 tsearch \
15823
15824 do
15825 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15826 echo "$as_me:15826: checking for $ac_func" >&5
15827 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15828 if eval "test \"\${$as_ac_var+set}\" = set"; then
15829   echo $ECHO_N "(cached) $ECHO_C" >&6
15830 else
15831   cat >conftest.$ac_ext <<_ACEOF
15832 #line 15832 "configure"
15833 #include "confdefs.h"
15834 /* System header to define __stub macros and hopefully few prototypes,
15835     which can conflict with char $ac_func (); below.  */
15836 #include <assert.h>
15837 /* Override any gcc2 internal prototype to avoid an error.  */
15838 #ifdef __cplusplus
15839 extern "C"
15840 #endif
15841 /* We use char because int might match the return type of a gcc2
15842    builtin and then its argument prototype would still apply.  */
15843 char $ac_func ();
15844 char (*f) ();
15845
15846 int
15847 main (void)
15848 {
15849 /* The GNU C library defines this for functions which it implements
15850     to always fail with ENOSYS.  Some functions are actually named
15851     something starting with __ and the normal name is an alias.  */
15852 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15853 choke me
15854 #else
15855 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15856 #endif
15857
15858   ;
15859   return 0;
15860 }
15861 _ACEOF
15862 rm -f conftest.$ac_objext conftest$ac_exeext
15863 if { (eval echo "$as_me:15863: \"$ac_link\"") >&5
15864   (eval $ac_link) 2>&5
15865   ac_status=$?
15866   echo "$as_me:15866: \$? = $ac_status" >&5
15867   (exit $ac_status); } &&
15868          { ac_try='test -s conftest$ac_exeext'
15869   { (eval echo "$as_me:15869: \"$ac_try\"") >&5
15870   (eval $ac_try) 2>&5
15871   ac_status=$?
15872   echo "$as_me:15872: \$? = $ac_status" >&5
15873   (exit $ac_status); }; }; then
15874   eval "$as_ac_var=yes"
15875 else
15876   echo "$as_me: failed program was:" >&5
15877 cat conftest.$ac_ext >&5
15878 eval "$as_ac_var=no"
15879 fi
15880 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15881 fi
15882 echo "$as_me:15882: result: `eval echo '${'$as_ac_var'}'`" >&5
15883 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15884 if test `eval echo '${'$as_ac_var'}'` = yes; then
15885   cat >>confdefs.h <<EOF
15886 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15887 EOF
15888
15889 fi
15890 done
15891
15892 # use a compile-check to work with ncurses*-config and subdirectory includes
15893 echo "$as_me:15893: checking if we can use termcap.h" >&5
15894 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
15895 if test "${cf_cv_have_termcap_h+set}" = set; then
15896   echo $ECHO_N "(cached) $ECHO_C" >&6
15897 else
15898
15899         cat >conftest.$ac_ext <<_ACEOF
15900 #line 15900 "configure"
15901 #include "confdefs.h"
15902
15903 #include <curses.h>
15904 #include <termcap.h>
15905
15906 int
15907 main (void)
15908 {
15909 return 0;
15910   ;
15911   return 0;
15912 }
15913 _ACEOF
15914 rm -f conftest.$ac_objext
15915 if { (eval echo "$as_me:15915: \"$ac_compile\"") >&5
15916   (eval $ac_compile) 2>&5
15917   ac_status=$?
15918   echo "$as_me:15918: \$? = $ac_status" >&5
15919   (exit $ac_status); } &&
15920          { ac_try='test -s conftest.$ac_objext'
15921   { (eval echo "$as_me:15921: \"$ac_try\"") >&5
15922   (eval $ac_try) 2>&5
15923   ac_status=$?
15924   echo "$as_me:15924: \$? = $ac_status" >&5
15925   (exit $ac_status); }; }; then
15926   cf_cv_have_termcap_h=yes
15927 else
15928   echo "$as_me: failed program was:" >&5
15929 cat conftest.$ac_ext >&5
15930 cf_cv_have_termcap_h=no
15931 fi
15932 rm -f conftest.$ac_objext conftest.$ac_ext
15933 fi
15934 echo "$as_me:15934: result: $cf_cv_have_termcap_h" >&5
15935 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
15936 test "x$cf_cv_have_termcap_h" = xyes && cat >>confdefs.h <<\EOF
15937 #define HAVE_TERMCAP_H 1
15938 EOF
15939
15940 if test "x$ac_cv_func_getopt" = xno; then
15941         { { echo "$as_me:15941: error: getopt is required for building programs" >&5
15942 echo "$as_me: error: getopt is required for building programs" >&2;}
15943    { (exit 1); exit 1; }; }
15944 fi
15945
15946 if test "$cf_enable_widec" = yes; then
15947
15948 for ac_func in \
15949 mblen \
15950 mbrlen \
15951 mbrtowc \
15952 mbsrtowcs \
15953 mbstowcs \
15954 mbtowc \
15955 wcsrtombs \
15956 wcstombs \
15957
15958 do
15959 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15960 echo "$as_me:15960: checking for $ac_func" >&5
15961 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15962 if eval "test \"\${$as_ac_var+set}\" = set"; then
15963   echo $ECHO_N "(cached) $ECHO_C" >&6
15964 else
15965   cat >conftest.$ac_ext <<_ACEOF
15966 #line 15966 "configure"
15967 #include "confdefs.h"
15968 /* System header to define __stub macros and hopefully few prototypes,
15969     which can conflict with char $ac_func (); below.  */
15970 #include <assert.h>
15971 /* Override any gcc2 internal prototype to avoid an error.  */
15972 #ifdef __cplusplus
15973 extern "C"
15974 #endif
15975 /* We use char because int might match the return type of a gcc2
15976    builtin and then its argument prototype would still apply.  */
15977 char $ac_func ();
15978 char (*f) ();
15979
15980 int
15981 main (void)
15982 {
15983 /* The GNU C library defines this for functions which it implements
15984     to always fail with ENOSYS.  Some functions are actually named
15985     something starting with __ and the normal name is an alias.  */
15986 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15987 choke me
15988 #else
15989 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15990 #endif
15991
15992   ;
15993   return 0;
15994 }
15995 _ACEOF
15996 rm -f conftest.$ac_objext conftest$ac_exeext
15997 if { (eval echo "$as_me:15997: \"$ac_link\"") >&5
15998   (eval $ac_link) 2>&5
15999   ac_status=$?
16000   echo "$as_me:16000: \$? = $ac_status" >&5
16001   (exit $ac_status); } &&
16002          { ac_try='test -s conftest$ac_exeext'
16003   { (eval echo "$as_me:16003: \"$ac_try\"") >&5
16004   (eval $ac_try) 2>&5
16005   ac_status=$?
16006   echo "$as_me:16006: \$? = $ac_status" >&5
16007   (exit $ac_status); }; }; then
16008   eval "$as_ac_var=yes"
16009 else
16010   echo "$as_me: failed program was:" >&5
16011 cat conftest.$ac_ext >&5
16012 eval "$as_ac_var=no"
16013 fi
16014 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16015 fi
16016 echo "$as_me:16016: result: `eval echo '${'$as_ac_var'}'`" >&5
16017 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
16018 if test `eval echo '${'$as_ac_var'}'` = yes; then
16019   cat >>confdefs.h <<EOF
16020 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
16021 EOF
16022
16023 fi
16024 done
16025
16026 fi
16027
16028 echo "$as_me:16028: checking definition to turn on extended curses functions" >&5
16029 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
16030 if test "${cf_cv_need_xopen_extension+set}" = set; then
16031   echo $ECHO_N "(cached) $ECHO_C" >&6
16032 else
16033
16034 cf_cv_need_xopen_extension=unknown
16035 cat >conftest.$ac_ext <<_ACEOF
16036 #line 16036 "configure"
16037 #include "confdefs.h"
16038
16039 #include <stdlib.h>
16040 #include <${cf_cv_ncurses_header:-curses.h}>
16041 int
16042 main (void)
16043 {
16044
16045 #if defined(NCURSES_VERSION_PATCH)
16046 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
16047         make an error
16048 #endif
16049 #endif
16050 #ifdef NCURSES_VERSION
16051         cchar_t check;
16052         int check2 = curs_set((int)sizeof(check));
16053 #endif
16054         long x = winnstr(stdscr, "", 0);
16055         int x1, y1;
16056         getbegyx(stdscr, y1, x1)
16057   ;
16058   return 0;
16059 }
16060 _ACEOF
16061 rm -f conftest.$ac_objext conftest$ac_exeext
16062 if { (eval echo "$as_me:16062: \"$ac_link\"") >&5
16063   (eval $ac_link) 2>&5
16064   ac_status=$?
16065   echo "$as_me:16065: \$? = $ac_status" >&5
16066   (exit $ac_status); } &&
16067          { ac_try='test -s conftest$ac_exeext'
16068   { (eval echo "$as_me:16068: \"$ac_try\"") >&5
16069   (eval $ac_try) 2>&5
16070   ac_status=$?
16071   echo "$as_me:16071: \$? = $ac_status" >&5
16072   (exit $ac_status); }; }; then
16073   cf_cv_need_xopen_extension=none
16074 else
16075   echo "$as_me: failed program was:" >&5
16076 cat conftest.$ac_ext >&5
16077
16078         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
16079         do
16080                 cat >conftest.$ac_ext <<_ACEOF
16081 #line 16081 "configure"
16082 #include "confdefs.h"
16083
16084 #define $cf_try_xopen_extension 1
16085 #include <stdlib.h>
16086 #include <${cf_cv_ncurses_header:-curses.h}>
16087 int
16088 main (void)
16089 {
16090
16091 #ifdef NCURSES_VERSION
16092                 cchar_t check;
16093                 int check2 = curs_set((int)sizeof(check));
16094 #endif
16095                 long x = winnstr(stdscr, "", 0);
16096                 int x1, y1;
16097                 getbegyx(stdscr, y1, x1)
16098   ;
16099   return 0;
16100 }
16101 _ACEOF
16102 rm -f conftest.$ac_objext conftest$ac_exeext
16103 if { (eval echo "$as_me:16103: \"$ac_link\"") >&5
16104   (eval $ac_link) 2>&5
16105   ac_status=$?
16106   echo "$as_me:16106: \$? = $ac_status" >&5
16107   (exit $ac_status); } &&
16108          { ac_try='test -s conftest$ac_exeext'
16109   { (eval echo "$as_me:16109: \"$ac_try\"") >&5
16110   (eval $ac_try) 2>&5
16111   ac_status=$?
16112   echo "$as_me:16112: \$? = $ac_status" >&5
16113   (exit $ac_status); }; }; then
16114   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
16115 else
16116   echo "$as_me: failed program was:" >&5
16117 cat conftest.$ac_ext >&5
16118 fi
16119 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16120         done
16121
16122 fi
16123 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16124
16125 fi
16126 echo "$as_me:16126: result: $cf_cv_need_xopen_extension" >&5
16127 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
16128
16129 case $cf_cv_need_xopen_extension in
16130 (*_*)
16131         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
16132         ;;
16133 esac
16134
16135 echo "$as_me:16135: checking for term.h" >&5
16136 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
16137 if test "${cf_cv_term_header+set}" = set; then
16138   echo $ECHO_N "(cached) $ECHO_C" >&6
16139 else
16140
16141 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
16142 # for <term.h> if we do not find the variant.
16143
16144 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
16145
16146 case ${cf_cv_ncurses_header:-curses.h} in
16147 (*/*)
16148         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
16149         cf_header_list="$cf_header_item $cf_header_list"
16150         ;;
16151 esac
16152
16153 for cf_header in $cf_header_list
16154 do
16155         cat >conftest.$ac_ext <<_ACEOF
16156 #line 16156 "configure"
16157 #include "confdefs.h"
16158
16159 #include <${cf_cv_ncurses_header:-curses.h}>
16160 #include <${cf_header}>
16161 int
16162 main (void)
16163 {
16164 WINDOW *x
16165   ;
16166   return 0;
16167 }
16168 _ACEOF
16169 rm -f conftest.$ac_objext
16170 if { (eval echo "$as_me:16170: \"$ac_compile\"") >&5
16171   (eval $ac_compile) 2>&5
16172   ac_status=$?
16173   echo "$as_me:16173: \$? = $ac_status" >&5
16174   (exit $ac_status); } &&
16175          { ac_try='test -s conftest.$ac_objext'
16176   { (eval echo "$as_me:16176: \"$ac_try\"") >&5
16177   (eval $ac_try) 2>&5
16178   ac_status=$?
16179   echo "$as_me:16179: \$? = $ac_status" >&5
16180   (exit $ac_status); }; }; then
16181   cf_cv_term_header=$cf_header
16182          break
16183 else
16184   echo "$as_me: failed program was:" >&5
16185 cat conftest.$ac_ext >&5
16186 cf_cv_term_header=no
16187 fi
16188 rm -f conftest.$ac_objext conftest.$ac_ext
16189 done
16190
16191 case $cf_cv_term_header in
16192 (no)
16193         # If curses is ncurses, some packagers still mess it up by trying to make
16194         # us use GNU termcap.  This handles the most common case.
16195         for cf_header in ncurses/term.h ncursesw/term.h
16196         do
16197                 cat >conftest.$ac_ext <<_ACEOF
16198 #line 16198 "configure"
16199 #include "confdefs.h"
16200
16201 #include <${cf_cv_ncurses_header:-curses.h}>
16202 #ifdef NCURSES_VERSION
16203 #include <${cf_header}>
16204 #else
16205 make an error
16206 #endif
16207 int
16208 main (void)
16209 {
16210 WINDOW *x
16211   ;
16212   return 0;
16213 }
16214 _ACEOF
16215 rm -f conftest.$ac_objext
16216 if { (eval echo "$as_me:16216: \"$ac_compile\"") >&5
16217   (eval $ac_compile) 2>&5
16218   ac_status=$?
16219   echo "$as_me:16219: \$? = $ac_status" >&5
16220   (exit $ac_status); } &&
16221          { ac_try='test -s conftest.$ac_objext'
16222   { (eval echo "$as_me:16222: \"$ac_try\"") >&5
16223   (eval $ac_try) 2>&5
16224   ac_status=$?
16225   echo "$as_me:16225: \$? = $ac_status" >&5
16226   (exit $ac_status); }; }; then
16227   cf_cv_term_header=$cf_header
16228                          break
16229 else
16230   echo "$as_me: failed program was:" >&5
16231 cat conftest.$ac_ext >&5
16232 cf_cv_term_header=no
16233 fi
16234 rm -f conftest.$ac_objext conftest.$ac_ext
16235         done
16236         ;;
16237 esac
16238
16239 fi
16240 echo "$as_me:16240: result: $cf_cv_term_header" >&5
16241 echo "${ECHO_T}$cf_cv_term_header" >&6
16242
16243 case $cf_cv_term_header in
16244 (term.h)
16245
16246 cat >>confdefs.h <<\EOF
16247 #define HAVE_TERM_H 1
16248 EOF
16249
16250         ;;
16251 (ncurses/term.h)
16252
16253 cat >>confdefs.h <<\EOF
16254 #define HAVE_NCURSES_TERM_H 1
16255 EOF
16256
16257         ;;
16258 (ncursesw/term.h)
16259
16260 cat >>confdefs.h <<\EOF
16261 #define HAVE_NCURSESW_TERM_H 1
16262 EOF
16263
16264         ;;
16265 esac
16266
16267 echo "$as_me:16267: checking for unctrl.h" >&5
16268 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
16269 if test "${cf_cv_unctrl_header+set}" = set; then
16270   echo $ECHO_N "(cached) $ECHO_C" >&6
16271 else
16272
16273 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
16274 # for <unctrl.h> if we do not find the variant.
16275
16276 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
16277
16278 case ${cf_cv_ncurses_header:-curses.h} in
16279 (*/*)
16280         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
16281         cf_header_list="$cf_header_item $cf_header_list"
16282         ;;
16283 esac
16284
16285 for cf_header in $cf_header_list
16286 do
16287         cat >conftest.$ac_ext <<_ACEOF
16288 #line 16288 "configure"
16289 #include "confdefs.h"
16290
16291 #include <${cf_cv_ncurses_header:-curses.h}>
16292 #include <${cf_header}>
16293 int
16294 main (void)
16295 {
16296 WINDOW *x
16297   ;
16298   return 0;
16299 }
16300 _ACEOF
16301 rm -f conftest.$ac_objext
16302 if { (eval echo "$as_me:16302: \"$ac_compile\"") >&5
16303   (eval $ac_compile) 2>&5
16304   ac_status=$?
16305   echo "$as_me:16305: \$? = $ac_status" >&5
16306   (exit $ac_status); } &&
16307          { ac_try='test -s conftest.$ac_objext'
16308   { (eval echo "$as_me:16308: \"$ac_try\"") >&5
16309   (eval $ac_try) 2>&5
16310   ac_status=$?
16311   echo "$as_me:16311: \$? = $ac_status" >&5
16312   (exit $ac_status); }; }; then
16313   cf_cv_unctrl_header=$cf_header
16314          break
16315 else
16316   echo "$as_me: failed program was:" >&5
16317 cat conftest.$ac_ext >&5
16318 cf_cv_unctrl_header=no
16319 fi
16320 rm -f conftest.$ac_objext conftest.$ac_ext
16321 done
16322
16323 fi
16324 echo "$as_me:16324: result: $cf_cv_unctrl_header" >&5
16325 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
16326
16327 case $cf_cv_unctrl_header in
16328 (no)
16329         { echo "$as_me:16329: WARNING: unctrl.h header not found" >&5
16330 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
16331         ;;
16332 esac
16333
16334 case $cf_cv_unctrl_header in
16335 (unctrl.h)
16336
16337 cat >>confdefs.h <<\EOF
16338 #define HAVE_UNCTRL_H 1
16339 EOF
16340
16341         ;;
16342 (ncurses/unctrl.h)
16343
16344 cat >>confdefs.h <<\EOF
16345 #define HAVE_NCURSES_UNCTRL_H 1
16346 EOF
16347
16348         ;;
16349 (ncursesw/unctrl.h)
16350
16351 cat >>confdefs.h <<\EOF
16352 #define HAVE_NCURSESW_UNCTRL_H 1
16353 EOF
16354
16355         ;;
16356 esac
16357
16358 for cf_func in \
16359 alloc_pair \
16360 assume_default_colors \
16361 chgat \
16362 color_content \
16363 color_set \
16364 copywin \
16365 delscreen \
16366 dupwin \
16367 filter \
16368 getbegx \
16369 getcurx \
16370 getmaxx \
16371 getnstr \
16372 getparx \
16373 getwin \
16374 halfdelay \
16375 init_extended_color \
16376 mvderwin \
16377 mvvline \
16378 mvwin \
16379 mvwvline \
16380 napms \
16381 newpad \
16382 putwin \
16383 reset_color_pairs \
16384 resize_term \
16385 resizeterm \
16386 restartterm \
16387 ripoffline \
16388 scr_dump \
16389 setupterm \
16390 slk_color \
16391 slk_init \
16392 termattrs \
16393 tgetent \
16394 tigetnum \
16395 tigetstr \
16396 tputs_sp \
16397 typeahead \
16398 use_default_colors \
16399 use_env \
16400 use_extended_names \
16401 use_screen \
16402 use_window \
16403 vid_puts \
16404 vidputs \
16405 vsscanf \
16406 vw_printw \
16407 wchgat \
16408 winsdelln \
16409 winsstr \
16410 wresize \
16411 wsyncdown \
16412 _tracef \
16413
16414 do
16415
16416 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16417
16418         echo "$as_me:16418: checking for ${cf_func}" >&5
16419 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
16420
16421 echo "${as_me:-configure}:16421: testing ${cf_func} ..." 1>&5
16422
16423         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
16424   echo $ECHO_N "(cached) $ECHO_C" >&6
16425 else
16426
16427                 eval cf_result='$ac_cv_func_'$cf_func
16428                 if test ".$cf_result" != ".no"; then
16429                         cat >conftest.$ac_ext <<_ACEOF
16430 #line 16430 "configure"
16431 #include "confdefs.h"
16432
16433 #ifdef HAVE_XCURSES
16434 #include <xcurses.h>
16435 char * XCursesProgramName = "test";
16436 #else
16437 #include <${cf_cv_ncurses_header:-curses.h}>
16438 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16439 #include <ncursesw/term.h>
16440 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16441 #include <ncurses/term.h>
16442 #elif defined(HAVE_TERM_H)
16443 #include <term.h>
16444 #endif
16445 #endif
16446
16447 int
16448 main (void)
16449 {
16450
16451 #ifndef ${cf_func}
16452 long foo = (long)(&${cf_func});
16453 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
16454 if (foo + 1234L > 5678L)
16455         ${cf_cv_main_return:-return}(foo != 0);
16456 #endif
16457
16458   ;
16459   return 0;
16460 }
16461 _ACEOF
16462 rm -f conftest.$ac_objext conftest$ac_exeext
16463 if { (eval echo "$as_me:16463: \"$ac_link\"") >&5
16464   (eval $ac_link) 2>&5
16465   ac_status=$?
16466   echo "$as_me:16466: \$? = $ac_status" >&5
16467   (exit $ac_status); } &&
16468          { ac_try='test -s conftest$ac_exeext'
16469   { (eval echo "$as_me:16469: \"$ac_try\"") >&5
16470   (eval $ac_try) 2>&5
16471   ac_status=$?
16472   echo "$as_me:16472: \$? = $ac_status" >&5
16473   (exit $ac_status); }; }; then
16474   cf_result=yes
16475 else
16476   echo "$as_me: failed program was:" >&5
16477 cat conftest.$ac_ext >&5
16478 cf_result=no
16479 fi
16480 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16481                 fi
16482                 eval 'cf_cv_func_'$cf_func'=$cf_result'
16483
16484 fi
16485
16486         # use the computed/retrieved cache-value:
16487         eval 'cf_result=$cf_cv_func_'$cf_func
16488         echo "$as_me:16488: result: $cf_result" >&5
16489 echo "${ECHO_T}$cf_result" >&6
16490         if test $cf_result != no; then
16491                 cat >>confdefs.h <<EOF
16492 #define HAVE_${cf_tr_func} 1
16493 EOF
16494
16495         fi
16496 done
16497
16498 for cf_func in tputs
16499 do
16500
16501 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16502
16503         echo "$as_me:16503: checking for ${cf_func}" >&5
16504 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
16505
16506 echo "${as_me:-configure}:16506: testing ${cf_func} ..." 1>&5
16507
16508         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
16509   echo $ECHO_N "(cached) $ECHO_C" >&6
16510 else
16511
16512                 eval cf_result='$ac_cv_func_'$cf_func
16513                 if test ".$cf_result" != ".no"; then
16514                         cat >conftest.$ac_ext <<_ACEOF
16515 #line 16515 "configure"
16516 #include "confdefs.h"
16517
16518 #ifdef HAVE_XCURSES
16519 #include <xcurses.h>
16520 char * XCursesProgramName = "test";
16521 #else
16522 #include <${cf_cv_ncurses_header:-curses.h}>
16523 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16524 #include <ncursesw/term.h>
16525 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16526 #include <ncurses/term.h>
16527 #elif defined(HAVE_TERM_H)
16528 #include <term.h>
16529 #endif
16530 #endif
16531
16532 int
16533 main (void)
16534 {
16535
16536 #ifndef ${cf_func}
16537 long foo = (long)(&${cf_func});
16538 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
16539 if (foo + 1234L > 5678L)
16540         ${cf_cv_main_return:-return}(foo != 0);
16541 #endif
16542
16543   ;
16544   return 0;
16545 }
16546 _ACEOF
16547 rm -f conftest.$ac_objext conftest$ac_exeext
16548 if { (eval echo "$as_me:16548: \"$ac_link\"") >&5
16549   (eval $ac_link) 2>&5
16550   ac_status=$?
16551   echo "$as_me:16551: \$? = $ac_status" >&5
16552   (exit $ac_status); } &&
16553          { ac_try='test -s conftest$ac_exeext'
16554   { (eval echo "$as_me:16554: \"$ac_try\"") >&5
16555   (eval $ac_try) 2>&5
16556   ac_status=$?
16557   echo "$as_me:16557: \$? = $ac_status" >&5
16558   (exit $ac_status); }; }; then
16559   cf_result=yes
16560 else
16561   echo "$as_me: failed program was:" >&5
16562 cat conftest.$ac_ext >&5
16563 cf_result=no
16564 fi
16565 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16566                 fi
16567                 eval 'cf_cv_func_'$cf_func'=$cf_result'
16568
16569 fi
16570
16571         # use the computed/retrieved cache-value:
16572         eval 'cf_result=$cf_cv_func_'$cf_func
16573         echo "$as_me:16573: result: $cf_result" >&5
16574 echo "${ECHO_T}$cf_result" >&6
16575         if test $cf_result != no; then
16576                 cat >>confdefs.h <<EOF
16577 #define HAVE_${cf_tr_func} 1
16578 EOF
16579
16580         fi
16581 done
16582
16583 if test x$cf_cv_func_tputs = xyes
16584 then
16585         cf_done=no
16586         for cf_arg in int char
16587         do
16588                 for cf_ret in int void
16589                 do
16590                         if test $cf_ret = void
16591                         then
16592                                 cf_return="/* nothing */"
16593                         else
16594                                 cf_return="return value"
16595                         fi
16596                         cat >conftest.$ac_ext <<_ACEOF
16597 #line 16597 "configure"
16598 #include "confdefs.h"
16599
16600 #include <${cf_cv_ncurses_header:-curses.h}>
16601 #include <$cf_cv_term_header>
16602
16603 static $cf_ret outc($cf_arg value) { $cf_return; }
16604
16605 int
16606 main (void)
16607 {
16608
16609         tputs("hello", 0, outc);
16610         ${cf_cv_main_return:-return}(0);
16611
16612   ;
16613   return 0;
16614 }
16615 _ACEOF
16616 rm -f conftest.$ac_objext
16617 if { (eval echo "$as_me:16617: \"$ac_compile\"") >&5
16618   (eval $ac_compile) 2>&5
16619   ac_status=$?
16620   echo "$as_me:16620: \$? = $ac_status" >&5
16621   (exit $ac_status); } &&
16622          { ac_try='test -s conftest.$ac_objext'
16623   { (eval echo "$as_me:16623: \"$ac_try\"") >&5
16624   (eval $ac_try) 2>&5
16625   ac_status=$?
16626   echo "$as_me:16626: \$? = $ac_status" >&5
16627   (exit $ac_status); }; }; then
16628
16629                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
16630
16631 echo "${as_me:-configure}:16631: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
16632
16633                 cat >>confdefs.h <<EOF
16634 #define TPUTS_ARG               $cf_arg
16635 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
16636 #define TPUTS_RETURN(value)     $cf_return
16637 EOF
16638                 cf_done=yes
16639                 break
16640
16641 else
16642   echo "$as_me: failed program was:" >&5
16643 cat conftest.$ac_ext >&5
16644 fi
16645 rm -f conftest.$ac_objext conftest.$ac_ext
16646                 done
16647                 test $cf_done = yes && break
16648         done
16649 fi
16650
16651 echo "$as_me:16651: checking for ncurses extended functions" >&5
16652 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
16653 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
16654   echo $ECHO_N "(cached) $ECHO_C" >&6
16655 else
16656
16657 cat >conftest.$ac_ext <<_ACEOF
16658 #line 16658 "configure"
16659 #include "confdefs.h"
16660
16661 #include <${cf_cv_ncurses_header:-curses.h}>
16662 int
16663 main (void)
16664 {
16665
16666 int x = NCURSES_EXT_FUNCS
16667
16668   ;
16669   return 0;
16670 }
16671 _ACEOF
16672 rm -f conftest.$ac_objext
16673 if { (eval echo "$as_me:16673: \"$ac_compile\"") >&5
16674   (eval $ac_compile) 2>&5
16675   ac_status=$?
16676   echo "$as_me:16676: \$? = $ac_status" >&5
16677   (exit $ac_status); } &&
16678          { ac_try='test -s conftest.$ac_objext'
16679   { (eval echo "$as_me:16679: \"$ac_try\"") >&5
16680   (eval $ac_try) 2>&5
16681   ac_status=$?
16682   echo "$as_me:16682: \$? = $ac_status" >&5
16683   (exit $ac_status); }; }; then
16684   cf_cv_ncurses_ext_funcs=defined
16685 else
16686   echo "$as_me: failed program was:" >&5
16687 cat conftest.$ac_ext >&5
16688
16689 cat >conftest.$ac_ext <<_ACEOF
16690 #line 16690 "configure"
16691 #include "confdefs.h"
16692
16693 #include <${cf_cv_ncurses_header:-curses.h}>
16694 int
16695 main (void)
16696 {
16697
16698         (void) assume_default_colors (0, 0);
16699         (void) curses_version ();
16700         (void) define_key (0, 0);
16701         (void) is_term_resized (0, 0);
16702         (void) key_defined (0);
16703         (void) keybound (0, 0);
16704         (void) keyok (0, 0);
16705         (void) resize_term (0, 0);
16706         (void) resizeterm (0, 0);
16707         (void) use_default_colors ();
16708         (void) use_extended_names (0);
16709         (void) wresize (0, 0, 0);
16710   ;
16711   return 0;
16712 }
16713 _ACEOF
16714 rm -f conftest.$ac_objext conftest$ac_exeext
16715 if { (eval echo "$as_me:16715: \"$ac_link\"") >&5
16716   (eval $ac_link) 2>&5
16717   ac_status=$?
16718   echo "$as_me:16718: \$? = $ac_status" >&5
16719   (exit $ac_status); } &&
16720          { ac_try='test -s conftest$ac_exeext'
16721   { (eval echo "$as_me:16721: \"$ac_try\"") >&5
16722   (eval $ac_try) 2>&5
16723   ac_status=$?
16724   echo "$as_me:16724: \$? = $ac_status" >&5
16725   (exit $ac_status); }; }; then
16726   cf_cv_ncurses_ext_funcs=yes
16727 else
16728   echo "$as_me: failed program was:" >&5
16729 cat conftest.$ac_ext >&5
16730 cf_cv_ncurses_ext_funcs=no
16731 fi
16732 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16733
16734 fi
16735 rm -f conftest.$ac_objext conftest.$ac_ext
16736
16737 fi
16738 echo "$as_me:16738: result: $cf_cv_ncurses_ext_funcs" >&5
16739 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
16740 test "$cf_cv_ncurses_ext_funcs" = yes &&
16741 cat >>confdefs.h <<\EOF
16742 #define NCURSES_EXT_FUNCS 1
16743 EOF
16744
16745 if test "$cf_enable_widec" = yes
16746 then
16747         # workaround for systems with ncurses before 20111029, due to change of
16748         # feature test macro from _XPG5 to _XOPEN_SOURCE
16749         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
16750         then
16751                 cf_define_xpg5=no
16752                 echo "$as_me:16752: checking if _XPG5 should be defined to enable wide-characters" >&5
16753 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
16754
16755                 cat >conftest.$ac_ext <<_ACEOF
16756 #line 16756 "configure"
16757 #include "confdefs.h"
16758
16759 #include <${cf_cv_ncurses_header:-curses.h}>
16760 int
16761 main (void)
16762 {
16763 int x = _XPG5
16764   ;
16765   return 0;
16766 }
16767 _ACEOF
16768 rm -f conftest.$ac_objext
16769 if { (eval echo "$as_me:16769: \"$ac_compile\"") >&5
16770   (eval $ac_compile) 2>&5
16771   ac_status=$?
16772   echo "$as_me:16772: \$? = $ac_status" >&5
16773   (exit $ac_status); } &&
16774          { ac_try='test -s conftest.$ac_objext'
16775   { (eval echo "$as_me:16775: \"$ac_try\"") >&5
16776   (eval $ac_try) 2>&5
16777   ac_status=$?
16778   echo "$as_me:16778: \$? = $ac_status" >&5
16779   (exit $ac_status); }; }; then
16780   :
16781 else
16782   echo "$as_me: failed program was:" >&5
16783 cat conftest.$ac_ext >&5
16784 cf_save_cppflags="$CPPFLAGS"
16785                          CPPFLAGS="$CPPFLAGS -D_XPG5"
16786                          cat >conftest.$ac_ext <<_ACEOF
16787 #line 16787 "configure"
16788 #include "confdefs.h"
16789
16790 #include <${cf_cv_ncurses_header:-curses.h}>
16791 int
16792 main (void)
16793 {
16794 int x = _XPG5
16795   ;
16796   return 0;
16797 }
16798 _ACEOF
16799 rm -f conftest.$ac_objext
16800 if { (eval echo "$as_me:16800: \"$ac_compile\"") >&5
16801   (eval $ac_compile) 2>&5
16802   ac_status=$?
16803   echo "$as_me:16803: \$? = $ac_status" >&5
16804   (exit $ac_status); } &&
16805          { ac_try='test -s conftest.$ac_objext'
16806   { (eval echo "$as_me:16806: \"$ac_try\"") >&5
16807   (eval $ac_try) 2>&5
16808   ac_status=$?
16809   echo "$as_me:16809: \$? = $ac_status" >&5
16810   (exit $ac_status); }; }; then
16811   cf_define_xpg5=yes
16812 else
16813   echo "$as_me: failed program was:" >&5
16814 cat conftest.$ac_ext >&5
16815 fi
16816 rm -f conftest.$ac_objext conftest.$ac_ext
16817                          CPPFLAGS="$cf_save_cppflags"
16818 fi
16819 rm -f conftest.$ac_objext conftest.$ac_ext
16820                 echo "$as_me:16820: result: $cf_define_xpg5" >&5
16821 echo "${ECHO_T}$cf_define_xpg5" >&6
16822
16823                 if test "$cf_define_xpg5" = yes
16824                 then
16825                         CPPFLAGS="$CPPFLAGS -D_XPG5"
16826                 fi
16827         fi
16828
16829         echo "$as_me:16829: checking for wide-character functions" >&5
16830 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
16831 if test "${cf_cv_widechar_funcs+set}" = set; then
16832   echo $ECHO_N "(cached) $ECHO_C" >&6
16833 else
16834
16835         cat >conftest.$ac_ext <<_ACEOF
16836 #line 16836 "configure"
16837 #include "confdefs.h"
16838
16839 #include <${cf_cv_ncurses_header:-curses.h}>
16840 int
16841 main (void)
16842 {
16843
16844                 static wchar_t src_wchar[2];
16845                 static cchar_t dst_cchar;
16846                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
16847
16848   ;
16849   return 0;
16850 }
16851 _ACEOF
16852 rm -f conftest.$ac_objext conftest$ac_exeext
16853 if { (eval echo "$as_me:16853: \"$ac_link\"") >&5
16854   (eval $ac_link) 2>&5
16855   ac_status=$?
16856   echo "$as_me:16856: \$? = $ac_status" >&5
16857   (exit $ac_status); } &&
16858          { ac_try='test -s conftest$ac_exeext'
16859   { (eval echo "$as_me:16859: \"$ac_try\"") >&5
16860   (eval $ac_try) 2>&5
16861   ac_status=$?
16862   echo "$as_me:16862: \$? = $ac_status" >&5
16863   (exit $ac_status); }; }; then
16864   cf_cv_widechar_funcs=yes
16865 else
16866   echo "$as_me: failed program was:" >&5
16867 cat conftest.$ac_ext >&5
16868 cf_cv_widechar_funcs=no
16869 fi
16870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16871
16872 fi
16873 echo "$as_me:16873: result: $cf_cv_widechar_funcs" >&5
16874 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
16875         if test "$cf_cv_widechar_funcs" != no ; then
16876
16877 cat >>confdefs.h <<\EOF
16878 #define USE_WIDEC_SUPPORT 1
16879 EOF
16880
16881         else
16882                 cat >>confdefs.h <<\EOF
16883 #define USE_WIDEC_SUPPORT 0
16884 EOF
16885
16886         fi
16887 else
16888         cat >>confdefs.h <<\EOF
16889 #define USE_WIDEC_SUPPORT 0
16890 EOF
16891
16892 fi
16893
16894 echo "$as_me:16894: checking if $cf_cv_screen library uses pthreads" >&5
16895 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
16896 if test "${cf_cv_use_pthreads+set}" = set; then
16897   echo $ECHO_N "(cached) $ECHO_C" >&6
16898 else
16899
16900 cat >conftest.$ac_ext <<_ACEOF
16901 #line 16901 "configure"
16902 #include "confdefs.h"
16903
16904 #include <${cf_cv_ncurses_header:-curses.h}>
16905 extern void _nc_init_pthreads(void);
16906
16907 int
16908 main (void)
16909 {
16910
16911         initscr();
16912         _nc_init_pthreads();
16913
16914   ;
16915   return 0;
16916 }
16917 _ACEOF
16918 rm -f conftest.$ac_objext conftest$ac_exeext
16919 if { (eval echo "$as_me:16919: \"$ac_link\"") >&5
16920   (eval $ac_link) 2>&5
16921   ac_status=$?
16922   echo "$as_me:16922: \$? = $ac_status" >&5
16923   (exit $ac_status); } &&
16924          { ac_try='test -s conftest$ac_exeext'
16925   { (eval echo "$as_me:16925: \"$ac_try\"") >&5
16926   (eval $ac_try) 2>&5
16927   ac_status=$?
16928   echo "$as_me:16928: \$? = $ac_status" >&5
16929   (exit $ac_status); }; }; then
16930   cf_cv_use_pthreads=yes
16931 else
16932   echo "$as_me: failed program was:" >&5
16933 cat conftest.$ac_ext >&5
16934 cf_cv_use_pthreads=no
16935 fi
16936 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16937
16938 fi
16939 echo "$as_me:16939: result: $cf_cv_use_pthreads" >&5
16940 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
16941 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
16942 #define USE_PTHREADS 1
16943 EOF
16944
16945 echo "$as_me:16945: checking if sys/time.h works with sys/select.h" >&5
16946 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
16947 if test "${cf_cv_sys_time_select+set}" = set; then
16948   echo $ECHO_N "(cached) $ECHO_C" >&6
16949 else
16950
16951 cat >conftest.$ac_ext <<_ACEOF
16952 #line 16952 "configure"
16953 #include "confdefs.h"
16954
16955 #include <sys/types.h>
16956 #ifdef HAVE_SYS_TIME_H
16957 #include <sys/time.h>
16958 #endif
16959 #ifdef HAVE_SYS_SELECT_H
16960 #include <sys/select.h>
16961 #endif
16962
16963 int
16964 main (void)
16965 {
16966
16967   ;
16968   return 0;
16969 }
16970 _ACEOF
16971 rm -f conftest.$ac_objext
16972 if { (eval echo "$as_me:16972: \"$ac_compile\"") >&5
16973   (eval $ac_compile) 2>&5
16974   ac_status=$?
16975   echo "$as_me:16975: \$? = $ac_status" >&5
16976   (exit $ac_status); } &&
16977          { ac_try='test -s conftest.$ac_objext'
16978   { (eval echo "$as_me:16978: \"$ac_try\"") >&5
16979   (eval $ac_try) 2>&5
16980   ac_status=$?
16981   echo "$as_me:16981: \$? = $ac_status" >&5
16982   (exit $ac_status); }; }; then
16983   cf_cv_sys_time_select=yes
16984 else
16985   echo "$as_me: failed program was:" >&5
16986 cat conftest.$ac_ext >&5
16987 cf_cv_sys_time_select=no
16988 fi
16989 rm -f conftest.$ac_objext conftest.$ac_ext
16990
16991 fi
16992
16993 echo "$as_me:16993: result: $cf_cv_sys_time_select" >&5
16994 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
16995 test "$cf_cv_sys_time_select" = yes &&
16996 cat >>confdefs.h <<\EOF
16997 #define HAVE_SYS_TIME_SELECT 1
16998 EOF
16999
17000 # special check for test/ditto.c
17001
17002 echo "$as_me:17002: checking for openpty in -lutil" >&5
17003 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
17004 if test "${ac_cv_lib_util_openpty+set}" = set; then
17005   echo $ECHO_N "(cached) $ECHO_C" >&6
17006 else
17007   ac_check_lib_save_LIBS=$LIBS
17008 LIBS="-lutil  $LIBS"
17009 cat >conftest.$ac_ext <<_ACEOF
17010 #line 17010 "configure"
17011 #include "confdefs.h"
17012
17013 /* Override any gcc2 internal prototype to avoid an error.  */
17014 #ifdef __cplusplus
17015 extern "C"
17016 #endif
17017 /* We use char because int might match the return type of a gcc2
17018    builtin and then its argument prototype would still apply.  */
17019 char openpty ();
17020 int
17021 main (void)
17022 {
17023 openpty ();
17024   ;
17025   return 0;
17026 }
17027 _ACEOF
17028 rm -f conftest.$ac_objext conftest$ac_exeext
17029 if { (eval echo "$as_me:17029: \"$ac_link\"") >&5
17030   (eval $ac_link) 2>&5
17031   ac_status=$?
17032   echo "$as_me:17032: \$? = $ac_status" >&5
17033   (exit $ac_status); } &&
17034          { ac_try='test -s conftest$ac_exeext'
17035   { (eval echo "$as_me:17035: \"$ac_try\"") >&5
17036   (eval $ac_try) 2>&5
17037   ac_status=$?
17038   echo "$as_me:17038: \$? = $ac_status" >&5
17039   (exit $ac_status); }; }; then
17040   ac_cv_lib_util_openpty=yes
17041 else
17042   echo "$as_me: failed program was:" >&5
17043 cat conftest.$ac_ext >&5
17044 ac_cv_lib_util_openpty=no
17045 fi
17046 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17047 LIBS=$ac_check_lib_save_LIBS
17048 fi
17049 echo "$as_me:17049: result: $ac_cv_lib_util_openpty" >&5
17050 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
17051 if test $ac_cv_lib_util_openpty = yes; then
17052   cf_cv_lib_util=yes
17053 else
17054   cf_cv_lib_util=no
17055 fi
17056
17057 echo "$as_me:17057: checking for openpty header" >&5
17058 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
17059 if test "${cf_cv_func_openpty+set}" = set; then
17060   echo $ECHO_N "(cached) $ECHO_C" >&6
17061 else
17062
17063         cf_save_LIBS="$LIBS"
17064         test $cf_cv_lib_util = yes && {
17065 cf_add_libs="-lutil"
17066 # Filter out duplicates - this happens with badly-designed ".pc" files...
17067 for cf_add_1lib in $LIBS
17068 do
17069         for cf_add_2lib in $cf_add_libs
17070         do
17071                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17072                 then
17073                         cf_add_1lib=
17074                         break
17075                 fi
17076         done
17077         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17078 done
17079 LIBS="$cf_add_libs"
17080  }
17081         for cf_header in pty.h libutil.h util.h
17082         do
17083         cat >conftest.$ac_ext <<_ACEOF
17084 #line 17084 "configure"
17085 #include "confdefs.h"
17086
17087 #include <$cf_header>
17088
17089 int
17090 main (void)
17091 {
17092
17093         int x = openpty((int *)0, (int *)0, (char *)0,
17094                                    (struct termios *)0, (struct winsize *)0);
17095
17096   ;
17097   return 0;
17098 }
17099 _ACEOF
17100 rm -f conftest.$ac_objext conftest$ac_exeext
17101 if { (eval echo "$as_me:17101: \"$ac_link\"") >&5
17102   (eval $ac_link) 2>&5
17103   ac_status=$?
17104   echo "$as_me:17104: \$? = $ac_status" >&5
17105   (exit $ac_status); } &&
17106          { ac_try='test -s conftest$ac_exeext'
17107   { (eval echo "$as_me:17107: \"$ac_try\"") >&5
17108   (eval $ac_try) 2>&5
17109   ac_status=$?
17110   echo "$as_me:17110: \$? = $ac_status" >&5
17111   (exit $ac_status); }; }; then
17112
17113                 cf_cv_func_openpty=$cf_header
17114                 break
17115
17116 else
17117   echo "$as_me: failed program was:" >&5
17118 cat conftest.$ac_ext >&5
17119
17120                 cf_cv_func_openpty=no
17121
17122 fi
17123 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17124         done
17125         LIBS="$cf_save_LIBS"
17126
17127 fi
17128 echo "$as_me:17128: result: $cf_cv_func_openpty" >&5
17129 echo "${ECHO_T}$cf_cv_func_openpty" >&6
17130
17131 if test "$cf_cv_func_openpty" != no ; then
17132
17133 cat >>confdefs.h <<EOF
17134 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
17135 EOF
17136
17137 cat >>confdefs.h <<\EOF
17138 #define USE_XTERM_PTY 1
17139 EOF
17140
17141         if test "x$cf_cv_lib_util" = xyes ; then
17142
17143 cf_add_libs="-lutil"
17144 # Filter out duplicates - this happens with badly-designed ".pc" files...
17145 for cf_add_1lib in $TEST_LIBS
17146 do
17147         for cf_add_2lib in $cf_add_libs
17148         do
17149                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17150                 then
17151                         cf_add_1lib=
17152                         break
17153                 fi
17154         done
17155         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17156 done
17157 TEST_LIBS="$cf_add_libs"
17158
17159         fi
17160 fi
17161
17162 echo "$as_me:17162: checking for function curses_version" >&5
17163 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
17164 if test "${cf_cv_func_curses_version+set}" = set; then
17165   echo $ECHO_N "(cached) $ECHO_C" >&6
17166 else
17167
17168 if test "$cross_compiling" = yes; then
17169   cf_cv_func_curses_version=unknown
17170 else
17171   cat >conftest.$ac_ext <<_ACEOF
17172 #line 17172 "configure"
17173 #include "confdefs.h"
17174
17175 #include <${cf_cv_ncurses_header:-curses.h}>
17176 int main(void)
17177 {
17178         char temp[1024];
17179         sprintf(temp, "%s\n", curses_version());
17180         ${cf_cv_main_return:-return}(0);
17181 }
17182
17183 _ACEOF
17184 rm -f conftest$ac_exeext
17185 if { (eval echo "$as_me:17185: \"$ac_link\"") >&5
17186   (eval $ac_link) 2>&5
17187   ac_status=$?
17188   echo "$as_me:17188: \$? = $ac_status" >&5
17189   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17190   { (eval echo "$as_me:17190: \"$ac_try\"") >&5
17191   (eval $ac_try) 2>&5
17192   ac_status=$?
17193   echo "$as_me:17193: \$? = $ac_status" >&5
17194   (exit $ac_status); }; }; then
17195   cf_cv_func_curses_version=yes
17196
17197 else
17198   echo "$as_me: program exited with status $ac_status" >&5
17199 echo "$as_me: failed program was:" >&5
17200 cat conftest.$ac_ext >&5
17201 cf_cv_func_curses_version=no
17202
17203 fi
17204 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17205 fi
17206 rm -f core
17207 fi
17208 echo "$as_me:17208: result: $cf_cv_func_curses_version" >&5
17209 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
17210 test "$cf_cv_func_curses_version" = yes &&
17211 cat >>confdefs.h <<\EOF
17212 #define HAVE_CURSES_VERSION 1
17213 EOF
17214
17215 echo "$as_me:17215: checking for alternate character set array" >&5
17216 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
17217 if test "${cf_cv_curses_acs_map+set}" = set; then
17218   echo $ECHO_N "(cached) $ECHO_C" >&6
17219 else
17220
17221 cf_cv_curses_acs_map=unknown
17222 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
17223 do
17224 cat >conftest.$ac_ext <<_ACEOF
17225 #line 17225 "configure"
17226 #include "confdefs.h"
17227
17228 #include <${cf_cv_ncurses_header:-curses.h}>
17229
17230 int
17231 main (void)
17232 {
17233
17234 $name['k'] = ACS_PLUS
17235
17236   ;
17237   return 0;
17238 }
17239 _ACEOF
17240 rm -f conftest.$ac_objext conftest$ac_exeext
17241 if { (eval echo "$as_me:17241: \"$ac_link\"") >&5
17242   (eval $ac_link) 2>&5
17243   ac_status=$?
17244   echo "$as_me:17244: \$? = $ac_status" >&5
17245   (exit $ac_status); } &&
17246          { ac_try='test -s conftest$ac_exeext'
17247   { (eval echo "$as_me:17247: \"$ac_try\"") >&5
17248   (eval $ac_try) 2>&5
17249   ac_status=$?
17250   echo "$as_me:17250: \$? = $ac_status" >&5
17251   (exit $ac_status); }; }; then
17252   cf_cv_curses_acs_map=$name; break
17253 else
17254   echo "$as_me: failed program was:" >&5
17255 cat conftest.$ac_ext >&5
17256 fi
17257 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17258 done
17259
17260 fi
17261 echo "$as_me:17261: result: $cf_cv_curses_acs_map" >&5
17262 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
17263
17264 test "$cf_cv_curses_acs_map" != unknown &&
17265 cat >>confdefs.h <<EOF
17266 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
17267 EOF
17268
17269 if test "$cf_enable_widec" = yes; then
17270
17271 echo "$as_me:17271: checking for wide alternate character set array" >&5
17272 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
17273 if test "${cf_cv_curses_wacs_map+set}" = set; then
17274   echo $ECHO_N "(cached) $ECHO_C" >&6
17275 else
17276
17277         cf_cv_curses_wacs_map=unknown
17278         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
17279         do
17280         cat >conftest.$ac_ext <<_ACEOF
17281 #line 17281 "configure"
17282 #include "confdefs.h"
17283
17284 #ifndef _XOPEN_SOURCE_EXTENDED
17285 #define _XOPEN_SOURCE_EXTENDED
17286 #endif
17287 #include <${cf_cv_ncurses_header:-curses.h}>
17288 int
17289 main (void)
17290 {
17291 void *foo = &($name['k'])
17292   ;
17293   return 0;
17294 }
17295 _ACEOF
17296 rm -f conftest.$ac_objext conftest$ac_exeext
17297 if { (eval echo "$as_me:17297: \"$ac_link\"") >&5
17298   (eval $ac_link) 2>&5
17299   ac_status=$?
17300   echo "$as_me:17300: \$? = $ac_status" >&5
17301   (exit $ac_status); } &&
17302          { ac_try='test -s conftest$ac_exeext'
17303   { (eval echo "$as_me:17303: \"$ac_try\"") >&5
17304   (eval $ac_try) 2>&5
17305   ac_status=$?
17306   echo "$as_me:17306: \$? = $ac_status" >&5
17307   (exit $ac_status); }; }; then
17308   cf_cv_curses_wacs_map=$name
17309          break
17310 else
17311   echo "$as_me: failed program was:" >&5
17312 cat conftest.$ac_ext >&5
17313 fi
17314 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17315         done
17316 fi
17317 echo "$as_me:17317: result: $cf_cv_curses_wacs_map" >&5
17318 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
17319
17320 test "$cf_cv_curses_wacs_map" != unknown &&
17321 cat >>confdefs.h <<EOF
17322 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
17323 EOF
17324
17325 echo "$as_me:17325: checking for wide alternate character constants" >&5
17326 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
17327 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
17328   echo $ECHO_N "(cached) $ECHO_C" >&6
17329 else
17330
17331 cf_cv_curses_wacs_symbols=no
17332 if test "$cf_cv_curses_wacs_map" != unknown
17333 then
17334         cat >conftest.$ac_ext <<_ACEOF
17335 #line 17335 "configure"
17336 #include "confdefs.h"
17337
17338 #ifndef _XOPEN_SOURCE_EXTENDED
17339 #define _XOPEN_SOURCE_EXTENDED
17340 #endif
17341 #include <${cf_cv_ncurses_header:-curses.h}>
17342 int
17343 main (void)
17344 {
17345 cchar_t *foo = WACS_PLUS;
17346          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
17347   ;
17348   return 0;
17349 }
17350 _ACEOF
17351 rm -f conftest.$ac_objext conftest$ac_exeext
17352 if { (eval echo "$as_me:17352: \"$ac_link\"") >&5
17353   (eval $ac_link) 2>&5
17354   ac_status=$?
17355   echo "$as_me:17355: \$? = $ac_status" >&5
17356   (exit $ac_status); } &&
17357          { ac_try='test -s conftest$ac_exeext'
17358   { (eval echo "$as_me:17358: \"$ac_try\"") >&5
17359   (eval $ac_try) 2>&5
17360   ac_status=$?
17361   echo "$as_me:17361: \$? = $ac_status" >&5
17362   (exit $ac_status); }; }; then
17363   cf_cv_curses_wacs_symbols=yes
17364 else
17365   echo "$as_me: failed program was:" >&5
17366 cat conftest.$ac_ext >&5
17367 fi
17368 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17369 else
17370         cat >conftest.$ac_ext <<_ACEOF
17371 #line 17371 "configure"
17372 #include "confdefs.h"
17373
17374 #ifndef _XOPEN_SOURCE_EXTENDED
17375 #define _XOPEN_SOURCE_EXTENDED
17376 #endif
17377 #include <${cf_cv_ncurses_header:-curses.h}>
17378 int
17379 main (void)
17380 {
17381 cchar_t *foo = WACS_PLUS
17382   ;
17383   return 0;
17384 }
17385 _ACEOF
17386 rm -f conftest.$ac_objext conftest$ac_exeext
17387 if { (eval echo "$as_me:17387: \"$ac_link\"") >&5
17388   (eval $ac_link) 2>&5
17389   ac_status=$?
17390   echo "$as_me:17390: \$? = $ac_status" >&5
17391   (exit $ac_status); } &&
17392          { ac_try='test -s conftest$ac_exeext'
17393   { (eval echo "$as_me:17393: \"$ac_try\"") >&5
17394   (eval $ac_try) 2>&5
17395   ac_status=$?
17396   echo "$as_me:17396: \$? = $ac_status" >&5
17397   (exit $ac_status); }; }; then
17398   cf_cv_curses_wacs_symbols=yes
17399 else
17400   echo "$as_me: failed program was:" >&5
17401 cat conftest.$ac_ext >&5
17402 fi
17403 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17404 fi
17405
17406 fi
17407 echo "$as_me:17407: result: $cf_cv_curses_wacs_symbols" >&5
17408 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
17409
17410 test "$cf_cv_curses_wacs_symbols" != no &&
17411 cat >>confdefs.h <<\EOF
17412 #define CURSES_WACS_SYMBOLS 1
17413 EOF
17414
17415 fi
17416
17417 echo "$as_me:17417: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17418 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17419 cat >conftest.$ac_ext <<_ACEOF
17420 #line 17420 "configure"
17421 #include "confdefs.h"
17422
17423 #ifndef _XOPEN_SOURCE_EXTENDED
17424 #define _XOPEN_SOURCE_EXTENDED
17425 #endif
17426 #include <${cf_cv_ncurses_header:-curses.h}>
17427 int
17428 main (void)
17429 {
17430
17431 attr_t foo
17432
17433   ;
17434   return 0;
17435 }
17436 _ACEOF
17437 rm -f conftest.$ac_objext
17438 if { (eval echo "$as_me:17438: \"$ac_compile\"") >&5
17439   (eval $ac_compile) 2>&5
17440   ac_status=$?
17441   echo "$as_me:17441: \$? = $ac_status" >&5
17442   (exit $ac_status); } &&
17443          { ac_try='test -s conftest.$ac_objext'
17444   { (eval echo "$as_me:17444: \"$ac_try\"") >&5
17445   (eval $ac_try) 2>&5
17446   ac_status=$?
17447   echo "$as_me:17447: \$? = $ac_status" >&5
17448   (exit $ac_status); }; }; then
17449   cf_result=yes
17450 else
17451   echo "$as_me: failed program was:" >&5
17452 cat conftest.$ac_ext >&5
17453 cf_result=no
17454 fi
17455 rm -f conftest.$ac_objext conftest.$ac_ext
17456 echo "$as_me:17456: result: $cf_result" >&5
17457 echo "${ECHO_T}$cf_result" >&6
17458 if test $cf_result = yes ; then
17459
17460 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17461
17462 cat >>confdefs.h <<EOF
17463 #define $cf_result 1
17464 EOF
17465
17466 else
17467
17468 cat >>confdefs.h <<EOF
17469 #define attr_t long
17470 EOF
17471
17472 fi
17473
17474 if test "$cf_enable_widec" = yes; then
17475
17476 # This is needed on Tru64 5.0 to declare mbstate_t
17477 echo "$as_me:17477: checking if we must include wchar.h to declare mbstate_t" >&5
17478 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
17479 if test "${cf_cv_mbstate_t+set}" = set; then
17480   echo $ECHO_N "(cached) $ECHO_C" >&6
17481 else
17482
17483 cat >conftest.$ac_ext <<_ACEOF
17484 #line 17484 "configure"
17485 #include "confdefs.h"
17486
17487 #include <stdlib.h>
17488 #include <stdarg.h>
17489 #include <stdio.h>
17490 #ifdef HAVE_LIBUTF8_H
17491 #include <libutf8.h>
17492 #endif
17493 int
17494 main (void)
17495 {
17496 mbstate_t state
17497   ;
17498   return 0;
17499 }
17500 _ACEOF
17501 rm -f conftest.$ac_objext
17502 if { (eval echo "$as_me:17502: \"$ac_compile\"") >&5
17503   (eval $ac_compile) 2>&5
17504   ac_status=$?
17505   echo "$as_me:17505: \$? = $ac_status" >&5
17506   (exit $ac_status); } &&
17507          { ac_try='test -s conftest.$ac_objext'
17508   { (eval echo "$as_me:17508: \"$ac_try\"") >&5
17509   (eval $ac_try) 2>&5
17510   ac_status=$?
17511   echo "$as_me:17511: \$? = $ac_status" >&5
17512   (exit $ac_status); }; }; then
17513   cf_cv_mbstate_t=no
17514 else
17515   echo "$as_me: failed program was:" >&5
17516 cat conftest.$ac_ext >&5
17517 cat >conftest.$ac_ext <<_ACEOF
17518 #line 17518 "configure"
17519 #include "confdefs.h"
17520
17521 #include <stdlib.h>
17522 #include <stdarg.h>
17523 #include <stdio.h>
17524 #include <wchar.h>
17525 #ifdef HAVE_LIBUTF8_H
17526 #include <libutf8.h>
17527 #endif
17528 int
17529 main (void)
17530 {
17531 mbstate_t value
17532   ;
17533   return 0;
17534 }
17535 _ACEOF
17536 rm -f conftest.$ac_objext
17537 if { (eval echo "$as_me:17537: \"$ac_compile\"") >&5
17538   (eval $ac_compile) 2>&5
17539   ac_status=$?
17540   echo "$as_me:17540: \$? = $ac_status" >&5
17541   (exit $ac_status); } &&
17542          { ac_try='test -s conftest.$ac_objext'
17543   { (eval echo "$as_me:17543: \"$ac_try\"") >&5
17544   (eval $ac_try) 2>&5
17545   ac_status=$?
17546   echo "$as_me:17546: \$? = $ac_status" >&5
17547   (exit $ac_status); }; }; then
17548   cf_cv_mbstate_t=yes
17549 else
17550   echo "$as_me: failed program was:" >&5
17551 cat conftest.$ac_ext >&5
17552 cf_cv_mbstate_t=unknown
17553 fi
17554 rm -f conftest.$ac_objext conftest.$ac_ext
17555 fi
17556 rm -f conftest.$ac_objext conftest.$ac_ext
17557 fi
17558 echo "$as_me:17558: result: $cf_cv_mbstate_t" >&5
17559 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
17560
17561 if test "$cf_cv_mbstate_t" = yes ; then
17562
17563 cat >>confdefs.h <<\EOF
17564 #define NEED_WCHAR_H 1
17565 EOF
17566
17567         NEED_WCHAR_H=1
17568 fi
17569
17570 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
17571 if test "$cf_cv_mbstate_t" = unknown ; then
17572         NCURSES_MBSTATE_T=1
17573 fi
17574
17575 # if we find mbstate_t in either place, use substitution to provide a fallback.
17576 if test "$cf_cv_mbstate_t" != unknown ; then
17577         NCURSES_OK_MBSTATE_T=1
17578 fi
17579
17580 # This is needed on Tru64 5.0 to declare wchar_t
17581 echo "$as_me:17581: checking if we must include wchar.h to declare wchar_t" >&5
17582 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
17583 if test "${cf_cv_wchar_t+set}" = set; then
17584   echo $ECHO_N "(cached) $ECHO_C" >&6
17585 else
17586
17587 cat >conftest.$ac_ext <<_ACEOF
17588 #line 17588 "configure"
17589 #include "confdefs.h"
17590
17591 #include <stdlib.h>
17592 #include <stdarg.h>
17593 #include <stdio.h>
17594 #ifdef HAVE_LIBUTF8_H
17595 #include <libutf8.h>
17596 #endif
17597 int
17598 main (void)
17599 {
17600 wchar_t state
17601   ;
17602   return 0;
17603 }
17604 _ACEOF
17605 rm -f conftest.$ac_objext
17606 if { (eval echo "$as_me:17606: \"$ac_compile\"") >&5
17607   (eval $ac_compile) 2>&5
17608   ac_status=$?
17609   echo "$as_me:17609: \$? = $ac_status" >&5
17610   (exit $ac_status); } &&
17611          { ac_try='test -s conftest.$ac_objext'
17612   { (eval echo "$as_me:17612: \"$ac_try\"") >&5
17613   (eval $ac_try) 2>&5
17614   ac_status=$?
17615   echo "$as_me:17615: \$? = $ac_status" >&5
17616   (exit $ac_status); }; }; then
17617   cf_cv_wchar_t=no
17618 else
17619   echo "$as_me: failed program was:" >&5
17620 cat conftest.$ac_ext >&5
17621 cat >conftest.$ac_ext <<_ACEOF
17622 #line 17622 "configure"
17623 #include "confdefs.h"
17624
17625 #include <stdlib.h>
17626 #include <stdarg.h>
17627 #include <stdio.h>
17628 #include <wchar.h>
17629 #ifdef HAVE_LIBUTF8_H
17630 #include <libutf8.h>
17631 #endif
17632 int
17633 main (void)
17634 {
17635 wchar_t value
17636   ;
17637   return 0;
17638 }
17639 _ACEOF
17640 rm -f conftest.$ac_objext
17641 if { (eval echo "$as_me:17641: \"$ac_compile\"") >&5
17642   (eval $ac_compile) 2>&5
17643   ac_status=$?
17644   echo "$as_me:17644: \$? = $ac_status" >&5
17645   (exit $ac_status); } &&
17646          { ac_try='test -s conftest.$ac_objext'
17647   { (eval echo "$as_me:17647: \"$ac_try\"") >&5
17648   (eval $ac_try) 2>&5
17649   ac_status=$?
17650   echo "$as_me:17650: \$? = $ac_status" >&5
17651   (exit $ac_status); }; }; then
17652   cf_cv_wchar_t=yes
17653 else
17654   echo "$as_me: failed program was:" >&5
17655 cat conftest.$ac_ext >&5
17656 cf_cv_wchar_t=unknown
17657 fi
17658 rm -f conftest.$ac_objext conftest.$ac_ext
17659 fi
17660 rm -f conftest.$ac_objext conftest.$ac_ext
17661 fi
17662 echo "$as_me:17662: result: $cf_cv_wchar_t" >&5
17663 echo "${ECHO_T}$cf_cv_wchar_t" >&6
17664
17665 if test "$cf_cv_wchar_t" = yes ; then
17666
17667 cat >>confdefs.h <<\EOF
17668 #define NEED_WCHAR_H 1
17669 EOF
17670
17671         NEED_WCHAR_H=1
17672 fi
17673
17674 # if we do not find wchar_t in either place, use substitution to provide a fallback.
17675 if test "$cf_cv_wchar_t" = unknown ; then
17676         NCURSES_WCHAR_T=1
17677 fi
17678
17679 # if we find wchar_t in either place, use substitution to provide a fallback.
17680 if test "$cf_cv_wchar_t" != unknown ; then
17681         NCURSES_OK_WCHAR_T=1
17682 fi
17683
17684 # This is needed on Tru64 5.0 to declare wint_t
17685 echo "$as_me:17685: checking if we must include wchar.h to declare wint_t" >&5
17686 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
17687 if test "${cf_cv_wint_t+set}" = set; then
17688   echo $ECHO_N "(cached) $ECHO_C" >&6
17689 else
17690
17691 cat >conftest.$ac_ext <<_ACEOF
17692 #line 17692 "configure"
17693 #include "confdefs.h"
17694
17695 #include <stdlib.h>
17696 #include <stdarg.h>
17697 #include <stdio.h>
17698 #ifdef HAVE_LIBUTF8_H
17699 #include <libutf8.h>
17700 #endif
17701 int
17702 main (void)
17703 {
17704 wint_t state
17705   ;
17706   return 0;
17707 }
17708 _ACEOF
17709 rm -f conftest.$ac_objext
17710 if { (eval echo "$as_me:17710: \"$ac_compile\"") >&5
17711   (eval $ac_compile) 2>&5
17712   ac_status=$?
17713   echo "$as_me:17713: \$? = $ac_status" >&5
17714   (exit $ac_status); } &&
17715          { ac_try='test -s conftest.$ac_objext'
17716   { (eval echo "$as_me:17716: \"$ac_try\"") >&5
17717   (eval $ac_try) 2>&5
17718   ac_status=$?
17719   echo "$as_me:17719: \$? = $ac_status" >&5
17720   (exit $ac_status); }; }; then
17721   cf_cv_wint_t=no
17722 else
17723   echo "$as_me: failed program was:" >&5
17724 cat conftest.$ac_ext >&5
17725 cat >conftest.$ac_ext <<_ACEOF
17726 #line 17726 "configure"
17727 #include "confdefs.h"
17728
17729 #include <stdlib.h>
17730 #include <stdarg.h>
17731 #include <stdio.h>
17732 #include <wchar.h>
17733 #ifdef HAVE_LIBUTF8_H
17734 #include <libutf8.h>
17735 #endif
17736 int
17737 main (void)
17738 {
17739 wint_t value
17740   ;
17741   return 0;
17742 }
17743 _ACEOF
17744 rm -f conftest.$ac_objext
17745 if { (eval echo "$as_me:17745: \"$ac_compile\"") >&5
17746   (eval $ac_compile) 2>&5
17747   ac_status=$?
17748   echo "$as_me:17748: \$? = $ac_status" >&5
17749   (exit $ac_status); } &&
17750          { ac_try='test -s conftest.$ac_objext'
17751   { (eval echo "$as_me:17751: \"$ac_try\"") >&5
17752   (eval $ac_try) 2>&5
17753   ac_status=$?
17754   echo "$as_me:17754: \$? = $ac_status" >&5
17755   (exit $ac_status); }; }; then
17756   cf_cv_wint_t=yes
17757 else
17758   echo "$as_me: failed program was:" >&5
17759 cat conftest.$ac_ext >&5
17760 cf_cv_wint_t=unknown
17761 fi
17762 rm -f conftest.$ac_objext conftest.$ac_ext
17763 fi
17764 rm -f conftest.$ac_objext conftest.$ac_ext
17765 fi
17766 echo "$as_me:17766: result: $cf_cv_wint_t" >&5
17767 echo "${ECHO_T}$cf_cv_wint_t" >&6
17768
17769 if test "$cf_cv_wint_t" = yes ; then
17770
17771 cat >>confdefs.h <<\EOF
17772 #define NEED_WCHAR_H 1
17773 EOF
17774
17775         NEED_WCHAR_H=1
17776 fi
17777
17778 # if we do not find wint_t in either place, use substitution to provide a fallback.
17779 if test "$cf_cv_wint_t" = unknown ; then
17780         NCURSES_WINT_T=1
17781 fi
17782
17783 # if we find wint_t in either place, use substitution to provide a fallback.
17784 if test "$cf_cv_wint_t" != unknown ; then
17785         NCURSES_OK_WINT_T=1
17786 fi
17787
17788         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
17789
17790 echo "$as_me:17790: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17791 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17792 cat >conftest.$ac_ext <<_ACEOF
17793 #line 17793 "configure"
17794 #include "confdefs.h"
17795
17796 #ifndef _XOPEN_SOURCE_EXTENDED
17797 #define _XOPEN_SOURCE_EXTENDED
17798 #endif
17799 #include <${cf_cv_ncurses_header:-curses.h}>
17800 int
17801 main (void)
17802 {
17803
17804 mbstate_t foo
17805
17806   ;
17807   return 0;
17808 }
17809 _ACEOF
17810 rm -f conftest.$ac_objext
17811 if { (eval echo "$as_me:17811: \"$ac_compile\"") >&5
17812   (eval $ac_compile) 2>&5
17813   ac_status=$?
17814   echo "$as_me:17814: \$? = $ac_status" >&5
17815   (exit $ac_status); } &&
17816          { ac_try='test -s conftest.$ac_objext'
17817   { (eval echo "$as_me:17817: \"$ac_try\"") >&5
17818   (eval $ac_try) 2>&5
17819   ac_status=$?
17820   echo "$as_me:17820: \$? = $ac_status" >&5
17821   (exit $ac_status); }; }; then
17822   cf_result=yes
17823 else
17824   echo "$as_me: failed program was:" >&5
17825 cat conftest.$ac_ext >&5
17826 cf_result=no
17827 fi
17828 rm -f conftest.$ac_objext conftest.$ac_ext
17829 echo "$as_me:17829: result: $cf_result" >&5
17830 echo "${ECHO_T}$cf_result" >&6
17831 if test $cf_result = yes ; then
17832
17833 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17834
17835 cat >>confdefs.h <<EOF
17836 #define $cf_result 1
17837 EOF
17838
17839 else
17840
17841 cat >>confdefs.h <<EOF
17842 #define mbstate_t long
17843 EOF
17844
17845 fi
17846
17847         fi
17848
17849         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
17850
17851 echo "$as_me:17851: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17852 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17853 cat >conftest.$ac_ext <<_ACEOF
17854 #line 17854 "configure"
17855 #include "confdefs.h"
17856
17857 #ifndef _XOPEN_SOURCE_EXTENDED
17858 #define _XOPEN_SOURCE_EXTENDED
17859 #endif
17860 #include <${cf_cv_ncurses_header:-curses.h}>
17861 int
17862 main (void)
17863 {
17864
17865 wchar_t foo
17866
17867   ;
17868   return 0;
17869 }
17870 _ACEOF
17871 rm -f conftest.$ac_objext
17872 if { (eval echo "$as_me:17872: \"$ac_compile\"") >&5
17873   (eval $ac_compile) 2>&5
17874   ac_status=$?
17875   echo "$as_me:17875: \$? = $ac_status" >&5
17876   (exit $ac_status); } &&
17877          { ac_try='test -s conftest.$ac_objext'
17878   { (eval echo "$as_me:17878: \"$ac_try\"") >&5
17879   (eval $ac_try) 2>&5
17880   ac_status=$?
17881   echo "$as_me:17881: \$? = $ac_status" >&5
17882   (exit $ac_status); }; }; then
17883   cf_result=yes
17884 else
17885   echo "$as_me: failed program was:" >&5
17886 cat conftest.$ac_ext >&5
17887 cf_result=no
17888 fi
17889 rm -f conftest.$ac_objext conftest.$ac_ext
17890 echo "$as_me:17890: result: $cf_result" >&5
17891 echo "${ECHO_T}$cf_result" >&6
17892 if test $cf_result = yes ; then
17893
17894 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17895
17896 cat >>confdefs.h <<EOF
17897 #define $cf_result 1
17898 EOF
17899
17900 else
17901
17902 cat >>confdefs.h <<EOF
17903 #define wchar_t long
17904 EOF
17905
17906 fi
17907
17908         fi
17909
17910         if test "$NCURSES_OK_WINT_T" = 0 ; then
17911
17912 echo "$as_me:17912: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17913 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17914 cat >conftest.$ac_ext <<_ACEOF
17915 #line 17915 "configure"
17916 #include "confdefs.h"
17917
17918 #ifndef _XOPEN_SOURCE_EXTENDED
17919 #define _XOPEN_SOURCE_EXTENDED
17920 #endif
17921 #include <${cf_cv_ncurses_header:-curses.h}>
17922 int
17923 main (void)
17924 {
17925
17926 wint_t foo
17927
17928   ;
17929   return 0;
17930 }
17931 _ACEOF
17932 rm -f conftest.$ac_objext
17933 if { (eval echo "$as_me:17933: \"$ac_compile\"") >&5
17934   (eval $ac_compile) 2>&5
17935   ac_status=$?
17936   echo "$as_me:17936: \$? = $ac_status" >&5
17937   (exit $ac_status); } &&
17938          { ac_try='test -s conftest.$ac_objext'
17939   { (eval echo "$as_me:17939: \"$ac_try\"") >&5
17940   (eval $ac_try) 2>&5
17941   ac_status=$?
17942   echo "$as_me:17942: \$? = $ac_status" >&5
17943   (exit $ac_status); }; }; then
17944   cf_result=yes
17945 else
17946   echo "$as_me: failed program was:" >&5
17947 cat conftest.$ac_ext >&5
17948 cf_result=no
17949 fi
17950 rm -f conftest.$ac_objext conftest.$ac_ext
17951 echo "$as_me:17951: result: $cf_result" >&5
17952 echo "${ECHO_T}$cf_result" >&6
17953 if test $cf_result = yes ; then
17954
17955 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17956
17957 cat >>confdefs.h <<EOF
17958 #define $cf_result 1
17959 EOF
17960
17961 else
17962
17963 cat >>confdefs.h <<EOF
17964 #define wint_t long
17965 EOF
17966
17967 fi
17968
17969         fi
17970 fi
17971
17972 for cf_data in \
17973 curscr \
17974 ospeed \
17975 boolnames \
17976 boolfnames \
17977 ttytype
17978 do
17979 echo "$as_me:17979: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17980 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17981
17982 cat >conftest.$ac_ext <<_ACEOF
17983 #line 17983 "configure"
17984 #include "confdefs.h"
17985
17986 #ifdef HAVE_XCURSES
17987 #include <xcurses.h>
17988 char * XCursesProgramName = "test";
17989 #else
17990 #include <${cf_cv_ncurses_header:-curses.h}>
17991 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17992 #include <ncursesw/term.h>
17993 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17994 #include <ncurses/term.h>
17995 #elif defined(HAVE_TERM_H)
17996 #include <term.h>
17997 #endif
17998 #endif
17999
18000 int
18001 main (void)
18002 {
18003
18004 void *foo = &($cf_data)
18005
18006   ;
18007   return 0;
18008 }
18009 _ACEOF
18010 rm -f conftest.$ac_objext
18011 if { (eval echo "$as_me:18011: \"$ac_compile\"") >&5
18012   (eval $ac_compile) 2>&5
18013   ac_status=$?
18014   echo "$as_me:18014: \$? = $ac_status" >&5
18015   (exit $ac_status); } &&
18016          { ac_try='test -s conftest.$ac_objext'
18017   { (eval echo "$as_me:18017: \"$ac_try\"") >&5
18018   (eval $ac_try) 2>&5
18019   ac_status=$?
18020   echo "$as_me:18020: \$? = $ac_status" >&5
18021   (exit $ac_status); }; }; then
18022   cf_result=yes
18023
18024 else
18025   echo "$as_me: failed program was:" >&5
18026 cat conftest.$ac_ext >&5
18027 cf_result=no
18028 fi
18029 rm -f conftest.$ac_objext conftest.$ac_ext
18030 echo "$as_me:18030: result: $cf_result" >&5
18031 echo "${ECHO_T}$cf_result" >&6
18032
18033 if test $cf_result = yes ; then
18034
18035 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18036
18037         cat >>confdefs.h <<EOF
18038 #define $cf_result 1
18039 EOF
18040
18041 else
18042         echo "$as_me:18042: checking for data $cf_data in library" >&5
18043 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
18044         # BSD linkers insist on making weak linkage, but resolve at runtime.
18045         if test "$cross_compiling" = yes; then
18046
18047         # cross-compiling
18048         cat >conftest.$ac_ext <<_ACEOF
18049 #line 18049 "configure"
18050 #include "confdefs.h"
18051
18052 #ifdef HAVE_XCURSES
18053 #include <xcurses.h>
18054 char * XCursesProgramName = "test";
18055 #else
18056 #include <${cf_cv_ncurses_header:-curses.h}>
18057 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18058 #include <ncursesw/term.h>
18059 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18060 #include <ncurses/term.h>
18061 #elif defined(HAVE_TERM_H)
18062 #include <term.h>
18063 #endif
18064 #endif
18065
18066 extern char $cf_data;
18067 int
18068 main (void)
18069 {
18070
18071         do {
18072                 void *foo = &($cf_data);
18073                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
18074                 ${cf_cv_main_return:-return}(foo == 0);
18075         } while (0)
18076
18077   ;
18078   return 0;
18079 }
18080 _ACEOF
18081 rm -f conftest.$ac_objext conftest$ac_exeext
18082 if { (eval echo "$as_me:18082: \"$ac_link\"") >&5
18083   (eval $ac_link) 2>&5
18084   ac_status=$?
18085   echo "$as_me:18085: \$? = $ac_status" >&5
18086   (exit $ac_status); } &&
18087          { ac_try='test -s conftest$ac_exeext'
18088   { (eval echo "$as_me:18088: \"$ac_try\"") >&5
18089   (eval $ac_try) 2>&5
18090   ac_status=$?
18091   echo "$as_me:18091: \$? = $ac_status" >&5
18092   (exit $ac_status); }; }; then
18093   cf_result=yes
18094 else
18095   echo "$as_me: failed program was:" >&5
18096 cat conftest.$ac_ext >&5
18097 cf_result=no
18098 fi
18099 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18100
18101 else
18102   cat >conftest.$ac_ext <<_ACEOF
18103 #line 18103 "configure"
18104 #include "confdefs.h"
18105
18106 #ifdef HAVE_XCURSES
18107 #include <xcurses.h>
18108 char * XCursesProgramName = "test";
18109 #else
18110 #include <${cf_cv_ncurses_header:-curses.h}>
18111 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18112 #include <ncursesw/term.h>
18113 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18114 #include <ncurses/term.h>
18115 #elif defined(HAVE_TERM_H)
18116 #include <term.h>
18117 #endif
18118 #endif
18119
18120 extern char $cf_data;
18121 int main(void)
18122 {
18123         void *foo = &($cf_data);
18124         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
18125         ${cf_cv_main_return:-return}(foo == 0);
18126 }
18127 _ACEOF
18128 rm -f conftest$ac_exeext
18129 if { (eval echo "$as_me:18129: \"$ac_link\"") >&5
18130   (eval $ac_link) 2>&5
18131   ac_status=$?
18132   echo "$as_me:18132: \$? = $ac_status" >&5
18133   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18134   { (eval echo "$as_me:18134: \"$ac_try\"") >&5
18135   (eval $ac_try) 2>&5
18136   ac_status=$?
18137   echo "$as_me:18137: \$? = $ac_status" >&5
18138   (exit $ac_status); }; }; then
18139   cf_result=yes
18140
18141 else
18142   echo "$as_me: program exited with status $ac_status" >&5
18143 echo "$as_me: failed program was:" >&5
18144 cat conftest.$ac_ext >&5
18145 cf_result=no
18146 fi
18147 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18148 fi
18149         echo "$as_me:18149: result: $cf_result" >&5
18150 echo "${ECHO_T}$cf_result" >&6
18151         if test $cf_result = yes ; then
18152
18153 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18154
18155                 cat >>confdefs.h <<EOF
18156 #define $cf_result 1
18157 EOF
18158
18159                 # do not exit loop here, since we prefer system's declarations
18160         fi
18161 fi
18162 done
18163
18164 if ( test "$GCC" = yes || test "$GXX" = yes )
18165 then
18166 echo "$as_me:18166: checking if you want to turn on gcc warnings" >&5
18167 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
18168
18169 # Check whether --enable-warnings or --disable-warnings was given.
18170 if test "${enable_warnings+set}" = set; then
18171   enableval="$enable_warnings"
18172   test "$enableval" != yes && enableval=no
18173         if test "$enableval" != "no" ; then
18174     with_warnings=yes
18175         else
18176                 with_warnings=no
18177         fi
18178 else
18179   enableval=no
18180         with_warnings=no
18181
18182 fi;
18183 echo "$as_me:18183: result: $with_warnings" >&5
18184 echo "${ECHO_T}$with_warnings" >&6
18185 if test "$with_warnings" = "yes"
18186 then
18187
18188 if test "$GCC" = yes
18189 then
18190 cat > conftest.i <<EOF
18191 #ifndef GCC_PRINTF
18192 #define GCC_PRINTF 0
18193 #endif
18194 #ifndef GCC_SCANF
18195 #define GCC_SCANF 0
18196 #endif
18197 #ifndef GCC_NORETURN
18198 #define GCC_NORETURN /* nothing */
18199 #endif
18200 #ifndef GCC_UNUSED
18201 #define GCC_UNUSED /* nothing */
18202 #endif
18203 EOF
18204 if test "$GCC" = yes
18205 then
18206         { echo "$as_me:18206: checking for $CC __attribute__ directives..." >&5
18207 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
18208 cat > conftest.$ac_ext <<EOF
18209 #line 18209 "${as_me:-configure}"
18210 #include "confdefs.h"
18211 #include "conftest.h"
18212 #include "conftest.i"
18213 #if     GCC_PRINTF
18214 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
18215 #else
18216 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
18217 #endif
18218 #if     GCC_SCANF
18219 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
18220 #else
18221 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
18222 #endif
18223 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
18224 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
18225 extern void foo(void) GCC_NORETURN;
18226 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
18227 EOF
18228         cf_printf_attribute=no
18229         cf_scanf_attribute=no
18230         for cf_attribute in scanf printf unused noreturn
18231         do
18232
18233 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18234
18235                 cf_directive="__attribute__(($cf_attribute))"
18236                 echo "checking for $CC $cf_directive" 1>&5
18237
18238                 case $cf_attribute in
18239                 (printf)
18240                         cf_printf_attribute=yes
18241                         cat >conftest.h <<EOF
18242 #define GCC_$cf_ATTRIBUTE 1
18243 EOF
18244                         ;;
18245                 (scanf)
18246                         cf_scanf_attribute=yes
18247                         cat >conftest.h <<EOF
18248 #define GCC_$cf_ATTRIBUTE 1
18249 EOF
18250                         ;;
18251                 (*)
18252                         cat >conftest.h <<EOF
18253 #define GCC_$cf_ATTRIBUTE $cf_directive
18254 EOF
18255                         ;;
18256                 esac
18257
18258                 if { (eval echo "$as_me:18258: \"$ac_compile\"") >&5
18259   (eval $ac_compile) 2>&5
18260   ac_status=$?
18261   echo "$as_me:18261: \$? = $ac_status" >&5
18262   (exit $ac_status); }; then
18263                         test -n "$verbose" && echo "$as_me:18263: result: ... $cf_attribute" >&5
18264 echo "${ECHO_T}... $cf_attribute" >&6
18265                         cat conftest.h >>confdefs.h
18266                         case $cf_attribute in
18267                         (noreturn)
18268
18269 cat >>confdefs.h <<EOF
18270 #define GCC_NORETURN $cf_directive
18271 EOF
18272
18273                                 ;;
18274                         (printf)
18275                                 cf_value='/* nothing */'
18276                                 if test "$cf_printf_attribute" != no ; then
18277                                         cf_value='__attribute__((format(printf,fmt,var)))'
18278
18279 cat >>confdefs.h <<\EOF
18280 #define GCC_PRINTF 1
18281 EOF
18282
18283                                 fi
18284
18285 cat >>confdefs.h <<EOF
18286 #define GCC_PRINTFLIKE(fmt,var) $cf_value
18287 EOF
18288
18289                                 ;;
18290                         (scanf)
18291                                 cf_value='/* nothing */'
18292                                 if test "$cf_scanf_attribute" != no ; then
18293                                         cf_value='__attribute__((format(scanf,fmt,var)))'
18294
18295 cat >>confdefs.h <<\EOF
18296 #define GCC_SCANF 1
18297 EOF
18298
18299                                 fi
18300
18301 cat >>confdefs.h <<EOF
18302 #define GCC_SCANFLIKE(fmt,var) $cf_value
18303 EOF
18304
18305                                 ;;
18306                         (unused)
18307
18308 cat >>confdefs.h <<EOF
18309 #define GCC_UNUSED $cf_directive
18310 EOF
18311
18312                                 ;;
18313                         esac
18314                 fi
18315         done
18316 else
18317         fgrep define conftest.i >>confdefs.h
18318 fi
18319 rm -rf conftest*
18320 fi
18321
18322 INTEL_COMPILER=no
18323
18324 if test "$GCC" = yes ; then
18325         case $host_os in
18326         (linux*|gnu*)
18327                 echo "$as_me:18327: checking if this is really Intel C compiler" >&5
18328 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
18329                 cf_save_CFLAGS="$CFLAGS"
18330                 CFLAGS="$CFLAGS -no-gcc"
18331                 cat >conftest.$ac_ext <<_ACEOF
18332 #line 18332 "configure"
18333 #include "confdefs.h"
18334
18335 int
18336 main (void)
18337 {
18338
18339 #ifdef __INTEL_COMPILER
18340 #else
18341 make an error
18342 #endif
18343
18344   ;
18345   return 0;
18346 }
18347 _ACEOF
18348 rm -f conftest.$ac_objext
18349 if { (eval echo "$as_me:18349: \"$ac_compile\"") >&5
18350   (eval $ac_compile) 2>&5
18351   ac_status=$?
18352   echo "$as_me:18352: \$? = $ac_status" >&5
18353   (exit $ac_status); } &&
18354          { ac_try='test -s conftest.$ac_objext'
18355   { (eval echo "$as_me:18355: \"$ac_try\"") >&5
18356   (eval $ac_try) 2>&5
18357   ac_status=$?
18358   echo "$as_me:18358: \$? = $ac_status" >&5
18359   (exit $ac_status); }; }; then
18360   INTEL_COMPILER=yes
18361 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
18362
18363 else
18364   echo "$as_me: failed program was:" >&5
18365 cat conftest.$ac_ext >&5
18366 fi
18367 rm -f conftest.$ac_objext conftest.$ac_ext
18368                 CFLAGS="$cf_save_CFLAGS"
18369                 echo "$as_me:18369: result: $INTEL_COMPILER" >&5
18370 echo "${ECHO_T}$INTEL_COMPILER" >&6
18371                 ;;
18372         esac
18373 fi
18374
18375 CLANG_COMPILER=no
18376
18377 if test "$GCC" = yes ; then
18378         echo "$as_me:18378: checking if this is really Clang C compiler" >&5
18379 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
18380         cf_save_CFLAGS="$CFLAGS"
18381         CFLAGS="$CFLAGS -Qunused-arguments"
18382         cat >conftest.$ac_ext <<_ACEOF
18383 #line 18383 "configure"
18384 #include "confdefs.h"
18385
18386 int
18387 main (void)
18388 {
18389
18390 #ifdef __clang__
18391 #else
18392 make an error
18393 #endif
18394
18395   ;
18396   return 0;
18397 }
18398 _ACEOF
18399 rm -f conftest.$ac_objext
18400 if { (eval echo "$as_me:18400: \"$ac_compile\"") >&5
18401   (eval $ac_compile) 2>&5
18402   ac_status=$?
18403   echo "$as_me:18403: \$? = $ac_status" >&5
18404   (exit $ac_status); } &&
18405          { ac_try='test -s conftest.$ac_objext'
18406   { (eval echo "$as_me:18406: \"$ac_try\"") >&5
18407   (eval $ac_try) 2>&5
18408   ac_status=$?
18409   echo "$as_me:18409: \$? = $ac_status" >&5
18410   (exit $ac_status); }; }; then
18411   CLANG_COMPILER=yes
18412 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
18413
18414 else
18415   echo "$as_me: failed program was:" >&5
18416 cat conftest.$ac_ext >&5
18417 fi
18418 rm -f conftest.$ac_objext conftest.$ac_ext
18419         CFLAGS="$cf_save_CFLAGS"
18420         echo "$as_me:18420: result: $CLANG_COMPILER" >&5
18421 echo "${ECHO_T}$CLANG_COMPILER" >&6
18422 fi
18423
18424 cat > conftest.$ac_ext <<EOF
18425 #line 18425 "${as_me:-configure}"
18426 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
18427 EOF
18428
18429 if test "$INTEL_COMPILER" = yes
18430 then
18431 # The "-wdXXX" options suppress warnings:
18432 # remark #1419: external declaration in primary source file
18433 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
18434 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
18435 # remark #193: zero used for undefined preprocessing identifier
18436 # remark #593: variable "curs_sb_left_arrow" was set but never used
18437 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
18438 # remark #869: parameter "tw" was never referenced
18439 # remark #981: operands are evaluated in unspecified order
18440 # warning #279: controlling expression is constant
18441
18442         { echo "$as_me:18442: checking for $CC warning options..." >&5
18443 echo "$as_me: checking for $CC warning options..." >&6;}
18444         cf_save_CFLAGS="$CFLAGS"
18445         EXTRA_CFLAGS="-Wall"
18446         for cf_opt in \
18447                 wd1419 \
18448                 wd1683 \
18449                 wd1684 \
18450                 wd193 \
18451                 wd593 \
18452                 wd279 \
18453                 wd810 \
18454                 wd869 \
18455                 wd981
18456         do
18457                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
18458                 if { (eval echo "$as_me:18458: \"$ac_compile\"") >&5
18459   (eval $ac_compile) 2>&5
18460   ac_status=$?
18461   echo "$as_me:18461: \$? = $ac_status" >&5
18462   (exit $ac_status); }; then
18463                         test -n "$verbose" && echo "$as_me:18463: result: ... -$cf_opt" >&5
18464 echo "${ECHO_T}... -$cf_opt" >&6
18465                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
18466                 fi
18467         done
18468         CFLAGS="$cf_save_CFLAGS"
18469
18470 elif test "$GCC" = yes
18471 then
18472         { echo "$as_me:18472: checking for $CC warning options..." >&5
18473 echo "$as_me: checking for $CC warning options..." >&6;}
18474         cf_save_CFLAGS="$CFLAGS"
18475         EXTRA_CFLAGS=
18476         cf_warn_CONST=""
18477         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
18478         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
18479         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
18480         for cf_opt in W Wall \
18481                 Wbad-function-cast \
18482                 Wcast-align \
18483                 Wcast-qual \
18484                 Wdeclaration-after-statement \
18485                 Wextra \
18486                 Winline \
18487                 Wmissing-declarations \
18488                 Wmissing-prototypes \
18489                 Wnested-externs \
18490                 Wpointer-arith \
18491                 Wshadow \
18492                 Wstrict-prototypes \
18493                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
18494         do
18495                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
18496                 if { (eval echo "$as_me:18496: \"$ac_compile\"") >&5
18497   (eval $ac_compile) 2>&5
18498   ac_status=$?
18499   echo "$as_me:18499: \$? = $ac_status" >&5
18500   (exit $ac_status); }; then
18501                         test -n "$verbose" && echo "$as_me:18501: result: ... -$cf_opt" >&5
18502 echo "${ECHO_T}... -$cf_opt" >&6
18503                         case $cf_opt in
18504                         (Wcast-qual)
18505                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
18506                                 ;;
18507                         (Winline)
18508                                 case $GCC_VERSION in
18509                                 ([34].*)
18510                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
18511
18512 echo "${as_me:-configure}:18512: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
18513
18514                                         continue;;
18515                                 esac
18516                                 ;;
18517                         (Wpointer-arith)
18518                                 case $GCC_VERSION in
18519                                 ([12].*)
18520                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
18521
18522 echo "${as_me:-configure}:18522: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
18523
18524                                         continue;;
18525                                 esac
18526                                 ;;
18527                         esac
18528                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
18529                 fi
18530         done
18531         CFLAGS="$cf_save_CFLAGS"
18532 fi
18533 rm -rf conftest*
18534
18535 fi
18536 fi
18537
18538 echo "$as_me:18538: checking if you want to use dmalloc for testing" >&5
18539 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
18540
18541 # Check whether --with-dmalloc or --without-dmalloc was given.
18542 if test "${with_dmalloc+set}" = set; then
18543   withval="$with_dmalloc"
18544
18545 cat >>confdefs.h <<EOF
18546 #define USE_DMALLOC 1
18547 EOF
18548
18549         : ${with_cflags:=-g}
18550         : ${with_no_leaks:=yes}
18551          with_dmalloc=yes
18552 else
18553   with_dmalloc=
18554 fi;
18555 echo "$as_me:18555: result: ${with_dmalloc:-no}" >&5
18556 echo "${ECHO_T}${with_dmalloc:-no}" >&6
18557
18558 case .$with_cflags in
18559 (.*-g*)
18560         case .$CFLAGS in
18561         (.*-g*)
18562                 ;;
18563         (*)
18564
18565 cf_fix_cppflags=no
18566 cf_new_cflags=
18567 cf_new_cppflags=
18568 cf_new_extra_cppflags=
18569
18570 for cf_add_cflags in -g
18571 do
18572 case $cf_fix_cppflags in
18573 (no)
18574         case $cf_add_cflags in
18575         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18576                 case $cf_add_cflags in
18577                 (-D*)
18578                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18579
18580                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18581                                 && test -z "${cf_tst_cflags}" \
18582                                 && cf_fix_cppflags=yes
18583
18584                         if test $cf_fix_cppflags = yes ; then
18585
18586         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18587         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18588
18589                                 continue
18590                         elif test "${cf_tst_cflags}" = "\"'" ; then
18591
18592         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18593         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18594
18595                                 continue
18596                         fi
18597                         ;;
18598                 esac
18599                 case "$CPPFLAGS" in
18600                 (*$cf_add_cflags)
18601                         ;;
18602                 (*)
18603                         case $cf_add_cflags in
18604                         (-D*)
18605                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18606
18607 CPPFLAGS=`echo "$CPPFLAGS" | \
18608         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18609                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18610
18611                                 ;;
18612                         esac
18613
18614         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18615         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18616
18617                         ;;
18618                 esac
18619                 ;;
18620         (*)
18621
18622         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18623         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18624
18625                 ;;
18626         esac
18627         ;;
18628 (yes)
18629
18630         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18631         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18632
18633         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18634
18635         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18636                 && test -z "${cf_tst_cflags}" \
18637                 && cf_fix_cppflags=no
18638         ;;
18639 esac
18640 done
18641
18642 if test -n "$cf_new_cflags" ; then
18643
18644         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18645         CFLAGS="${CFLAGS}$cf_new_cflags"
18646
18647 fi
18648
18649 if test -n "$cf_new_cppflags" ; then
18650
18651         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18652         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18653
18654 fi
18655
18656 if test -n "$cf_new_extra_cppflags" ; then
18657
18658         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18659         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18660
18661 fi
18662
18663                 ;;
18664         esac
18665         ;;
18666 esac
18667
18668 if test "$with_dmalloc" = yes ; then
18669         echo "$as_me:18669: checking for dmalloc.h" >&5
18670 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
18671 if test "${ac_cv_header_dmalloc_h+set}" = set; then
18672   echo $ECHO_N "(cached) $ECHO_C" >&6
18673 else
18674   cat >conftest.$ac_ext <<_ACEOF
18675 #line 18675 "configure"
18676 #include "confdefs.h"
18677 #include <dmalloc.h>
18678 _ACEOF
18679 if { (eval echo "$as_me:18679: \"$ac_cpp conftest.$ac_ext\"") >&5
18680   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18681   ac_status=$?
18682   egrep -v '^ *\+' conftest.er1 >conftest.err
18683   rm -f conftest.er1
18684   cat conftest.err >&5
18685   echo "$as_me:18685: \$? = $ac_status" >&5
18686   (exit $ac_status); } >/dev/null; then
18687   if test -s conftest.err; then
18688     ac_cpp_err=$ac_c_preproc_warn_flag
18689   else
18690     ac_cpp_err=
18691   fi
18692 else
18693   ac_cpp_err=yes
18694 fi
18695 if test -z "$ac_cpp_err"; then
18696   ac_cv_header_dmalloc_h=yes
18697 else
18698   echo "$as_me: failed program was:" >&5
18699   cat conftest.$ac_ext >&5
18700   ac_cv_header_dmalloc_h=no
18701 fi
18702 rm -f conftest.err conftest.$ac_ext
18703 fi
18704 echo "$as_me:18704: result: $ac_cv_header_dmalloc_h" >&5
18705 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
18706 if test $ac_cv_header_dmalloc_h = yes; then
18707
18708 echo "$as_me:18708: checking for dmalloc_debug in -ldmalloc" >&5
18709 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
18710 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
18711   echo $ECHO_N "(cached) $ECHO_C" >&6
18712 else
18713   ac_check_lib_save_LIBS=$LIBS
18714 LIBS="-ldmalloc  $LIBS"
18715 cat >conftest.$ac_ext <<_ACEOF
18716 #line 18716 "configure"
18717 #include "confdefs.h"
18718
18719 /* Override any gcc2 internal prototype to avoid an error.  */
18720 #ifdef __cplusplus
18721 extern "C"
18722 #endif
18723 /* We use char because int might match the return type of a gcc2
18724    builtin and then its argument prototype would still apply.  */
18725 char dmalloc_debug ();
18726 int
18727 main (void)
18728 {
18729 dmalloc_debug ();
18730   ;
18731   return 0;
18732 }
18733 _ACEOF
18734 rm -f conftest.$ac_objext conftest$ac_exeext
18735 if { (eval echo "$as_me:18735: \"$ac_link\"") >&5
18736   (eval $ac_link) 2>&5
18737   ac_status=$?
18738   echo "$as_me:18738: \$? = $ac_status" >&5
18739   (exit $ac_status); } &&
18740          { ac_try='test -s conftest$ac_exeext'
18741   { (eval echo "$as_me:18741: \"$ac_try\"") >&5
18742   (eval $ac_try) 2>&5
18743   ac_status=$?
18744   echo "$as_me:18744: \$? = $ac_status" >&5
18745   (exit $ac_status); }; }; then
18746   ac_cv_lib_dmalloc_dmalloc_debug=yes
18747 else
18748   echo "$as_me: failed program was:" >&5
18749 cat conftest.$ac_ext >&5
18750 ac_cv_lib_dmalloc_dmalloc_debug=no
18751 fi
18752 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18753 LIBS=$ac_check_lib_save_LIBS
18754 fi
18755 echo "$as_me:18755: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
18756 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
18757 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
18758   cat >>confdefs.h <<EOF
18759 #define HAVE_LIBDMALLOC 1
18760 EOF
18761
18762   LIBS="-ldmalloc $LIBS"
18763
18764 fi
18765
18766 fi
18767
18768 fi
18769
18770 echo "$as_me:18770: checking if you want to use dbmalloc for testing" >&5
18771 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
18772
18773 # Check whether --with-dbmalloc or --without-dbmalloc was given.
18774 if test "${with_dbmalloc+set}" = set; then
18775   withval="$with_dbmalloc"
18776
18777 cat >>confdefs.h <<EOF
18778 #define USE_DBMALLOC 1
18779 EOF
18780
18781         : ${with_cflags:=-g}
18782         : ${with_no_leaks:=yes}
18783          with_dbmalloc=yes
18784 else
18785   with_dbmalloc=
18786 fi;
18787 echo "$as_me:18787: result: ${with_dbmalloc:-no}" >&5
18788 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
18789
18790 case .$with_cflags in
18791 (.*-g*)
18792         case .$CFLAGS in
18793         (.*-g*)
18794                 ;;
18795         (*)
18796
18797 cf_fix_cppflags=no
18798 cf_new_cflags=
18799 cf_new_cppflags=
18800 cf_new_extra_cppflags=
18801
18802 for cf_add_cflags in -g
18803 do
18804 case $cf_fix_cppflags in
18805 (no)
18806         case $cf_add_cflags in
18807         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18808                 case $cf_add_cflags in
18809                 (-D*)
18810                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18811
18812                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18813                                 && test -z "${cf_tst_cflags}" \
18814                                 && cf_fix_cppflags=yes
18815
18816                         if test $cf_fix_cppflags = yes ; then
18817
18818         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18819         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18820
18821                                 continue
18822                         elif test "${cf_tst_cflags}" = "\"'" ; then
18823
18824         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18825         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18826
18827                                 continue
18828                         fi
18829                         ;;
18830                 esac
18831                 case "$CPPFLAGS" in
18832                 (*$cf_add_cflags)
18833                         ;;
18834                 (*)
18835                         case $cf_add_cflags in
18836                         (-D*)
18837                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18838
18839 CPPFLAGS=`echo "$CPPFLAGS" | \
18840         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18841                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18842
18843                                 ;;
18844                         esac
18845
18846         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18847         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18848
18849                         ;;
18850                 esac
18851                 ;;
18852         (*)
18853
18854         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18855         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18856
18857                 ;;
18858         esac
18859         ;;
18860 (yes)
18861
18862         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18863         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18864
18865         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18866
18867         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18868                 && test -z "${cf_tst_cflags}" \
18869                 && cf_fix_cppflags=no
18870         ;;
18871 esac
18872 done
18873
18874 if test -n "$cf_new_cflags" ; then
18875
18876         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18877         CFLAGS="${CFLAGS}$cf_new_cflags"
18878
18879 fi
18880
18881 if test -n "$cf_new_cppflags" ; then
18882
18883         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18884         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18885
18886 fi
18887
18888 if test -n "$cf_new_extra_cppflags" ; then
18889
18890         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18891         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18892
18893 fi
18894
18895                 ;;
18896         esac
18897         ;;
18898 esac
18899
18900 if test "$with_dbmalloc" = yes ; then
18901         echo "$as_me:18901: checking for dbmalloc.h" >&5
18902 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
18903 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
18904   echo $ECHO_N "(cached) $ECHO_C" >&6
18905 else
18906   cat >conftest.$ac_ext <<_ACEOF
18907 #line 18907 "configure"
18908 #include "confdefs.h"
18909 #include <dbmalloc.h>
18910 _ACEOF
18911 if { (eval echo "$as_me:18911: \"$ac_cpp conftest.$ac_ext\"") >&5
18912   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18913   ac_status=$?
18914   egrep -v '^ *\+' conftest.er1 >conftest.err
18915   rm -f conftest.er1
18916   cat conftest.err >&5
18917   echo "$as_me:18917: \$? = $ac_status" >&5
18918   (exit $ac_status); } >/dev/null; then
18919   if test -s conftest.err; then
18920     ac_cpp_err=$ac_c_preproc_warn_flag
18921   else
18922     ac_cpp_err=
18923   fi
18924 else
18925   ac_cpp_err=yes
18926 fi
18927 if test -z "$ac_cpp_err"; then
18928   ac_cv_header_dbmalloc_h=yes
18929 else
18930   echo "$as_me: failed program was:" >&5
18931   cat conftest.$ac_ext >&5
18932   ac_cv_header_dbmalloc_h=no
18933 fi
18934 rm -f conftest.err conftest.$ac_ext
18935 fi
18936 echo "$as_me:18936: result: $ac_cv_header_dbmalloc_h" >&5
18937 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
18938 if test $ac_cv_header_dbmalloc_h = yes; then
18939
18940 echo "$as_me:18940: checking for debug_malloc in -ldbmalloc" >&5
18941 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
18942 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
18943   echo $ECHO_N "(cached) $ECHO_C" >&6
18944 else
18945   ac_check_lib_save_LIBS=$LIBS
18946 LIBS="-ldbmalloc  $LIBS"
18947 cat >conftest.$ac_ext <<_ACEOF
18948 #line 18948 "configure"
18949 #include "confdefs.h"
18950
18951 /* Override any gcc2 internal prototype to avoid an error.  */
18952 #ifdef __cplusplus
18953 extern "C"
18954 #endif
18955 /* We use char because int might match the return type of a gcc2
18956    builtin and then its argument prototype would still apply.  */
18957 char debug_malloc ();
18958 int
18959 main (void)
18960 {
18961 debug_malloc ();
18962   ;
18963   return 0;
18964 }
18965 _ACEOF
18966 rm -f conftest.$ac_objext conftest$ac_exeext
18967 if { (eval echo "$as_me:18967: \"$ac_link\"") >&5
18968   (eval $ac_link) 2>&5
18969   ac_status=$?
18970   echo "$as_me:18970: \$? = $ac_status" >&5
18971   (exit $ac_status); } &&
18972          { ac_try='test -s conftest$ac_exeext'
18973   { (eval echo "$as_me:18973: \"$ac_try\"") >&5
18974   (eval $ac_try) 2>&5
18975   ac_status=$?
18976   echo "$as_me:18976: \$? = $ac_status" >&5
18977   (exit $ac_status); }; }; then
18978   ac_cv_lib_dbmalloc_debug_malloc=yes
18979 else
18980   echo "$as_me: failed program was:" >&5
18981 cat conftest.$ac_ext >&5
18982 ac_cv_lib_dbmalloc_debug_malloc=no
18983 fi
18984 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18985 LIBS=$ac_check_lib_save_LIBS
18986 fi
18987 echo "$as_me:18987: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
18988 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
18989 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
18990   cat >>confdefs.h <<EOF
18991 #define HAVE_LIBDBMALLOC 1
18992 EOF
18993
18994   LIBS="-ldbmalloc $LIBS"
18995
18996 fi
18997
18998 fi
18999
19000 fi
19001
19002 echo "$as_me:19002: checking if you want to use valgrind for testing" >&5
19003 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
19004
19005 # Check whether --with-valgrind or --without-valgrind was given.
19006 if test "${with_valgrind+set}" = set; then
19007   withval="$with_valgrind"
19008
19009 cat >>confdefs.h <<EOF
19010 #define USE_VALGRIND 1
19011 EOF
19012
19013         : ${with_cflags:=-g}
19014         : ${with_no_leaks:=yes}
19015          with_valgrind=yes
19016 else
19017   with_valgrind=
19018 fi;
19019 echo "$as_me:19019: result: ${with_valgrind:-no}" >&5
19020 echo "${ECHO_T}${with_valgrind:-no}" >&6
19021
19022 case .$with_cflags in
19023 (.*-g*)
19024         case .$CFLAGS in
19025         (.*-g*)
19026                 ;;
19027         (*)
19028
19029 cf_fix_cppflags=no
19030 cf_new_cflags=
19031 cf_new_cppflags=
19032 cf_new_extra_cppflags=
19033
19034 for cf_add_cflags in -g
19035 do
19036 case $cf_fix_cppflags in
19037 (no)
19038         case $cf_add_cflags in
19039         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19040                 case $cf_add_cflags in
19041                 (-D*)
19042                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19043
19044                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19045                                 && test -z "${cf_tst_cflags}" \
19046                                 && cf_fix_cppflags=yes
19047
19048                         if test $cf_fix_cppflags = yes ; then
19049
19050         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19051         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19052
19053                                 continue
19054                         elif test "${cf_tst_cflags}" = "\"'" ; then
19055
19056         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19057         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19058
19059                                 continue
19060                         fi
19061                         ;;
19062                 esac
19063                 case "$CPPFLAGS" in
19064                 (*$cf_add_cflags)
19065                         ;;
19066                 (*)
19067                         case $cf_add_cflags in
19068                         (-D*)
19069                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19070
19071 CPPFLAGS=`echo "$CPPFLAGS" | \
19072         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19073                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19074
19075                                 ;;
19076                         esac
19077
19078         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19079         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19080
19081                         ;;
19082                 esac
19083                 ;;
19084         (*)
19085
19086         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19087         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19088
19089                 ;;
19090         esac
19091         ;;
19092 (yes)
19093
19094         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19095         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19096
19097         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19098
19099         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19100                 && test -z "${cf_tst_cflags}" \
19101                 && cf_fix_cppflags=no
19102         ;;
19103 esac
19104 done
19105
19106 if test -n "$cf_new_cflags" ; then
19107
19108         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19109         CFLAGS="${CFLAGS}$cf_new_cflags"
19110
19111 fi
19112
19113 if test -n "$cf_new_cppflags" ; then
19114
19115         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19116         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19117
19118 fi
19119
19120 if test -n "$cf_new_extra_cppflags" ; then
19121
19122         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19123         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19124
19125 fi
19126
19127                 ;;
19128         esac
19129         ;;
19130 esac
19131
19132 echo "$as_me:19132: checking if you want to perform memory-leak testing" >&5
19133 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
19134
19135 # Check whether --enable-leaks or --disable-leaks was given.
19136 if test "${enable_leaks+set}" = set; then
19137   enableval="$enable_leaks"
19138   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
19139 else
19140   : ${with_no_leaks:=no}
19141 fi;
19142 echo "$as_me:19142: result: $with_no_leaks" >&5
19143 echo "${ECHO_T}$with_no_leaks" >&6
19144
19145 if test "$with_no_leaks" = yes ; then
19146
19147 cat >>confdefs.h <<\EOF
19148 #define NO_LEAKS 1
19149 EOF
19150
19151 cat >>confdefs.h <<\EOF
19152 #define YY_NO_LEAKS 1
19153 EOF
19154
19155 fi
19156
19157 LD_RPATH_OPT=
19158 echo "$as_me:19158: checking for an rpath option" >&5
19159 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
19160 case $cf_cv_system_name in
19161 (irix*)
19162         if test "$GCC" = yes; then
19163                 LD_RPATH_OPT="-Wl,-rpath,"
19164         else
19165                 LD_RPATH_OPT="-rpath "
19166         fi
19167         ;;
19168 (linux*|gnu*|k*bsd*-gnu|freebsd*)
19169         LD_RPATH_OPT="-Wl,-rpath,"
19170         ;;
19171 (openbsd[2-9].*|mirbsd*)
19172         LD_RPATH_OPT="-Wl,-rpath,"
19173         ;;
19174 (dragonfly*)
19175         LD_RPATH_OPT="-rpath "
19176         ;;
19177 (netbsd*)
19178         LD_RPATH_OPT="-Wl,-rpath,"
19179         ;;
19180 (osf*|mls+*)
19181         LD_RPATH_OPT="-rpath "
19182         ;;
19183 (solaris2*)
19184         LD_RPATH_OPT="-R"
19185         ;;
19186 (*)
19187         ;;
19188 esac
19189 echo "$as_me:19189: result: $LD_RPATH_OPT" >&5
19190 echo "${ECHO_T}$LD_RPATH_OPT" >&6
19191
19192 case "x$LD_RPATH_OPT" in
19193 (x-R*)
19194         echo "$as_me:19194: checking if we need a space after rpath option" >&5
19195 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
19196         cf_save_LIBS="$LIBS"
19197
19198 cf_add_libs="${LD_RPATH_OPT}$libdir"
19199 # Filter out duplicates - this happens with badly-designed ".pc" files...
19200 for cf_add_1lib in $LIBS
19201 do
19202         for cf_add_2lib in $cf_add_libs
19203         do
19204                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
19205                 then
19206                         cf_add_1lib=
19207                         break
19208                 fi
19209         done
19210         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
19211 done
19212 LIBS="$cf_add_libs"
19213
19214         cat >conftest.$ac_ext <<_ACEOF
19215 #line 19215 "configure"
19216 #include "confdefs.h"
19217
19218 int
19219 main (void)
19220 {
19221
19222   ;
19223   return 0;
19224 }
19225 _ACEOF
19226 rm -f conftest.$ac_objext conftest$ac_exeext
19227 if { (eval echo "$as_me:19227: \"$ac_link\"") >&5
19228   (eval $ac_link) 2>&5
19229   ac_status=$?
19230   echo "$as_me:19230: \$? = $ac_status" >&5
19231   (exit $ac_status); } &&
19232          { ac_try='test -s conftest$ac_exeext'
19233   { (eval echo "$as_me:19233: \"$ac_try\"") >&5
19234   (eval $ac_try) 2>&5
19235   ac_status=$?
19236   echo "$as_me:19236: \$? = $ac_status" >&5
19237   (exit $ac_status); }; }; then
19238   cf_rpath_space=no
19239 else
19240   echo "$as_me: failed program was:" >&5
19241 cat conftest.$ac_ext >&5
19242 cf_rpath_space=yes
19243 fi
19244 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19245         LIBS="$cf_save_LIBS"
19246         echo "$as_me:19246: result: $cf_rpath_space" >&5
19247 echo "${ECHO_T}$cf_rpath_space" >&6
19248         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
19249         ;;
19250 esac
19251
19252 echo "$as_me:19252: checking if rpath-hack should be disabled" >&5
19253 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
19254
19255 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
19256 if test "${enable_rpath_hack+set}" = set; then
19257   enableval="$enable_rpath_hack"
19258   test "$enableval" != no && enableval=yes
19259         if test "$enableval" != "yes" ; then
19260     cf_disable_rpath_hack=yes
19261         else
19262                 cf_disable_rpath_hack=no
19263         fi
19264 else
19265   enableval=yes
19266         cf_disable_rpath_hack=no
19267
19268 fi;
19269 echo "$as_me:19269: result: $cf_disable_rpath_hack" >&5
19270 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
19271 if test "$cf_disable_rpath_hack" = no ; then
19272
19273 echo "$as_me:19273: checking for updated LDFLAGS" >&5
19274 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
19275 if test -n "$LD_RPATH_OPT" ; then
19276         echo "$as_me:19276: result: maybe" >&5
19277 echo "${ECHO_T}maybe" >&6
19278
19279         for ac_prog in ldd
19280 do
19281   # Extract the first word of "$ac_prog", so it can be a program name with args.
19282 set dummy $ac_prog; ac_word=$2
19283 echo "$as_me:19283: checking for $ac_word" >&5
19284 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
19285 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
19286   echo $ECHO_N "(cached) $ECHO_C" >&6
19287 else
19288   if test -n "$cf_ldd_prog"; then
19289   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
19290 else
19291   ac_save_IFS=$IFS; IFS=$ac_path_separator
19292 ac_dummy="$PATH"
19293 for ac_dir in $ac_dummy; do
19294   IFS=$ac_save_IFS
19295   test -z "$ac_dir" && ac_dir=.
19296   $as_executable_p "$ac_dir/$ac_word" || continue
19297 ac_cv_prog_cf_ldd_prog="$ac_prog"
19298 echo "$as_me:19298: found $ac_dir/$ac_word" >&5
19299 break
19300 done
19301
19302 fi
19303 fi
19304 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
19305 if test -n "$cf_ldd_prog"; then
19306   echo "$as_me:19306: result: $cf_ldd_prog" >&5
19307 echo "${ECHO_T}$cf_ldd_prog" >&6
19308 else
19309   echo "$as_me:19309: result: no" >&5
19310 echo "${ECHO_T}no" >&6
19311 fi
19312
19313   test -n "$cf_ldd_prog" && break
19314 done
19315 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
19316
19317         cf_rpath_list="/usr/lib /lib"
19318         if test "$cf_ldd_prog" != no
19319         then
19320                 cf_rpath_oops=
19321
19322 cat >conftest.$ac_ext <<_ACEOF
19323 #line 19323 "configure"
19324 #include "confdefs.h"
19325 #include <stdio.h>
19326 int
19327 main (void)
19328 {
19329 printf("Hello");
19330   ;
19331   return 0;
19332 }
19333 _ACEOF
19334 rm -f conftest.$ac_objext conftest$ac_exeext
19335 if { (eval echo "$as_me:19335: \"$ac_link\"") >&5
19336   (eval $ac_link) 2>&5
19337   ac_status=$?
19338   echo "$as_me:19338: \$? = $ac_status" >&5
19339   (exit $ac_status); } &&
19340          { ac_try='test -s conftest$ac_exeext'
19341   { (eval echo "$as_me:19341: \"$ac_try\"") >&5
19342   (eval $ac_try) 2>&5
19343   ac_status=$?
19344   echo "$as_me:19344: \$? = $ac_status" >&5
19345   (exit $ac_status); }; }; then
19346   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
19347                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
19348 else
19349   echo "$as_me: failed program was:" >&5
19350 cat conftest.$ac_ext >&5
19351 fi
19352 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19353
19354                 # If we passed the link-test, but get a "not found" on a given library,
19355                 # this could be due to inept reconfiguration of gcc to make it only
19356                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
19357                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
19358                 # /usr/local libraries.
19359                 if test -n "$cf_rpath_oops"
19360                 then
19361                         for cf_rpath_src in $cf_rpath_oops
19362                         do
19363                                 for cf_rpath_dir in \
19364                                         /usr/local \
19365                                         /usr/pkg \
19366                                         /opt/sfw
19367                                 do
19368                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
19369                                         then
19370                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
19371
19372 echo "${as_me:-configure}:19372: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
19373
19374                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
19375                                                 break
19376                                         fi
19377                                 done
19378                         done
19379                 fi
19380         fi
19381
19382         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
19383
19384 echo "${as_me:-configure}:19384: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
19385
19386 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
19387
19388 echo "${as_me:-configure}:19388: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
19389
19390 cf_rpath_dst=
19391 for cf_rpath_src in $LDFLAGS
19392 do
19393         case $cf_rpath_src in
19394         (-L*)
19395
19396                 # check if this refers to a directory which we will ignore
19397                 cf_rpath_skip=no
19398                 if test -n "$cf_rpath_list"
19399                 then
19400                         for cf_rpath_item in $cf_rpath_list
19401                         do
19402                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
19403                                 then
19404                                         cf_rpath_skip=yes
19405                                         break
19406                                 fi
19407                         done
19408                 fi
19409
19410                 if test "$cf_rpath_skip" = no
19411                 then
19412                         # transform the option
19413                         if test "$LD_RPATH_OPT" = "-R " ; then
19414                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
19415                         else
19416                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
19417                         fi
19418
19419                         # if we have not already added this, add it now
19420                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
19421                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
19422                         then
19423                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
19424
19425 echo "${as_me:-configure}:19425: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
19426
19427                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
19428                         fi
19429                 fi
19430                 ;;
19431         esac
19432         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
19433 done
19434 LDFLAGS=$cf_rpath_dst
19435
19436 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
19437
19438 echo "${as_me:-configure}:19438: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
19439
19440 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
19441
19442 echo "${as_me:-configure}:19442: testing ...checking LIBS $LIBS ..." 1>&5
19443
19444 cf_rpath_dst=
19445 for cf_rpath_src in $LIBS
19446 do
19447         case $cf_rpath_src in
19448         (-L*)
19449
19450                 # check if this refers to a directory which we will ignore
19451                 cf_rpath_skip=no
19452                 if test -n "$cf_rpath_list"
19453                 then
19454                         for cf_rpath_item in $cf_rpath_list
19455                         do
19456                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
19457                                 then
19458                                         cf_rpath_skip=yes
19459                                         break
19460                                 fi
19461                         done
19462                 fi
19463
19464                 if test "$cf_rpath_skip" = no
19465                 then
19466                         # transform the option
19467                         if test "$LD_RPATH_OPT" = "-R " ; then
19468                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
19469                         else
19470                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
19471                         fi
19472
19473                         # if we have not already added this, add it now
19474                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
19475                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
19476                         then
19477                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
19478
19479 echo "${as_me:-configure}:19479: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
19480
19481                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
19482                         fi
19483                 fi
19484                 ;;
19485         esac
19486         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
19487 done
19488 LIBS=$cf_rpath_dst
19489
19490 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
19491
19492 echo "${as_me:-configure}:19492: testing ...checked LIBS $LIBS ..." 1>&5
19493
19494         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
19495
19496 echo "${as_me:-configure}:19496: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
19497
19498 else
19499         echo "$as_me:19499: result: no" >&5
19500 echo "${ECHO_T}no" >&6
19501 fi
19502
19503 fi
19504
19505 TEST_ARGS="$LIBS"
19506 LIBS=
19507
19508 ac_config_files="$ac_config_files Makefile"
19509 ac_config_commands="$ac_config_commands default"
19510 cat >confcache <<\_ACEOF
19511 # This file is a shell script that caches the results of configure
19512 # tests run on this system so they can be shared between configure
19513 # scripts and configure runs, see configure's option --config-cache.
19514 # It is not useful on other systems.  If it contains results you don't
19515 # want to keep, you may remove or edit it.
19516 #
19517 # config.status only pays attention to the cache file if you give it
19518 # the --recheck option to rerun configure.
19519 #
19520 # `ac_cv_env_foo' variables (set or unset) will be overriden when
19521 # loading this file, other *unset* `ac_cv_foo' will be assigned the
19522 # following values.
19523
19524 _ACEOF
19525
19526 # The following way of writing the cache mishandles newlines in values,
19527 # but we know of no workaround that is simple, portable, and efficient.
19528 # So, don't put newlines in cache variables' values.
19529 # Ultrix sh set writes to stderr and can't be redirected directly,
19530 # and sets the high bit in the cache file unless we assign to the vars.
19531 {
19532   (set) 2>&1 |
19533     case `(ac_space=' '; set | grep ac_space) 2>&1` in
19534     *ac_space=\ *)
19535       # `set' does not quote correctly, so add quotes (double-quote
19536       # substitution turns \\\\ into \\, and sed turns \\ into \).
19537       sed -n \
19538         "s/'/'\\\\''/g;
19539           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
19540       ;;
19541     *)
19542       # `set' quotes correctly as required by POSIX, so do not add quotes.
19543       sed -n \
19544         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
19545       ;;
19546     esac;
19547 } |
19548   sed '
19549      t clear
19550      : clear
19551      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
19552      t end
19553      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
19554      : end' >>confcache
19555 if cmp -s $cache_file confcache; then :; else
19556   if test -w $cache_file; then
19557     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
19558     cat confcache >$cache_file
19559   else
19560     echo "not updating unwritable cache $cache_file"
19561   fi
19562 fi
19563 rm -f confcache
19564
19565 test "x$prefix" = xNONE && prefix=$ac_default_prefix
19566 # Let make expand exec_prefix.
19567 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
19568
19569 # VPATH may cause trouble with some makes, so we remove $(srcdir),
19570 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
19571 # trailing colons and then remove the whole line if VPATH becomes empty
19572 # (actually we leave an empty line to preserve line numbers).
19573 if test "x$srcdir" = x.; then
19574   ac_vpsub='/^[         ]*VPATH[        ]*=/{
19575 s/:*\$(srcdir):*/:/;
19576 s/:*\${srcdir}:*/:/;
19577 s/:*@srcdir@:*/:/;
19578 s/^\([^=]*=[    ]*\):*/\1/;
19579 s/:*$//;
19580 s/^[^=]*=[      ]*$//;
19581 }'
19582 fi
19583
19584 DEFS=-DHAVE_CONFIG_H
19585
19586 : ${CONFIG_STATUS=./config.status}
19587 ac_clean_files_save=$ac_clean_files
19588 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
19589 { echo "$as_me:19589: creating $CONFIG_STATUS" >&5
19590 echo "$as_me: creating $CONFIG_STATUS" >&6;}
19591 cat >$CONFIG_STATUS <<_ACEOF
19592 #! $SHELL
19593 # Generated automatically by configure.
19594 # Run this file to recreate the current configuration.
19595 # Compiler output produced by configure, useful for debugging
19596 # configure, is in config.log if it exists.
19597
19598 debug=false
19599 SHELL=\${CONFIG_SHELL-$SHELL}
19600 ac_cs_invocation="\$0 \$@"
19601
19602 _ACEOF
19603
19604 cat >>$CONFIG_STATUS <<\_ACEOF
19605 # Be Bourne compatible
19606 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
19607   emulate sh
19608   NULLCMD=:
19609 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
19610   set -o posix
19611 fi
19612
19613 # Name of the executable.
19614 as_me=`echo "$0" |sed 's,.*[\\/],,'`
19615
19616 if expr a : '\(a\)' >/dev/null 2>&1; then
19617   as_expr=expr
19618 else
19619   as_expr=false
19620 fi
19621
19622 rm -f conf$$ conf$$.exe conf$$.file
19623 echo >conf$$.file
19624 if ln -s conf$$.file conf$$ 2>/dev/null; then
19625   # We could just check for DJGPP; but this test a) works b) is more generic
19626   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
19627   if test -f conf$$.exe; then
19628     # Don't use ln at all; we don't have any links
19629     as_ln_s='cp -p'
19630   else
19631     as_ln_s='ln -s'
19632   fi
19633 elif ln conf$$.file conf$$ 2>/dev/null; then
19634   as_ln_s=ln
19635 else
19636   as_ln_s='cp -p'
19637 fi
19638 rm -f conf$$ conf$$.exe conf$$.file
19639
19640 as_executable_p="test -f"
19641
19642 # Support unset when possible.
19643 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
19644   as_unset=unset
19645 else
19646   as_unset=false
19647 fi
19648
19649 # NLS nuisances.
19650 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
19651 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
19652 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
19653 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
19654 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
19655 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
19656 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
19657 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
19658
19659 # IFS
19660 # We need space, tab and new line, in precisely that order.
19661 as_nl='
19662 '
19663 IFS="   $as_nl"
19664
19665 # CDPATH.
19666 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
19667
19668 exec 6>&1
19669
19670 _ACEOF
19671
19672 # Files that config.status was made for.
19673 if test -n "$ac_config_files"; then
19674   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
19675 fi
19676
19677 if test -n "$ac_config_headers"; then
19678   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
19679 fi
19680
19681 if test -n "$ac_config_links"; then
19682   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
19683 fi
19684
19685 if test -n "$ac_config_commands"; then
19686   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
19687 fi
19688
19689 cat >>$CONFIG_STATUS <<\EOF
19690
19691 ac_cs_usage="\
19692 \`$as_me' instantiates files from templates according to the
19693 current configuration.
19694
19695 Usage: $0 [OPTIONS] [FILE]...
19696
19697   -h, --help       print this help, then exit
19698   -V, --version    print version number, then exit
19699   -d, --debug      don't remove temporary files
19700       --recheck    update $as_me by reconfiguring in the same conditions
19701   --file=FILE[:TEMPLATE]
19702                    instantiate the configuration file FILE
19703   --header=FILE[:TEMPLATE]
19704                    instantiate the configuration header FILE
19705
19706 Configuration files:
19707 $config_files
19708
19709 Configuration headers:
19710 $config_headers
19711
19712 Configuration commands:
19713 $config_commands
19714
19715 Report bugs to <dickey@invisible-island.net>."
19716 EOF
19717
19718 cat >>$CONFIG_STATUS <<EOF
19719 ac_cs_version="\\
19720 config.status
19721 configured by $0, generated by GNU Autoconf 2.52.20170501,
19722   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
19723
19724 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
19725 Free Software Foundation, Inc.
19726 This config.status script is free software; the Free Software Foundation
19727 gives unlimited permission to copy, distribute and modify it."
19728 srcdir=$srcdir
19729 INSTALL="$INSTALL"
19730 EOF
19731
19732 cat >>$CONFIG_STATUS <<\EOF
19733 # If no file are specified by the user, then we need to provide default
19734 # value.  By we need to know if files were specified by the user.
19735 ac_need_defaults=:
19736 while test $# != 0
19737 do
19738   case $1 in
19739   --*=*)
19740     ac_option=`expr "x$1" : 'x\([^=]*\)='`
19741     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
19742     shift
19743     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
19744     shift
19745     ;;
19746   -*);;
19747   *) # This is not an option, so the user has probably given explicit
19748      # arguments.
19749      ac_need_defaults=false;;
19750   esac
19751
19752   case $1 in
19753   # Handling of the options.
19754 EOF
19755 cat >>$CONFIG_STATUS <<EOF
19756   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
19757     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
19758     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
19759 EOF
19760 cat >>$CONFIG_STATUS <<\EOF
19761   --version | --vers* | -V )
19762     echo "$ac_cs_version"; exit 0 ;;
19763   --he | --h)
19764     # Conflict between --help and --header
19765     { { echo "$as_me:19765: error: ambiguous option: $1
19766 Try \`$0 --help' for more information." >&5
19767 echo "$as_me: error: ambiguous option: $1
19768 Try \`$0 --help' for more information." >&2;}
19769    { (exit 1); exit 1; }; };;
19770   --help | --hel | -h )
19771     echo "$ac_cs_usage"; exit 0 ;;
19772   --debug | --d* | -d )
19773     debug=: ;;
19774   --file | --fil | --fi | --f )
19775     shift
19776     CONFIG_FILES="$CONFIG_FILES $1"
19777     ac_need_defaults=false;;
19778   --header | --heade | --head | --hea )
19779     shift
19780     CONFIG_HEADERS="$CONFIG_HEADERS $1"
19781     ac_need_defaults=false;;
19782
19783   # This is an error.
19784   -*) { { echo "$as_me:19784: error: unrecognized option: $1
19785 Try \`$0 --help' for more information." >&5
19786 echo "$as_me: error: unrecognized option: $1
19787 Try \`$0 --help' for more information." >&2;}
19788    { (exit 1); exit 1; }; } ;;
19789
19790   *) ac_config_targets="$ac_config_targets $1" ;;
19791
19792   esac
19793   shift
19794 done
19795
19796 exec 5>>config.log
19797 cat >&5 << _ACEOF
19798
19799 ## ----------------------- ##
19800 ## Running config.status.  ##
19801 ## ----------------------- ##
19802
19803 This file was extended by $as_me 2.52.20170501, executed with
19804   CONFIG_FILES    = $CONFIG_FILES
19805   CONFIG_HEADERS  = $CONFIG_HEADERS
19806   CONFIG_LINKS    = $CONFIG_LINKS
19807   CONFIG_COMMANDS = $CONFIG_COMMANDS
19808   > $ac_cs_invocation
19809 on `(hostname || uname -n) 2>/dev/null | sed 1q`
19810
19811 _ACEOF
19812 EOF
19813
19814 cat >>$CONFIG_STATUS <<EOF
19815 #
19816 # INIT-COMMANDS section.
19817 #
19818
19819 AWK="$AWK"
19820 ECHO_CC="$ECHO_CC"
19821 ECHO_LD="$ECHO_LD"
19822 SHOW_CC="$SHOW_LD"
19823
19824 EOF
19825
19826 cat >>$CONFIG_STATUS <<\EOF
19827 for ac_config_target in $ac_config_targets
19828 do
19829   case "$ac_config_target" in
19830   # Handling of arguments.
19831   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
19832   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
19833   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
19834   *) { { echo "$as_me:19834: error: invalid argument: $ac_config_target" >&5
19835 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
19836    { (exit 1); exit 1; }; };;
19837   esac
19838 done
19839
19840 # If the user did not use the arguments to specify the items to instantiate,
19841 # then the envvar interface is used.  Set only those that are not.
19842 # We use the long form for the default assignment because of an extremely
19843 # bizarre bug on SunOS 4.1.3.
19844 if $ac_need_defaults; then
19845   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
19846   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
19847   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
19848 fi
19849
19850 # Create a temporary directory, and hook for its removal unless debugging.
19851 $debug ||
19852 {
19853   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
19854   trap '{ (exit 1); exit 1; }' 1 2 13 15
19855 }
19856
19857 # Create a (secure) tmp directory for tmp files.
19858 : ${TMPDIR=/tmp}
19859 {
19860   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
19861   test -n "$tmp" && test -d "$tmp"
19862 }  ||
19863 {
19864   tmp=$TMPDIR/cs$$-$RANDOM
19865   (umask 077 && mkdir $tmp)
19866 } ||
19867 {
19868    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
19869    { (exit 1); exit 1; }
19870 }
19871
19872 EOF
19873
19874 cat >>$CONFIG_STATUS <<EOF
19875
19876 #
19877 # CONFIG_FILES section.
19878 #
19879
19880 # No need to generate the scripts if there are no CONFIG_FILES.
19881 # This happens for instance when ./config.status config.h
19882 if test -n "\$CONFIG_FILES"; then
19883   # Protect against being on the right side of a sed subst in config.status.
19884   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
19885    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
19886 s,@SHELL@,$SHELL,;t t
19887 s,@exec_prefix@,$exec_prefix,;t t
19888 s,@prefix@,$prefix,;t t
19889 s,@program_transform_name@,$program_transform_name,;t t
19890 s,@bindir@,$bindir,;t t
19891 s,@sbindir@,$sbindir,;t t
19892 s,@libexecdir@,$libexecdir,;t t
19893 s,@datarootdir@,$datarootdir,;t t
19894 s,@datadir@,$datadir,;t t
19895 s,@sysconfdir@,$sysconfdir,;t t
19896 s,@sharedstatedir@,$sharedstatedir,;t t
19897 s,@localstatedir@,$localstatedir,;t t
19898 s,@libdir@,$libdir,;t t
19899 s,@includedir@,$includedir,;t t
19900 s,@oldincludedir@,$oldincludedir,;t t
19901 s,@infodir@,$infodir,;t t
19902 s,@mandir@,$mandir,;t t
19903 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
19904 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
19905 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
19906 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
19907 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
19908 s,@build_alias@,$build_alias,;t t
19909 s,@host_alias@,$host_alias,;t t
19910 s,@target_alias@,$target_alias,;t t
19911 s,@ECHO_C@,$ECHO_C,;t t
19912 s,@ECHO_N@,$ECHO_N,;t t
19913 s,@ECHO_T@,$ECHO_T,;t t
19914 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
19915 s,@DEFS@,$DEFS,;t t
19916 s,@LIBS@,$LIBS,;t t
19917 s,@build@,$build,;t t
19918 s,@build_cpu@,$build_cpu,;t t
19919 s,@build_vendor@,$build_vendor,;t t
19920 s,@build_os@,$build_os,;t t
19921 s,@host@,$host,;t t
19922 s,@host_cpu@,$host_cpu,;t t
19923 s,@host_vendor@,$host_vendor,;t t
19924 s,@host_os@,$host_os,;t t
19925 s,@SET_MAKE@,$SET_MAKE,;t t
19926 s,@CC@,$CC,;t t
19927 s,@CFLAGS@,$CFLAGS,;t t
19928 s,@LDFLAGS@,$LDFLAGS,;t t
19929 s,@CPPFLAGS@,$CPPFLAGS,;t t
19930 s,@ac_ct_CC@,$ac_ct_CC,;t t
19931 s,@EXEEXT@,$EXEEXT,;t t
19932 s,@OBJEXT@,$OBJEXT,;t t
19933 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
19934 s,@CPP@,$CPP,;t t
19935 s,@AWK@,$AWK,;t t
19936 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
19937 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
19938 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
19939 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
19940 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
19941 s,@LINT@,$LINT,;t t
19942 s,@LINT_OPTS@,$LINT_OPTS,;t t
19943 s,@CTAGS@,$CTAGS,;t t
19944 s,@ETAGS@,$ETAGS,;t t
19945 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
19946 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
19947 s,@MATH_LIB@,$MATH_LIB,;t t
19948 s,@top_builddir@,$top_builddir,;t t
19949 s,@CC_G_OPT@,$CC_G_OPT,;t t
19950 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
19951 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
19952 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
19953 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
19954 s,@LD@,$LD,;t t
19955 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
19956 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
19957 s,@LD_MODEL@,$LD_MODEL,;t t
19958 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
19959 s,@LIBTOOL@,$LIBTOOL,;t t
19960 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
19961 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
19962 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
19963 s,@LIB_LINK@,$LIB_LINK,;t t
19964 s,@LINK_TESTS@,$LINK_TESTS,;t t
19965 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
19966 s,@PACKAGE@,$PACKAGE,;t t
19967 s,@PTHREAD@,$PTHREAD,;t t
19968 s,@TEST_ARGS@,$TEST_ARGS,;t t
19969 s,@TEST_DEPS@,$TEST_DEPS,;t t
19970 s,@TEST_LIBS@,$TEST_LIBS,;t t
19971 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
19972 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
19973 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
19974 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
19975 s,@includesubdir@,$includesubdir,;t t
19976 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
19977 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
19978 s,@ECHO_LT@,$ECHO_LT,;t t
19979 s,@ECHO_LD@,$ECHO_LD,;t t
19980 s,@RULE_CC@,$RULE_CC,;t t
19981 s,@SHOW_CC@,$SHOW_CC,;t t
19982 s,@ECHO_CC@,$ECHO_CC,;t t
19983 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
19984 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
19985 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
19986 s,@X_CFLAGS@,$X_CFLAGS,;t t
19987 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
19988 s,@X_LIBS@,$X_LIBS,;t t
19989 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
19990 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
19991 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
19992 s,@RGB_PATH@,$RGB_PATH,;t t
19993 s,@no_x11_rgb@,$no_x11_rgb,;t t
19994 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
19995 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
19996 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
19997 CEOF
19998
19999 EOF
20000
20001   cat >>$CONFIG_STATUS <<\EOF
20002   # Split the substitutions into bite-sized pieces for seds with
20003   # small command number limits, like on Digital OSF/1 and HP-UX.
20004   ac_max_sed_lines=48
20005   ac_sed_frag=1 # Number of current file.
20006   ac_beg=1 # First line for current file.
20007   ac_end=$ac_max_sed_lines # Line after last line for current file.
20008   ac_more_lines=:
20009   ac_sed_cmds=
20010   while $ac_more_lines; do
20011     if test $ac_beg -gt 1; then
20012       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
20013     else
20014       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
20015     fi
20016     if test ! -s $tmp/subs.frag; then
20017       ac_more_lines=false
20018     else
20019       # The purpose of the label and of the branching condition is to
20020       # speed up the sed processing (if there are no `@' at all, there
20021       # is no need to browse any of the substitutions).
20022       # These are the two extra sed commands mentioned above.
20023       (echo ':t
20024   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
20025       # It is possible to make a multiline substitution using escaped newlines.
20026       # Ensure that we do not split the substitution between script fragments.
20027       ac_BEG=$ac_end
20028       ac_END=`expr $ac_end + $ac_max_sed_lines`
20029       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
20030       if test -s $tmp/subs.next; then
20031         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
20032         if test ! -s $tmp/subs.edit; then
20033           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
20034           if test ! -s $tmp/subs.edit; then
20035             if test $ac_beg -gt 1; then
20036               ac_end=`expr $ac_end - 1`
20037               continue
20038             fi
20039           fi
20040         fi
20041       fi
20042
20043       if test -z "$ac_sed_cmds"; then
20044         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
20045       else
20046         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
20047       fi
20048       ac_sed_frag=`expr $ac_sed_frag + 1`
20049       ac_beg=$ac_end
20050       ac_end=`expr $ac_end + $ac_max_sed_lines`
20051     fi
20052   done
20053   if test -z "$ac_sed_cmds"; then
20054     ac_sed_cmds=cat
20055   fi
20056 fi # test -n "$CONFIG_FILES"
20057
20058 EOF
20059 cat >>$CONFIG_STATUS <<\EOF
20060 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
20061   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
20062   case $ac_file in
20063   - | *:- | *:-:* ) # input from stdin
20064         cat >$tmp/stdin
20065         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20066         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20067   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20068         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20069   * )   ac_file_in=$ac_file.in ;;
20070   esac
20071
20072   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
20073   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20074          X"$ac_file" : 'X\(//\)[^/]' \| \
20075          X"$ac_file" : 'X\(//\)$' \| \
20076          X"$ac_file" : 'X\(/\)' \| \
20077          .     : '\(.\)' 2>/dev/null ||
20078 echo X"$ac_file" |
20079     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20080           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20081           /^X\(\/\/\)$/{ s//\1/; q; }
20082           /^X\(\/\).*/{ s//\1/; q; }
20083           s/.*/./; q'`
20084   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
20085     { case "$ac_dir" in
20086   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
20087   *)                      as_incr_dir=.;;
20088 esac
20089 as_dummy="$ac_dir"
20090 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
20091   case $as_mkdir_dir in
20092     # Skip DOS drivespec
20093     ?:) as_incr_dir=$as_mkdir_dir ;;
20094     *)
20095       as_incr_dir=$as_incr_dir/$as_mkdir_dir
20096       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
20097     ;;
20098   esac
20099 done; }
20100
20101     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
20102     # A "../" for each directory in $ac_dir_suffix.
20103     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
20104   else
20105     ac_dir_suffix= ac_dots=
20106   fi
20107
20108   case $srcdir in
20109   .)  ac_srcdir=.
20110       if test -z "$ac_dots"; then
20111          ac_top_srcdir=.
20112       else
20113          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
20114       fi ;;
20115   [\\/]* | ?:[\\/]* )
20116       ac_srcdir=$srcdir$ac_dir_suffix;
20117       ac_top_srcdir=$srcdir ;;
20118   *) # Relative path.
20119     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
20120     ac_top_srcdir=$ac_dots$srcdir ;;
20121   esac
20122
20123   case $INSTALL in
20124   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
20125   *) ac_INSTALL=$ac_dots$INSTALL ;;
20126   esac
20127
20128   if test x"$ac_file" != x-; then
20129     { echo "$as_me:20129: creating $ac_file" >&5
20130 echo "$as_me: creating $ac_file" >&6;}
20131     rm -f "$ac_file"
20132   fi
20133   # Let's still pretend it is `configure' which instantiates (i.e., don't
20134   # use $as_me), people would be surprised to read:
20135   #    /* config.h.  Generated automatically by config.status.  */
20136   configure_input="Generated automatically from `echo $ac_file_in |
20137                                                  sed 's,.*/,,'` by configure."
20138
20139   # First look for the input files in the build tree, otherwise in the
20140   # src tree.
20141   ac_file_inputs=`IFS=:
20142     for f in $ac_file_in; do
20143       case $f in
20144       -) echo $tmp/stdin ;;
20145       [\\/$]*)
20146          # Absolute (can't be DOS-style, as IFS=:)
20147          test -f "$f" || { { echo "$as_me:20147: error: cannot find input file: $f" >&5
20148 echo "$as_me: error: cannot find input file: $f" >&2;}
20149    { (exit 1); exit 1; }; }
20150          echo $f;;
20151       *) # Relative
20152          if test -f "$f"; then
20153            # Build tree
20154            echo $f
20155          elif test -f "$srcdir/$f"; then
20156            # Source tree
20157            echo $srcdir/$f
20158          else
20159            # /dev/null tree
20160            { { echo "$as_me:20160: error: cannot find input file: $f" >&5
20161 echo "$as_me: error: cannot find input file: $f" >&2;}
20162    { (exit 1); exit 1; }; }
20163          fi;;
20164       esac
20165     done` || { (exit 1); exit 1; }
20166 EOF
20167 cat >>$CONFIG_STATUS <<\EOF
20168   ac_warn_datarootdir=no
20169   if test x"$ac_file" != x-; then
20170     for ac_item in $ac_file_inputs
20171     do
20172       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
20173       if test -n "$ac_seen"; then
20174         ac_used=`grep '@datarootdir@' $ac_item`
20175         if test -z "$ac_used"; then
20176           { echo "$as_me:20176: WARNING: datarootdir was used implicitly but not set:
20177 $ac_seen" >&5
20178 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
20179 $ac_seen" >&2;}
20180           ac_warn_datarootdir=yes
20181         fi
20182       fi
20183       ac_seen=`grep '${datarootdir}' $ac_item`
20184       if test -n "$ac_seen"; then
20185         { echo "$as_me:20185: WARNING: datarootdir was used explicitly but not set:
20186 $ac_seen" >&5
20187 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
20188 $ac_seen" >&2;}
20189         ac_warn_datarootdir=yes
20190       fi
20191     done
20192   fi
20193
20194 if test "x$ac_warn_datarootdir" = xyes; then
20195   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
20196 fi
20197
20198 EOF
20199 cat >>$CONFIG_STATUS <<EOF
20200   sed "$ac_vpsub
20201 $extrasub
20202 EOF
20203 cat >>$CONFIG_STATUS <<\EOF
20204 :t
20205 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
20206 s,@configure_input@,$configure_input,;t t
20207 s,@srcdir@,$ac_srcdir,;t t
20208 s,@top_srcdir@,$ac_top_srcdir,;t t
20209 s,@INSTALL@,$ac_INSTALL,;t t
20210 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
20211   rm -f $tmp/stdin
20212   if test x"$ac_file" != x-; then
20213     cp $tmp/out $ac_file
20214
20215     for ac_name in prefix exec_prefix datarootdir
20216     do
20217         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
20218         if test -n "$ac_seen"; then
20219             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
20220             if test -z "$ac_init"; then
20221               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
20222               { echo "$as_me:20222: WARNING: Variable $ac_name is used but was not set:
20223 $ac_seen" >&5
20224 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
20225 $ac_seen" >&2;}
20226             fi
20227         fi
20228     done
20229     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
20230     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
20231     if test -s $tmp/out; then
20232       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
20233       { echo "$as_me:20233: WARNING: Some variables may not be substituted:
20234 $ac_seen" >&5
20235 echo "$as_me: WARNING: Some variables may not be substituted:
20236 $ac_seen" >&2;}
20237     fi
20238   else
20239     cat $tmp/out
20240   fi
20241   rm -f $tmp/out
20242
20243 done
20244 EOF
20245 cat >>$CONFIG_STATUS <<\EOF
20246
20247 #
20248 # CONFIG_HEADER section.
20249 #
20250
20251 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
20252 # NAME is the cpp macro being defined and VALUE is the value it is being given.
20253 #
20254 # ac_d sets the value in "#define NAME VALUE" lines.
20255 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
20256 ac_dB='[        ].*$,\1#\2'
20257 ac_dC=' '
20258 ac_dD=',;t'
20259 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
20260 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
20261 ac_iB='\([      ]\),\1#\2define\3'
20262 ac_iC=' '
20263 ac_iD='\4,;t'
20264 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
20265 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
20266 ac_uB='$,\1#\2define\3'
20267 ac_uC=' '
20268 ac_uD=',;t'
20269
20270 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
20271   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
20272   case $ac_file in
20273   - | *:- | *:-:* ) # input from stdin
20274         cat >$tmp/stdin
20275         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20276         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20277   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20278         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20279   * )   ac_file_in=$ac_file.in ;;
20280   esac
20281
20282   test x"$ac_file" != x- && { echo "$as_me:20282: creating $ac_file" >&5
20283 echo "$as_me: creating $ac_file" >&6;}
20284
20285   # First look for the input files in the build tree, otherwise in the
20286   # src tree.
20287   ac_file_inputs=`IFS=:
20288     for f in $ac_file_in; do
20289       case $f in
20290       -) echo $tmp/stdin ;;
20291       [\\/$]*)
20292          # Absolute (can't be DOS-style, as IFS=:)
20293          test -f "$f" || { { echo "$as_me:20293: error: cannot find input file: $f" >&5
20294 echo "$as_me: error: cannot find input file: $f" >&2;}
20295    { (exit 1); exit 1; }; }
20296          echo $f;;
20297       *) # Relative
20298          if test -f "$f"; then
20299            # Build tree
20300            echo $f
20301          elif test -f "$srcdir/$f"; then
20302            # Source tree
20303            echo $srcdir/$f
20304          else
20305            # /dev/null tree
20306            { { echo "$as_me:20306: error: cannot find input file: $f" >&5
20307 echo "$as_me: error: cannot find input file: $f" >&2;}
20308    { (exit 1); exit 1; }; }
20309          fi;;
20310       esac
20311     done` || { (exit 1); exit 1; }
20312   # Remove the trailing spaces.
20313   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
20314
20315 EOF
20316
20317 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
20318 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
20319 # be either 'cat' or 'sort'.
20320 cat confdefs.h | uniq >conftest.vals
20321
20322 # Break up conftest.vals because some shells have a limit on
20323 # the size of here documents, and old seds have small limits too.
20324
20325 rm -f conftest.tail
20326 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
20327 while grep . conftest.vals >/dev/null
20328 do
20329   # Write chunks of a limited-size here document to conftest.frag.
20330   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
20331   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
20332   echo 'CEOF' >> $CONFIG_STATUS
20333   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
20334   rm -f conftest.vals
20335   mv conftest.tail conftest.vals
20336 done
20337 rm -f conftest.vals
20338
20339 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
20340 # marker @DEFS@.
20341 echo '  cat >> conftest.edit <<CEOF
20342 /@DEFS@/r conftest.frag
20343 /@DEFS@/d
20344 CEOF
20345 sed -f conftest.edit $tmp/in > $tmp/out
20346 rm -f $tmp/in
20347 mv $tmp/out $tmp/in
20348 rm -f conftest.edit conftest.frag
20349 ' >> $CONFIG_STATUS
20350
20351 cat >>$CONFIG_STATUS <<\EOF
20352   # Let's still pretend it is `configure' which instantiates (i.e., don't
20353   # use $as_me), people would be surprised to read:
20354   #    /* config.h.  Generated automatically by config.status.  */
20355   if test x"$ac_file" = x-; then
20356     echo "/* Generated automatically by configure.  */" >$tmp/config.h
20357   else
20358     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
20359   fi
20360   cat $tmp/in >>$tmp/config.h
20361   rm -f $tmp/in
20362   if test x"$ac_file" != x-; then
20363     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
20364       { echo "$as_me:20364: $ac_file is unchanged" >&5
20365 echo "$as_me: $ac_file is unchanged" >&6;}
20366     else
20367       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20368          X"$ac_file" : 'X\(//\)[^/]' \| \
20369          X"$ac_file" : 'X\(//\)$' \| \
20370          X"$ac_file" : 'X\(/\)' \| \
20371          .     : '\(.\)' 2>/dev/null ||
20372 echo X"$ac_file" |
20373     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20374           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20375           /^X\(\/\/\)$/{ s//\1/; q; }
20376           /^X\(\/\).*/{ s//\1/; q; }
20377           s/.*/./; q'`
20378       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
20379         { case "$ac_dir" in
20380   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
20381   *)                      as_incr_dir=.;;
20382 esac
20383 as_dummy="$ac_dir"
20384 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
20385   case $as_mkdir_dir in
20386     # Skip DOS drivespec
20387     ?:) as_incr_dir=$as_mkdir_dir ;;
20388     *)
20389       as_incr_dir=$as_incr_dir/$as_mkdir_dir
20390       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
20391     ;;
20392   esac
20393 done; }
20394
20395       fi
20396       rm -f $ac_file
20397       mv $tmp/config.h $ac_file
20398     fi
20399   else
20400     cat $tmp/config.h
20401     rm -f $tmp/config.h
20402   fi
20403 done
20404 EOF
20405 cat >>$CONFIG_STATUS <<\EOF
20406 #
20407 # CONFIG_COMMANDS section.
20408 #
20409 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
20410   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
20411   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
20412
20413   case $ac_dest in
20414     default )
20415
20416 for cf_dir in .
20417 do
20418         if test ! -d $srcdir/$cf_dir; then
20419                 continue
20420         elif test -f $srcdir/$cf_dir/programs; then
20421                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
20422         fi
20423 done
20424
20425         cat >>Makefile <<TEST_EOF
20426
20427 # These rules are generated so we do not rely on suffix rules, which do not
20428 # work consistently for different make-programs (the '\$(MODEL)/' confuses
20429 # some, and the '\$x' confuses others).
20430 TEST_EOF
20431
20432 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
20433 for N in $LIST
20434 do
20435         cat >>Makefile <<TEST_EOF
20436
20437 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
20438         \$(srcdir)/test.priv.h \\
20439         ncurses_cfg.h
20440         $SHOW_CC
20441         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
20442 TEST_EOF
20443 done
20444
20445 if test -f ../config.guess && test -f ../config.sub
20446 then
20447         cat >>Makefile <<TEST_EOF
20448
20449 # if we used CF_INHERIT for getting these files, we can remove them
20450 distclean::
20451         rm -f config.guess config.sub
20452 TEST_EOF
20453 fi
20454  ;;
20455   esac
20456 done
20457 EOF
20458
20459 cat >>$CONFIG_STATUS <<\EOF
20460
20461 { (exit 0); exit 0; }
20462 EOF
20463 chmod +x $CONFIG_STATUS
20464 ac_clean_files=$ac_clean_files_save
20465
20466 # configure is writing to config.log, and then calls config.status.
20467 # config.status does its own redirection, appending to config.log.
20468 # Unfortunately, on DOS this fails, as config.log is still kept open
20469 # by configure, so config.status won't be able to write to it; its
20470 # output is simply discarded.  So we exec the FD to /dev/null,
20471 # effectively closing config.log, so it can be properly (re)opened and
20472 # appended to by config.status.  When coming back to configure, we
20473 # need to make the FD available again.
20474 if test "$no_create" != yes; then
20475   ac_cs_success=:
20476   exec 5>/dev/null
20477   $SHELL $CONFIG_STATUS || ac_cs_success=false
20478   exec 5>>config.log
20479   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
20480   # would make configure fail if this is the last instruction.
20481   $ac_cs_success || { (exit 1); exit 1; }
20482 fi
20483