summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2016-01-20 04:30:28 +0000
committerBruce Momjian2016-01-20 04:30:28 +0000
commitb1bc381446d7089164b92d52dab1a2d2872dba54 (patch)
tree34cdd57f76ecd27dbdbcb9de8123f1e2660c7bd8
parent161a767155166e5bc29e515fb16e4c4331be3633 (diff)
Properly install dynloader.h on MSVC builds
This will enable PL/Java to be cleanly compiled, as dynloader.h is a requirement. Report by Chapman Flack Patch by Michael Paquier Backpatch through 9.1
-rw-r--r--src/backend/utils/fmgr/dfmgr.c4
-rw-r--r--src/tools/msvc/Install.pm5
-rw-r--r--src/tools/msvc/Solution.pm6
-rwxr-xr-xsrc/tools/msvc/clean.bat1
4 files changed, 10 insertions, 6 deletions
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index d7634a98d90..688897165d9 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -16,11 +16,7 @@
#include <sys/stat.h>
-#ifndef WIN32_ONLY_COMPILER
#include "dynloader.h"
-#else
-#include "port/dynloader/win32.h"
-#endif
#include "lib/stringinfo.h"
#include "miscadmin.h"
#include "utils/dynamic_loader.h"
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index da82ccd9e50..b779b313960 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -444,7 +444,8 @@ sub CopyIncludeFiles
CopyFiles(
'Public headers',
$target . '/include/',
- 'src/include/', 'postgres_ext.h', 'pg_config.h', 'pg_config_os.h', 'pg_config_manual.h'
+ 'src/include/', 'postgres_ext.h', 'pg_config.h', 'pg_config_os.h',
+ 'dynloader.h', 'pg_config_manual.h'
);
lcopy('src/include/libpq/libpq-fs.h', $target . '/include/libpq/')
|| croak 'Could not copy libpq-fs.h';
@@ -471,7 +472,7 @@ sub CopyIncludeFiles
CopyFiles(
'Server headers',
$target . '/include/server/',
- 'src/include/', 'pg_config.h', 'pg_config_os.h'
+ 'src/include/', 'pg_config.h', 'pg_config_os.h', 'dynloader.h'
);
CopyFiles('Grammar header', $target . '/include/server/parser/',
'src/backend/parser/', 'gram.h');
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 1a7b94da6cd..bedab72471d 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -265,6 +265,12 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
copyFile('src\backend\utils\fmgroids.h','src\include\utils\fmgroids.h');
}
+ if (IsNewer('src/include/dynloader.h', 'src/backend/port/dynloader/win32.h'))
+ {
+ copyFile('src/backend/port/dynloader/win32.h',
+ 'src/include/dynloader.h');
+ }
+
if (IsNewer('src\include\utils\probes.h','src\backend\utils\probes.d'))
{
print "Generating probes.h...\n";
diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat
index a59bbe55da9..2d73320bc7b 100755
--- a/src/tools/msvc/clean.bat
+++ b/src/tools/msvc/clean.bat
@@ -20,6 +20,7 @@ REM Delete files created with GenerateFiles() in Solution.pm
if exist src\include\pg_config.h del /q src\include\pg_config.h
if exist src\include\pg_config_os.h del /q src\include\pg_config_os.h
if %DIST%==1 if exist src\backend\parser\gram.h del /q src\backend\parser\gram.h
+if exist src\include\dynloader.h del /q src\include\dynloader.h
if exist src\include\utils\errcodes.h del /q src\include\utils\errcodes.h
if exist src\include\utils\fmgroids.h del /q src\include\utils\fmgroids.h
if exist src\include\utils\probes.h del /q src\include\utils\probes.h