Skip to content

Commit 4c01292

Browse files
committed
Make win32 build extract PGPRO_VERSION from configure.in as well as upstream version
1 parent 4bc8e94 commit 4c01292

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/tools/msvc/Solution.pm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ sub _new
1919
options => $options,
2020
numver => '',
2121
strver => '',
22+
pgprover => '',
2223
VisualStudioVersion => undef,
2324
MinimumVisualStudioVersion => undef,
2425
vcver => undef,
@@ -138,10 +139,13 @@ sub GenerateFiles
138139
$self->{numver} = sprintf("%d%02d%02d", $1, $2, $3 ? $3 : 0);
139140
$self->{majorver} = sprintf("%d.%d", $1, $2);
140141
}
142+
if ( /^PGPRO_VERSION="\$PACKAGE_VERSION\.(\d+)"/) {
143+
$self->{pgprover} = $1;
144+
}
141145
}
142146
close(C);
143147
confess "Unable to parse configure.in for all variables!"
144-
if ($self->{strver} eq '' || $self->{numver} eq '');
148+
if ($self->{strver} eq '' || $self->{numver} eq '' || $self->{pgprover} eq '');
145149

146150
if (IsNewer("src/include/pg_config_os.h", "src/include/port/win32.h"))
147151
{
@@ -163,6 +167,8 @@ sub GenerateFiles
163167
s{PG_VERSION "[^"]+"}{PG_VERSION "$self->{strver}$extraver"};
164168
s{PG_VERSION_NUM \d+}{PG_VERSION_NUM $self->{numver}};
165169
s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY(z)\n#define PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, compiled by Visual C++ build " __STRINGIFY2(_MSC_VER) ", $bits-bit"};
170+
s{PGPRO_PACKAGE_VERSION "[^"]+"}{PGRPO_PACKAGE_VERSION "$self->{strver}.$self->{pgprover}"};
171+
s{PGPRO_PACKAGE_STR "[^"]+"}{PGPRO_PACKAGE_STR "PostgresPro $self->{strver}.$self->{pgprover}"};
166172
s{#define PGPRO_VERSION_STR "[^"]+"}{#define PGPRO_VERSION_STR PGPRO_PACKAGE_STR " compiled by Visual C++ build" __STRINGIFY2(_MSC_VER) ", $bits-bit"};
167173
print O;
168174
}

0 commit comments

Comments
 (0)