autoconf-patches
[Top][All Lists]
Advanced

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

ac-lang-compiler-gnu.patch


From: Akim Demaille
Subject: ac-lang-compiler-gnu.patch
Date: 12 Oct 2000 18:20:15 +0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

The aim is to reach the day where all the languages share the same
skeleton.

There is one thing which needs to be debated: I believe it is OK to
compile an empty file with GNU compilers, but if I'm wrong, then
replacing AC_LANG_SOURCE with AC_LANG_PROGRAM should make it.

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * aclang.m4 (_AC_LANG_COMPILER_GNU): New macro, which unifies...
        (_AC_PROG_F77_GNU, _AC_PROG_CC_GNU, _AC_PROG_CXX_GNU): Remove.
        Adjust dependencies.

Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.568
diff -u -r1.568 acgeneral.m4
--- acgeneral.m4 2000/10/12 14:45:06 1.568
+++ acgeneral.m4 2000/10/12 16:02:39
@@ -5393,7 +5393,7 @@
 # doesn't currently support.
 # FIXME: Get rid of this macro.
 AC_DEFUN([AC_LINKER_OPTION],
-[if test "ac_gnu_compiler" = yes; then
+[if test "$ac_compiler_gnu" = yes; then
   for ac_link_opt in $1; do
     $2="[$]$2 -Xlinker $ac_link_opt"
   done
Index: aclang.m4
===================================================================
RCS file: /cvs/autoconf/aclang.m4,v
retrieving revision 1.70
diff -u -r1.70 aclang.m4
--- aclang.m4 2000/10/12 12:39:25 1.70
+++ aclang.m4 2000/10/12 16:02:40
@@ -176,7 +176,7 @@
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG'
 ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS 
conftest.$ac_ext $LIBS >&AC_FD_LOG'
-ac_gnu_compiler=$ac_cv_prog_gcc
+ac_compiler_gnu=$ac_[]_AC_LANG_ABBREV[]_cv_compiler_gnu
 ])


@@ -203,7 +203,7 @@
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG'
 ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS 
conftest.$ac_ext $LIBS >&AC_FD_LOG'
-ac_gnu_compiler=$ac_cv_prog_gxx
+ac_compiler_gnu=$ac_[]_AC_LANG_ABBREV[]_cv_compiler_gnu
 ])


@@ -228,7 +228,7 @@
 [ac_ext=f
 ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext >&AC_FD_LOG'
 ac_link='${F77-f77} -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext 
$LIBS >&AC_FD_LOG'
-ac_gnu_compiler=$ac_cv_prog_g77
+ac_compiler_gnu=$ac_[]_AC_LANG_ABBREV[]_cv_compiler_gnu
 ])


@@ -542,6 +542,23 @@
 ])# _AC_LANG_COMPILER_WORKS


+# _AC_LANG_COMPILER_GNU
+# ---------------------
+# Check whether the compiler for the current language is GNU.
+define([_AC_LANG_COMPILER_GNU],
+[AC_CACHE_CHECK([whether we are using the GNU _AC_LANG compiler],
+                [ac_[]_AC_LANG_ABBREV[]_cv_compiler_gnu],
+[_AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#ifndef __GNUC__
+  choke me
+#endif
+]])],
+                   [ac_compiler_gnu=yes],
+                   [ac_compiler_gnu=no])
+ac_[]_AC_LANG_ABBREV[]_cv_compiler_gnu=$ac_compiler_gnu
+])])# _AC_LANG_COMPILER_GNU
+
+
+
 # AC_NO_EXECUTABLES
 # -----------------
 # FIXME: The GCC team has specific needs which the current Autoconf
@@ -687,7 +704,8 @@
 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])

 _AC_LANG_COMPILER_WORKS
-_AC_PROG_CC_GNU
+_AC_LANG_COMPILER_GNU
+GCC=`test $ac_compiler_gnu = yes && echo yes`
 _AC_PROG_CC_G
 AC_EXPAND_ONCE([_AC_OBJEXT])
 AC_EXPAND_ONCE([_AC_EXEEXT])
@@ -695,30 +713,6 @@
 ])# AC_PROG_CC


-# _AC_PROG_CC_GNU
-# ---------------
-define([_AC_PROG_CC_GNU],
-[AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
-[# The semicolon is to pacify NeXT's syntax-checking cpp.
-cat >conftest.$ac_ext <<_ACEOF
-#ifdef __GNUC__
-  yes;
-#endif
-_ACEOF
-if AC_TRY_COMMAND(${CC-cc} -E conftest.$ac_ext) | grep yes >/dev/null; then
-  ac_cv_prog_gcc=yes
-else
-  ac_cv_prog_gcc=no
-fi])
-ac_gnu_compiler=$ac_cv_prog_gcc
-if test $ac_gnu_compiler = yes; then
-  GCC=yes
-else
-  GCC=
-fi[]dnl
-])# _AC_PROG_CC_GNU
-
-
 # _AC_PROG_CC_G
 # -------------
 # Check whether -g works, even if CFLAGS is set, in case the package
@@ -760,7 +754,7 @@
 AC_DEFUN([AC_PROG_GCC_TRADITIONAL],
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_REQUIRE([AC_PROG_CPP])dnl
-if test $ac_cv_prog_gcc = yes; then
+if test $ac_c_cv_compiler_gnu = yes; then
     AC_CACHE_CHECK(whether ${CC-cc} needs -traditional,
       ac_cv_prog_gcc_traditional,
 [  ac_pattern="Autoconf.*'x'"
@@ -899,7 +893,8 @@
                g++)

 _AC_LANG_COMPILER_WORKS
-_AC_PROG_CXX_GNU
+_AC_LANG_COMPILER_GNU
+GXX=`test $ac_compiler_gnu = yes && echo yes`
 _AC_PROG_CXX_G
 AC_EXPAND_ONCE([_AC_OBJEXT])
 AC_EXPAND_ONCE([_AC_EXEEXT])
@@ -907,30 +902,6 @@
 ])# AC_PROG_CXX


-# _AC_PROG_CXX_GNU
-# ----------------
-define([_AC_PROG_CXX_GNU],
-[AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx,
-[# The semicolon is to pacify NeXT's syntax-checking cpp.
-cat >conftest.$ac_ext <<_ACEOF
-#ifdef __GNUC__
-  yes;
-#endif
-_ACEOF
-if AC_TRY_COMMAND(${CXX-g++} -E conftest.$ac_ext) | grep yes >/dev/null; then
-  ac_cv_prog_gxx=yes
-else
-  ac_cv_prog_gxx=no
-fi])
-ac_gnu_compiler=$ac_cv_prog_gxx
-if test $ac_gnu_compiler = yes; then
-  GXX=yes
-else
-  GXX=
-fi[]dnl
-])# _AC_PROG_CXX_GNU
-
-
 # _AC_PROG_CXX_G
 # --------------
 # Check whether -g works, even if CXXFLAGS is set, in case the package
@@ -1006,38 +977,13 @@
                   [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 fc])])

 _AC_LANG_COMPILER_WORKS
-_AC_PROG_F77_GNU
+_AC_LANG_COMPILER_GNU
+G77=`test $ac_compiler_gnu = yes && echo yes`
 _AC_PROG_F77_G
 AC_EXPAND_ONCE([_AC_OBJEXT])
 AC_EXPAND_ONCE([_AC_EXEEXT])
 AC_LANG_POP
 ])# AC_PROG_F77
-
-
-# _AC_PROG_F77_GNU
-# ----------------
-# Test whether for Fortran 77 compiler is `g77' (the GNU Fortran 77
-# Compiler).  This test depends on whether the Fortran 77 compiler can
-# do CPP pre-processing.
-define([_AC_PROG_F77_GNU],
-[AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77,
-[cat >conftest.$ac_ext <<_ACEOF
-#ifdef __GNUC__
-  yes
-#endif
-_ACEOF
-if AC_TRY_COMMAND($F77 -E - <conftest.$ac_ext) | grep yes >/dev/null; then
-  ac_cv_prog_g77=yes
-else
-  ac_cv_prog_g77=no
-fi])
-ac_gnu_compiler=$ac_cv_prog_g77
-if test $ac_gnu_compiler = yes; then
-  G77=yes
-else
-  G77=
-fi[]dnl
-])# _AC_PROG_F77_GNU


 # _AC_PROG_F77_G



reply via email to

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