diff options
author | Thorsten Behrens <thorsten.behrens@cib.de> | 2017-11-15 21:31:07 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-11-22 17:57:08 +0100 |
commit | 50a55d862034b7a06510c014332236f44e306831 (patch) | |
tree | 422addf00716499a75d07cfb69d53aa0e2b0f118 /external | |
parent | bafbaa3fed95f28f368b0bd4256dbe2a714e3bd8 (diff) |
gpg4libre: cleanup gpgme & add gbuild lib for gpgmepp
This moves the external to gpgmepp, since that's what we _actually_
link against; plus tons of enablement for Windows build, mostly
related to linker probs integration.
There's still no good way to build a DLL with autotools, so we fall
back to gbuild manual make, see also tdf#91480
Change-Id: Ifd8217ef58536612d2389d48e343db133a13fb9c
Reviewed-on: https://gerrit.libreoffice.org/44970
Reviewed-by: Siegmund Gorr <siegmund.gorr@cib.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'external')
17 files changed, 405 insertions, 74 deletions
diff --git a/external/Module_external.mk b/external/Module_external.mk index 498d95bef4ca..6cde6d90d5aa 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -43,7 +43,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,FREETYPE,freetype) \ $(call gb_Helper_optional,GLIB2,glib2) \ $(call gb_Helper_optional,GLM,glm) \ - $(call gb_Helper_optional,GPGMEPP,gpgme) \ + $(call gb_Helper_optional,GPGMEPP,gpgmepp) \ $(call gb_Helper_optional,GRAPHITE,graphite) \ $(call gb_Helper_optional,HARFBUZZ,harfbuzz) \ $(call gb_Helper_optional,HSQLDB,hsqldb) \ diff --git a/external/gpgme/ExternalPackage_gpgme.mk b/external/gpgme/ExternalPackage_gpgme.mk deleted file mode 100644 index 8f772ec8e7e4..000000000000 --- a/external/gpgme/ExternalPackage_gpgme.mk +++ /dev/null @@ -1,30 +0,0 @@ -# -*- 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_ExternalPackage_ExternalPackage,gpgme,gpgme)) - -$(eval $(call gb_ExternalPackage_use_external_project,gpgme,gpgme)) - -ifneq ($(DISABLE_DYNLOADING),TRUE) - -ifeq ($(OS),LINUX) - -$(eval $(call gb_ExternalPackage_add_file,gpgme,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.4.0)) -$(eval $(call gb_ExternalPackage_add_file,gpgme,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.18.0)) - -else ifeq ($(OS),MACOSX) - -$(eval $(call gb_ExternalPackage_add_file,gpgme,$(LIBO_LIB_FOLDER)/libgpgmepp.6.dylib,lang/cpp/src/.libs/libgpgmepp.6.dylib)) -$(eval $(call gb_ExternalPackage_add_file,gpgme,$(LIBO_LIB_FOLDER)/libgpgme.11.dylib,src/.libs/libgpgme.11.dylib)) - -endif - -endif # $(DISABLE_DYNLOADING) - -# vim: set noet sw=4 ts=4: diff --git a/external/gpgme/UnpackedTarball_gpgme.mk b/external/gpgme/UnpackedTarball_gpgme.mk deleted file mode 100644 index 4e95fe0ab160..000000000000 --- a/external/gpgme/UnpackedTarball_gpgme.mk +++ /dev/null @@ -1,22 +0,0 @@ -# -*- 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_UnpackedTarball_UnpackedTarball,gpgme)) - -$(eval $(call gb_UnpackedTarball_set_tarball,gpgme,$(GPGME_TARBALL))) - -$(eval $(call gb_UnpackedTarball_set_patchlevel,gpgme,0)) - -$(eval $(call gb_UnpackedTarball_add_patches,gpgme, \ - external/gpgme/find-libgpg-error-libassuan.patch \ - external/gpgme/fix-autoconf-macros.patch \ - external/gpgme/add-minimal-keyexport.patch \ - $(if $(filter MSC,$(COM)),external/gpgme/w32-build-fixes.patch.1) \ -)) -# vim: set noet sw=4 ts=4: diff --git a/external/gpgmepp/ExternalPackage_gpgmepp.mk b/external/gpgmepp/ExternalPackage_gpgmepp.mk new file mode 100644 index 000000000000..d5285520619f --- /dev/null +++ b/external/gpgmepp/ExternalPackage_gpgmepp.mk @@ -0,0 +1,30 @@ +# -*- 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_ExternalPackage_ExternalPackage,gpgmepp,gpgmepp)) + +$(eval $(call gb_ExternalPackage_use_external_project,gpgmepp,gpgmepp)) + +ifneq ($(DISABLE_DYNLOADING),TRUE) + +ifeq ($(OS),LINUX) + +$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.4.0)) +$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.18.0)) + +else ifeq ($(OS),MACOSX) + +$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgmepp.6.dylib,lang/cpp/src/.libs/libgpgmepp.6.dylib)) +$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.11.dylib,src/.libs/libgpgme.11.dylib)) + +endif + +endif # $(DISABLE_DYNLOADING) + +# vim: set noet sw=4 ts=4: diff --git a/external/gpgme/ExternalProject_gpgme.mk b/external/gpgmepp/ExternalProject_gpgmepp.mk index dcaaf6bdfa2a..4b69774771fd 100644 --- a/external/gpgme/ExternalProject_gpgme.mk +++ b/external/gpgmepp/ExternalProject_gpgmepp.mk @@ -7,34 +7,32 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_ExternalProject_ExternalProject,gpgme)) +$(eval $(call gb_ExternalProject_ExternalProject,gpgmepp)) -$(eval $(call gb_ExternalProject_register_targets,gpgme,\ +$(eval $(call gb_ExternalProject_register_targets,gpgmepp,\ build \ )) -$(eval $(call gb_ExternalProject_use_autoconf,gpgme,build)) +$(eval $(call gb_ExternalProject_use_autoconf,gpgmepp,build)) -$(eval $(call gb_ExternalProject_use_externals,gpgme,\ +$(eval $(call gb_ExternalProject_use_externals,gpgmepp,\ libgpg-error \ libassuan \ )) ifeq ($(COM),MSC) -$(call gb_ExternalProject_get_state_target,gpgme,build): +$(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_ExternalProject_run,build,\ autoreconf \ && ./configure \ - --enable-languages="cl cpp" \ + --disable-shared \ + --disable-languages \ --disable-gpgconf-test \ --disable-gpg-test \ --disable-gpgsm-test \ --disable-g13-test \ - GPG_ERROR_CFLAGS="$(GPG_ERROR_CFLAGS)" \ - GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \ - LIBASSUAN_CFLAGS="$(LIBASSUAN_CFLAGS)" \ - LIBASSUAN_LIBS="$(LIBASSUAN_LIBS)" \ - CFLAGS='$(CFLAGS) \ + --disable-glibtest \ + CFLAGS='$(CFLAGS) \ $(if $(ENABLE_OPTIMIZED), \ $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \ $(if $(ENABLE_DEBUG),$(gb_DEBUG_CFLAGS)) \ @@ -42,18 +40,17 @@ $(call gb_ExternalProject_get_state_target,gpgme,build): --host=$(if $(filter INTEL,$(CPUNAME)),i686-mingw32,x86_64-w64-mingw32) \ && $(MAKE) \ ) - else -$(call gb_ExternalProject_get_state_target,gpgme,build): +$(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_ExternalProject_run,build,\ autoreconf \ && ./configure \ - --enable-languages="cl cpp" \ + --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) \ + CFLAGS='$(CFLAGS) \ $(if $(ENABLE_OPTIMIZED), \ $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \ $(if $(ENABLE_DEBUG),$(gb_DEBUG_CFLAGS)) \ @@ -64,6 +61,6 @@ $(call gb_ExternalProject_get_state_target,gpgme,build): $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ && $(MAKE) \ ) - endif + # vim: set noet sw=4 ts=4: diff --git a/external/gpgmepp/Library_gpgmepp.mk b/external/gpgmepp/Library_gpgmepp.mk new file mode 100644 index 000000000000..7649753fe748 --- /dev/null +++ b/external/gpgmepp/Library_gpgmepp.mk @@ -0,0 +1,79 @@ +# -*- 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_Library_Library,gpgmepp)) + +$(eval $(call gb_Library_use_unpacked,gpgmepp,gpgmepp)) + +$(eval $(call gb_Library_use_externals,gpgmepp,\ + libgpg-error \ + libassuan \ +)) + +$(eval $(call gb_LinkTarget_use_external_project,\ + $(call gb_Library_get_linktarget,gpgmepp),gpgmepp,full)) + +$(eval $(call gb_Library_set_warnings_not_errors,gpgmepp)) + +$(eval $(call gb_Library_set_include,gpgmepp,\ + -I$(call gb_UnpackedTarball_get_dir,gpgmepp)/lang/cpp/src \ + -I$(call gb_UnpackedTarball_get_dir,gpgmepp)/lang/cpp/src/interfaces \ + -I$(call gb_UnpackedTarball_get_dir,gpgmepp) \ + -I$(call gb_UnpackedTarball_get_dir,gpgmepp)/src \ + -I$(call gb_UnpackedTarball_get_dir,libgpg-error)/src \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_Library_add_libs,gpgmepp,\ + ws2_32.lib shell32.lib \ + -LIBPATH:$(call gb_UnpackedTarball_get_dir,gpgmepp)/src/.libs libgpgme.lib \ +)) + +$(eval $(call gb_Library_add_defs,gpgmepp,\ + -DHAVE_CONFIG_H \ + -DBUILDING_GPGMEPP \ + -DDLL_EXPORT \ + -DPIC \ +)) + +$(eval $(call gb_Library_set_generated_cxx_suffix,gpgmepp,cpp)) + +$(eval $(call gb_Library_add_generated_exception_objects,gpgmepp,\ + UnpackedTarball/gpgmepp/lang/cpp/src/callbacks \ + UnpackedTarball/gpgmepp/lang/cpp/src/configuration \ + UnpackedTarball/gpgmepp/lang/cpp/src/context \ + UnpackedTarball/gpgmepp/lang/cpp/src/context_vanilla \ + UnpackedTarball/gpgmepp/lang/cpp/src/data \ + UnpackedTarball/gpgmepp/lang/cpp/src/decryptionresult \ + UnpackedTarball/gpgmepp/lang/cpp/src/defaultassuantransaction \ + UnpackedTarball/gpgmepp/lang/cpp/src/editinteractor \ + UnpackedTarball/gpgmepp/lang/cpp/src/encryptionresult \ + UnpackedTarball/gpgmepp/lang/cpp/src/engineinfo \ + UnpackedTarball/gpgmepp/lang/cpp/src/eventloopinteractor \ + UnpackedTarball/gpgmepp/lang/cpp/src/exception \ + UnpackedTarball/gpgmepp/lang/cpp/src/gpgadduserideditinteractor \ + UnpackedTarball/gpgmepp/lang/cpp/src/gpgagentgetinfoassuantransaction \ + UnpackedTarball/gpgmepp/lang/cpp/src/gpggencardkeyinteractor \ + UnpackedTarball/gpgmepp/lang/cpp/src/gpgsetexpirytimeeditinteractor \ + UnpackedTarball/gpgmepp/lang/cpp/src/gpgsetownertrusteditinteractor \ + UnpackedTarball/gpgmepp/lang/cpp/src/gpgsignkeyeditinteractor \ + UnpackedTarball/gpgmepp/lang/cpp/src/importresult \ + UnpackedTarball/gpgmepp/lang/cpp/src/key \ + UnpackedTarball/gpgmepp/lang/cpp/src/keygenerationresult \ + UnpackedTarball/gpgmepp/lang/cpp/src/keylistresult \ + UnpackedTarball/gpgmepp/lang/cpp/src/scdgetinfoassuantransaction \ + UnpackedTarball/gpgmepp/lang/cpp/src/signingresult \ + UnpackedTarball/gpgmepp/lang/cpp/src/swdbresult \ + UnpackedTarball/gpgmepp/lang/cpp/src/tofuinfo \ + UnpackedTarball/gpgmepp/lang/cpp/src/trustitem \ + UnpackedTarball/gpgmepp/lang/cpp/src/verificationresult \ + UnpackedTarball/gpgmepp/lang/cpp/src/vfsmountresult \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/gpgme/Makefile b/external/gpgmepp/Makefile index 569ad8a0ba7a..569ad8a0ba7a 100644 --- a/external/gpgme/Makefile +++ b/external/gpgmepp/Makefile diff --git a/external/gpgme/Module_gpgme.mk b/external/gpgmepp/Module_gpgmepp.mk index 97da18dfaabd..1c13a2a5fcb8 100644 --- a/external/gpgme/Module_gpgme.mk +++ b/external/gpgmepp/Module_gpgmepp.mk @@ -7,12 +7,25 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_Module_Module,gpgme)) +$(eval $(call gb_Module_Module,gpgmepp)) -$(eval $(call gb_Module_add_targets,gpgme,\ - ExternalProject_gpgme \ - ExternalPackage_gpgme \ - UnpackedTarball_gpgme \ +$(eval $(call gb_Module_add_targets,gpgmepp,\ + UnpackedTarball_gpgmepp \ + ExternalProject_gpgmepp \ )) +ifeq ($(COM),MSC) + +$(eval $(call gb_Module_add_targets,gpgmepp,\ + Library_gpgmepp \ +)) + +else + +$(eval $(call gb_Module_add_targets,gpgmepp,\ + ExternalPackage_gpgmepp \ +)) + +endif + # vim: set noet sw=4 ts=4: diff --git a/external/gpgme/README b/external/gpgmepp/README index 220028e42471..220028e42471 100644 --- a/external/gpgme/README +++ b/external/gpgmepp/README diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk b/external/gpgmepp/UnpackedTarball_gpgmepp.mk new file mode 100644 index 000000000000..db8c398e3003 --- /dev/null +++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk @@ -0,0 +1,25 @@ +# -*- 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_UnpackedTarball_UnpackedTarball,gpgmepp)) + +$(eval $(call gb_UnpackedTarball_set_tarball,gpgmepp,$(GPGME_TARBALL))) + +$(eval $(call gb_UnpackedTarball_set_patchlevel,gpgmepp,0)) + +$(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \ + external/gpgmepp/find-libgpg-error-libassuan.patch \ + external/gpgmepp/fix-autoconf-macros.patch \ + external/gpgmepp/add-minimal-keyexport.patch \ + $(if $(filter MSC,$(COM)),external/gpgmepp/w32-build-fixes.patch.1) \ + $(if $(filter MSC,$(COM)),external/gpgmepp/w32-disable-docs.patch.1) \ + $(if $(filter MSC,$(COM)),external/gpgmepp/w32-fix-win32-macro.patch.1) \ + $(if $(filter MSC,$(COM)),external/gpgmepp/w32-fix-libtool.patch.1) \ +)) +# vim: set noet sw=4 ts=4: diff --git a/external/gpgme/add-minimal-keyexport.patch b/external/gpgmepp/add-minimal-keyexport.patch index abaeb15897fc..abaeb15897fc 100644 --- a/external/gpgme/add-minimal-keyexport.patch +++ b/external/gpgmepp/add-minimal-keyexport.patch diff --git a/external/gpgme/find-libgpg-error-libassuan.patch b/external/gpgmepp/find-libgpg-error-libassuan.patch index 2ddd4d2f2e62..2ddd4d2f2e62 100644 --- a/external/gpgme/find-libgpg-error-libassuan.patch +++ b/external/gpgmepp/find-libgpg-error-libassuan.patch diff --git a/external/gpgme/fix-autoconf-macros.patch b/external/gpgmepp/fix-autoconf-macros.patch index 627c7b15247a..627c7b15247a 100644 --- a/external/gpgme/fix-autoconf-macros.patch +++ b/external/gpgmepp/fix-autoconf-macros.patch diff --git a/external/gpgme/w32-build-fixes.patch.1 b/external/gpgmepp/w32-build-fixes.patch.1 index cd45b45a31d9..9bc8f52b4c64 100755..100644 --- a/external/gpgme/w32-build-fixes.patch.1 +++ b/external/gpgmepp/w32-build-fixes.patch.1 @@ -120,3 +120,14 @@ diff -ru gpgme.orig/src/vfs-mount.c gpgme/src/vfs-mount.c { if (opd->result.mount_dir) free (opd->result.mount_dir); +diff -ur gpgmepp.org/src/w32-glib-io.c gpgmepp/src/w32-glib-io.c +--- gpgmepp.org/src/w32-glib-io.c 2016-11-16 13:22:41.000000000 +0100 ++++ gpgmepp/src/w32-glib-io.c 2017-11-20 06:40:44.793945300 +0100 +@@ -37,6 +37,7 @@ + #ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif ++#include <winsock2.h> + #include <glib.h> + #include <windows.h> + #include <io.h> diff --git a/external/gpgmepp/w32-disable-docs.patch.1 b/external/gpgmepp/w32-disable-docs.patch.1 new file mode 100644 index 000000000000..603122131ea3 --- /dev/null +++ b/external/gpgmepp/w32-disable-docs.patch.1 @@ -0,0 +1,15 @@ +Disable doc building the hard way - should rather be a config option +like libgpg-error's --disable-doc + +diff -ur gpgmepp.org/Makefile.am gpgmepp/Makefile.am +--- gpgmepp.org/Makefile.am 2016-11-16 13:20:18.000000000 +0100 ++++ gpgmepp/Makefile.am 2017-11-20 15:34:49.086731000 +0100 +@@ -33,7 +33,7 @@ + tests = + endif + +-SUBDIRS = src ${tests} doc lang ++SUBDIRS = src ${tests} lang + + # Fix the version of the spec file and create a file named VERSION + # to be used for patch's Prereq: feature. diff --git a/external/gpgmepp/w32-fix-libtool.patch.1 b/external/gpgmepp/w32-fix-libtool.patch.1 new file mode 100644 index 000000000000..9a7adf713694 --- /dev/null +++ b/external/gpgmepp/w32-fix-libtool.patch.1 @@ -0,0 +1,38 @@ +Gross hack to make libtool work with gcc-wrapper - frontended +link.exe on Windows. Make libtool ignore all libs & simply pass +them on as-is to the linker + +A proper fix would be to make gcc-wrapper behave like gcc during +linking, by accepting cygwin path names, and correctly expanding +-l<short_lib_name> to lib<short_lib_name>.lib + +diff -ur gpgmepp.org/m4/libtool.m4 gpgmepp/m4/libtool.m4 +--- gpgmepp.org/m4/libtool.m4 2016-11-16 13:20:16.000000000 +0100 ++++ gpgmepp/m4/libtool.m4 2017-11-21 22:00:05.006587800 +0100 +@@ -3209,24 +3209,11 @@ + ;; + + cygwin*) +- # func_win32_libid is a shell function defined in ltmain.sh +- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' +- lt_cv_file_magic_cmd='func_win32_libid' ++ lt_cv_deplibs_check_method=pass_all + ;; + + mingw* | pw32*) +- # Base MSYS/MinGW do not provide the 'file' command needed by +- # func_win32_libid shell function, so use a weaker test based on 'objdump', +- # unless we find 'file', for example because we are cross-compiling. +- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. +- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then +- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' +- lt_cv_file_magic_cmd='func_win32_libid' +- else +- # Keep this pattern in sync with the one in func_win32_libid. +- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' +- lt_cv_file_magic_cmd='$OBJDUMP -f' +- fi ++ lt_cv_deplibs_check_method=pass_all + ;; + + cegcc*) diff --git a/external/gpgmepp/w32-fix-win32-macro.patch.1 b/external/gpgmepp/w32-fix-win32-macro.patch.1 new file mode 100644 index 000000000000..70a8b5ffe6e8 --- /dev/null +++ b/external/gpgmepp/w32-fix-win32-macro.patch.1 @@ -0,0 +1,175 @@ +diff -ur gpgmepp.org/lang/cpp/src/callbacks.cpp gpgmepp/lang/cpp/src/callbacks.cpp +--- gpgmepp.org/lang/cpp/src/callbacks.cpp 2016-10-18 19:22:02.000000000 +0200 ++++ gpgmepp/lang/cpp/src/callbacks.cpp 2017-11-20 18:03:04.290060900 +0100 +@@ -38,7 +38,9 @@ + #include <cassert> + #include <cerrno> + #include <cstring> ++#if HAVE_UNISTD_H + #include <unistd.h> ++#endif + #include <stdlib.h> + + static inline gpgme_error_t make_err_from_syserror() +diff -ur gpgmepp.org/lang/cpp/src/data.h gpgmepp/lang/cpp/src/data.h +--- gpgmepp.org/lang/cpp/src/data.h 2017-03-24 15:20:32.000000000 +0100 ++++ gpgmepp/lang/cpp/src/data.h 2017-11-20 17:23:24.802711200 +0100 +@@ -31,6 +31,11 @@ + #include <algorithm> + #include <memory> + ++#ifdef _MSC_VER ++# include <BaseTsd.h> ++typedef SSIZE_T ssize_t; ++#endif ++ + namespace GpgME + { + +diff -ur gpgmepp.org/lang/cpp/src/editinteractor.cpp gpgmepp/lang/cpp/src/editinteractor.cpp +--- gpgmepp.org/lang/cpp/src/editinteractor.cpp 2017-03-09 09:01:10.000000000 +0100 ++++ gpgmepp/lang/cpp/src/editinteractor.cpp 2017-11-20 18:09:33.022674700 +0100 +@@ -30,9 +30,11 @@ + + #include <gpgme.h> + +-#ifdef _WIN32 ++#ifdef _MSC_VER + # include <io.h> +-#include <windows.h> ++# include <windows.h> ++# include <BaseTsd.h> ++ typedef SSIZE_T ssize_t; + #else + # include <unistd.h> + #endif +diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_export.h +--- gpgmepp.org/lang/cpp/src/gpgmepp_export.h 2016-08-04 15:03:09.000000000 +0200 ++++ gpgmepp/lang/cpp/src/gpgmepp_export.h 2017-11-20 16:57:47.805691100 +0100 +@@ -29,14 +29,14 @@ + # ifndef GPGMEPP_EXPORT + # ifdef BUILDING_GPGMEPP + /* We are building this library */ +-# ifdef WIN32 ++# ifdef _MSC_VER + # define GPGMEPP_EXPORT __declspec(dllexport) + # else + # define GPGMEPP_EXPORT __attribute__((visibility("default"))) + # endif + # else + /* We are using this library */ +-# ifdef WIN32 ++# ifdef _MSC_VER + # define GPGMEPP_EXPORT __declspec(dllimport) + # else + # define GPGMEPP_EXPORT __attribute__((visibility("default"))) +@@ -45,7 +45,7 @@ + # endif + + # ifndef GPGMEPP_NO_EXPORT +-# ifdef WIN32 ++# ifdef _MSC_VER + # define GPGMEPP_NO_EXPORT + # else + # define GPGMEPP_NO_EXPORT __attribute__((visibility("hidden"))) +@@ -54,7 +54,11 @@ + #endif + + #ifndef GPGMEPP_DEPRECATED +-# define GPGMEPP_DEPRECATED __attribute__ ((__deprecated__)) ++# ifdef _MSC_VER ++# define GPGMEPP_DEPRECATED __declspec(deprecated("deprecated")) ++# else ++# define GPGMEPP_DEPRECATED __attribute__ ((__deprecated__)) ++# endif + #endif + + #ifndef GPGMEPP_DEPRECATED_EXPORT +diff -ur gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h gpgmepp/lang/cpp/src/interfaces/dataprovider.h +--- gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h 2016-05-17 14:32:37.000000000 +0200 ++++ gpgmepp/lang/cpp/src/interfaces/dataprovider.h 2017-11-20 18:03:11.332715700 +0100 +@@ -29,6 +29,11 @@ + + #include <gpg-error.h> + ++#ifdef _MSC_VER ++# include <BaseTsd.h> ++typedef SSIZE_T ssize_t; ++#endif ++ + namespace GpgME + { + +diff -ur gpgmepp.org/lang/cpp/src/key.cpp gpgmepp/lang/cpp/src/key.cpp +--- gpgmepp.org/lang/cpp/src/key.cpp 2017-03-20 20:10:15.000000000 +0100 ++++ gpgmepp/lang/cpp/src/key.cpp 2017-11-20 17:44:50.321858800 +0100 +@@ -33,10 +33,16 @@ + #include <gpgme.h> + + #include <string.h> ++#if HAVE_STRINGS_H + #include <strings.h> ++#endif + #include <istream> + #include <iterator> + ++#ifdef _MSC_VER ++# define strcasecmp _stricmp ++#endif ++ + const GpgME::Key::Null GpgME::Key::null; + + namespace GpgME +diff -ur gpgmepp.org/lang/cpp/src/key.h gpgmepp/lang/cpp/src/key.h +--- gpgmepp.org/lang/cpp/src/key.h 2017-03-20 20:10:15.000000000 +0100 ++++ gpgmepp/lang/cpp/src/key.h 2017-11-20 17:07:51.551632000 +0100 +@@ -30,7 +30,6 @@ + #include "gpgmefw.h" + + #include <memory> +-#include <sys/time.h> + + #include <vector> + #include <algorithm> +diff -ur gpgmepp.org/lang/qt/src/qgpgme_export.h gpgmepp/lang/qt/src/qgpgme_export.h +--- gpgmepp.org/lang/qt/src/qgpgme_export.h 2016-11-03 17:32:30.000000000 +0100 ++++ gpgmepp/lang/qt/src/qgpgme_export.h 2017-11-20 16:58:27.395388000 +0100 +@@ -39,14 +39,14 @@ + # ifndef QGPGME_EXPORT + # ifdef BUILDING_QGPGME + /* We are building this library */ +-# ifdef WIN32 ++# ifdef _WIN32 + # define QGPGME_EXPORT __declspec(dllexport) + # else + # define QGPGME_EXPORT __attribute__((visibility("default"))) + # endif + # else + /* We are using this library */ +-# ifdef WIN32 ++# ifdef _WIN32 + # define QGPGME_EXPORT __declspec(dllimport) + # else + # define QGPGME_EXPORT __attribute__((visibility("default"))) +@@ -55,7 +55,7 @@ + # endif + + # ifndef QGPGME_NO_EXPORT +-# ifdef WIN32 ++# ifdef _WIN32 + # define QGPGME_NO_EXPORT + # else + # define QGPGME_NO_EXPORT __attribute__((visibility("hidden"))) +@@ -64,7 +64,11 @@ + #endif + + #ifndef QGPGME_DEPRECATED +-# define QGPGME_DEPRECATED __attribute__ ((__deprecated__)) ++# ifdef _MSC_VER ++# define QGPGME_DEPRECATED __declspec(deprecated("deprecated")) ++# else ++# define QGPGME_DEPRECATED __attribute__ ((__deprecated__)) ++# endif + #endif + + #ifndef QGPGME_DEPRECATED_EXPORT |