diff --git a/ChangeLog b/ChangeLog index 577002a1..4ebfc4a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,19 @@ +2005-05-05 Paul Eggert + + Fix C++ related problems reported by Werner Lemberg. + * doc/autoconf.texi (C++ Compiler): Mention .cpp extension. + * lib/autoconf/c.m4 (AC_LANG(C++)): Set ac_ext to .cpp, not .cc. + * lib/autoconf/types.m4 (AC_TYPE_SIGNAL): Simplify test, to + avoid problems with C++ and throw. + * tests/compile.at: .cpp, not .cc. + + * tests/semantics.at: Prepend LIBOBJDIR, as per 2005-05-02 change. + 2005-05-05 Ralf Wildenhues * doc/autoconf.texi (Generic Functions): Typos. -2004-05-02 Gary V. Vaughan +2005-05-02 Gary V. Vaughan * lib/autoconf/general.m4 (_AC_LIBOBJS_NORMALIZE): Prepend each object named in LIBOBJS and LTLIBOBJS with the ${LIBOBJDIR}, as diff --git a/doc/autoconf.texi b/doc/autoconf.texi index a9c900f9..0841f939 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -5990,8 +5990,8 @@ compilers. @ovindex CXXCPP Set output variable @code{CXXCPP} to a command that runs the C++ preprocessor. If @samp{$CXX -E} doesn't work, @file{/lib/cpp} is used. -It is only portable to run @code{CXXCPP} on files with a @file{.c}, -@file{.C}, or @file{.cc} extension. +It is portable to run @code{CXXCPP} only on files with a @file{.c}, +@file{.C}, @file{.cc}, or @file{.cpp} extension. Some preprocessors don't indicate missing include files by the error status. For such preprocessors an internal variable is set that causes diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index b72710fe..28647e81 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -90,7 +90,7 @@ m4_define([_AC_LANG_PREFIX(C)], [C]) # ------------ # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. m4_define([AC_LANG(C++)], -[ac_ext=cc +[ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD' diff --git a/lib/autoconf/types.m4 b/lib/autoconf/types.m4 index 85c5fd93..b6a17632 100644 --- a/lib/autoconf/types.m4 +++ b/lib/autoconf/types.m4 @@ -1,6 +1,6 @@ # This file is part of Autoconf. -*- Autoconf -*- # Type related macros: existence, sizeof, and structure members. -# Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -355,18 +355,10 @@ AC_DEFUN([AC_TYPE_SIGNAL], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([#include #include -#ifdef signal -# undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); -#endif ], - [int i;])], - [ac_cv_type_signal=void], - [ac_cv_type_signal=int])]) + [return *(signal (0, 0)) (0) == 1;])], + [ac_cv_type_signal=int], + [ac_cv_type_signal=void])]) AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal, [Define as the return type of signal handlers (`int' or `void').]) diff --git a/tests/compile.at b/tests/compile.at index 797245bb..d47492bd 100644 --- a/tests/compile.at +++ b/tests/compile.at @@ -2,7 +2,7 @@ AT_BANNER([Low level compiling/preprocessing macros.]) -# Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2003, 2005 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -59,11 +59,11 @@ AT_CHECK([sed -n 's/^ac_ext=//p' configure], 0, [c c c -cc -cc +cpp +cpp f -cc -cc +cpp +cpp c c ])