Kaydet (Commit) a46ef637 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

include breakpad into the build

Change-Id: I1bfd107502332fc86ae5e96bbc1f475b8d669c6c
Reviewed-on: https://gerrit.libreoffice.org/22547Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst e72cd405
......@@ -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) \
......
......@@ -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)
......
......@@ -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@
......
......@@ -146,4 +146,9 @@
*/
#define HAVE_FEATURE_COLLADA 0
/*
* Whether we support breakpad as crash reporting lib.
*/
#define HAVE_FEATURE_BREAKPAD 0
#endif
......@@ -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 ===================================================================
......
......@@ -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,\
......
......@@ -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.
......
......@@ -34,3 +34,4 @@
--enable-online-update
--disable-dconf
--enable-mergelibs
--enable-breakpad
......@@ -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
......
# -*- 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:
# -*- 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:
# -*- 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:
# -*- 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:
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment