autoconf-patches
[Top][All Lists]
Advanced

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

62-ac-lang-assert.patch


From: Akim Demaille
Subject: 62-ac-lang-assert.patch
Date: Tue, 05 Dec 2000 09:44:27 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        
        * aclang.m4 (AC_LANG): Be `smart': don't issue teh sh code if the
        current language did not change.
        (AC_LANG_ASSERT): New.
        (AC_PROG_CPP, AC_PROG_CXXCPP): Assert the language.
        (_AC_PROG_F77_V, _AC_F77_NAME_MANGLING): Don't require
        AC_PROG_F77, the code you include does it.
        (AC_F77_LIBRARY_LDFLAGS): Set the language.
        
Index: aclang.m4
--- aclang.m4 Sat, 02 Dec 2000 13:28:42 +0100 akim (ace/b/32_aclang.m4 1.5.3.52 
644)
+++ aclang.m4 Sun, 03 Dec 2000 14:40:57 +0100 akim (ace/b/32_aclang.m4 1.5.3.52 
644)
@@ -117,8 +117,9 @@ m4_define([_AC_LANG_DISPATCH],
 # If you add quotes here, they will be part of the name too, yielding
 # `AC_LANG([C])' for instance, which does not exist.
 AC_DEFUN([AC_LANG],
-[m4_define([_AC_LANG], [$1])dnl
-_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+[m4_if(m4_defn([_AC_LANG]), [$1], [],
+       [m4_define([_AC_LANG], [$1])dnl
+_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])])
 
 
 # AC_LANG_PUSH(LANG)
@@ -162,6 +163,15 @@ m4_define([_AC_LANG_ABBREV],
 [_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
 
 
+# AC_LANG_ASSERT(LANG)
+# --------------------
+# Current language must be LANG.
+m4_define([AC_LANG_ASSERT],
+[m4_if(_AC_LANG, $1, [],
+       [m4_fatal([$0: current language is not $1: ] _AC_LANG)])])
+
+
+
 # -------------------- #
 # 1b. The C language.  #
 # -------------------- #
@@ -668,7 +678,7 @@ AC_DEFUN([_AC_PROG_PREPROC_WORKS],
 # Find a working C preprocessor
 AC_DEFUN([AC_PROG_CPP],
 [AC_MSG_CHECKING([how to run the C preprocessor])
-AC_LANG_PUSH(C)dnl
+AC_LANG_ASSERT(C)dnl
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -696,7 +706,6 @@ AC_DEFUN([AC_PROG_CPP],
   AC_MSG_ERROR([C preprocessor "$CPP" fails sanity check])
 fi
 AC_SUBST(CPP)dnl
-AC_LANG_POP()dnl
 ])# AC_PROG_CPP
 
 
@@ -871,7 +880,7 @@ AC_DEFUN([AC_LANG_PREPROC(C++)],
 # Find a working C++ preprocessor
 AC_DEFUN([AC_PROG_CXXCPP],
 [AC_MSG_CHECKING([how to run the C++ preprocessor])
-AC_LANG_PUSH(C++)dnl
+AC_LANG_ASSERT(C++)dnl
 if test -z "$CXXCPP"; then
   AC_CACHE_VAL(ac_cv_prog_CXXCPP,
   [dnl
@@ -895,7 +904,6 @@ AC_DEFUN([AC_PROG_CXXCPP],
   AC_MSG_ERROR([C++ preprocessor "$CXXCPP" fails sanity check])
 fi
 AC_SUBST(CXXCPP)dnl
-AC_LANG_POP()dnl
 ])# AC_PROG_CXXCPP
 
 
@@ -1495,10 +1503,9 @@ AC_DEFUN([_AC_PROG_F77_V_OUTPUT],
 # Needed for AC_F77_LIBRARY_FLAGS
 # Some compilers don't accept -v (Lahey: -verbose, xlf: -V)
 AC_DEFUN([_AC_PROG_F77_V],
-[AC_REQUIRE([AC_PROG_F77])dnl
-AC_CACHE_CHECK([how to get verbose linking output from $F77],
-               [ac_cv_prog_f77_v],
-[AC_LANG_PUSH(Fortran 77)
+[AC_CACHE_CHECK([how to get verbose linking output from $F77],
+                [ac_cv_prog_f77_v],
+[AC_LANG_ASSERT(Fortran 77)
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
 [ac_cv_prog_f77_v=
 # Try some options frequently used verbose output
@@ -1517,7 +1524,6 @@ AC_DEFUN([_AC_PROG_F77_V],
    AC_MSG_WARN([cannot determine how to obtain linking information from $F77])
 fi],
                   [AC_MSG_WARN([compilation failed])])
-AC_LANG_POP()dnl
 ])])# _AC_PROG_F77_V
 
 
@@ -1550,7 +1556,7 @@ AC_DEFUN([_AC_PROG_F77_V],
 # in "octave-2.0.13/aclocal.m4", and full credit should go to John
 # W. Eaton for writing this extremely useful macro.  Thank you John.
 AC_DEFUN([AC_F77_LIBRARY_LDFLAGS],
-[AC_REQUIRE([AC_PROG_F77])dnl
+[AC_LANG_PUSH(Fortran 77)dnl
 _AC_PROG_F77_V
 AC_CACHE_CHECK([for Fortran 77 libraries], ac_cv_flibs,
 [if test "x$FLIBS" != "x"; then
@@ -1628,6 +1634,7 @@ AC_DEFUN([AC_F77_LIBRARY_LDFLAGS],
 ])
 FLIBS="$ac_cv_flibs"
 AC_SUBST(FLIBS)
+AC_LANG_POP()dnl
 ])# AC_F77_LIBRARY_LDFLAGS
 
 
@@ -1635,7 +1642,8 @@ AC_DEFUN([AC_F77_LIBRARY_LDFLAGS],
 # ---------------------
 # Test for the name mangling scheme used by the Fortran 77 compiler.
 #
-# Sets ac_cv_f77_mangling. The value contains three fields, separated by 
commas:
+# Sets ac_cv_f77_mangling. The value contains three fields, separated
+# by commas:
 #
 # lower case / upper case:
 #    case translation of the Fortan 77 symbols
@@ -1646,9 +1654,7 @@ AC_DEFUN([AC_F77_LIBRARY_LDFLAGS],
 #    containing at least one underscore
 #
 AC_DEFUN([_AC_F77_NAME_MANGLING],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_F77])dnl
-AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])dnl
+[AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])dnl
 AC_CACHE_CHECK([for Fortran 77 name-mangling scheme],
                ac_cv_f77_mangling,
 [AC_LANG_PUSH(Fortran 77)



reply via email to

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