1 # Copyright (c) 2012, Google Inc. 2 # All rights reserved. 3 # 4 # Redistribution and use in source and binary forms, with or without 5 # modification, are permitted provided that the following conditions are 6 # met: 7 # 8 # * Redistributions of source code must retain the above copyright 9 # notice, this list of conditions and the following disclaimer. 10 # * Redistributions in binary form must reproduce the above 11 # copyright notice, this list of conditions and the following disclaimer 12 # in the documentation and/or other materials provided with the 13 # distribution. 14 # * Neither the name of Google Inc. nor the names of its 15 # contributors may be used to endorse or promote products derived from 16 # this software without specific prior written permission. 17 # 18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 30 # ndk-build module definition for the Google Breakpad client library 31 # 32 # To use this file, do the following: 33 # 34 # 1/ Include this file from your own Android.mk, either directly 35 # or with through the NDK's import-module function. 36 # 37 # 2/ Use the client static library in your project with: 38 # 39 # LOCAL_STATIC_LIBRARIES += breakpad_client 40 # 41 # 3/ In your source code, include "src/client/linux/exception_handler.h" 42 # and use the Linux instructions to use it. 43 # 44 # This module works with either the STLport or GNU libstdc++, but you need 45 # to select one in your Application.mk 46 # 47 48 # The top Google Breakpad directory. 49 # We assume this Android.mk to be under 'android/google_breakpad' 50 51 LOCAL_PATH := $(call my-dir)/../.. 52 53 # Defube the client library module, as a simple static library that 54 # exports the right include path / linker flags to its users. 55 56 include $(CLEAR_VARS) 57 58 LOCAL_MODULE := breakpad_client 59 60 LOCAL_CPP_EXTENSION := .cc 61 62 # Breakpad uses inline ARM assembly that requires the library 63 # to be built in ARM mode. Otherwise, the build will fail with 64 # cryptic assembler messages like: 65 # Compile++ thumb : google_breakpad_client <= crash_generation_client.cc 66 # /tmp/cc8aMSoD.s: Assembler messages: 67 # /tmp/cc8aMSoD.s:132: Error: invalid immediate: 288 is out of range 68 # /tmp/cc8aMSoD.s:244: Error: invalid immediate: 296 is out of range 69 LOCAL_ARM_MODE := arm 70 71 # List of client source files, directly taken from Makefile.am 72 LOCAL_SRC_FILES := \ 73 src/client/linux/crash_generation/crash_generation_client.cc \ 74 src/client/linux/handler/exception_handler.cc \ 75 src/client/linux/handler/minidump_descriptor.cc \ 76 src/client/linux/log/log.cc \ 77 src/client/linux/minidump_writer/linux_dumper.cc \ 78 src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ 79 src/client/linux/minidump_writer/minidump_writer.cc \ 80 src/client/minidump_file_writer.cc \ 81 src/common/android/breakpad_getcontext.S \ 82 src/common/convert_UTF.c \ 83 src/common/md5.cc \ 84 src/common/string_conversion.cc \ 85 src/common/linux/elfutils.cc \ 86 src/common/linux/file_id.cc \ 87 src/common/linux/guid_creator.cc \ 88 src/common/linux/linux_libc_support.cc \ 89 src/common/linux/memory_mapped_file.cc \ 90 src/common/linux/safe_readlink.cc 91 92 LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/common/android/include \ 93 $(LOCAL_PATH)/src 94 95 LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) 96 LOCAL_EXPORT_LDLIBS := -llog 97 98 include $(BUILD_STATIC_LIBRARY) 99 100 # Done.