From: Akim Demaille Date: Fri, 19 May 2000 12:55:02 +0000 (+0000) Subject: * aclang.m4 (AC_PROG_CC_GNU, AC_PROG_CXX_GNU, AC_PROG_F77_GNU): X-Git-Tag: autoconf-2.50~903 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffb32e07419c86704cd3c1225fab4bd469fbd0a1;p=thirdparty%2Fautoconf.git * aclang.m4 (AC_PROG_CC_GNU, AC_PROG_CXX_GNU, AC_PROG_F77_GNU): Rename as: (_AC_PROG_CC_GNU, _AC_PROG_CXX_GNU, _AC_PROG_F77_GNU): these. Compute the value of GCC, GXX and G77 here. Set to `no' (instead of empty) if not the GNU compiler. (AC_PROG_CC, AC_PROG_CXX, AC_PROG_F77): Adjust. * doc/autoconf.texi: Adjust. --- diff --git a/ChangeLog b/ChangeLog index 8536afd9b..8a1bf72ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2000-05-19 Akim Demaille + + * aclang.m4 (AC_PROG_CC_GNU, AC_PROG_CXX_GNU, AC_PROG_F77_GNU): + Rename as: + (_AC_PROG_CC_GNU, _AC_PROG_CXX_GNU, _AC_PROG_F77_GNU): these. + Compute the value of GCC, GXX and G77 here. + Set to `no' (instead of empty) if not the GNU compiler. + (AC_PROG_CC, AC_PROG_CXX, AC_PROG_F77): Adjust. + * doc/autoconf.texi: Adjust. + 2000-05-19 Akim Demaille Fix Autoconf/106. diff --git a/aclang.m4 b/aclang.m4 index 45e6ca3a7..b7df8c446 100644 --- a/aclang.m4 +++ b/aclang.m4 @@ -399,13 +399,7 @@ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) if test "$cross_compiling" != yes; then AC_PROG_CC_WORKS fi -AC_PROG_CC_GNU - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi +_AC_PROG_CC_GNU dnl Check whether -g works, even if CFLAGS is set, in case the package dnl plays around with CFLAGS (such as to build both debugging and @@ -453,9 +447,9 @@ fi ])# AC_PROG_CC_WORKS -# AC_PROG_CC_GNU -# -------------- -AC_DEFUN(AC_PROG_CC_GNU, +# _AC_PROG_CC_GNU +# --------------- +define([_AC_PROG_CC_GNU], [AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat >conftest.c </dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no -fi])[]dnl -])# AC_PROG_CC_GNU +fi]) +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi[]dnl +])# _AC_PROG_CC_GNU # AC_PROG_CC_G @@ -599,13 +598,7 @@ AC_CHECK_PROGS(CXX, $CCC m4_default([$1], [c++ g++ gpp CC cxx cc++ cl]), g++) if test "$cross_compiling" != yes; then AC_PROG_CXX_WORKS fi -AC_PROG_CXX_GNU - -if test $ac_cv_prog_gxx = yes; then - GXX=yes -else - GXX= -fi +_AC_PROG_CXX_GNU dnl Check whether -g works, even if CXXFLAGS is set, in case the package dnl plays around with CXXFLAGS (such as to build both debugging and @@ -653,9 +646,9 @@ fi ])# AC_PROG_CXX_WORKS -# AC_PROG_CXX_GNU -# --------------- -AC_DEFUN(AC_PROG_CXX_GNU, +# _AC_PROG_CXX_GNU +# ---------------- +define([_AC_PROG_CXX_GNU], [AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat >conftest.C </dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no -fi])[]dnl -])# AC_PROG_CXX_GNU +fi]) + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +else + GXX= +fi[]dnl +])# _AC_PROG_CXX_GNU # AC_PROG_CXX_G @@ -703,13 +702,7 @@ AC_CHECK_PROGS(F77, if test "$cross_compiling" != yes; then AC_PROG_F77_WORKS fi -AC_PROG_F77_GNU - -if test $ac_cv_prog_g77 = yes; then - G77=yes -else - G77= -fi +_AC_PROG_F77_GNU dnl Check whether -g works, even if FFLAGS is set, in case the package dnl plays around with FFLAGS (such as to build both debugging and @@ -763,12 +756,12 @@ fi ])# AC_PROG_F77_WORKS -# AC_PROG_F77_GNU -# --------------- +# _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. -AC_DEFUN(AC_PROG_F77_GNU, +define([_AC_PROG_F77_GNU], [AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77, [cat >conftest.fpp </dev/null 2>&1; then ac_cv_prog_g77=yes else ac_cv_prog_g77=no -fi])])# AC_PROG_F77_GNU +fi]) +if test $ac_cv_prog_g77 = yes; then + G77=yes +else + G77= +fi[]dnl +])# _AC_PROG_F77_GNU # AC_PROG_F77_G diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 55bafdc2c..ced9da0ef 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -2353,10 +2353,9 @@ AC_PROG_CC(cl egcs gcc cc) @end example If using the @sc{gnu} C compiler, set shell variable @code{GCC} to -@samp{yes}, empty otherwise. If output variable @code{CFLAGS} was not -already set, set it to @samp{-g -O2} for the @sc{gnu} C compiler -(@samp{-O2} on systems where GCC does not accept @samp{-g}), or -@samp{-g} for other compilers. +@samp{yes}. If output variable @code{CFLAGS} was not already set, set +it to @samp{-g -O2} for the @sc{gnu} C compiler (@samp{-O2} on systems +where GCC does not accept @samp{-g}), or @samp{-g} for other compilers. If the compiler being used does not produce executables, fail. If the executables can't be run, and cross-compilation is not enabled, fail. @@ -2431,10 +2430,9 @@ AC_PROG_CXX(cl KCC CC cxx cc++ xlC aCC c++ g++ egcs gcc) @end example If using the @sc{gnu} C++ compiler, set shell variable @code{GXX} to -@samp{yes}, empty otherwise. If output variable @code{CXXFLAGS} was not -already set, set it to @samp{-g -O2} for the @sc{gnu} C++ compiler -(@samp{-O2} on systems where G++ does not accept @samp{-g}), or -@samp{-g} for other compilers. +@samp{yes}. If output variable @code{CXXFLAGS} was not already set, set +it to @samp{-g -O2} for the @sc{gnu} C++ compiler (@samp{-O2} on systems +where G++ does not accept @samp{-g}), or @samp{-g} for other compilers. If the compiler being used does not produce executables, fail. If the executables can't be run, and cross-compilation is not enabled, fail. @@ -2477,12 +2475,11 @@ AC_PROG_F77(fl32 f77 fort77 xlf cf77 g77 f90 xlf90 f2c) @end example If using @code{g77} (the @sc{gnu} Fortran 77 compiler), then -@code{AC_PROG_F77} will set the shell variable @code{G77} to @samp{yes}, -and empty otherwise. If the output variable @code{FFLAGS} was not -already set in the environment, then set it to @samp{-g -02} for -@code{g77} (or @samp{-O2} where @code{g77} does not accept @samp{-g}). -Otherwise, set @code{FFLAGS} to @samp{-g} for all other Fortran 77 -compilers. +@code{AC_PROG_F77} will set the shell variable @code{G77} to @samp{yes}. +If the output variable @code{FFLAGS} was not already set in the +environment, then set it to @samp{-g -02} for @code{g77} (or @samp{-O2} +where @code{g77} does not accept @samp{-g}). Otherwise, set +@code{FFLAGS} to @samp{-g} for all other Fortran 77 compilers. If the compiler being used does not produce executables, fail. If the executables can't be run, and cross-compilation is not enabled, fail. diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 45e6ca3a7..b7df8c446 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -399,13 +399,7 @@ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) if test "$cross_compiling" != yes; then AC_PROG_CC_WORKS fi -AC_PROG_CC_GNU - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi +_AC_PROG_CC_GNU dnl Check whether -g works, even if CFLAGS is set, in case the package dnl plays around with CFLAGS (such as to build both debugging and @@ -453,9 +447,9 @@ fi ])# AC_PROG_CC_WORKS -# AC_PROG_CC_GNU -# -------------- -AC_DEFUN(AC_PROG_CC_GNU, +# _AC_PROG_CC_GNU +# --------------- +define([_AC_PROG_CC_GNU], [AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat >conftest.c </dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no -fi])[]dnl -])# AC_PROG_CC_GNU +fi]) +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi[]dnl +])# _AC_PROG_CC_GNU # AC_PROG_CC_G @@ -599,13 +598,7 @@ AC_CHECK_PROGS(CXX, $CCC m4_default([$1], [c++ g++ gpp CC cxx cc++ cl]), g++) if test "$cross_compiling" != yes; then AC_PROG_CXX_WORKS fi -AC_PROG_CXX_GNU - -if test $ac_cv_prog_gxx = yes; then - GXX=yes -else - GXX= -fi +_AC_PROG_CXX_GNU dnl Check whether -g works, even if CXXFLAGS is set, in case the package dnl plays around with CXXFLAGS (such as to build both debugging and @@ -653,9 +646,9 @@ fi ])# AC_PROG_CXX_WORKS -# AC_PROG_CXX_GNU -# --------------- -AC_DEFUN(AC_PROG_CXX_GNU, +# _AC_PROG_CXX_GNU +# ---------------- +define([_AC_PROG_CXX_GNU], [AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat >conftest.C </dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no -fi])[]dnl -])# AC_PROG_CXX_GNU +fi]) + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +else + GXX= +fi[]dnl +])# _AC_PROG_CXX_GNU # AC_PROG_CXX_G @@ -703,13 +702,7 @@ AC_CHECK_PROGS(F77, if test "$cross_compiling" != yes; then AC_PROG_F77_WORKS fi -AC_PROG_F77_GNU - -if test $ac_cv_prog_g77 = yes; then - G77=yes -else - G77= -fi +_AC_PROG_F77_GNU dnl Check whether -g works, even if FFLAGS is set, in case the package dnl plays around with FFLAGS (such as to build both debugging and @@ -763,12 +756,12 @@ fi ])# AC_PROG_F77_WORKS -# AC_PROG_F77_GNU -# --------------- +# _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. -AC_DEFUN(AC_PROG_F77_GNU, +define([_AC_PROG_F77_GNU], [AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77, [cat >conftest.fpp </dev/null 2>&1; then ac_cv_prog_g77=yes else ac_cv_prog_g77=no -fi])])# AC_PROG_F77_GNU +fi]) +if test $ac_cv_prog_g77 = yes; then + G77=yes +else + G77= +fi[]dnl +])# _AC_PROG_F77_GNU # AC_PROG_F77_G diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index 45e6ca3a7..b7df8c446 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -399,13 +399,7 @@ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) if test "$cross_compiling" != yes; then AC_PROG_CC_WORKS fi -AC_PROG_CC_GNU - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi +_AC_PROG_CC_GNU dnl Check whether -g works, even if CFLAGS is set, in case the package dnl plays around with CFLAGS (such as to build both debugging and @@ -453,9 +447,9 @@ fi ])# AC_PROG_CC_WORKS -# AC_PROG_CC_GNU -# -------------- -AC_DEFUN(AC_PROG_CC_GNU, +# _AC_PROG_CC_GNU +# --------------- +define([_AC_PROG_CC_GNU], [AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat >conftest.c </dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no -fi])[]dnl -])# AC_PROG_CC_GNU +fi]) +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi[]dnl +])# _AC_PROG_CC_GNU # AC_PROG_CC_G @@ -599,13 +598,7 @@ AC_CHECK_PROGS(CXX, $CCC m4_default([$1], [c++ g++ gpp CC cxx cc++ cl]), g++) if test "$cross_compiling" != yes; then AC_PROG_CXX_WORKS fi -AC_PROG_CXX_GNU - -if test $ac_cv_prog_gxx = yes; then - GXX=yes -else - GXX= -fi +_AC_PROG_CXX_GNU dnl Check whether -g works, even if CXXFLAGS is set, in case the package dnl plays around with CXXFLAGS (such as to build both debugging and @@ -653,9 +646,9 @@ fi ])# AC_PROG_CXX_WORKS -# AC_PROG_CXX_GNU -# --------------- -AC_DEFUN(AC_PROG_CXX_GNU, +# _AC_PROG_CXX_GNU +# ---------------- +define([_AC_PROG_CXX_GNU], [AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat >conftest.C </dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no -fi])[]dnl -])# AC_PROG_CXX_GNU +fi]) + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +else + GXX= +fi[]dnl +])# _AC_PROG_CXX_GNU # AC_PROG_CXX_G @@ -703,13 +702,7 @@ AC_CHECK_PROGS(F77, if test "$cross_compiling" != yes; then AC_PROG_F77_WORKS fi -AC_PROG_F77_GNU - -if test $ac_cv_prog_g77 = yes; then - G77=yes -else - G77= -fi +_AC_PROG_F77_GNU dnl Check whether -g works, even if FFLAGS is set, in case the package dnl plays around with FFLAGS (such as to build both debugging and @@ -763,12 +756,12 @@ fi ])# AC_PROG_F77_WORKS -# AC_PROG_F77_GNU -# --------------- +# _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. -AC_DEFUN(AC_PROG_F77_GNU, +define([_AC_PROG_F77_GNU], [AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77, [cat >conftest.fpp </dev/null 2>&1; then ac_cv_prog_g77=yes else ac_cv_prog_g77=no -fi])])# AC_PROG_F77_GNU +fi]) +if test $ac_cv_prog_g77 = yes; then + G77=yes +else + G77= +fi[]dnl +])# _AC_PROG_F77_GNU # AC_PROG_F77_G diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4 index 45e6ca3a7..b7df8c446 100644 --- a/lib/autoconf/lang.m4 +++ b/lib/autoconf/lang.m4 @@ -399,13 +399,7 @@ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) if test "$cross_compiling" != yes; then AC_PROG_CC_WORKS fi -AC_PROG_CC_GNU - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi +_AC_PROG_CC_GNU dnl Check whether -g works, even if CFLAGS is set, in case the package dnl plays around with CFLAGS (such as to build both debugging and @@ -453,9 +447,9 @@ fi ])# AC_PROG_CC_WORKS -# AC_PROG_CC_GNU -# -------------- -AC_DEFUN(AC_PROG_CC_GNU, +# _AC_PROG_CC_GNU +# --------------- +define([_AC_PROG_CC_GNU], [AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat >conftest.c </dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no -fi])[]dnl -])# AC_PROG_CC_GNU +fi]) +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi[]dnl +])# _AC_PROG_CC_GNU # AC_PROG_CC_G @@ -599,13 +598,7 @@ AC_CHECK_PROGS(CXX, $CCC m4_default([$1], [c++ g++ gpp CC cxx cc++ cl]), g++) if test "$cross_compiling" != yes; then AC_PROG_CXX_WORKS fi -AC_PROG_CXX_GNU - -if test $ac_cv_prog_gxx = yes; then - GXX=yes -else - GXX= -fi +_AC_PROG_CXX_GNU dnl Check whether -g works, even if CXXFLAGS is set, in case the package dnl plays around with CXXFLAGS (such as to build both debugging and @@ -653,9 +646,9 @@ fi ])# AC_PROG_CXX_WORKS -# AC_PROG_CXX_GNU -# --------------- -AC_DEFUN(AC_PROG_CXX_GNU, +# _AC_PROG_CXX_GNU +# ---------------- +define([_AC_PROG_CXX_GNU], [AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat >conftest.C </dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no -fi])[]dnl -])# AC_PROG_CXX_GNU +fi]) + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +else + GXX= +fi[]dnl +])# _AC_PROG_CXX_GNU # AC_PROG_CXX_G @@ -703,13 +702,7 @@ AC_CHECK_PROGS(F77, if test "$cross_compiling" != yes; then AC_PROG_F77_WORKS fi -AC_PROG_F77_GNU - -if test $ac_cv_prog_g77 = yes; then - G77=yes -else - G77= -fi +_AC_PROG_F77_GNU dnl Check whether -g works, even if FFLAGS is set, in case the package dnl plays around with FFLAGS (such as to build both debugging and @@ -763,12 +756,12 @@ fi ])# AC_PROG_F77_WORKS -# AC_PROG_F77_GNU -# --------------- +# _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. -AC_DEFUN(AC_PROG_F77_GNU, +define([_AC_PROG_F77_GNU], [AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77, [cat >conftest.fpp </dev/null 2>&1; then ac_cv_prog_g77=yes else ac_cv_prog_g77=no -fi])])# AC_PROG_F77_GNU +fi]) +if test $ac_cv_prog_g77 = yes; then + G77=yes +else + G77= +fi[]dnl +])# _AC_PROG_F77_GNU # AC_PROG_F77_G