Properly install dynloader.h on MSVC builds
authorBruce Momjian
Wed, 20 Jan 2016 04:30:28 +0000 (23:30 -0500)
committerBruce Momjian
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 5528eded6362bb12501f669fbd70f95dc9008d21..814d9c80579d6f206f48ef4c7d20af4844e24241 100644 (file)
 
 #include 
 
-#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 a11c59b89de226be43b5fbc3d0072cd8ac5d9f95..5bd2637c854f1d6c690b0e68159b3d5d5ea926a4 100644 (file)
@@ -499,7 +499,7 @@ sub CopyIncludeFiles
        'Public headers', $target . '/include/',
        'src/include/',   'postgres_ext.h',
        'pg_config.h',    'pg_config_ext.h',
-       'pg_config_os.h', 'pg_config_manual.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';
 
@@ -522,7 +522,8 @@ sub CopyIncludeFiles
    CopyFiles(
        'Server headers',
        $target . '/include/server/',
-       'src/include/', 'pg_config.h', 'pg_config_ext.h', 'pg_config_os.h');
+       'src/include/', 'pg_config.h', 'pg_config_ext.h', 'pg_config_os.h',
+       'dynloader.h');
    CopyFiles(
        'Grammar header',
        $target . '/include/server/parser/',
index 473185f3ec6bd7b001a5e0a23036e3dc049b6f31..c2244bd4936b9432bcd3e7a5f2c407795085340c 100644 (file)
@@ -292,6 +292,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 e06838cc1ef12c92b2bc9bc51ab1df91608cc86f..1a4327443888b1ea31e787e44c1b1557df1a5c3f 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_ext.h del /q src\include\pg_config_ext.h
 if exist src\include\pg_config_os.h del /q src\include\pg_config_os.h
+if exist src\include\dynloader.h del /q src\include\dynloader.h
 if %DIST%==1 if exist src\backend\parser\gram.h del /q src\backend\parser\gram.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