[Libreoffice-commits] core.git: config_host/config_features.h.in config_host.mk.in configure.ac desktop/Library_sofficeapp.mk desktop/source distro-configs/LibreOfficeLinux.conf download.lst external/breakpad Makefile.fetch RepositoryExternal.mk vcl/opengl

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Feb 22 18:20:40 UTC 2016


 Makefile.fetch                                |    1 
 RepositoryExternal.mk                         |   37 +++++++++++++++++++++++
 config_host.mk.in                             |    1 
 config_host/config_features.h.in              |    5 +++
 configure.ac                                  |   20 ++++++++++++
 desktop/Library_sofficeapp.mk                 |    4 ++
 desktop/source/app/sofficemain.cxx            |   31 +++++++++++++++++++
 distro-configs/LibreOfficeLinux.conf          |    1 
 download.lst                                  |    2 +
 external/breakpad/ExternalProject_breakpad.mk |   41 ++++++++++++++++++++++++++
 external/breakpad/Makefile                    |   14 ++++++++
 external/breakpad/Module_breakpad.mk          |   17 ++++++++++
 external/breakpad/README                      |    1 
 external/breakpad/UnpackedTarball_breakpad.mk |   14 ++++++++
 vcl/opengl/x11/X11DeviceInfo.cxx              |    2 +
 15 files changed, 191 insertions(+)

New commits:
commit a46ef637d5f37962f826969cb2d7eb4cb9ba81c6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 15 04:39:24 2015 +0100

    include breakpad into the build
    
    Change-Id: I1bfd107502332fc86ae5e96bbc1f475b8d669c6c
    Reviewed-on: https://gerrit.libreoffice.org/22547
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/Makefile.fetch b/Makefile.fetch
index 13138cd..633202e 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -108,6 +108,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
 		$(call fetch_Optional,APR,APR_TARBALL) \
 		$(call fetch_Optional,APR,APR_UTIL_TARBALL) \
 		$(call fetch_Optional,BOOST,BOOST_TARBALL) \
+		$(call fetch_Optional,BREAKPAD,BREAKPAD_TARBALL) \
 		$(call fetch_Optional,BSH,BSH_TARBALL) \
 		$(call fetch_Optional,BZIP2,BZIP2_TARBALL) \
 		$(call fetch_Optional,CAIRO,CAIRO_TARBALL) \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index d0ee166..8ce914d 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3346,6 +3346,43 @@ endif # SYSTEM_NSS
 
 endif # DESKTOP
 
+ifeq ($(ENABLE_BREAKPAD),TRUE)
+
+# ifneq ($(SYSTEM_LIBBREAKPAD),TRUE)
+
+define gb_LinkTarget__use_breakpad
+$(call gb_LinkTarget_set_include,$(1),\
+    -I$(call gb_UnpackedTarball_get_dir,breakpad)/src \
+    $$(INCLUDE) \
+)
+
+ifeq ($(COM),MSC)
+$(call gb_LinkTarget_add_libs,$(1),\
+	$(call gb_UnpackedTarball_get_dir,breakpad)/build/win32/$(wnt_arch_subdir_optional)$(if $(MSVC_USE_DEBUG_RUNTIME),Debug/breakpad.lib,Release/breakpad.lib) \
+)
+else
+$(call gb_LinkTarget_add_libs,$(1),\
+	$(call gb_UnpackedTarball_get_dir,breakpad)/src/client/linux/libbreakpad_client.a \
+)
+endif
+
+$(call gb_LinkTarget_use_external_project,$(1),breakpad)
+
+endef
+
+# else # SYSTEM_LIBBREAKPAD
+# 
+# define gb_LinkTarget__use_libgltf
+# $(call gb_LinkTarget_set_include,$(1),\
+# 	$$(INCLUDE) \
+# 	$(LIBBREAKPAD_CFLAGS) \
+# )
+# $(call gb_LinkTarget_add_libs,$(1),$(LIBBREAKPAD_LIBS))
+#
+# endef
+
+endif # SYSTEN_LIBBREAKPAD
+
 ifeq ($(ENABLE_GLTF),TRUE)
 
 ifneq ($(SYSTEM_LIBGLTF),TRUE)
diff --git a/config_host.mk.in b/config_host.mk.in
index 6170227..8becc9e 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -108,6 +108,7 @@ export DPKG=@DPKG@
 export EBOOK_CFLAGS=$(gb_SPACE)@EBOOK_CFLAGS@
 export EBOOK_LIBS=$(gb_SPACE)@EBOOK_LIBS@
 export ENABLE_AVAHI=@ENABLE_AVAHI@
+export ENABLE_BREAKPAD=@ENABLE_BREAKPAD@
 export ENABLE_CAIRO_CANVAS=@ENABLE_CAIRO_CANVAS@
 export ENABLE_CHART_TESTS=@ENABLE_CHART_TESTS@
 export ENABLE_CMIS=@ENABLE_CMIS@
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index 77fea97..5426bf3 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -146,4 +146,9 @@
  */
 #define HAVE_FEATURE_COLLADA 0
 
+/*
+ * Whether we support breakpad as crash reporting lib.
+ */
+#define HAVE_FEATURE_BREAKPAD 0
+
 #endif
diff --git a/configure.ac b/configure.ac
index aabe558..7825349 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1038,6 +1038,11 @@ AC_ARG_ENABLE(graphite,
         [Disables the compilation of Graphite smart font rendering.])
 )
 
+AC_ARG_ENABLE(breakpad,
+    AS_HELP_STRING([--enable-breakpad],
+        [Enables breakpad for crash reporting.])
+)
+
 AC_ARG_ENABLE(orcus,
     AS_HELP_STRING([--enable-orcus],
         [Enables orcus for extra file import filters for Calc.])
@@ -9079,6 +9084,21 @@ else
 fi
 AC_SUBST(ENABLE_GRAPHITE)
 
+dnl ==================================================================
+dnl Breakpad
+dnl ==================================================================
+AC_MSG_CHECKING([whether to enable breakpad])
+if test "$enable_breakpad" != yes; then
+    AC_MSG_RESULT([no])
+else
+    AC_MSG_RESULT([yes])
+    ENABLE_BREAKPAD="TRUE"
+    AC_DEFINE(ENABLE_BREAKPAD)
+    AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
+    BUILD_TYPE="$BUILD_TYPE BREAKPAD"
+fi
+AC_SUBST(ENABLE_BREAKPAD)
+
 dnl ===================================================================
 dnl Orcus
 dnl ===================================================================
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index d7b6dba..13b8115 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -117,6 +117,10 @@ $(eval $(call gb_Library_add_libs,sofficeapp,\
 endif
 endif
 
+ifeq ($(ENABLE_BREAKPAD),TRUE)
+$(eval $(call gb_Library_use_external,sofficeapp,breakpad))
+endif
+
 # LibreOfficeKit bits
 ifneq ($(filter $(OS),ANDROID IOS MACOSX WNT),)
 $(eval $(call gb_Library_add_exception_objects,sofficeapp,\
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index c94d5f14..b14df2f 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <sal/config.h>
+#include <config_features.h>
 
 #include "desktopdllapi.h"
 
@@ -40,6 +41,14 @@
 #include <cppuhelper/bootstrap.hxx>
 #include <unotools/mediadescriptor.hxx>
 
+#if HAVE_FEATURE_BREAKPAD
+
+#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
+#include <client/linux/handler/exception_handler.h>
+#endif
+
+#endif
+
 
 #ifdef ANDROID
 #  include <jni.h>
@@ -50,8 +59,30 @@
 #  define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOGTAG, __VA_ARGS__))
 #endif
 
+#if HAVE_FEATURE_BREAKPAD
+
+#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
+static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* /*context*/, bool succeeded)
+{
+    // send the minidump to the server (not yet implemented)
+    SAL_WARN("sofficemain", "minidump generated: " << descriptor.path());
+    return succeeded;
+}
+#endif
+
+#endif
+
 extern "C" int DESKTOP_DLLPUBLIC soffice_main()
 {
+#if HAVE_FEATURE_BREAKPAD
+
+#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
+    google_breakpad::MinidumpDescriptor descriptor("/tmp");
+    google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, NULL, true, -1);
+#endif
+
+#endif
+
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
     /* Run test for OpenGL support in own process to avoid crash with broken
      * OpenGL drivers. Start process as early as possible.
diff --git a/distro-configs/LibreOfficeLinux.conf b/distro-configs/LibreOfficeLinux.conf
index d57706c..efa314f 100644
--- a/distro-configs/LibreOfficeLinux.conf
+++ b/distro-configs/LibreOfficeLinux.conf
@@ -34,3 +34,4 @@
 --enable-online-update
 --disable-dconf
 --enable-mergelibs
+--enable-breakpad
diff --git a/download.lst b/download.lst
index 7bf361b..7a9835f 100644
--- a/download.lst
+++ b/download.lst
@@ -8,6 +8,8 @@ export APR_UTIL_MD5SUM := 71a11d037240b292f824ba1eb537b4e3
 export APR_UTIL_TARBALL := apr-util-1.5.3.tar.gz
 export BOOST_MD5SUM := 65a840e1a0b13a558ff19eeb2c4f0cbe
 export BOOST_TARBALL := boost_1_60_0.tar.bz2
+export BREAKPAD_TARBALL := breakpad.zip
+export BREAKPAD_MD5SUM := 415ce291aa6f2ee1d5db7b62bf62ade8
 export BSH_TARBALL := ec1941a74d3ef513c4ce57a9092b74e1-bsh-2.0b5-src.zip
 export BZIP2_TARBALL := 00b516f4704d4a7cb50a1d97e6e8e15b-bzip2-1.0.6.tar.gz
 export CAIRO_TARBALL := f101a9e88b783337b20b2e26dfd26d5f-cairo-1.10.2.tar.gz
diff --git a/external/breakpad/ExternalProject_breakpad.mk b/external/breakpad/ExternalProject_breakpad.mk
new file mode 100644
index 0000000..713276e
--- /dev/null
+++ b/external/breakpad/ExternalProject_breakpad.mk
@@ -0,0 +1,41 @@
+# -*- 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,breakpad))
+
+$(eval $(call gb_ExternalProject_use_autoconf,breakpad,build))
+
+$(eval $(call gb_ExternalProject_register_targets,breakpad,\
+	build \
+))
+
+
+ifeq ($(COM),MSC)
+
+$(call gb_ExternalProject_get_state_target,breakpad,build) :
+	$(call gb_ExternalProject_run,build,\
+		msbuild.exe breakpad.vcxproj /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \
+			/p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+			$(if $(filter 120,$(VCVER)),/p:PlatformToolset=v120 /p:VisualStudioVersion=12.0 /ToolsVersion:12.0) \
+			$(if $(filter 140,$(VCVER)),/p:PlatformToolset=v140 /p:VisualStudioVersion=14.0 /ToolsVersion:14.0) \
+			'/p:AdditionalIncludeDirectories=$(subst $(WHITESPACE),;,$(subst /,\,$(strip $(libgltf_AdditionalIncludes))))' \
+			/p:AdditionalLibraryDirectories=$(if $(SYSTEM_GLEW),,"$(subst /,\,$(call gb_UnpackedTarball_get_dir,glew))\lib\$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)\Win32") \
+	,build/win32)
+
+else # !ifeq($(COM),MSC)
+
+$(call gb_ExternalProject_get_state_target,breakpad,build) :
+	$(call gb_ExternalProject_run,build,\
+		./configure \
+		&& $(MAKE) \
+	)
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/breakpad/Makefile b/external/breakpad/Makefile
new file mode 100644
index 0000000..569ad8a
--- /dev/null
+++ b/external/breakpad/Makefile
@@ -0,0 +1,14 @@
+# -*- 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/.
+#
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/breakpad/Module_breakpad.mk b/external/breakpad/Module_breakpad.mk
new file mode 100644
index 0000000..9750c31
--- /dev/null
+++ b/external/breakpad/Module_breakpad.mk
@@ -0,0 +1,17 @@
+# -*- 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_Module_Module,breakpad))
+
+$(eval $(call gb_Module_add_targets,breakpad,\
+	ExternalProject_breakpad \
+	UnpackedTarball_breakpad \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/breakpad/README b/external/breakpad/README
new file mode 100644
index 0000000..41fbde6
--- /dev/null
+++ b/external/breakpad/README
@@ -0,0 +1 @@
+Render glTF 3D models.
diff --git a/external/breakpad/UnpackedTarball_breakpad.mk b/external/breakpad/UnpackedTarball_breakpad.mk
new file mode 100644
index 0000000..ab09d66
--- /dev/null
+++ b/external/breakpad/UnpackedTarball_breakpad.mk
@@ -0,0 +1,14 @@
+# -*- 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,breakpad))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,breakpad,$(BREAKPAD_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
diff --git a/vcl/opengl/x11/X11DeviceInfo.cxx b/vcl/opengl/x11/X11DeviceInfo.cxx
index 49593c7..4a5a9c3 100644
--- a/vcl/opengl/x11/X11DeviceInfo.cxx
+++ b/vcl/opengl/x11/X11DeviceInfo.cxx
@@ -10,6 +10,8 @@
 #include "opengl/x11/X11DeviceInfo.hxx"
 #include "opengl/x11//glxtest.hxx"
 
+#include <config_features.h>
+
 #include <rtl/ustring.hxx>
 
 #include <unistd.h>


More information about the Libreoffice-commits mailing list