From eccc31e9ad579584ad0bf25681a2e7ad482a665d Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Sun, 12 Jul 2009 21:37:03 +0000 Subject: [PATCH] Add --disable-selinux option and fix static build if selinux is required. git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@64 36d66b0a-2a48-0410-832c-cd162a569da5 --- ChangeLog | 1 + configure.in | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2dd8912..8395021 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2009-07-11 Milan Broz + * Add --disable-selinux option and fix static build if selinux is required. * Reject unsupported --offset and --skip options for luksFormat and update man page. 2009-06-22 Milan Broz diff --git a/configure.in b/configure.in index ad4a122..734aa28 100644 --- a/configure.in +++ b/configure.in @@ -50,7 +50,7 @@ AM_GNU_GETTEXT([external],[need-ngettext]) AM_GNU_GETTEXT_VERSION([0.15]) dnl ========================================================================== - + saved_LIBS="$LIBS" AC_CHECK_LIB(popt, poptConfigFileToString,, AC_MSG_ERROR([You need popt 1.7 or newer to compile.])) @@ -87,16 +87,29 @@ MODULE_HELPER(libgcrypt, AM_CONDITIONAL(BUILD_LIBGCRYPT, test x$build_static = xyes) AM_CONDITIONAL(SHARED_LIBGCRYPT, test x$build_shared = xyes) +AC_ARG_ENABLE(selinux, +[ --disable-selinux disable selinux support [[default=auto]]],[], []) + MODULE_HELPER(libdevmapper, [ --enable-libdevmapper enable dm-crypt backend through libdevmapper [[default=auto]]],auto,[ have_module=yes saved_LIBS="$LIBS" - AC_CHECK_LIB(sepol, sepol_bool_set) - AC_CHECK_LIB(selinux, is_selinux_enabled) + if test "x$enable_selinux" != xno; then + AC_CHECK_LIB(sepol, sepol_bool_set) + AC_CHECK_LIB(selinux, is_selinux_enabled) + # Check if we need -pthread with --enable-static and selinux + if test x$build_static = xyes; then + saved_LIBS2="$LIBS" + LIBS="$LIBS -static" + AC_SEARCH_LIBS([pthread_mutex_lock], [pthread], + [test "$ac_cv_search_pthread_mutex_lock" = "none required" || LIB_PTHREAD=-lpthread]) + LIBS="$saved_LIBS2" + fi + fi AC_CHECK_LIB(devmapper, dm_task_set_name,,unset have_module) AC_CHECK_HEADER(libdevmapper.h,,unset have_module) - LIBDEVMAPPER_LIBS="$LIBS" + LIBDEVMAPPER_LIBS="$LIBS $LIB_PTHREAD" LIBS="$saved_LIBS" AC_SUBST(LIBDEVMAPPER_LIBS) AC_SUBST(LIBDEVMAPPER_CFLAGS) -- 2.7.4