From 9d1fe2c166cfb23c11d495140cfeb8a7b0be5c22 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 5 Jan 2024 06:55:54 -0600 Subject: renamed defined H5_VERS* to avoid conflicts (#3926) --- configure.ac | 24 ++++++++++++------------ fortran/src/H5config_f.inc.in | 6 +++--- 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) \ -- cgit v0.12