From db724a449b8a6325e81d04e835f7e24a35f9e78b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 4 Mar 2010 12:12:34 +0000 Subject: [PATCH] Use UDEV_LIBS, and link -ludev only when needed. --- WHATS_NEW | 1 + configure | 5 ++++- configure.in | 4 +++- libdm/Makefile.in | 2 +- make.tmpl.in | 3 ++- tools/Makefile.in | 2 ++ 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 1173c4bd3..8cabe24ca 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.62 - ==================================== + Define and use internal makefile variable UDEV_LIBS. Define and use internal makefile variable DL_LIBS. Update check for selinux libraries and link them only when needed. Define and use internal makefile variable SELINUX_LIBS and STATIC_LIBS. diff --git a/configure b/configure index e91d9d091..2d8d96957 100755 --- a/configure +++ b/configure @@ -648,6 +648,7 @@ kerneldir interface UDEV_SYNC UDEV_RULES +UDEV_LIBS STATIC_LINK STATICDIR SNAPSHOTS @@ -12307,8 +12308,9 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE 1 _ACEOF - LIBS="-ludev $LIBS" + UDEV_LIBS="-ludev" else + UDEV_LIBS= { $as_echo "$as_me:$LINENO: WARNING: It won't be possible to get udev state. We will assume that udev is not running." >&5 $as_echo "$as_me: WARNING: It won't be possible to get udev state. We will assume that udev is not running." >&2;} fi @@ -15559,6 +15561,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'` + ################################################################################ diff --git a/configure.in b/configure.in index f6324202b..3473d9539 100644 --- a/configure.in +++ b/configure.in @@ -668,8 +668,9 @@ if test x$UDEV_SYNC = xyes; then if test x$HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE = xyes; then AC_DEFINE([HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE], 1, [Define to 1 if libudev's udev_queue_get_udev_is_active function is available.]) - LIBS="-ludev $LIBS" + UDEV_LIBS="-ludev" else + UDEV_LIBS= AC_MSG_WARN(It won't be possible to get udev state. We will assume that udev is not running.) fi fi @@ -1120,6 +1121,7 @@ AC_SUBST(SELINUX_LIBS) AC_SUBST(SNAPSHOTS) AC_SUBST(STATICDIR) AC_SUBST(STATIC_LINK) +AC_SUBST(UDEV_LIBS) AC_SUBST(UDEV_RULES) AC_SUBST(UDEV_SYNC) AC_SUBST(interface) diff --git a/libdm/Makefile.in b/libdm/Makefile.in index 7ea06047d..85e19ea74 100644 --- a/libdm/Makefile.in +++ b/libdm/Makefile.in @@ -52,7 +52,7 @@ include $(top_builddir)/make.tmpl DEFS += -DDM_DEVICE_UID=@DM_DEVICE_UID@ -DDM_DEVICE_GID=@DM_DEVICE_GID@ \ -DDM_DEVICE_MODE=@DM_DEVICE_MODE@ -LIBS += $(SELINUX_LIBS) +LIBS += $(SELINUX_LIBS) $(UDEV_LIBS) device-mapper: all diff --git a/make.tmpl.in b/make.tmpl.in index 48f145d4f..ff4d1b21f 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -31,7 +31,7 @@ CFLOW_CMD = @CFLOW_CMD@ LIBS = @LIBS@ # Extra libraries always linked with static binaries -STATIC_LIBS = $(SELINUX_LIBS) +STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) DEFS += @DEFS@ CFLAGS += @CFLAGS@ CLDFLAGS += @CLDFLAGS@ @@ -43,6 +43,7 @@ DL_LIBS = @DL_LIBS@ PTHREAD_LIBS = @PTHREAD_LIBS@ READLINE_LIBS = @READLINE_LIBS@ SELINUX_LIBS = @SELINUX_LIBS@ +UDEV_LIBS = @UDEV_LIBS@ # Setup directory variables prefix = @prefix@ diff --git a/tools/Makefile.in b/tools/Makefile.in index c7cd1d516..510632770 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -107,6 +107,8 @@ DEFS += -DLVM_SHARED_PATH=\"$(exec_prefix)/sbin/lvm\" include $(top_builddir)/make.tmpl +LIBS += $(UDEV_LIBS) + device-mapper: $(TARGETS_DM) dmsetup: dmsetup.o $(top_builddir)/libdm/libdevmapper.$(LIB_SUFFIX)