Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / external / postgresql / ExternalProject_postgresql.mk
blobf6617e52fcd882f65e876199c9351d1f4f3487a3
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_ExternalProject_ExternalProject,postgresql))
12 $(eval $(call gb_ExternalProject_use_externals,postgresql,\
13 openldap \
14 openssl \
15 zlib \
18 $(eval $(call gb_ExternalProject_register_targets,postgresql,\
19 build \
22 ifeq ($(OS),WNT)
24 $(eval $(call gb_ExternalProject_use_nmake,postgresql,build))
26 $(call gb_ExternalProject_get_state_target,postgresql,build) :
27 $(call gb_ExternalProject_run,build,\
28 nmake -f win32.mak USE_SSL=1 USE_LDAP=1 \
29 ,src)
31 else
33 postgresql_CPPFLAGS := $(ZLIB_CFLAGS)
34 postgresql_LDFLAGS :=
36 ifeq ($(SYSTEM_ZLIB),)
37 postgresql_LDFLAGS += $(ZLIB_LIBS)
38 endif
40 ifeq ($(DISABLE_OPENSSL),)
41 ifeq ($(SYSTEM_OPENSSL),)
42 postgresql_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,openssl)/include
43 postgresql_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,openssl)/
44 endif
45 endif
47 ifeq ($(SYSTEM_OPENLDAP),)
48 postgresql_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,openldap)/include
49 postgresql_LDFLAGS += \
50 -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/libldap_r/.libs \
51 -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/libldap/.libs \
52 -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/liblber/.libs \
53 $(if $(SYSTEM_NSS),,\
54 -L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib) \
56 endif
59 $(call gb_ExternalProject_get_state_target,postgresql,build) :
60 $(call gb_ExternalProject_run,build,\
61 ./configure \
62 --without-readline --disable-shared --with-ldap \
63 $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
64 $(if $(DISABLE_OPENSSL),,--with-openssl \
65 $(if $(WITH_KRB5), --with-krb5) \
66 $(if $(WITH_GSSAPI),--with-gssapi)) \
67 CPPFLAGS="$(postgresql_CPPFLAGS)" \
68 LDFLAGS="$(postgresql_LDFLAGS)" \
69 EXTRA_LDAP_LIBS="-llber -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4" \
70 && cd src/interfaces/libpq \
71 && MAKEFLAGS= && $(MAKE) all-static-lib)
73 endif
75 # vim: set noet sw=4 ts=4: