WASM: add initial support for Emscripten cross build
[LibreOffice.git] / external / libffi / ExternalProject_libffi.mk
bloba495db9af11ca7bbdde9458cef96cdf443ef0a1a
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,\
13 build \
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 --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
33 $(if $(filter LINUX,$(OS)), \
34 --disable-shared \
35 CC="$(CC) -fvisibility=hidden" \
36 --with-pic \
37 --enable-portable-binary) \
38 $(if $(filter WNT,$(OS)), \
39 --disable-static \
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)" \
42 LD='link' \
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) \
47 --disable-docs \
48 && $(MAKE) \
50 $(call gb_Trace_EndRange,libffi,EXTERNAL)
52 # vim: set noet sw=4 ts=4: