| From 9548dc5e1a6c835cd4f387ba384d8f3f14c3fc8b Mon Sep 17 00:00:00 2001 |
| From: Changqing Li <changqing.li@windriver.com> |
| Date: Thu, 22 Aug 2019 10:50:21 +0800 |
| Subject: [PATCH] configure.ac: add option for libcap |
| |
| Upstream-Status: Pending |
| |
| Signed-off-by: Jackie Huang <jackie.huang@windriver.com> |
| Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| --- |
| configure.ac | 36 +++++++++++++++++++++++++++--------- |
| 1 file changed, 27 insertions(+), 9 deletions(-) |
| |
| diff --git a/configure.ac b/configure.ac |
| index ef8fced680..263098f7fd 100644 |
| --- a/configure.ac |
| +++ b/configure.ac |
| @@ -1161,6 +1161,22 @@ fi |
| dnl Set by FR_SMART_CHECKLIB |
| LIBS="${old_LIBS}" |
| |
| +dnl # |
| +dnl # extra argument: --with-libcap |
| +dnl # |
| +WITH_LIBCAP=yes |
| +AC_ARG_WITH(libcap, |
| +[ --with-licap use licap for debugger checks. (default=yes)], |
| +[ case "$withval" in |
| + no) |
| + WITH_LIBCAP=no |
| + ;; |
| + *) |
| + WITH_LIBCAP=yes |
| + ;; |
| + esac ] |
| +) |
| + |
| dnl Check for cap |
| dnl extra argument: --with-cap-lib-dir=DIR |
| cap_lib_dir= |
| @@ -1194,15 +1210,17 @@ AC_ARG_WITH(cap-include-dir, |
| ;; |
| esac]) |
| |
| -smart_try_dir="$cap_lib_dir" |
| -FR_SMART_CHECK_LIB(cap, cap_get_proc) |
| -if test "x$ac_cv_lib_cap_cap_get_proc" != "xyes"; then |
| - AC_MSG_WARN([cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=<path>.]) |
| -else |
| - AC_DEFINE(HAVE_LIBCAP, 1, |
| - [Define to 1 if you have the `cap' library (-lcap).] |
| - ) |
| - HAVE_LIBCAP=1 |
| +if test "x$WITH_LIBCAP" = xyes; then |
| + smart_try_dir="$cap_lib_dir" |
| + FR_SMART_CHECK_LIB(cap, cap_get_proc) |
| + if test "x$ac_cv_lib_cap_cap_get_proc" != "xyes"; then |
| + AC_MSG_WARN([cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=<path>.]) |
| + else |
| + AC_DEFINE(HAVE_LIBCAP, 1, |
| + [Define to 1 if you have the `cap' library (-lcap).] |
| + ) |
| + HAVE_LIBCAP=1 |
| + fi |
| fi |
| |
| dnl # |
| -- |
| 2.25.1 |
| |