summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2024-01-05 12:55:54 (GMT)
committerGitHub <noreply@github.com>2024-01-05 12:55:54 (GMT)
commit9d1fe2c166cfb23c11d495140cfeb8a7b0be5c22 (patch)
tree425c56a2e4e8d9ec17b2aa9f83e65a3da7729c08
parenta00d62f77a715b0b4b862a594d1d85f4a0e5296c (diff)
downloadhdf5-9d1fe2c166cfb23c11d495140cfeb8a7b0be5c22.zip
hdf5-9d1fe2c166cfb23c11d495140cfeb8a7b0be5c22.tar.gz
hdf5-9d1fe2c166cfb23c11d495140cfeb8a7b0be5c22.tar.bz2
renamed defined H5_VERS* to avoid conflicts (#3926)
-rw-r--r--configure.ac24
-rw-r--r--fortran/src/H5config_f.inc.in6
2 files changed, 15 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index e594ccc..92eff58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -546,17 +546,6 @@ AC_CHECK_SIZEOF([float])
AC_CHECK_SIZEOF([double])
AC_CHECK_SIZEOF([long double])
-## HDF5 version from the first line of the README.md file.
-H5_VERSION="`cut -d' ' -f3 $srcdir/README.md | head -1`"
-AC_SUBST([H5_VERSION])
-
-VERS_MAJOR=`echo $H5_VERSION | cut -d. -f1`
-VERS_MINOR=`echo $H5_VERSION | cut -d. -f2`
-VERS_RELEASE=`echo $H5_VERSION | cut -d. -f3`
-AC_DEFINE_UNQUOTED([VERS_MAJOR], $VERS_MAJOR, [Define major library version])
-AC_DEFINE_UNQUOTED([VERS_MINOR], $VERS_MINOR, [Define minor library version])
-AC_DEFINE_UNQUOTED([VERS_RELEASE], $VERS_RELEASE, [Define release library version])
-
## ----------------------------------------------------------------------
## Check if the Fortran interface should be enabled
##
@@ -602,12 +591,19 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
AC_DEFINE_UNQUOTED([PAC_C_MAX_REAL_PRECISION], $PAC_C_MAX_REAL_PRECISION, [Determine the maximum decimal precision in C])
AC_MSG_RESULT([$PAC_C_MAX_REAL_PRECISION])
+ VERS_MAJOR=`cat $srcdir/src/H5public.h | sed -n 's/^#define H5_VERS_MAJOR //p'`
+ VERS_MINOR=`cat $srcdir/src/H5public.h | sed -n 's/^#define H5_VERS_MINOR //p'`
+ VERS_RELEASE=`cat $srcdir/src/H5public.h | sed -n 's/^#define H5_VERS_RELEASE //p'`
+ AC_DEFINE_UNQUOTED([VERS_MAJOR_TMP], $VERS_MAJOR, [Define major library version])
+ AC_DEFINE_UNQUOTED([VERS_MINOR_TMP], $VERS_MINOR, [Define minor library version])
+ AC_DEFINE_UNQUOTED([VERS_RELEASE_TMP], $VERS_RELEASE, [Define release library version])
+
## We will output an include file for Fortran, H5config_f.inc which
## contains various configure definitions used by the Fortran Library.
## Prepend H5_ to all macro names. This avoids name conflict between HDF5 macro
## names and those generated by another software package that uses the HDF5 library.
AC_CONFIG_HEADERS([fortran/src/H5config_f.inc],
- [cat fortran/src/H5config_f.inc | sed '1d;s%^/\* \(.*\) \*/%\1%;s/#define /#define H5_/;s/#undef /#undef H5_/' >fortran/src/H5config_f.inc.tmp; mv -f fortran/src/H5config_f.inc.tmp fortran/src/H5config_f.inc])
+ [cat fortran/src/H5config_f.inc | sed '1d;s%^/\* \(.*\) \*/%\1%;s/#define /#define H5_/;s/#undef /#undef H5_/' >fortran/src/H5config_f.inc.tmp; sed -i 's\_TMP\\g' fortran/src/H5config_f.inc.tmp; mv -f fortran/src/H5config_f.inc.tmp fortran/src/H5config_f.inc])
AC_SUBST([FC])
@@ -3683,6 +3679,10 @@ fi
## and installed with the libraries (used to generate libhdf5.settings).
##
+## HDF5 version from the first line of the README.md file.
+H5_VERSION="`cut -d' ' -f3 $srcdir/README.md | head -1`"
+AC_SUBST([H5_VERSION])
+
## Configuration date
AC_SUBST([CONFIG_DATE]) CONFIG_DATE="`date`"
diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in
index 5fe1bcc..afcfa6e 100644
--- a/fortran/src/H5config_f.inc.in
+++ b/fortran/src/H5config_f.inc.in
@@ -81,13 +81,13 @@
#undef NO_DEPRECATED_SYMBOLS
! For major interface/format changes
-#undef VERS_MAJOR
+#undef VERS_MAJOR_TMP
! For minor interface/format changes
-#undef VERS_MINOR
+#undef VERS_MINOR_TMP
! For tweaks, bug-fixes, or development
-#undef VERS_RELEASE
+#undef VERS_RELEASE_TMP
! macros for comparing versions
#define VERSION_GE(Maj, Min, Rel) \