Skip to contentSkip to conversation

: Rename old liblvm and add new liblvm application library

PATCH New Dave Wysochanski 1 participant 3 messages Mar 6, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover : Rename old liblvm and add new liblvm application library

The following two patches rename the original LVM library, liblvm.a to liblvm-internal.a which allows for the new application library. The new application library is build in new subdirectory liblvm.

#1 lore raw

PATCH 1/2 Rename liblvm to liblvm-internal.

Make preparation for using liblvm for new application library.

---
 lib/Makefile.in   |    9 +++++----
 tools/Makefile.in |   16 ++++++++--------
 2 files changed, 13 insertions(+), 12 deletions(-)
lib/Makefile.in +5 -4
index 47786a7..0d5ee94 100644
@@ -140,18 +140,19 @@ ifeq ("@DMEVENTD@", "yes")
   CLDFLAGS += -ldevmapper-event
 endif
 
-LIB_STATIC = liblvm.a
+LIB_NAME = liblvm-internal
+LIB_STATIC = $(LIB_NAME).a
 
 $(SUBDIRS): $(LIB_STATIC)
 
-CLEAN_TARGETS += liblvm.cflow
+CLEAN_TARGETS += $(LIB_NAME).cflow
 
 include $(top_srcdir)/make.tmpl
 
-liblvm.cflow: $(SOURCES)
+$(LIB_NAME).cflow: $(SOURCES)
 	set -e; (echo -n "SOURCES += "; \
 		 echo $(SOURCES) | \
 		 sed "s/^/ /;s/ / $(top_srcdir)\/lib\//g;s/$$//"; \
 		 ) > $@
 
-cflow: liblvm.cflow
+cflow: $(LIB_NAME).cflow
tools/Makefile.in +8 -8
index 774d75e..72ecd98 100644
@@ -77,7 +77,7 @@ ifeq ("@STATIC_LINK@", "yes")
   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
 endif
 
-LVMLIBS = -llvm
+LVMLIBS = -llvm-internal
 
 CLEAN_TARGETS = liblvm2cmd.$(LIB_SUFFIX) liblvm2cmd.a liblvm2cmd-static.a lvm lvm.o \
 		lvm2cmd.o lvm2cmd-static.o lvm2cmdlib.o lvm.static \
@@ -112,21 +112,21 @@ dmsetup.static: dmsetup.o $(interfacedir)/libdevmapper.a
 
 all: device-mapper
 
-lvm: $(OBJECTS) lvm.o $(top_srcdir)/lib/liblvm.a
+lvm: $(OBJECTS) lvm.o $(top_srcdir)/lib/liblvm-internal.a
 	$(CC) -o $@ $(CFLAGS) $(OBJECTS) lvm.o \
 		$(LDFLAGS) $(LVMLIBS) $(LIBS) -rdynamic
 
 LIB_PTHREAD = @LIB_PTHREAD@
-lvm.static: $(OBJECTS) lvm-static.o $(top_srcdir)/lib/liblvm.a  $(interfacedir)/libdevmapper.a
+lvm.static: $(OBJECTS) lvm-static.o $(top_srcdir)/lib/liblvm-internal.a  $(interfacedir)/libdevmapper.a
 	$(CC) -o $@ $(CFLAGS) $(OBJECTS) lvm-static.o -static \
 		-L$(interfacedir) $(LDFLAGS) $(LVMLIBS) $(LIBS) $(LIB_PTHREAD) -rdynamic
 
-liblvm2cmd.a: $(top_srcdir)/lib/liblvm.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
-	cat $(top_srcdir)/lib/liblvm.a > $@
+liblvm2cmd.a: $(top_srcdir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
+	cat $(top_srcdir)/lib/liblvm-internal.a > $@
 	$(AR) rs $@ $(OBJECTS) lvmcmdlib.o lvm2cmd.o
 
-liblvm2cmd-static.a: $(top_srcdir)/lib/liblvm.a $(OBJECTS) lvmcmdlib.o lvm2cmd-static.o
-	cat $(top_srcdir)/lib/liblvm.a > $@
+liblvm2cmd-static.a: $(top_srcdir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd-static.o
+	cat $(top_srcdir)/lib/liblvm-internal.a > $@
 	$(AR) rs $@ $(OBJECTS) lvmcmdlib.o lvm2cmd-static.o
 
 liblvm2cmd.$(LIB_SUFFIX): liblvm2cmd.a $(LDDEPS)
@@ -141,7 +141,7 @@ liblvm2cmd.$(LIB_SUFFIX): liblvm2cmd.a $(LDDEPS)
 ifneq ("@CFLOW_CMD@", "")
 CFLOW_FLAGS += --cpp="$(CC) -E"
 .PHONY: lvm.cflow
--include $(top_srcdir)/lib/liblvm.cflow
+-include $(top_srcdir)/lib/liblvm-internal.cflow
 lvm.cflow: $(SOURCES)
 	@CFLOW_CMD@ -o$@ $(CFLOW_FLAGS) $(INCLUDES) $(DEFS) $(SOURCES)
 lvm.rxref: $(SOURCES)
Signature · 1 line
1.6.0.6
#2 lore raw

PATCH 2/2 Add new liblvm build directory and move lvm_base.c.

The original liblvm.a has been moved to liblvm-internal.a. We now use liblvm.a for the new application library and build it inside liblvm directory.

---
 Makefile.in        |    2 +-
 WHATS_NEW          |    1 +
 configure          |    3 +-
 configure.in       |    1 +
 lib/Makefile.in    |    3 +-
 lib/lvm_base.c     |   64 ----------------------------------------------------
 liblvm/Makefile.in |   36 +++++++++++++++++++++++++++++
 liblvm/lvm_base.c  |   64 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 106 insertions(+), 68 deletions(-)
 delete mode 100644 lib/lvm_base.c
 create mode 100644 liblvm/Makefile.in
 create mode 100644 liblvm/lvm_base.c
Makefile.in +1 -1
index 07f22c6..38835eb 100644
@@ -22,7 +22,7 @@ ifeq ("@INTL@", "yes")
   SUBDIRS += po
 endif
 
-SUBDIRS += lib tools daemons libdm
+SUBDIRS += lib tools daemons libdm liblvm
 
 ifeq ($(MAKECMDGOALS),distclean)
   SUBDIRS += daemons/clvmd \
WHATS_NEW +1 -0
index e039108..0b96651 100644
@@ -1,5 +1,6 @@
 Version 2.02.46 - 
 ================================
+  Rename liblvm.a to liblvm-internal.a and build new application library.
   Flush memory pool and fix locking in clvmd refresh and backup command.
   Fix unlocks in clvmd-corosync. Broken in 2.02.45.
 
configure +2 -1
index 64afd3c..dbc9263 100755
@@ -12659,7 +12659,7 @@ LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '.' '{print $3}'`
 
 
 ################################################################################
-ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile doc/Makefile include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/misc/lvm-version.h lib/snapshot/Makefile libdm/Makefile libdm/libdevmapper.pc man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/Makefile test/Makefile test/api/Makefile tools/Makefile"
+ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile doc/Makefile include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/misc/lvm-version.h lib/snapshot/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/Makefile test/Makefile test/api/Makefile tools/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -13278,6 +13278,7 @@ do
     "lib/snapshot/Makefile") CONFIG_FILES="$CONFIG_FILES lib/snapshot/Makefile" ;;
     "libdm/Makefile") CONFIG_FILES="$CONFIG_FILES libdm/Makefile" ;;
     "libdm/libdevmapper.pc") CONFIG_FILES="$CONFIG_FILES libdm/libdevmapper.pc" ;;
+    "liblvm/Makefile") CONFIG_FILES="$CONFIG_FILES liblvm/Makefile" ;;
     "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
     "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;;
     "scripts/clvmd_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/clvmd_init_red_hat" ;;
configure.in +1 -0
index 1eaa2a0..f84d589 100644
@@ -835,6 +835,7 @@ lib/misc/lvm-version.h
 lib/snapshot/Makefile
 libdm/Makefile
 libdm/libdevmapper.pc
+liblvm/Makefile
 man/Makefile
 po/Makefile
 scripts/clvmd_init_red_hat
lib/Makefile.in +1 -2
index 0d5ee94..ee1f8ff 100644
@@ -86,8 +86,7 @@ SOURCES =\
 	report/report.c \
 	striped/striped.c \
 	uuid/uuid.c \
-	zero/zero.c \
-	lvm_base.c
+	zero/zero.c
 
 ifeq ("@LVM1@", "internal")
   SOURCES +=\
lib/lvm_base.c deleted +0 -64

64 lines not on this page · raw message

liblvm/Makefile.in new file +36 -0
new file mode 100644
index 0000000..6f90f6a
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
+# Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+#
+# This file is part of LVM2.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+SOURCES =\
+	lvm_base.c
+
+LIB_STATIC = liblvm.a
+
+$(SUBDIRS): $(LIB_STATIC)
+
+CLEAN_TARGETS += liblvm.cflow
+
+include $(top_srcdir)/make.tmpl
+
+liblvm.cflow: $(SOURCES)
+	set -e; (echo -n "SOURCES += "; \
+		 echo $(SOURCES) | \
+		 sed "s/^/ /;s/ / $(top_srcdir)\/lib\//g;s/$$//"; \
+		 ) > $@
+
+cflow: liblvm.cflow
liblvm/lvm_base.c new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
1.6.0.6