summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2010-03-04 12:08:26 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2010-03-04 12:08:26 +0000
commitf8f6ec92b13ace440d5037c1e18ea53096895688 (patch)
tree82bb1c60f57465183735592ad2c76fffa1dae440 /configure.in
parent9f0a5c1d269412f9e053df47b01b26acabe08e23 (diff)
downloadlvm2-f8f6ec92b13ace440d5037c1e18ea53096895688.tar.gz
lvm2-f8f6ec92b13ace440d5037c1e18ea53096895688.tar.xz
lvm2-f8f6ec92b13ace440d5037c1e18ea53096895688.zip
This patch add SELINUX_LIBS and STATIC_LIBS variables.
For static builds dependency for SELinux libs is not handled by 'ar'. Till better solution is found, for static builds STATIC_LIBS is used. Patch updates SELinux detection to use 3rd & 4th parameter for Success/Fail. Also removes detection of pthread from this check as we know which version of libdevmapper we are going to link with lvm after merge. SELinux header check moved to the SELinux test code.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in38
1 files changed, 8 insertions, 30 deletions
diff --git a/configure.in b/configure.in
index 42e42356..b985c987 100644
--- a/configure.in
+++ b/configure.in
@@ -824,35 +824,18 @@ AC_MSG_RESULT($SELINUX)
################################################################################
dnl -- Check for selinux
if test x$SELINUX = xyes; then
- AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no)
+ AC_CHECK_LIB([sepol], [sepol_check_context], [
+ AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+ SELINUX_LIBS="-lsepol"])
- if test x$HAVE_SEPOL = xyes; then
- AC_DEFINE([HAVE_SEPOL], 1,
- [Define to 1 if sepol_check_context is available.])
- SELINUX_LIBS="-lsepol $SELINUX_LIBS"
- fi
-
- AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
-
- if test x$HAVE_SELINUX = xyes; then
+ AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+ AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
SELINUX_LIBS="-lselinux $SELINUX_LIBS"
- else
+ HAVE_SELINUX=yes ], [
AC_MSG_WARN(Disabling selinux)
- fi
- LIBS="$SELINUX_LIBS $LIBS"
-
- # With --enable-static_link and selinux enabled, linking
- # fails on at least Debian unstable due to unsatisfied references
- # to pthread_mutex_lock and _unlock. See if we need -lpthread.
- if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
- lvm_saved_libs=$LIBS
- LIBS="$LIBS -static"
- AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
- [test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
- LIB_PTHREAD=-lpthread])
- LIBS=$lvm_saved_libs
- fi
+ SELINUX_LIBS=
+ HAVE_SELINUX=no ])
fi
################################################################################
@@ -997,10 +980,6 @@ if test x$INTL = xyes; then
AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
fi
-if test x$HAVE_SELINUX = xyes; then
- AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out))
-fi
-
if test x$UDEV_SYNC = xyes; then
AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out))
fi
@@ -1109,7 +1088,6 @@ AC_SUBST(GULM_CFLAGS)
AC_SUBST(GULM_LIBS)
AC_SUBST(HAVE_LIBDL)
AC_SUBST(HAVE_REALTIME)
-AC_SUBST(HAVE_SELINUX)
AC_SUBST(INTL)
AC_SUBST(INTL_PACKAGE)
AC_SUBST(JOBS)