libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [PATCH 05/17] build: make libunwind-coredump build opt


From: Cody P Schafer
Subject: [Libunwind-devel] [PATCH 05/17] build: make libunwind-coredump build optional
Date: Fri, 14 Sep 2012 17:11:50 -0700

Disable the building of libunwind-coredump except on x86_64 and x86
(where implimentations exsist).

Allow overriding of this autodetection via --enable-coredump and
--disable-coredump.
---
 configure.in      | 10 ++++++++++
 src/Makefile.am   |  5 ++++-
 tests/Makefile.am |  8 ++++++--
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/configure.in b/configure.in
index c2bf259..e601ecc 100644
--- a/configure.in
+++ b/configure.in
@@ -102,6 +102,15 @@ build_arch=`get_arch $build_cpu`
 host_arch=`get_arch $host_cpu`
 target_arch=`get_arch $target_cpu`
 
+AC_ARG_ENABLE(coredump,
+       AS_HELP_STRING([--enable-coredump],[building libunwind-coredump 
library]),
+       [enable_coredump=$enableval],
+        [AS_CASE([$host_arch], [x86*], [enable_coredump=yes], 
[enable_coredump=no])]
+)
+
+AC_MSG_CHECKING([if we should build libunwind-coredump])
+AC_MSG_RESULT([$enable_coredump])
+
 AC_MSG_CHECKING([for build architecture])
 AC_MSG_RESULT([$build_arch])
 AC_MSG_CHECKING([for host architecture])
@@ -111,6 +120,7 @@ AC_MSG_RESULT([$target_arch])
 AC_MSG_CHECKING([for target operating system])
 AC_MSG_RESULT([$target_os])
 
+AM_CONDITIONAL(BUILD_COREDUMP, test x$enable_coredump = xyes)
 AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$host_arch)
 AM_CONDITIONAL(ARCH_ARM, test x$target_arch = xarm)
 AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64)
diff --git a/src/Makefile.am b/src/Makefile.am
index f5414d0..6860977 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,7 +9,10 @@ COMMON_SO_LDFLAGS =    -XCClinker -nostartfiles
 lib_LIBRARIES =
 lib_LTLIBRARIES =
 if !REMOTE_ONLY
-lib_LTLIBRARIES += libunwind.la libunwind-coredump.la libunwind-ptrace.la
+lib_LTLIBRARIES += libunwind.la libunwind-ptrace.la
+if BUILD_COREDUMP
+lib_LTLIBRARIES += libunwind-coredump.la
+endif
 endif
 
 noinst_HEADERS =
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c96d8a5..9902d55 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -60,13 +60,15 @@ if SUPPORT_CXX_EXCEPTIONS
 endif
 
 if OS_LINUX
+if BUILD_COREDUMP
  check_SCRIPTS_cdep += run-coredump-unwind
  noinst_PROGRAMS_cdep += test-coredump-unwind
 
 if HAVE_LZMA
  check_SCRIPTS_cdep += run-coredump-unwind-mdi
-endif
-endif
+endif # HAVE_LZMA
+endif # BUILD_COREDUMP
+endif # OS_LINUX
 
 perf: perf-startup Gperf-simple Lperf-simple Lperf-trace
        @echo "########## Basic performance of generic libunwind:"
@@ -177,7 +179,9 @@ Lperf_trace_LDADD = $(LIBUNWIND_local)
 test_setjmp_LDADD = $(LIBUNWIND_setjmp)
 ia64_test_setjmp_LDADD = $(LIBUNWIND_setjmp)
 
+if BUILD_COREDUMP
 test_coredump_unwind_LDADD = $(LIBUNWIND_coredump) $(LIBUNWIND)
+endif
 
 Gia64_test_nat_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
 Gia64_test_stack_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
-- 
1.7.11.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]