[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 5/7] build: make libunwind-coredump build optio
From: |
Cody P Schafer |
Subject: |
[Libunwind-devel] [PATCH 5/7] build: make libunwind-coredump build optional |
Date: |
Tue, 4 Sep 2012 12:46:39 -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 | 17 +++++++++++++++++
src/Makefile.am | 5 ++++-
tests/Makefile.am | 15 +++++++++++----
3 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/configure.in b/configure.in
index e655322..ca40d6f 100644
--- a/configure.in
+++ b/configure.in
@@ -108,6 +108,22 @@ build_arch=`get_arch $build_cpu`
host_arch=`get_arch $host_cpu`
target_arch=`get_arch $target_cpu`
+no_force_coredump=true
+AC_ARG_ENABLE(coredump,
+ AS_HELP_STRING([--enable-coredump],[build libunwind-coredump
library]),
+ [no_force_coredump=false; use_coredump=true],
+ [no_force_coredump=false; use_coredump=false])
+
+if $no_force_coredump; then
+ case "$host_arch" in
+ x86|x86_64) use_coredump=true ;;
+ *) use_coredump=false;;
+ esac
+fi
+
+AC_MSG_CHECKING([if we should build libunwind-coredump])
+AC_MSG_RESULT([$use_coredump])
+
AC_MSG_CHECKING([for build architecture])
AC_MSG_RESULT([$build_arch])
AC_MSG_CHECKING([for host architecture])
@@ -117,6 +133,7 @@ AC_MSG_RESULT([$target_arch])
AC_MSG_CHECKING([for target operating system])
AC_MSG_RESULT([$target_os])
+AM_CONDITIONAL(BUILD_COREDUMP, test x$use_coredump = xtrue)
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 ab850df..c6ad0b0 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 f4f6f3e..60f4db1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,9 +1,12 @@
AM_CPPFLAGS = -I$(top_srcdir)/include
EXTRA_DIST = run-ia64-test-dyn1 run-ptrace-mapper run-ptrace-misc \
- run-check-namespace run-coredump-unwind \
- run-coredump-unwind-mdi check-namespace.sh.in \
+ run-check-namespace \
+ check-namespace.sh.in \
Gtest-nomalloc.c Gtest-nocalloc.c
+if BUILD_COREDUMP
+ EXTRA_DIST += run-coredump-unwind-mdi run-coredump-unwind
+endif
MAINTAINERCLEANFILES = Makefile.in
@@ -60,13 +63,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:"
@@ -176,7 +181,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
- [Libunwind-devel] [PATCH 0/7] Fixup the PowerPC (64 & 32 bit) builds., Cody P Schafer, 2012/09/04
- [Libunwind-devel] [PATCH 2/7] ppc32: remove unused dmy_vrregset, Cody P Schafer, 2012/09/04
- [Libunwind-devel] [PATCH 3/7] ppc32: add used attribute to dmy_ctxt, Cody P Schafer, 2012/09/04
- [Libunwind-devel] [PATCH 4/7] ppc32: ppc64: test altivec support by running the compiler., Cody P Schafer, 2012/09/04
- [Libunwind-devel] [PATCH 5/7] build: make libunwind-coredump build optional,
Cody P Schafer <=
- [Libunwind-devel] [PATCH 1/7] ppc32: ppc64: use AC_COMPILE_IFELSE to test __powerpc64__ macro for ppc64, Cody P Schafer, 2012/09/04
- [Libunwind-devel] [PATCH 7/7] ppc64: remove compile warnings from wchar test., Cody P Schafer, 2012/09/04
- [Libunwind-devel] [PATCH 6/7] configure: use AC_HELP_STRING for configure args instead of manual formating, Cody P Schafer, 2012/09/04