Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
diana:windows:building:sql [2010-02-18 17:09:36] dages |
diana:windows:building:sql [2022-05-31 09:29:31] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Building the MySQL and PostgreSQL libraries on Windows ====== | ====== Building the MySQL and PostgreSQL libraries on Windows ====== | ||
+ | |||
+ | ===== MySQL ===== | ||
MySQL does not support gcc on Windows, only MSVC. Moved to a [[windows: | MySQL does not support gcc on Windows, only MSVC. Moved to a [[windows: | ||
Line 5: | Line 7: | ||
===== PostgreSQL ===== | ===== PostgreSQL ===== | ||
- | http://www.postgresql.org/ | + | Both the C and C++ interfaces build fine "out of the box" (except for the '' |
- | There is a bug in '' | + | There is a problem when building static libraries, though. |
- | LDFLAGS=" | + | Keeping SSPI means a little more work right now (to build '' |
- | to this: | + | Another issue is that '' |
- | LDFLAGS=" | + | ==== libpq (C interface) ==== |
- | Then configure | + | PostgreSQL includes its own implementations of certain functions which are not available in Win32, such as '' |
- | $ LDFLAGS=-L/c/met.no/lib CPPFLAGS=-I/ | + | **NOTE:** The PostgreSQL developers have [[http://thread.gmane.org/gmane.comp.db.postgresql.devel.general/137878|stated quite unambiguously]] that they do not support static linking and will disable it completely in future releases. |
- | $ make | + | |
- | We don't want to install | + | First, get the latest source |
- | $ make -C src/include install | + | Next, apply the patch below. |
- | $ make -C src/ | + | |
- | $ make -C src/ | + | |
- | ===== '' | + | $ patch -b -l -p0 |
- | http://pqxx.org/ | + | then copy & paste the patch. |
- | | + | |
- | $ make all install | + | --- src/include/port.h.orig 2009-11-14 16: |
+ | +++ src/include/ | ||
+ | @@ -337,6 +337,7 @@ | ||
+ | * When necessary, these routines are provided by files in src/port/. | ||
+ | */ | ||
+ | # | ||
+ | +#define crypt pq_crypt | ||
+ | | ||
+ | # | ||
+ | |||
+ | @@ -351,44 +352,60 @@ | ||
+ | # | ||
+ | |||
+ | # | ||
+ | +#define getopt pq_getopt | ||
+ | | ||
+ | # | ||
+ | |||
+ | # | ||
+ | +#define isinf pq_isinf | ||
+ | | ||
+ | # | ||
+ | |||
+ | # | ||
+ | +#define rint pq_rint | ||
+ | | ||
+ | # | ||
+ | |||
+ | # | ||
+ | #include | ||
+ | # | ||
+ | +#define inet_aton pq_inet_aton | ||
+ | | ||
+ | # | ||
+ | |||
+ | # | ||
+ | +#define strdup pq_strdup | ||
+ | | ||
+ | # | ||
+ | |||
+ | +#ifndef HAVE_STRLCAT | ||
+ | +#define strlcat pq_strlcat | ||
+ | +#endif | ||
+ | + | ||
+ | #if !HAVE_DECL_STRLCAT | ||
+ | | ||
+ | # | ||
+ | |||
+ | +#ifndef HAVE_STRLCPY | ||
+ | +#define strlcpy pq_strlcpy | ||
+ | +#endif | ||
+ | + | ||
+ | #if !HAVE_DECL_STRLCPY | ||
+ | | ||
+ | # | ||
+ | |||
+ | #if !defined(HAVE_RANDOM) && !defined(__BORLANDC__) | ||
+ | +#define random pq_random | ||
+ | | ||
+ | # | ||
+ | |||
+ | # | ||
+ | +#define unsetenv pq_unsetenv | ||
+ | | ||
+ | # | ||
+ | |||
+ | # | ||
+ | +#define srandom pq_srandom | ||
+ | | ||
+ | # | ||
+ | |||
+ | --- src/Makefile.global.in.orig 2007-11-13 01: | ||
+ | +++ src/Makefile.global.in 2010-03-10 13: | ||
+ | @@ -435,9 +435,10 @@ | ||
+ | | ||
+ | |||
+ | # to make ws2_32.lib the last library, and always link with shfolder, | ||
+ | -# so SHGetFolderName isn't picked up from shell32.dll | ||
+ | +# so SHGetFolderName isn't picked up from shell32.dll. | ||
+ | +# with secur32 for SSPI. | ||
+ | ifeq ($(PORTNAME), | ||
+ | -LIBS += -lws2_32 -lshfolder | ||
+ | +LIBS += -lws2_32 -lshfolder -lsecur32 | ||
+ | | ||
+ | |||
+ | # Not really standard libc functions, used by the backend. | ||
+ | --- src/template/win32.orig 2004-11-08 06: | ||
+ | | ||
+ | @@ -1,4 +1,4 @@ | ||
+ | # This is required to link pg_dump because it finds pg_toupper() in | ||
+ | # libpq and pgport | ||
+ | -LDFLAGS=" | ||
+ | +LDFLAGS=" | ||
+ | |||
+ | Then configure: | ||
+ | |||
+ | $ LDFLAGS=-L/ | ||
+ | |||
+ | We don't want to install the entire package (server and all); we'll just install the library and headers and the '' | ||
+ | |||
+ | $ make -C src/port all | ||
+ | $ make -C src/backend utils/ | ||
+ | $ make -C src/backend ../ | ||
+ | $ make -C src/include all install | ||
+ | $ make -C src/ | ||
+ | $ make -C src/ | ||
+ | $ cp COPYRIGHT / | ||
+ | |||
+ | ==== libpqxx (C++ interface) ==== | ||
+ | |||
+ | First, get the latest source (currently 3.0.2) from http:// | ||
+ | |||
+ | Then configure: | ||
+ | |||
+ | $ LIBS=-lsecur32 LDFLAGS=-L/ | ||
+ | |||
+ | The '' | ||
+ | |||
+ | Finally, build and install: | ||
+ | |||
+ | $ make all install | ||
+ | $ cp AUTHORS / | ||
+ | $ cat COPYING >>/ |