Bump version to 6.4.7.2.M8
[LibreOffice.git] / external / postgresql / ExternalProject_postgresql.mk
blob377f02c0174cab560f1fed05f455a27456805e9e
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 $(if $(ENABLE_LDAP),openldap) \
14 openssl \
17 $(eval $(call gb_ExternalProject_register_targets,postgresql,\
18 build \
21 ifeq ($(OS),WNT)
23 $(eval $(call gb_ExternalProject_use_nmake,postgresql,build))
25 $(call gb_ExternalProject_get_state_target,postgresql,build) :
26 $(call gb_ExternalProject_run,build,\
27 MSBFLAGS="/p:Platform=$(if $(filter X86_64,$(CPUNAME)),x64,Win32) \
28 $(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \
29 $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \
30 $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION))" \
31 $(PERL) build.pl $(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) libpq \
32 ,src/tools/msvc)
34 else
36 postgresql_CPPFLAGS := $(ZLIB_CFLAGS)
37 postgresql_LDFLAGS := $(LDFLAGS)
39 ifeq ($(SYSTEM_ZLIB),)
40 postgresql_LDFLAGS += $(ZLIB_LIBS)
41 endif
43 ifeq ($(DISABLE_OPENSSL),)
44 ifeq ($(SYSTEM_OPENSSL),)
45 postgresql_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,openssl)/include
46 postgresql_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,openssl)/ $(if $(filter $(OS),LINUX),-pthread)
47 endif
48 endif
50 ifeq ($(SYSTEM_OPENLDAP),)
51 postgresql_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,openldap)/include
52 postgresql_LDFLAGS += \
53 -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/libldap_r/.libs \
54 -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/libldap/.libs \
55 -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/liblber/.libs \
56 $(if $(SYSTEM_NSS),,\
57 -L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib) \
59 endif
61 # note: as of 13.1, zlib is not needed by libpq
62 # passing MAKELEVEL=0 is required to find internal headers
64 $(call gb_ExternalProject_get_state_target,postgresql,build) :
65 $(call gb_ExternalProject_run,build,\
66 ./configure \
67 --without-readline \
68 --without-zlib \
69 --with-ldap \
70 $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
71 $(if $(DISABLE_OPENSSL),,--with-openssl \
72 $(if $(WITH_GSSAPI),--with-gssapi)) \
73 $(if $(ENABLE_LDAP),,--with-ldap=no) \
74 CFLAGS="-fPIC" \
75 CPPFLAGS="$(postgresql_CPPFLAGS)" \
76 LDFLAGS="$(postgresql_LDFLAGS)" \
77 $(if $(ENABLE_LDAP),EXTRA_LDAP_LIBS="-llber -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4") \
78 && cd src/interfaces/libpq \
79 && MAKEFLAGS= && $(MAKE) MAKELEVEL=0 all-static-lib)
81 endif
83 # vim: set noet sw=4 ts=4: