]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix F77 name-mangling macros to work with cached values (so
authorAkim Demaille <akim@epita.fr>
Mon, 3 Apr 2000 08:47:05 +0000 (08:47 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 3 Apr 2000 08:47:05 +0000 (08:47 +0000)
they don't break the second time you run configure).

* aclang.m4 (AC_F77_NAME_MANGLING): Extract f77_case,
f77_underscore from cache variable.
(AC_F77_WRAPPERS): Get rid of ac_cv_f77_wrappers, it's useless.
Simplify the nested case-esac into a single one.
Simplify the documentation strings of CPP symbols.

ChangeLog
aclang.m4
lib/autoconf/c.m4
lib/autoconf/fortran.m4
lib/autoconf/lang.m4

index cd1ab845c9e211a92730a268866dc9a7306fc4e0..4680cfa7ae8d4cc2bb9360d4ffa2a2f640d151ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-03-30  Steven G. Johnson  <stevenj@alum.mit.edu>
+
+       Fix F77 name-mangling macros to work with cached values (so
+       they don't break the second time you run configure).
+
+       * aclang.m4 (AC_F77_NAME_MANGLING): Extract f77_case,
+       f77_underscore from cache variable.
+       (AC_F77_WRAPPERS): Get rid of ac_cv_f77_wrappers, it's useless.
+       Simplify the nested case-esac into a single one.
+       Simplify the documentation strings of CPP symbols.
+
 2000-03-31  Akim Demaille  <akim@epita.fr>
 
        * acgeneral.m4 (_AC_OUTPUT_CONFIG_STATUS): Fix the accumulation in
index 073d126c6f81ab4efe334c89d21de3ad8dacf968..397f77f7dab4d7bdc791b594e0f987e12565409f 100644 (file)
--- a/aclang.m4
+++ b/aclang.m4
@@ -1431,7 +1431,11 @@ else
   cat conftest.$ac_ext >&AC_FD_CC
 fi
 AC_LANG_RESTORE()dnl
-])])# AC_F77_NAME_MANGLING
+])
+dnl Get case/underscore from cache variable, in case above tests were skipped:
+f77_case=`echo "$ac_cv_f77_mangling" | sed 's/ case.*$//'`
+f77_underscore=`echo "$ac_cv_f77_mangling" | sed 's/^.*, \(.*\) .*$/\1/'`
+])# AC_F77_NAME_MANGLING
 
 
 # AC_F77_WRAPPERS
@@ -1441,63 +1445,33 @@ AC_LANG_RESTORE()dnl
 # underscores, respectively, so that they match the name mangling
 # scheme used by the Fortran 77 compiler.
 AC_DEFUN(AC_F77_WRAPPERS,
-[AH_TEMPLATE([F77_FUNC],
-             [Define to a macro that performs the appropriate name
-              mangling on its argument to make the C identifier, which
-              *does not* contain underscores, match the name mangling
-              scheme of the Fortran 77 compiler.])dnl
+[AC_REQUIRE([AC_F77_NAME_MANGLING])dnl
+AH_TEMPLATE([F77_FUNC],
+    [Define to a macro mangling the given C identifier (in lower and upper
+     case), which must not contain underscores, for linking with Fortran.])dnl
 AH_TEMPLATE([F77_FUNC_],
-             [Define to a macro that performs the appropriate name
-              mangling on its argument to make the C identifier, which
-              *does* contain underscores, match the name mangling
-              scheme of the Fortran 77 compiler.])dnl
-AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
-                 ac_cv_f77_wrappers,
-[# Be optimistic at first.
-ac_cv_f77_wrappers="yes"
-
-AC_REQUIRE([AC_F77_NAME_MANGLING])dnl
-case "$f77_case" in
-  lower)
-    case "$f77_underscore" in
-      no)
+    [As F77_FUNC, but for C identifiers containing underscores.])dnl
+case "$f77_case,$f77_underscore" in
+  lower,no)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name])
-          ;;
-      single)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name]) ;;
+  lower,single)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## _])
-          ;;
-      double)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## _]) ;;
+  lower,double)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## __])
-          ;;
-      *)
-          AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
-          ;;
-    esac
-    ;;
-  upper)
-    case "$f77_underscore" in
-      no)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## __]) ;;
+  upper,no)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME])
-          ;;
-      single)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME]) ;;
+  upper,single)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## _])
-          ;;
-      double)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## _]) ;;
+  upper,double)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __])
-          ;;
-      *)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __]) ;;
+  *)
           AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
           ;;
-    esac
-    ;;
-  *)
-    AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
-    ;;
 esac
-])])# AC_F77_WRAPPERS
+])# AC_F77_WRAPPERS
index 073d126c6f81ab4efe334c89d21de3ad8dacf968..397f77f7dab4d7bdc791b594e0f987e12565409f 100644 (file)
@@ -1431,7 +1431,11 @@ else
   cat conftest.$ac_ext >&AC_FD_CC
 fi
 AC_LANG_RESTORE()dnl
-])])# AC_F77_NAME_MANGLING
+])
+dnl Get case/underscore from cache variable, in case above tests were skipped:
+f77_case=`echo "$ac_cv_f77_mangling" | sed 's/ case.*$//'`
+f77_underscore=`echo "$ac_cv_f77_mangling" | sed 's/^.*, \(.*\) .*$/\1/'`
+])# AC_F77_NAME_MANGLING
 
 
 # AC_F77_WRAPPERS
@@ -1441,63 +1445,33 @@ AC_LANG_RESTORE()dnl
 # underscores, respectively, so that they match the name mangling
 # scheme used by the Fortran 77 compiler.
 AC_DEFUN(AC_F77_WRAPPERS,
-[AH_TEMPLATE([F77_FUNC],
-             [Define to a macro that performs the appropriate name
-              mangling on its argument to make the C identifier, which
-              *does not* contain underscores, match the name mangling
-              scheme of the Fortran 77 compiler.])dnl
+[AC_REQUIRE([AC_F77_NAME_MANGLING])dnl
+AH_TEMPLATE([F77_FUNC],
+    [Define to a macro mangling the given C identifier (in lower and upper
+     case), which must not contain underscores, for linking with Fortran.])dnl
 AH_TEMPLATE([F77_FUNC_],
-             [Define to a macro that performs the appropriate name
-              mangling on its argument to make the C identifier, which
-              *does* contain underscores, match the name mangling
-              scheme of the Fortran 77 compiler.])dnl
-AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
-                 ac_cv_f77_wrappers,
-[# Be optimistic at first.
-ac_cv_f77_wrappers="yes"
-
-AC_REQUIRE([AC_F77_NAME_MANGLING])dnl
-case "$f77_case" in
-  lower)
-    case "$f77_underscore" in
-      no)
+    [As F77_FUNC, but for C identifiers containing underscores.])dnl
+case "$f77_case,$f77_underscore" in
+  lower,no)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name])
-          ;;
-      single)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name]) ;;
+  lower,single)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## _])
-          ;;
-      double)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## _]) ;;
+  lower,double)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## __])
-          ;;
-      *)
-          AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
-          ;;
-    esac
-    ;;
-  upper)
-    case "$f77_underscore" in
-      no)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## __]) ;;
+  upper,no)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME])
-          ;;
-      single)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME]) ;;
+  upper,single)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## _])
-          ;;
-      double)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## _]) ;;
+  upper,double)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __])
-          ;;
-      *)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __]) ;;
+  *)
           AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
           ;;
-    esac
-    ;;
-  *)
-    AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
-    ;;
 esac
-])])# AC_F77_WRAPPERS
+])# AC_F77_WRAPPERS
index 073d126c6f81ab4efe334c89d21de3ad8dacf968..397f77f7dab4d7bdc791b594e0f987e12565409f 100644 (file)
@@ -1431,7 +1431,11 @@ else
   cat conftest.$ac_ext >&AC_FD_CC
 fi
 AC_LANG_RESTORE()dnl
-])])# AC_F77_NAME_MANGLING
+])
+dnl Get case/underscore from cache variable, in case above tests were skipped:
+f77_case=`echo "$ac_cv_f77_mangling" | sed 's/ case.*$//'`
+f77_underscore=`echo "$ac_cv_f77_mangling" | sed 's/^.*, \(.*\) .*$/\1/'`
+])# AC_F77_NAME_MANGLING
 
 
 # AC_F77_WRAPPERS
@@ -1441,63 +1445,33 @@ AC_LANG_RESTORE()dnl
 # underscores, respectively, so that they match the name mangling
 # scheme used by the Fortran 77 compiler.
 AC_DEFUN(AC_F77_WRAPPERS,
-[AH_TEMPLATE([F77_FUNC],
-             [Define to a macro that performs the appropriate name
-              mangling on its argument to make the C identifier, which
-              *does not* contain underscores, match the name mangling
-              scheme of the Fortran 77 compiler.])dnl
+[AC_REQUIRE([AC_F77_NAME_MANGLING])dnl
+AH_TEMPLATE([F77_FUNC],
+    [Define to a macro mangling the given C identifier (in lower and upper
+     case), which must not contain underscores, for linking with Fortran.])dnl
 AH_TEMPLATE([F77_FUNC_],
-             [Define to a macro that performs the appropriate name
-              mangling on its argument to make the C identifier, which
-              *does* contain underscores, match the name mangling
-              scheme of the Fortran 77 compiler.])dnl
-AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
-                 ac_cv_f77_wrappers,
-[# Be optimistic at first.
-ac_cv_f77_wrappers="yes"
-
-AC_REQUIRE([AC_F77_NAME_MANGLING])dnl
-case "$f77_case" in
-  lower)
-    case "$f77_underscore" in
-      no)
+    [As F77_FUNC, but for C identifiers containing underscores.])dnl
+case "$f77_case,$f77_underscore" in
+  lower,no)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name])
-          ;;
-      single)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name]) ;;
+  lower,single)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## _])
-          ;;
-      double)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## _]) ;;
+  lower,double)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## __])
-          ;;
-      *)
-          AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
-          ;;
-    esac
-    ;;
-  upper)
-    case "$f77_underscore" in
-      no)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## __]) ;;
+  upper,no)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME])
-          ;;
-      single)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME]) ;;
+  upper,single)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## _])
-          ;;
-      double)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## _]) ;;
+  upper,double)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __])
-          ;;
-      *)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __]) ;;
+  *)
           AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
           ;;
-    esac
-    ;;
-  *)
-    AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
-    ;;
 esac
-])])# AC_F77_WRAPPERS
+])# AC_F77_WRAPPERS
index 073d126c6f81ab4efe334c89d21de3ad8dacf968..397f77f7dab4d7bdc791b594e0f987e12565409f 100644 (file)
@@ -1431,7 +1431,11 @@ else
   cat conftest.$ac_ext >&AC_FD_CC
 fi
 AC_LANG_RESTORE()dnl
-])])# AC_F77_NAME_MANGLING
+])
+dnl Get case/underscore from cache variable, in case above tests were skipped:
+f77_case=`echo "$ac_cv_f77_mangling" | sed 's/ case.*$//'`
+f77_underscore=`echo "$ac_cv_f77_mangling" | sed 's/^.*, \(.*\) .*$/\1/'`
+])# AC_F77_NAME_MANGLING
 
 
 # AC_F77_WRAPPERS
@@ -1441,63 +1445,33 @@ AC_LANG_RESTORE()dnl
 # underscores, respectively, so that they match the name mangling
 # scheme used by the Fortran 77 compiler.
 AC_DEFUN(AC_F77_WRAPPERS,
-[AH_TEMPLATE([F77_FUNC],
-             [Define to a macro that performs the appropriate name
-              mangling on its argument to make the C identifier, which
-              *does not* contain underscores, match the name mangling
-              scheme of the Fortran 77 compiler.])dnl
+[AC_REQUIRE([AC_F77_NAME_MANGLING])dnl
+AH_TEMPLATE([F77_FUNC],
+    [Define to a macro mangling the given C identifier (in lower and upper
+     case), which must not contain underscores, for linking with Fortran.])dnl
 AH_TEMPLATE([F77_FUNC_],
-             [Define to a macro that performs the appropriate name
-              mangling on its argument to make the C identifier, which
-              *does* contain underscores, match the name mangling
-              scheme of the Fortran 77 compiler.])dnl
-AC_CACHE_CHECK([if we can define Fortran 77 name-mangling macros],
-                 ac_cv_f77_wrappers,
-[# Be optimistic at first.
-ac_cv_f77_wrappers="yes"
-
-AC_REQUIRE([AC_F77_NAME_MANGLING])dnl
-case "$f77_case" in
-  lower)
-    case "$f77_underscore" in
-      no)
+    [As F77_FUNC, but for C identifiers containing underscores.])dnl
+case "$f77_case,$f77_underscore" in
+  lower,no)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name])
-          ;;
-      single)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name]) ;;
+  lower,single)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## _])
-          ;;
-      double)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## _]) ;;
+  lower,double)
           AC_DEFINE([F77_FUNC(name,NAME)],  [name ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## __])
-          ;;
-      *)
-          AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
-          ;;
-    esac
-    ;;
-  upper)
-    case "$f77_underscore" in
-      no)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [name ## __]) ;;
+  upper,no)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME])
-          ;;
-      single)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME]) ;;
+  upper,single)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## _])
-          ;;
-      double)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## _]) ;;
+  upper,double)
           AC_DEFINE([F77_FUNC(name,NAME)],  [NAME ## _])
-          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __])
-          ;;
-      *)
+          AC_DEFINE([F77_FUNC_(name,NAME)], [NAME ## __]) ;;
+  *)
           AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
           ;;
-    esac
-    ;;
-  *)
-    AC_MSG_WARN(unknown Fortran 77 name-mangling scheme)
-    ;;
 esac
-])])# AC_F77_WRAPPERS
+])# AC_F77_WRAPPERS