Rework check for selinux.

This commit is contained in:
Ralf Corsépius 2007-08-13 09:35:48 +02:00
parent 9eded681b8
commit 94f8f21a94
1 changed files with 25 additions and 7 deletions

View File

@ -831,16 +831,34 @@ yes)
esac esac
WITH_SELINUX_LIB= WITH_SELINUX_LIB=
with_selinuxval=no AC_ARG_WITH(selinux, [ --with-selinux build with selinux support ],,[with_selinux=auto])
case "$host" in
*-*-linux*) with_selinuxval=yes ;; case "$with_selinux" in
yes)
AC_CHECK_HEADER([selinux/selinux.h],[
AC_CHECK_LIB(selinux,[is_selinux_enabled],[with_selinux=yes],[
AC_MSG_ERROR([--with-selinux given, but libselinux not found])])
],[
AC_MSG_ERROR([--with-selinux given, but selinux/selinux.h not found])
])
;;
auto)
AC_CHECK_HEADER([selinux/selinux.h],[
AC_CHECK_LIB(selinux,[is_selinux_enabled],[with_selinux=yes],[
[with_selinux=no])
])
],[
[with_selinux=no])
])
;;
*) with_selinux=no
;;
esac esac
withval=${with_selinuxval}
AC_ARG_WITH(selinux, [ --with-selinux build with selinux support ]) AS_IF([test "$with_selinux" = yes],[
if test $withval != no ; then
AC_DEFINE(WITH_SELINUX, 1, [Build with selinux support?]) AC_DEFINE(WITH_SELINUX, 1, [Build with selinux support?])
WITH_SELINUX_LIB="-lselinux" WITH_SELINUX_LIB="-lselinux"
fi ])
AC_SUBST(WITH_SELINUX_LIB) AC_SUBST(WITH_SELINUX_LIB)
WITH_LUA_LIB= WITH_LUA_LIB=