internals:windows:libs:libpg
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
internals:windows:libs:libpg [2008/07/23 17:18] – code change pajoye | internals:windows:libs:libpg [2013/01/29 11:25] – [Dependencies] ab | ||
---|---|---|---|
Line 6: | Line 6: | ||
* Common tools used to compile PHP | * Common tools used to compile PHP | ||
* Native Perl from ActiveState ([[http:// | * Native Perl from ActiveState ([[http:// | ||
- | * Postgresql sources ([[http://pecl2.php.net/ | + | * Postgresql sources ([[https://github.com/winlibs/]] Custom sources for VC6) |
==== Dependencies ==== | ==== Dependencies ==== | ||
- | * OpenSSL build ([[http://pecl2.php.net/ | + | * OpenSSL build ([[http://windows.php.net/ |
- | * ZLib build ([[http://pecl2.php.net/ | + | * ZLib build ([[http://windows.php.net/ |
==== Modification to the config scripts (all VCs) ===== | ==== Modification to the config scripts (all VCs) ===== | ||
+ | |||
+ | The ready to be used sources are available in our source repository [[https:// | ||
To make it works smoothly with our libraries, it is first needed to modify the script to look for: | To make it works smoothly with our libraries, it is first needed to modify the script to look for: | ||
Line 55: | Line 57: | ||
==== Modification to the sources (VC6) only ===== | ==== Modification to the sources (VC6) only ===== | ||
- | libpq relies on SHGetFolderPath which is not available in the Platform SDK used by VC6 (2003/ | + | libpq relies on SHGetFolderPath which is not available in the Platform SDK used by VC6 (2003/ |
<code C> | <code C> | ||
Line 90: | Line 92: | ||
</ | </ | ||
- | ==== Configure | ||
- | Configure | + | Further changes have to be done after having run the configure scripts, to update pg_config.h, |
+ | |||
+ | ==== Compile ===== | ||
+ | |||
+ | The automatic build works smoothly for VC8 and VC9. However it is not compatible with VC6, the generated files have to be slightly modified after that build.bat has been called (and failed with many errors). | ||
<code bash> | <code bash> | ||
- | cd C: | + | cd C: |
+ | |||
+ | build.bat libpq | ||
</ | </ | ||
+ | Modify src\src\include\pg_config.h as follow, line 136: | ||
+ | <code C> | ||
+ | /* Define to 1 if your compiler understands __FUNCTION__. */ | ||
+ | #if _MSV_VER >= 1500 | ||
+ | #define HAVE_FUNCNAME__FUNCTION 1 | ||
+ | #endif | ||
+ | </ | ||
+ | |||
+ | SSPI auth is supported by the Platform SDK used by VC6, it has to be disabled: | ||
+ | <code C> | ||
+ | /* | ||
+ | * Always build with SSPI support. Keep it as a #define in case | ||
+ | * we want a switch to disable it sometime in the future. | ||
+ | */ | ||
+ | #ifndef __BORLANDC__ | ||
+ | # if _MSC_VER >= 1500 | ||
+ | # define ENABLE_SSPI 1 | ||
+ | # endif | ||
+ | #endif | ||
+ | </ | ||
===== Compiling ===== | ===== Compiling ===== | ||
+ | For VC8 and VC9, the build.bat script works out of the box (with the config.pl changes). The dll should be in the Release or Debug directory. | ||
+ | |||
+ | For VC6, open the pgsql.dsw (it has dozen of dsp, but we need only two) in VC6. Build first libpgport then libpq. The dependency requires a change: | ||
+ | |||
+ | * drop secur32.lib (odbc*, ole*, gdi* as well but they are harmless) | ||
+ | |||
+ | It may not find the .lib or headers for openssl or zlib, in that case simply fix the project settings: | ||
+ | |||
+ | * Add ..\..\..\deps\include to the include path option | ||
+ | * Add ..\..\..\deps\lib to the additionals library path option | ||
+ | Absolute path works as well but they make your tree path dependent. These relative paths will work by default with the php-sdk. |
internals/windows/libs/libpg.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1