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_Trace_StartRange
,postgresql
,EXTERNAL
)
27 $(call gb_ExternalProject_run
,build
,\
28 MSBFLAGS
="/p:Platform=$(gb_MSBUILD_PLATFORM) \
29 /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \
30 $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION))" \
31 $(PERL
) build.pl
$(gb_MSBUILD_CONFIG
) libpq \
33 $(call gb_Trace_EndRange
,postgresql
,EXTERNAL
)
37 postgresql_CPPFLAGS
:= $(ZLIB_CFLAGS
)
38 postgresql_LDFLAGS
:= $(LDFLAGS
)
40 ifeq ($(SYSTEM_ZLIB
),)
41 postgresql_LDFLAGS
+= $(ZLIB_LIBS
)
44 ifeq ($(ENABLE_OPENSSL
),TRUE
)
45 ifeq ($(SYSTEM_OPENSSL
),)
46 postgresql_CPPFLAGS
+= -I
$(gb_UnpackedTarball_workdir
)/openssl
/include
47 postgresql_LDFLAGS
+= -L
$(gb_UnpackedTarball_workdir
)/openssl
$(if
$(filter $(OS
),LINUX
),-pthread
)
51 ifeq ($(SYSTEM_OPENLDAP
),)
52 postgresql_CPPFLAGS
+= -I
$(gb_UnpackedTarball_workdir
)/openldap
/include
53 postgresql_LDFLAGS
+= \
54 -L
$(gb_UnpackedTarball_workdir
)/openldap
/libraries
/libldap_r
/.libs \
55 -L
$(gb_UnpackedTarball_workdir
)/openldap
/libraries
/libldap
/.libs \
56 -L
$(gb_UnpackedTarball_workdir
)/openldap
/libraries
/liblber
/.libs \
60 # note: as of 13.1, zlib is not needed by libpq
61 # passing MAKELEVEL=0 is required to find internal headers
63 $(call gb_ExternalProject_get_state_target
,postgresql
,build
) :
64 $(call gb_Trace_StartRange
,postgresql
,EXTERNAL
)
65 $(call gb_ExternalProject_run
,build
,\
66 $(gb_RUN_CONFIGURE
) .
/configure \
70 $(gb_CONFIGURE_PLATFORMS
) \
71 $(if
$(ENABLE_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") \
78 && cd src
/interfaces
/libpq \
79 && MAKEFLAGS
= && $(MAKE
) MAKELEVEL
=0 all-static-lib
)
80 $(call gb_Trace_EndRange
,postgresql
,EXTERNAL
)
84 # vim: set noet sw=4 ts=4: