From 4ae6d1c18d0dec956b814865893812655ec3a22c Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 10 Feb 2008 00:41:46 +0000 Subject: [PATCH 1/1] ncurses 5.6 - patch 20080209 + update test programs to build/work with various UNIX curses for comparisons. This was to reinvestigate statement in X/Open curses that insnstr and winsnstr perform wrapping. None of the Unix-branded implementations do this, as noted in manpage (cf: 20040228). --- NEWS | 8 +- dist.mk | 4 +- include/ncurses_defs | 7 +- test/aclocal.m4 | 500 ++++++++---- test/chgat.c | 6 +- test/color_set.c | 6 +- test/configure | 1783 ++++++++++++++++++++++++++++-------------- test/configure.in | 12 +- test/demo_menus.c | 19 +- test/demo_panels.c | 6 +- test/demo_termcap.c | 10 +- test/dots.c | 6 +- test/dots_mvcur.c | 6 +- test/key_names.c | 6 +- test/movewindow.c | 22 +- test/ncurses.c | 14 +- test/newdemo.c | 4 +- test/railroad.c | 6 +- test/test.priv.h | 92 ++- test/test_arrays.c | 15 +- test/test_getstr.c | 16 +- 21 files changed, 1713 insertions(+), 835 deletions(-) diff --git a/NEWS b/NEWS index 16c55d06..d71eaf8a 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1204 2008/02/03 20:34:02 tom Exp $ +-- $Id: NEWS,v 1.1206 2008/02/09 23:49:39 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,12 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20080209 + + update test programs to build/work with various UNIX curses for + comparisons. This was to reinvestigate statement in X/Open curses + that insnstr and winsnstr perform wrapping. None of the Unix-branded + implementations do this, as noted in manpage (cf: 20040228). + 20080203 + modify _nc_setupscreen() to set the legacy-coding value the same for both narrow/wide models. It had been set only for wide model, diff --git a/dist.mk b/dist.mk index 6c2b86fa..0141b05e 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.628 2008/02/03 14:36:09 tom Exp $ +# $Id: dist.mk,v 1.629 2008/02/09 15:32:57 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 NCURSES_MINOR = 6 -NCURSES_PATCH = 20080203 +NCURSES_PATCH = 20080209 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/ncurses_defs b/include/ncurses_defs index cc6b9fe8..924c75eb 100644 --- a/include/ncurses_defs +++ b/include/ncurses_defs @@ -1,6 +1,6 @@ -# $Id: ncurses_defs,v 1.35 2007/10/06 21:18:16 tom Exp $ +# $Id: ncurses_defs,v 1.38 2008/02/10 00:12:03 tom Exp $ ############################################################################## -# Copyright (c) 2000-2006,2007 Free Software Foundation, Inc. # +# Copyright (c) 2000-2007,2008 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -46,6 +46,8 @@ HAVE_BSD_CGETENT HAVE_BSD_SIGNAL_H HAVE_BTOWC HAVE_BUILTIN_H +HAVE_CHGAT 1 +HAVE_COLOR_SET 1 HAVE_DIRENT_H HAVE_ERRNO HAVE_FCNTL_H @@ -58,6 +60,7 @@ HAVE_GETEGID HAVE_GETEUID HAVE_GETMAXX 1 HAVE_GETNSTR +HAVE_GETPARX 1 HAVE_GETOPT_H HAVE_GETTIMEOFDAY HAVE_GETTTYNAM diff --git a/test/aclocal.m4 b/test/aclocal.m4 index 464da3a3..afc50fea 100644 --- a/test/aclocal.m4 +++ b/test/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 2003-2005,2006 Free Software Foundation, Inc. * +dnl Copyright (c) 2003-2007,2008 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl -dnl $Id: aclocal.m4,v 1.19 2007/06/09 20:01:31 tom Exp $ +dnl $Id: aclocal.m4,v 1.22 2008/02/09 18:22:17 tom Exp $ dnl dnl Author: Thomas E. Dickey dnl @@ -122,42 +122,119 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 4 updated: 2002/12/21 14:25:52 +dnl CF_ADD_INCDIR version: 9 updated: 2008/02/09 13:15:34 dnl ------------- dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's dnl redundant. We don't normally need to add -I/usr/local/include for gcc, dnl but old versions (and some misinstalled ones) need that. To make things -dnl worse, gcc 3.x gives error messages if -I/usr/local/include is added to +dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to dnl the include-path). AC_DEFUN([CF_ADD_INCDIR], [ -for cf_add_incdir in $1 -do - while true +if test -n "$1" ; then + for cf_add_incdir in $1 + do + while test $cf_add_incdir != /usr/include do - case $cf_add_incdir in - /usr/include) # (vi - ;; - /usr/local/include) # (vi + if test -d $cf_add_incdir + then + cf_have_incdir=no + if test -n "$CFLAGS$CPPFLAGS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_incdir in $CFLAGS $CPPFLAGS ; do + if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then + cf_have_incdir=yes; break + fi + done + fi + + if test "$cf_have_incdir" = no ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then - cf_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - AC_TRY_COMPILE([#include ], - [printf("Hello")], - [], - [CPPFLAGS="$cf_save_CPPFLAGS"]) + cf_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + AC_TRY_COMPILE([#include ], + [printf("Hello")], + [], + [cf_have_incdir=yes]) + CPPFLAGS=$cf_save_CPPFLAGS fi - ;; - *) # (vi - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - ;; - esac - cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` - test "$cf_top_incdir" = "$cf_add_incdir" && break - cf_add_incdir="$cf_top_incdir" + fi + fi + + if test "$cf_have_incdir" = no ; then + CF_VERBOSE(adding $cf_add_incdir to include-path) + ifelse($2,,CPPFLAGS,$2)="-I$cf_add_incdir $ifelse($2,,CPPFLAGS,[$]$2)" + + cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + test "$cf_top_incdir" = "$cf_add_incdir" && break + cf_add_incdir="$cf_top_incdir" + else + break + fi + fi done -done + done +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_LIBDIR version: 6 updated: 2008/02/09 13:15:34 +dnl ------------- +dnl Adds to the library-path +dnl +dnl Some machines have trouble with multiple -L options. +dnl +dnl $1 is the (list of) directory(s) to add +dnl $2 is the optional name of the variable to update (default LDFLAGS) +dnl +AC_DEFUN([CF_ADD_LIBDIR], +[ +if test -n "$1" ; then + for cf_add_libdir in $1 + do + if test $cf_add_libdir = /usr/lib ; then + : + elif test -d $cf_add_libdir + then + cf_have_libdir=no + if test -n "$LDFLAGS$LIBS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_libdir in $LDFLAGS $LIBS ; do + if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then + cf_have_libdir=yes; break + fi + done + fi + if test "$cf_have_libdir" = no ; then + CF_VERBOSE(adding $cf_add_libdir to library-path) + ifelse($2,,LDFLAGS,$2)="-L$cf_add_libdir $ifelse($2,,LDFLAGS,[$]$2)" + fi + fi + done +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_SUBDIR_PATH version: 2 updated: 2007/07/29 10:12:59 +dnl ------------------ +dnl Append to a search-list for a nonstandard header/lib-file +dnl $1 = the variable to return as result +dnl $2 = the package name +dnl $3 = the subdirectory, e.g., bin, include or lib +dnl $4 = the directory under which we will test for subdirectories +dnl $5 = a directory that we do not want $4 to match +AC_DEFUN([CF_ADD_SUBDIR_PATH], +[ +test "$4" != "$5" && \ +test -d "$4" && \ +ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) { + test -n "$verbose" && echo " ... testing for $3-directories under $4" + test -d $4/$3 && $1="[$]$1 $4/$3" + test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" + test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3" + test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3" + test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2" +} ])dnl dnl --------------------------------------------------------------------------- dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34 @@ -389,6 +466,60 @@ CF_CURSES_HEADER CF_TERM_HEADER ])dnl dnl --------------------------------------------------------------------------- +dnl CF_CURSES_FUNCS version: 13 updated: 2007/04/28 09:15:55 +dnl --------------- +dnl Curses-functions are a little complicated, since a lot of them are macros. +AC_DEFUN([CF_CURSES_FUNCS], +[ +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl +AC_REQUIRE([CF_XOPEN_CURSES]) +AC_REQUIRE([CF_CURSES_TERM_H]) +for cf_func in $1 +do + CF_UPPER(cf_tr_func,$cf_func) + AC_MSG_CHECKING(for ${cf_func}) + CF_MSG_LOG(${cf_func}) + AC_CACHE_VAL(cf_cv_func_$cf_func,[ + eval cf_result='$ac_cv_func_'$cf_func + if test ".$cf_result" != ".no"; then + AC_TRY_LINK([ +#ifdef HAVE_XCURSES +#include +char * XCursesProgramName = "test"; +#else +#include <${cf_cv_ncurses_header-curses.h}> +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) +#include +#else +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) +#include +#else +#ifdef HAVE_TERM_H +#include +#endif +#endif +#endif +#endif], + [ +#ifndef ${cf_func} +long foo = (long)(&${cf_func}); +${cf_cv_main_return-return}(foo == 0); +#endif + ], + [cf_result=yes], + [cf_result=no]) + fi + eval 'cf_cv_func_'$cf_func'=$cf_result' + ]) + # use the computed/retrieved cache-value: + eval 'cf_result=$cf_cv_func_'$cf_func + AC_MSG_RESULT($cf_result) + if test $cf_result != no; then + AC_DEFINE_UNQUOTED(HAVE_${cf_tr_func}) + fi +done +])dnl +dnl --------------------------------------------------------------------------- dnl CF_CURSES_HEADER version: 1 updated: 2005/12/31 13:28:25 dnl ---------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common @@ -418,7 +549,7 @@ fi AC_CHECK_HEADERS($cf_cv_ncurses_header) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CURSES_LIBS version: 24 updated: 2006/02/04 19:44:43 +dnl CF_CURSES_LIBS version: 26 updated: 2007/07/29 10:32:40 dnl -------------- dnl Look for the curses libraries. Older curses implementations may require dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first. @@ -427,95 +558,137 @@ AC_DEFUN([CF_CURSES_LIBS],[ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_MSG_CHECKING(if we have identified curses libraries) AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], - [initscr(); tgoto("?", 0,0)], - cf_result=yes, - cf_result=no) + [initscr(); tgoto("?", 0,0)], + cf_result=yes, + cf_result=no) AC_MSG_RESULT($cf_result) if test "$cf_result" = no ; then case $host_os in #(vi freebsd*) #(vi - AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"]) - ;; + AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"]) + ;; hpux10.*) #(vi - AC_CHECK_LIB(cur_colr,initscr,[ - LIBS="-lcur_colr $LIBS" - ac_cv_func_initscr=yes - ],[ - AC_CHECK_LIB(Hcurses,initscr,[ - # HP's header uses __HP_CURSES, but user claims _HP_CURSES. - LIBS="-lHcurses $LIBS" - CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS" - ac_cv_func_initscr=yes - ])]) - ;; + AC_CHECK_LIB(cur_colr,initscr,[ + LIBS="-lcur_colr $LIBS" + ac_cv_func_initscr=yes + ],[ + AC_CHECK_LIB(Hcurses,initscr,[ + # HP's header uses __HP_CURSES, but user claims _HP_CURSES. + LIBS="-lHcurses $LIBS" + CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS" + ac_cv_func_initscr=yes + ])]) + ;; linux*) # Suse Linux does not follow /usr/lib convention - LIBS="$LIBS -L/lib" - ;; + CF_ADD_LIBDIR(/lib) + ;; sunos3*|sunos4*) - test -d /usr/5lib && \ - LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap" - ac_cv_func_initscr=yes - ;; + if test -d /usr/5lib ; then + CF_ADD_LIBDIR(/usr/5lib) + LIBS="$LIBS -lcurses -ltermcap" + fi + ac_cv_func_initscr=yes + ;; esac if test ".$ac_cv_func_initscr" != .yes ; then - cf_save_LIBS="$LIBS" - cf_term_lib="" - cf_curs_lib="" - - if test ".${cf_cv_ncurses_version-no}" != .no - then - cf_check_list="ncurses curses cursesX" - else - cf_check_list="cursesX curses ncurses" - fi - - # Check for library containing tgoto. Do this before curses library - # because it may be needed to link the test-case for initscr. - AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[ - for cf_term_lib in $cf_check_list termcap termlib unknown - do - AC_CHECK_LIB($cf_term_lib,tgoto,[break]) - done - ]) - - # Check for library containing initscr - test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" - for cf_curs_lib in $cf_check_list xcurses jcurses unknown - do - AC_CHECK_LIB($cf_curs_lib,initscr,[break]) - done - test $cf_curs_lib = unknown && AC_ERROR(no curses library found) - - LIBS="-l$cf_curs_lib $cf_save_LIBS" - if test "$cf_term_lib" = unknown ; then - AC_MSG_CHECKING(if we can link with $cf_curs_lib library) - AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], - [initscr()], - [cf_result=yes], - [cf_result=no]) - AC_MSG_RESULT($cf_result) - test $cf_result = no && AC_ERROR(Cannot link curses library) - elif test "$cf_curs_lib" = "$cf_term_lib" ; then - : - elif test "$cf_term_lib" != predefined ; then - AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries) - AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], - [initscr(); tgoto((char *)0, 0, 0);], - [cf_result=no], - [ - LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" - AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], - [initscr()], - [cf_result=yes], - [cf_result=error]) - ]) - AC_MSG_RESULT($cf_result) - fi + cf_save_LIBS="$LIBS" + cf_term_lib="" + cf_curs_lib="" + + if test ".${cf_cv_ncurses_version-no}" != .no + then + cf_check_list="ncurses curses cursesX" + else + cf_check_list="cursesX curses ncurses" + fi + + # Check for library containing tgoto. Do this before curses library + # because it may be needed to link the test-case for initscr. + AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[ + for cf_term_lib in $cf_check_list termcap termlib unknown + do + AC_CHECK_LIB($cf_term_lib,tgoto,[break]) + done + ]) + + # Check for library containing initscr + test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" + for cf_curs_lib in $cf_check_list xcurses jcurses unknown + do + AC_CHECK_LIB($cf_curs_lib,initscr,[break]) + done + test $cf_curs_lib = unknown && AC_ERROR(no curses library found) + + LIBS="-l$cf_curs_lib $cf_save_LIBS" + if test "$cf_term_lib" = unknown ; then + AC_MSG_CHECKING(if we can link with $cf_curs_lib library) + AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], + [initscr()], + [cf_result=yes], + [cf_result=no]) + AC_MSG_RESULT($cf_result) + test $cf_result = no && AC_ERROR(Cannot link curses library) + elif test "$cf_curs_lib" = "$cf_term_lib" ; then + : + elif test "$cf_term_lib" != predefined ; then + AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries) + AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], + [initscr(); tgoto((char *)0, 0, 0);], + [cf_result=no], + [ + LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" + AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], + [initscr()], + [cf_result=yes], + [cf_result=error]) + ]) + AC_MSG_RESULT($cf_result) + fi fi fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_TERM_H version: 6 updated: 2003/11/06 19:59:57 +dnl ---------------- +dnl SVr4 curses should have term.h as well (where it puts the definitions of +dnl the low-level interface). This may not be true in old/broken implementations, +dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4 +dnl running with Solaris 2.5.1). +AC_DEFUN([CF_CURSES_TERM_H], +[ +AC_CACHE_CHECK(for term.h, cf_cv_term_header,[ + +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl +# If we found , look for , but always look +# for if we do not find the variant. +for cf_header in \ + `echo ${cf_cv_ncurses_header-curses.h} | sed -e 's%/.*%/%'`term.h \ + term.h +do + AC_TRY_COMPILE([ +#include <${cf_cv_ncurses_header-curses.h}> +#include <${cf_header}>], + [WINDOW *x], + [cf_cv_term_header=$cf_header + break], + [cf_cv_term_header=no]) +done +]) + +case $cf_cv_term_header in #(vi +term.h) #(vi + AC_DEFINE(HAVE_TERM_H) + ;; +ncurses/term.h) + AC_DEFINE(HAVE_NCURSES_TERM_H) + ;; +ncursesw/term.h) + AC_DEFINE(HAVE_NCURSESW_TERM_H) + ;; +esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_WACS_MAP version: 3 updated: 2003/05/17 22:19:02 @@ -671,7 +844,7 @@ rm -f core]) test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION) ]) dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 10 updated: 2005/05/28 13:16:28 +dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -698,7 +871,7 @@ if test "$GCC" = yes then AC_CHECKING([for $CC __attribute__ directives]) cat > conftest.$ac_ext < conftest.$ac_ext <&AC_FD_CC +echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_CC_CHECK version: 3 updated: 2003/01/12 18:59:28 +dnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05 dnl ------------------- dnl Check if we can compile with ncurses' header file dnl $1 is the cache variable to set @@ -1010,11 +1183,11 @@ printf("old\n"); #endif #endif ] - ,[$1=$cf_header] + ,[$1=$2] ,[$1=no]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_CPPFLAGS version: 18 updated: 2005/12/31 13:26:39 +dnl CF_NCURSES_CPPFLAGS version: 19 updated: 2007/07/29 13:35:20 dnl ------------------- dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting dnl the CPPFLAGS variable so we can include its header. @@ -1042,8 +1215,9 @@ AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl cf_ncuhdr_root=ifelse($1,,ncurses,$1) test -n "$cf_cv_curses_dir" && \ -test "$cf_cv_curses_dir" != "no" && \ -CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS" +test "$cf_cv_curses_dir" != "no" && { \ + CF_ADD_INCDIR($cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root) +} AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[ cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" @@ -1130,7 +1304,7 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_LIBS version: 12 updated: 2004/04/27 16:26:05 +dnl CF_NCURSES_LIBS version: 13 updated: 2007/07/29 10:29:20 dnl --------------- dnl Look for the ncurses library. This is a little complicated on Linux, dnl because it may be linked with the gpm (general purpose mouse) library. @@ -1170,7 +1344,8 @@ LIBS="$cf_ncurses_LIBS $LIBS" if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then - LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS" + CF_ADD_LIBDIR($cf_cv_curses_dir/lib) + LIBS="-l$cf_nculib_root $LIBS" else CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root, [#include <${cf_cv_ncurses_header-curses.h}>], @@ -1520,7 +1695,7 @@ AC_MSG_RESULT($cf_cv_sig_atomic_t) test "$cf_cv_sig_atomic_t" != no && AC_DEFINE_UNQUOTED(SIG_ATOMIC_T, $cf_cv_sig_atomic_t) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SUBDIR_PATH version: 4 updated: 2006/11/18 17:13:19 +dnl CF_SUBDIR_PATH version: 5 updated: 2007/07/29 09:55:12 dnl -------------- dnl Construct a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result @@ -1529,59 +1704,11 @@ dnl $3 = the subdirectory, e.g., bin, include or lib AC_DEFUN([CF_SUBDIR_PATH], [$1="" -test -d "[$]HOME" && { - test -n "$verbose" && echo " ... testing $3-directories under [$]HOME" - test -d "[$]HOME/$3" && $1="[$]$1 [$]HOME/$3" - test -d "[$]HOME/$3/$2" && $1="[$]$1 [$]HOME/$3/$2" - test -d "[$]HOME/$3/$2/$3" && $1="[$]$1 [$]HOME/$3/$2/$3" -} - -# For other stuff under the home directory, it should be sufficient to put -# a symbolic link for $HOME/$2 to the actual package location: -test -d "[$]HOME/$2" && { - test -n "$verbose" && echo " ... testing $3-directories under [$]HOME/$2" - test -d "[$]HOME/$2/$3" && $1="[$]$1 [$]HOME/$2/$3" - test -d "[$]HOME/$2/$3/$2" && $1="[$]$1 [$]HOME/$2/$3/$2" -} - -test "$prefix" != /usr/local && \ -test -d /usr/local && { - test -n "$verbose" && echo " ... testing $3-directories under /usr/local" - test -d /usr/local/$3 && $1="[$]$1 /usr/local/$3" - test -d /usr/local/$3/$2 && $1="[$]$1 /usr/local/$3/$2" - test -d /usr/local/$3/$2/$3 && $1="[$]$1 /usr/local/$3/$2/$3" - test -d /usr/local/$2/$3 && $1="[$]$1 /usr/local/$2/$3" - test -d /usr/local/$2/$3/$2 && $1="[$]$1 /usr/local/$2/$3/$2" -} - -test "$prefix" != NONE && \ -test -d $prefix && { - test -n "$verbose" && echo " ... testing $3-directories under $prefix" - test -d $prefix/$3 && $1="[$]$1 $prefix/$3" - test -d $prefix/$3/$2 && $1="[$]$1 $prefix/$3/$2" - test -d $prefix/$3/$2/$3 && $1="[$]$1 $prefix/$3/$2/$3" - test -d $prefix/$2/$3 && $1="[$]$1 $prefix/$2/$3" - test -d $prefix/$2/$3/$2 && $1="[$]$1 $prefix/$2/$3/$2" -} - -test "$prefix" != /opt && \ -test -d /opt && { - test -n "$verbose" && echo " ... testing $3-directories under /opt" - test -d /opt/$3 && $1="[$]$1 /opt/$3" - test -d /opt/$3/$2 && $1="[$]$1 /opt/$3/$2" - test -d /opt/$3/$2/$3 && $1="[$]$1 /opt/$3/$2/$3" - test -d /opt/$2/$3 && $1="[$]$1 /opt/$2/$3" - test -d /opt/$2/$3/$2 && $1="[$]$1 /opt/$2/$3/$2" -} - -test "$prefix" != /usr && \ -test -d /usr && { - test -n "$verbose" && echo " ... testing $3-directories under /usr" - test -d /usr/$3 && $1="[$]$1 /usr/$3" - test -d /usr/$3/$2 && $1="[$]$1 /usr/$3/$2" - test -d /usr/$3/$2/$3 && $1="[$]$1 /usr/$3/$2/$3" - test -d /usr/$2/$3 && $1="[$]$1 /usr/$2/$3" -} +CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) +CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) +CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix) +CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix) +CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SYS_TIME_SELECT version: 4 updated: 2000/10/04 09:18:40 @@ -1689,11 +1816,12 @@ if test "$cf_cv_utf8_lib" = "add-on" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_VERBOSE version: 2 updated: 1997/09/05 10:45:14 +dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings AC_DEFUN([CF_VERBOSE], [test -n "$verbose" && echo " $1" 1>&AC_FD_MSG +CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_CURSES_DIR version: 2 updated: 2002/11/10 14:46:59 @@ -1708,6 +1836,36 @@ AC_ARG_WITH(curses-dir, [cf_cv_curses_dir=no]) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_XOPEN_CURSES version: 8 updated: 2003/11/07 19:47:46 +dnl --------------- +dnl Test if we should define X/Open source for curses, needed on Digital Unix +dnl 4.x, to see the extended functions, but breaks on IRIX 6.x. +dnl +dnl The getbegyx() check is needed for HPUX, which omits legacy macros such +dnl as getbegy(). The latter is better design, but the former is standard. +AC_DEFUN([CF_XOPEN_CURSES], +[ +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl +AC_CACHE_CHECK(if we must define _XOPEN_SOURCE_EXTENDED,cf_cv_need_xopen_extension,[ +AC_TRY_LINK([ +#include +#include <${cf_cv_ncurses_header-curses.h}>],[ + long x = winnstr(stdscr, "", 0); + int x1, y1; + getbegyx(stdscr, y1, x1)], + [cf_cv_need_xopen_extension=no], + [AC_TRY_LINK([ +#define _XOPEN_SOURCE_EXTENDED +#include +#include <${cf_cv_ncurses_header-curses.h}>],[ + long x = winnstr(stdscr, "", 0); + int x1, y1; + getbegyx(stdscr, y1, x1)], + [cf_cv_need_xopen_extension=yes], + [cf_cv_need_xopen_extension=unknown])])]) +test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" +])dnl +dnl --------------------------------------------------------------------------- dnl CF_XOPEN_SOURCE version: 25 updated: 2007/01/29 18:36:38 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, diff --git a/test/chgat.c b/test/chgat.c index ef9ab676..ee51297d 100644 --- a/test/chgat.c +++ b/test/chgat.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2006-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,14 +26,14 @@ * authorization. * ****************************************************************************/ /* - * $Id: chgat.c,v 1.7 2007/06/30 17:52:17 tom Exp $ + * $Id: chgat.c,v 1.8 2008/02/09 23:19:13 tom Exp $ * * test-driver for chgat/wchgat/mvchgat/mvwchgat */ #include -#ifdef HAVE_CHGAT +#if HAVE_CHGAT #define SHOW(n) ((n) == ERR ? "ERR" : "OK") #define COLOR_DEFAULT (-1) diff --git a/test/color_set.c b/test/color_set.c index 8d8d4b09..2e981cba 100644 --- a/test/color_set.c +++ b/test/color_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2003-2004,2006 Free Software Foundation, Inc. * + * Copyright (c) 2003-2006,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,12 +26,12 @@ * authorization. * ****************************************************************************/ /* - * $Id: color_set.c,v 1.5 2006/06/03 16:40:10 tom Exp $ + * $Id: color_set.c,v 1.6 2008/02/10 00:18:01 tom Exp $ */ #include -#ifdef HAVE_COLOR_SET +#if HAVE_COLOR_SET #define SHOW(n) ((n) == ERR ? "ERR" : "OK") diff --git a/test/configure b/test/configure index ed6c0518..ac9e40a2 100755 --- a/test/configure +++ b/test/configure @@ -1606,7 +1606,7 @@ then echo "checking for $CC __attribute__ directives" 1>&6 echo "configure:1608: checking for $CC __attribute__ directives" >&5 cat > conftest.$ac_ext <&5 +echo "${as_me-configure}:1906: testing if the symbol is already defined go no further ..." 1>&5 cat > conftest.$ac_ext <&5 +echo "${as_me-configure}:1962: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" -echo "(line 1967) testing if the second compile does not leave our definition intact error ..." 1>&5 +echo "${as_me-configure}:1967: testing if the second compile does not leave our definition intact error ..." 1>&5 cat > conftest.$ac_ext < conftest.$ac_ext <&5 cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" - for cf_opt in \ + for cf_opt in \ wd1419 \ wd1682 \ wd1683 \ @@ -2335,6 +2335,9 @@ echo "configure:2309: checking for $CC warning options" >&5 3.3*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 +echo "${as_me-configure}:2339: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 + + continue;; esac ;; @@ -2436,7 +2439,7 @@ curses) echo $ac_n "checking for extra include directories""... $ac_c" 1>&6 -echo "configure:2440: checking for extra include directories" >&5 +echo "configure:2443: checking for extra include directories" >&5 if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2461,7 +2464,7 @@ test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS" echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6 -echo "configure:2465: checking if we have identified curses headers" >&5 +echo "configure:2468: checking if we have identified curses headers" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2474,14 +2477,14 @@ for cf_header in \ ncurses/ncurses.h do cat > conftest.$ac_ext < int main() { initscr(); tgoto("?", 0,0) ; return 0; } EOF -if { (eval echo configure:2485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ncurses_header=$cf_header; break else @@ -2504,17 +2507,17 @@ for ac_hdr in $cf_cv_ncurses_header do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2508: checking for $ac_hdr" >&5 +echo "configure:2511: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2543,7 +2546,7 @@ done echo $ac_n "checking for terminfo header""... $ac_c" 1>&6 -echo "configure:2547: checking for terminfo header" >&5 +echo "configure:2550: checking for terminfo header" >&5 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2560,7 +2563,7 @@ esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat > conftest.$ac_ext < #include <${cf_cv_ncurses_header-curses.h}> @@ -2570,7 +2573,7 @@ int main() { int x = auto_left_margin ; return 0; } EOF -if { (eval echo configure:2574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_term_header="$cf_test" @@ -2619,7 +2622,7 @@ esac echo $ac_n "checking for ncurses version""... $ac_c" 1>&6 -echo "configure:2623: checking for ncurses version" >&5 +echo "configure:2626: checking for ncurses version" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2645,7 +2648,7 @@ Autoconf "old" #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo configure:2649: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } + { (eval echo configure:2652: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" @@ -2654,7 +2657,7 @@ EOF else cat > conftest.$ac_ext < @@ -2678,7 +2681,7 @@ int main() ${cf_cv_main_return-return}(0); } EOF -if { (eval echo configure:2682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_ncurses_version=`cat $cf_tempfile` @@ -2702,16 +2705,16 @@ EOF echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6 -echo "configure:2706: checking if we have identified curses libraries" >&5 +echo "configure:2709: checking if we have identified curses libraries" >&5 cat > conftest.$ac_ext < int main() { initscr(); tgoto("?", 0,0) ; return 0; } EOF -if { (eval echo configure:2715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_result=yes else @@ -2726,8 +2729,8 @@ echo "$ac_t""$cf_result" 1>&6 if test "$cf_result" = no ; then case $host_os in #(vi freebsd*) #(vi - echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6 -echo "configure:2731: checking for tgoto in -lmytinfo" >&5 + echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6 +echo "configure:2734: checking for tgoto in -lmytinfo" >&5 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2735,7 +2738,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmytinfo $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2766,10 +2769,10 @@ else echo "$ac_t""no" 1>&6 fi - ;; + ;; hpux10.*) #(vi - echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6 -echo "configure:2773: checking for initscr in -lcur_colr" >&5 + echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6 +echo "configure:2776: checking for initscr in -lcur_colr" >&5 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2777,7 +2780,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcur_colr $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2804,14 +2807,14 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - LIBS="-lcur_colr $LIBS" - ac_cv_func_initscr=yes - + LIBS="-lcur_colr $LIBS" + ac_cv_func_initscr=yes + else echo "$ac_t""no" 1>&6 - echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6 -echo "configure:2815: checking for initscr in -lHcurses" >&5 + echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6 +echo "configure:2818: checking for initscr in -lHcurses" >&5 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2819,7 +2822,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lHcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2846,49 +2849,107 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - # HP's header uses __HP_CURSES, but user claims _HP_CURSES. - LIBS="-lHcurses $LIBS" - CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS" - ac_cv_func_initscr=yes - + # HP's header uses __HP_CURSES, but user claims _HP_CURSES. + LIBS="-lHcurses $LIBS" + CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS" + ac_cv_func_initscr=yes + else echo "$ac_t""no" 1>&6 fi fi - ;; + ;; linux*) # Suse Linux does not follow /usr/lib convention - LIBS="$LIBS -L/lib" - ;; + +if test -n "/lib" ; then + for cf_add_libdir in /lib + do + if test $cf_add_libdir = /usr/lib ; then + : + elif test -d $cf_add_libdir + then + cf_have_libdir=no + if test -n "$LDFLAGS$LIBS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_libdir in $LDFLAGS $LIBS ; do + if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then + cf_have_libdir=yes; break + fi + done + fi + if test "$cf_have_libdir" = no ; then + test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 + +echo "${as_me-configure}:2886: testing adding $cf_add_libdir to library-path ..." 1>&5 + + + LDFLAGS="-L$cf_add_libdir $LDFLAGS" + fi + fi + done +fi + + ;; sunos3*|sunos4*) - test -d /usr/5lib && \ - LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap" - ac_cv_func_initscr=yes - ;; + if test -d /usr/5lib ; then + +if test -n "/usr/5lib" ; then + for cf_add_libdir in /usr/5lib + do + if test $cf_add_libdir = /usr/lib ; then + : + elif test -d $cf_add_libdir + then + cf_have_libdir=no + if test -n "$LDFLAGS$LIBS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_libdir in $LDFLAGS $LIBS ; do + if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then + cf_have_libdir=yes; break + fi + done + fi + if test "$cf_have_libdir" = no ; then + test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 + +echo "${as_me-configure}:2918: testing adding $cf_add_libdir to library-path ..." 1>&5 + + + LDFLAGS="-L$cf_add_libdir $LDFLAGS" + fi + fi + done +fi + + LIBS="$LIBS -lcurses -ltermcap" + fi + ac_cv_func_initscr=yes + ;; esac if test ".$ac_cv_func_initscr" != .yes ; then - cf_save_LIBS="$LIBS" - cf_term_lib="" - cf_curs_lib="" + cf_save_LIBS="$LIBS" + cf_term_lib="" + cf_curs_lib="" - if test ".${cf_cv_ncurses_version-no}" != .no - then - cf_check_list="ncurses curses cursesX" - else - cf_check_list="cursesX curses ncurses" - fi + if test ".${cf_cv_ncurses_version-no}" != .no + then + cf_check_list="ncurses curses cursesX" + else + cf_check_list="cursesX curses ncurses" + fi - # Check for library containing tgoto. Do this before curses library - # because it may be needed to link the test-case for initscr. - echo $ac_n "checking for tgoto""... $ac_c" 1>&6 -echo "configure:2887: checking for tgoto" >&5 + # Check for library containing tgoto. Do this before curses library + # because it may be needed to link the test-case for initscr. + echo $ac_n "checking for tgoto""... $ac_c" 1>&6 +echo "configure:2948: checking for tgoto" >&5 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_tgoto=yes" else @@ -2929,10 +2990,10 @@ if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then else echo "$ac_t""no" 1>&6 - for cf_term_lib in $cf_check_list termcap termlib unknown - do - echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6 -echo "configure:2936: checking for tgoto in -l$cf_term_lib" >&5 + for cf_term_lib in $cf_check_list termcap termlib unknown + do + echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6 +echo "configure:2997: checking for tgoto in -l$cf_term_lib" >&5 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2940,7 +3001,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$cf_term_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2971,17 +3032,17 @@ else echo "$ac_t""no" 1>&6 fi - done - + done + fi - # Check for library containing initscr - test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" - for cf_curs_lib in $cf_check_list xcurses jcurses unknown - do - echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6 -echo "configure:2985: checking for initscr in -l$cf_curs_lib" >&5 + # Check for library containing initscr + test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" + for cf_curs_lib in $cf_check_list xcurses jcurses unknown + do + echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6 +echo "configure:3046: checking for initscr in -l$cf_curs_lib" >&5 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2989,7 +3050,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$cf_curs_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3020,22 +3081,22 @@ else echo "$ac_t""no" 1>&6 fi - done - test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; } - - LIBS="-l$cf_curs_lib $cf_save_LIBS" - if test "$cf_term_lib" = unknown ; then - echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6 -echo "configure:3030: checking if we can link with $cf_curs_lib library" >&5 - cat > conftest.$ac_ext <&2; exit 1; } + + LIBS="-l$cf_curs_lib $cf_save_LIBS" + if test "$cf_term_lib" = unknown ; then + echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6 +echo "configure:3091: checking if we can link with $cf_curs_lib library" >&5 + cat > conftest.$ac_ext < int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_result=yes else @@ -3045,22 +3106,22 @@ else cf_result=no fi rm -f conftest* - echo "$ac_t""$cf_result" 1>&6 - test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; } - elif test "$cf_curs_lib" = "$cf_term_lib" ; then - : - elif test "$cf_term_lib" != predefined ; then - echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6 -echo "configure:3055: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5 - cat > conftest.$ac_ext <&6 + test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; } + elif test "$cf_curs_lib" = "$cf_term_lib" ; then + : + elif test "$cf_term_lib" != predefined ; then + echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6 +echo "configure:3116: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5 + cat > conftest.$ac_ext < int main() { initscr(); tgoto((char *)0, 0, 0); ; return 0; } EOF -if { (eval echo configure:3064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_result=no else @@ -3068,16 +3129,16 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* - LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" - cat > conftest.$ac_ext < conftest.$ac_ext < int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_result=yes else @@ -3087,11 +3148,11 @@ else cf_result=error fi rm -f conftest* - + fi rm -f conftest* - echo "$ac_t""$cf_result" 1>&6 - fi + echo "$ac_t""$cf_result" 1>&6 + fi fi fi @@ -3103,11 +3164,76 @@ ncurses) cf_ncuhdr_root=ncurses test -n "$cf_cv_curses_dir" && \ -test "$cf_cv_curses_dir" != "no" && \ -CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS" +test "$cf_cv_curses_dir" != "no" && { \ + +if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then + for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root + do + while test $cf_add_incdir != /usr/include + do + if test -d $cf_add_incdir + then + cf_have_incdir=no + if test -n "$CFLAGS$CPPFLAGS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_incdir in $CFLAGS $CPPFLAGS ; do + if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then + cf_have_incdir=yes; break + fi + done + fi + + if test "$cf_have_incdir" = no ; then + if test "$cf_add_incdir" = /usr/local/include ; then + if test "$GCC" = yes + then + cf_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat > conftest.$ac_ext < +int main() { +printf("Hello") +; return 0; } +EOF +if { (eval echo configure:3201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_have_incdir=yes +fi +rm -f conftest* + CPPFLAGS=$cf_save_CPPFLAGS + fi + fi + fi + + if test "$cf_have_incdir" = no ; then + test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 + +echo "${as_me-configure}:3218: testing adding $cf_add_incdir to include-path ..." 1>&5 + + + CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + + cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + test "$cf_top_incdir" = "$cf_add_incdir" && break + cf_add_incdir="$cf_top_incdir" + else + break + fi + fi + done + done +fi + +} echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6 -echo "configure:3111: checking for $cf_ncuhdr_root header in include-path" >&5 +echo "configure:3237: checking for $cf_ncuhdr_root header in include-path" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3118,7 +3244,7 @@ else do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ncurses_h=$cf_header @@ -3165,7 +3291,7 @@ if test "$cf_cv_ncurses_h" != no ; then else echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6 -echo "configure:3169: checking for $cf_ncuhdr_root include-path" >&5 +echo "configure:3295: checking for $cf_ncuhdr_root include-path" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3173,34 +3299,23 @@ else test -n "$verbose" && echo cf_search="" -test -d "$HOME" && { - test -n "$verbose" && echo " ... testing include-directories under $HOME" - test -d "$HOME/include" && cf_search="$cf_search $HOME/include" - test -d "$HOME/include/$cf_ncuhdr_root" && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root" - test -d "$HOME/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include" -} -# For other stuff under the home directory, it should be sufficient to put -# a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location: -test -d "$HOME/$cf_ncuhdr_root" && { - test -n "$verbose" && echo " ... testing include-directories under $HOME/$cf_ncuhdr_root" - test -d "$HOME/$cf_ncuhdr_root/include" && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include" - test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +test "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for include-directories under /usr" + test -d /usr/include && cf_search="$cf_search /usr/include" + test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root" + test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } -test "$prefix" != /usr/local && \ -test -d /usr/local && { - test -n "$verbose" && echo " ... testing include-directories under /usr/local" - test -d /usr/local/include && cf_search="$cf_search /usr/local/include" - test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root" - test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include" - test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include" - test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} -test "$prefix" != NONE && \ -test -d $prefix && { - test -n "$verbose" && echo " ... testing include-directories under $prefix" +test "$prefix" != "NONE" && \ +test -d "$prefix" && \ + { + test -n "$verbose" && echo " ... testing for include-directories under $prefix" test -d $prefix/include && cf_search="$cf_search $prefix/include" test -d $prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" @@ -3208,25 +3323,43 @@ test -d $prefix && { test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } -test "$prefix" != /opt && \ -test -d /opt && { - test -n "$verbose" && echo " ... testing include-directories under /opt" - test -d /opt/include && cf_search="$cf_search /opt/include" - test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root" - test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include" - test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include" - test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root" + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for include-directories under /usr/local" + test -d /usr/local/include && cf_search="$cf_search /usr/local/include" + test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root" + test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for include-directories under /opt" + test -d /opt/include && cf_search="$cf_search /opt/include" + test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root" + test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } -test "$prefix" != /usr && \ -test -d /usr && { - test -n "$verbose" && echo " ... testing include-directories under /usr" - test -d /usr/include && cf_search="$cf_search /usr/include" - test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root" - test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include" - test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include" + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for include-directories under $HOME" + test -d $HOME/include && cf_search="$cf_search $HOME/include" + test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root" + test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } + test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { @@ -3247,46 +3380,69 @@ test -d "$oldincludedir" && { for cf_incdir in $cf_search do -for cf_add_incdir in $cf_incdir -do - while true +if test -n "$cf_incdir" ; then + for cf_add_incdir in $cf_incdir + do + while test $cf_add_incdir != /usr/include do - case $cf_add_incdir in - /usr/include) # (vi - ;; - /usr/local/include) # (vi + if test -d $cf_add_incdir + then + cf_have_incdir=no + if test -n "$CFLAGS$CPPFLAGS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_incdir in $CFLAGS $CPPFLAGS ; do + if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then + cf_have_incdir=yes; break + fi + done + fi + + if test "$cf_have_incdir" = no ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then - cf_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cat > conftest.$ac_ext < conftest.$ac_ext < int main() { printf("Hello") ; return 0; } EOF -if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - CPPFLAGS="$cf_save_CPPFLAGS" + cf_have_incdir=yes fi rm -f conftest* + CPPFLAGS=$cf_save_CPPFLAGS fi - ;; - *) # (vi - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - ;; - esac - cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` - test "$cf_top_incdir" = "$cf_add_incdir" && break - cf_add_incdir="$cf_top_incdir" + fi + fi + + if test "$cf_have_incdir" = no ; then + test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 + +echo "${as_me-configure}:3432: testing adding $cf_add_incdir to include-path ..." 1>&5 + + + CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + + cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + test "$cf_top_incdir" = "$cf_add_incdir" && break + cf_add_incdir="$cf_top_incdir" + else + break + fi + fi done -done + done +fi for cf_header in \ ncurses.h \ @@ -3294,7 +3450,7 @@ done do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ncurses_h2=$cf_header @@ -3349,46 +3505,69 @@ echo "$ac_t""$cf_cv_ncurses_h2" 1>&6 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header fi -for cf_add_incdir in $cf_1st_incdir -do - while true +if test -n "$cf_1st_incdir" ; then + for cf_add_incdir in $cf_1st_incdir + do + while test $cf_add_incdir != /usr/include do - case $cf_add_incdir in - /usr/include) # (vi - ;; - /usr/local/include) # (vi + if test -d $cf_add_incdir + then + cf_have_incdir=no + if test -n "$CFLAGS$CPPFLAGS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_incdir in $CFLAGS $CPPFLAGS ; do + if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then + cf_have_incdir=yes; break + fi + done + fi + + if test "$cf_have_incdir" = no ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then - cf_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cat > conftest.$ac_ext < conftest.$ac_ext < int main() { printf("Hello") ; return 0; } EOF -if { (eval echo configure:3373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - CPPFLAGS="$cf_save_CPPFLAGS" + cf_have_incdir=yes fi rm -f conftest* + CPPFLAGS=$cf_save_CPPFLAGS fi - ;; - *) # (vi - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - ;; - esac - cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` - test "$cf_top_incdir" = "$cf_add_incdir" && break - cf_add_incdir="$cf_top_incdir" + fi + fi + + if test "$cf_have_incdir" = no ; then + test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 + +echo "${as_me-configure}:3557: testing adding $cf_add_incdir to include-path ..." 1>&5 + + + CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + + cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + test "$cf_top_incdir" = "$cf_add_incdir" && break + cf_add_incdir="$cf_top_incdir" + else + break + fi + fi done -done + done +fi fi @@ -3422,7 +3601,7 @@ esac echo $ac_n "checking for terminfo header""... $ac_c" 1>&6 -echo "configure:3426: checking for terminfo header" >&5 +echo "configure:3605: checking for terminfo header" >&5 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3439,7 +3618,7 @@ esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat > conftest.$ac_ext < #include <${cf_cv_ncurses_header-curses.h}> @@ -3449,7 +3628,7 @@ int main() { int x = auto_left_margin ; return 0; } EOF -if { (eval echo configure:3453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_term_header="$cf_test" @@ -3504,7 +3683,7 @@ EOF echo $ac_n "checking for ncurses version""... $ac_c" 1>&6 -echo "configure:3508: checking for ncurses version" >&5 +echo "configure:3687: checking for ncurses version" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3530,7 +3709,7 @@ Autoconf "old" #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo configure:3534: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } + { (eval echo configure:3713: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" @@ -3539,7 +3718,7 @@ EOF else cat > conftest.$ac_ext < @@ -3563,7 +3742,7 @@ int main() ${cf_cv_main_return-return}(0); } EOF -if { (eval echo configure:3567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_ncurses_version=`cat $cf_tempfile` @@ -3594,7 +3773,7 @@ cf_nculib_root=ncurses cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:3598: checking for Gpm_Open in -lgpm" >&5 +echo "configure:3777: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3602,7 +3781,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3629,7 +3808,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6 -echo "configure:3633: checking for initscr in -lgpm" >&5 +echo "configure:3812: checking for initscr in -lgpm" >&5 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3637,7 +3816,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3680,7 +3859,7 @@ freebsd*) # version of ncurses (but it should do no harm, since it's static). if test "$cf_nculib_root" = ncurses ; then echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6 -echo "configure:3684: checking for tgoto in -lmytinfo" >&5 +echo "configure:3863: checking for tgoto in -lmytinfo" >&5 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3688,7 +3867,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmytinfo $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3727,18 +3906,47 @@ LIBS="$cf_ncurses_LIBS $LIBS" if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then - LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS" + +if test -n "$cf_cv_curses_dir/lib" ; then + for cf_add_libdir in $cf_cv_curses_dir/lib + do + if test $cf_add_libdir = /usr/lib ; then + : + elif test -d $cf_add_libdir + then + cf_have_libdir=no + if test -n "$LDFLAGS$LIBS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_libdir in $LDFLAGS $LIBS ; do + if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then + cf_have_libdir=yes; break + fi + done + fi + if test "$cf_have_libdir" = no ; then + test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 + +echo "${as_me-configure}:3930: testing adding $cf_add_libdir to library-path ..." 1>&5 + + + LDFLAGS="-L$cf_add_libdir $LDFLAGS" + fi + fi + done +fi + + LIBS="-l$cf_nculib_root $LIBS" else eval 'cf_cv_have_lib_'$cf_nculib_root'=no' cf_libdir="" echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:3737: checking for initscr" >&5 +echo "configure:3945: checking for initscr" >&5 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_initscr=yes" else @@ -3781,17 +3989,17 @@ else cf_save_LIBS="$LIBS" echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6 -echo "configure:3785: checking for initscr in -l$cf_nculib_root" >&5 +echo "configure:3993: checking for initscr in -l$cf_nculib_root" >&5 LIBS="-l$cf_nculib_root $LIBS" cat > conftest.$ac_ext < int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' @@ -3803,34 +4011,23 @@ else echo "$ac_t""no" 1>&6 cf_search="" -test -d "$HOME" && { - test -n "$verbose" && echo " ... testing lib-directories under $HOME" - test -d "$HOME/lib" && cf_search="$cf_search $HOME/lib" - test -d "$HOME/lib/$cf_nculib_root" && cf_search="$cf_search $HOME/lib/$cf_nculib_root" - test -d "$HOME/lib/$cf_nculib_root/lib" && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib" -} -# For other stuff under the home directory, it should be sufficient to put -# a symbolic link for $HOME/$cf_nculib_root to the actual package location: -test -d "$HOME/$cf_nculib_root" && { - test -n "$verbose" && echo " ... testing lib-directories under $HOME/$cf_nculib_root" - test -d "$HOME/$cf_nculib_root/lib" && cf_search="$cf_search $HOME/$cf_nculib_root/lib" - test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root" +test "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr" + test -d /usr/lib && cf_search="$cf_search /usr/lib" + test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root" + test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root" } -test "$prefix" != /usr/local && \ -test -d /usr/local && { - test -n "$verbose" && echo " ... testing lib-directories under /usr/local" - test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" - test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root" - test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib" - test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib" - test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root" -} -test "$prefix" != NONE && \ -test -d $prefix && { - test -n "$verbose" && echo " ... testing lib-directories under $prefix" +test "$prefix" != "NONE" && \ +test -d "$prefix" && \ + { + test -n "$verbose" && echo " ... testing for lib-directories under $prefix" test -d $prefix/lib && cf_search="$cf_search $prefix/lib" test -d $prefix/lib/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" @@ -3838,39 +4035,57 @@ test -d $prefix && { test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" } -test "$prefix" != /opt && \ -test -d /opt && { - test -n "$verbose" && echo " ... testing lib-directories under /opt" - test -d /opt/lib && cf_search="$cf_search /opt/lib" - test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root" - test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib" - test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib" - test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root" + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" + test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" + test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root" + test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root" +} + + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for lib-directories under /opt" + test -d /opt/lib && cf_search="$cf_search /opt/lib" + test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root" + test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root" } -test "$prefix" != /usr && \ -test -d /usr && { - test -n "$verbose" && echo " ... testing lib-directories under /usr" - test -d /usr/lib && cf_search="$cf_search /usr/lib" - test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root" - test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib" - test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib" + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for lib-directories under $HOME" + test -d $HOME/lib && cf_search="$cf_search $HOME/lib" + test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root" + test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root" } + for cf_libdir in $cf_search do echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6 -echo "configure:3864: checking for -l$cf_nculib_root in $cf_libdir" >&5 +echo "configure:4079: checking for -l$cf_nculib_root in $cf_libdir" >&5 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS" cat > conftest.$ac_ext < int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' @@ -3901,7 +4116,7 @@ fi if test -n "$cf_ncurses_LIBS" ; then echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6 -echo "configure:3905: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5 +echo "configure:4120: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5 cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` @@ -3910,14 +4125,14 @@ echo "configure:3905: checking if we can link $cf_nculib_root without $cf_ncurse fi done cat > conftest.$ac_ext < int main() { initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); ; return 0; } EOF -if { (eval echo configure:3921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -3943,14 +4158,14 @@ ncursesw) cf_cv_libtype=w echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6 -echo "configure:3947: checking for multibyte character support" >&5 +echo "configure:4162: checking for multibyte character support" >&5 if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cf_save_LIBS="$LIBS" cat > conftest.$ac_ext < @@ -3958,7 +4173,7 @@ int main() { putwc(0,0); ; return 0; } EOF -if { (eval echo configure:3962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_utf8_lib=yes else @@ -3967,7 +4182,7 @@ else rm -rf conftest* LIBS="-lutf8 $LIBS" cat > conftest.$ac_ext < @@ -3975,7 +4190,7 @@ int main() { putwc(0,0); ; return 0; } EOF -if { (eval echo configure:3979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_utf8_lib=add-on else @@ -4008,11 +4223,76 @@ fi cf_ncuhdr_root=ncursesw test -n "$cf_cv_curses_dir" && \ -test "$cf_cv_curses_dir" != "no" && \ -CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS" +test "$cf_cv_curses_dir" != "no" && { \ + +if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then + for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root + do + while test $cf_add_incdir != /usr/include + do + if test -d $cf_add_incdir + then + cf_have_incdir=no + if test -n "$CFLAGS$CPPFLAGS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_incdir in $CFLAGS $CPPFLAGS ; do + if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then + cf_have_incdir=yes; break + fi + done + fi + + if test "$cf_have_incdir" = no ; then + if test "$cf_add_incdir" = /usr/local/include ; then + if test "$GCC" = yes + then + cf_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat > conftest.$ac_ext < +int main() { +printf("Hello") +; return 0; } +EOF +if { (eval echo configure:4260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_have_incdir=yes +fi +rm -f conftest* + CPPFLAGS=$cf_save_CPPFLAGS + fi + fi + fi + + if test "$cf_have_incdir" = no ; then + test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 + +echo "${as_me-configure}:4277: testing adding $cf_add_incdir to include-path ..." 1>&5 + + + CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + + cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + test "$cf_top_incdir" = "$cf_add_incdir" && break + cf_add_incdir="$cf_top_incdir" + else + break + fi + fi + done + done +fi + +} echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6 -echo "configure:4016: checking for $cf_ncuhdr_root header in include-path" >&5 +echo "configure:4296: checking for $cf_ncuhdr_root header in include-path" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4023,7 +4303,7 @@ else do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ncurses_h=$cf_header @@ -4078,7 +4358,7 @@ if test "$cf_cv_ncurses_h" != no ; then else echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6 -echo "configure:4082: checking for $cf_ncuhdr_root include-path" >&5 +echo "configure:4362: checking for $cf_ncuhdr_root include-path" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4086,34 +4366,23 @@ else test -n "$verbose" && echo cf_search="" -test -d "$HOME" && { - test -n "$verbose" && echo " ... testing include-directories under $HOME" - test -d "$HOME/include" && cf_search="$cf_search $HOME/include" - test -d "$HOME/include/$cf_ncuhdr_root" && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root" - test -d "$HOME/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include" -} -# For other stuff under the home directory, it should be sufficient to put -# a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location: -test -d "$HOME/$cf_ncuhdr_root" && { - test -n "$verbose" && echo " ... testing include-directories under $HOME/$cf_ncuhdr_root" - test -d "$HOME/$cf_ncuhdr_root/include" && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include" - test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +test "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for include-directories under /usr" + test -d /usr/include && cf_search="$cf_search /usr/include" + test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root" + test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } -test "$prefix" != /usr/local && \ -test -d /usr/local && { - test -n "$verbose" && echo " ... testing include-directories under /usr/local" - test -d /usr/local/include && cf_search="$cf_search /usr/local/include" - test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root" - test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include" - test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include" - test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} -test "$prefix" != NONE && \ -test -d $prefix && { - test -n "$verbose" && echo " ... testing include-directories under $prefix" +test "$prefix" != "NONE" && \ +test -d "$prefix" && \ + { + test -n "$verbose" && echo " ... testing for include-directories under $prefix" test -d $prefix/include && cf_search="$cf_search $prefix/include" test -d $prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" @@ -4121,25 +4390,43 @@ test -d $prefix && { test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } -test "$prefix" != /opt && \ -test -d /opt && { - test -n "$verbose" && echo " ... testing include-directories under /opt" - test -d /opt/include && cf_search="$cf_search /opt/include" - test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root" - test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include" - test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include" - test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root" + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for include-directories under /usr/local" + test -d /usr/local/include && cf_search="$cf_search /usr/local/include" + test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root" + test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for include-directories under /opt" + test -d /opt/include && cf_search="$cf_search /opt/include" + test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root" + test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } -test "$prefix" != /usr && \ -test -d /usr && { - test -n "$verbose" && echo " ... testing include-directories under /usr" - test -d /usr/include && cf_search="$cf_search /usr/include" - test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root" - test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include" - test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include" + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for include-directories under $HOME" + test -d $HOME/include && cf_search="$cf_search $HOME/include" + test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root" + test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } + test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { @@ -4160,46 +4447,69 @@ test -d "$oldincludedir" && { for cf_incdir in $cf_search do -for cf_add_incdir in $cf_incdir -do - while true +if test -n "$cf_incdir" ; then + for cf_add_incdir in $cf_incdir + do + while test $cf_add_incdir != /usr/include do - case $cf_add_incdir in - /usr/include) # (vi - ;; - /usr/local/include) # (vi + if test -d $cf_add_incdir + then + cf_have_incdir=no + if test -n "$CFLAGS$CPPFLAGS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_incdir in $CFLAGS $CPPFLAGS ; do + if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then + cf_have_incdir=yes; break + fi + done + fi + + if test "$cf_have_incdir" = no ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then - cf_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cat > conftest.$ac_ext < conftest.$ac_ext < int main() { printf("Hello") ; return 0; } EOF -if { (eval echo configure:4184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - CPPFLAGS="$cf_save_CPPFLAGS" + cf_have_incdir=yes fi rm -f conftest* + CPPFLAGS=$cf_save_CPPFLAGS fi - ;; - *) # (vi - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - ;; - esac - cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` - test "$cf_top_incdir" = "$cf_add_incdir" && break - cf_add_incdir="$cf_top_incdir" + fi + fi + + if test "$cf_have_incdir" = no ; then + test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 + +echo "${as_me-configure}:4499: testing adding $cf_add_incdir to include-path ..." 1>&5 + + + CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + + cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + test "$cf_top_incdir" = "$cf_add_incdir" && break + cf_add_incdir="$cf_top_incdir" + else + break + fi + fi done -done + done +fi for cf_header in \ ncurses.h \ @@ -4207,7 +4517,7 @@ done do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ncurses_h2=$cf_header @@ -4262,46 +4572,69 @@ echo "$ac_t""$cf_cv_ncurses_h2" 1>&6 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header fi -for cf_add_incdir in $cf_1st_incdir -do - while true +if test -n "$cf_1st_incdir" ; then + for cf_add_incdir in $cf_1st_incdir + do + while test $cf_add_incdir != /usr/include do - case $cf_add_incdir in - /usr/include) # (vi - ;; - /usr/local/include) # (vi + if test -d $cf_add_incdir + then + cf_have_incdir=no + if test -n "$CFLAGS$CPPFLAGS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_incdir in $CFLAGS $CPPFLAGS ; do + if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then + cf_have_incdir=yes; break + fi + done + fi + + if test "$cf_have_incdir" = no ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then - cf_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cat > conftest.$ac_ext < conftest.$ac_ext < int main() { printf("Hello") ; return 0; } EOF -if { (eval echo configure:4286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - CPPFLAGS="$cf_save_CPPFLAGS" + cf_have_incdir=yes fi rm -f conftest* + CPPFLAGS=$cf_save_CPPFLAGS fi - ;; - *) # (vi - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - ;; - esac - cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` - test "$cf_top_incdir" = "$cf_add_incdir" && break - cf_add_incdir="$cf_top_incdir" + fi + fi + + if test "$cf_have_incdir" = no ; then + test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 + +echo "${as_me-configure}:4624: testing adding $cf_add_incdir to include-path ..." 1>&5 + + + CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + + cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + test "$cf_top_incdir" = "$cf_add_incdir" && break + cf_add_incdir="$cf_top_incdir" + else + break + fi + fi done -done + done +fi fi @@ -4335,7 +4668,7 @@ esac echo $ac_n "checking for terminfo header""... $ac_c" 1>&6 -echo "configure:4339: checking for terminfo header" >&5 +echo "configure:4672: checking for terminfo header" >&5 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4352,7 +4685,7 @@ esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat > conftest.$ac_ext < #include <${cf_cv_ncurses_header-curses.h}> @@ -4362,7 +4695,7 @@ int main() { int x = auto_left_margin ; return 0; } EOF -if { (eval echo configure:4366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_term_header="$cf_test" @@ -4417,7 +4750,7 @@ EOF echo $ac_n "checking for ncurses version""... $ac_c" 1>&6 -echo "configure:4421: checking for ncurses version" >&5 +echo "configure:4754: checking for ncurses version" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4443,7 +4776,7 @@ Autoconf "old" #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo configure:4447: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } + { (eval echo configure:4780: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" @@ -4452,7 +4785,7 @@ EOF else cat > conftest.$ac_ext < @@ -4476,7 +4809,7 @@ int main() ${cf_cv_main_return-return}(0); } EOF -if { (eval echo configure:4480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_ncurses_version=`cat $cf_tempfile` @@ -4507,7 +4840,7 @@ cf_nculib_root=ncursesw cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:4511: checking for Gpm_Open in -lgpm" >&5 +echo "configure:4844: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4515,7 +4848,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4542,7 +4875,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6 -echo "configure:4546: checking for initscr in -lgpm" >&5 +echo "configure:4879: checking for initscr in -lgpm" >&5 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4550,7 +4883,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4593,7 +4926,7 @@ freebsd*) # version of ncurses (but it should do no harm, since it's static). if test "$cf_nculib_root" = ncurses ; then echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6 -echo "configure:4597: checking for tgoto in -lmytinfo" >&5 +echo "configure:4930: checking for tgoto in -lmytinfo" >&5 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4601,7 +4934,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmytinfo $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4640,18 +4973,47 @@ LIBS="$cf_ncurses_LIBS $LIBS" if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then - LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS" + +if test -n "$cf_cv_curses_dir/lib" ; then + for cf_add_libdir in $cf_cv_curses_dir/lib + do + if test $cf_add_libdir = /usr/lib ; then + : + elif test -d $cf_add_libdir + then + cf_have_libdir=no + if test -n "$LDFLAGS$LIBS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_libdir in $LDFLAGS $LIBS ; do + if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then + cf_have_libdir=yes; break + fi + done + fi + if test "$cf_have_libdir" = no ; then + test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 + +echo "${as_me-configure}:4997: testing adding $cf_add_libdir to library-path ..." 1>&5 + + + LDFLAGS="-L$cf_add_libdir $LDFLAGS" + fi + fi + done +fi + + LIBS="-l$cf_nculib_root $LIBS" else eval 'cf_cv_have_lib_'$cf_nculib_root'=no' cf_libdir="" echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:4650: checking for initscr" >&5 +echo "configure:5012: checking for initscr" >&5 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_initscr=yes" else @@ -4694,17 +5056,17 @@ else cf_save_LIBS="$LIBS" echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6 -echo "configure:4698: checking for initscr in -l$cf_nculib_root" >&5 +echo "configure:5060: checking for initscr in -l$cf_nculib_root" >&5 LIBS="-l$cf_nculib_root $LIBS" cat > conftest.$ac_ext < int main() { initscr() ; return 0; } EOF -if { (eval echo configure:4708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' @@ -4716,34 +5078,23 @@ else echo "$ac_t""no" 1>&6 cf_search="" -test -d "$HOME" && { - test -n "$verbose" && echo " ... testing lib-directories under $HOME" - test -d "$HOME/lib" && cf_search="$cf_search $HOME/lib" - test -d "$HOME/lib/$cf_nculib_root" && cf_search="$cf_search $HOME/lib/$cf_nculib_root" - test -d "$HOME/lib/$cf_nculib_root/lib" && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib" -} -# For other stuff under the home directory, it should be sufficient to put -# a symbolic link for $HOME/$cf_nculib_root to the actual package location: -test -d "$HOME/$cf_nculib_root" && { - test -n "$verbose" && echo " ... testing lib-directories under $HOME/$cf_nculib_root" - test -d "$HOME/$cf_nculib_root/lib" && cf_search="$cf_search $HOME/$cf_nculib_root/lib" - test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root" +test "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr" + test -d /usr/lib && cf_search="$cf_search /usr/lib" + test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root" + test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root" } -test "$prefix" != /usr/local && \ -test -d /usr/local && { - test -n "$verbose" && echo " ... testing lib-directories under /usr/local" - test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" - test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root" - test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib" - test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib" - test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root" -} -test "$prefix" != NONE && \ -test -d $prefix && { - test -n "$verbose" && echo " ... testing lib-directories under $prefix" +test "$prefix" != "NONE" && \ +test -d "$prefix" && \ + { + test -n "$verbose" && echo " ... testing for lib-directories under $prefix" test -d $prefix/lib && cf_search="$cf_search $prefix/lib" test -d $prefix/lib/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" @@ -4751,39 +5102,57 @@ test -d $prefix && { test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" } -test "$prefix" != /opt && \ -test -d /opt && { - test -n "$verbose" && echo " ... testing lib-directories under /opt" - test -d /opt/lib && cf_search="$cf_search /opt/lib" - test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root" - test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib" - test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib" - test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root" + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" + test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" + test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root" + test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root" +} + + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for lib-directories under /opt" + test -d /opt/lib && cf_search="$cf_search /opt/lib" + test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root" + test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root" } -test "$prefix" != /usr && \ -test -d /usr && { - test -n "$verbose" && echo " ... testing lib-directories under /usr" - test -d /usr/lib && cf_search="$cf_search /usr/lib" - test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root" - test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib" - test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib" + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test -d $prefix) && { + test -n "$verbose" && echo " ... testing for lib-directories under $HOME" + test -d $HOME/lib && cf_search="$cf_search $HOME/lib" + test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root" + test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root" } + for cf_libdir in $cf_search do echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6 -echo "configure:4777: checking for -l$cf_nculib_root in $cf_libdir" >&5 +echo "configure:5146: checking for -l$cf_nculib_root in $cf_libdir" >&5 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS" cat > conftest.$ac_ext < int main() { initscr() ; return 0; } EOF -if { (eval echo configure:4787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' @@ -4814,7 +5183,7 @@ fi if test -n "$cf_ncurses_LIBS" ; then echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6 -echo "configure:4818: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5 +echo "configure:5187: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5 cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` @@ -4823,14 +5192,14 @@ echo "configure:4818: checking if we can link $cf_nculib_root without $cf_ncurse fi done cat > conftest.$ac_ext < int main() { initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); ; return 0; } EOF -if { (eval echo configure:4834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -4873,17 +5242,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:4877: checking whether -R must be followed by a space" >&5 +echo "configure:5246: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -4899,14 +5268,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -4938,7 +5307,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:4942: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:5311: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4946,7 +5315,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4979,7 +5348,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:4983: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:5352: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4987,7 +5356,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5027,12 +5396,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:5031: checking for gethostbyname" >&5 +echo "configure:5400: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -5076,7 +5445,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:5080: checking for gethostbyname in -lnsl" >&5 +echo "configure:5449: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5084,7 +5453,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5125,12 +5494,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:5129: checking for connect" >&5 +echo "configure:5498: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -5174,7 +5543,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:5178: checking for connect in -lsocket" >&5 +echo "configure:5547: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5182,7 +5551,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5217,12 +5586,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:5221: checking for remove" >&5 +echo "configure:5590: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -5266,7 +5635,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:5270: checking for remove in -lposix" >&5 +echo "configure:5639: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5274,7 +5643,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5309,12 +5678,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:5313: checking for shmat" >&5 +echo "configure:5682: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -5358,7 +5727,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:5362: checking for shmat in -lipc" >&5 +echo "configure:5731: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5366,7 +5735,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5410,7 +5779,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:5414: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:5783: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5418,7 +5787,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5465,6 +5834,9 @@ LDFLAGS="$X_LIBS $LDFLAGS" test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6 +echo "${as_me-configure}:5838: testing checking additions to CFLAGS ..." 1>&5 + + cf_check_cflags="$CFLAGS" cf_check_cppflags="$CPPFLAGS" @@ -5524,18 +5896,27 @@ done if test -n "$cf_new_cflags" ; then test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 +echo "${as_me-configure}:5900: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 + + CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 +echo "${as_me-configure}:5909: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 + + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 +echo "${as_me-configure}:5918: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi @@ -5544,14 +5925,14 @@ fi if test "$cf_check_cflags" != "$CFLAGS" ; then cat > conftest.$ac_ext < int main() { printf("Hello world"); ; return 0; } EOF -if { (eval echo configure:5555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -5559,9 +5940,15 @@ else rm -rf conftest* test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6 +echo "${as_me-configure}:5944: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5 + + if test "$cf_check_cppflags" != "$CPPFLAGS" ; then test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6 +echo "${as_me-configure}:5950: testing but keeping change to \$CPPFLAGS ..." 1>&5 + + fi CFLAGS="$cf_check_flags" fi @@ -5570,12 +5957,12 @@ fi echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6 -echo "configure:5574: checking for XOpenDisplay" >&5 +echo "configure:5961: checking for XOpenDisplay" >&5 if eval "test \"`echo '$''{'ac_cv_func_XOpenDisplay'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_XOpenDisplay=yes" else @@ -5617,7 +6004,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:5621: checking for XOpenDisplay in -lX11" >&5 +echo "configure:6008: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5625,7 +6012,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5660,12 +6047,12 @@ fi echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6 -echo "configure:5664: checking for XtAppInitialize" >&5 +echo "configure:6051: checking for XtAppInitialize" >&5 if eval "test \"`echo '$''{'ac_cv_func_XtAppInitialize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_XtAppInitialize=yes" else @@ -5707,7 +6094,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6 -echo "configure:5711: checking for XtAppInitialize in -lXt" >&5 +echo "configure:6098: checking for XtAppInitialize in -lXt" >&5 ac_lib_var=`echo Xt'_'XtAppInitialize | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5715,7 +6102,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5764,7 +6151,7 @@ fi cf_x_athena=${cf_x_athena-Xaw} echo $ac_n "checking if you want to link with Xaw 3d library""... $ac_c" 1>&6 -echo "configure:5768: checking if you want to link with Xaw 3d library" >&5 +echo "configure:6155: checking if you want to link with Xaw 3d library" >&5 withval= # Check whether --with-Xaw3d or --without-Xaw3d was given. @@ -5781,7 +6168,7 @@ else fi echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6 -echo "configure:5785: checking if you want to link with neXT Athena library" >&5 +echo "configure:6172: checking if you want to link with neXT Athena library" >&5 withval= # Check whether --with-neXtaw or --without-neXtaw was given. @@ -5798,7 +6185,7 @@ else fi echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6 -echo "configure:5802: checking if you want to link with Athena-Plus library" >&5 +echo "configure:6189: checking if you want to link with Athena-Plus library" >&5 withval= # Check whether --with-XawPlus or --without-XawPlus was given. @@ -5815,7 +6202,7 @@ else fi echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6 -echo "configure:5819: checking for XextCreateExtension in -lXext" >&5 +echo "configure:6206: checking for XextCreateExtension in -lXext" >&5 ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5823,7 +6210,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXext $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5873,13 +6260,13 @@ do if test $cf_path != default ; then CPPFLAGS="-I$cf_path/include $cf_save" echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6 -echo "configure:5877: checking for $cf_test in $cf_path" >&5 +echo "configure:6264: checking for $cf_test in $cf_path" >&5 else echo $ac_n "checking for $cf_test""... $ac_c" 1>&6 -echo "configure:5880: checking for $cf_test" >&5 +echo "configure:6267: checking for $cf_test" >&5 fi cat > conftest.$ac_ext < @@ -5888,7 +6275,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_result=yes else @@ -5935,21 +6322,21 @@ do if test $cf_path != default ; then LIBS="-L$cf_path/lib $cf_lib $LIBS" echo $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6 -echo "configure:5939: checking for $cf_lib in $cf_path" >&5 +echo "configure:6326: checking for $cf_lib in $cf_path" >&5 else LIBS="$cf_lib $LIBS" echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6 -echo "configure:5943: checking for $cf_test in $cf_lib" >&5 +echo "configure:6330: checking for $cf_test in $cf_lib" >&5 fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_result=yes else @@ -5990,7 +6377,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5994: checking for $ac_word" >&5 +echo "configure:6381: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XCURSES_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6040,6 +6427,9 @@ LDFLAGS="$LDFLAGS $X_LIBS" test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6 +echo "${as_me-configure}:6431: testing checking additions to CFLAGS ..." 1>&5 + + cf_check_cflags="$CFLAGS" cf_check_cppflags="$CPPFLAGS" @@ -6099,18 +6489,27 @@ done if test -n "$cf_new_cflags" ; then test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 +echo "${as_me-configure}:6493: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 + + CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 +echo "${as_me-configure}:6502: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 + + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 +echo "${as_me-configure}:6511: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi @@ -6119,14 +6518,14 @@ fi if test "$cf_check_cflags" != "$CFLAGS" ; then cat > conftest.$ac_ext < int main() { printf("Hello world"); ; return 0; } EOF -if { (eval echo configure:6130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -6134,9 +6533,15 @@ else rm -rf conftest* test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6 +echo "${as_me-configure}:6537: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5 + + if test "$cf_check_cppflags" != "$CPPFLAGS" ; then test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6 +echo "${as_me-configure}:6543: testing but keeping change to \$CPPFLAGS ..." 1>&5 + + fi CFLAGS="$cf_check_flags" fi @@ -6144,7 +6549,7 @@ rm -f conftest* fi echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:6148: checking for XOpenDisplay in -lX11" >&5 +echo "configure:6553: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6152,7 +6557,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6184,14 +6589,14 @@ else fi echo $ac_n "checking for XCurses library""... $ac_c" 1>&6 -echo "configure:6188: checking for XCurses library" >&5 +echo "configure:6593: checking for XCurses library" >&5 if eval "test \"`echo '$''{'cf_cv_lib_XCurses'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else LIBS="-lXCurses $LIBS" cat > conftest.$ac_ext < @@ -6201,7 +6606,7 @@ int main() { XCursesExit(); ; return 0; } EOF -if { (eval echo configure:6205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_lib_XCurses=yes else @@ -6246,7 +6651,7 @@ pdcurses) #(vi *) # look for curses-related libraries echo $ac_n "checking for new_panel in -lpanel$cf_cv_libtype""... $ac_c" 1>&6 -echo "configure:6250: checking for new_panel in -lpanel$cf_cv_libtype" >&5 +echo "configure:6655: checking for new_panel in -lpanel$cf_cv_libtype" >&5 ac_lib_var=`echo panel$cf_cv_libtype'_'new_panel | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6254,7 +6659,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpanel$cf_cv_libtype $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6293,7 +6698,7 @@ else fi echo $ac_n "checking for menu_driver in -lmenu$cf_cv_libtype""... $ac_c" 1>&6 -echo "configure:6297: checking for menu_driver in -lmenu$cf_cv_libtype" >&5 +echo "configure:6702: checking for menu_driver in -lmenu$cf_cv_libtype" >&5 ac_lib_var=`echo menu$cf_cv_libtype'_'menu_driver | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6301,7 +6706,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmenu$cf_cv_libtype $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6340,7 +6745,7 @@ else fi echo $ac_n "checking for form_driver in -lform$cf_cv_libtype""... $ac_c" 1>&6 -echo "configure:6344: checking for form_driver in -lform$cf_cv_libtype" >&5 +echo "configure:6749: checking for form_driver in -lform$cf_cv_libtype" >&5 ac_lib_var=`echo form$cf_cv_libtype'_'form_driver | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6348,7 +6753,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lform$cf_cv_libtype $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6398,17 +6803,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6402: checking for $ac_hdr" >&5 +echo "configure:6807: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6438,12 +6843,12 @@ done esac echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:6442: checking return type of signal handlers" >&5 +echo "configure:6847: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6460,7 +6865,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:6464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -6480,12 +6885,12 @@ EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:6484: checking for ANSI C header files" >&5 +echo "configure:6889: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6493,7 +6898,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6497: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6510,7 +6915,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -6528,7 +6933,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -6549,7 +6954,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -6560,7 +6965,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:6564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -6584,12 +6989,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:6588: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:6993: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6598,7 +7003,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:6602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -6631,17 +7036,17 @@ unistd.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6635: checking for $ac_hdr" >&5 +echo "configure:7040: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6669,45 +7074,17 @@ done for ac_func in \ -chgat \ -color_set \ -filter \ -getbegx \ -getcurx \ -getmaxx \ -getnstr \ gettimeofday \ -getwin \ -mvvline \ -mvwvline \ -napms \ -putwin \ -resize_term \ -resizeterm \ -ripoffline \ -setupterm \ -slk_color \ -slk_init \ strdup \ -termattrs \ -tgetent \ -tigetnum \ -tigetstr \ -typeahead \ -use_default_colors \ -vsscanf \ -wchgat \ -winsstr \ -wresize \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6706: checking for $ac_func" >&5 +echo "configure:7083: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6755,14 +7132,240 @@ fi done + +echo $ac_n "checking if we must define _XOPEN_SOURCE_EXTENDED""... $ac_c" 1>&6 +echo "configure:7138: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5 +if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +#include <${cf_cv_ncurses_header-curses.h}> +int main() { + + long x = winnstr(stdscr, "", 0); + int x1, y1; + getbegyx(stdscr, y1, x1) +; return 0; } +EOF +if { (eval echo configure:7156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_need_xopen_extension=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext < +#include <${cf_cv_ncurses_header-curses.h}> +int main() { + + long x = winnstr(stdscr, "", 0); + int x1, y1; + getbegyx(stdscr, y1, x1) +; return 0; } +EOF +if { (eval echo configure:7177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_need_xopen_extension=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_need_xopen_extension=unknown +fi +rm -f conftest* +fi +rm -f conftest* +fi + +echo "$ac_t""$cf_cv_need_xopen_extension" 1>&6 +test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" + + +echo $ac_n "checking for term.h""... $ac_c" 1>&6 +echo "configure:7196: checking for term.h" >&5 +if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + +# If we found , look for , but always look +# for if we do not find the variant. +for cf_header in \ + `echo ${cf_cv_ncurses_header-curses.h} | sed -e 's%/.*%/%'`term.h \ + term.h +do + cat > conftest.$ac_ext < +#include <${cf_header}> +int main() { +WINDOW *x +; return 0; } +EOF +if { (eval echo configure:7218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_term_header=$cf_header + break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_term_header=no +fi +rm -f conftest* +done + +fi + +echo "$ac_t""$cf_cv_term_header" 1>&6 + +case $cf_cv_term_header in #(vi +term.h) #(vi + cat >> confdefs.h <<\EOF +#define HAVE_TERM_H 1 +EOF + + ;; +ncurses/term.h) + cat >> confdefs.h <<\EOF +#define HAVE_NCURSES_TERM_H 1 +EOF + + ;; +ncursesw/term.h) + cat >> confdefs.h <<\EOF +#define HAVE_NCURSESW_TERM_H 1 +EOF + + ;; +esac + + + + +for cf_func in \ +chgat \ +color_set \ +filter \ +getbegx \ +getcurx \ +getmaxx \ +getnstr \ +getparx \ +getwin \ +mvvline \ +mvwvline \ +napms \ +putwin \ +resize_term \ +resizeterm \ +ripoffline \ +setupterm \ +slk_color \ +slk_init \ +termattrs \ +tgetent \ +tigetnum \ +tigetstr \ +typeahead \ +use_default_colors \ +vsscanf \ +wchgat \ +winsstr \ +wresize \ + +do + +cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + echo $ac_n "checking for ${cf_func}""... $ac_c" 1>&6 +echo "configure:7295: checking for ${cf_func}" >&5 + +echo "${as_me-configure}:7297: testing ${cf_func} ..." 1>&5 + + if eval "test \"`echo '$''{'cf_cv_func_$cf_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + eval cf_result='$ac_cv_func_'$cf_func + if test ".$cf_result" != ".no"; then + cat > conftest.$ac_ext < +char * XCursesProgramName = "test"; +#else +#include <${cf_cv_ncurses_header-curses.h}> +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) +#include +#else +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) +#include +#else +#ifdef HAVE_TERM_H +#include +#endif +#endif +#endif +#endif +int main() { + +#ifndef ${cf_func} +long foo = (long)(&${cf_func}); +${cf_cv_main_return-return}(foo == 0); +#endif + +; return 0; } +EOF +if { (eval echo configure:7335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_result=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_result=no +fi +rm -f conftest* + fi + eval 'cf_cv_func_'$cf_func'=$cf_result' + +fi + + # use the computed/retrieved cache-value: + eval 'cf_result=$cf_cv_func_'$cf_func + echo "$ac_t""$cf_result" 1>&6 + if test $cf_result != no; then + cat >> confdefs.h <&6 -echo "configure:6760: checking for ncurses extended functions" >&5 +echo "configure:7363: checking for ncurses extended functions" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_ext_funcs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6782,7 +7385,7 @@ int main() { (void) wresize (0, 0, 0); ; return 0; } EOF -if { (eval echo configure:6786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_ncurses_ext_funcs=yes else @@ -6802,13 +7405,13 @@ EOF echo $ac_n "checking for wide-character functions""... $ac_c" 1>&6 -echo "configure:6806: checking for wide-character functions" >&5 +echo "configure:7409: checking for wide-character functions" >&5 if eval "test \"`echo '$''{'cf_cv_widechar_funcs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6820,7 +7423,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_widechar_funcs=yes else @@ -6848,13 +7451,13 @@ fi echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6 -echo "configure:6852: checking if sys/time.h works with sys/select.h" >&5 +echo "configure:7455: checking if sys/time.h works with sys/select.h" >&5 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6869,7 +7472,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_sys_time_select=yes else @@ -6890,7 +7493,7 @@ EOF echo $ac_n "checking for function curses_version""... $ac_c" 1>&6 -echo "configure:6894: checking for function curses_version" >&5 +echo "configure:7497: checking for function curses_version" >&5 if eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6899,7 +7502,7 @@ if test "$cross_compiling" = yes; then cf_cv_func_curses_version=unknown else cat > conftest.$ac_ext < @@ -6911,7 +7514,7 @@ int main() } EOF -if { (eval echo configure:6915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_func_curses_version=yes @@ -6936,7 +7539,7 @@ EOF echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6 -echo "configure:6940: checking for alternate character set array" >&5 +echo "configure:7543: checking for alternate character set array" >&5 if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6945,7 +7548,7 @@ cf_cv_curses_acs_map=unknown for name in acs_map _acs_map __acs_map _nc_acs_map do cat > conftest.$ac_ext < @@ -6956,7 +7559,7 @@ $name['k'] = ACS_PLUS ; return 0; } EOF -if { (eval echo configure:6960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_curses_acs_map=$name; break else @@ -6977,7 +7580,7 @@ EOF echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6 -echo "configure:6981: checking for wide alternate character set array" >&5 +echo "configure:7584: checking for wide alternate character set array" >&5 if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6986,7 +7589,7 @@ else for name in wacs_map _wacs_map __wacs_map _nc_wacs do cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_curses_wacs_map=$name break @@ -7013,9 +7616,9 @@ echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6 echo $ac_n "checking for type attr_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6 -echo "configure:7017: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5 +echo "configure:7620: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_result=yes else @@ -7056,9 +7659,9 @@ fi echo $ac_n "checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6 -echo "configure:7060: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5 +echo "configure:7663: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_result=yes else diff --git a/test/configure.in b/test/configure.in index d5d280b4..eae3990e 100644 --- a/test/configure.in +++ b/test/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1996, etc. dnl -dnl $Id: configure.in,v 1.63 2007/06/09 20:02:57 tom Exp $ +dnl $Id: configure.in,v 1.65 2008/02/09 18:24:11 tom Exp $ dnl This is a simple configuration-script for the ncurses test programs that dnl allows the test-directory to be separately configured against a reference dnl system (i.e., sysvr4 curses) @@ -178,6 +178,11 @@ unistd.h \ ) AC_CHECK_FUNCS( \ +gettimeofday \ +strdup \ +) + +CF_CURSES_FUNCS( \ chgat \ color_set \ filter \ @@ -185,7 +190,7 @@ getbegx \ getcurx \ getmaxx \ getnstr \ -gettimeofday \ +getparx \ getwin \ mvvline \ mvwvline \ @@ -197,7 +202,6 @@ ripoffline \ setupterm \ slk_color \ slk_init \ -strdup \ termattrs \ tgetent \ tigetnum \ diff --git a/test/demo_menus.c b/test/demo_menus.c index 80ad01cc..84322eb4 100644 --- a/test/demo_menus.c +++ b/test/demo_menus.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2005-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2005-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_menus.c,v 1.21 2007/07/21 17:45:09 tom Exp $ + * $Id: demo_menus.c,v 1.22 2008/02/09 18:09:26 tom Exp $ * * Demonstrate a variety of functions from the menu library. * Thomas Dickey - 2005/4/9 @@ -291,7 +291,7 @@ menu_display(MENU * m) static void build_file_menu(MenuNo number) { - static const char *labels[] = + static CONST_MENUS char *labels[] = { "Exit", (char *) 0 @@ -299,7 +299,7 @@ build_file_menu(MenuNo number) static ITEM *items[SIZEOF(labels)]; ITEM **ip = items; - const char **ap; + CONST_MENUS char **ap; for (ap = labels; *ap; ap++) *ip++ = new_item(*ap, ""); @@ -319,7 +319,7 @@ perform_file_menu(int cmd) static void build_select_menu(MenuNo number, char *filename) { - static const char *labels[] = + static CONST_MENUS char *labels[] = { "Lions", "Tigers", @@ -339,7 +339,7 @@ build_select_menu(MenuNo number, char *filename) static ITEM **items; ITEM **ip; - const char **ap = 0; + CONST_MENUS char **ap = 0; unsigned count = 0; if (filename != 0) { @@ -350,7 +350,8 @@ build_select_menu(MenuNo number, char *filename) unsigned size = sb.st_size; unsigned j, k; char *blob = malloc(size + 1); - const char **list = (const char **) calloc(sizeof(*list), size + 1); + CONST_MENUS char **list = + (CONST_MENUS char **) calloc(sizeof(*list), size + 1); items = (ITEM **) calloc(sizeof(ITEM *), size + 1); if (blob != 0 && list != 0) { @@ -569,7 +570,7 @@ current_menu(void) static void build_menus(char *filename) { - static const char *labels[] = + static CONST_MENUS char *labels[] = { "File", "Select", @@ -581,7 +582,7 @@ build_menus(char *filename) static ITEM *items[SIZEOF(labels)]; ITEM **ip = items; - const char **ap; + CONST_MENUS char **ap; for (ap = labels; *ap; ap++) *ip++ = new_item(*ap, ""); diff --git a/test/demo_panels.c b/test/demo_panels.c index 6ef699fc..b4594fb4 100755 --- a/test/demo_panels.c +++ b/test/demo_panels.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007 Free Software Foundation, Inc. * + * Copyright (c) 2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_panels.c,v 1.28 2007/08/11 16:34:49 tom Exp $ + * $Id: demo_panels.c,v 1.29 2008/02/09 23:05:37 tom Exp $ * * Demonstrate a variety of functions from the panel library. */ @@ -634,7 +634,7 @@ get_command(PANEL * px[MAX_PANELS + 1], char *buffer, int limit) if (log_in != 0) { if (fgets(buffer, limit - 3, log_in) != 0) { length = strlen(buffer); - while (length > 0 && isspace(buffer[length - 1])) + while (length > 0 && isspace(UChar(buffer[length - 1]))) buffer[--length] = '\0'; waddstr(win, buffer); } else { diff --git a/test/demo_termcap.c b/test/demo_termcap.c index e5c747b3..3e856489 100644 --- a/test/demo_termcap.c +++ b/test/demo_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2005-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2005-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: demo_termcap.c,v 1.6 2007/02/03 18:51:23 tom Exp $ + * $Id: demo_termcap.c,v 1.7 2008/02/09 18:08:36 tom Exp $ * * A simple demo of the termcap interface. */ @@ -116,7 +116,7 @@ dumpit(char *cap) } static void -demo_termcap(const char *name) +demo_termcap(char *name) { char buffer[1024]; @@ -153,11 +153,13 @@ main(int argc, char *argv[]) } else if ((name = getenv("TERM")) != 0) { demo_termcap(name); } else { - demo_termcap("dumb"); + static char dumb[] = "dumb"; + demo_termcap(dumb); } ExitProgram(EXIT_SUCCESS); } + #else int main(int argc GCC_UNUSED, diff --git a/test/dots.c b/test/dots.c index c0cdf901..2d647185 100644 --- a/test/dots.c +++ b/test/dots.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1999-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey 1999 * - * $Id: dots.c,v 1.16 2007/02/03 18:51:23 tom Exp $ + * $Id: dots.c,v 1.17 2008/02/09 18:08:50 tom Exp $ * * A simple demo of the terminfo interface. */ @@ -47,7 +47,7 @@ static long total_chars = 0; static time_t started; static int -outc(int c) +outc(TPUTS_ARG c) { if (interrupted) { char tmp = c; diff --git a/test/dots_mvcur.c b/test/dots_mvcur.c index 0d8aafba..f0230238 100644 --- a/test/dots_mvcur.c +++ b/test/dots_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1999-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey - 2007 * - * $Id: dots_mvcur.c,v 1.1 2007/06/02 20:01:32 tom Exp $ + * $Id: dots_mvcur.c,v 1.2 2008/02/09 18:08:57 tom Exp $ * * A simple demo of the terminfo interface, and mvcur. */ @@ -47,7 +47,7 @@ static long total_chars = 0; static time_t started; static int -outc(int c) +outc(TPUTS_ARG c) { if (interrupted) { char tmp = c; diff --git a/test/key_names.c b/test/key_names.c index fe07a17d..dea60eb8 100644 --- a/test/key_names.c +++ b/test/key_names.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007 Free Software Foundation, Inc. * + * Copyright (c) 2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: key_names.c,v 1.2 2007/06/09 22:32:34 tom Exp $ + * $Id: key_names.c,v 1.3 2008/02/09 18:09:18 tom Exp $ */ #include @@ -39,7 +39,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) int n; setlocale(LC_ALL, ""); - for (n = -1; n < KEY_MAX + 512; n++) { + for (n = KEY_MIN; n < KEY_MAX + 512; n++) { const char *result = key_name(n); if (result != 0) printf("%d(%5o):%s\n", n, n, result); diff --git a/test/movewindow.c b/test/movewindow.c index e102b667..a45121db 100644 --- a/test/movewindow.c +++ b/test/movewindow.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2006-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: movewindow.c,v 1.20 2007/01/06 23:28:53 tom Exp $ + * $Id: movewindow.c,v 1.21 2008/02/09 18:08:28 tom Exp $ * * Demonstrate move functions for windows and derived windows from the curses * library. @@ -47,6 +47,12 @@ mvwin #undef derwin #endif +#ifdef NCURSES_VERSION +#define CONST_FMT const +#else +#define CONST_FMT /* nothing */ +#endif + #undef LINE_MAX #define LINE_MIN 2 @@ -63,14 +69,14 @@ typedef struct { WINDOW *child; /* the actual value */ } FRAME; -static void head_line(const char *fmt,...) GCC_PRINTFLIKE(1, 2); -static void tail_line(const char *fmt,...) GCC_PRINTFLIKE(1, 2); +static void head_line(CONST_FMT char *fmt,...) GCC_PRINTFLIKE(1, 2); +static void tail_line(CONST_FMT char *fmt,...) GCC_PRINTFLIKE(1, 2); static unsigned num_windows; static FRAME *all_windows; static void -message(int lineno, const char *fmt, va_list argp) +message(int lineno, CONST_FMT char *fmt, va_list argp) { int y, x; @@ -93,7 +99,7 @@ message(int lineno, const char *fmt, va_list argp) } static void -head_line(const char *fmt,...) +head_line(CONST_FMT char *fmt,...) { va_list argp; @@ -103,7 +109,7 @@ head_line(const char *fmt,...) } static void -tail_line(const char *fmt,...) +tail_line(CONST_FMT char *fmt,...) { va_list argp; @@ -511,7 +517,7 @@ show_help(WINDOW *current) /* *INDENT-OFF* */ static struct { int key; - const char * msg; + CONST_FMT char * msg; } help[] = { { '?', "Show this screen" }, { 'b', "Draw a box inside the current window" }, diff --git a/test/ncurses.c b/test/ncurses.c index 51bda884..aa1c9703 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -40,7 +40,7 @@ AUTHOR Author: Eric S. Raymond 1993 Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.300 2008/01/19 23:10:59 tom Exp $ +$Id: ncurses.c,v 1.301 2008/02/09 17:19:55 tom Exp $ ***************************************************************************/ @@ -1310,7 +1310,7 @@ show_attr(int row, int skip, bool arrow, chtype attr, const char *name) } /* *INDENT-OFF* */ static const struct { - attr_t attr; + chtype attr; NCURSES_CONST char * name; } attrs_to_test[] = { { A_STANDOUT, "STANDOUT" }, @@ -2893,7 +2893,7 @@ acs_display(void) #if USE_WIDEC_SUPPORT static cchar_t * -merge_wide_attr(cchar_t *dst, cchar_t *src, attr_t attr, short pair) +merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, short pair) { int count = getcchar(src, NULL, NULL, NULL, 0); wchar_t *wch = 0; @@ -3138,7 +3138,7 @@ show_utf8_chars(attr_t attr, short pair) } /* *INDENT-OFF* */ static struct { - attr_t attr; + chtype attr; const char *name; } attrs_to_cycle[] = { { A_NORMAL, "normal" }, @@ -4849,7 +4849,7 @@ menu_virtualize(int c) } } -static const char *animals[] = +static CONST_MENUS char *animals[] = { "Lions", "Tigers", @@ -4873,7 +4873,7 @@ menu_test(void) MENU *m; ITEM *items[SIZEOF(animals)]; ITEM **ip = items; - const char **ap; + CONST_MENUS char **ap; int mrows, mcols, c; WINDOW *menuwin; @@ -5930,7 +5930,7 @@ do_single_test(const char c) break; #endif -#if USE_WIDEC_SUPPORT +#if USE_WIDEC_SUPPORT && USE_LIBPANEL case 'O': demo_panels(init_wide_panel, fill_wide_panel); break; diff --git a/test/newdemo.c b/test/newdemo.c index 1e694269..84d3f82c 100644 --- a/test/newdemo.c +++ b/test/newdemo.c @@ -2,7 +2,7 @@ * newdemo.c - A demo program using PDCurses. The program illustrate * the use of colours for text output. * - * $Id: newdemo.c,v 1.29 2006/12/03 00:15:28 tom Exp $ + * $Id: newdemo.c,v 1.30 2008/02/09 16:41:29 tom Exp $ */ #include @@ -12,7 +12,7 @@ /* * The Australian map */ -static const char *AusMap[16] = +static CONST_MENUS char *AusMap[16] = { " A A ", " N.T. AAAAA AAAA ", diff --git a/test/railroad.c b/test/railroad.c index ad89fa00..160823d4 100644 --- a/test/railroad.c +++ b/test/railroad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2000-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2000-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey - 2000 * - * $Id: railroad.c,v 1.15 2007/02/03 18:51:23 tom Exp $ + * $Id: railroad.c,v 1.16 2008/02/09 18:08:43 tom Exp $ * * A simple demo of the termcap interface. */ @@ -56,7 +56,7 @@ static char *backup; static bool interrupted = FALSE; static int -outc(int c) +outc(TPUTS_ARG c) { if (interrupted) { char tmp = c; diff --git a/test/test.priv.h b/test/test.priv.h index 5447fa6e..fb5f203f 100644 --- a/test/test.priv.h +++ b/test/test.priv.h @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: test.priv.h,v 1.69 2008/01/26 22:05:48 tom Exp $ */ +/* $Id: test.priv.h,v 1.73 2008/02/10 00:12:55 tom Exp $ */ #ifndef __TEST_PRIV_H #define __TEST_PRIV_H 1 @@ -59,6 +59,14 @@ #define HAVE_CURSES_VERSION 0 #endif +#ifndef HAVE_CHGAT +#define HAVE_CHGAT 0 +#endif + +#ifndef HAVE_COLOR_SET +#define HAVE_COLOR_SET 0 +#endif + #ifndef HAVE_FILTER #define HAVE_FILTER 0 #endif @@ -83,6 +91,10 @@ #define HAVE_GETOPT_H 0 #endif +#ifndef HAVE_GETPARX +#define HAVE_GETPARX 0 +#endif + #ifndef HAVE_GETWIN #define HAVE_GETWIN 0 #endif @@ -235,9 +247,18 @@ #include #endif -#ifdef NCURSES_VERSION -#define HAVE_COLOR_SET 1 -#define HAVE_CHGAT 1 +/* + * Not all curses.h implementations include unctrl.h, + * Solaris 10 xpg4 for example. + */ +#if defined(NCURSES_VERSION) || defined(_XOPEN_CURSES) +#if defined(HAVE_NCURSESW_NCURSES_H) +#include +#elif defined(HAVE_NCURSES_NCURSES_H) +#include +#else +#include +#endif #endif #if HAVE_GETOPT_H @@ -308,7 +329,7 @@ extern int optind; #endif #ifndef HAVE_TYPE_ATTR_T -#if !USE_WIDEC_SUPPORT +#if !USE_WIDEC_SUPPORT && !defined(attr_t) #define attr_t chtype #endif #endif @@ -328,9 +349,8 @@ extern int optind; #define CCHARW_MAX 5 #endif -#ifndef CTRL -#define CTRL(x) ((x) & 0x1f) -#endif +#undef CTRL +#define CTRL(x) ((x) & 0x1f) #define QUIT CTRL('Q') #define ESCAPE CTRL('[') @@ -371,6 +391,21 @@ extern int optind; #define getmaxy(win) ((win)?((win)->_maxy + 1):ERR) #endif +/* + * Solaris 10 xpg4: +#define __m_getparx(w) ((w)->_parent == (WINDOW *) 0 ? -1 \ + : (w)->_begx - (w)->_parent->_begx) + */ +#if !defined(getparx) && !HAVE_GETPARX +#ifdef __m_getparx +#define getparx(win) __m_getparx(win) +#define getpary(win) __m_getpary(win) +#else +#define getparx(win) ((win)?((win)->_parx + 1):ERR) +#define getpary(win) ((win)?((win)->_pary + 1):ERR) +#endif +#endif + #if !defined(mvwvline) && !HAVE_MVWVLINE #define mvwvline(w,y,x,ch,n) (move(y,x) == ERR ? ERR : wvline(w,ch,n)) #define mvwhline(w,y,x,ch,n) (move(y,x) == ERR ? ERR : whline(w,ch,n)) @@ -459,19 +494,56 @@ extern int optind; signal(nsig, handler); \ } +/* + * Workaround for clean(er) compile with Solaris's legacy curses. + * The same would be needed for HPUX 10.20 + */ +#ifndef TPUTS_ARG +#if defined(sun) && !defined(_XOPEN_CURSES) && !defined(NCURSES_VERSION_PATCH) +#define TPUTS_ARG char +extern char *tgoto(char *, int, int); /* available, but not prototyped */ +#else +#define TPUTS_ARG int +#endif +#endif + +/* + * Workarounds for Solaris's X/Open curses + */ +#if defined(sun) && defined(_XOPEN_CURSES) && !defined(NCURSES_VERSION_PATCH) +#if !defined(KEY_MIN) && defined(__KEY_MIN) +#define KEY_MIN __KEY_MIN +#endif +#if !defined(KEY_MAX) && defined(__KEY_MIN) +#define KEY_MAX __KEY_MAX +#endif +#endif + +/* + * ncurses uses const in some places where X/Open does (or did) not allow. + */ +#ifdef NCURSES_VERSION +#define CONST_MENUS const +#else +#define CONST_MENUS /* nothing */ +#endif + /* * Simplify setting up demo of threading with these macros. */ #if !defined(NCURSES_VERSION_PATCH) || (NCURSES_VERSION_PATCH < 20070915) || !NCURSES_EXT_FUNCS +typedef int (*NCURSES_CALLBACK)(WINDOW *, void *); #define WANT_USE_WINDOW() \ static int \ use_window(WINDOW *win, int (*func) (WINDOW *, void *), void *data) \ { \ return func(win, data); \ -} +} \ + extern void _nc_want_use_window(void) #define USING_WINDOW(w,func) use_window(w, (NCURSES_CALLBACK) func, w) #else -#define WANT_USE_WINDOW() /* nothing */ +#define WANT_USE_WINDOW() /* nothing */ \ + extern void _nc_want_use_window(void) #define USING_WINDOW(w,func) func(w) #endif diff --git a/test/test_arrays.c b/test/test_arrays.c index 62f38474..ff6a10b0 100644 --- a/test/test_arrays.c +++ b/test/test_arrays.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007 Free Software Foundation, Inc. * + * Copyright (c) 2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_arrays.c,v 1.2 2007/09/01 20:11:57 tom Exp $ + * $Id: test_arrays.c,v 1.3 2008/02/09 18:09:43 tom Exp $ * * Author: Thomas E Dickey * @@ -47,6 +47,8 @@ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[]; #define USE_TINFO #include +#if defined(NCURSES_VERSION) || !defined(_XOPEN_CURSES) + #define DUMP(name) dump_array(#name, name) static void @@ -77,3 +79,12 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) ExitProgram(EXIT_SUCCESS); } + +#else +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + printf("This program requires the terminfo arrays\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/test_getstr.c b/test/test_getstr.c index c8a8f3b1..25dbecf7 100644 --- a/test/test_getstr.c +++ b/test/test_getstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007 Free Software Foundation, Inc. * + * Copyright (c) 2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_getstr.c,v 1.7 2007/08/11 16:56:25 tom Exp $ + * $Id: test_getstr.c,v 1.8 2008/02/09 18:09:35 tom Exp $ * * Author: Thomas E Dickey * @@ -44,6 +44,9 @@ #include +#if HAVE_CHGAT +/* Solaris SVr4 curses lacks wchgat, mvgetnstr, mvwgetnstr */ + #define BASE_Y 6 #define MAX_COLS 1024 @@ -349,3 +352,12 @@ main(int argc, char *argv[]) endwin(); ExitProgram(EXIT_SUCCESS); } + +#else +int +main(void) +{ + printf("This program requires the curses chgat function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif -- 2.44.0