keyutils: handle non-linux platform

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
Noah Watkins 2013-09-21 12:50:28 -07:00
parent 6663a5eee3
commit ef6a56aa26
3 changed files with 9 additions and 5 deletions

View File

@ -168,10 +168,14 @@ if test x"$resolv_libs" != "xok"; then
fi
AC_SUBST([RESOLV_LIBS])
dnl check for libkeyutils on linux
KEYUTILS_LIB=""
AS_IF([test x"$linux" = x"yes"], [
AC_CHECK_LIB([keyutils], [add_key], [KEYUTILS_LIB="-lkeyutils"], [
AC_MSG_FAILURE([libkeyutils not found])])])
AC_SUBST(KEYUTILS_LIB)
AC_CHECK_LIB([m], [pow], [true], AC_MSG_FAILURE([libm not found]))
if test x"$linux" = x"yes"; then
AC_CHECK_LIB([keyutils], [add_key], [true], AC_MSG_FAILURE([libkeyutils not found]))
fi
AC_CHECK_FUNCS([syncfs], AC_DEFINE([HAVE_SYS_SYNCFS], [1], [we have syncfs]), [])
# Find some crypto library for us to use, while letting user to decide which one to use.

View File

@ -116,7 +116,7 @@ AM_CCASFLAGS = -f elf64
#####################
## library definitions and dependencies
EXTRALIBS = -luuid -lm -lkeyutils
EXTRALIBS = -luuid -lm $(KEYUTILS_LIB)
if FREEBSD
EXTRALIBS += -lexecinfo
endif # FREEBSD

View File

@ -112,7 +112,7 @@ noinst_HEADERS += \
LIBCOMMON_DEPS += \
$(LIBMSG) $(LIBAUTH) \
$(LIBCRUSH) $(LIBJSON_SPIRIT) $(LIBLOG) $(LIBARCH) \
-lkeyutils
$(KEYUTILS_LIB)
if LINUX
LIBCOMMON_DEPS += -lrt