aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2014-08-18 22:59:53 -0400
committerNoah Misch <noah@leadboat.com>2014-08-18 22:59:53 -0400
commitee9569e4df1c3bdb6858f4f65d0770783c32a84d (patch)
tree4abc544d89e41c6bccbc01eb578919411fcd1461 /src
parentfb2aece8ae4e6f23310d7c87c7da3fec6f5df3a1 (diff)
downloadpostgresql-ee9569e4df1c3bdb6858f4f65d0770783c32a84d.tar.gz
postgresql-ee9569e4df1c3bdb6858f4f65d0770783c32a84d.zip
Finish adding file version information to installed Windows binaries.
In support of this, have the MSVC build follow GNU make in preferring GNUmakefile over Makefile when a directory contains both. Michael Paquier, reviewed by MauMau.
Diffstat (limited to 'src')
-rw-r--r--src/backend/snowball/Makefile5
-rw-r--r--src/interfaces/ecpg/test/Makefile5
-rw-r--r--src/test/isolation/Makefile7
-rw-r--r--src/test/regress/GNUmakefile7
-rw-r--r--src/timezone/Makefile5
-rw-r--r--src/tools/msvc/Mkvcbuild.pm15
-rw-r--r--src/tools/msvc/Project.pm38
-rwxr-xr-xsrc/tools/msvc/clean.bat6
8 files changed, 66 insertions, 22 deletions
diff --git a/src/backend/snowball/Makefile b/src/backend/snowball/Makefile
index ac80efeb7d1..50cbace41da 100644
--- a/src/backend/snowball/Makefile
+++ b/src/backend/snowball/Makefile
@@ -6,6 +6,9 @@
#
#-------------------------------------------------------------------------
+PGFILEDESC = "snowball - natural language stemmers"
+PGAPPICON = win32
+
subdir = src/backend/snowball
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
@@ -13,7 +16,7 @@ include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I$(top_srcdir)/src/include/snowball \
-I$(top_srcdir)/src/include/snowball/libstemmer $(CPPFLAGS)
-OBJS= dict_snowball.o api.o utilities.o \
+OBJS= $(WIN32RES) dict_snowball.o api.o utilities.o \
stem_ISO_8859_1_danish.o \
stem_ISO_8859_1_dutch.o \
stem_ISO_8859_1_english.o \
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index 56f6a17c34e..387729bda34 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -1,5 +1,8 @@
# src/interfaces/ecpg/test/Makefile
+PGFILEDESC = "ECPG Test - regression tests for ECPG"
+PGAPPICON = win32
+
subdir = src/interfaces/ecpg/test
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
@@ -13,8 +16,6 @@ override CPPFLAGS := \
'-DDLSUFFIX="$(DLSUFFIX)"' \
$(CPPFLAGS)
-PGFILEDESC = "ECPG Test - regression tests for ECPG"
-
# where to find psql for testing an existing installation
PSQLDIR = $(bindir)
diff --git a/src/test/isolation/Makefile b/src/test/isolation/Makefile
index 26bcf22392a..a88257a562c 100644
--- a/src/test/isolation/Makefile
+++ b/src/test/isolation/Makefile
@@ -2,6 +2,9 @@
# Makefile for isolation tests
#
+PGFILEDESC = "pg_isolation_regress/isolationtester - multi-client test driver"
+PGAPPICON = win32
+
subdir = src/test/isolation
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
@@ -11,7 +14,7 @@ PSQLDIR = $(bindir)
override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) -I$(srcdir)/../regress $(CPPFLAGS)
-OBJS = specparse.o isolationtester.o
+OBJS = specparse.o isolationtester.o $(WIN32RES)
all: isolationtester$(X) pg_isolation_regress$(X)
@@ -21,7 +24,7 @@ submake-regress:
pg_regress.o: | submake-regress
rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/pg_regress.o .
-pg_isolation_regress$(X): isolation_main.o pg_regress.o
+pg_isolation_regress$(X): isolation_main.o pg_regress.o $(WIN32RES)
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
isolationtester$(X): $(OBJS) | submake-libpq submake-libpgport
diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
index b084e0a831e..b40b37c0b74 100644
--- a/src/test/regress/GNUmakefile
+++ b/src/test/regress/GNUmakefile
@@ -10,6 +10,9 @@
#
#-------------------------------------------------------------------------
+PGFILEDESC = "pg_regress - test driver"
+PGAPPICON = win32
+
subdir = src/test/regress
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
@@ -43,7 +46,7 @@ EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
all: pg_regress$(X)
-pg_regress$(X): pg_regress.o pg_regress_main.o | submake-libpgport
+pg_regress$(X): pg_regress.o pg_regress_main.o $(WIN32RES) | submake-libpgport
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
# dependencies ensure that path changes propagate
@@ -66,7 +69,7 @@ uninstall:
# Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE C.
NAME = regress
-OBJS = regress.o
+OBJS = $(WIN32RES) regress.o
include $(top_srcdir)/src/Makefile.shlib
diff --git a/src/timezone/Makefile b/src/timezone/Makefile
index ef739e9d098..a289050d82c 100644
--- a/src/timezone/Makefile
+++ b/src/timezone/Makefile
@@ -8,6 +8,9 @@
#
#-------------------------------------------------------------------------
+PGFILEDESC = "zic - time zone compiler"
+PGAPPICON = win32
+
subdir = src/timezone
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
@@ -16,7 +19,7 @@ include $(top_builddir)/src/Makefile.global
OBJS= localtime.o strftime.o pgtz.o
# files needed to build zic utility program
-ZICOBJS= zic.o ialloc.o scheck.o localtime.o
+ZICOBJS= zic.o ialloc.o scheck.o localtime.o $(WIN32RES)
# timezone data files
TZDATA = africa antarctica asia australasia europe northamerica southamerica \
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index e6fb3ecdecf..004942ca07a 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -106,6 +106,9 @@ sub mkvcbuild
$postgres->AddFiles('src\port', @pgportfiles);
$postgres->AddFiles('src\common', @pgcommonbkndfiles);
$postgres->AddDir('src\timezone');
+ # We need source files from src\timezone, but that directory's resource
+ # file pertains to "zic", not to the backend.
+ $postgres->RemoveFile('src\timezone\win32ver.rc');
$postgres->AddFiles('src\backend\parser', 'scan.l', 'gram.y');
$postgres->AddFiles('src\backend\bootstrap', 'bootscanner.l',
'bootparse.y');
@@ -126,10 +129,11 @@ sub mkvcbuild
my $snowball = $solution->AddProject('dict_snowball', 'dll', '',
'src\backend\snowball');
+ # This Makefile uses VPATH to find most source files in a subdirectory.
$snowball->RelocateFiles(
'src\backend\snowball\libstemmer',
sub {
- return shift !~ /dict_snowball.c$/;
+ return shift !~ /(dict_snowball.c|win32ver.rc)$/;
});
$snowball->AddIncludeDir('src\include\snowball');
$snowball->AddReference($postgres);
@@ -341,6 +345,7 @@ sub mkvcbuild
$pgregress_ecpg->AddIncludeDir('src\test\regress');
$pgregress_ecpg->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
$pgregress_ecpg->AddDefine('FRONTEND');
+ $pgregress_ecpg->AddDirResourceFile('src\interfaces\ecpg\test');
$pgregress_ecpg->AddReference($libpgcommon, $libpgport);
my $isolation_tester =
@@ -356,6 +361,7 @@ sub mkvcbuild
$isolation_tester->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
$isolation_tester->AddDefine('FRONTEND');
$isolation_tester->AddLibrary('ws2_32.lib');
+ $isolation_tester->AddDirResourceFile('src\test\isolation');
$isolation_tester->AddReference($libpq, $libpgcommon, $libpgport);
my $pgregress_isolation =
@@ -366,6 +372,7 @@ sub mkvcbuild
$pgregress_isolation->AddIncludeDir('src\test\regress');
$pgregress_isolation->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
$pgregress_isolation->AddDefine('FRONTEND');
+ $pgregress_isolation->AddDirResourceFile('src\test\isolation');
$pgregress_isolation->AddReference($libpgcommon, $libpgport);
# src/bin
@@ -448,6 +455,7 @@ sub mkvcbuild
my $zic = $solution->AddProject('zic', 'exe', 'utils');
$zic->AddFiles('src\timezone', 'zic.c', 'ialloc.c', 'scheck.c',
'localtime.c');
+ $zic->AddDirResourceFile('src\timezone');
$zic->AddReference($libpgcommon, $libpgport);
if ($solution->{options}->{xml})
@@ -582,14 +590,14 @@ sub mkvcbuild
$proj->AddIncludeDir('src\bin\pg_dump');
$proj->AddIncludeDir('src\bin\psql');
$proj->AddReference($libpq, $libpgcommon, $libpgport);
- $proj->AddResourceFile('src\bin\scripts', 'PostgreSQL Utility',
- 'win32');
+ $proj->AddDirResourceFile('src\bin\scripts');
$proj->AddLibrary('ws2_32.lib');
}
# Regression DLL and EXE
my $regress = $solution->AddProject('regress', 'dll', 'misc');
$regress->AddFile('src\test\regress\regress.c');
+ $regress->AddDirResourceFile('src\test\regress');
$regress->AddReference($postgres);
my $pgregress = $solution->AddProject('pg_regress', 'exe', 'misc');
@@ -597,6 +605,7 @@ sub mkvcbuild
$pgregress->AddFile('src\test\regress\pg_regress_main.c');
$pgregress->AddIncludeDir('src\port');
$pgregress->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
+ $pgregress->AddDirResourceFile('src\test\regress');
$pgregress->AddReference($libpgcommon, $libpgport);
# fix up pg_xlogdump once it's been set up
diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm
index f343b2b9b8c..b9b5a239d8a 100644
--- a/src/tools/msvc/Project.pm
+++ b/src/tools/msvc/Project.pm
@@ -183,15 +183,7 @@ sub UseDef
sub AddDir
{
my ($self, $reldir) = @_;
- my $MF;
-
- my $t = $/;
- undef $/;
- open($MF, "$reldir\\Makefile")
- || open($MF, "$reldir\\GNUMakefile")
- || croak "Could not open $reldir\\Makefile\n";
- my $mf = <$MF>;
- close($MF);
+ my $mf = read_makefile($reldir);
$mf =~ s{\\\r?\n}{}g;
if ($mf =~ m{^(?:SUB)?DIRS[^=]*=\s*(.*)$}mg)
@@ -292,7 +284,15 @@ sub AddDir
$mf =~ s{$replace_re}{}m;
}
- # See if this Makefile contains a description, and should have a RC file
+ $self->AddDirResourceFile($reldir);
+}
+
+# If the directory's Makefile bears a description string, add a resource file.
+sub AddDirResourceFile
+{
+ my ($self, $reldir) = @_;
+ my $mf = read_makefile($reldir);
+
if ($mf =~ /^PGFILEDESC\s*=\s*\"([^\"]+)\"/m)
{
my $desc = $1;
@@ -300,7 +300,6 @@ sub AddDir
if ($mf =~ /^PGAPPICON\s*=\s*(.*)$/m) { $ico = $1; }
$self->AddResourceFile($reldir, $desc, $ico);
}
- $/ = $t;
}
sub AddResourceFile
@@ -409,4 +408,21 @@ sub read_file
return $txt;
}
+sub read_makefile
+{
+ my $reldir = shift;
+ my $F;
+ my $t = $/;
+
+ undef $/;
+ open($F, "$reldir\\GNUmakefile")
+ || open($F, "$reldir\\Makefile")
+ || croak "Could not open $reldir\\Makefile\n";
+ my $txt = <$F>;
+ close($F);
+ $/ = $t;
+
+ return $txt;
+}
+
1;
diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat
index b76eea99eda..9c7ea4292bf 100755
--- a/src/tools/msvc/clean.bat
+++ b/src/tools/msvc/clean.bat
@@ -20,10 +20,16 @@ del /s /q src\bin\win32ver.rc 2> NUL
del /s /q src\interfaces\win32ver.rc 2> NUL
if exist src\backend\win32ver.rc del /q src\backend\win32ver.rc
if exist src\backend\replication\libpqwalreceiver\win32ver.rc del /q src\backend\replication\libpqwalreceiver\win32ver.rc
+if exist src\backend\snowball\win32ver.rc del /q src\backend\snowball\win32ver.rc
+if exist src\interfaces\ecpg\test\win32ver.rc del /q src\interfaces\ecpg\test\win32ver.rc
if exist src\pl\plperl\win32ver.rc del /q src\pl\plperl\win32ver.rc
if exist src\pl\plpgsql\src\win32ver.rc del /q src\pl\plpgsql\src\win32ver.rc
if exist src\pl\plpython\win32ver.rc del /q src\pl\plpython\win32ver.rc
if exist src\pl\tcl\win32ver.rc del /q src\pl\tcl\win32ver.rc
+if exist src\test\isolation\win32ver.rc del /q src\test\isolation\win32ver.rc
+if exist src\test\regress\win32ver.rc del /q src\test\regress\win32ver.rc
+if exist src\timezone\win32ver.rc del /q src\timezone\win32ver.rc
+
for /d %%f in (src\interfaces\ecpg\*) do if exist %%f\win32ver.rc del /q %%f\win32ver.rc
for /d %%f in (contrib\*) do if exist %%f\win32ver.rc del /q %%f\win32ver.rc
for /d %%f in (src\backend\utils\mb\conversion_procs\*) do if exist %%f\win32ver.rc del /q %%f\win32ver.rc