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
,libffi
))
12 $(eval
$(call gb_ExternalProject_register_targets
,libffi
,\
16 # set prefix so that it ends up in libffi.pc so that pkg-config in python3 works
17 # For a static Windows build, change CPPFLAGS to include -D_LIB and --disable-static
18 # Also remove the ExternalPackage in that case
20 libffi_WIN_PLATFORM
:= $(strip \
21 $(if
$(filter INTEL
,$(CPUNAME
)),32) \
22 $(if
$(filter X86_64
,$(CPUNAME
)),64) \
23 $(if
$(filter AARCH64
,$(CPUNAME
)),arm64
) \
26 $(call gb_ExternalProject_get_state_target
,libffi
,build
):
27 $(call gb_Trace_StartRange
,libffi
,EXTERNAL
)
28 $(call gb_ExternalProject_run
,build
,\
29 export LIB
="$(ILIB)" && \
30 MAKE
=$(MAKE
) $(gb_RUN_CONFIGURE
) .
/configure \
31 --enable-option-checking
=fatal \
32 $(gb_CONFIGURE_PLATFORMS
) \
33 $(if
$(filter LINUX
,$(OS
)), \
35 CC
="$(CC) -fvisibility=hidden" \
37 --enable-portable-binary
) \
38 $(if
$(filter WNT
,$(OS
)), \
40 CC
="$(call gb_UnpackedTarball_get_dir,libffi)/msvcc.sh -m$(libffi_WIN_PLATFORM)" \
41 CXX
="$(call gb_UnpackedTarball_get_dir,libffi)/msvcc.sh -m$(libffi_WIN_PLATFORM)" \
43 CPP
='cl -nologo -EP' \
44 CXXCPP
='cl -nologo -EP' \
45 CPPFLAGS
="-DFFI_BUILDING_DLL $(SOLARINC)") \
46 --prefix=$(call gb_UnpackedTarball_get_dir
,libffi
)/$(HOST_PLATFORM
) \
50 $(call gb_Trace_EndRange
,libffi
,EXTERNAL
)
52 # vim: set noet sw=4 ts=4: