Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renamed defined H5_VERS* to avoid conflicts #3926

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
##
Expand Down Expand Up @@ -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])

Expand Down Expand Up @@ -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`"

Expand Down
6 changes: 3 additions & 3 deletions fortran/src/H5config_f.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down