From e179b31bfcb6a49de5fe7df7586a2aade9191e08 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 30 Aug 2013 20:39:21 +0000 Subject: [conf] Add config variable to disable crash related overrides. - We do some nasty things w.r.t. installing or overriding signal handlers in order to improve our crash recovery support or interaction with crash reporting software, and those things are not necessarily appropriate when LLVM is being linked into a client application that has its own ideas about how to do things. This gives those clients a way to disable that handling at build time. - Currently, the code this guards is all Apple specific, but other platforms might have the same concerns so I went for a more generic configure name. Someone who is more familiar with library embedding on Windows can handle choosing which of the Windows/Signals.inc behaviors might make sense to go under this flag. - This also fixes the proper autoconf'ing of ENABLE_BACKTRACES. The code expects it to be undefined when disabled, but the autoconf check was just defining it to 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189694 91177308-0d34-0410-b5e6-96231b3b80d8 --- configure | 57 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 20 deletions(-) (limited to 'configure') diff --git a/configure b/configure index abe5db8..f3a6594 100755 --- a/configure +++ b/configure @@ -709,7 +709,6 @@ ENABLE_PIC ENABLE_SHARED ENABLE_EMBED_STDCXX ENABLE_TIMESTAMPS -ENABLE_BACKTRACES TARGETS_TO_BUILD LLVM_ENUM_TARGETS LLVM_ENUM_ASM_PRINTERS @@ -1443,6 +1442,8 @@ Optional Features: (default is YES) --enable-backtraces Enable embedding backtraces on crash (default is YES) + --enable-crash-overrides + Enable crash handling overrides (default is YES) --enable-targets Build specific host targets: all or target1,target2,... Valid targets are: host, x86, x86_64, sparc, powerpc, arm, aarch64, mips, hexagon, @@ -5632,30 +5633,47 @@ cat >>confdefs.h <<_ACEOF _ACEOF - # Check whether --enable-backtraces was given. if test "${enable_backtraces+set}" = set; then - enableval=$enable_backtraces; + enableval=$enable_backtraces; case "$enableval" in + yes) llvm_cv_enable_backtraces="yes" ;; + no) llvm_cv_enable_backtraces="no" ;; + *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-backtraces. Use \"yes\" or \"no\"" >&5 +echo "$as_me: error: Invalid setting for --enable-backtraces. Use \"yes\" or \"no\"" >&2;} + { (exit 1); exit 1; }; } ;; + esac else - enableval=default + llvm_cv_enable_backtraces="yes" fi -case "$enableval" in - yes) ENABLE_BACKTRACES=1 - ;; - no) ENABLE_BACKTRACES=0 - ;; - default) ENABLE_BACKTRACES=1 - ;; - *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-backtraces. Use \"yes\" or \"no\"" >&5 -echo "$as_me: error: Invalid setting for --enable-backtraces. Use \"yes\" or \"no\"" >&2;} +if test "$llvm_cv_enable_backtraces" = "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_BACKTRACES 1 +_ACEOF + +fi + +# Check whether --enable-crash-overrides was given. +if test "${enable_crash_overrides+set}" = set; then + enableval=$enable_crash_overrides; case "$enableval" in + yes) llvm_cv_enable_crash_overrides="yes" ;; + no) llvm_cv_enable_crash_overrides="no" ;; + *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-crash-overrides. Use \"yes\" or \"no\"" >&5 +echo "$as_me: error: Invalid setting for --enable-crash-overrides. Use \"yes\" or \"no\"" >&2;} { (exit 1); exit 1; }; } ;; -esac + esac +else + llvm_cv_enable_crash_overrides="yes" +fi -cat >>confdefs.h <<_ACEOF -#define ENABLE_BACKTRACES $ENABLE_BACKTRACES +if test "$llvm_cv_enable_crash_overrides" = "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_CRASH_OVERRIDES 1 _ACEOF +fi TARGETS_TO_BUILD="" # Check whether --enable-targets was given. @@ -10568,7 +10586,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <conf$$subs.sed <<_ACEOF -OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim RPATH!$RPATH$ac_delim RDYNAMIC!$RDYNAMIC$ac_delim @@ -23192,7 +23209,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 6; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -- cgit v1.1