From eb50977cab0b353dfbe1f519884b4a0e7820f19a Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 26 Jan 2000 16:43:25 +0000 Subject: Import ncurses-5.0-release to update the 5.0-prerelease that we had. --- contrib/ncurses/aclocal.m4 | 191 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 154 insertions(+), 37 deletions(-) (limited to 'contrib/ncurses/aclocal.m4') diff --git a/contrib/ncurses/aclocal.m4 b/contrib/ncurses/aclocal.m4 index b42625d..b4edb24 100644 --- a/contrib/ncurses/aclocal.m4 +++ b/contrib/ncurses/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998 Free Software Foundation, Inc. * +dnl Copyright (c) 1998,1999 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,1997,1998 dnl -dnl $Id: aclocal.m4,v 1.162 1999/08/22 00:13:21 tom Exp $ +dnl $Id: aclocal.m4,v 1.179 1999/10/23 21:49:25 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl --------------------------------------------------------------------------- @@ -154,7 +154,11 @@ AC_CACHE_VAL(cf_cv_type_of_bool,[ AC_TRY_RUN([ #include #include -#if HAVE_BUILTIN_H +#if HAVE_GXX_BUILTIN_H +#include +#elif HAVE_GPP_BUILTIN_H +#include +#elif HAVE_BUILTIN_H #include #endif main() @@ -350,26 +354,35 @@ fi ])dnl dnl --------------------------------------------------------------------------- -dnl If we're trying to use g++, test if libg++ is installed (a rather common -dnl problem :-). If we have the compiler but no library, we'll be able to -dnl configure, but won't be able to build the c++ demo program. -AC_DEFUN([CF_CXX_LIBRARY], +dnl Check if the C++ compiler accepts duplicate parameter initialization. This +dnl is a late feature for the standard and is not in some recent compilers +dnl (1999/9/11). +AC_DEFUN([CF_CPP_PARAM_INIT], [ -cf_cxx_library=unknown -if test $ac_cv_prog_gxx = yes; then - AC_MSG_CHECKING([for libg++]) - cf_save="$LIBS" - LIBS="$LIBS -lg++ -lm" - AC_TRY_LINK([ -#include - ], - [float foo=abs(1.0)], - [cf_cxx_library=yes - CXXLIBS="$CXXLIBS -lg++ -lm"], - [cf_cxx_library=no]) - LIBS="$cf_save" - AC_MSG_RESULT($cf_cxx_library) +if test -n "$CXX" ; then +AC_CACHE_CHECK(if $CXX accepts parameter initialization,cf_cv_cpp_param_init,[ + AC_LANG_CPLUSPLUS + AC_TRY_RUN([ +class TEST { +private: + int value; +public: + TEST(int x = 1); + ~TEST(); +}; + +TEST::TEST(int x = 1) // some compilers do not like second initializer +{ + value = x; +} +void main() { } +], + [cf_cv_cpp_param_init=yes], + [cf_cv_cpp_param_init=no], + [cf_cv_cpp_param_init=unknown]) +]) fi +test "$cf_cv_cpp_param_init" = yes && AC_DEFINE(CPP_HAS_PARAM_INIT) ])dnl dnl --------------------------------------------------------------------------- AC_DEFUN([CF_DIRS_TO_MAKE], @@ -410,8 +423,8 @@ do AC_TRY_COMPILE([ #include ],[],[ - test -n "$cf_math" && AC_DEFINE(ETIP_NEEDS_${cf_math}) - test -n "$cf_excp" && AC_DEFINE(ETIP_NEEDS_${cf_excp}) + test -n "$cf_math" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_math}) + test -n "$cf_excp" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_excp}) cf_result="$cf_math $cf_excp" break ],[]) @@ -473,7 +486,7 @@ cat > conftest.i < conftest.$ac_ext <&AC_FD_CC + echo "checking for $CC $cf_directive" 1>&AC_FD_CC case $cf_attribute in scanf|printf) cat >conftest.h < + ], + [//float foo=abs(1.0); + two_arg_error_handler_t foo2 = lib_error_handler], + [cf_cxx_library=yes + CXXLIBS="$CXXLIBS -l$cf_gpp_libname -lm" + if test "$cf_gpp_libname" = cpp ; then + AC_DEFINE(HAVE_GPP_BUILTIN_H) + else + AC_DEFINE(HAVE_GXX_BUILTIN_H) + fi], + [AC_TRY_LINK([ +#include + ], + [//float foo=abs(1.0); + two_arg_error_handler_t foo2 = lib_error_handler], + [cf_cxx_library=yes + CXXLIBS="$CXXLIBS -l$cf_gpp_libname -lm" + AC_DEFINE(HAVE_BUILTIN_H)], + [cf_cxx_library=no])]) + LIBS="$cf_save" + AC_MSG_RESULT($cf_cxx_library) +fi +])dnl +dnl --------------------------------------------------------------------------- dnl Insert text into the help-message, for readability, from AC_ARG_WITH. AC_DEFUN([CF_HELP_MESSAGE], [AC_DIVERT_HELP([$1])dnl @@ -675,6 +732,8 @@ AC_DEFUN([CF_LIB_PREFIX], os2) $1='' ;; *) $1='lib' ;; esac + LIB_PREFIX=[$]$1 + AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- dnl Append definitions and rules for the given models to the subdirectory @@ -821,10 +880,12 @@ done cat >> Makefile <cf_makeflags.tmp <],[ +char buf[80]; +strstreambuf foo(buf, sizeof(buf)) +//destroy foo +], + [cf_cv_libstdcpp=yes], + [cf_cv_libstdcpp=no]) + LIBS="$cf_save" +]) +test $cf_cv_libstdcpp = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +fi +])dnl +dnl --------------------------------------------------------------------------- dnl Remove "-g" option from the compiler options AC_DEFUN([CF_STRIP_G_OPT], [$1=`echo ${$1} | sed -e 's/-g //' -e 's/-g$//'`])dnl -- cgit v1.1