diff options
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | configure.ac | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index bb4885d478..84e15e9e52 100644 --- a/Makefile.am +++ b/Makefile.am @@ -503,6 +503,9 @@ libelogind_shared_la_LIBADD = \ $(CAP_LIBS) \ -lm +libelogind_shared_la_LDFLAGS = \ + $(CAP_LDFLAGS) + # ------------------------------------------------------------------------------ if HAVE_ACL noinst_LTLIBRARIES += \ diff --git a/configure.ac b/configure.ac index 54b533004f..16e0343702 100644 --- a/configure.ac +++ b/configure.ac @@ -234,11 +234,18 @@ AC_CHECK_HEADERS([linux/memfd.h], [], []) # unconditionally pull-in librt with old glibc versions AC_SEARCH_LIBS([clock_gettime], [rt], [], []) +AC_ARG_WITH([libcap], + AS_HELP_STRING([--with-libcap=DIR], [Prefix for libcap]), + [CAP_LDFLAGS="-L$with_libcap/lib"], + [CAP_LDFLAGS=""]) save_LIBS="$LIBS" LIBS= +LDFLAGS="$LDFLAGS $CAP_LDFLAGS" AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])]) CAP_LIBS="$LIBS" AC_SUBST(CAP_LIBS) +AC_SUBST(CAP_LDFLAGS) +LDFLAGS="$save_LDFLAGS" AC_CHECK_FUNCS([memfd_create]) AC_CHECK_FUNCS([__secure_getenv secure_getenv]) |