3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13.20030927
5 # Copyright (C) 1992, 93, 94, 95, 96 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.
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
15 # Initialize some variables set by options.
16 # The variables have the same names as the options, with
17 # dashes changed to underlines.
19 cache_file=./config.cache
28 program_transform_name=s,x,x,
36 bindir='${exec_prefix}/bin'
37 sbindir='${exec_prefix}/sbin'
38 libexecdir='${exec_prefix}/libexec'
39 datadir='${prefix}/share'
40 sysconfdir='${prefix}/etc'
41 sharedstatedir='${prefix}/com'
42 localstatedir='${prefix}/var'
43 libdir='${exec_prefix}/lib'
44 includedir='${prefix}/include'
45 oldincludedir='/usr/include'
46 infodir='${prefix}/info'
47 mandir='${prefix}/man'
49 # Initialize some other variables.
52 SHELL=${CONFIG_SHELL-/bin/sh}
53 # Maximum number of lines to put in a shell here document.
60 # If the previous option needs an argument, assign it.
61 if test -n "$ac_prev"; then
62 eval "$ac_prev=\$ac_option"
68 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
72 # Accept the important Cygnus configure options, so we can diagnose typos.
76 -bindir | --bindir | --bindi | --bind | --bin | --bi)
78 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
79 bindir="$ac_optarg" ;;
81 -build | --build | --buil | --bui | --bu)
83 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
86 -cache-file | --cache-file | --cache-fil | --cache-fi \
87 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
89 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
90 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
91 cache_file="$ac_optarg" ;;
93 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
95 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
97 datadir="$ac_optarg" ;;
99 -disable-* | --disable-*)
100 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
101 # Reject names that are not valid shell variable names.
102 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
103 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
105 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
106 eval "enable_${ac_feature}=no" ;;
108 -enable-* | --enable-*)
109 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
110 # Reject names that are not valid shell variable names.
111 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
112 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
114 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
119 eval "enable_${ac_feature}='$ac_optarg'" ;;
121 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
122 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
123 | --exec | --exe | --ex)
124 ac_prev=exec_prefix ;;
125 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
126 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
127 | --exec=* | --exe=* | --ex=*)
128 exec_prefix="$ac_optarg" ;;
130 -gas | --gas | --ga | --g)
131 # Obsolete; use --with-gas.
134 -help | --help | --hel | --he)
135 # Omit some internal or obsolete options to make the list less imposing.
136 # This message is too long to be a string in the A/UX 3.1 sh.
138 Usage: configure [options] [host]
139 Options: [defaults in brackets after descriptions]
141 --cache-file=FILE cache test results in FILE
142 --help print this message
143 --no-create do not create output files
144 --quiet, --silent do not print \`checking...' messages
145 --version print the version of autoconf that created configure
146 Directory and file names:
147 --prefix=PREFIX install architecture-independent files in PREFIX
149 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
151 --bindir=DIR user executables in DIR [EPREFIX/bin]
152 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
153 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
154 --datadir=DIR read-only architecture-independent data in DIR
156 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
157 --sharedstatedir=DIR modifiable architecture-independent data in DIR
159 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
160 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
161 --includedir=DIR C header files in DIR [PREFIX/include]
162 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
163 --infodir=DIR info documentation in DIR [PREFIX/info]
164 --mandir=DIR man documentation in DIR [PREFIX/man]
165 --srcdir=DIR find the sources in DIR [configure dir or ..]
166 --program-prefix=PREFIX prepend PREFIX to installed program names
167 --program-suffix=SUFFIX append SUFFIX to installed program names
168 --program-transform-name=PROGRAM
169 run sed PROGRAM on installed program names
173 --build=BUILD configure for building on BUILD [BUILD=HOST]
174 --host=HOST configure for HOST [guessed]
175 --target=TARGET configure for TARGET [TARGET=HOST]
176 Features and packages:
177 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
178 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
179 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
180 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
181 --x-includes=DIR X include files are in DIR
182 --x-libraries=DIR X library files are in DIR
185 --enable and --with options recognized:
186 --disable-echo display "compiling" commands
187 --enable-warnings test: turn on gcc compiler warnings
188 --with-curses-dir=DIR directory in which (n)curses is installed
189 --with-5lib use SunOS sysv-libraries
190 --with-ncursesw use wide ncurses-libraries (installed)
191 --with-ncurses use ncurses-libraries (installed)
192 --with-pdcurses compile/link with pdcurses X11 library
193 --with-x use the X Window System
194 --with-Xaw3d link with Xaw 3d library
195 --with-neXtaw link with neXT Athena library
196 --with-XawPlus link with Athena-Plus library
200 -host | --host | --hos | --ho)
202 -host=* | --host=* | --hos=* | --ho=*)
205 -includedir | --includedir | --includedi | --included | --include \
206 | --includ | --inclu | --incl | --inc)
207 ac_prev=includedir ;;
208 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
209 | --includ=* | --inclu=* | --incl=* | --inc=*)
210 includedir="$ac_optarg" ;;
212 -infodir | --infodir | --infodi | --infod | --info | --inf)
214 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
215 infodir="$ac_optarg" ;;
217 -libdir | --libdir | --libdi | --libd)
219 -libdir=* | --libdir=* | --libdi=* | --libd=*)
220 libdir="$ac_optarg" ;;
222 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
223 | --libexe | --libex | --libe)
224 ac_prev=libexecdir ;;
225 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
226 | --libexe=* | --libex=* | --libe=*)
227 libexecdir="$ac_optarg" ;;
229 -localstatedir | --localstatedir | --localstatedi | --localstated \
230 | --localstate | --localstat | --localsta | --localst \
231 | --locals | --local | --loca | --loc | --lo)
232 ac_prev=localstatedir ;;
233 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
234 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
235 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
236 localstatedir="$ac_optarg" ;;
238 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
240 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
241 mandir="$ac_optarg" ;;
244 # Obsolete; use --without-fp.
247 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
251 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
252 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
255 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
256 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
257 | --oldin | --oldi | --old | --ol | --o)
258 ac_prev=oldincludedir ;;
259 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
260 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
261 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
262 oldincludedir="$ac_optarg" ;;
264 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
266 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
267 prefix="$ac_optarg" ;;
269 -program-prefix | --program-prefix | --program-prefi | --program-pref \
270 | --program-pre | --program-pr | --program-p)
271 ac_prev=program_prefix ;;
272 -program-prefix=* | --program-prefix=* | --program-prefi=* \
273 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
274 program_prefix="$ac_optarg" ;;
276 -program-suffix | --program-suffix | --program-suffi | --program-suff \
277 | --program-suf | --program-su | --program-s)
278 ac_prev=program_suffix ;;
279 -program-suffix=* | --program-suffix=* | --program-suffi=* \
280 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
281 program_suffix="$ac_optarg" ;;
283 -program-transform-name | --program-transform-name \
284 | --program-transform-nam | --program-transform-na \
285 | --program-transform-n | --program-transform- \
286 | --program-transform | --program-transfor \
287 | --program-transfo | --program-transf \
288 | --program-trans | --program-tran \
289 | --progr-tra | --program-tr | --program-t)
290 ac_prev=program_transform_name ;;
291 -program-transform-name=* | --program-transform-name=* \
292 | --program-transform-nam=* | --program-transform-na=* \
293 | --program-transform-n=* | --program-transform-=* \
294 | --program-transform=* | --program-transfor=* \
295 | --program-transfo=* | --program-transf=* \
296 | --program-trans=* | --program-tran=* \
297 | --progr-tra=* | --program-tr=* | --program-t=*)
298 program_transform_name="$ac_optarg" ;;
300 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
301 | -silent | --silent | --silen | --sile | --sil)
304 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
306 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
308 sbindir="$ac_optarg" ;;
310 -sharedstatedir | --sharedstatedir | --sharedstatedi \
311 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
312 | --sharedst | --shareds | --shared | --share | --shar \
314 ac_prev=sharedstatedir ;;
315 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
316 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
317 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
319 sharedstatedir="$ac_optarg" ;;
321 -site | --site | --sit)
323 -site=* | --site=* | --sit=*)
326 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
328 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
329 srcdir="$ac_optarg" ;;
331 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
332 | --syscon | --sysco | --sysc | --sys | --sy)
333 ac_prev=sysconfdir ;;
334 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
335 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
336 sysconfdir="$ac_optarg" ;;
338 -target | --target | --targe | --targ | --tar | --ta | --t)
340 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
341 target="$ac_optarg" ;;
343 -v | -verbose | --verbose | --verbos | --verbo | --verb)
346 -version | --version | --versio | --versi | --vers)
347 echo "configure generated by autoconf version 2.13.20030927"
351 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
352 # Reject names that are not valid shell variable names.
353 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
354 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
356 ac_package=`echo $ac_package| sed 's/-/_/g'`
361 eval "with_${ac_package}='$ac_optarg'" ;;
363 -without-* | --without-*)
364 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
365 # Reject names that are not valid shell variable names.
366 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
367 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
369 ac_package=`echo $ac_package| sed 's/-/_/g'`
370 eval "with_${ac_package}=no" ;;
373 # Obsolete; use --with-x.
376 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
377 | --x-incl | --x-inc | --x-in | --x-i)
378 ac_prev=x_includes ;;
379 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
380 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
381 x_includes="$ac_optarg" ;;
383 -x-libraries | --x-libraries | --x-librarie | --x-librari \
384 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
385 ac_prev=x_libraries ;;
386 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
387 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
388 x_libraries="$ac_optarg" ;;
390 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
394 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
395 echo "configure: warning: $ac_option: invalid host type" 1>&2
397 if test "x$nonopt" != xNONE; then
398 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
406 if test -n "$ac_prev"; then
407 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
410 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
412 # File descriptor usage:
415 # 2 errors and warnings
416 # 3 some systems may open it to /dev/tty
417 # 4 used on the Kubota Titan
418 # 6 checking for... messages and results
419 # 5 compiler messages saved in config.log
420 if test "$silent" = yes; then
428 This file contains any messages produced by compilers while
429 running configure, to aid debugging if configure makes a mistake.
432 # Strip out --no-create and --no-recursion so they do not pile up.
433 # Also quote any args containing shell metacharacters.
438 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
439 | --no-cr | --no-c) ;;
440 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
441 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
442 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
443 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
444 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
449 # Only set these to C if already set. These must not be set unconditionally
450 # because not all systems understand e.g. LANG=C (notably SCO).
451 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
452 # Non-C LC_CTYPE values break the ctype check.
453 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
454 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
455 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
456 if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
458 # confdefs.h avoids OS command line length limits that DEFS can exceed.
459 rm -rf conftest* confdefs.h
460 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
463 # A filename unique to this package, relative to the directory that
464 # configure is in, which we can look for to find out if srcdir is correct.
465 ac_unique_file=ncurses.c
467 # Find the source files, if location was not specified.
468 if test -z "$srcdir"; then
469 ac_srcdir_defaulted=yes
470 # Try the directory containing this script, then its parent.
472 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
473 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
475 if test ! -r $srcdir/$ac_unique_file; then
479 ac_srcdir_defaulted=no
481 if test ! -r $srcdir/$ac_unique_file; then
482 if test "$ac_srcdir_defaulted" = yes; then
483 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
485 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
488 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
490 # Prefer explicitly selected file to automatically selected ones.
491 if test -z "$CONFIG_SITE"; then
492 if test "x$prefix" != xNONE; then
493 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
495 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
498 for ac_site_file in $CONFIG_SITE; do
499 if test -r "$ac_site_file"; then
500 echo "loading site script $ac_site_file"
505 if test -r "$cache_file"; then
506 echo "loading cache $cache_file"
509 echo "creating cache $cache_file"
514 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
515 ac_cpp='$CPP $CPPFLAGS'
516 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
517 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
518 cross_compiling=$ac_cv_prog_cc_cross
522 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
523 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
524 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
531 ac_n= ac_c='\c' ac_t=
534 # If we find X, set shell vars x_includes and x_libraries to the
535 # paths, otherwise set no_x=yes.
536 # Uses ac_ vars as temps to allow command line to override cache and checks.
537 # --without-x overrides everything else, but does not touch the cache.
538 echo $ac_n "checking for X""... $ac_c" 1>&6
539 echo "configure:540: checking for X" >&5
542 # Check whether --with-x or --without-x was given.
543 if test "${with_x+set}" = set; then
548 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
549 if test "x$with_x" = xno; then
550 # The user explicitly disabled X.
553 if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
554 # Both variables are already set.
557 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
558 echo $ac_n "(cached) $ac_c" 1>&6
560 # One or both of the vars are not set, and there is no cached value.
561 ac_x_includes=NO ac_x_libraries=NO
563 if mkdir conftestdir; then
565 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
566 cat > Imakefile <<'EOF'
568 @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
570 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
571 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
572 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
573 # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
574 for ac_extension in a so sl; do
575 if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
576 test -f $ac_im_libdir/libX11.$ac_extension; then
577 ac_im_usrlibdir=$ac_im_libdir; break
580 # Screen out bogus values from the imake configuration. They are
581 # bogus both because they are the default anyway, and because
582 # using them would break gcc on systems where it needs fixed includes.
583 case "$ac_im_incroot" in
585 *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
587 case "$ac_im_usrlibdir" in
589 *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
596 if test "$ac_x_includes" = NO; then
597 # Guess where to find include files, by looking for this one X11 .h file.
598 test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
600 # First, try using that file with no special directory specified.
601 cat > conftest.$ac_ext <<EOF
602 #line 603 "configure"
603 #include "confdefs.h"
604 #include <$x_direct_test_include>
606 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
607 { (eval echo configure:608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
608 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
609 if test -z "$ac_err"; then
611 # We can compile using X headers with no special include directory.
615 echo "configure: failed program was:" >&5
616 cat conftest.$ac_ext >&5
618 # Look for the header file in a standard set of common directories.
619 # Check X11 before X11Rn because it is often a symlink to the current release.
631 /usr/local/X11/include \
632 /usr/local/X11R6/include \
633 /usr/local/X11R5/include \
634 /usr/local/X11R4/include \
636 /usr/local/include/X11 \
637 /usr/local/include/X11R6 \
638 /usr/local/include/X11R5 \
639 /usr/local/include/X11R4 \
643 /usr/XFree86/include/X11 \
647 /usr/unsupported/include \
648 /usr/athena/include \
649 /usr/local/x11r5/include \
650 /usr/lpp/Xamples/include \
652 /usr/openwin/include \
653 /usr/openwin/share/include \
656 if test -r "$ac_dir/$x_direct_test_include"; then
657 ac_x_includes=$ac_dir
663 fi # $ac_x_includes = NO
665 if test "$ac_x_libraries" = NO; then
666 # Check for the libraries.
668 test -z "$x_direct_test_library" && x_direct_test_library=Xt
669 test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
671 # See if we find them without any special options.
672 # Don't add to $LIBS permanently.
674 LIBS="-l$x_direct_test_library $LIBS"
675 cat > conftest.$ac_ext <<EOF
676 #line 677 "configure"
677 #include "confdefs.h"
680 ${x_direct_test_function}()
683 if { (eval echo configure:684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
686 # We can link X programs with no special library path.
689 echo "configure: failed program was:" >&5
690 cat conftest.$ac_ext >&5
693 # First see if replacing the include by lib works.
694 # Check X11 before X11Rn because it is often a symlink to the current release.
695 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
707 /usr/local/X11R6/lib \
708 /usr/local/X11R5/lib \
709 /usr/local/X11R4/lib \
712 /usr/local/lib/X11R6 \
713 /usr/local/lib/X11R5 \
714 /usr/local/lib/X11R4 \
718 /usr/XFree86/lib/X11 \
722 /usr/unsupported/lib \
724 /usr/local/x11r5/lib \
725 /usr/lpp/Xamples/lib \
729 /usr/openwin/share/lib \
732 for ac_extension in a so sl; do
733 if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
734 ac_x_libraries=$ac_dir
741 fi # $ac_x_libraries = NO
743 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
744 # Didn't find X anywhere. Cache the known absence of X.
745 ac_cv_have_x="have_x=no"
747 # Record where we found X for the cache.
748 ac_cv_have_x="have_x=yes \
749 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
756 if test "$have_x" != yes; then
757 echo "$ac_t""$have_x" 1>&6
760 # If each of the values was on the command line, it overrides each guess.
761 test "x$x_includes" = xNONE && x_includes=$ac_x_includes
762 test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
763 # Update the cache value to reflect the command line values.
764 ac_cv_have_x="have_x=yes \
765 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
766 echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
773 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
776 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
779 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
780 if test -f $ac_dir/install-sh; then
782 ac_install_sh="$ac_aux_dir/install-sh -c"
784 elif test -f $ac_dir/install.sh; then
786 ac_install_sh="$ac_aux_dir/install.sh -c"
790 if test -z "$ac_aux_dir"; then
791 { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
793 ac_config_guess=$ac_aux_dir/config.guess
794 ac_config_sub=$ac_aux_dir/config.sub
795 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
798 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
800 # Make sure we can run config.sub.
801 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
802 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
805 echo $ac_n "checking host system type""... $ac_c" 1>&6
806 echo "configure:807: checking host system type" >&5
809 case "$host_alias" in
813 if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
814 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
816 *) host_alias=$nonopt ;;
820 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
821 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
822 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
823 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
824 echo "$ac_t""$host" 1>&6
826 system_name="$host_os"
828 system_name="`(uname -s -r) 2>/dev/null`"
829 if test -z "$system_name" ; then
830 system_name="`(hostname) 2>/dev/null`"
833 test -n "$system_name" && cat >> confdefs.h <<EOF
834 #define SYSTEM_NAME "$system_name"
837 if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
838 echo $ac_n "(cached) $ac_c" 1>&6
840 cf_cv_system_name="$system_name"
844 test -z "$system_name" && system_name="$cf_cv_system_name"
845 test -n "$cf_cv_system_name" && echo "$ac_t""Configuring for $cf_cv_system_name" 1>&6
847 if test ".$system_name" != ".$cf_cv_system_name" ; then
848 echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
849 { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
853 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
854 echo "configure:855: checking whether ${MAKE-make} sets \${MAKE}" >&5
855 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
856 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
857 echo $ac_n "(cached) $ac_c" 1>&6
859 cat > conftestmake <<\EOF
861 @echo 'ac_maketemp="${MAKE}"'
863 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
864 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
865 if test -n "$ac_maketemp"; then
866 eval ac_cv_prog_make_${ac_make}_set=yes
868 eval ac_cv_prog_make_${ac_make}_set=no
872 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
873 echo "$ac_t""yes" 1>&6
876 echo "$ac_t""no" 1>&6
877 SET_MAKE="MAKE=${MAKE-make}"
880 # Extract the first word of "gcc", so it can be a program name with args.
881 set dummy gcc; ac_word=$2
882 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
883 echo "configure:884: checking for $ac_word" >&5
884 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
885 echo $ac_n "(cached) $ac_c" 1>&6
887 if test -n "$CC"; then
888 ac_cv_prog_CC="$CC" # Let the user override the test.
890 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
892 for ac_dir in $ac_dummy; do
893 test -z "$ac_dir" && ac_dir=.
894 if test -f $ac_dir/$ac_word; then
903 if test -n "$CC"; then
904 echo "$ac_t""$CC" 1>&6
906 echo "$ac_t""no" 1>&6
909 if test -z "$CC"; then
910 # Extract the first word of "cc", so it can be a program name with args.
911 set dummy cc; ac_word=$2
912 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
913 echo "configure:914: checking for $ac_word" >&5
914 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
915 echo $ac_n "(cached) $ac_c" 1>&6
917 if test -n "$CC"; then
918 ac_cv_prog_CC="$CC" # Let the user override the test.
920 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
923 for ac_dir in $ac_dummy; do
924 test -z "$ac_dir" && ac_dir=.
925 if test -f $ac_dir/$ac_word; then
926 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
935 if test $ac_prog_rejected = yes; then
936 # We found a bogon in the path, so make sure we never use it.
937 set dummy $ac_cv_prog_CC
939 if test $# -gt 0; then
940 # We chose a different compiler from the bogus one.
941 # However, it has the same basename, so the bogon will be chosen
942 # first if we set CC to just the basename; use the full file name.
944 set dummy "$ac_dir/$ac_word" "$@"
952 if test -n "$CC"; then
953 echo "$ac_t""$CC" 1>&6
955 echo "$ac_t""no" 1>&6
958 if test -z "$CC"; then
961 # Extract the first word of "cl", so it can be a program name with args.
962 set dummy cl; ac_word=$2
963 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
964 echo "configure:965: checking for $ac_word" >&5
965 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
966 echo $ac_n "(cached) $ac_c" 1>&6
968 if test -n "$CC"; then
969 ac_cv_prog_CC="$CC" # Let the user override the test.
971 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
973 for ac_dir in $ac_dummy; do
974 test -z "$ac_dir" && ac_dir=.
975 if test -f $ac_dir/$ac_word; then
984 if test -n "$CC"; then
985 echo "$ac_t""$CC" 1>&6
987 echo "$ac_t""no" 1>&6
992 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
995 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
996 echo "configure:997: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
999 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1000 ac_cpp='$CPP $CPPFLAGS'
1001 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1002 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1003 cross_compiling=$ac_cv_prog_cc_cross
1005 cat > conftest.$ac_ext << EOF
1007 #line 1008 "configure"
1008 #include "confdefs.h"
1012 if { (eval echo configure:1013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1013 ac_cv_prog_cc_works=yes
1014 # If we can't run a trivial program, we are probably using a cross compiler.
1015 if (./conftest; exit) 2>/dev/null; then
1016 ac_cv_prog_cc_cross=no
1018 ac_cv_prog_cc_cross=yes
1021 echo "configure: failed program was:" >&5
1022 cat conftest.$ac_ext >&5
1023 ac_cv_prog_cc_works=no
1027 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1028 ac_cpp='$CPP $CPPFLAGS'
1029 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1030 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1031 cross_compiling=$ac_cv_prog_cc_cross
1033 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1034 if test $ac_cv_prog_cc_works = no; then
1035 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1037 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1038 echo "configure:1039: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1039 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1040 cross_compiling=$ac_cv_prog_cc_cross
1042 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1043 echo "configure:1044: checking whether we are using GNU C" >&5
1044 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1045 echo $ac_n "(cached) $ac_c" 1>&6
1047 cat > conftest.c <<EOF
1052 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1059 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1061 if test $ac_cv_prog_gcc = yes; then
1067 ac_test_CFLAGS="${CFLAGS+set}"
1068 ac_save_CFLAGS="$CFLAGS"
1070 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1071 echo "configure:1072: checking whether ${CC-cc} accepts -g" >&5
1072 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1073 echo $ac_n "(cached) $ac_c" 1>&6
1075 echo 'void f(){}' > conftest.c
1076 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1085 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1086 if test "$ac_test_CFLAGS" = set; then
1087 CFLAGS="$ac_save_CFLAGS"
1088 elif test $ac_cv_prog_cc_g = yes; then
1089 if test "$GCC" = yes; then
1095 if test "$GCC" = yes; then
1102 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1103 echo "configure:1104: checking how to run the C preprocessor" >&5
1104 # On Suns, sometimes $CPP names a directory.
1105 if test -n "$CPP" && test -d "$CPP"; then
1108 if test -z "$CPP"; then
1109 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1110 echo $ac_n "(cached) $ac_c" 1>&6
1112 # This must be in double quotes, not single quotes, because CPP may get
1113 # substituted into the Makefile and "${CC-cc}" will confuse make.
1115 # On the NeXT, cc -E runs the code through the compiler's parser,
1116 # not just through cpp.
1117 cat > conftest.$ac_ext <<EOF
1118 #line 1119 "configure"
1119 #include "confdefs.h"
1123 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1124 { (eval echo configure:1125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1125 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1126 if test -z "$ac_err"; then
1130 echo "configure: failed program was:" >&5
1131 cat conftest.$ac_ext >&5
1133 CPP="${CC-cc} -E -traditional-cpp"
1134 cat > conftest.$ac_ext <<EOF
1135 #line 1136 "configure"
1136 #include "confdefs.h"
1140 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1141 { (eval echo configure:1142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1142 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1143 if test -z "$ac_err"; then
1147 echo "configure: failed program was:" >&5
1148 cat conftest.$ac_ext >&5
1150 CPP="${CC-cc} -nologo -E"
1151 cat > conftest.$ac_ext <<EOF
1152 #line 1153 "configure"
1153 #include "confdefs.h"
1157 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1158 { (eval echo configure:1159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1159 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1160 if test -z "$ac_err"; then
1164 echo "configure: failed program was:" >&5
1165 cat conftest.$ac_ext >&5
1174 ac_cv_prog_CPP="$CPP"
1176 CPP="$ac_cv_prog_CPP"
1178 ac_cv_prog_CPP="$CPP"
1180 echo "$ac_t""$CPP" 1>&6
1182 for ac_prog in mawk gawk nawk awk
1184 # Extract the first word of "$ac_prog", so it can be a program name with args.
1185 set dummy $ac_prog; ac_word=$2
1186 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1187 echo "configure:1188: checking for $ac_word" >&5
1188 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
1189 echo $ac_n "(cached) $ac_c" 1>&6
1191 if test -n "$AWK"; then
1192 ac_cv_prog_AWK="$AWK" # Let the user override the test.
1194 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1196 for ac_dir in $ac_dummy; do
1197 test -z "$ac_dir" && ac_dir=.
1198 if test -f $ac_dir/$ac_word; then
1199 ac_cv_prog_AWK="$ac_prog"
1206 AWK="$ac_cv_prog_AWK"
1207 if test -n "$AWK"; then
1208 echo "$ac_t""$AWK" 1>&6
1210 echo "$ac_t""no" 1>&6
1213 test -n "$AWK" && break
1218 CC_SHARED_OPTS=unknown
1219 CPPFLAGS="$CPPFLAGS"
1221 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
1222 DFT_UPR_MODEL="NORMAL"
1241 TINFO_ARGS='$(LIBS_CURSES)'
1242 cf_cv_abi_version=""
1243 cf_cv_rel_version=""
1248 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
1249 echo "configure:1250: checking for Cygwin environment" >&5
1250 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
1251 echo $ac_n "(cached) $ac_c" 1>&6
1253 cat > conftest.$ac_ext <<EOF
1254 #line 1255 "configure"
1255 #include "confdefs.h"
1260 #define __CYGWIN__ __CYGWIN32__
1265 if { (eval echo configure:1266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1269 echo "configure: failed program was:" >&5
1270 cat conftest.$ac_ext >&5
1278 echo "$ac_t""$ac_cv_cygwin" 1>&6
1280 test "$ac_cv_cygwin" = yes && CYGWIN=yes
1281 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
1282 echo "configure:1283: checking for mingw32 environment" >&5
1283 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
1284 echo $ac_n "(cached) $ac_c" 1>&6
1286 cat > conftest.$ac_ext <<EOF
1287 #line 1288 "configure"
1288 #include "confdefs.h"
1294 if { (eval echo configure:1295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1298 echo "configure: failed program was:" >&5
1299 cat conftest.$ac_ext >&5
1307 echo "$ac_t""$ac_cv_mingw32" 1>&6
1309 test "$ac_cv_mingw32" = yes && MINGW32=yes
1312 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1313 echo "configure:1314: checking for executable suffix" >&5
1314 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
1315 echo $ac_n "(cached) $ac_c" 1>&6
1317 if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
1321 echo 'int main () { return 0; }' > conftest.$ac_ext
1323 if { (eval echo configure:1324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1324 for file in conftest.*; do
1326 *.c | *.o | *.obj) ;;
1327 *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
1331 { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
1334 test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
1339 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
1340 echo "$ac_t""${ac_cv_exeext}" 1>&6
1343 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
1344 echo "configure:1345: checking for object suffix" >&5
1345 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
1346 echo $ac_n "(cached) $ac_c" 1>&6
1349 echo 'int i = 1;' > conftest.$ac_ext
1350 if { (eval echo configure:1351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1351 for ac_file in conftest.*; do
1354 *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
1358 { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
1363 echo "$ac_t""$ac_cv_objext" 1>&6
1364 OBJEXT=$ac_cv_objext
1365 ac_objext=$ac_cv_objext
1369 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1370 echo "configure:1371: checking for ${CC-cc} option to accept ANSI C" >&5
1371 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
1372 echo $ac_n "(cached) $ac_c" 1>&6
1376 cf_save_CFLAGS="$CFLAGS"
1377 cf_save_CPPFLAGS="$CPPFLAGS"
1378 # Don't try gcc -ansi; that turns off useful extensions and
1379 # breaks some systems' header files.
1380 # AIX -qlanglvl=ansi
1381 # Ultrix and OSF/1 -std1
1382 # HP-UX -Aa -D_HPUX_SOURCE
1384 # UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)
1385 for cf_arg in "-DCC_HAS_PROTOS" \
1390 "-Aa -D_HPUX_SOURCE" \
1397 cf_new_extra_cppflags=
1399 for cf_add_cflags in $cf_arg
1401 case $cf_fix_cppflags in
1403 case $cf_add_cflags in #(vi
1404 -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1405 case $cf_add_cflags in
1407 cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1409 test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1410 && test -z "${cf_tst_cflags}" \
1411 && cf_fix_cppflags=yes
1413 if test $cf_fix_cppflags = yes ; then
1414 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1416 elif test "${cf_tst_cflags}" = "\"'" ; then
1417 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1423 *$cf_add_cflags) #(vi
1426 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1431 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1436 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1438 cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1440 test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1441 && test -z "${cf_tst_cflags}" \
1442 && cf_fix_cppflags=no
1447 if test -n "$cf_new_cflags" ; then
1449 CFLAGS="$CFLAGS $cf_new_cflags"
1452 if test -n "$cf_new_cppflags" ; then
1454 CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
1457 if test -n "$cf_new_extra_cppflags" ; then
1459 EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1465 cat > conftest.$ac_ext <<EOF
1466 #line 1467 "configure"
1467 #include "confdefs.h"
1469 #ifndef CC_HAS_PROTOS
1470 #if !defined(__STDC__) || (__STDC__ != 1)
1477 int test (int i, double x);
1478 struct s1 {int (*f) (int a);};
1479 struct s2 {int (*f) (double a);};
1482 if { (eval echo configure:1483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1484 cf_cv_ansi_cc="$cf_arg"; break
1486 echo "configure: failed program was:" >&5
1487 cat conftest.$ac_ext >&5
1491 CFLAGS="$cf_save_CFLAGS"
1492 CPPFLAGS="$cf_save_CPPFLAGS"
1496 echo "$ac_t""$cf_cv_ansi_cc" 1>&6
1498 if test "$cf_cv_ansi_cc" != "no"; then
1499 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1504 cf_new_extra_cppflags=
1506 for cf_add_cflags in $cf_cv_ansi_cc
1508 case $cf_fix_cppflags in
1510 case $cf_add_cflags in #(vi
1511 -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1512 case $cf_add_cflags in
1514 cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1516 test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1517 && test -z "${cf_tst_cflags}" \
1518 && cf_fix_cppflags=yes
1520 if test $cf_fix_cppflags = yes ; then
1521 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1523 elif test "${cf_tst_cflags}" = "\"'" ; then
1524 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1530 *$cf_add_cflags) #(vi
1533 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1538 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1543 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1545 cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1547 test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1548 && test -z "${cf_tst_cflags}" \
1549 && cf_fix_cppflags=no
1554 if test -n "$cf_new_cflags" ; then
1556 CFLAGS="$CFLAGS $cf_new_cflags"
1559 if test -n "$cf_new_cppflags" ; then
1561 CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
1564 if test -n "$cf_new_extra_cppflags" ; then
1566 EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1573 cat >> confdefs.h <<\EOF
1574 #define CC_HAS_PROTOS 1
1581 if test "$cf_cv_ansi_cc" = "no"; then
1582 { echo "configure: error: Your compiler does not appear to recognize prototypes.
1583 You have the following choices:
1584 a. adjust your compiler options
1585 b. get an up-to-date compiler
1586 c. use a wrapper such as unproto" 1>&2; exit 1; }
1590 if test "$GCC" = yes
1592 cat > conftest.i <<EOF
1594 #define GCC_PRINTF 0
1599 #ifndef GCC_NORETURN
1600 #define GCC_NORETURN /* nothing */
1603 #define GCC_UNUSED /* nothing */
1606 if test "$GCC" = yes
1608 echo "checking for $CC __attribute__ directives" 1>&6
1609 echo "configure:1610: checking for $CC __attribute__ directives" >&5
1610 cat > conftest.$ac_ext <<EOF
1611 #line 1612 "${as_me-configure}"
1612 #include "confdefs.h"
1613 #include "conftest.h"
1614 #include "conftest.i"
1616 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
1618 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
1621 #define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
1623 #define GCC_SCANFLIKE(fmt,var) /*nothing*/
1625 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
1626 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
1627 extern void foo(void) GCC_NORETURN;
1628 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
1630 for cf_attribute in scanf printf unused noreturn
1633 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1635 cf_directive="__attribute__(($cf_attribute))"
1636 echo "checking for $CC $cf_directive" 1>&5
1637 case $cf_attribute in
1639 cat >conftest.h <<EOF
1640 #define GCC_$cf_ATTRIBUTE 1
1644 cat >conftest.h <<EOF
1645 #define GCC_$cf_ATTRIBUTE $cf_directive
1649 if { (eval echo configure:1650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1650 test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
1651 cat conftest.h >>confdefs.h
1655 fgrep define conftest.i >>confdefs.h
1661 echo $ac_n "checking if $CC -U and -D options work together""... $ac_c" 1>&6
1662 echo "configure:1663: checking if $CC -U and -D options work together" >&5
1663 if eval "test \"`echo '$''{'cf_cv_cc_u_d_options'+set}'`\" = set"; then
1664 echo $ac_n "(cached) $ac_c" 1>&6
1667 cf_save_CPPFLAGS="$CPPFLAGS"
1668 CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
1669 cat > conftest.$ac_ext <<EOF
1670 #line 1671 "configure"
1671 #include "confdefs.h"
1676 make an undefined-error
1679 make a defined-error
1684 if { (eval echo configure:1685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1687 cf_cv_cc_u_d_options=yes
1689 echo "configure: failed program was:" >&5
1690 cat conftest.$ac_ext >&5
1693 cf_cv_cc_u_d_options=no
1696 CPPFLAGS="$cf_save_CPPFLAGS"
1700 echo "$ac_t""$cf_cv_cc_u_d_options" 1>&6
1707 cf_POSIX_C_SOURCE=199506L
1709 case $host_os in #(vi
1711 CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
1714 # 5.x headers associate
1715 # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
1716 # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
1717 cf_POSIX_C_SOURCE=200112L
1719 CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1722 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
1725 CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
1727 linux*|gnu*|k*bsd*-gnu) #(vi
1729 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
1730 echo "configure:1731: checking if we must define _GNU_SOURCE" >&5
1731 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
1732 echo $ac_n "(cached) $ac_c" 1>&6
1735 cat > conftest.$ac_ext <<EOF
1736 #line 1737 "configure"
1737 #include "confdefs.h"
1738 #include <sys/types.h>
1741 #ifndef _XOPEN_SOURCE
1746 if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1750 echo "configure: failed program was:" >&5
1751 cat conftest.$ac_ext >&5
1754 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1755 cat > conftest.$ac_ext <<EOF
1756 #line 1757 "configure"
1757 #include "confdefs.h"
1758 #include <sys/types.h>
1761 #ifdef _XOPEN_SOURCE
1766 if { (eval echo configure:1767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1770 echo "configure: failed program was:" >&5
1771 cat conftest.$ac_ext >&5
1773 cf_cv_gnu_source=yes
1783 echo "$ac_t""$cf_cv_gnu_source" 1>&6
1784 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1788 # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
1791 # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
1794 # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
1797 CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
1800 CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
1803 # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
1806 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
1809 echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
1810 echo "configure:1811: checking if we should define _XOPEN_SOURCE" >&5
1811 if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
1812 echo $ac_n "(cached) $ac_c" 1>&6
1815 cat > conftest.$ac_ext <<EOF
1816 #line 1817 "configure"
1817 #include "confdefs.h"
1818 #include <sys/types.h>
1821 #ifndef _XOPEN_SOURCE
1826 if { (eval echo configure:1827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1828 cf_cv_xopen_source=no
1830 echo "configure: failed program was:" >&5
1831 cat conftest.$ac_ext >&5
1834 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1835 cat > conftest.$ac_ext <<EOF
1836 #line 1837 "configure"
1837 #include "confdefs.h"
1838 #include <sys/types.h>
1841 #ifdef _XOPEN_SOURCE
1846 if { (eval echo configure:1847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1848 cf_cv_xopen_source=no
1850 echo "configure: failed program was:" >&5
1851 cat conftest.$ac_ext >&5
1853 cf_cv_xopen_source=$cf_XOPEN_SOURCE
1863 echo "$ac_t""$cf_cv_xopen_source" 1>&6
1864 if test "$cf_cv_xopen_source" != no ; then
1866 # remove _XOPEN_SOURCE symbol from $CFLAGS
1867 CFLAGS=`echo "$CFLAGS" | \
1868 sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \
1869 -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'`
1872 # remove _XOPEN_SOURCE symbol from $CPPFLAGS
1873 CPPFLAGS=`echo "$CPPFLAGS" | \
1874 sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \
1875 -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'`
1877 test "$cf_cv_cc_u_d_options" = yes && \
1878 CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
1879 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
1882 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
1884 cf_save_CFLAGS="$CFLAGS"
1885 cf_save_CPPFLAGS="$CPPFLAGS"
1888 # remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS
1889 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
1890 sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \
1891 -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'`
1894 # remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS
1895 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
1896 sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \
1897 -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'`
1900 echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
1901 echo "configure:1902: checking if we should define _POSIX_C_SOURCE" >&5
1902 if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
1903 echo $ac_n "(cached) $ac_c" 1>&6
1907 echo "${as_me-configure}:1908: testing if the symbol is already defined go no further ..." 1>&5
1909 cat > conftest.$ac_ext <<EOF
1910 #line 1911 "configure"
1911 #include "confdefs.h"
1912 #include <sys/types.h>
1915 #ifndef _POSIX_C_SOURCE
1920 if { (eval echo configure:1921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1922 cf_cv_posix_c_source=no
1924 echo "configure: failed program was:" >&5
1925 cat conftest.$ac_ext >&5
1927 cf_want_posix_source=no
1928 case .$cf_POSIX_C_SOURCE in #(vi
1930 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
1933 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
1934 cf_want_posix_source=yes
1937 cf_want_posix_source=yes
1940 if test "$cf_want_posix_source" = yes ; then
1941 cat > conftest.$ac_ext <<EOF
1942 #line 1943 "configure"
1943 #include "confdefs.h"
1944 #include <sys/types.h>
1947 #ifdef _POSIX_SOURCE
1952 if { (eval echo configure:1953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1955 echo "configure: failed program was:" >&5
1956 cat conftest.$ac_ext >&5
1958 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
1963 echo "${as_me-configure}:1964: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
1965 CFLAGS="$cf_trim_CFLAGS"
1966 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
1968 echo "${as_me-configure}:1969: testing if the second compile does not leave our definition intact error ..." 1>&5
1970 cat > conftest.$ac_ext <<EOF
1971 #line 1972 "configure"
1972 #include "confdefs.h"
1973 #include <sys/types.h>
1976 #ifndef _POSIX_C_SOURCE
1981 if { (eval echo configure:1982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1984 echo "configure: failed program was:" >&5
1985 cat conftest.$ac_ext >&5
1987 cf_cv_posix_c_source=no
1990 CFLAGS="$cf_save_CFLAGS"
1991 CPPFLAGS="$cf_save_CPPFLAGS"
1998 echo "$ac_t""$cf_cv_posix_c_source" 1>&6
2000 if test "$cf_cv_posix_c_source" != no ; then
2001 CFLAGS="$cf_trim_CFLAGS"
2002 CPPFLAGS="$cf_trim_CPPFLAGS"
2003 if test "$cf_cv_cc_u_d_options" = yes ; then
2004 cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
2005 sed -e 's/-D/-U/g' -e 's/=[^ ]*//g'`
2006 CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
2008 CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
2015 echo $ac_n "checking for working const""... $ac_c" 1>&6
2016 echo "configure:2017: checking for working const" >&5
2017 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
2018 echo $ac_n "(cached) $ac_c" 1>&6
2020 cat > conftest.$ac_ext <<EOF
2021 #line 2022 "configure"
2022 #include "confdefs.h"
2026 /* Ultrix mips cc rejects this. */
2027 typedef int charset[2]; const charset x;
2028 /* SunOS 4.1.1 cc rejects this. */
2029 char const *const *ccp;
2031 /* NEC SVR4.0.2 mips cc rejects this. */
2032 struct point {int x, y;};
2033 static struct point const zero = {0,0};
2034 /* AIX XL C 1.02.0.0 rejects this.
2035 It does not let you subtract one const X* pointer from another in an arm
2036 of an if-expression whose if-part is not a constant expression */
2037 const char *g = "string";
2038 ccp = &g + (g ? g-g : 0);
2039 /* HPUX 7.0 cc rejects these. */
2042 ccp = (char const *const *) p;
2043 { /* SCO 3.2v4 cc rejects this. */
2045 char const *s = 0 ? (char *) 0 : (char const *) 0;
2049 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
2051 const int *foo = &x[0];
2054 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
2055 typedef const int *iptr;
2059 { /* AIX XL C 1.02.0.0 rejects this saying
2060 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
2061 struct s { int j; const int *ap[3]; };
2062 struct s *b; b->j = 5;
2064 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
2070 if { (eval echo configure:2071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2074 echo "configure: failed program was:" >&5
2075 cat conftest.$ac_ext >&5
2082 echo "$ac_t""$ac_cv_c_const" 1>&6
2083 if test $ac_cv_c_const = no; then
2084 cat >> confdefs.h <<\EOF
2091 echo $ac_n "checking for signal global datatype""... $ac_c" 1>&6
2092 echo "configure:2093: checking for signal global datatype" >&5
2093 if eval "test \"`echo '$''{'cf_cv_sig_atomic_t'+set}'`\" = set"; then
2094 echo $ac_n "(cached) $ac_c" 1>&6
2098 "volatile sig_atomic_t" \
2102 cat > conftest.$ac_ext <<EOF
2103 #line 2104 "configure"
2104 #include "confdefs.h"
2106 #include <sys/types.h>
2112 static void handler(int sig)
2117 signal(SIGINT, handler);
2121 if { (eval echo configure:2122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2123 cf_cv_sig_atomic_t=$cf_type
2125 echo "configure: failed program was:" >&5
2126 cat conftest.$ac_ext >&5
2128 cf_cv_sig_atomic_t=no
2131 test "$cf_cv_sig_atomic_t" != no && break
2136 echo "$ac_t""$cf_cv_sig_atomic_t" 1>&6
2137 test "$cf_cv_sig_atomic_t" != no && cat >> confdefs.h <<EOF
2138 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
2144 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
2145 echo "configure:2146: checking if you want to see long compiling messages" >&5
2147 # Check whether --enable-echo or --disable-echo was given.
2148 if test "${enable_echo+set}" = set; then
2149 enableval="$enable_echo"
2150 test "$enableval" != no && enableval=yes
2151 if test "$enableval" != "yes" ; then
2154 ECHO_LD='@echo linking $@;'
2155 RULE_CC=' @echo compiling $<'
2156 SHOW_CC=' @echo compiling $@'
2163 RULE_CC='# compiling'
2164 SHOW_CC='# compiling'
2173 RULE_CC='# compiling'
2174 SHOW_CC='# compiling'
2180 echo "$ac_t""$enableval" 1>&6
2190 if test "$GCC" = yes ; then
2191 echo $ac_n "checking version of $CC""... $ac_c" 1>&6
2192 echo "configure:2193: checking version of $CC" >&5
2193 GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
2194 test -z "$GCC_VERSION" && GCC_VERSION=unknown
2195 echo "$ac_t""$GCC_VERSION" 1>&6
2199 if ( test "$GCC" = yes || test "$GXX" = yes )
2201 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
2202 echo "configure:2203: checking if you want to turn on gcc warnings" >&5
2204 # Check whether --enable-warnings or --disable-warnings was given.
2205 if test "${enable_warnings+set}" = set; then
2206 enableval="$enable_warnings"
2207 test "$enableval" != yes && enableval=no
2208 if test "$enableval" != "no" ; then
2219 echo "$ac_t""$with_warnings" 1>&6
2220 if test "$with_warnings" = "yes"
2227 if test "$GCC" = yes ; then
2230 echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
2231 echo "configure:2232: checking if this is really Intel C compiler" >&5
2232 cf_save_CFLAGS="$CFLAGS"
2233 CFLAGS="$CFLAGS -no-gcc"
2234 cat > conftest.$ac_ext <<EOF
2235 #line 2236 "configure"
2236 #include "confdefs.h"
2240 #ifdef __INTEL_COMPILER
2247 if { (eval echo configure:2248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2250 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
2253 echo "configure: failed program was:" >&5
2254 cat conftest.$ac_ext >&5
2257 CFLAGS="$cf_save_CFLAGS"
2258 echo "$ac_t""$INTEL_COMPILER" 1>&6
2264 cat > conftest.$ac_ext <<EOF
2265 #line 2266 "${as_me-configure}"
2266 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
2269 if test "$INTEL_COMPILER" = yes
2271 # The "-wdXXX" options suppress warnings:
2272 # remark #1419: external declaration in primary source file
2273 # remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
2274 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
2275 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
2276 # remark #193: zero used for undefined preprocessing identifier
2277 # remark #593: variable "curs_sb_left_arrow" was set but never used
2278 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
2279 # remark #869: parameter "tw" was never referenced
2280 # remark #981: operands are evaluated in unspecified order
2281 # warning #269: invalid format string conversion
2283 echo "checking for $CC warning options" 1>&6
2284 echo "configure:2285: checking for $CC warning options" >&5
2285 cf_save_CFLAGS="$CFLAGS"
2286 EXTRA_CFLAGS="-Wall"
2299 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2300 if { (eval echo configure:2301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2301 test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
2302 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2305 CFLAGS="$cf_save_CFLAGS"
2307 elif test "$GCC" = yes
2309 echo "checking for $CC warning options" 1>&6
2310 echo "configure:2311: checking for $CC warning options" >&5
2311 cf_save_CFLAGS="$CFLAGS"
2312 EXTRA_CFLAGS="-W -Wall"
2314 test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
2316 Wbad-function-cast \
2320 Wmissing-declarations \
2321 Wmissing-prototypes \
2325 Wstrict-prototypes \
2326 Wundef $cf_warn_CONST
2328 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2329 if { (eval echo configure:2330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2330 test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
2331 case $cf_opt in #(vi
2333 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
2336 case $GCC_VERSION in
2338 test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
2340 echo "${as_me-configure}:2341: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
2347 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2350 CFLAGS="$cf_save_CFLAGS"
2362 # Check whether --with-curses-dir or --without-curses-dir was given.
2363 if test "${with_curses_dir+set}" = set; then
2364 withval="$with_curses_dir"
2366 if test "x$prefix" != xNONE; then
2367 cf_path_syntax="$prefix"
2369 cf_path_syntax="$ac_default_prefix"
2372 case ".$withval" in #(vi
2373 .\$\(*\)*|.\'*\'*) #(vi
2377 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2380 eval withval="$withval"
2381 case ".$withval" in #(vi
2383 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2388 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2391 { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
2395 cf_cv_curses_dir=$withval
2403 # Check whether --with-5lib or --without-5lib was given.
2404 if test "${with_5lib+set}" = set; then
2405 withval="$with_5lib"
2406 LIBS="-L/usr/5lib $LIBS"
2407 CPPFLAGS="$CPPFLAGS -I/usr/5include"
2412 # Check whether --with-ncursesw or --without-ncursesw was given.
2413 if test "${with_ncursesw+set}" = set; then
2414 withval="$with_ncursesw"
2415 cf_cv_screen=ncursesw
2420 # Check whether --with-ncurses or --without-ncurses was given.
2421 if test "${with_ncurses+set}" = set; then
2422 withval="$with_ncurses"
2423 cf_cv_screen=ncurses
2428 # Check whether --with-pdcurses or --without-pdcurses was given.
2429 if test "${with_pdcurses+set}" = set; then
2430 withval="$with_pdcurses"
2431 cf_cv_screen=pdcurses
2439 case $cf_cv_screen in
2443 echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
2444 echo "configure:2445: checking for extra include directories" >&5
2445 if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
2446 echo $ac_n "(cached) $ac_c" 1>&6
2449 cf_cv_curses_incdir=no
2450 case $host_os in #(vi
2452 test -d /usr/include/curses_colr && \
2453 cf_cv_curses_incdir="-I/usr/include/curses_colr"
2456 test -d /usr/5lib && \
2457 test -d /usr/5include && \
2458 cf_cv_curses_incdir="-I/usr/5include"
2464 echo "$ac_t""$cf_cv_curses_incdir" 1>&6
2465 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
2468 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
2469 echo "configure:2470: checking if we have identified curses headers" >&5
2470 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
2471 echo $ac_n "(cached) $ac_c" 1>&6
2474 cf_cv_ncurses_header=none
2481 cat > conftest.$ac_ext <<EOF
2482 #line 2483 "configure"
2483 #include "confdefs.h"
2484 #include <${cf_header}>
2486 initscr(); tgoto("?", 0,0)
2489 if { (eval echo configure:2490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2491 cf_cv_ncurses_header=$cf_header; break
2493 echo "configure: failed program was:" >&5
2494 cat conftest.$ac_ext >&5
2501 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
2503 if test "$cf_cv_ncurses_header" = none ; then
2504 { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
2507 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
2508 for ac_hdr in $cf_cv_ncurses_header
2510 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2511 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2512 echo "configure:2513: checking for $ac_hdr" >&5
2513 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2514 echo $ac_n "(cached) $ac_c" 1>&6
2516 cat > conftest.$ac_ext <<EOF
2517 #line 2518 "configure"
2518 #include "confdefs.h"
2521 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2522 { (eval echo configure:2523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2523 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2524 if test -z "$ac_err"; then
2526 eval "ac_cv_header_$ac_safe=yes"
2529 echo "configure: failed program was:" >&5
2530 cat conftest.$ac_ext >&5
2532 eval "ac_cv_header_$ac_safe=no"
2536 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2537 echo "$ac_t""yes" 1>&6
2538 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2539 cat >> confdefs.h <<EOF
2540 #define $ac_tr_hdr 1
2544 echo "$ac_t""no" 1>&6
2550 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
2551 echo "configure:2552: checking for terminfo header" >&5
2552 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
2553 echo $ac_n "(cached) $ac_c" 1>&6
2556 case ${cf_cv_ncurses_header} in #(vi
2557 */ncurses.h|*/ncursesw.h) #(vi
2558 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
2561 cf_term_header=term.h
2565 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
2567 cat > conftest.$ac_ext <<EOF
2568 #line 2569 "configure"
2569 #include "confdefs.h"
2571 #include <${cf_cv_ncurses_header-curses.h}>
2575 int x = auto_left_margin
2578 if { (eval echo configure:2579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2581 cf_cv_term_header="$cf_test"
2583 echo "configure: failed program was:" >&5
2584 cat conftest.$ac_ext >&5
2587 cf_cv_term_header=unknown
2591 test "$cf_cv_term_header" != unknown && break
2596 echo "$ac_t""$cf_cv_term_header" 1>&6
2598 # Set definitions to allow ifdef'ing to accommodate subdirectories
2600 case $cf_cv_term_header in # (vi
2602 cat >> confdefs.h <<\EOF
2603 #define HAVE_TERM_H 1
2609 case $cf_cv_term_header in # (vi
2610 ncurses/term.h) #(vi
2611 cat >> confdefs.h <<\EOF
2612 #define HAVE_NCURSES_TERM_H 1
2617 cat >> confdefs.h <<\EOF
2618 #define HAVE_NCURSESW_TERM_H 1
2626 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
2627 echo "configure:2628: checking for ncurses version" >&5
2628 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
2629 echo $ac_n "(cached) $ac_c" 1>&6
2632 cf_cv_ncurses_version=no
2635 if test "$cross_compiling" = yes; then
2638 # This will not work if the preprocessor splits the line after the
2639 # Autoconf token. The 'unproto' program does that.
2640 cat > conftest.$ac_ext <<EOF
2641 #include <${cf_cv_ncurses_header-curses.h}>
2643 #ifdef NCURSES_VERSION
2644 Autoconf NCURSES_VERSION
2652 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
2653 { (eval echo configure:2654: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
2654 if test -f conftest.out ; then
2655 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
2656 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
2661 cat > conftest.$ac_ext <<EOF
2662 #line 2663 "configure"
2663 #include "confdefs.h"
2665 #include <${cf_cv_ncurses_header-curses.h}>
2669 FILE *fp = fopen("$cf_tempfile", "w");
2670 #ifdef NCURSES_VERSION
2671 # ifdef NCURSES_VERSION_PATCH
2672 fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
2674 fprintf(fp, "%s\n", NCURSES_VERSION);
2678 fprintf(fp, "old\n");
2683 ${cf_cv_main_return-return}(0);
2686 if { (eval echo configure:2687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2689 cf_cv_ncurses_version=`cat $cf_tempfile`
2691 echo "configure: failed program was:" >&5
2692 cat conftest.$ac_ext >&5
2701 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
2702 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
2709 echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
2710 echo "configure:2711: checking if we have identified curses libraries" >&5
2711 cat > conftest.$ac_ext <<EOF
2712 #line 2713 "configure"
2713 #include "confdefs.h"
2714 #include <${cf_cv_ncurses_header-curses.h}>
2716 initscr(); tgoto("?", 0,0)
2719 if { (eval echo configure:2720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2723 echo "configure: failed program was:" >&5
2724 cat conftest.$ac_ext >&5
2729 echo "$ac_t""$cf_result" 1>&6
2731 if test "$cf_result" = no ; then
2732 case $host_os in #(vi
2734 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
2735 echo "configure:2736: checking for tgoto in -lmytinfo" >&5
2736 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
2737 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2738 echo $ac_n "(cached) $ac_c" 1>&6
2740 ac_save_LIBS="$LIBS"
2741 LIBS="-lmytinfo $LIBS"
2742 cat > conftest.$ac_ext <<EOF
2743 #line 2744 "configure"
2744 #include "confdefs.h"
2745 /* Override any gcc2 internal prototype to avoid an error. */
2746 /* We use char because int might match the return type of a gcc2
2747 builtin and then its argument prototype would still apply. */
2754 if { (eval echo configure:2755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2756 eval "ac_cv_lib_$ac_lib_var=yes"
2758 echo "configure: failed program was:" >&5
2759 cat conftest.$ac_ext >&5
2761 eval "ac_cv_lib_$ac_lib_var=no"
2764 LIBS="$ac_save_LIBS"
2767 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2768 echo "$ac_t""yes" 1>&6
2769 LIBS="-lmytinfo $LIBS"
2771 echo "$ac_t""no" 1>&6
2776 echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
2777 echo "configure:2778: checking for initscr in -lcur_colr" >&5
2778 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
2779 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2780 echo $ac_n "(cached) $ac_c" 1>&6
2782 ac_save_LIBS="$LIBS"
2783 LIBS="-lcur_colr $LIBS"
2784 cat > conftest.$ac_ext <<EOF
2785 #line 2786 "configure"
2786 #include "confdefs.h"
2787 /* Override any gcc2 internal prototype to avoid an error. */
2788 /* We use char because int might match the return type of a gcc2
2789 builtin and then its argument prototype would still apply. */
2796 if { (eval echo configure:2797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2798 eval "ac_cv_lib_$ac_lib_var=yes"
2800 echo "configure: failed program was:" >&5
2801 cat conftest.$ac_ext >&5
2803 eval "ac_cv_lib_$ac_lib_var=no"
2806 LIBS="$ac_save_LIBS"
2809 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2810 echo "$ac_t""yes" 1>&6
2812 LIBS="-lcur_colr $LIBS"
2813 ac_cv_func_initscr=yes
2816 echo "$ac_t""no" 1>&6
2818 echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
2819 echo "configure:2820: checking for initscr in -lHcurses" >&5
2820 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
2821 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2822 echo $ac_n "(cached) $ac_c" 1>&6
2824 ac_save_LIBS="$LIBS"
2825 LIBS="-lHcurses $LIBS"
2826 cat > conftest.$ac_ext <<EOF
2827 #line 2828 "configure"
2828 #include "confdefs.h"
2829 /* Override any gcc2 internal prototype to avoid an error. */
2830 /* We use char because int might match the return type of a gcc2
2831 builtin and then its argument prototype would still apply. */
2838 if { (eval echo configure:2839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2840 eval "ac_cv_lib_$ac_lib_var=yes"
2842 echo "configure: failed program was:" >&5
2843 cat conftest.$ac_ext >&5
2845 eval "ac_cv_lib_$ac_lib_var=no"
2848 LIBS="$ac_save_LIBS"
2851 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2852 echo "$ac_t""yes" 1>&6
2854 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
2855 LIBS="-lHcurses $LIBS"
2856 CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
2857 ac_cv_func_initscr=yes
2860 echo "$ac_t""no" 1>&6
2866 linux*) # Suse Linux does not follow /usr/lib convention
2868 if test -n "/lib" ; then
2869 for cf_add_libdir in /lib
2871 if test $cf_add_libdir = /usr/lib ; then
2873 elif test -d $cf_add_libdir
2876 if test -n "$LDFLAGS$LIBS" ; then
2877 # a loop is needed to ensure we can add subdirs of existing dirs
2878 for cf_test_libdir in $LDFLAGS $LIBS ; do
2879 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
2880 cf_have_libdir=yes; break
2884 if test "$cf_have_libdir" = no ; then
2885 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
2887 echo "${as_me-configure}:2888: testing adding $cf_add_libdir to library-path ..." 1>&5
2890 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
2898 if test -d /usr/5lib ; then
2900 if test -n "/usr/5lib" ; then
2901 for cf_add_libdir in /usr/5lib
2903 if test $cf_add_libdir = /usr/lib ; then
2905 elif test -d $cf_add_libdir
2908 if test -n "$LDFLAGS$LIBS" ; then
2909 # a loop is needed to ensure we can add subdirs of existing dirs
2910 for cf_test_libdir in $LDFLAGS $LIBS ; do
2911 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
2912 cf_have_libdir=yes; break
2916 if test "$cf_have_libdir" = no ; then
2917 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
2919 echo "${as_me-configure}:2920: testing adding $cf_add_libdir to library-path ..." 1>&5
2922 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
2928 LIBS="$LIBS -lcurses -ltermcap"
2930 ac_cv_func_initscr=yes
2934 if test ".$ac_cv_func_initscr" != .yes ; then
2935 cf_save_LIBS="$LIBS"
2939 if test ".${cf_cv_ncurses_version-no}" != .no
2941 cf_check_list="ncurses curses cursesX"
2943 cf_check_list="cursesX curses ncurses"
2946 # Check for library containing tgoto. Do this before curses library
2947 # because it may be needed to link the test-case for initscr.
2948 echo $ac_n "checking for tgoto""... $ac_c" 1>&6
2949 echo "configure:2950: checking for tgoto" >&5
2950 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
2951 echo $ac_n "(cached) $ac_c" 1>&6
2953 cat > conftest.$ac_ext <<EOF
2954 #line 2955 "configure"
2955 #include "confdefs.h"
2956 /* System header to define __stub macros and hopefully few prototypes,
2957 which can conflict with char tgoto(); below. */
2959 /* Override any gcc2 internal prototype to avoid an error. */
2960 /* We use char because int might match the return type of a gcc2
2961 builtin and then its argument prototype would still apply. */
2966 /* The GNU C library defines this for functions which it implements
2967 to always fail with ENOSYS. Some functions are actually named
2968 something starting with __ and the normal name is an alias. */
2969 #if defined (__stub_tgoto) || defined (__stub___tgoto)
2977 if { (eval echo configure:2978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2979 eval "ac_cv_func_tgoto=yes"
2981 echo "configure: failed program was:" >&5
2982 cat conftest.$ac_ext >&5
2984 eval "ac_cv_func_tgoto=no"
2989 if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
2990 echo "$ac_t""yes" 1>&6
2991 cf_term_lib=predefined
2993 echo "$ac_t""no" 1>&6
2995 for cf_term_lib in $cf_check_list termcap termlib unknown
2997 echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
2998 echo "configure:2999: checking for tgoto in -l$cf_term_lib" >&5
2999 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
3000 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3001 echo $ac_n "(cached) $ac_c" 1>&6
3003 ac_save_LIBS="$LIBS"
3004 LIBS="-l$cf_term_lib $LIBS"
3005 cat > conftest.$ac_ext <<EOF
3006 #line 3007 "configure"
3007 #include "confdefs.h"
3008 /* Override any gcc2 internal prototype to avoid an error. */
3009 /* We use char because int might match the return type of a gcc2
3010 builtin and then its argument prototype would still apply. */
3017 if { (eval echo configure:3018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3019 eval "ac_cv_lib_$ac_lib_var=yes"
3021 echo "configure: failed program was:" >&5
3022 cat conftest.$ac_ext >&5
3024 eval "ac_cv_lib_$ac_lib_var=no"
3027 LIBS="$ac_save_LIBS"
3030 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3031 echo "$ac_t""yes" 1>&6
3034 echo "$ac_t""no" 1>&6
3042 # Check for library containing initscr
3043 test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
3044 for cf_curs_lib in $cf_check_list xcurses jcurses unknown
3046 echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
3047 echo "configure:3048: checking for initscr in -l$cf_curs_lib" >&5
3048 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
3049 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3050 echo $ac_n "(cached) $ac_c" 1>&6
3052 ac_save_LIBS="$LIBS"
3053 LIBS="-l$cf_curs_lib $LIBS"
3054 cat > conftest.$ac_ext <<EOF
3055 #line 3056 "configure"
3056 #include "confdefs.h"
3057 /* Override any gcc2 internal prototype to avoid an error. */
3058 /* We use char because int might match the return type of a gcc2
3059 builtin and then its argument prototype would still apply. */
3066 if { (eval echo configure:3067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3068 eval "ac_cv_lib_$ac_lib_var=yes"
3070 echo "configure: failed program was:" >&5
3071 cat conftest.$ac_ext >&5
3073 eval "ac_cv_lib_$ac_lib_var=no"
3076 LIBS="$ac_save_LIBS"
3079 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3080 echo "$ac_t""yes" 1>&6
3083 echo "$ac_t""no" 1>&6
3087 test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
3089 LIBS="-l$cf_curs_lib $cf_save_LIBS"
3090 if test "$cf_term_lib" = unknown ; then
3091 echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
3092 echo "configure:3093: checking if we can link with $cf_curs_lib library" >&5
3093 cat > conftest.$ac_ext <<EOF
3094 #line 3095 "configure"
3095 #include "confdefs.h"
3096 #include <${cf_cv_ncurses_header-curses.h}>
3101 if { (eval echo configure:3102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3105 echo "configure: failed program was:" >&5
3106 cat conftest.$ac_ext >&5
3111 echo "$ac_t""$cf_result" 1>&6
3112 test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
3113 elif test "$cf_curs_lib" = "$cf_term_lib" ; then
3115 elif test "$cf_term_lib" != predefined ; then
3116 echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
3117 echo "configure:3118: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
3118 cat > conftest.$ac_ext <<EOF
3119 #line 3120 "configure"
3120 #include "confdefs.h"
3121 #include <${cf_cv_ncurses_header-curses.h}>
3123 initscr(); tgoto((char *)0, 0, 0);
3126 if { (eval echo configure:3127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3130 echo "configure: failed program was:" >&5
3131 cat conftest.$ac_ext >&5
3134 LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
3135 cat > conftest.$ac_ext <<EOF
3136 #line 3137 "configure"
3137 #include "confdefs.h"
3138 #include <${cf_cv_ncurses_header-curses.h}>
3143 if { (eval echo configure:3144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3147 echo "configure: failed program was:" >&5
3148 cat conftest.$ac_ext >&5
3156 echo "$ac_t""$cf_result" 1>&6
3166 cf_ncuhdr_root=ncurses
3168 test -n "$cf_cv_curses_dir" && \
3169 test "$cf_cv_curses_dir" != "no" && { \
3171 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
3172 for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
3174 while test $cf_add_incdir != /usr/include
3176 if test -d $cf_add_incdir
3179 if test -n "$CFLAGS$CPPFLAGS" ; then
3180 # a loop is needed to ensure we can add subdirs of existing dirs
3181 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3182 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3183 cf_have_incdir=yes; break
3188 if test "$cf_have_incdir" = no ; then
3189 if test "$cf_add_incdir" = /usr/local/include ; then
3190 if test "$GCC" = yes
3192 cf_save_CPPFLAGS=$CPPFLAGS
3193 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3194 cat > conftest.$ac_ext <<EOF
3195 #line 3196 "configure"
3196 #include "confdefs.h"
3202 if { (eval echo configure:3203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3205 echo "configure: failed program was:" >&5
3206 cat conftest.$ac_ext >&5
3211 CPPFLAGS=$cf_save_CPPFLAGS
3216 if test "$cf_have_incdir" = no ; then
3217 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
3219 echo "${as_me-configure}:3220: testing adding $cf_add_incdir to include-path ..." 1>&5
3222 CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
3224 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3225 test "$cf_top_incdir" = "$cf_add_incdir" && break
3226 cf_add_incdir="$cf_top_incdir"
3237 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
3238 echo "configure:3239: checking for $cf_ncuhdr_root header in include-path" >&5
3239 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
3240 echo $ac_n "(cached) $ac_c" 1>&6
3243 cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
3244 ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
3245 for cf_header in $cf_header_list
3248 cat > conftest.$ac_ext <<EOF
3249 #line 3250 "configure"
3250 #include "confdefs.h"
3253 #include <$cf_header>
3256 #ifdef NCURSES_VERSION
3258 printf("%s\n", NCURSES_VERSION);
3270 if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3272 cf_cv_ncurses_h=$cf_header
3275 echo "configure: failed program was:" >&5
3276 cat conftest.$ac_ext >&5
3282 test "$cf_cv_ncurses_h" != no && break
3287 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
3291 if test "$cf_cv_ncurses_h" != no ; then
3292 cf_cv_ncurses_header=$cf_cv_ncurses_h
3295 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
3296 echo "configure:3297: checking for $cf_ncuhdr_root include-path" >&5
3297 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
3298 echo $ac_n "(cached) $ac_c" 1>&6
3301 test -n "$verbose" && echo
3305 test "/usr" != "$prefix" && \
3307 (test $prefix = NONE || test -d $prefix) && {
3308 test -n "$verbose" && echo " ... testing for include-directories under /usr"
3309 test -d /usr/include && cf_search="$cf_search /usr/include"
3310 test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
3311 test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
3312 test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
3313 test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3317 test "$prefix" != "NONE" && \
3318 test -d "$prefix" && \
3320 test -n "$verbose" && echo " ... testing for include-directories under $prefix"
3321 test -d $prefix/include && cf_search="$cf_search $prefix/include"
3322 test -d $prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
3323 test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
3324 test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
3325 test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3329 test "/usr/local" != "$prefix" && \
3330 test -d "/usr/local" && \
3331 (test $prefix = NONE || test -d $prefix) && {
3332 test -n "$verbose" && echo " ... testing for include-directories under /usr/local"
3333 test -d /usr/local/include && cf_search="$cf_search /usr/local/include"
3334 test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
3335 test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
3336 test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
3337 test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3341 test "/opt" != "$prefix" && \
3343 (test $prefix = NONE || test -d $prefix) && {
3344 test -n "$verbose" && echo " ... testing for include-directories under /opt"
3345 test -d /opt/include && cf_search="$cf_search /opt/include"
3346 test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
3347 test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
3348 test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
3349 test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3353 test "$HOME" != "$prefix" && \
3354 test -d "$HOME" && \
3355 (test $prefix = NONE || test -d $prefix) && {
3356 test -n "$verbose" && echo " ... testing for include-directories under $HOME"
3357 test -d $HOME/include && cf_search="$cf_search $HOME/include"
3358 test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
3359 test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
3360 test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
3361 test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3365 test "$includedir" != NONE && \
3366 test "$includedir" != "/usr/include" && \
3367 test -d "$includedir" && {
3368 test -d $includedir && cf_search="$cf_search $includedir"
3369 test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
3372 test "$oldincludedir" != NONE && \
3373 test "$oldincludedir" != "/usr/include" && \
3374 test -d "$oldincludedir" && {
3375 test -d $oldincludedir && cf_search="$cf_search $oldincludedir"
3376 test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
3380 test -n "$verbose" && echo search path $cf_search
3381 cf_save2_CPPFLAGS="$CPPFLAGS"
3382 for cf_incdir in $cf_search
3385 if test -n "$cf_incdir" ; then
3386 for cf_add_incdir in $cf_incdir
3388 while test $cf_add_incdir != /usr/include
3390 if test -d $cf_add_incdir
3393 if test -n "$CFLAGS$CPPFLAGS" ; then
3394 # a loop is needed to ensure we can add subdirs of existing dirs
3395 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3396 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3397 cf_have_incdir=yes; break
3402 if test "$cf_have_incdir" = no ; then
3403 if test "$cf_add_incdir" = /usr/local/include ; then
3404 if test "$GCC" = yes
3406 cf_save_CPPFLAGS=$CPPFLAGS
3407 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3408 cat > conftest.$ac_ext <<EOF
3409 #line 3410 "configure"
3410 #include "confdefs.h"
3416 if { (eval echo configure:3417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3419 echo "configure: failed program was:" >&5
3420 cat conftest.$ac_ext >&5
3425 CPPFLAGS=$cf_save_CPPFLAGS
3430 if test "$cf_have_incdir" = no ; then
3431 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
3433 echo "${as_me-configure}:3434: testing adding $cf_add_incdir to include-path ..." 1>&5
3436 CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
3438 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3439 test "$cf_top_incdir" = "$cf_add_incdir" && break
3440 cf_add_incdir="$cf_top_incdir"
3454 cat > conftest.$ac_ext <<EOF
3455 #line 3456 "configure"
3456 #include "confdefs.h"
3459 #include <$cf_header>
3462 #ifdef NCURSES_VERSION
3464 printf("%s\n", NCURSES_VERSION);
3476 if { (eval echo configure:3477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3478 cf_cv_ncurses_h2=$cf_header
3481 echo "configure: failed program was:" >&5
3482 cat conftest.$ac_ext >&5
3488 if test "$cf_cv_ncurses_h2" != no ; then
3489 cf_cv_ncurses_h2=$cf_incdir/$cf_header
3490 test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6
3493 test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6
3495 CPPFLAGS="$cf_save2_CPPFLAGS"
3496 test "$cf_cv_ncurses_h2" != no && break
3498 test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
3502 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
3504 cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
3505 cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
3506 if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
3507 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
3510 if test -n "$cf_1st_incdir" ; then
3511 for cf_add_incdir in $cf_1st_incdir
3513 while test $cf_add_incdir != /usr/include
3515 if test -d $cf_add_incdir
3518 if test -n "$CFLAGS$CPPFLAGS" ; then
3519 # a loop is needed to ensure we can add subdirs of existing dirs
3520 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3521 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3522 cf_have_incdir=yes; break
3527 if test "$cf_have_incdir" = no ; then
3528 if test "$cf_add_incdir" = /usr/local/include ; then
3529 if test "$GCC" = yes
3531 cf_save_CPPFLAGS=$CPPFLAGS
3532 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3533 cat > conftest.$ac_ext <<EOF
3534 #line 3535 "configure"
3535 #include "confdefs.h"
3541 if { (eval echo configure:3542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3544 echo "configure: failed program was:" >&5
3545 cat conftest.$ac_ext >&5
3550 CPPFLAGS=$cf_save_CPPFLAGS
3555 if test "$cf_have_incdir" = no ; then
3556 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
3558 echo "${as_me-configure}:3559: testing adding $cf_add_incdir to include-path ..." 1>&5
3561 CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
3563 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3564 test "$cf_top_incdir" = "$cf_add_incdir" && break
3565 cf_add_incdir="$cf_top_incdir"
3577 # Set definitions to allow ifdef'ing for ncurses.h
3579 case $cf_cv_ncurses_header in # (vi
3581 cat >> confdefs.h <<\EOF
3582 #define HAVE_NCURSES_H 1
3588 case $cf_cv_ncurses_header in # (vi
3589 ncurses/curses.h|ncurses/ncurses.h)
3590 cat >> confdefs.h <<\EOF
3591 #define HAVE_NCURSES_NCURSES_H 1
3595 ncursesw/curses.h|ncursesw/ncurses.h)
3596 cat >> confdefs.h <<\EOF
3597 #define HAVE_NCURSESW_NCURSES_H 1
3605 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
3606 echo "configure:3607: checking for terminfo header" >&5
3607 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
3608 echo $ac_n "(cached) $ac_c" 1>&6
3611 case ${cf_cv_ncurses_header} in #(vi
3612 */ncurses.h|*/ncursesw.h) #(vi
3613 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
3616 cf_term_header=term.h
3620 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
3622 cat > conftest.$ac_ext <<EOF
3623 #line 3624 "configure"
3624 #include "confdefs.h"
3626 #include <${cf_cv_ncurses_header-curses.h}>
3630 int x = auto_left_margin
3633 if { (eval echo configure:3634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3636 cf_cv_term_header="$cf_test"
3638 echo "configure: failed program was:" >&5
3639 cat conftest.$ac_ext >&5
3642 cf_cv_term_header=unknown
3646 test "$cf_cv_term_header" != unknown && break
3651 echo "$ac_t""$cf_cv_term_header" 1>&6
3653 # Set definitions to allow ifdef'ing to accommodate subdirectories
3655 case $cf_cv_term_header in # (vi
3657 cat >> confdefs.h <<\EOF
3658 #define HAVE_TERM_H 1
3664 case $cf_cv_term_header in # (vi
3665 ncurses/term.h) #(vi
3666 cat >> confdefs.h <<\EOF
3667 #define HAVE_NCURSES_TERM_H 1
3672 cat >> confdefs.h <<\EOF
3673 #define HAVE_NCURSESW_TERM_H 1
3680 # some applications need this, but should check for NCURSES_VERSION
3681 cat >> confdefs.h <<\EOF
3687 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
3688 echo "configure:3689: checking for ncurses version" >&5
3689 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
3690 echo $ac_n "(cached) $ac_c" 1>&6
3693 cf_cv_ncurses_version=no
3696 if test "$cross_compiling" = yes; then
3699 # This will not work if the preprocessor splits the line after the
3700 # Autoconf token. The 'unproto' program does that.
3701 cat > conftest.$ac_ext <<EOF
3702 #include <${cf_cv_ncurses_header-curses.h}>
3704 #ifdef NCURSES_VERSION
3705 Autoconf NCURSES_VERSION
3713 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
3714 { (eval echo configure:3715: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
3715 if test -f conftest.out ; then
3716 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
3717 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
3722 cat > conftest.$ac_ext <<EOF
3723 #line 3724 "configure"
3724 #include "confdefs.h"
3726 #include <${cf_cv_ncurses_header-curses.h}>
3730 FILE *fp = fopen("$cf_tempfile", "w");
3731 #ifdef NCURSES_VERSION
3732 # ifdef NCURSES_VERSION_PATCH
3733 fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
3735 fprintf(fp, "%s\n", NCURSES_VERSION);
3739 fprintf(fp, "old\n");
3744 ${cf_cv_main_return-return}(0);
3747 if { (eval echo configure:3748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3750 cf_cv_ncurses_version=`cat $cf_tempfile`
3752 echo "configure: failed program was:" >&5
3753 cat conftest.$ac_ext >&5
3762 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
3763 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
3771 cf_nculib_root=ncurses
3772 # This works, except for the special case where we find gpm, but
3773 # ncurses is in a nonstandard location via $LIBS, and we really want
3776 cf_ncurses_SAVE="$LIBS"
3777 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
3778 echo "configure:3779: checking for Gpm_Open in -lgpm" >&5
3779 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
3780 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3781 echo $ac_n "(cached) $ac_c" 1>&6
3783 ac_save_LIBS="$LIBS"
3785 cat > conftest.$ac_ext <<EOF
3786 #line 3787 "configure"
3787 #include "confdefs.h"
3788 /* Override any gcc2 internal prototype to avoid an error. */
3789 /* We use char because int might match the return type of a gcc2
3790 builtin and then its argument prototype would still apply. */
3797 if { (eval echo configure:3798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3799 eval "ac_cv_lib_$ac_lib_var=yes"
3801 echo "configure: failed program was:" >&5
3802 cat conftest.$ac_ext >&5
3804 eval "ac_cv_lib_$ac_lib_var=no"
3807 LIBS="$ac_save_LIBS"
3810 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3811 echo "$ac_t""yes" 1>&6
3812 echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
3813 echo "configure:3814: checking for initscr in -lgpm" >&5
3814 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
3815 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3816 echo $ac_n "(cached) $ac_c" 1>&6
3818 ac_save_LIBS="$LIBS"
3820 cat > conftest.$ac_ext <<EOF
3821 #line 3822 "configure"
3822 #include "confdefs.h"
3823 /* Override any gcc2 internal prototype to avoid an error. */
3824 /* We use char because int might match the return type of a gcc2
3825 builtin and then its argument prototype would still apply. */
3832 if { (eval echo configure:3833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3834 eval "ac_cv_lib_$ac_lib_var=yes"
3836 echo "configure: failed program was:" >&5
3837 cat conftest.$ac_ext >&5
3839 eval "ac_cv_lib_$ac_lib_var=no"
3842 LIBS="$ac_save_LIBS"
3845 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3846 echo "$ac_t""yes" 1>&6
3847 LIBS="$cf_ncurses_SAVE"
3849 echo "$ac_t""no" 1>&6
3850 cf_ncurses_LIBS="-lgpm"
3854 echo "$ac_t""no" 1>&6
3858 case $host_os in #(vi
3860 # This is only necessary if you are linking against an obsolete
3861 # version of ncurses (but it should do no harm, since it's static).
3862 if test "$cf_nculib_root" = ncurses ; then
3863 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
3864 echo "configure:3865: checking for tgoto in -lmytinfo" >&5
3865 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
3866 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3867 echo $ac_n "(cached) $ac_c" 1>&6
3869 ac_save_LIBS="$LIBS"
3870 LIBS="-lmytinfo $LIBS"
3871 cat > conftest.$ac_ext <<EOF
3872 #line 3873 "configure"
3873 #include "confdefs.h"
3874 /* Override any gcc2 internal prototype to avoid an error. */
3875 /* We use char because int might match the return type of a gcc2
3876 builtin and then its argument prototype would still apply. */
3883 if { (eval echo configure:3884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3885 eval "ac_cv_lib_$ac_lib_var=yes"
3887 echo "configure: failed program was:" >&5
3888 cat conftest.$ac_ext >&5
3890 eval "ac_cv_lib_$ac_lib_var=no"
3893 LIBS="$ac_save_LIBS"
3896 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3897 echo "$ac_t""yes" 1>&6
3898 cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
3900 echo "$ac_t""no" 1>&6
3907 LIBS="$cf_ncurses_LIBS $LIBS"
3909 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3912 if test -n "$cf_cv_curses_dir/lib" ; then
3913 for cf_add_libdir in $cf_cv_curses_dir/lib
3915 if test $cf_add_libdir = /usr/lib ; then
3917 elif test -d $cf_add_libdir
3920 if test -n "$LDFLAGS$LIBS" ; then
3921 # a loop is needed to ensure we can add subdirs of existing dirs
3922 for cf_test_libdir in $LDFLAGS $LIBS ; do
3923 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3924 cf_have_libdir=yes; break
3928 if test "$cf_have_libdir" = no ; then
3929 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
3931 echo "${as_me-configure}:3932: testing adding $cf_add_libdir to library-path ..." 1>&5
3934 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3940 LIBS="-l$cf_nculib_root $LIBS"
3943 eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
3945 echo $ac_n "checking for initscr""... $ac_c" 1>&6
3946 echo "configure:3947: checking for initscr" >&5
3947 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
3948 echo $ac_n "(cached) $ac_c" 1>&6
3950 cat > conftest.$ac_ext <<EOF
3951 #line 3952 "configure"
3952 #include "confdefs.h"
3953 /* System header to define __stub macros and hopefully few prototypes,
3954 which can conflict with char initscr(); below. */
3956 /* Override any gcc2 internal prototype to avoid an error. */
3957 /* We use char because int might match the return type of a gcc2
3958 builtin and then its argument prototype would still apply. */
3963 /* The GNU C library defines this for functions which it implements
3964 to always fail with ENOSYS. Some functions are actually named
3965 something starting with __ and the normal name is an alias. */
3966 #if defined (__stub_initscr) || defined (__stub___initscr)
3974 if { (eval echo configure:3975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3976 eval "ac_cv_func_initscr=yes"
3978 echo "configure: failed program was:" >&5
3979 cat conftest.$ac_ext >&5
3981 eval "ac_cv_func_initscr=no"
3986 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
3987 echo "$ac_t""yes" 1>&6
3988 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
3990 echo "$ac_t""no" 1>&6
3992 cf_save_LIBS="$LIBS"
3993 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
3994 echo "configure:3995: checking for initscr in -l$cf_nculib_root" >&5
3995 LIBS="-l$cf_nculib_root $LIBS"
3996 cat > conftest.$ac_ext <<EOF
3997 #line 3998 "configure"
3998 #include "confdefs.h"
3999 #include <${cf_cv_ncurses_header-curses.h}>
4004 if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4006 echo "$ac_t""yes" 1>&6
4007 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4010 echo "configure: failed program was:" >&5
4011 cat conftest.$ac_ext >&5
4013 echo "$ac_t""no" 1>&6
4017 test "/usr" != "$prefix" && \
4019 (test $prefix = NONE || test -d $prefix) && {
4020 test -n "$verbose" && echo " ... testing for lib-directories under /usr"
4021 test -d /usr/lib && cf_search="$cf_search /usr/lib"
4022 test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root"
4023 test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
4024 test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib"
4025 test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
4029 test "$prefix" != "NONE" && \
4030 test -d "$prefix" && \
4032 test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
4033 test -d $prefix/lib && cf_search="$cf_search $prefix/lib"
4034 test -d $prefix/lib/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root"
4035 test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
4036 test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib"
4037 test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
4041 test "/usr/local" != "$prefix" && \
4042 test -d "/usr/local" && \
4043 (test $prefix = NONE || test -d $prefix) && {
4044 test -n "$verbose" && echo " ... testing for lib-directories under /usr/local"
4045 test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib"
4046 test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
4047 test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
4048 test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
4049 test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
4053 test "/opt" != "$prefix" && \
4055 (test $prefix = NONE || test -d $prefix) && {
4056 test -n "$verbose" && echo " ... testing for lib-directories under /opt"
4057 test -d /opt/lib && cf_search="$cf_search /opt/lib"
4058 test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root"
4059 test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
4060 test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib"
4061 test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
4065 test "$HOME" != "$prefix" && \
4066 test -d "$HOME" && \
4067 (test $prefix = NONE || test -d $prefix) && {
4068 test -n "$verbose" && echo " ... testing for lib-directories under $HOME"
4069 test -d $HOME/lib && cf_search="$cf_search $HOME/lib"
4070 test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root"
4071 test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
4072 test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib"
4073 test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
4077 for cf_libdir in $cf_search
4079 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
4080 echo "configure:4081: checking for -l$cf_nculib_root in $cf_libdir" >&5
4081 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
4082 cat > conftest.$ac_ext <<EOF
4083 #line 4084 "configure"
4084 #include "confdefs.h"
4085 #include <${cf_cv_ncurses_header-curses.h}>
4090 if { (eval echo configure:4091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4092 echo "$ac_t""yes" 1>&6
4093 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4096 echo "configure: failed program was:" >&5
4097 cat conftest.$ac_ext >&5
4099 echo "$ac_t""no" 1>&6
4100 LIBS="$cf_save_LIBS"
4110 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
4112 if test $cf_found_library = no ; then
4113 { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
4119 if test -n "$cf_ncurses_LIBS" ; then
4120 echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
4121 echo "configure:4122: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
4122 cf_ncurses_SAVE="$LIBS"
4123 for p in $cf_ncurses_LIBS ; do
4124 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
4125 if test "$q" != "$LIBS" ; then
4129 cat > conftest.$ac_ext <<EOF
4130 #line 4131 "configure"
4131 #include "confdefs.h"
4132 #include <${cf_cv_ncurses_header-curses.h}>
4134 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4137 if { (eval echo configure:4138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4139 echo "$ac_t""yes" 1>&6
4141 echo "configure: failed program was:" >&5
4142 cat conftest.$ac_ext >&5
4144 echo "$ac_t""no" 1>&6
4145 LIBS="$cf_ncurses_SAVE"
4151 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4153 cat >> confdefs.h <<EOF
4154 #define $cf_nculib_ROOT 1
4162 echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6
4163 echo "configure:4164: checking for multibyte character support" >&5
4164 if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then
4165 echo $ac_n "(cached) $ac_c" 1>&6
4168 cf_save_LIBS="$LIBS"
4169 cat > conftest.$ac_ext <<EOF
4170 #line 4171 "configure"
4171 #include "confdefs.h"
4178 if { (eval echo configure:4179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4182 echo "configure: failed program was:" >&5
4183 cat conftest.$ac_ext >&5
4186 cat > conftest.$ac_ext <<EOF
4187 #line 4188 "configure"
4188 #include "confdefs.h"
4190 #include <libutf8.h>
4195 if { (eval echo configure:4196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4197 cf_cv_utf8_lib=add-on
4199 echo "configure: failed program was:" >&5
4200 cat conftest.$ac_ext >&5
4205 LIBS="$cf_save_LIBS"
4211 echo "$ac_t""$cf_cv_utf8_lib" 1>&6
4213 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4215 if test "$cf_cv_utf8_lib" = "add-on" ; then
4216 cat >> confdefs.h <<\EOF
4217 #define HAVE_LIBUTF8_H 1
4225 cf_ncuhdr_root=ncursesw
4227 test -n "$cf_cv_curses_dir" && \
4228 test "$cf_cv_curses_dir" != "no" && { \
4230 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4231 for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
4233 while test $cf_add_incdir != /usr/include
4235 if test -d $cf_add_incdir
4238 if test -n "$CFLAGS$CPPFLAGS" ; then
4239 # a loop is needed to ensure we can add subdirs of existing dirs
4240 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4241 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4242 cf_have_incdir=yes; break
4247 if test "$cf_have_incdir" = no ; then
4248 if test "$cf_add_incdir" = /usr/local/include ; then
4249 if test "$GCC" = yes
4251 cf_save_CPPFLAGS=$CPPFLAGS
4252 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4253 cat > conftest.$ac_ext <<EOF
4254 #line 4255 "configure"
4255 #include "confdefs.h"
4261 if { (eval echo configure:4262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4264 echo "configure: failed program was:" >&5
4265 cat conftest.$ac_ext >&5
4270 CPPFLAGS=$cf_save_CPPFLAGS
4275 if test "$cf_have_incdir" = no ; then
4276 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
4278 echo "${as_me-configure}:4279: testing adding $cf_add_incdir to include-path ..." 1>&5
4281 CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
4283 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4284 test "$cf_top_incdir" = "$cf_add_incdir" && break
4285 cf_add_incdir="$cf_top_incdir"
4296 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
4297 echo "configure:4298: checking for $cf_ncuhdr_root header in include-path" >&5
4298 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
4299 echo $ac_n "(cached) $ac_c" 1>&6
4302 cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4303 ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4304 for cf_header in $cf_header_list
4307 cat > conftest.$ac_ext <<EOF
4308 #line 4309 "configure"
4309 #include "confdefs.h"
4312 #define _XOPEN_SOURCE_EXTENDED
4313 #undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */
4314 #define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */
4316 #include <$cf_header>
4319 #ifdef NCURSES_VERSION
4325 printf("%s\n", NCURSES_VERSION);
4337 if { (eval echo configure:4338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4339 cf_cv_ncurses_h=$cf_header
4342 echo "configure: failed program was:" >&5
4343 cat conftest.$ac_ext >&5
4349 test "$cf_cv_ncurses_h" != no && break
4354 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
4358 if test "$cf_cv_ncurses_h" != no ; then
4359 cf_cv_ncurses_header=$cf_cv_ncurses_h
4362 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
4363 echo "configure:4364: checking for $cf_ncuhdr_root include-path" >&5
4364 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
4365 echo $ac_n "(cached) $ac_c" 1>&6
4368 test -n "$verbose" && echo
4372 test "/usr" != "$prefix" && \
4374 (test $prefix = NONE || test -d $prefix) && {
4375 test -n "$verbose" && echo " ... testing for include-directories under /usr"
4376 test -d /usr/include && cf_search="$cf_search /usr/include"
4377 test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
4378 test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
4379 test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
4380 test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4384 test "$prefix" != "NONE" && \
4385 test -d "$prefix" && \
4387 test -n "$verbose" && echo " ... testing for include-directories under $prefix"
4388 test -d $prefix/include && cf_search="$cf_search $prefix/include"
4389 test -d $prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4390 test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4391 test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4392 test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4396 test "/usr/local" != "$prefix" && \
4397 test -d "/usr/local" && \
4398 (test $prefix = NONE || test -d $prefix) && {
4399 test -n "$verbose" && echo " ... testing for include-directories under /usr/local"
4400 test -d /usr/local/include && cf_search="$cf_search /usr/local/include"
4401 test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
4402 test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
4403 test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
4404 test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4408 test "/opt" != "$prefix" && \
4410 (test $prefix = NONE || test -d $prefix) && {
4411 test -n "$verbose" && echo " ... testing for include-directories under /opt"
4412 test -d /opt/include && cf_search="$cf_search /opt/include"
4413 test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
4414 test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
4415 test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
4416 test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4420 test "$HOME" != "$prefix" && \
4421 test -d "$HOME" && \
4422 (test $prefix = NONE || test -d $prefix) && {
4423 test -n "$verbose" && echo " ... testing for include-directories under $HOME"
4424 test -d $HOME/include && cf_search="$cf_search $HOME/include"
4425 test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
4426 test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
4427 test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
4428 test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4432 test "$includedir" != NONE && \
4433 test "$includedir" != "/usr/include" && \
4434 test -d "$includedir" && {
4435 test -d $includedir && cf_search="$cf_search $includedir"
4436 test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4439 test "$oldincludedir" != NONE && \
4440 test "$oldincludedir" != "/usr/include" && \
4441 test -d "$oldincludedir" && {
4442 test -d $oldincludedir && cf_search="$cf_search $oldincludedir"
4443 test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4447 test -n "$verbose" && echo search path $cf_search
4448 cf_save2_CPPFLAGS="$CPPFLAGS"
4449 for cf_incdir in $cf_search
4452 if test -n "$cf_incdir" ; then
4453 for cf_add_incdir in $cf_incdir
4455 while test $cf_add_incdir != /usr/include
4457 if test -d $cf_add_incdir
4460 if test -n "$CFLAGS$CPPFLAGS" ; then
4461 # a loop is needed to ensure we can add subdirs of existing dirs
4462 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4463 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4464 cf_have_incdir=yes; break
4469 if test "$cf_have_incdir" = no ; then
4470 if test "$cf_add_incdir" = /usr/local/include ; then
4471 if test "$GCC" = yes
4473 cf_save_CPPFLAGS=$CPPFLAGS
4474 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4475 cat > conftest.$ac_ext <<EOF
4476 #line 4477 "configure"
4477 #include "confdefs.h"
4483 if { (eval echo configure:4484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4486 echo "configure: failed program was:" >&5
4487 cat conftest.$ac_ext >&5
4492 CPPFLAGS=$cf_save_CPPFLAGS
4497 if test "$cf_have_incdir" = no ; then
4498 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
4500 echo "${as_me-configure}:4501: testing adding $cf_add_incdir to include-path ..." 1>&5
4503 CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
4505 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4506 test "$cf_top_incdir" = "$cf_add_incdir" && break
4507 cf_add_incdir="$cf_top_incdir"
4521 cat > conftest.$ac_ext <<EOF
4522 #line 4523 "configure"
4523 #include "confdefs.h"
4526 #include <$cf_header>
4529 #ifdef NCURSES_VERSION
4531 printf("%s\n", NCURSES_VERSION);
4543 if { (eval echo configure:4544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4545 cf_cv_ncurses_h2=$cf_header
4548 echo "configure: failed program was:" >&5
4549 cat conftest.$ac_ext >&5
4555 if test "$cf_cv_ncurses_h2" != no ; then
4556 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4557 test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6
4560 test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6
4562 CPPFLAGS="$cf_save2_CPPFLAGS"
4563 test "$cf_cv_ncurses_h2" != no && break
4565 test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
4569 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
4571 cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4572 cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4573 if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4574 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4577 if test -n "$cf_1st_incdir" ; then
4578 for cf_add_incdir in $cf_1st_incdir
4580 while test $cf_add_incdir != /usr/include
4582 if test -d $cf_add_incdir
4585 if test -n "$CFLAGS$CPPFLAGS" ; then
4586 # a loop is needed to ensure we can add subdirs of existing dirs
4587 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4588 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4589 cf_have_incdir=yes; break
4594 if test "$cf_have_incdir" = no ; then
4595 if test "$cf_add_incdir" = /usr/local/include ; then
4596 if test "$GCC" = yes
4598 cf_save_CPPFLAGS=$CPPFLAGS
4599 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4600 cat > conftest.$ac_ext <<EOF
4601 #line 4602 "configure"
4602 #include "confdefs.h"
4608 if { (eval echo configure:4609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4611 echo "configure: failed program was:" >&5
4612 cat conftest.$ac_ext >&5
4617 CPPFLAGS=$cf_save_CPPFLAGS
4622 if test "$cf_have_incdir" = no ; then
4623 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
4625 echo "${as_me-configure}:4626: testing adding $cf_add_incdir to include-path ..." 1>&5
4628 CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
4630 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4631 test "$cf_top_incdir" = "$cf_add_incdir" && break
4632 cf_add_incdir="$cf_top_incdir"
4644 # Set definitions to allow ifdef'ing for ncurses.h
4646 case $cf_cv_ncurses_header in # (vi
4648 cat >> confdefs.h <<\EOF
4649 #define HAVE_NCURSES_H 1