Properly install dynloader.h on MSVC builds
authorBruce Momjian <[email protected]>
Wed, 20 Jan 2016 04:30:28 +0000 (23:30 -0500)
committerBruce Momjian <[email protected]>
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 64b48e11497ee5cf9aa9a6f27204a6fe83b61b17..5f595578d346e800d742a867fb408a82f1cf2f19 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 4cd6cdb6574621550521c740c6d4aa0d0807d9b4..7205e232842cf739489f11c1efba7f8c272267ef 100644 (file)
@@ -492,7 +492,7 @@ sub CopyIncludeFiles
        'Public headers',
        $target . '/include/',
        'src/include/', 'postgres_ext.h', 'pg_config.h', 'pg_config_os.h',
-       'pg_config_manual.h');
+       'dynloader.h', 'pg_config_manual.h');
    lcopy('src/include/libpq/libpq-fs.h', $target . '/include/libpq/')
      || croak 'Could not copy libpq-fs.h';
 
@@ -515,7 +515,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/',
index f7a114a19de659326a7b7aa0ecc935eaa8b8c263..ac5f913509ba19864a82e536c4140d9fbbc4b179 100644 (file)
@@ -273,6 +273,14 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
            '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 ac310382e329e686069b107c66f4b60345fdcd8e..0501e6c11684c0874704bb52620114fba3b01f22 100755 (executable)
@@ -24,6 +24,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