From 98a9eff357959d1113e33a615c2178751d5b2054 Mon Sep 17 00:00:00 2001 From: Changqing Li Date: Thu, 22 Aug 2019 10:50:21 +0800 Subject: [PATCH 2/2] configure.ac: add option for libcap Upstream-Status: Pending Signed-off-by: Jackie Huang Signed-off-by: Changqing Li --- configure.ac | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 65db61e..6486aac 100644 --- a/configure.ac +++ b/configure.ac @@ -977,6 +977,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= @@ -1010,15 +1026,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=.]) -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=.]) + else + AC_DEFINE(HAVE_LIBCAP, 1, + [Define to 1 if you have the `cap' library (-lcap).] + ) + HAVE_LIBCAP=1 + fi fi dnl # -- 2.7.4