]> granicus.if.org Git - postgresql/commitdiff
Properly install dynloader.h on MSVC builds
authorBruce Momjian <bruce@momjian.us>
Wed, 20 Jan 2016 04:30:28 +0000 (23:30 -0500)
committerBruce Momjian <bruce@momjian.us>
Wed, 20 Jan 2016 04:30:28 +0000 (23:30 -0500)
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

src/backend/utils/fmgr/dfmgr.c
src/tools/msvc/Install.pm
src/tools/msvc/Solution.pm
src/tools/msvc/clean.bat

index d7634a98d90c6c6d6a34c1a84af4f02ab38d970d..688897165d967ff4f5b6b5e0173b345efbe84968 100644 (file)
 
 #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"
index da82ccd9e504fbeadd39e0ace36c8138fd389dd7..b779b3139608294c2f11f7c290f710bfe3b774ba 100644 (file)
@@ -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');
index 1a7b94da6cd7728c473080db124456fbc9b890ce..bedab72471db26224846b05b89a8973d7de1859b 100644 (file)
@@ -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";
index a59bbe55da93df6c10248933e37a837f7db61690..2d73320bc7b3fe6f0951fbf863b1feb109b67663 100755 (executable)
@@ -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