diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-11-19 14:24:06 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-11-19 16:33:14 +0100 |
commit | f4680be8e39d4e4411c0afd704ebdcb2045dee43 (patch) | |
tree | 1c57cbd8f92241d737402be629b6d6431fadde0f | |
parent | b736204f3ba6ee9813ae109071c9d442c2fb2219 (diff) |
HAVE_FEATURE_CRASHDUMP instead of manual SAL_ENABLE_CRASH_REPORT
Change-Id: Ifaf971d77f11cef207706989bba11dbe2028ca79
-rw-r--r-- | config_host/config_features.h.in | 3 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | sal/Library_sal.mk | 4 | ||||
-rw-r--r-- | sal/osl/unx/signal.c | 23 |
4 files changed, 19 insertions, 12 deletions
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in index 74ce2347c6b1..886542ec461d 100644 --- a/config_host/config_features.h.in +++ b/config_host/config_features.h.in @@ -146,4 +146,7 @@ */ #define HAVE_FEATURE_COLLADA 0 +/* see --enable-crashdump: */ +#define HAVE_FEATURE_CRASHDUMP 0 + #endif diff --git a/configure.ac b/configure.ac index 8ee0ab46e80b..e716ad011533 100644 --- a/configure.ac +++ b/configure.ac @@ -4537,6 +4537,7 @@ if test "$enable_crashdump" = "yes"; then ENABLE_CRASHDUMP="TRUE" BUILD_TYPE="$BUILD_TYPE CRASHREP" AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_FEATURE_CRASHDUMP) else ENABLE_CRASHDUMP="" AC_MSG_RESULT([no]) diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index a5ac8bc57e58..1469f82d9003 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -176,8 +176,8 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/time \ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ )) -$(eval $(call gb_Library_add_cobject,sal,sal/osl/unx/signal, \ - $(if $(ENABLE_CRASHDUMP),-DSAL_ENABLE_CRASH_REPORT) \ +$(eval $(call gb_Library_add_cobjects,sal, \ + sal/osl/unx/signal \ )) # Note that the uunxapi.mm file just includes the uunxapi.cxx one diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c index 6b73d501fdc9..a2bd05aa185b 100644 --- a/sal/osl/unx/signal.c +++ b/sal/osl/unx/signal.c @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <config_features.h> + /* system headers */ #include "system.h" @@ -25,7 +29,7 @@ #if defined( INTEL ) #include "backtrace.h" #define INCLUDE_BACKTRACE -#ifdef SAL_ENABLE_CRASH_REPORT +#if HAVE_FEATURE_CRASHDUMP #define STACKTYPE "MacOsX_X86" #endif #endif /* INTEL */ @@ -36,7 +40,7 @@ #include <execinfo.h> #include <link.h> #define INCLUDE_BACKTRACE -#if defined SAL_ENABLE_CRASH_REPORT +#if HAVE_FEATURE_CRASHDUMP #define STACKTYPE "Linux" #endif #endif @@ -46,7 +50,7 @@ #include "backtrace.h" #define INCLUDE_BACKTRACE -#if defined SAL_ENABLE_CRASH_REPORT +#if HAVE_FEATURE_CRASHDUMP #if defined( SPARC ) #define STACKTYPE "Solaris_Sparc" #elif defined( INTEL ) @@ -77,7 +81,7 @@ #define ACT_EXIT 2 #define ACT_SYSTEM 3 #define ACT_HIDE 4 -#ifdef SAL_ENABLE_CRASH_REPORT +#if HAVE_FEATURE_CRASHDUMP # define ACT_ABORT 5 #else # define ACT_ABORT ACT_SYSTEM @@ -310,7 +314,7 @@ static sal_Bool DeInitSignal(void) return sal_False; } -#if defined (SAL_ENABLE_CRASH_REPORT) && defined(INCLUDE_BACKTRACE) +#if HAVE_FEATURE_CRASHDUMP && defined(INCLUDE_BACKTRACE) static sal_uInt32 calc_md5_checksum( const char *filename, sal_uInt8 *pChecksum, sal_uInt32 nChecksumLen ) { @@ -389,8 +393,7 @@ static int fputs_xml( const char *string, FILE *stream ) /* Create intermediate files and run crash reporter */ -#if defined SAL_ENABLE_CRASH_REPORT && defined INCLUDE_BACKTRACE && \ - defined LINUX +#if HAVE_FEATURE_CRASHDUMP && defined INCLUDE_BACKTRACE && defined LINUX typedef struct { @@ -473,7 +476,7 @@ dynamic_section_offset(const char *name) static int ReportCrash( int Signal ) { -#ifdef SAL_ENABLE_CRASH_REPORT +#if HAVE_FEATURE_CRASHDUMP #define REPORTENV_PARAM "-crashreportenv:" @@ -794,12 +797,12 @@ static int ReportCrash( int Signal ) } return 1; -#else /* defined SAL_ENABLE_CRASH_REPORT */ +#else /* HAVE_FEATURE_CRASHDUMP */ /* the utility crash_report is not build, so do the same as when the option -nocrashreport is used */ (void) Signal; // avoid warnings return -1; -#endif /* defined SAL_ENABLE_CRASH_REPORT */ +#endif /* HAVE_FEATURE_CRASHDUMP */ } static void PrintStack( int sig ) |