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
,openldap
))
12 $(eval
$(call gb_ExternalProject_use_externals
,openldap
,openssl
))
14 $(eval
$(call gb_ExternalProject_register_targets
,openldap
,\
19 ifeq ($(OS
),LINUX
) # i.e., assuming glibc
20 # glibc needs at least _XOPEN_SOURCE=500 to declare pthread_getconcurrency and
21 # pthread_setconcurrency in <pthread.h> (and once that is defined, it also needs either
22 # _DEFUALT_SOURCE (glibc >= 2.19) or the deprecated _BSD_SOURCE (glibc <= 2.18) to be defined
23 # explicitly, so that e.g. u_char is declared in <sys/types.h>):
24 openldap_CFLAGS
= -D_XOPEN_SOURCE
=500 -D_DEFAULT_SOURCE
-D_BSD_SOURCE
27 openldap_LDFLAGS
= $(call gb_ExternalProject_get_link_flags
,openldap
)
28 ifeq ($(SYSTEM_OPENSSL
),)
29 openldap_LDFLAGS
+= -L
$(gb_UnpackedTarball_workdir
)/openssl
32 openldap_LDFLAGS
+= -pthread
35 $(call gb_ExternalProject_get_state_target
,openldap
,build
) :
36 $(call gb_Trace_StartRange
,openldap
,EXTERNAL
)
37 $(call gb_ExternalProject_run
,build
,\
38 $(gb_RUN_CONFIGURE
) .
/configure \
42 --without-cyrus-sasl \
45 $(gb_CONFIGURE_PLATFORMS
) \
46 $(if
$(CROSS_COMPILING
), \
47 --with-yielding_select
=yes \
48 ac_cv_func_memcmp_working
=yes \
50 $(if
$(SYSTEM_OPENSSL
), \
51 CPPFLAGS
="$(CPPFLAGS) $(OPENSSL_CFLAGS)" CFLAGS
="$(CFLAGS) $(openldap_CFLAGS) $(OPENSSL_CFLAGS) $(call gb_ExternalProject_get_build_flags,openldap)" LDFLAGS
="$(LDFLAGS) $(openldap_LDFLAGS) $(OPENSSL_LIBS)" \
53 CPPFLAGS
="$(CPPFLAGS) -I$(gb_UnpackedTarball_workdir)/openssl/include" \
54 CFLAGS
="$(CFLAGS) $(openldap_CFLAGS) $(call gb_ExternalProject_get_build_flags,openldap) -I$(gb_UnpackedTarball_workdir)/openssl/include" \
56 $(if
$(openldap_LDFLAGS
),LDFLAGS
="$(LDFLAGS) $(openldap_LDFLAGS)") \
57 && MAKEFLAGS
= && $(MAKE
) \
59 $(call gb_Trace_EndRange
,openldap
,EXTERNAL
)
62 # vim: set noet sw=4 ts=4: