This is an old revision of the document!


Building the MySQL and PostgreSQL libraries on Windows

MySQL does not support gcc on Windows, only MSVC. Moved to a separate page.

XXX WIP (previous version worked fine for shared libraries, trying to get static libraries working)

http://www.postgresql.org/ftp/source/v8.3.9/

There is a bug in src/template/win32: it sets LDFLAGS unconditionally. Change this line:

LDFLAGS="-Wl,--allow-multiple-definition"

to this:

LDFLAGS="${LDFLAGS} -Wl,--allow-multiple-definition"

Next, open src/Makefile.global.in, search for -lws2_32, and add -lsecur32 at the end of that line so it looks like this:

ifeq ($(PORTNAME),win32)
LIBS += -lws2_32 -lshfolder -lsecur32
endif

Take care to edit src/Makefile.global.in and not src/Makefile.global, as the latter will be automatically regenerated from the former.

Then configure:

$ LDFLAGS=-L/c/met.no/lib CPPFLAGS=-I/c/met.no/include ./configure --prefix=/c/met.no --disable-shared

We don't want to install the entire package (server and all); we'll just install the library and headers and the pg_config tool which is used by other packages (such as libpqxx) that link against libpq.

$ make -C src/port all
$ make -C src/backend utils/fmgroids.h
$ make -C src/backend ../../src/include/utils/fmgroids.h
$ make -C src/include all install
$ make -C src/interfaces/libpq all install
$ make -C src/bin/pg_config all install

http://pqxx.org/development/libpqxx/wiki/DownloadPage

$ LDFLAGS=-L/c/met.no/lib CPPFLAGS=-I/c/met.no/include PG_CONFIG=/c/met.no/bin/pg_config.exe ./configure --prefix=/c/met.no --disable-shared
$ make all install
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • diana/windows/building/sql.1268067101.txt.gz
  • Last modified: 2022-05-31 09:23:14
  • (external edit)