diff options
author | Peter Eisentraut | 2020-01-15 09:15:06 +0000 |
---|---|---|
committer | Peter Eisentraut | 2020-01-15 14:06:12 +0000 |
commit | 16a4a3d59cd5574fdc697ea16ef5692ce34c54d5 (patch) | |
tree | e0d2ee9337cb9c2b05e0fcc3389c128be16cf283 /src/tools | |
parent | ac5bdf62617507b1942f6124a2696c04a16fca04 (diff) |
Remove libpq.rc, use win32ver.rc for libpq
For historical reasons, libpq used a separate libpq.rc file for the
Windows builds while all other components use a common file
win32ver.rc. With a bit of tweaking, the libpq build can also use the
win32ver.rc file. This removes a bit of duplicative code.
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://www.postgresql.org/message-id/flat/ad505e61-a923-e114-9f38-9867d161073f@2ndquadrant.com
Diffstat (limited to 'src/tools')
-rwxr-xr-x | src/tools/copyright.pl | 1 | ||||
-rw-r--r-- | src/tools/msvc/Mkvcbuild.pm | 2 | ||||
-rw-r--r-- | src/tools/msvc/Project.pm | 8 | ||||
-rw-r--r-- | src/tools/msvc/Solution.pm | 21 | ||||
-rwxr-xr-x | src/tools/msvc/clean.bat | 1 | ||||
-rwxr-xr-x | src/tools/version_stamp.pl | 7 |
6 files changed, 8 insertions, 32 deletions
diff --git a/src/tools/copyright.pl b/src/tools/copyright.pl index bd9f89d6ab3..35ee8468186 100755 --- a/src/tools/copyright.pl +++ b/src/tools/copyright.pl @@ -66,6 +66,5 @@ sub wanted } print "Manually update:\n"; -print " ./src/interfaces/libpq/libpq.rc.in in head\n"; print " ./doc/src/sgml/legal.sgml in head and back branches\n"; print " ./COPYRIGHT in back branches\n"; diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index 3d6ef0de84b..f6ab0d528b1 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -250,8 +250,6 @@ sub mkvcbuild $libpq->AddLibrary('ws2_32.lib'); $libpq->AddLibrary('wldap32.lib') if ($solution->{options}->{ldap}); $libpq->UseDef('src/interfaces/libpq/libpqdll.def'); - $libpq->ReplaceFile('src/interfaces/libpq/libpqrc.c', - 'src/interfaces/libpq/libpq.rc'); $libpq->AddReference($libpgcommon, $libpgport); # The OBJS scraper doesn't know about ifdefs, so remove appropriate files diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm index 16a7340b22d..7d25704e2c6 100644 --- a/src/tools/msvc/Project.pm +++ b/src/tools/msvc/Project.pm @@ -338,6 +338,14 @@ sub AddResourceFile if ($self->{type} eq "dll") { s/VFT_APP/VFT_DLL/gm; + my $name = $self->{name}; + s/_INTERNAL_NAME_/"$name"/; + s/_ORIGINAL_NAME_/"$name.dll"/; + } + else + { + /_INTERNAL_NAME_/ && next; + /_ORIGINAL_NAME_/ && next; } print $o $_; } diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 909bded5920..be02bd4524c 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -668,27 +668,6 @@ sub GenerateFiles ); } - if (IsNewer( - 'src/interfaces/libpq/libpq.rc', - 'src/interfaces/libpq/libpq.rc.in')) - { - print "Generating libpq.rc...\n"; - my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = - localtime(time); - my $d = ($year - 100) . "$yday"; - open(my $i, '<', 'src/interfaces/libpq/libpq.rc.in') - || confess "Could not open libpq.rc.in"; - open(my $o, '>', 'src/interfaces/libpq/libpq.rc') - || confess "Could not open libpq.rc"; - while (<$i>) - { - s/(VERSION.*),0/$1,$d/; - print $o $_; - } - close($i); - close($o); - } - if (IsNewer('src/bin/psql/sql_help.h', 'src/bin/psql/create_help.pl')) { print "Generating sql_help.h...\n"; diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat index d034ec57659..235de932532 100755 --- a/src/tools/msvc/clean.bat +++ b/src/tools/msvc/clean.bat @@ -89,7 +89,6 @@ if %DIST%==1 if exist src\backend\replication\syncrep_scanner.c del /q src\backe if %DIST%==1 if exist src\backend\replication\syncrep_gram.c del /q src\backend\replication\syncrep_gram.c -if exist src\interfaces\libpq\libpq.rc del /q src\interfaces\libpq\libpq.rc if exist src\interfaces\libpq\libpqdll.def del /q src\interfaces\libpq\libpqdll.def if exist src\interfaces\ecpg\compatlib\compatlib.def del /q src\interfaces\ecpg\compatlib\compatlib.def if exist src\interfaces\ecpg\ecpglib\ecpglib.def del /q src\interfaces\ecpg\ecpglib\ecpglib.def diff --git a/src/tools/version_stamp.pl b/src/tools/version_stamp.pl index a92599d96fb..d8ab8d9de8f 100755 --- a/src/tools/version_stamp.pl +++ b/src/tools/version_stamp.pl @@ -102,13 +102,6 @@ sed_file("configure.in", "-e 's/AC_INIT(\\[PostgreSQL\\], \\[[0-9a-z.]*\\]/AC_INIT([PostgreSQL], [$fullversion]/'" ); -sed_file("src/interfaces/libpq/libpq.rc.in", - "-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $majorversion,0,$numericminor,0/' " - . "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $majorversion,0,$numericminor,0/' " - . "-e 's/VALUE \"FileVersion\", \"[0-9.]*/VALUE \"FileVersion\", \"$numericversion/' " - . "-e 's/VALUE \"ProductVersion\", \"[0-9.]*/VALUE \"ProductVersion\", \"$numericversion/'" -); - sed_file("src/port/win32ver.rc", "-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $majorversion,0,$numericminor,0/' " . "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $majorversion,0,$numericminor,0/'" |