[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 10/11] configure: introduce AX_ARG_ENABLE.
From: |
Cody P Schafer |
Subject: |
[Libunwind-devel] [PATCH 10/11] configure: introduce AX_ARG_ENABLE. |
Date: |
Mon, 10 Sep 2012 17:21:42 -0700 |
Allows us to reuse the common convention of AC_ARG_ENABLE(arg, text,
[enable_arg=$enablearg], [custom-if-not-found]).
---
configure.in | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/configure.in b/configure.in
index 66a6323..1405dfc 100644
--- a/configure.in
+++ b/configure.in
@@ -86,6 +86,12 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#endif
]])], [ppc_bits=64], [ppc_bits=32])
+
+# AX_ARG_ENABLE(argument, help-text, if-not-present)
+AC_DEFUN([AX_ARG_ENABLE],
+ [AC_ARG_ENABLE([$1], [$2],[enable_$1=$enablearg],[$3])])
+
+
AC_DEFUN([SET_ARCH],[
AS_CASE([$1],
[arm*],[$2=arm],
@@ -101,9 +107,8 @@ SET_ARCH([$build_cpu],[build_arch])
SET_ARCH([$host_cpu],[host_arch])
SET_ARCH([$target_cpu],[target_arch])
-AC_ARG_ENABLE(coredump,
+AX_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])]
)
@@ -179,9 +184,8 @@ fi
AC_MSG_RESULT([$enable_debug])
AC_MSG_CHECKING([whether to enable C++ exception support])
-AC_ARG_ENABLE(cxx_exceptions,
+AX_ARG_ENABLE(cxx_exceptions,
AS_HELP_STRING([--enable-cxx-exceptions],[use libunwind to handle C++
exceptions]),
-[enable_cxx_exceptions=$enableval],
[
# C++ exception handling doesn't work too well on x86
case $target_arch in
@@ -196,9 +200,8 @@ AM_CONDITIONAL([SUPPORT_CXX_EXCEPTIONS], [test
x$enable_cxx_exceptions = xyes])
AC_MSG_RESULT([$enable_cxx_exceptions])
AC_MSG_CHECKING([whether to load .debug_frame sections])
-AC_ARG_ENABLE(debug_frame,
-AS_HELP_STRING([--enable-debug-frame],[Load the ".debug_frame" section if
available]),
-[enable_debug_frame=$enableval], [
+AX_ARG_ENABLE(debug_frame,
+AS_HELP_STRING([--enable-debug-frame],[Load the ".debug_frame" section if
available]), [
case "${target_arch}" in
(arm) enable_debug_frame=yes;;
(*) enable_debug_frame=no;;
@@ -209,18 +212,18 @@ fi
AC_MSG_RESULT([$enable_debug_frame])
AC_MSG_CHECKING([whether to block signals during mutex ops])
-AC_ARG_ENABLE(block_signals,
+AX_ARG_ENABLE(block_signals,
AS_HELP_STRING([--enable-block-signals],[Block signals before performing mutex
operations]),
-[enable_block_signals=$enableval], [enable_block_signals=yes])
+[enable_block_signals=yes])
if test x$enable_block_signals = xyes; then
AC_DEFINE([CONFIG_BLOCK_SIGNALS], [], [Block signals before mutex
operations])
fi
AC_MSG_RESULT([$enable_block_signals])
AC_MSG_CHECKING([whether to validate memory addresses before use])
-AC_ARG_ENABLE(conservative_checks,
+AX_ARG_ENABLE(conservative_checks,
AS_HELP_STRING([--enable-conservative-checks],[Validate all memory addresses
before use]),
-[enable_conservative_checks=$enableval], [enable_conservative_checks=yes])
+[enable_conservative_checks=yes])
if test x$enable_conservative_checks = xyes; then
AC_DEFINE(CONSERVATIVE_CHECKS, 1,
[Define to 1 if you want every memory access validated])
@@ -236,9 +239,8 @@ fi
AC_MSG_RESULT([$enable_msabi_support])
AC_MSG_CHECKING([whether to support LZMA-compressed symbol tables])
-AC_ARG_ENABLE(minidebuginfo,
-AS_HELP_STRING([--enable-minidebuginfo], [Enables support for LZMA-compressed
symbol tables]),
-[enable_minidebuginfo=$enableval], [enable_minidebuginfo=auto])
+AX_ARG_ENABLE(minidebuginfo,
+AS_HELP_STRING([--enable-minidebuginfo], [Enables support for LZMA-compressed
symbol tables]), [enable_minidebuginfo=auto])
AC_MSG_RESULT([$enable_minidebuginfo])
if test x$enable_minidebuginfo != xno; then
AC_CHECK_LIB([lzma], [lzma_mf_is_supported],
--
1.7.11.3
[Libunwind-devel] [PATCH 09/11] configure: use AC_ARG_ENABLE's defaults when possible, Cody P Schafer, 2012/09/10
[Libunwind-devel] [PATCH 08/11] configure: avoid using a shell function in autoconf, Cody P Schafer, 2012/09/10
[Libunwind-devel] [PATCH 03/11] ppc32: add used attribute to dmy_ctxt, Cody P Schafer, 2012/09/10