office-gobmx/external/gpgmepp/ExternalProject_gpgmepp.mk
Jan-Marek Glogowski 4537886ec1 externals: always provide platform configure flags
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>
2022-01-31 10:31:04 +01:00

87 lines
3.1 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,gpgmepp))
$(eval $(call gb_ExternalProject_register_targets,gpgmepp,\
build \
))
$(eval $(call gb_ExternalProject_use_autoconf,gpgmepp,build))
$(eval $(call gb_ExternalProject_use_externals,gpgmepp,\
libgpg-error \
libassuan \
))
ifeq ($(COM),MSC)
$(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_Executable_get_target_for_build,cpp)
$(call gb_Trace_StartRange,gpgmepp,EXTERNAL)
$(call gb_ExternalProject_run,build, \
$(gb_WIN_GPG_cross_setup_exports) \
&& autoreconf \
&& $(gb_RUN_CONFIGURE) ./configure \
$(gb_CONFIGURE_PLATFORMS) \
--disable-shared \
--disable-languages \
--disable-gpgconf-test \
--disable-gpg-test \
--disable-gpgsm-test \
--disable-g13-test \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
CFLAGS='$(CFLAGS) \
$(if $(ENABLE_OPTIMIZED), \
$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
$(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \
$(gb_WIN_GPG_platform_switches) \
MAKE=$(MAKE) \
&& $(MAKE) \
)
$(call gb_Trace_EndRange,gpgmepp,EXTERNAL)
else
$(call gb_ExternalProject_get_state_target,gpgmepp,build):
$(call gb_Trace_StartRange,gpgmepp,EXTERNAL)
$(call gb_ExternalProject_run,build,\
autoreconf \
&& $(gb_RUN_CONFIGURE) ./configure \
--disable-gpgconf-test \
--disable-gpg-test \
--disable-gpgsm-test \
--disable-g13-test \
--enable-languages="cpp" \
GPG_ERROR_CFLAGS="$(GPG_ERROR_CFLAGS)" \
GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \
LIBASSUAN_CFLAGS="$(LIBASSUAN_CFLAGS)" \
LIBASSUAN_LIBS="$(LIBASSUAN_LIBS)" \
CFLAGS='$(CFLAGS) \
$(if $(ENABLE_OPTIMIZED), \
$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
$(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \
CXXFLAGS='$(CXXFLAGS) \
$(if $(ENABLE_OPTIMIZED), \
$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
$(gb_COMPILERDEFS_STDLIB_DEBUG) \
$(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \
$(if $(filter LINUX,$(OS)), \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
$(gb_CONFIGURE_PLATFORMS) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \
&& $(MAKE) \
$(if $(filter MACOSX,$(OS)),\
&& $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
$(EXTERNAL_WORKDIR)/lang/cpp/src/.libs/libgpgmepp.6.dylib \
$(EXTERNAL_WORKDIR)/src/.libs/libgpgme.11.dylib \
) \
)
$(call gb_Trace_EndRange,gpgmepp,EXTERNAL)
endif
# vim: set noet sw=4 ts=4: