]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Properly install dynloader.h on MSVC builds
authorBruce Momjian <bruce@momjian.us>
Wed, 20 Jan 2016 04:30:29 +0000 (23:30 -0500)
committerBruce Momjian <bruce@momjian.us>
Wed, 20 Jan 2016 04:30:29 +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 cd3db871e0bd240e80ecff695786fe61056c7ca1..a0be31da152109c5b81cc90f4b257592005668e3 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 "storage/shmem.h"
index f9557254a4b2b1c481b89f8d33c527415dfb0c06..51d8ee477ce6944c965cfcaef22c28791e0ecfa9 100644 (file)
@@ -582,7 +582,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';
 
@@ -605,7 +605,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 6b16e69b69015c3e5129650baf41fd36f2c9acba..24dcd995413ea0708f50d9427e540469f362885a 100644 (file)
@@ -285,6 +285,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 e3da6aa282fbf1a3ec95e23041f32e0e084faac7..feb0fe5b85e462f657344360aec9586e36e45049 100755 (executable)
@@ -38,6 +38,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