From 595848c85acc2609fcc48a40c7a9f216a2722cd8 Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Mon, 30 Jan 2017 15:50:55 +0100 Subject: gpg4libre: Support building --with-system-gpgme (Linux only so far) Change-Id: I22af89b920d43f3fc5f0fff02070f288bfa59fb4 Reviewed-on: https://gerrit.libreoffice.org/33702 Tested-by: Jenkins Reviewed-by: Siegmund Gorr Reviewed-by: Thorsten Behrens --- RepositoryExternal.mk | 16 ++++++++++++++++ config_host.mk.in | 3 +++ configure.ac | 28 ++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 02392ae9af8c..13c9ddfd45e3 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -3423,6 +3423,22 @@ endef endif # ENABLE_BREAKPAD +ifneq ($(SYSTEM_GPGME),) + +define gb_LinkTarget__use_gpgme +$(call gb_LinkTarget_set_include,$(1),\ + $$(INCLUDE) \ + $$(GPGME_CFLAGS) \ +) + +$(call gb_LinkTarget_add_libs,$(1),\ + $(GPGME_LIBS) \ +) + +endef + +endif + ifeq ($(ENABLE_GLTF),TRUE) ifneq ($(SYSTEM_LIBGLTF),TRUE) diff --git a/config_host.mk.in b/config_host.mk.in index 13e0bde6e271..1ddf49dba636 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -203,6 +203,8 @@ export GIT_NEEDED_SUBMODULES=@GIT_NEEDED_SUBMODULES@ export EPOXY_CFLAGS=$(gb_SPACE)@EPOXY_CFLAGS@ export EPOXY_LIBS=$(gb_SPACE)@EPOXY_LIBS@ export GLM_CFLAGS=$(gb_SPACE)@GLM_CFLAGS@ +export GPGME_CFLAGS=$(gb_SPACE)@GPGME_CFLAGS@ +export GPGME_LIBS=$(gb_SPACE)@GPGME_LIBS@ export GNOMEVFS_CFLAGS=$(gb_SPACE)@GNOMEVFS_CFLAGS@ export GNOMEVFS_LIBS=$(gb_SPACE)@GNOMEVFS_LIBS@ export GNUTLS_CFLAGS=$(gb_SPACE)@GNUTLS_CFLAGS@ @@ -516,6 +518,7 @@ export SYSTEM_GENCCODE=@SYSTEM_GENCCODE@ export SYSTEM_GENCMN=@SYSTEM_GENCMN@ export SYSTEM_EPOXY=@SYSTEM_EPOXY@ export SYSTEM_GLM=@SYSTEM_GLM@ +export SYSTEM_GPGME=@SYSTEM_GPGME@ export SYSTEM_GRAPHITE=@SYSTEM_GRAPHITE@ export SYSTEM_HARFBUZZ=@SYSTEM_HARFBUZZ@ export SYSTEM_HSQLDB=@SYSTEM_HSQLDB@ diff --git a/configure.ac b/configure.ac index e8551c801e88..93896d73495f 100644 --- a/configure.ac +++ b/configure.ac @@ -1721,6 +1721,11 @@ AC_ARG_WITH(system-poppler, [Use system poppler (only needed for PDF import).]),, [with_system_poppler="$with_system_libs"]) +AC_ARG_WITH(system-gpgme, + AS_HELP_STRING([--with-system-gpgme], + [Use gpgme already on system]),, + [with_system_gpgme="$with_system_libs"]) + AC_ARG_WITH(system-apache-commons, AS_HELP_STRING([--with-system-apache-commons], [Use Apache commons libraries already on system.]),, @@ -10622,6 +10627,29 @@ AC_SUBST(SYSTEM_POPPLER) AC_SUBST(POPPLER_CFLAGS) AC_SUBST(POPPLER_LIBS) +SYSTEM_GPGME= +if test "$_os" = "Linux"; then + dnl =================================================================== + dnl Check for system gpgme + dnl =================================================================== + AC_MSG_CHECKING([which gpgme to use]) + if test "$with_system_gpgme" = "yes"; then + AC_MSG_RESULT([external]) + SYSTEM_GPGME=TRUE + + AC_PATH_PROG(GPGMECONFIG, gpgme-config) + if test -z "$GPGMECONFIG"; then + AC_MSG_ERROR([--with-system-gpgme requested, but gpgme programs not found]) + fi + + GPGME_CFLAGS=`$GPGMECONFIG --cflags` + GPGME_LIBS=`$GPGMECONFIG --libs` + fi +fi +AC_SUBST(SYSTEM_GPGME) +AC_SUBST(GPGME_CFLAGS) +AC_SUBST(GPGME_LIBS) + AC_MSG_CHECKING([whether to build the Wiki Publisher extension]) if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then AC_MSG_RESULT([yes]) -- cgit