autoconf-patches
[Top][All Lists]
Advanced

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

01-ac-lang-compiler-require.patch (Was: CC/CPP/TRY_LINK)


From: Akim Demaille
Subject: 01-ac-lang-compiler-require.patch (Was: CC/CPP/TRY_LINK)
Date: 07 Nov 2000 11:08:38 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

Thanks for the report, it's a known bug.  In fact this bug is not new,
what is new is that the core machinery now correctly catches it.

The problem is related to the fact that AC_PROG_CC can be expanded
twice, and since the first expansion expands AC_PROG_CPP, the second
expansion of AC_PROG_CC will complain because AC_PROG_CPP was run
beforehand.

The following patch fixes this issue.  There was another obvious
implementation possibility: having AC_LANG_COMPILER(C) provide
AC_PROG_CC, but I think this approach is better.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        When running

        AC_INIT
        AC_PROG_CC
        AC_LANG_COMPILER_REQUIRE

        AC_PROG_CC is expanded twice, because AC_PROG_CC provides
        `AC_PROG_CC', and not `AC_LANG_COMPILER(C)' as expected by
        AC_LANG_COMPILER_REQUIRE.

        * aclang.m4 (AC_LANG_COMPILER(C)): Instead of calling AC_PROG_CC,
        require it.
        (AC_LANG_COMPILER(C++), AC_LANG_COMPILER(Fortran 77)): Likewise.

Index: aclang.m4
===================================================================
RCS file: /cvs/autoconf/aclang.m4,v
retrieving revision 1.81
diff -u -u -r1.81 aclang.m4
--- aclang.m4 2000/11/03 14:01:58 1.81
+++ aclang.m4 2000/11/07 10:09:44
@@ -675,7 +675,7 @@
 # -------------------
 # Find the C compiler.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
 AC_DEFUN([AC_LANG_COMPILER(C)],
-[AC_PROG_CC])
+[AC_REQUIRE([AC_PROG_CC])])
 
 
 # ac_cv_prog_gcc
@@ -869,7 +869,7 @@
 # ---------------------
 # Find the C++ compiler.  Must be AC_DEFUN'd to be AC_REQUIRE'able.
 AC_DEFUN([AC_LANG_COMPILER(C++)],
-[AC_PROG_CXX])
+[AC_REQUIRE([AC_PROG_CXX])])
 
 
 # ac_cv_prog_gxx
@@ -951,7 +951,7 @@
 # Find the Fortran 77 compiler.  Must be AC_DEFUN'd to be
 # AC_REQUIRE'able.
 AC_DEFUN([AC_LANG_COMPILER(Fortran 77)],
-[AC_PROG_F77])
+[AC_REQUIRE([AC_PROG_F77])])
 
 
 # ac_cv_prog_g77



reply via email to

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