diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2020-03-10 11:20:38 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2020-03-10 11:21:41 +0100 |
commit | 0a42a2e9ce8481a024d085f2cc526a366db8df59 (patch) | |
tree | 7ee73144df8283a86dbed9a5cb7eef34b1980c6e /src/tools/msvc/Solution.pm | |
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 'src/tools/msvc/Solution.pm')
-rw-r--r-- | src/tools/msvc/Solution.pm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 4244a4a8ac1..34d1f61dbaa 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -19,7 +19,6 @@ sub _new my $self = { projects => {}, options => $options, - numver => '', VisualStudioVersion => undef, MinimumVisualStudioVersion => undef, vcver => undef, @@ -151,6 +150,7 @@ sub GenerateFiles my $package_version; my $package_bugreport; my $package_url; + my ($majorver, $minorver); # Parse configure.in to get version numbers open(my $c, '<', "configure.in") @@ -171,8 +171,8 @@ sub GenerateFiles { confess "Bad format of version: $self->{strver}\n"; } - $self->{numver} = sprintf("%d%04d", $1, $2 ? $2 : 0); - $self->{majorver} = sprintf("%d", $1); + $majorver = sprintf("%d", $1); + $minorver = sprintf("%d", $2 ? $2 : 0); } } close($c); @@ -440,11 +440,13 @@ sub GenerateFiles PG_INT128_TYPE => undef, PG_INT64_TYPE => 'long long int', PG_KRB_SRVNAM => qq{"postgres"}, - PG_MAJORVERSION => qq{"$self->{majorver}"}, + PG_MAJORVERSION => qq{"$majorver"}, + PG_MAJORVERSION_NUM => $majorver, + PG_MINORVERSION_NUM => $minorver, PG_PRINTF_ATTRIBUTE => undef, PG_USE_STDBOOL => 1, PG_VERSION => qq{"$package_version$extraver"}, - PG_VERSION_NUM => $self->{numver}, + PG_VERSION_NUM => sprintf("%d%04d", $majorver, $minorver), PG_VERSION_STR => qq{"PostgreSQL $package_version$extraver, compiled by Visual C++ build " CppAsString2(_MSC_VER) ", $bits-bit"}, PROFILE_PID_DIR => undef, @@ -778,7 +780,7 @@ EOF chdir('src/backend/catalog'); my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs); system( - "perl genbki.pl --include-path ../../../src/include/ --set-version=$self->{majorver} $bki_srcs" + "perl genbki.pl --include-path ../../../src/include/ --set-version=$majorver $bki_srcs" ); open(my $f, '>', 'bki-stamp') || confess "Could not touch bki-stamp"; @@ -813,7 +815,7 @@ EOF || croak "Could not write to version.sgml\n"; print $o <<EOF; <!ENTITY version "$package_version"> -<!ENTITY majorversion "$self->{majorver}"> +<!ENTITY majorversion "$majorver"> EOF close($o); return; |