LVM2 ./WHATS_NEW ./configure ./configure.in ./ ...
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2010-03-04 12:08:27
Modified files:
. : WHATS_NEW configure configure.in make.tmpl.in
daemons/dmeventd: Makefile.in
libdm : Makefile.in
tools : Makefile.in
Log message:
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.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1451&r2=1.1452
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.118&r2=1.119
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.128&r2=1.129
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/make.tmpl.in.diff?cvsroot=lvm2&r1=1.80&r2=1.81
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/Makefile.in.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/Makefile.in.diff?cvsroot=lvm2&r1=1.48&r2=1.49
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/Makefile.in.diff?cvsroot=lvm2&r1=1.109&r2=1.110
WHATS_NEW +2 -0
@@ -1,5 +1,7 @@ Version 2.02.62 - ==================================== + Update check for selinux libraries and link them only when needed. + Define and use internal makefile variable SELINUX_LIBS and STATIC_LIBS. Remove -rdynamic from static builds. Update check for pthread library and link it only when needed. Define and use internal makefile variable PTHREAD_LIBS.
configure +129 -240
441 lines not on this page · raw message
configure.in +8 -30
@@ -824,35 +824,18 @@ ################################################################################ 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 @@ 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_LIBS) AC_SUBST(HAVE_LIBDL) AC_SUBST(HAVE_REALTIME) -AC_SUBST(HAVE_SELINUX) AC_SUBST(INTL) AC_SUBST(INTL_PACKAGE) AC_SUBST(JOBS)
make.tmpl.in +3 -0
@@ -30,6 +30,8 @@ CFLOW_CMD = @CFLOW_CMD@ LIBS = @LIBS@ +# Extra libraries always linked with static binaries +STATIC_LIBS = $(SELINUX_LIBS) DEFS += @DEFS@ CFLAGS += @CFLAGS@ CLDFLAGS += @CLDFLAGS@
@@ -39,6 +41,7 @@ LVMINTERNAL_LIBS = -llvm-internal PTHREAD_LIBS = @PTHREAD_LIBS@ READLINE_LIBS = @READLINE_LIBS@ +SELINUX_LIBS = @SELINUX_LIBS@ # Setup directory variables prefix = @prefix@
daemons/dmeventd/Makefile.in +1 -1
@@ -66,7 +66,7 @@ dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a $(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \ - dmeventd.o $(LVMLIBS) $(LIBS) + dmeventd.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS) ifeq ("@PKGCONFIG@", "yes") INSTALL_LIB_TARGETS += install_pkgconfig
libdm/Makefile.in +2 -0
@@ -52,6 +52,8 @@ DEFS += -DDM_DEVICE_UID=@DM_DEVICE_UID@ -DDM_DEVICE_GID=@DM_DEVICE_GID@ \ -DDM_DEVICE_MODE=@DM_DEVICE_MODE@ +LIBS += $(SELINUX_LIBS) + device-mapper: all .PHONY: install_dynamic install_static install_include \
tools/Makefile.in +2 -2
@@ -115,7 +115,7 @@ dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \ - -o $@ dmsetup.o -ldevmapper $(LIBS) + -o $@ dmsetup.o -ldevmapper $(STATIC_LIBS) $(LIBS) all: device-mapper
@@ -125,7 +125,7 @@ lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a $(interfacebuilddir)/libdevmapper.a $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \ - $(OBJECTS) lvm-static.o $(LVMLIBS) $(LIBS) + $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS) liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o cat $(top_builddir)/lib/liblvm-internal.a > $@