From: Akim Demaille Date: Tue, 5 Dec 2000 14:08:35 +0000 (+0000) Subject: * aclang.m4 (AC_PROG_F77): Temporarily set ac_ext to F to run X-Git-Tag: autoconf-2.50~353 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e77a2341a09acef5d58945cdedc3822a82bf3b4c;p=thirdparty%2Fautoconf.git * aclang.m4 (AC_PROG_F77): Temporarily set ac_ext to F to run _AC_LANG_COMPILER_GNU. From Steven G. Johnson. * tests/compile.at (GNU Fortran 77): New test. --- diff --git a/ChangeLog b/ChangeLog index 414c6f5df..ba9f5f9e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-12-05 Akim Demaille + + * aclang.m4 (AC_PROG_F77): Temporarily set ac_ext to F to run + _AC_LANG_COMPILER_GNU. + From Steven G. Johnson. + * tests/compile.at (GNU Fortran 77): New test. + 2000-12-05 Akim Demaille * tests/tools.at (autoupdate): Strengthen and check autoupdate's diff --git a/aclang.m4 b/aclang.m4 index e9d4e7664..37158c9af 100644 --- a/aclang.m4 +++ b/aclang.m4 @@ -1030,7 +1030,12 @@ AC_CHECK_TOOLS(F77, [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 fc])]) _AC_LANG_COMPILER_WORKS +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. +ac_save_ext=$ac_ext +ac_ext=F _AC_LANG_COMPILER_GNU +ac_ext=$ac_save_ext G77=`test $ac_compiler_gnu = yes && echo yes` AC_EXPAND_ONCE([_AC_OBJEXT]) AC_EXPAND_ONCE([_AC_EXEEXT]) diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index e9d4e7664..37158c9af 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -1030,7 +1030,12 @@ AC_CHECK_TOOLS(F77, [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 fc])]) _AC_LANG_COMPILER_WORKS +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. +ac_save_ext=$ac_ext +ac_ext=F _AC_LANG_COMPILER_GNU +ac_ext=$ac_save_ext G77=`test $ac_compiler_gnu = yes && echo yes` AC_EXPAND_ONCE([_AC_OBJEXT]) AC_EXPAND_ONCE([_AC_EXEEXT]) diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index e9d4e7664..37158c9af 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -1030,7 +1030,12 @@ AC_CHECK_TOOLS(F77, [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 fc])]) _AC_LANG_COMPILER_WORKS +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. +ac_save_ext=$ac_ext +ac_ext=F _AC_LANG_COMPILER_GNU +ac_ext=$ac_save_ext G77=`test $ac_compiler_gnu = yes && echo yes` AC_EXPAND_ONCE([_AC_OBJEXT]) AC_EXPAND_ONCE([_AC_EXEEXT]) diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4 index e9d4e7664..37158c9af 100644 --- a/lib/autoconf/lang.m4 +++ b/lib/autoconf/lang.m4 @@ -1030,7 +1030,12 @@ AC_CHECK_TOOLS(F77, [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 fc])]) _AC_LANG_COMPILER_WORKS +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. +ac_save_ext=$ac_ext +ac_ext=F _AC_LANG_COMPILER_GNU +ac_ext=$ac_save_ext G77=`test $ac_compiler_gnu = yes && echo yes` AC_EXPAND_ONCE([_AC_OBJEXT]) AC_EXPAND_ONCE([_AC_EXEEXT]) diff --git a/tests/compile.at b/tests/compile.at index 10582741c..f72f0f40f 100644 --- a/tests/compile.at +++ b/tests/compile.at @@ -7,23 +7,6 @@ AT_BANNER([Low level compiling/preprocessing macros.]) # primitive, so check those first. -## ------------ ## -## C keywords. ## -## ------------ ## - -# GCC supports `const', `volatile', and `inline'. -AT_CHECK_MACRO([C keywords], -[[AC_PROG_CC -AC_C_CONST -AC_C_INLINE -AC_C_VOLATILE -case "$GCC,$ac_cv_c_const,$ac_cv_c_inline,$ac_cv_c_volatile" in - yes,*no*) - AC_MSG_ERROR([failed to detect `const', `inline' or `volatile' support]);; -esac]]) - - - ## --------------------------- ## ## AC_PROG_CPP with warnings. ## ## --------------------------- ## @@ -99,3 +82,38 @@ AT_CHECK_MACRO([AC_TRY_LINK_FUNC], [AC_MSG_ERROR([cannot find `exit'])]) AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this, [AC_MSG_ERROR([found a nonexistent function])])]) + + + +## ------------ ## +## C keywords. ## +## ------------ ## + +# GCC supports `const', `volatile', and `inline'. +AT_CHECK_MACRO([C keywords], +[[AC_PROG_CC +AC_C_CONST +AC_C_INLINE +AC_C_VOLATILE +case "$GCC,$ac_cv_c_const,$ac_cv_c_inline,$ac_cv_c_volatile" in + yes,*no*) + AC_MSG_ERROR([failed to detect `const', `inline' or `volatile' support]);; +esac]]) + + + +## --------------------- ## +## Fortran 77 Compiler. ## +## --------------------- ## + + +AT_CHECK_MACRO([GNU Fortran 77], +[[AC_LANG(Fortran 77) +AC_LANG_COMPILER + +case `$F77 --version`,$G77 in + *GNU*,yes) ;; + *GNU*,no ) AC_MSG_ERROR([failed to recognize GNU Fortran 77 compiler]);; + *,yes ) AC_MSG_ERROR([incorrectly recognized a GNU Fortran 77 compiler]);; +esac +exit 0]])