bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_TYPE_SIGNAL fails with CC=g++


From: Paul Eggert
Subject: Re: AC_TYPE_SIGNAL fails with CC=g++
Date: Thu, 05 May 2005 22:39:48 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Werner LEMBERG <address@hidden> writes:

> I have appended a better solution (taken from groff CVS, modeled after
> _AC_PROG_CXX_EXIT_DECLARATION).

Thanks, but how about the following simpler patch instead?  (It also
addresses your other bug report.)  I installed this one, for now anyway.

2005-05-05  Paul Eggert  <address@hidden>

        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.

Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.895
diff -p -u -r1.895 autoconf.texi
--- doc/autoconf.texi   5 May 2005 08:13:25 -0000       1.895
+++ doc/autoconf.texi   6 May 2005 05:26:15 -0000
@@ -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},
address@hidden, or @file{.cc} extension.
+It is portable to run @code{CXXCPP} only on files with a @file{.c},
address@hidden, @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
Index: lib/autoconf/c.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.198
diff -p -u -r1.198 c.m4
--- lib/autoconf/c.m4   25 Feb 2005 08:52:48 -0000      1.198
+++ lib/autoconf/c.m4   6 May 2005 05:26:15 -0000
@@ -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'
Index: lib/autoconf/types.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/types.m4,v
retrieving revision 1.29
diff -p -u -r1.29 types.m4
--- lib/autoconf/types.m4       3 May 2004 20:15:44 -0000       1.29
+++ lib/autoconf/types.m4       6 May 2005 05:26:15 -0000
@@ -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 <sys/types.h>
 #include <signal.h>
-#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').])
Index: tests/compile.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/compile.at,v
retrieving revision 1.27
diff -p -u -r1.27 compile.at
--- tests/compile.at    23 Jun 2003 11:11:42 -0000      1.27
+++ tests/compile.at    6 May 2005 05:26:15 -0000
@@ -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' configu
 [c
 c
 c
-cc
-cc
+cpp
+cpp
 f
-cc
-cc
+cpp
+cpp
 c
 c
 ])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]