diff options
author | Peter Eisentraut | 2020-03-10 10:20:38 +0000 |
---|---|---|
committer | Peter Eisentraut | 2020-03-10 10:21:41 +0000 |
commit | 0a42a2e9ce8481a024d085f2cc526a366db8df59 (patch) | |
tree | 7ee73144df8283a86dbed9a5cb7eef34b1980c6e /configure.in | |
parent | 3c173a53a825075f3efe32b9917eff5063e81f4d (diff) |
Remove win32ver.rc from version_stamp.pl
This removes another relic from the old nmake-based Windows build.
version_stamp.pl put version number information into win32ver.rc. But
win32ver.rc already gets other version number information from the
preprocessor at build time, so it would make more sense if all version
number information would be handled in the same way and we don't have
two places that do it.
What we need for this is having the major version number and the minor
version number as separate integer symbols. Both configure and
Solution.pm already have that logic, because they compute
PG_VERSION_NUM. So we just keep all the logic there now. Put the
minor version number into a new symbol PG_MINORVERSION_NUM. Also, add
a symbol PG_MAJORVERSION_NUM, which is a number, alongside the
existing PG_MAJORVERSION, which is a string.
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/1ee46ac4-a9b2-4531-bf54-5ec2e374634d@2ndquadrant.com
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.in b/configure.in index 22f096a5ac7..78902fb60db 100644 --- a/configure.in +++ b/configure.in @@ -30,8 +30,12 @@ AC_PREFIX_DEFAULT(/usr/local/pgsql) AC_DEFINE_UNQUOTED(CONFIGURE_ARGS, ["$ac_configure_args"], [Saved arguments from configure]) [PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`] +[PG_MINORVERSION=`expr "$PACKAGE_VERSION" : '.*\.\([0-9][0-9]*\)'`] +test -n "$PG_MINORVERSION" || PG_MINORVERSION=0 AC_SUBST(PG_MAJORVERSION) AC_DEFINE_UNQUOTED(PG_MAJORVERSION, "$PG_MAJORVERSION", [PostgreSQL major version as a string]) +AC_DEFINE_UNQUOTED(PG_MAJORVERSION_NUM, $PG_MAJORVERSION, [PostgreSQL major version number]) +AC_DEFINE_UNQUOTED(PG_MINORVERSION_NUM, $PG_MINORVERSION, [PostgreSQL minor version number]) PGAC_ARG_REQ(with, extra-version, [STRING], [append STRING to version], [PG_VERSION="$PACKAGE_VERSION$withval"], @@ -2318,8 +2322,7 @@ AC_DEFINE_UNQUOTED(PG_VERSION_STR, # Supply a numeric version string for use by 3rd party add-ons # awk -F is a regex on some platforms, and not on others, so make "." a tab -[PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' | -tr '.' ' ' | +[PG_VERSION_NUM="`echo "$PG_MAJORVERSION $PG_MINORVERSION" | $AWK '{printf "%d%04d", $1, $2}'`"] AC_DEFINE_UNQUOTED(PG_VERSION_NUM, $PG_VERSION_NUM, [PostgreSQL version as a number]) AC_SUBST(PG_VERSION_NUM) |