Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame^] | 1 | From 98a9eff357959d1113e33a615c2178751d5b2054 Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Thu, 22 Aug 2019 10:50:21 +0800 |
| 4 | Subject: [PATCH 2/2] configure.ac: add option for libcap |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 5 | |
| 6 | Upstream-Status: Pending |
| 7 | |
| 8 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame^] | 9 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 10 | --- |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame^] | 11 | configure.ac | 36 +++++++++++++++++++++++++++--------- |
| 12 | 1 file changed, 27 insertions(+), 9 deletions(-) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 13 | |
| 14 | diff --git a/configure.ac b/configure.ac |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame^] | 15 | index 65db61e..6486aac 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 16 | --- a/configure.ac |
| 17 | +++ b/configure.ac |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame^] | 18 | @@ -977,6 +977,22 @@ fi |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | dnl Set by FR_SMART_CHECKLIB |
| 20 | LIBS="${old_LIBS}" |
| 21 | |
| 22 | +dnl # |
| 23 | +dnl # extra argument: --with-libcap |
| 24 | +dnl # |
| 25 | +WITH_LIBCAP=yes |
| 26 | +AC_ARG_WITH(libcap, |
| 27 | +[ --with-licap use licap for debugger checks. (default=yes)], |
| 28 | +[ case "$withval" in |
| 29 | + no) |
| 30 | + WITH_LIBCAP=no |
| 31 | + ;; |
| 32 | + *) |
| 33 | + WITH_LIBCAP=yes |
| 34 | + ;; |
| 35 | + esac ] |
| 36 | +) |
| 37 | + |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 38 | dnl Check for cap |
| 39 | dnl extra argument: --with-cap-lib-dir=DIR |
| 40 | cap_lib_dir= |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame^] | 41 | @@ -1010,15 +1026,17 @@ AC_ARG_WITH(cap-include-dir, |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 42 | ;; |
| 43 | esac]) |
| 44 | |
| 45 | -smart_try_dir="$cap_lib_dir" |
| 46 | -FR_SMART_CHECK_LIB(cap, cap_get_proc) |
| 47 | -if test "x$ac_cv_lib_cap_cap_get_proc" != "xyes"; then |
| 48 | - AC_MSG_WARN([cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=<path>.]) |
| 49 | -else |
| 50 | - AC_DEFINE(HAVE_LIBCAP, 1, |
| 51 | - [Define to 1 if you have the `cap' library (-lcap).] |
| 52 | - ) |
| 53 | - HAVE_LIBCAP=1 |
| 54 | +if test "x$WITH_LIBCAP" = xyes; then |
| 55 | + smart_try_dir="$cap_lib_dir" |
| 56 | + FR_SMART_CHECK_LIB(cap, cap_get_proc) |
| 57 | + if test "x$ac_cv_lib_cap_cap_get_proc" != "xyes"; then |
| 58 | + AC_MSG_WARN([cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=<path>.]) |
| 59 | + else |
| 60 | + AC_DEFINE(HAVE_LIBCAP, 1, |
| 61 | + [Define to 1 if you have the `cap' library (-lcap).] |
| 62 | + ) |
| 63 | + HAVE_LIBCAP=1 |
| 64 | + fi |
| 65 | fi |
| 66 | |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame^] | 67 | dnl # |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 68 | -- |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame^] | 69 | 2.7.4 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 70 | |