Skip to content

Commit

Permalink
Merge pull request #2527 from DennisHeimbigner/versionfix.dmh
Browse files Browse the repository at this point in the history
Move construction of VERSION file to end of the build
  • Loading branch information
WardF authored Oct 11, 2022
2 parents 632fef4 + 52a4eca commit 1bbaa66
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,11 @@ install-data-hook:
@echo '| https://www.unidata.ucar.edu |'
@echo '+-------------------------------------------------------------+'
@echo ''


# Create the VERSION file after the build
# in case it is being used by packagers
all-local: liblib/libnetcdf.la
echo ${PACKAGE_VERSION} > VERSION
# Remove the VERSION file
CLEANFILES = VERSION
11 changes: 8 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ AC_SUBST([netCDF_SO_VERSION]) netCDF_SO_VERSION=20:0:1
# pattered after the files generated by libhdf4, libhdf5.
#####

# Create the VERSION file, which contains the package version from
# AC_INIT.
echo AC_PACKAGE_VERSION>VERSION
# Create the VERSION file, which contains the package version from AC_INIT.
# This file is apparently unused. But see the bottom of Makefile.am
# echo AC_PACKAGE_VERSION>VERSION

AC_SUBST(PACKAGE_VERSION)

AC_MSG_NOTICE([netCDF AC_PACKAGE_VERSION])
Expand Down Expand Up @@ -115,7 +116,11 @@ ISMSYS=yes
fi

# Get windows version info
if text "x$ISMSVC" = xyes ; then
WINVER=`systeminfo | sed -e '/^OS Version:/p' -ed | sed -e 's|[^0-9]*\([0-9.]*\).*|\1|'`
else
WINVER="0.0.0"
fi
WINVERMAJOR=`echo $WVER | sed -e 's|\([^.]*\)[.]\([^.]*\)[.]\(.*\)|\1|'`
WINVERBUILD=`echo $WVER | sed -e 's|\([^.]*\)[.]\([^.]*\)[.]\(.*\)|\3|'`
if test "x$WINVERMAJOR" = x ; then WINVERMAJOR=0; fi
Expand Down

0 comments on commit 1bbaa66

Please sign in to comment.