forked from amazingfate/loongoffice
No idea why we just provided the platform flags when cross- compiling. In the curious case, where the host platform is detected as x86_64-pc-mingw32 per default and we actually want to override it with x86_64-pc-cygwin, we don't do a cross compile, but must override the host platform. But there is additional special handling needed for the omitted cross-platform build in the special case of --host=i686-pc-cygwin and --build=x86_64-pc-cygwin, where we deliberatly ignore cross building; Windows is already a slow build, so try to keep this optimization (AMD64 can execute x86 binaries). There is the theoretical case, where the externals config.guess would have detected something else and that "magically" even worked, while the LO detected triplet would fail, but this should be fixed in the external in any way. Change-Id: Ib7a9719e0e406fe90334b7611dc3f01b51692bfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129153 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
53 lines
1.8 KiB
Makefile
53 lines
1.8 KiB
Makefile
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
|
#
|
|
# This file is part of the LibreOffice project.
|
|
#
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
#
|
|
|
|
$(eval $(call gb_ExternalProject_ExternalProject,libffi))
|
|
|
|
$(eval $(call gb_ExternalProject_register_targets,libffi,\
|
|
build \
|
|
))
|
|
|
|
# set prefix so that it ends up in libffi.pc so that pkg-config in python3 works
|
|
# For a static Windows build, change CPPFLAGS to include -D_LIB and --disable-static
|
|
# Also remove the ExternalPackage in that case
|
|
|
|
libffi_WIN_PLATFORM := $(strip \
|
|
$(if $(filter INTEL,$(CPUNAME)),32) \
|
|
$(if $(filter X86_64,$(CPUNAME)),64) \
|
|
$(if $(filter AARCH64,$(CPUNAME)),arm64) \
|
|
)
|
|
|
|
$(call gb_ExternalProject_get_state_target,libffi,build):
|
|
$(call gb_Trace_StartRange,libffi,EXTERNAL)
|
|
$(call gb_ExternalProject_run,build,\
|
|
export LIB="$(ILIB)" && \
|
|
MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
|
|
--enable-option-checking=fatal \
|
|
$(gb_CONFIGURE_PLATFORMS) \
|
|
$(if $(filter LINUX,$(OS)), \
|
|
--disable-shared \
|
|
CC="$(CC) -fvisibility=hidden" \
|
|
--with-pic \
|
|
--enable-portable-binary) \
|
|
$(if $(filter WNT,$(OS)), \
|
|
--disable-static \
|
|
CC="$(call gb_UnpackedTarball_get_dir,libffi)/msvcc.sh -m$(libffi_WIN_PLATFORM)" \
|
|
CXX="$(call gb_UnpackedTarball_get_dir,libffi)/msvcc.sh -m$(libffi_WIN_PLATFORM)" \
|
|
LD='link' \
|
|
CPP='cl -nologo -EP' \
|
|
CXXCPP='cl -nologo -EP' \
|
|
CPPFLAGS="-DFFI_BUILDING_DLL $(SOLARINC)") \
|
|
--prefix=$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM) \
|
|
--disable-docs \
|
|
&& $(MAKE) \
|
|
)
|
|
$(call gb_Trace_EndRange,libffi,EXTERNAL)
|
|
|
|
# vim: set noet sw=4 ts=4:
|