summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-07-28 04:02:32 +0200
committerMichael Biebl <biebl@debian.org>2011-07-28 05:01:12 +0200
commit85f19d825e7504676f3a80c78c1d9a7ec35a3b3f (patch)
tree223f1a62c0add48d2a0e312a0edbe62cd1b68581 /configure.ac
parent6c7506dca32f8add56cd03bf263f417305de74a0 (diff)
Link against -lcap only where required
Don't put -lcap into LIBS as otherwise everything will be linked against it, like libsystemd-daemon, where this is not desired.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 82ed85c3f8..a551d23672 100644
--- a/configure.ac
+++ b/configure.ac
@@ -111,8 +111,14 @@ LT_INIT
AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
+
+save_LIBS="$LIBS"
+LIBS=
AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
+CAP_LIBS="$LIBS"
+LIBS="$save_LIBS"
+AC_SUBST(CAP_LIBS)
# This makes sure pkg.m4 is available.
m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])