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
) \
17 $(eval
$(call gb_ExternalProject_register_targets
,postgresql
,\
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 \
36 postgresql_CPPFLAGS
:= $(ZLIB_CFLAGS
)
37 postgresql_LDFLAGS
:= $(LDFLAGS
)
39 ifeq ($(SYSTEM_ZLIB
),)
40 postgresql_LDFLAGS
+= $(ZLIB_LIBS
)
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
)
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 \
57 -L
$(call gb_UnpackedTarball_get_dir
,nss
)/dist/out
/lib
) \
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
,\
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
) \
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
)
83 # vim: set noet sw=4 ts=4: