All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] configure update
@ 2010-03-02 12:07 Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 1/9] Help display --disable-fsadm Zdenek Kabelac
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Zdenek Kabelac @ 2010-03-02 12:07 UTC (permalink / raw)
  To: lvm-devel

This patchset tries to mainly address linking problems.
First few patches are rather cosmetic cleanups.

Interestings patches starts with: Readline linking update.

With this patchset libpthread and libselinux are linked only
to object files which really needs this library.
Tested it on Fedora & Debian distribution.

Zdenek Kabelac (9):
  Help display --disable-fsadm
  Fix autoconf WARNING:
  For Makefile vars use $() instead of ${}
  Move include before  DEFS+=
  Readline linking update
  Pthread linking change
  Remove -rdynamic
  SELinux configure update
  misc/configure.in  modification

 configure.in                                  |   91 +++++++++++--------------
 daemons/clvmd/Makefile.in                     |    4 +-
 daemons/dmeventd/Makefile.in                  |    4 +-
 daemons/dmeventd/plugins/lvm2/Makefile.in     |    4 +-
 daemons/dmeventd/plugins/mirror/Makefile.in   |    6 +-
 daemons/dmeventd/plugins/snapshot/Makefile.in |    6 +-
 lib/misc/configure.h.in                       |    3 -
 libdm/Makefile.in                             |    4 +-
 make.tmpl.in                                  |    1 +
 man/Makefile.in                               |    4 +-
 test/api/Makefile.in                          |    2 +-
 tools/Makefile.in                             |   13 ++--
 12 files changed, 65 insertions(+), 77 deletions(-)



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/9] Help display --disable-fsadm
  2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
@ 2010-03-02 12:07 ` Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 2/9] Fix autoconf WARNING: Zdenek Kabelac
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Zdenek Kabelac @ 2010-03-02 12:07 UTC (permalink / raw)
  To: lvm-devel

As fsadm is installed by default - it's a common practice to rather
print help text in '--disable' form for such case.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 configure.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.in b/configure.in
index aaa21c6..4053f7f 100644
--- a/configure.in
+++ b/configure.in
@@ -737,8 +737,8 @@ AC_ARG_ENABLE(pkgconfig,   [  --enable-pkgconfig      Install pkgconfig support]
 ################################################################################
 dnl -- Enable fsadm
 AC_MSG_CHECKING(whether to install fsadm)
-AC_ARG_ENABLE(fsadm, [  --enable-fsadm          Enable fsadm],
-FSADM=$enableval)
+AC_ARG_ENABLE(fsadm, [AC_HELP_STRING([--disable-fsadm], [Disable fsadm])],
+	FSADM=$enableval)
 AC_MSG_RESULT($FSADM)
 
 ################################################################################
-- 
1.7.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/9] Fix autoconf WARNING:
  2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 1/9] Help display --disable-fsadm Zdenek Kabelac
@ 2010-03-02 12:07 ` Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 3/9] For Makefile vars use $() instead of ${} Zdenek Kabelac
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Zdenek Kabelac @ 2010-03-02 12:07 UTC (permalink / raw)
  To: lvm-devel

Use datarootdir and fix warning during configure process:
config.status: WARNING:  'make.tmpl.in' seems to ignore the
--datarootdir setting

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 make.tmpl.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/make.tmpl.in b/make.tmpl.in
index 1cba3f2..61365ec 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -47,6 +47,7 @@ libdir = $(DESTDIR)@libdir@
 usrlibdir = $(DESTDIR)@usrlibdir@
 sbindir = $(DESTDIR)@sbindir@
 usrsbindir = $(DESTDIR)@usrsbindir@
+datarootdir = $(DESTDIR)@datarootdir@
 infodir = $(DESTDIR)@infodir@
 mandir = $(DESTDIR)@mandir@
 localedir = $(DESTDIR)@LOCALEDIR@
-- 
1.7.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/9] For Makefile vars use $() instead of ${}
  2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 1/9] Help display --disable-fsadm Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 2/9] Fix autoconf WARNING: Zdenek Kabelac
@ 2010-03-02 12:07 ` Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 4/9] Move include before DEFS+= Zdenek Kabelac
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Zdenek Kabelac @ 2010-03-02 12:07 UTC (permalink / raw)
  To: lvm-devel

Both definitions are correct, but we should use one form
consistenly through all Makefiles.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 daemons/dmeventd/plugins/lvm2/Makefile.in     |    2 +-
 daemons/dmeventd/plugins/mirror/Makefile.in   |    4 ++--
 daemons/dmeventd/plugins/snapshot/Makefile.in |    4 ++--
 man/Makefile.in                               |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/daemons/dmeventd/plugins/lvm2/Makefile.in b/daemons/dmeventd/plugins/lvm2/Makefile.in
index 96c60e0..af6807b 100644
--- a/daemons/dmeventd/plugins/lvm2/Makefile.in
+++ b/daemons/dmeventd/plugins/lvm2/Makefile.in
@@ -16,7 +16,7 @@ top_srcdir = @top_srcdir@
 top_builddir = @top_builddir@
 VPATH = @srcdir@
 
-CLDFLAGS += -L${top_builddir}/tools
+CLDFLAGS += -L$(top_builddir)/tools
 
 SOURCES = dmeventd_lvm.c
 
diff --git a/daemons/dmeventd/plugins/mirror/Makefile.in b/daemons/dmeventd/plugins/mirror/Makefile.in
index a6af47f..bdb49d1 100644
--- a/daemons/dmeventd/plugins/mirror/Makefile.in
+++ b/daemons/dmeventd/plugins/mirror/Makefile.in
@@ -17,8 +17,8 @@ top_srcdir = @top_srcdir@
 top_builddir = @top_builddir@
 VPATH = @srcdir@
 
-INCLUDES += -I${top_srcdir}/tools -I$(top_srcdir)/daemons/dmeventd/plugins/lvm2
-CLDFLAGS += -L${top_builddir}/tools -L${top_builddir}/daemons/dmeventd/plugins/lvm2
+INCLUDES += -I$(top_srcdir)/tools -I$(top_srcdir)/daemons/dmeventd/plugins/lvm2
+CLDFLAGS += -L$(top_builddir)/tools -L$(top_builddir)/daemons/dmeventd/plugins/lvm2
 
 SOURCES = dmeventd_mirror.c
 
diff --git a/daemons/dmeventd/plugins/snapshot/Makefile.in b/daemons/dmeventd/plugins/snapshot/Makefile.in
index 133459d..4b203a0 100644
--- a/daemons/dmeventd/plugins/snapshot/Makefile.in
+++ b/daemons/dmeventd/plugins/snapshot/Makefile.in
@@ -17,8 +17,8 @@ top_srcdir = @top_srcdir@
 top_builddir = @top_builddir@
 VPATH = @srcdir@
 
-INCLUDES += -I${top_srcdir}/tools -I$(top_srcdir)/daemons/dmeventd/plugins/lvm2
-CLDFLAGS += -L${top_builddir}/tools -L${top_builddir}/daemons/dmeventd/plugins/lvm2
+INCLUDES += -I$(top_srcdir)/tools -I$(top_srcdir)/daemons/dmeventd/plugins/lvm2
+CLDFLAGS += -L$(top_builddir)/tools -L$(top_builddir)/daemons/dmeventd/plugins/lvm2
 
 SOURCES = dmeventd_snapshot.c
 
diff --git a/man/Makefile.in b/man/Makefile.in
index dfe95e6..b1b8596 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -43,8 +43,8 @@ ifeq ("@BUILD_CMIRRORD@", "yes")
 endif
 
 MAN8DM=dmsetup.8
-MAN5DIR=${mandir}/man5
-MAN8DIR=${mandir}/man8
+MAN5DIR=$(mandir)/man5
+MAN8DIR=$(mandir)/man8
 
 CLEAN_TARGETS=$(MAN5) $(MAN8) $(MAN8CLUSTER) $(FSADMMAN) $(MAN8DM)
 
-- 
1.7.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/9] Move include before DEFS+=
  2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
                   ` (2 preceding siblings ...)
  2010-03-02 12:07 ` [PATCH 3/9] For Makefile vars use $() instead of ${} Zdenek Kabelac
@ 2010-03-02 12:07 ` Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 5/9] Readline linking update Zdenek Kabelac
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Zdenek Kabelac @ 2010-03-02 12:07 UTC (permalink / raw)
  To: lvm-devel

This patch moves inclusion of the make.tmpl before DEFS modification,
so we can have them in the same order on the in compilation line.
(i.e. HAVE_CONFIG_H goes first)

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 libdm/Makefile.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libdm/Makefile.in b/libdm/Makefile.in
index 6dd25ff..1884b21 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -47,11 +47,11 @@ endif
 VERSIONED_SHLIB = libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION_DM)
 LIB_VERSION = $(LIB_VERSION_DM)
 
+include ../make.tmpl
+
 DEFS += -DDM_DEVICE_UID=@DM_DEVICE_UID@ -DDM_DEVICE_GID=@DM_DEVICE_GID@ \
 	-DDM_DEVICE_MODE=@DM_DEVICE_MODE@
 
-include ../make.tmpl
-
 device-mapper: all
 
 .PHONY: install_dynamic install_static install_include \
-- 
1.7.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/9] Readline linking update
  2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
                   ` (3 preceding siblings ...)
  2010-03-02 12:07 ` [PATCH 4/9] Move include before DEFS+= Zdenek Kabelac
@ 2010-03-02 12:07 ` Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 6/9] Pthread linking change Zdenek Kabelac
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Zdenek Kabelac @ 2010-03-02 12:07 UTC (permalink / raw)
  To: lvm-devel

Modify linking of readline library. Create new  substituted varible
READLINE_LIBS - readline library is linked ONLY with tools that really use
it - i.e. lvm. (Static lvm does not use readlin).
Previous behaviour put this library into the variable LIBS and thus
linked it with all created object files of lvm project (i.e. plugins...).

READLINE detection is simplified.
AC_SEARCH_LIBS needs to save/restore LIBS

Extra checking for termcap should not be really needed as the readline
library should have the proper dependencies compiled into the library.
Do we have some cases where we have to figure and link this termcap
library explicitly?

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 configure.in      |   39 +++++++++++++++++++++------------------
 tools/Makefile.in |    2 +-
 2 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/configure.in b/configure.in
index 4053f7f..a9850a2 100644
--- a/configure.in
+++ b/configure.in
@@ -790,19 +790,21 @@ fi;
 ################################################################################
 dnl -- Check for termcap (Shamelessly copied from parted 1.4.17)
 if test x$READLINE != xno; then
+	lvm_saved_libs=$LIBS
 	AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
-	  [tg_found=yes], [tg_found=no])
-	test x$READLINE:$tg_found = xyes:no &&
-	  AC_MSG_ERROR(
-termcap could not be found which is required for the
+		READLINE_LIBS=$ac_cv_search_tgetent, [
+		if test "$READLINE" = yes; then
+			AC_MSG_ERROR(
+[termcap could not be found which is required for the
 --enable-readline option (which is enabled by default).  Either disable readline
 support with --disable-readline or download and install termcap from:
 	ftp.gnu.org/gnu/termcap
 Note: if you are using precompiled packages you will also need the development
   package as well (which may be called termcap-devel or something similar).
 Note: (n)curses also seems to work as a substitute for termcap.  This was
-  not found either - but you could try installing that as well.
-)
+  not found either - but you could try installing that as well.])
+		fi])
+	LIBS=$lvm_saved_libs
 fi
 
 ################################################################################
@@ -887,22 +889,22 @@ AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getop
 ################################################################################
 dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
 if test x$READLINE != xno; then
-	rl_found=yes
-	AC_CHECK_LIB([readline], [readline], , [rl_found=no])
-	test x$READLINE:$rl_found = xyes:no &&
-	  AC_MSG_ERROR(
-GNU Readline could not be found which is required for the
+	AC_CHECK_LIB([readline], [readline], [
+		READLINE_LIBS="-lreadline $READLINE_LIBS"
+		lvm_save_LIBS=$LIBS
+		LIBS="$READLINE_LIBS $LIBS"
+		AC_CHECK_FUNCS([rl_completion_matches])
+		LIBS=$lvm_save_LIBS
+		AC_DEFINE([READLINE_SUPPORT], 1, [Define to 1 to include the LVM readline shell.])],[
+		if test "$READLINE" = yes; then
+			AC_MSG_ERROR(
+[GNU Readline could not be found which is required for the
 --enable-readline option (which is enabled by default).  Either disable readline
 support with --disable-readline or download and install readline from:
 	ftp.gnu.org/gnu/readline
 Note: if you are using precompiled packages you will also need the development
-package as well (which may be called readline-devel or something similar).
-)
-	if test $rl_found = yes; then
-		AC_CHECK_FUNCS([rl_completion_matches])
-		AC_DEFINE([READLINE_SUPPORT], 1,
-		  [Define to 1 to include the LVM readline shell.])
-	fi
+package as well (which may be called readline-devel or something similar).])
+                fi])
 fi
 
 ################################################################################
@@ -1123,6 +1125,7 @@ AC_SUBST(PKGCONFIG)
 AC_SUBST(POOL)
 AC_SUBST(QUORUM_CFLAGS)
 AC_SUBST(QUORUM_LIBS)
+AC_SUBST(READLINE_LIBS)
 AC_SUBST(SACKPT_CFLAGS)
 AC_SUBST(SACKPT_LIBS)
 AC_SUBST(SALCK_CFLAGS)
diff --git a/tools/Makefile.in b/tools/Makefile.in
index b650c67..07fd4a6 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -123,7 +123,7 @@ all: device-mapper
 
 lvm: $(OBJECTS) lvm.o $(top_builddir)/lib/liblvm-internal.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) lvm.o \
-		$(LVMLIBS) $(LIBS) $(LIB_PTHREAD) -rdynamic
+		$(LVMLIBS) @READLINE_LIBS@ $(LIBS) $(LIB_PTHREAD) -rdynamic
 
 lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a  $(interfacebuilddir)/libdevmapper.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
-- 
1.7.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/9] Pthread linking change
  2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
                   ` (4 preceding siblings ...)
  2010-03-02 12:07 ` [PATCH 5/9] Readline linking update Zdenek Kabelac
@ 2010-03-02 12:07 ` Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 7/9] Remove -rdynamic Zdenek Kabelac
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Zdenek Kabelac @ 2010-03-02 12:07 UTC (permalink / raw)
  To: lvm-devel

Create new substituted variable PTHREAD_LIBS and link this library
only with tools/libs which really needs it - i.e. dmeventd.

Check for libpthread only for builds with clvmd or dmeventd.

Remove variable LIB_PTHREAD

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 configure.in                                  |    9 ++++++++-
 daemons/clvmd/Makefile.in                     |    4 +++-
 daemons/dmeventd/Makefile.in                  |    2 +-
 daemons/dmeventd/plugins/lvm2/Makefile.in     |    2 +-
 daemons/dmeventd/plugins/mirror/Makefile.in   |    2 +-
 daemons/dmeventd/plugins/snapshot/Makefile.in |    2 +-
 test/api/Makefile.in                          |    2 +-
 tools/Makefile.in                             |   12 +++++-------
 8 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/configure.in b/configure.in
index a9850a2..64ef0b6 100644
--- a/configure.in
+++ b/configure.in
@@ -829,6 +829,12 @@ Features cannot be 'shared' when building statically
 fi
 
 ################################################################################
+if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then
+	AC_CHECK_LIB([pthread], [pthread_mutex_lock], 
+		[PTHREAD_LIBS="-lpthread"], [AC_MSG_ERROR(bailing out)])
+fi
+
+################################################################################
 dnl -- Disable selinux
 AC_MSG_CHECKING(whether to enable selinux support)
 AC_ARG_ENABLE(selinux, [  --disable-selinux       Disable selinux support],
@@ -1123,6 +1129,7 @@ AC_SUBST(MSGFMT)
 AC_SUBST(OWNER)
 AC_SUBST(PKGCONFIG)
 AC_SUBST(POOL)
+AC_SUBST(PTHREAD_LIBS)
 AC_SUBST(QUORUM_CFLAGS)
 AC_SUBST(QUORUM_LIBS)
 AC_SUBST(READLINE_LIBS)
@@ -1133,10 +1140,10 @@ AC_SUBST(SALCK_LIBS)
 AC_SUBST(SELINUX_LIBS)
 AC_SUBST(SNAPSHOTS)
 AC_SUBST(STATICDIR)
+AC_SUBST(STATIC_LIBS)
 AC_SUBST(STATIC_LINK)
 AC_SUBST(UDEV_RULES)
 AC_SUBST(UDEV_SYNC)
-AC_SUBST([LIB_PTHREAD])
 AC_SUBST(interface)
 AC_SUBST(kerneldir)
 AC_SUBST(missingkernel)
diff --git a/daemons/clvmd/Makefile.in b/daemons/clvmd/Makefile.in
index dad568e..d6e653a 100644
--- a/daemons/clvmd/Makefile.in
+++ b/daemons/clvmd/Makefile.in
@@ -75,7 +75,7 @@ endif
 TARGETS = \
 	clvmd
 
-LVMLIBS = -llvm-internal -lpthread
+LVMLIBS = -llvm-internal
 
 ifeq ("@DMEVENTD@", "yes")
 	LVMLIBS += -ldevmapper-event
@@ -83,6 +83,8 @@ endif
  
 LVMLIBS += -ldevmapper
 
+LIBS += @PTHREAD_LIBS@
+
 DEFS += -D_REENTRANT
 CFLAGS += -fno-strict-aliasing
 
diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
index d185205..eaf897a 100644
--- a/daemons/dmeventd/Makefile.in
+++ b/daemons/dmeventd/Makefile.in
@@ -54,7 +54,7 @@ all: device-mapper
 device-mapper: $(TARGETS)
 
 LIBS += -ldl
-LVMLIBS += -ldevmapper-event -lpthread -ldevmapper
+LVMLIBS += -ldevmapper-event -ldevmapper @PTHREAD_LIBS@
 
 $(VERSIONED_SHLIB): $(LIB_SHARED)
 	$(RM) -f $@
diff --git a/daemons/dmeventd/plugins/lvm2/Makefile.in b/daemons/dmeventd/plugins/lvm2/Makefile.in
index af6807b..80d6a61 100644
--- a/daemons/dmeventd/plugins/lvm2/Makefile.in
+++ b/daemons/dmeventd/plugins/lvm2/Makefile.in
@@ -29,7 +29,7 @@ LIB_VERSION = $(LIB_VERSION_LVM)
 
 include $(top_builddir)/make.tmpl
 
-LIBS += -ldevmapper @LIB_PTHREAD@ @LVM2CMD_LIB@
+LIBS += @LVM2CMD_LIB@ -ldevmapper @PTHREAD_LIBS@
 
 install_lvm2: libdevmapper-event-lvm2.$(LIB_SUFFIX)
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
diff --git a/daemons/dmeventd/plugins/mirror/Makefile.in b/daemons/dmeventd/plugins/mirror/Makefile.in
index bdb49d1..e060d96 100644
--- a/daemons/dmeventd/plugins/mirror/Makefile.in
+++ b/daemons/dmeventd/plugins/mirror/Makefile.in
@@ -32,7 +32,7 @@ LIB_VERSION = $(LIB_VERSION_LVM)
 
 include $(top_builddir)/make.tmpl
 
-LIBS += -ldevmapper @LIB_PTHREAD@ @LVM2CMD_LIB@ -ldevmapper-event-lvm2
+LIBS += @LVM2CMD_LIB@ -ldevmapper-event-lvm2 -ldevmapper @PTHREAD_LIBS@
 
 install_lvm2: libdevmapper-event-lvm2mirror.$(LIB_SUFFIX)
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
diff --git a/daemons/dmeventd/plugins/snapshot/Makefile.in b/daemons/dmeventd/plugins/snapshot/Makefile.in
index 4b203a0..ea058c3 100644
--- a/daemons/dmeventd/plugins/snapshot/Makefile.in
+++ b/daemons/dmeventd/plugins/snapshot/Makefile.in
@@ -32,7 +32,7 @@ LIB_VERSION = $(LIB_VERSION_LVM)
 
 include $(top_builddir)/make.tmpl
 
-LIBS += -ldevmapper @LIB_PTHREAD@ @LVM2CMD_LIB@ -ldevmapper-event-lvm2
+LIBS += @LVM2CMD_LIB@ -ldevmapper-event-lvm2 -ldevmapper @PTHREAD_LIBS@
 
 install_lvm2: libdevmapper-event-lvm2snapshot.$(LIB_SUFFIX)
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
diff --git a/test/api/Makefile.in b/test/api/Makefile.in
index 2c0c62f..605da33 100644
--- a/test/api/Makefile.in
+++ b/test/api/Makefile.in
@@ -35,7 +35,7 @@ include $(top_builddir)/make.tmpl
 LDFLAGS = -L$(top_builddir)/libdm -L$(top_builddir)/liblvm
 
 ifeq ("@DMEVENTD@", "yes")
-	LVMLIBS += -ldevmapper-event -lpthread
+	LVMLIBS += -ldevmapper-event
 	LDFLAGS += -L$(top_builddir)/daemons/dmeventd
 endif
 
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 07fd4a6..974abd2 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -17,8 +17,6 @@ top_srcdir = @top_srcdir@
 top_builddir = @top_builddir@
 VPATH = @srcdir@
 
-LIB_PTHREAD = @LIB_PTHREAD@
-
 SOURCES =\
 	dumpconfig.c \
 	formats.c \
@@ -100,7 +98,7 @@ ifeq ("@CMDLIB@", "yes")
 endif
 
 ifeq ("@DMEVENTD@", "yes")
-	LVMLIBS += -ldevmapper-event -lpthread
+	LVMLIBS += -ldevmapper-event
 endif
 
 LVMLIBS += -ldevmapper
@@ -113,21 +111,21 @@ device-mapper: $(TARGETS_DM)
 
 dmsetup: dmsetup.o $(top_builddir)/libdm/libdevmapper.$(LIB_SUFFIX)
 	$(CC) $(CFLAGS) $(LDFLAGS) -L$(top_builddir)/libdm \
-	      -o $@ dmsetup.o -ldevmapper $(LIBS) $(LIB_PTHREAD)
+	      -o $@ dmsetup.o -ldevmapper $(LIBS)
 
 dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
-	      -o $@ dmsetup.o -ldevmapper $(LIBS) $(LIB_PTHREAD)
+	      -o $@ dmsetup.o -ldevmapper $(LIBS)
 
 all: device-mapper
 
 lvm: $(OBJECTS) lvm.o $(top_builddir)/lib/liblvm-internal.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) lvm.o \
-		$(LVMLIBS) @READLINE_LIBS@ $(LIBS) $(LIB_PTHREAD) -rdynamic
+		$(LVMLIBS) @READLINE_LIBS@ $(LIBS) -rdynamic
 
 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) $(LIB_PTHREAD) \
+	      $(OBJECTS) lvm-static.o $(LVMLIBS) $(LIBS) \
 	      -rdynamic
 
 liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
-- 
1.7.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 7/9] Remove -rdynamic
  2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
                   ` (5 preceding siblings ...)
  2010-03-02 12:07 ` [PATCH 6/9] Pthread linking change Zdenek Kabelac
@ 2010-03-02 12:07 ` Zdenek Kabelac
  2010-03-03 13:09   ` Petr Rockai
  2010-03-02 12:07 ` [PATCH 8/9] SELinux configure update Zdenek Kabelac
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 12+ messages in thread
From: Zdenek Kabelac @ 2010-03-02 12:07 UTC (permalink / raw)
  To: lvm-devel

This patch might be a bit contraversional. It removes -rdynamic from
linking of lvm.statis and dmeventd.static. In my understanding
this compiler flag (or "-Wl,--export-dynamic") is mainly useful
for dynamic linked libraries. It should not be needed for linking
of static binary. But I could be wrong here...

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 daemons/dmeventd/Makefile.in |    2 +-
 tools/Makefile.in            |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
index eaf897a..aacb6a4 100644
--- a/daemons/dmeventd/Makefile.in
+++ b/daemons/dmeventd/Makefile.in
@@ -66,7 +66,7 @@ dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o
 
 dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
-	dmeventd.o $(LVMLIBS) $(LIBS) -rdynamic
+	dmeventd.o $(LVMLIBS) $(LIBS)
 
 ifeq ("@PKGCONFIG@", "yes")
   INSTALL_LIB_TARGETS += install_pkgconfig
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 974abd2..a8cb6aa 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -125,8 +125,7 @@ lvm: $(OBJECTS) lvm.o $(top_builddir)/lib/liblvm-internal.a
 
 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) \
-	      -rdynamic
+	      $(OBJECTS) lvm-static.o $(LVMLIBS) $(LIBS)
 
 liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
 	cat $(top_builddir)/lib/liblvm-internal.a > $@
-- 
1.7.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 8/9] SELinux configure update
  2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
                   ` (6 preceding siblings ...)
  2010-03-02 12:07 ` [PATCH 7/9] Remove -rdynamic Zdenek Kabelac
@ 2010-03-02 12:07 ` Zdenek Kabelac
  2010-03-02 12:07 ` [PATCH 9/9] misc/configure.in modification Zdenek Kabelac
  2010-03-03 13:55 ` [PATCH 0/9] configure update Petr Rockai
  9 siblings, 0 replies; 12+ messages in thread
From: Zdenek Kabelac @ 2010-03-02 12:07 UTC (permalink / raw)
  To: lvm-devel

This patch add substituted variables SELINUX_LIBS and STATIC_LIBS.

Here we have little trouble for static builds - there is the dependency
on SELinux libraries which are not bundled automagicaly to 'ar'
library files. So statically compiled binaries that links with
libdevmapper needs to explicitly link $(STATIC_LIBS)
(until better solution is found).
Also it looks like some static builds of selinux have dependencies
on runtime glibc libraries.

Modifies 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.

Move SELinux header check to the SELinux test code.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 configure.in                 |   39 +++++++++------------------------------
 daemons/dmeventd/Makefile.in |    2 +-
 libdm/Makefile.in            |    2 ++
 tools/Makefile.in            |    4 ++--
 4 files changed, 14 insertions(+), 33 deletions(-)

diff --git a/configure.in b/configure.in
index 64ef0b6..284323f 100644
--- a/configure.in
+++ b/configure.in
@@ -844,35 +844,19 @@ 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 $SELINUX_LIBS"])
 
-	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],, [AC_MSG_ERROR(bailing out)])
 		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
+		HAVE_SELINUX=no ])
+
+	STATIC_LIBS="$STATIC_LIBS $SELINUX_LIBS"
 fi
 
 ################################################################################
@@ -995,10 +979,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
@@ -1107,7 +1087,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)
diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
index aacb6a4..6355eef 100644
--- a/daemons/dmeventd/Makefile.in
+++ b/daemons/dmeventd/Makefile.in
@@ -66,7 +66,7 @@ dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o
 
 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
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
index 1884b21..cde7077 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -52,6 +52,8 @@ include ../make.tmpl
 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 \
diff --git a/tools/Makefile.in b/tools/Makefile.in
index a8cb6aa..53bc105 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -115,7 +115,7 @@ dmsetup: dmsetup.o $(top_builddir)/libdm/libdevmapper.$(LIB_SUFFIX)
 
 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: $(OBJECTS) lvm.o $(top_builddir)/lib/liblvm-internal.a
 
 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 > $@
-- 
1.7.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 9/9] misc/configure.in modification
  2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
                   ` (7 preceding siblings ...)
  2010-03-02 12:07 ` [PATCH 8/9] SELinux configure update Zdenek Kabelac
@ 2010-03-02 12:07 ` Zdenek Kabelac
  2010-03-03 13:55 ` [PATCH 0/9] configure update Petr Rockai
  9 siblings, 0 replies; 12+ messages in thread
From: Zdenek Kabelac @ 2010-03-02 12:07 UTC (permalink / raw)
  To: lvm-devel

This is generated file from autoreconf.
We no longer define HAVE_LIBREADLINE - we have not used it
before anyway.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 lib/misc/configure.h.in |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in
index 4273eeb..b0af63f 100644
--- a/lib/misc/configure.h.in
+++ b/lib/misc/configure.h.in
@@ -120,9 +120,6 @@
 /* Define to 1 if you have the <libintl.h> header file. */
 #undef HAVE_LIBINTL_H
 
-/* Define to 1 if you have the `readline' library (-lreadline). */
-#undef HAVE_LIBREADLINE
-
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
-- 
1.7.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 7/9] Remove -rdynamic
  2010-03-02 12:07 ` [PATCH 7/9] Remove -rdynamic Zdenek Kabelac
@ 2010-03-03 13:09   ` Petr Rockai
  0 siblings, 0 replies; 12+ messages in thread
From: Petr Rockai @ 2010-03-03 13:09 UTC (permalink / raw)
  To: lvm-devel

Zdenek Kabelac <zkabelac@redhat.com> writes:

> This patch might be a bit contraversional. It removes -rdynamic from
> linking of lvm.statis and dmeventd.static. In my understanding
> this compiler flag (or "-Wl,--export-dynamic") is mainly useful
> for dynamic linked libraries. It should not be needed for linking
> of static binary. But I could be wrong here...
(1) From man: This option is needed for some uses of "dlopen" or to
allow obtaining backtraces from within a program.

(2) Also according to manual, you need -rdynamic to allow dlopen'd
things to use symbols from the "host" binary.

We probably need not be concerned with (2) since we don't dlopen in
lvm.static as far as I can tell. As for (1), as long as debuginfo (-g)
is available, this is, as far as I can tell, redundant. So it *should*
be safe to remove this.

Yours,
   Petr.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/9] configure update
  2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
                   ` (8 preceding siblings ...)
  2010-03-02 12:07 ` [PATCH 9/9] misc/configure.in modification Zdenek Kabelac
@ 2010-03-03 13:55 ` Petr Rockai
  9 siblings, 0 replies; 12+ messages in thread
From: Petr Rockai @ 2010-03-03 13:55 UTC (permalink / raw)
  To: lvm-devel

Zdenek Kabelac <zkabelac@redhat.com> writes:

> This patchset tries to mainly address linking problems.
> First few patches are rather cosmetic cleanups.
>
> Interestings patches starts with: Readline linking update.
>
> With this patchset libpthread and libselinux are linked only
> to object files which really needs this library.
> Tested it on Fedora & Debian distribution.

Overall, looks reasonably OK to me. Could certainly benefit from further
testing though.

Reviewed-By: Petr Rockai <prockai@redhat.com>

Yours,
   Petr.



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-03-03 13:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-02 12:07 [PATCH 0/9] configure update Zdenek Kabelac
2010-03-02 12:07 ` [PATCH 1/9] Help display --disable-fsadm Zdenek Kabelac
2010-03-02 12:07 ` [PATCH 2/9] Fix autoconf WARNING: Zdenek Kabelac
2010-03-02 12:07 ` [PATCH 3/9] For Makefile vars use $() instead of ${} Zdenek Kabelac
2010-03-02 12:07 ` [PATCH 4/9] Move include before DEFS+= Zdenek Kabelac
2010-03-02 12:07 ` [PATCH 5/9] Readline linking update Zdenek Kabelac
2010-03-02 12:07 ` [PATCH 6/9] Pthread linking change Zdenek Kabelac
2010-03-02 12:07 ` [PATCH 7/9] Remove -rdynamic Zdenek Kabelac
2010-03-03 13:09   ` Petr Rockai
2010-03-02 12:07 ` [PATCH 8/9] SELinux configure update Zdenek Kabelac
2010-03-02 12:07 ` [PATCH 9/9] misc/configure.in modification Zdenek Kabelac
2010-03-03 13:55 ` [PATCH 0/9] configure update Petr Rockai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.