All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15] configure update v2
@ 2010-03-03 20:42 Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 01/15] Update AC_PREREQ version to 2.61 Zdenek Kabelac
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 UTC (permalink / raw)
  To: lvm-devel

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

Interesting patches starts with: Readline linking update.

With this patchset libpthread, libselinux, libdl, libudev libraries
are linked only to objects which really use them.
Tested it on Fedora, Debian and RHEL4 distribution.

configure diff is not part of patch (~0.5MB)

Zdenek Kabelac (15):
  Update AC_PREREQ version to 2.61
  Help display --disable-fsadm
  Fix autoconf WARNING:
  Fix usage of $(top_builddir)
  Replace just one CFLOW_CMD
  Use $() instead of ${} for Makefile variables
  Move include before  DEFS+=
  Introduce LVMINTERNAL_LIBS
  Readline linking update
  Pthread linking change
  Remove -rdynamic
  SELinux configure update
  Move "-ldl" from LIBS to DL_LIBS
  Introduce UDEV_LIBS
  Update generated misc/configure.in

 configure.in                                  |  134 ++++++++++++-------------
 daemons/Makefile.in                           |    2 +-
 daemons/clvmd/Makefile.in                     |    5 +-
 daemons/cmirrord/Makefile.in                  |    2 +-
 daemons/dmeventd/Makefile.in                  |    9 +-
 daemons/dmeventd/plugins/Makefile.in          |    2 +-
 daemons/dmeventd/plugins/lvm2/Makefile.in     |    4 +-
 daemons/dmeventd/plugins/mirror/Makefile.in   |    6 +-
 daemons/dmeventd/plugins/snapshot/Makefile.in |    6 +-
 doc/Makefile.in                               |    2 +-
 lib/Makefile.in                               |    4 +-
 lib/format1/Makefile.in                       |    2 +-
 lib/format_pool/Makefile.in                   |    2 +-
 lib/locking/Makefile.in                       |    2 +-
 lib/mirror/Makefile.in                        |    2 +-
 lib/misc/configure.h.in                       |    3 -
 lib/snapshot/Makefile.in                      |    2 +-
 libdm/Makefile.in                             |    4 +-
 liblvm/Makefile.in                            |    4 +-
 make.tmpl.in                                  |   10 ++
 man/Makefile.in                               |    6 +-
 old-tests/device/Makefile.in                  |    4 +-
 old-tests/filters/Makefile.in                 |    6 +-
 old-tests/format1/Makefile.in                 |   22 ++--
 old-tests/mm/Makefile.in                      |    6 +-
 old-tests/regex/Makefile.in                   |   10 +-
 po/Makefile.in                                |    2 +-
 scripts/Makefile.in                           |    2 +-
 test/api/Makefile.in                          |    2 +-
 tools/Makefile.in                             |   31 +++---
 udev/Makefile.in                              |    2 +-
 31 files changed, 149 insertions(+), 151 deletions(-)



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

* [PATCH 01/15] Update AC_PREREQ version to 2.61
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 02/15] Help display --disable-fsadm Zdenek Kabelac
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 UTC (permalink / raw)
  To: lvm-devel

Usage of AC_PROG_SED and AC_PROG_MKDIR_P requires autoconf version 2.61.

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

diff --git a/configure.in b/configure.in
index aaa21c6..9ccde94 100644
--- a/configure.in
+++ b/configure.in
@@ -11,7 +11,7 @@
 ## Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ################################################################################
 
-AC_PREREQ(2.57)
+AC_PREREQ(2.61)
 ################################################################################
 dnl -- Process this file with autoconf to produce a configure script.
 AC_INIT
-- 
1.7.0



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

* [PATCH 02/15] Help display --disable-fsadm
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 01/15] Update AC_PREREQ version to 2.61 Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 03/15] Fix autoconf WARNING: Zdenek Kabelac
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 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 9ccde94..a973590 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] 16+ messages in thread

* [PATCH 03/15] Fix autoconf WARNING:
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 01/15] Update AC_PREREQ version to 2.61 Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 02/15] Help display --disable-fsadm Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 04/15] Fix usage of $(top_builddir) Zdenek Kabelac
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 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] 16+ messages in thread

* [PATCH 04/15] Fix usage of $(top_builddir)
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (2 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 03/15] Fix autoconf WARNING: Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 05/15] Replace just one CFLOW_CMD Zdenek Kabelac
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 UTC (permalink / raw)
  To: lvm-devel

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 daemons/Makefile.in                  |    2 +-
 daemons/clvmd/Makefile.in            |    2 +-
 daemons/cmirrord/Makefile.in         |    2 +-
 daemons/dmeventd/Makefile.in         |    2 +-
 daemons/dmeventd/plugins/Makefile.in |    2 +-
 doc/Makefile.in                      |    2 +-
 lib/Makefile.in                      |    4 ++--
 lib/format1/Makefile.in              |    2 +-
 lib/format_pool/Makefile.in          |    2 +-
 lib/locking/Makefile.in              |    2 +-
 lib/mirror/Makefile.in               |    2 +-
 lib/snapshot/Makefile.in             |    2 +-
 libdm/Makefile.in                    |    2 +-
 liblvm/Makefile.in                   |    2 +-
 man/Makefile.in                      |    2 +-
 old-tests/device/Makefile.in         |    4 ++--
 old-tests/filters/Makefile.in        |    6 +++---
 old-tests/format1/Makefile.in        |   22 +++++++++++-----------
 old-tests/mm/Makefile.in             |    6 +++---
 old-tests/regex/Makefile.in          |   10 +++++-----
 po/Makefile.in                       |    2 +-
 scripts/Makefile.in                  |    2 +-
 tools/Makefile.in                    |    2 +-
 udev/Makefile.in                     |    2 +-
 24 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/daemons/Makefile.in b/daemons/Makefile.in
index 92773bb..a0e7268 100644
--- a/daemons/Makefile.in
+++ b/daemons/Makefile.in
@@ -30,7 +30,7 @@ ifeq ("@BUILD_DMEVENTD@", "yes")
   SUBDIRS += dmeventd
 endif
 
-include ../make.tmpl
+include $(top_builddir)/make.tmpl
 
 ifeq ("@BUILD_DMEVENTD@", "yes")
 device-mapper: dmeventd.device-mapper
diff --git a/daemons/clvmd/Makefile.in b/daemons/clvmd/Makefile.in
index dad568e..905f1c9 100644
--- a/daemons/clvmd/Makefile.in
+++ b/daemons/clvmd/Makefile.in
@@ -86,7 +86,7 @@ LVMLIBS += -ldevmapper
 DEFS += -D_REENTRANT
 CFLAGS += -fno-strict-aliasing
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 INSTALL_TARGETS = \
 	install_clvmd
diff --git a/daemons/cmirrord/Makefile.in b/daemons/cmirrord/Makefile.in
index b33aa6a..b8928c7 100644
--- a/daemons/cmirrord/Makefile.in
+++ b/daemons/cmirrord/Makefile.in
@@ -25,7 +25,7 @@ SOURCES = clogd.c cluster.c compat.c functions.c link_mon.c local.c logging.c
 
 TARGETS = cmirrord
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 LIBS += -ldevmapper
 LMLIBS += $(CPG_LIBS) $(SACKPT_LIBS)
diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
index d185205..fc72c21 100644
--- a/daemons/dmeventd/Makefile.in
+++ b/daemons/dmeventd/Makefile.in
@@ -48,7 +48,7 @@ ifneq ($(MAKECMDGOALS),device-mapper)
   SUBDIRS+=plugins
 endif
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 all: device-mapper
 device-mapper: $(TARGETS)
diff --git a/daemons/dmeventd/plugins/Makefile.in b/daemons/dmeventd/plugins/Makefile.in
index 48ae9e9..6b25235 100644
--- a/daemons/dmeventd/plugins/Makefile.in
+++ b/daemons/dmeventd/plugins/Makefile.in
@@ -19,7 +19,7 @@ VPATH = @srcdir@
 
 SUBDIRS += lvm2 mirror snapshot
 
-include ../../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 mirror: lvm2
 snapshot: lvm2
diff --git a/doc/Makefile.in b/doc/Makefile.in
index b4689af..ce66209 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -19,7 +19,7 @@ VPATH = @srcdir@
 CONFSRC=example.conf
 CONFDEST=lvm.conf
 
-include ../make.tmpl
+include $(top_builddir)/make.tmpl
 
 install_lvm2: $(CONFSRC)
 	@if [ ! -e $(confdir)/$(CONFDEST) ]; then \
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 6c29a5e..a2e66f3 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -143,7 +143,7 @@ ifeq ("@HAVE_LIBDL@", "yes")
 endif
 
 ifeq ("@DMEVENTD@", "yes")
-  CLDFLAGS += -L../daemons/dmeventd
+  CLDFLAGS += -L$(top_builddir)/daemons/dmeventd
   LIBS += -ldevmapper-event
 endif
 
@@ -152,7 +152,7 @@ LIB_STATIC = $(LIB_NAME).a
 
 CLEAN_TARGETS += $(LIB_NAME).cflow
 
-include ../make.tmpl
+include $(top_builddir)/make.tmpl
 
 $(SUBDIRS): $(LIB_STATIC)
 
diff --git a/lib/format1/Makefile.in b/lib/format1/Makefile.in
index e12cc6f..f62ab7c 100644
--- a/lib/format1/Makefile.in
+++ b/lib/format1/Makefile.in
@@ -29,7 +29,7 @@ SOURCES =\
 LIB_SHARED = liblvm2format1.so
 LIB_VERSION = $(LIB_VERSION_LVM)
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 install: liblvm2format1.so
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
diff --git a/lib/format_pool/Makefile.in b/lib/format_pool/Makefile.in
index d67c982..b0ebc36 100644
--- a/lib/format_pool/Makefile.in
+++ b/lib/format_pool/Makefile.in
@@ -26,7 +26,7 @@ SOURCES =\
 LIB_SHARED = liblvm2formatpool.so
 LIB_VERSION = $(LIB_VERSION_LVM)
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 install: liblvm2formatpool.so
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
diff --git a/lib/locking/Makefile.in b/lib/locking/Makefile.in
index 584c8d6..399b0af 100644
--- a/lib/locking/Makefile.in
+++ b/lib/locking/Makefile.in
@@ -22,7 +22,7 @@ SOURCES = cluster_locking.c
 LIB_SHARED = liblvm2clusterlock.so
 LIB_VERSION = $(LIB_VERSION_LVM)
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 install install_cluster: liblvm2clusterlock.so
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
diff --git a/lib/mirror/Makefile.in b/lib/mirror/Makefile.in
index d5b678b..038399a 100644
--- a/lib/mirror/Makefile.in
+++ b/lib/mirror/Makefile.in
@@ -22,7 +22,7 @@ SOURCES = mirrored.c
 LIB_SHARED = liblvm2mirror.so
 LIB_VERSION = $(LIB_VERSION_LVM)
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 install: liblvm2mirror.so
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
diff --git a/lib/snapshot/Makefile.in b/lib/snapshot/Makefile.in
index 3f960fb..80728c7 100644
--- a/lib/snapshot/Makefile.in
+++ b/lib/snapshot/Makefile.in
@@ -22,7 +22,7 @@ SOURCES = snapshot.c
 LIB_SHARED = liblvm2snapshot.so
 LIB_VERSION = $(LIB_VERSION_LVM)
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 install: liblvm2snapshot.so
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
index 6dd25ff..ce3e058 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -50,7 +50,7 @@ LIB_VERSION = $(LIB_VERSION_DM)
 DEFS += -DDM_DEVICE_UID=@DM_DEVICE_UID@ -DDM_DEVICE_GID=@DM_DEVICE_GID@ \
 	-DDM_DEVICE_MODE=@DM_DEVICE_MODE@
 
-include ../make.tmpl
+include $(top_builddir)/make.tmpl
 
 device-mapper: all
 
diff --git a/liblvm/Makefile.in b/liblvm/Makefile.in
index 5e6dfd4..25906e1 100644
--- a/liblvm/Makefile.in
+++ b/liblvm/Makefile.in
@@ -40,7 +40,7 @@ endif
 
 CLEAN_TARGETS += liblvm.cflow
 
-include ../make.tmpl
+include $(top_builddir)/make.tmpl
 
 LIBS += -ldevmapper -llvm-internal
 
diff --git a/man/Makefile.in b/man/Makefile.in
index dfe95e6..f49d4c8 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -48,7 +48,7 @@ MAN8DIR=${mandir}/man8
 
 CLEAN_TARGETS=$(MAN5) $(MAN8) $(MAN8CLUSTER) $(FSADMMAN) $(MAN8DM)
 
-include ../make.tmpl
+include $(top_builddir)/make.tmpl
 
 ifneq ("@CLVMD@", "none")
   install: install_cluster
diff --git a/old-tests/device/Makefile.in b/old-tests/device/Makefile.in
index 4bf15a9..5c9479e 100644
--- a/old-tests/device/Makefile.in
+++ b/old-tests/device/Makefile.in
@@ -22,8 +22,8 @@ SOURCES=\
 
 TARGETS=dev_cache_t
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 dev_cache_t: dev_cache_t.o $(top_srcdir)/lib/liblvm.a
-	$(CC) -o dev_cache_t dev_cache_t.o -L$(top_srcdir)/lib -llvm
+	$(CC) -o dev_cache_t dev_cache_t.o -L$(top_builddir)/lib -llvm
 
diff --git a/old-tests/filters/Makefile.in b/old-tests/filters/Makefile.in
index 01de934..62e13c0 100644
--- a/old-tests/filters/Makefile.in
+++ b/old-tests/filters/Makefile.in
@@ -25,11 +25,11 @@ TARGETS=\
 	rfilter_t \
 	pfilter_t
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 rfilter_t: rfilter_t.o $(top_srcdir)/lib/liblvm.a
-	$(CC) -o rfilter_t rfilter_t.o -L$(top_srcdir)/lib -llvm
+	$(CC) -o rfilter_t rfilter_t.o -L$(top_builddir)/lib -llvm
 
 pfilter_t: pfilter_t.o $(top_srcdir)/lib/liblvm.a
-	$(CC) -o pfilter_t pfilter_t.o -L$(top_srcdir)/lib -llvm
+	$(CC) -o pfilter_t pfilter_t.o -L$(top_builddir)/lib -llvm
 
diff --git a/old-tests/format1/Makefile.in b/old-tests/format1/Makefile.in
index 1ccb56d..b82e065 100644
--- a/old-tests/format1/Makefile.in
+++ b/old-tests/format1/Makefile.in
@@ -32,21 +32,21 @@ TARGETS=\
 	read_pv_t \
 	get_vgs_t
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
-read_vg_t: read_vg_t.o pretty_print.o $(top_srcdir)/lib/liblvm.a
-	$(CC) -o read_vg_t read_vg_t.o pretty_print.o -L$(top_srcdir)/lib -llvm
+read_vg_t: read_vg_t.o pretty_print.o $(top_builddir)/lib/liblvm.a
+	$(CC) -o read_vg_t read_vg_t.o pretty_print.o -L$(top_builddir)/lib -llvm
 
-write_vg_t: write_vg_t.o pretty_print.o $(top_srcdir)/lib/liblvm.a
+write_vg_t: write_vg_t.o pretty_print.o $(top_builddir)/lib/liblvm.a
 	$(CC) -o write_vg_t write_vg_t.o pretty_print.o \
-	-L$(top_srcdir)/lib -llvm
+	-L$(top_builddir)/lib -llvm
 
-get_pvs_t: get_pvs_t.o pretty_print.o $(top_srcdir)/lib/liblvm.a
-	$(CC) -o get_pvs_t get_pvs_t.o pretty_print.o -L$(top_srcdir)/lib -llvm
+get_pvs_t: get_pvs_t.o pretty_print.o $(top_builddir)/lib/liblvm.a
+	$(CC) -o get_pvs_t get_pvs_t.o pretty_print.o -L$(top_builddir)/lib -llvm
 
-read_pv_t: read_pv_t.o pretty_print.o $(top_srcdir)/lib/liblvm.a
-	$(CC) -o read_pv_t read_pv_t.o pretty_print.o -L$(top_srcdir)/lib -llvm
+read_pv_t: read_pv_t.o pretty_print.o $(top_builddir)/lib/liblvm.a
+	$(CC) -o read_pv_t read_pv_t.o pretty_print.o -L$(top_builddir)/lib -llvm
 
-get_vgs_t: get_vgs_t.o pretty_print.o $(top_srcdir)/lib/liblvm.a
-	$(CC) -o get_vgs_t get_vgs_t.o pretty_print.o -L$(top_srcdir)/lib -llvm
+get_vgs_t: get_vgs_t.o pretty_print.o $(top_builddir)/lib/liblvm.a
+	$(CC) -o get_vgs_t get_vgs_t.o pretty_print.o -L$(top_builddir)/lib -llvm
 
diff --git a/old-tests/mm/Makefile.in b/old-tests/mm/Makefile.in
index 997f0d3..62c341f 100644
--- a/old-tests/mm/Makefile.in
+++ b/old-tests/mm/Makefile.in
@@ -22,12 +22,12 @@ SOURCES=\
 
 TARGETS=dbg_malloc_t
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
 dbg_malloc_t: dbg_malloc_t.o
 	$(CC) $(CFLAGS) -o dbg_malloc_t dbg_malloc_t.o \
-		-L$(top_srcdir)/lib -llvm
+		-L$(top_builddir)/lib -llvm
 
 pool_t: pool_t.o
-	$(CC) $(CFLAGS) -o pool_t pool_t.o -L$(top_srcdir)/lib -llvm
+	$(CC) $(CFLAGS) -o pool_t pool_t.o -L$(top_builddir)/lib -llvm
 
diff --git a/old-tests/regex/Makefile.in b/old-tests/regex/Makefile.in
index 28783ae..7696c48 100644
--- a/old-tests/regex/Makefile.in
+++ b/old-tests/regex/Makefile.in
@@ -25,11 +25,11 @@ TARGETS=\
 	parse_t \
 	matcher_t
 
-include ../../make.tmpl
+include $(top_builddir)/make.tmpl
 
-parse_t: parse_t.o $(top_srcdir)/lib/liblvm.a
-	$(CC) -o parse_t parse_t.o -L$(top_srcdir)/lib -llvm
+parse_t: parse_t.o $(top_builddir)/lib/liblvm.a
+	$(CC) -o parse_t parse_t.o -L$(top_builddir)/lib -llvm
 
-matcher_t: matcher_t.o $(top_srcdir)/lib/liblvm.a
-	$(CC) -o matcher_t matcher_t.o -L$(top_srcdir)/lib -llvm
+matcher_t: matcher_t.o $(top_builddir)/lib/liblvm.a
+	$(CC) -o matcher_t matcher_t.o -L$(top_builddir)/lib -llvm
 
diff --git a/po/Makefile.in b/po/Makefile.in
index c9f8400..22184f1 100644
--- a/po/Makefile.in
+++ b/po/Makefile.in
@@ -25,7 +25,7 @@ DM_POSOURCES = $(top_srcdir)/dmsetup/*.pot $(top_srcdir)/libdm/*.pot \
 
 LVM_POSOURCES = $(top_srcdir)/tools/*.pot $(top_srcdir)/lib/*/*.pot
 
-include ../make.tmpl
+include $(top_builddir)/make.tmpl
 
 lvm2.po: Makefile $(LVM_POSOURCES)
 	@echo Compiling string table
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 867f0ee..b79d312 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -16,7 +16,7 @@ top_srcdir = @top_srcdir@
 top_builddir = @top_builddir@
 VPATH = @srcdir@
 
-include ../make.tmpl
+include $(top_builddir)/make.tmpl
 
 install:
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(srcdir)/lvm_dump.sh \
diff --git a/tools/Makefile.in b/tools/Makefile.in
index b650c67..880ea89 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -107,7 +107,7 @@ LVMLIBS += -ldevmapper
 
 DEFS += -DLVM_SHARED_PATH=\"$(exec_prefix)/sbin/lvm\"
 
-include ../make.tmpl
+include $(top_builddir)/make.tmpl
 
 device-mapper: $(TARGETS_DM)
 
diff --git a/udev/Makefile.in b/udev/Makefile.in
index 0a0050a..d4006b9 100644
--- a/udev/Makefile.in
+++ b/udev/Makefile.in
@@ -22,7 +22,7 @@ DM_DIR=$(shell grep "\#define DM_DIR" $(top_srcdir)/libdm/misc/dm-ioctl.h | awk
 
 CLEAN_TARGETS=10-dm.rules
 
-include ../make.tmpl
+include $(top_builddir)/make.tmpl
 
 %: %.in
 	$(SED) -e "s/(DM_DIR)/$(DM_DIR)/" $< >$@
-- 
1.7.0



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

* [PATCH 05/15] Replace just one CFLOW_CMD
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (3 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 04/15] Fix usage of $(top_builddir) Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 06/15] Use $() instead of ${} for Makefile variables Zdenek Kabelac
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 UTC (permalink / raw)
  To: lvm-devel

Replace CFLOW_CMD only in make.tmpl and use it as variable elsewhere.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 make.tmpl.in      |    1 +
 tools/Makefile.in |   12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/make.tmpl.in b/make.tmpl.in
index 61365ec..5b8476f 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -27,6 +27,7 @@ LCOV = @LCOV@
 GENHTML = @GENHTML@
 LN_S = @LN_S@
 SED = @SED@
+CFLOW_CMD = @CFLOW_CMD@
 
 LIBS = @LIBS@
 DEFS += @DEFS@
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 880ea89..41c20db 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -147,20 +147,20 @@ liblvm2cmd.$(LIB_SUFFIX): liblvm2cmd.a $(LDDEPS)
 .PHONY: install_cmdlib_dynamic install_cmdlib_static \
 	install_tools_dynamic install_tools_static
 
-ifneq ("@CFLOW_CMD@", "")
+ifneq ("$(CFLOW_CMD)", "")
 CFLOW_FLAGS += --cpp="$(CC) -E"
 .PHONY: lvm.cflow
 -include $(top_srcdir)/lib/liblvm-internal.cflow
 lvm.cflow: $(SOURCES)
-	@CFLOW_CMD@ -o$@ $(CFLOW_FLAGS) $(INCLUDES) $(DEFS) $(SOURCES)
+	$(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) $(INCLUDES) $(DEFS) $(SOURCES)
 lvm.rxref: $(SOURCES)
-	@CFLOW_CMD@ -o$@ --cpp="$(CC) -E" -r --omit-arguments -x $(INCLUDES) $(DEFS) $(SOURCES)
+	$(CFLOW_CMD) -o$@ --cpp="$(CC) -E" -r --omit-arguments -x $(INCLUDES) $(DEFS) $(SOURCES)
 lvm.xref: $(SOURCES)
-	@CFLOW_CMD@ -o$@ --cpp="$(CC) -E" --omit-arguments -x $(INCLUDES) $(DEFS) $(SOURCES)
+	$(CFLOW_CMD) -o$@ --cpp="$(CC) -E" --omit-arguments -x $(INCLUDES) $(DEFS) $(SOURCES)
 lvm.rtree: $(SOURCES)
-	@CFLOW_CMD@ -o$@ --cpp="$(CC) -E" -r --omit-arguments -T -b $(INCLUDES) $(DEFS) $(SOURCES)
+	$(CFLOW_CMD) -o$@ --cpp="$(CC) -E" -r --omit-arguments -T -b $(INCLUDES) $(DEFS) $(SOURCES)
 lvm.tree: $(SOURCES)
-	@CFLOW_CMD@ -o$@ --cpp="$(CC) -E" --omit-arguments -T -b $(INCLUDES) $(DEFS) $(SOURCES)
+	$(CFLOW_CMD) -o$@ --cpp="$(CC) -E" --omit-arguments -T -b $(INCLUDES) $(DEFS) $(SOURCES)
 cflow: lvm.cflow lvm.xref lvm.tree lvm.rtree lvm.rxref
 endif
 
-- 
1.7.0



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

* [PATCH 06/15] Use $() instead of ${} for Makefile variables
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (4 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 05/15] Replace just one CFLOW_CMD Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 07/15] Move include before DEFS+= Zdenek Kabelac
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 UTC (permalink / raw)
  To: lvm-devel

Both usage forms are correct, but we should use one them
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 f49d4c8..332f07f 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] 16+ messages in thread

* [PATCH 07/15] Move include before DEFS+=
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (5 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 06/15] Use $() instead of ${} for Makefile variables Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 08/15] Introduce LVMINTERNAL_LIBS Zdenek Kabelac
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 UTC (permalink / raw)
  To: lvm-devel

This patch moves inclusion of the make.tmpl before DEFS modification,
so it goes in the same order on the 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 ce3e058..6ff3bff 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 $(top_builddir)/make.tmpl
+
 DEFS += -DDM_DEVICE_UID=@DM_DEVICE_UID@ -DDM_DEVICE_GID=@DM_DEVICE_GID@ \
 	-DDM_DEVICE_MODE=@DM_DEVICE_MODE@
 
-include $(top_builddir)/make.tmpl
-
 device-mapper: all
 
 .PHONY: install_dynamic install_static install_include \
-- 
1.7.0



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

* [PATCH 08/15] Introduce LVMINTERNAL_LIBS
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (6 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 07/15] Move include before DEFS+= Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 09/15] Readline linking update Zdenek Kabelac
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 UTC (permalink / raw)
  To: lvm-devel

Keep dependency libraries for liblvm-internal in one place.

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

diff --git a/daemons/clvmd/Makefile.in b/daemons/clvmd/Makefile.in
index 905f1c9..40d1da4 100644
--- a/daemons/clvmd/Makefile.in
+++ b/daemons/clvmd/Makefile.in
@@ -75,7 +75,7 @@ endif
 TARGETS = \
 	clvmd
 
-LVMLIBS = -llvm-internal -lpthread
+LVMLIBS = $(LVMINTERNAL_LIBS) -lpthread
 
 ifeq ("@DMEVENTD@", "yes")
 	LVMLIBS += -ldevmapper-event
diff --git a/liblvm/Makefile.in b/liblvm/Makefile.in
index 25906e1..1b2b474 100644
--- a/liblvm/Makefile.in
+++ b/liblvm/Makefile.in
@@ -42,7 +42,7 @@ CLEAN_TARGETS += liblvm.cflow
 
 include $(top_builddir)/make.tmpl
 
-LIBS += -ldevmapper -llvm-internal
+LIBS += $(LVMINTERNAL_LIBS) -ldevmapper
 
 ifeq ("@DMEVENTD@", "yes")
   LIBS += -ldevmapper-event
diff --git a/make.tmpl.in b/make.tmpl.in
index 5b8476f..4b3ac17 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -36,6 +36,7 @@ CLDFLAGS += @CLDFLAGS@
 LDDEPS += @LDDEPS@
 LDFLAGS += @LDFLAGS@
 LIB_SUFFIX = @LIB_SUFFIX@
+LVMINTERNAL_LIBS = -llvm-internal
 
 # Setup directory variables
 prefix = @prefix@
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 41c20db..efdf699 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -86,7 +86,7 @@ ifeq ("@STATIC_LINK@", "yes")
   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
 endif
 
-LVMLIBS = -llvm-internal
+LVMLIBS = $(LVMINTERNAL_LIBS)
 LIB_VERSION = $(LIB_VERSION_LVM)
 
 CLEAN_TARGETS = liblvm2cmd.$(LIB_SUFFIX) liblvm2cmd.a liblvm2cmd-static.a lvm lvm.o \
-- 
1.7.0



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

* [PATCH 09/15] Readline linking update
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (7 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 08/15] Introduce LVMINTERNAL_LIBS Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 10/15] Pthread linking change Zdenek Kabelac
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 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      |   65 ++++++++++++++++++++++++++++------------------------
 make.tmpl.in      |    1 +
 tools/Makefile.in |    2 +-
 3 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/configure.in b/configure.in
index a973590..aeac331 100644
--- a/configure.in
+++ b/configure.in
@@ -788,24 +788,6 @@ if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
 fi;
 
 ################################################################################
-dnl -- Check for termcap (Shamelessly copied from parted 1.4.17)
-if test x$READLINE != xno; then
-	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
---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.
-)
-fi
-
-################################################################################
 dnl -- Check for dlopen
 AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
 
@@ -887,22 +869,44 @@ 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
+	lvm_saved_libs=$LIBS
+	AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
+		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.])
+		fi])
+	dnl -- Old systems may need extra termcap dependency explicitly in LIBS
+	AC_CHECK_LIB([readline], [readline], [
+		AC_DEFINE([READLINE_SUPPORT], 1,
+			[Define to 1 to include the LVM readline shell.])
+		dnl -- Try only with -lreadline and check for different symbol
+		LIBS=$lvm_saved_libs
+		AC_CHECK_LIB([readline], [rl_line_buffer],
+			[ READLINE_LIBS="-lreadline" ], [
+			  AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed])
+			  READLINE_LIBS="-lreadline $READLINE_LIBS"
+			]) ], [
+		READLINE_LIBS=
+		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 ])
+	LIBS="$READLINE_LIBS $lvm_saved_libs"
+	AC_CHECK_FUNCS([rl_completion_matches])
+	LIBS=$lvm_saved_libs
 fi
 
 ################################################################################
@@ -1123,6 +1127,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/make.tmpl.in b/make.tmpl.in
index 4b3ac17..88be259 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -37,6 +37,7 @@ LDDEPS += @LDDEPS@
 LDFLAGS += @LDFLAGS@
 LIB_SUFFIX = @LIB_SUFFIX@
 LVMINTERNAL_LIBS = -llvm-internal
+READLINE_LIBS = @READLINE_LIBS@
 
 # Setup directory variables
 prefix = @prefix@
diff --git a/tools/Makefile.in b/tools/Makefile.in
index efdf699..236fb4e 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] 16+ messages in thread

* [PATCH 10/15] Pthread linking change
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (8 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 09/15] Readline linking update Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 11/15] Remove -rdynamic Zdenek Kabelac
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 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                                  |    8 +++++++-
 daemons/clvmd/Makefile.in                     |    3 ++-
 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 +-
 make.tmpl.in                                  |    1 +
 test/api/Makefile.in                          |    2 +-
 tools/Makefile.in                             |   12 +++++-------
 9 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/configure.in b/configure.in
index aeac331..42e4235 100644
--- a/configure.in
+++ b/configure.in
@@ -809,6 +809,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"], hard_bailout)
+fi
+
+################################################################################
 dnl -- Disable selinux
 AC_MSG_CHECKING(whether to enable selinux support)
 AC_ARG_ENABLE(selinux, [  --disable-selinux       Disable selinux support],
@@ -1125,6 +1131,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)
@@ -1138,7 +1145,6 @@ AC_SUBST(STATICDIR)
 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 40d1da4..16ba0b8 100644
--- a/daemons/clvmd/Makefile.in
+++ b/daemons/clvmd/Makefile.in
@@ -75,13 +75,14 @@ endif
 TARGETS = \
 	clvmd
 
-LVMLIBS = $(LVMINTERNAL_LIBS) -lpthread
+LVMLIBS = $(LVMINTERNAL_LIBS)
 
 ifeq ("@DMEVENTD@", "yes")
 	LVMLIBS += -ldevmapper-event
 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 fc72c21..aa20453 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..0f23c84 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..bd85a6f 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..793fd38 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/make.tmpl.in b/make.tmpl.in
index 88be259..9def16d 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -37,6 +37,7 @@ LDDEPS += @LDDEPS@
 LDFLAGS += @LDFLAGS@
 LIB_SUFFIX = @LIB_SUFFIX@
 LVMINTERNAL_LIBS = -llvm-internal
+PTHREAD_LIBS = @PTHREAD_LIBS@
 READLINE_LIBS = @READLINE_LIBS@
 
 # Setup directory variables
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 236fb4e..a590d61 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] 16+ messages in thread

* [PATCH 11/15] Remove -rdynamic
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (9 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 10/15] Pthread linking change Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 12/15] SELinux configure update Zdenek Kabelac
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 UTC (permalink / raw)
  To: lvm-devel

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

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 aa20453..84514f0 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 a590d61..b3b0b29 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] 16+ messages in thread

* [PATCH 12/15] SELinux configure update
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (10 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 11/15] Remove -rdynamic Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:42 ` [PATCH 13/15] Move "-ldl" from LIBS to DL_LIBS Zdenek Kabelac
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 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                 |   38 ++++++++------------------------------
 daemons/dmeventd/Makefile.in |    2 +-
 libdm/Makefile.in            |    2 ++
 make.tmpl.in                 |    3 +++
 tools/Makefile.in            |    4 ++--
 5 files changed, 16 insertions(+), 33 deletions(-)

diff --git a/configure.in b/configure.in
index 42e4235..b985c98 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)
diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
index 84514f0..df223ef 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 6ff3bff..7ea0604 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -52,6 +52,8 @@ 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)
+
 device-mapper: all
 
 .PHONY: install_dynamic install_static install_include \
diff --git a/make.tmpl.in b/make.tmpl.in
index 9def16d..15ee915 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -30,6 +30,8 @@ SED = @SED@
 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 @@ LIB_SUFFIX = @LIB_SUFFIX@
 LVMINTERNAL_LIBS = -llvm-internal
 PTHREAD_LIBS = @PTHREAD_LIBS@
 READLINE_LIBS = @READLINE_LIBS@
+SELINUX_LIBS = @SELINUX_LIBS@
 
 # Setup directory variables
 prefix = @prefix@
diff --git a/tools/Makefile.in b/tools/Makefile.in
index b3b0b29..c7cd1d5 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] 16+ messages in thread

* [PATCH 13/15] Move "-ldl" from LIBS to DL_LIBS
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (11 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 12/15] SELinux configure update Zdenek Kabelac
@ 2010-03-03 20:42 ` Zdenek Kabelac
  2010-03-03 20:43 ` [PATCH 14/15] Introduce UDEV_LIBS Zdenek Kabelac
  2010-03-03 20:43 ` [PATCH 15/15] Update generated misc/configure.in Zdenek Kabelac
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:42 UTC (permalink / raw)
  To: lvm-devel

Introduce DL_LIBS substituted variable and move -ldl from global
LIBS to local DL_LIBS. Link this library only when needed.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 configure.in                 |   13 ++++++-------
 daemons/dmeventd/Makefile.in |    5 ++---
 make.tmpl.in                 |    3 ++-
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/configure.in b/configure.in
index b985c98..f632420 100644
--- a/configure.in
+++ b/configure.in
@@ -789,14 +789,12 @@ fi;
 
 ################################################################################
 dnl -- Check for dlopen
-AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
-
-if [[ "x$HAVE_LIBDL" = xyes ]]; then
+AC_CHECK_LIB(dl, dlopen, [
 	AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
-	LIBS="-ldl $LIBS"
-else
-	HAVE_LIBDL=no
-fi
+	DL_LIBS="-ldl"
+	HAVE_LIBDL=yes ], [
+	DL_LIBS=
+	HAVE_LIBDL=no ])
 
 ################################################################################
 dnl -- Check for shared/static conflicts
@@ -1074,6 +1072,7 @@ AC_SUBST(DEBUG)
 AC_SUBST(DEVMAPPER)
 AC_SUBST(DLM_CFLAGS)
 AC_SUBST(DLM_LIBS)
+AC_SUBST(DL_LIBS)
 AC_SUBST(DMEVENTD)
 AC_SUBST(DM_COMPAT)
 AC_SUBST(DM_DEVICE_GID)
diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
index df223ef..dc48f0d 100644
--- a/daemons/dmeventd/Makefile.in
+++ b/daemons/dmeventd/Makefile.in
@@ -53,7 +53,6 @@ include $(top_builddir)/make.tmpl
 all: device-mapper
 device-mapper: $(TARGETS)
 
-LIBS += -ldl
 LVMLIBS += -ldevmapper-event -ldevmapper $(PTHREAD_LIBS)
 
 $(VERSIONED_SHLIB): $(LIB_SHARED)
@@ -62,11 +61,11 @@ $(VERSIONED_SHLIB): $(LIB_SHARED)
 
 dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o
 	$(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ dmeventd.o \
-	$(LVMLIBS) $(LIBS) -rdynamic
+	$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
 
 dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
-	dmeventd.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
+	dmeventd.o $(DL_LIBS) $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
 
 ifeq ("@PKGCONFIG@", "yes")
   INSTALL_LIB_TARGETS += install_pkgconfig
diff --git a/make.tmpl.in b/make.tmpl.in
index 15ee915..48f145d 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -38,7 +38,8 @@ CLDFLAGS += @CLDFLAGS@
 LDDEPS += @LDDEPS@
 LDFLAGS += @LDFLAGS@
 LIB_SUFFIX = @LIB_SUFFIX@
-LVMINTERNAL_LIBS = -llvm-internal
+LVMINTERNAL_LIBS = -llvm-internal $(DL_LIBS)
+DL_LIBS = @DL_LIBS@
 PTHREAD_LIBS = @PTHREAD_LIBS@
 READLINE_LIBS = @READLINE_LIBS@
 SELINUX_LIBS = @SELINUX_LIBS@
-- 
1.7.0



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

* [PATCH 14/15] Introduce UDEV_LIBS
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (12 preceding siblings ...)
  2010-03-03 20:42 ` [PATCH 13/15] Move "-ldl" from LIBS to DL_LIBS Zdenek Kabelac
@ 2010-03-03 20:43 ` Zdenek Kabelac
  2010-03-03 20:43 ` [PATCH 15/15] Update generated misc/configure.in Zdenek Kabelac
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:43 UTC (permalink / raw)
  To: lvm-devel

Link libudev only to object files that really needs this library.

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

diff --git a/configure.in b/configure.in
index f632420..3473d95 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 7ea0604..85e19ea 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 48f145d..ff4d1b2 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 c7cd1d5..5106327 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)
-- 
1.7.0



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

* [PATCH 15/15] Update generated misc/configure.in
  2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
                   ` (13 preceding siblings ...)
  2010-03-03 20:43 ` [PATCH 14/15] Introduce UDEV_LIBS Zdenek Kabelac
@ 2010-03-03 20:43 ` Zdenek Kabelac
  14 siblings, 0 replies; 16+ messages in thread
From: Zdenek Kabelac @ 2010-03-03 20:43 UTC (permalink / raw)
  To: lvm-devel

This file is generated from autoreconf.
HAVE_LIBREADLINE is no longer defined
- lvm does not use it 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] 16+ messages in thread

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

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-03 20:42 [PATCH 00/15] configure update v2 Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 01/15] Update AC_PREREQ version to 2.61 Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 02/15] Help display --disable-fsadm Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 03/15] Fix autoconf WARNING: Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 04/15] Fix usage of $(top_builddir) Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 05/15] Replace just one CFLOW_CMD Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 06/15] Use $() instead of ${} for Makefile variables Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 07/15] Move include before DEFS+= Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 08/15] Introduce LVMINTERNAL_LIBS Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 09/15] Readline linking update Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 10/15] Pthread linking change Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 11/15] Remove -rdynamic Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 12/15] SELinux configure update Zdenek Kabelac
2010-03-03 20:42 ` [PATCH 13/15] Move "-ldl" from LIBS to DL_LIBS Zdenek Kabelac
2010-03-03 20:43 ` [PATCH 14/15] Introduce UDEV_LIBS Zdenek Kabelac
2010-03-03 20:43 ` [PATCH 15/15] Update generated misc/configure.in Zdenek Kabelac

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.