diff --git a/configure.ac b/configure.ac index 7d549aac..b68c1c22 100644 --- a/configure.ac +++ b/configure.ac @@ -110,6 +110,14 @@ AC_ARG_ENABLE(coredump, AC_MSG_CHECKING([if we should build libunwind-coredump]) AC_MSG_RESULT([$enable_coredump]) +AC_ARG_ENABLE(ptrace, + AS_HELP_STRING([--enable-ptrace],[building libunwind-ptrace library]),, + [AC_CHECK_HEADER([sys/ptrace.h], [enable_ptrace=yes], [enable_ptrace=no])] +) + +AC_MSG_CHECKING([if we should build libunwind-ptrace]) +AC_MSG_RESULT([$enable_ptrace]) + AC_MSG_CHECKING([for build architecture]) AC_MSG_RESULT([$build_arch]) AC_MSG_CHECKING([for host architecture]) @@ -120,6 +128,7 @@ AC_MSG_CHECKING([for target operating system]) AC_MSG_RESULT([$target_os]) AM_CONDITIONAL(BUILD_COREDUMP, test x$enable_coredump = xyes) +AM_CONDITIONAL(BUILD_PTRACE, test x$enable_ptrace = 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 adfbef36..5bc4b3e0 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-ptrace.la +lib_LTLIBRARIES += libunwind.la +if BUILD_PTRACE +lib_LTLIBRARIES += libunwind-ptrace.la +endif if BUILD_COREDUMP lib_LTLIBRARIES += libunwind-coredump.la endif @@ -22,8 +25,11 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libunwind-generic.pc if !REMOTE_ONLY -pkgconfig_DATA += unwind/libunwind.pc ptrace/libunwind-ptrace.pc \ - setjmp/libunwind-setjmp.pc +pkgconfig_DATA += unwind/libunwind.pc setjmp/libunwind-setjmp.pc +endif + +if BUILD_PTRACE +pkgconfig_DATA += ptrace/libunwind-ptrace.pc endif if BUILD_COREDUMP diff --git a/tests/Makefile.am b/tests/Makefile.am index a7700622..fc5529d9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -36,7 +36,7 @@ if USE_ALTIVEC endif #USE_ALTIVEC endif #ARCH_PPC64 endif #!ARCH_IA64 - check_SCRIPTS_cdep = run-ptrace-mapper run-ptrace-misc + check_SCRIPTS_cdep = check_PROGRAMS_cdep = Gtest-bt Ltest-bt Gtest-exc Ltest-exc \ Gtest-init Ltest-init \ Gtest-concurrent Ltest-concurrent \ @@ -45,12 +45,16 @@ endif #!ARCH_IA64 Gtest-dyn1 Ltest-dyn1 \ Gtest-trace Ltest-trace \ test-async-sig test-flush-cache test-init-remote \ - test-mem test-setjmp test-ptrace Ltest-varargs \ + test-mem test-setjmp Ltest-varargs \ Ltest-nomalloc Ltest-nocalloc Lrs-race - noinst_PROGRAMS_cdep = forker crasher mapper test-ptrace-misc \ - Gperf-simple Lperf-simple + noinst_PROGRAMS_cdep = forker crasher Gperf-simple Lperf-simple \ + Gperf-trace Lperf-trace - noinst_PROGRAMS_cdep += Gperf-trace Lperf-trace +if BUILD_PTRACE + check_SCRIPTS_cdep += run-ptrace-mapper run-ptrace-misc + check_PROGRAMS_cdep += test-ptrace + noinst_PROGRAMS_cdep += mapper test-ptrace-misc +endif if SUPPORT_CXX_EXCEPTIONS check_PROGRAMS_cdep += Ltest-cxx-exceptions