lvm2 stuff - bind into build system
authorAlex Hornung <ahornung@gmail.com>
Sat, 3 Jul 2010 22:39:32 +0000 (23:39 +0100)
committerAlex Hornung <ahornung@gmail.com>
Sun, 11 Jul 2010 21:05:49 +0000 (22:05 +0100)
* Bind all the lvm2 stuff into the build system and get rid of useless
  lvm2tools.mk.

contrib/lvm2/lvm2tools.mk [deleted file]
gnu/Makefile
gnu/lib/Makefile
gnu/lib/libdevmapper/Makefile [new file with mode: 0644]
gnu/lib/liblvm/Makefile [new file with mode: 0644]
gnu/sbin/Makefile [new file with mode: 0644]
gnu/sbin/Makefile.inc [new file with mode: 0644]
gnu/sbin/dmsetup/Makefile [new file with mode: 0644]
gnu/sbin/lvm/Makefile [new file with mode: 0644]

diff --git a/contrib/lvm2/lvm2tools.mk b/contrib/lvm2/lvm2tools.mk
deleted file mode 100644 (file)
index b6ffa76..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#      $NetBSD: lvm2tools.mk,v 1.1 2008/12/22 00:57:58 haad Exp $
-
-.include <bsd.own.mk>
-
-LVM2_SRCDIR=   ${NETBSDSRCDIR}/external/gpl2/lvm2
-LVM2_DISTDIR=  ${NETBSDSRCDIR}/external/gpl2/lvm2/dist
-
-LIBDM_SRCDIR=          ${NETBSDSRCDIR}/external/gpl2/lvm2/lib/libdevmapper
-LIBDM_DISTDIR=         ${NETBSDSRCDIR}/external/gpl2/lvm2/dist/libdm
-LIBDM_INCLUDE=         ${NETBSDSRCDIR}/external/gpl2/lvm2/dist/include
-
-#
-#LIBDM_OBJDIR.libdevmapper=${LIBDM_SRCDIR}/lib/libdevmapper/
-#
-#.if !defined(LVM2OBJDIR.liblvm)
-#LVM2OBJDIR.liblvm!=   cd ${LVM2_SRCDIR}/lib/liblvm && ${PRINTOBJDIR}
-#.MAKEOVERRIDES+=      LVM2OBJDIR.liblvm 
-#.endif
-#
-#LVM2.liblvm=  ${LVM2OBJDIR.liblvm}/liblvm.a
index cd64d59..c4fa19c 100644 (file)
@@ -2,6 +2,6 @@
 # $FreeBSD: src/gnu/Makefile,v 1.33.2.1 2002/07/25 16:33:10 obrien Exp $
 # $DragonFly: src/gnu/Makefile,v 1.4 2005/05/03 14:21:31 joerg Exp $
 
-SUBDIR= usr.bin lib
+SUBDIR= usr.bin sbin lib
 
 .include <bsd.subdir.mk>
index 40dc7dd..01b0b53 100644 (file)
@@ -5,5 +5,6 @@ SUBDIR= libdialog libregex gcc41
 .if !defined(NO_GCC44)
 SUBDIR+= gcc44
 .endif
+SUBDIR+= libdevmapper liblvm
 
 .include <bsd.subdir.mk>
diff --git a/gnu/lib/libdevmapper/Makefile b/gnu/lib/libdevmapper/Makefile
new file mode 100644 (file)
index 0000000..d041062
--- /dev/null
@@ -0,0 +1,35 @@
+#      $NetBSD: Makefile,v 1.4 2009/12/09 00:17:23 haad Exp $
+
+LVM2_DIR=      ${.CURDIR}/../../../contrib/lvm2
+
+LIBDM_SRCDIR=  ${LVM2_DIR}/lib/libdevmapper
+LIBDM_DISTDIR= ${LVM2_DIR}/dist/libdm
+LVM2_DISTDIR=  ${LVM2_DIR}/dist
+LIB=           devmapper
+
+CFLAGS+=       -D_XOPEN_SOURCE=600
+CFLAGS+=       -I${LIBDM_DISTDIR} -I${LIBDM_DISTDIR}/misc -I${LIBDM_DISTDIR}/mm \
+               -I${LIBDM_DISTDIR}/datastruct -I${LIBDM_DISTDIR}/ioctl \
+               -I${LVM2_DISTDIR}/include -I${LIBDM_SRCDIR} \
+               -I${.CURDIR}/../../../sys/dev/disk/dm
+
+
+CFLAGS+=       -D__LIB_DEVMAPPER__ -DDM_DEVICE_UID=0 \
+               -DDM_DEVICE_GID=0 -DDM_DEVICE_MODE=0600
+
+LDADD+=                -lprop
+
+INCS+=         ${LIBDM_DISTDIR}/libdevmapper.h
+
+SRCS+=         bitset.c hash.c list.c libdm-common.c libdm-file.c \
+               libdm-deptree.c libdm-string.c libdm-report.c \
+               dbg_malloc.c pool.c matcher.c parse_rx.c ttree.c \
+               libdm-dragonfly-iface.c libdm_dragonfly.c
+
+.PATH: ${LIBDM_DISTDIR}/
+.PATH: ${LIBDM_DISTDIR}/datastruct
+.PATH: ${LIBDM_DISTDIR}/mm
+.PATH: ${LIBDM_DISTDIR}/regex
+.PATH: ${LIBDM_DISTDIR}/ioctl
+
+.include <bsd.lib.mk>
diff --git a/gnu/lib/liblvm/Makefile b/gnu/lib/liblvm/Makefile
new file mode 100644 (file)
index 0000000..3cdff99
--- /dev/null
@@ -0,0 +1,72 @@
+#      $NetBSD: Makefile,v 1.4 2009/12/02 01:54:20 haad Exp $
+
+LVM2_DIR=      ${.CURDIR}/../../../contrib/lvm2
+
+LIB=           lvm
+
+LVM2_DISTDIR=  ${LVM2_DIR}/dist
+
+CFLAGS+=       -D_XOPEN_SOURCE=600
+CFLAGS+=       -I${LVM2_DISTDIR}/lib -I${LVM2_DISTDIR}/include \
+               -I. 
+
+# Some parts of liblvm can't be protected because if its
+# alloca() usage.
+#
+.if defined(USE_SSP) && (${USE_SSP} != "no")
+CPPFLAGS+=     -Wno-stack-protector
+.endif
+
+CPPFLAGS.imLcLkup.c=-Wno-error
+
+SRCS+=         activate.c lvmcache.c toolcontext.c config.c btree.c \
+               str_list.c dev-cache.c dev-io.c dev-md.c device.c dev-swap.c \
+               display.c errseg.c filter-composite.c \
+               filter-persistent.c \
+               filter-regex.c filter-sysfs.c filter-md.c archive.c \
+               archiver.c export.c flags.c format-text.c import.c \
+               import_vsn1.c tags.c text_label.c freeseg.c label.c \
+               file_locking.c locking.c no_locking.c log.c lv_manip.c \
+               merge.c metadata.c mirror.c pv_manip.c pv_map.c segtype.c \
+               snapshot_manip.c crc.c lvm-exec.c lvm-file.c lvm-string.c \
+               lvm-wrappers.c timestamp.c util.c memlock.c report.c \
+               striped.c unknown.c uuid.c zero.c disk-rep.c format1.c \
+               import-export.c \
+               import-extents.c layout.c lvm1-label.c vg_number.c \
+               disk_rep.c format_pool.c import_export.c pool_label.c \
+               filter_dragonfly.c snapshot.c mirrored.c dev_manager.c fs.c \
+               lvm-globals.c
+
+LDADD+=                -lprop
+
+.PATH: ${LVM2_DISTDIR}/lib/
+.PATH: ${LVM2_DISTDIR}/lib/activate
+.PATH: ${LVM2_DISTDIR}/lib/cache
+.PATH: ${LVM2_DISTDIR}/lib/commands
+.PATH: ${LVM2_DISTDIR}/lib/config
+.PATH: ${LVM2_DISTDIR}/lib/datastruct
+.PATH: ${LVM2_DISTDIR}/lib/device
+.PATH: ${LVM2_DISTDIR}/lib/display
+.PATH: ${LVM2_DISTDIR}/lib/error
+.PATH: ${LVM2_DISTDIR}/lib/filters
+.PATH: ${LVM2_DISTDIR}/lib/format1
+.PATH: ${LVM2_DISTDIR}/lib/format_pool
+.PATH: ${LVM2_DISTDIR}/lib/format_text
+.PATH: ${LVM2_DISTDIR}/lib/freeseg
+.PATH: ${LVM2_DISTDIR}/lib/label
+.PATH: ${LVM2_DISTDIR}/lib/locking
+.PATH: ${LVM2_DISTDIR}/lib/log
+.PATH: ${LVM2_DISTDIR}/lib/metadata
+.PATH: ${LVM2_DISTDIR}/lib/mirror
+.PATH: ${LVM2_DISTDIR}/lib/misc
+.PATH: ${LVM2_DISTDIR}/lib/mm
+.PATH: ${LVM2_DISTDIR}/lib/report
+.PATH: ${LVM2_DISTDIR}/lib/snapshot
+.PATH: ${LVM2_DISTDIR}/lib/striped
+.PATH: ${LVM2_DISTDIR}/lib/unknown
+.PATH: ${LVM2_DISTDIR}/lib/uuid
+.PATH: ${LVM2_DISTDIR}/lib/zero
+.PATH: ${LVM2_DISTDIR}/lib/netbsd
+
+.include <bsd.lib.mk>
+#.include <bsd.subdir.mk>
diff --git a/gnu/sbin/Makefile b/gnu/sbin/Makefile
new file mode 100644 (file)
index 0000000..e3c89a3
--- /dev/null
@@ -0,0 +1,6 @@
+# $FreeBSD: src/gnu/usr.bin/Makefile,v 1.51 2000/01/16 00:11:34 obrien Exp $
+# $DragonFly: src/gnu/usr.bin/Makefile,v 1.32 2007/09/05 21:40:10 pavalos Exp $
+
+SUBDIR= dmsetup lvm
+
+.include <bsd.subdir.mk>
diff --git a/gnu/sbin/Makefile.inc b/gnu/sbin/Makefile.inc
new file mode 100644 (file)
index 0000000..09d2e45
--- /dev/null
@@ -0,0 +1,5 @@
+# $FreeBSD: src/gnu/usr.bin/Makefile.inc,v 1.4 1999/08/27 23:34:09 peter Exp $
+# $DragonFly: src/gnu/usr.bin/Makefile.inc,v 1.2 2003/06/17 04:25:44 dillon Exp $
+
+BINDIR?=       /sbin
+NOSHARED?=     yes
diff --git a/gnu/sbin/dmsetup/Makefile b/gnu/sbin/dmsetup/Makefile
new file mode 100644 (file)
index 0000000..c4fabb4
--- /dev/null
@@ -0,0 +1,28 @@
+#      $NetBSD: Makefile,v 1.4 2008/12/22 18:13:30 agc Exp $
+
+LVM2_DIR=      ${.CURDIR}/../../../contrib/lvm2
+
+LVM2_DISTDIR=       ${LVM2_DIR}/dist
+LIBDM_DISTDIR=        ${LVM2_DIR}/dist/libdm
+LIBDM_SRCDIR= ${LVM2_DIR}/lib/libdevmapper
+.PATH:  ${LVM2_DISTDIR}/man
+
+PROG=          dmsetup
+
+MAN=           dmsetup.8
+
+CFLAGS+=       -D_XOPEN_SOURCE=600
+CFLAGS+=      -I${LIBDM_DISTDIR}/ -I${LIBDM_DISTDIR}/misc \
+               -I. -I${LIBDM_DISTDIR}/ioctl -I${LVM2_DISTDIR}/include
+
+CFLAGS+=       -D__LIB_DEVMAPPER__ -DDM_DEVICE_UID=0 \
+               -DDM_DEVICE_GID=0 -DDM_DEVICE_MODE=0600
+
+LDADD+=                -L${.CURDIR}/../../lib/libdevmapper -ldevmapper
+DPADD+=                ${.CURDIR}/../../lib/libdevmapper/libdevmapper.a
+
+LDADD+=                -lprop
+
+.PATH: ${LVM2_DISTDIR}/tools
+
+.include <bsd.prog.mk>
diff --git a/gnu/sbin/lvm/Makefile b/gnu/sbin/lvm/Makefile
new file mode 100644 (file)
index 0000000..84a3c4c
--- /dev/null
@@ -0,0 +1,144 @@
+#      $NetBSD: Makefile,v 1.7 2009/12/01 23:12:51 haad Exp $
+
+LVM2_DIR=      ${.CURDIR}/../../../contrib/lvm2
+LVM2_DISTDIR=       ${LVM2_DIR}/dist
+LIBDM_DISTDIR=        ${LVM2_DIR}/dist/libdm
+LIBDM_SRCDIR= ${LVM2_DIR}/lib/libdevmapper
+
+.PATH: ${LVM2_DISTDIR}/man
+
+PROG=          lvm
+
+SRCS=          dumpconfig.c formats.c lvchange.c lvconvert.c lvcreate.c \
+               lvdisplay.c lvextend.c lvmchange.c lvmcmdline.c \
+               lvmdiskscan.c lvreduce.c lvremove.c lvrename.c lvresize.c \
+               lvscan.c polldaemon.c pvchange.c pvck.c pvcreate.c \
+               pvdisplay.c pvmove.c pvremove.c pvresize.c pvscan.c \
+               reporter.c segtypes.c toollib.c vgcfgbackup.c \
+               vgcfgrestore.c vgchange.c vgck.c vgconvert.c vgcreate.c \
+               vgdisplay.c vgexport.c vgextend.c vgimport.c vgmerge.c \
+               vgmknodes.c vgreduce.c vgremove.c vgrename.c vgscan.c \
+               vgsplit.c lvm.c
+
+
+CFLAGS+=       -D_XOPEN_SOURCE=600
+CFLAGS+=       -I${LVM2_DISTDIR}/lib -I${LVM2_DISTDIR}/include \
+               -I. -I${LIBDM_INCLUDE} -I${LVM2_DISTDIR}/tools \
+               -I${LIBDM_DISTDIR}
+
+CFLAGS+=       -DLVM_SHARED_PATH=\"$(BINDIR)/lvm\"
+
+# Some parts of the code can't be protected because if its
+# alloca() usage.
+#
+.if defined(USE_SSP) && (${USE_SSP} != "no")
+CFLAGS+=      -Wno-stack-protector
+.endif
+
+MAN=           lvchange.8 lvconvert.8 lvcreate.8 lvdisplay.8 lvextend.8 \
+               lvm.8 lvm.conf.5 lvmchange.8 lvmdiskscan.8 lvmdump.8 \
+               lvreduce.8 lvremove.8 lvrename.8 lvresize.8 lvs.8 \
+               lvscan.8 pvchange.8 pvck.8 pvcreate.8 pvdisplay.8 \
+               pvmove.8 pvremove.8 pvresize.8 pvs.8 pvscan.8 \
+               vgcfgbackup.8 vgcfgrestore.8 vgchange.8 vgck.8 vgconvert.8 \
+               vgcreate.8 vgdisplay.8 vgexport.8 vgextend.8 vgimport.8 \
+               vgmerge.8 vgmknodes.8 vgreduce.8 vgremove.8 vgrename.8 \
+               vgs.8 vgscan.8 vgsplit.8
+
+SYMLINKS+=     ${BINDIR}/lvm ${BINDIR}/lvchange \
+               ${BINDIR}/lvm ${BINDIR}/lvconvert \
+               ${BINDIR}/lvm ${BINDIR}/lvcreate \
+               ${BINDIR}/lvm ${BINDIR}/lvdisplay \
+               ${BINDIR}/lvm ${BINDIR}/lvextend \
+               ${BINDIR}/lvm ${BINDIR}/lvmchange \
+               ${BINDIR}/lvm ${BINDIR}/lvmdiskscan \
+               ${BINDIR}/lvm ${BINDIR}/lvmdump \
+               ${BINDIR}/lvm ${BINDIR}/lvreduce \
+               ${BINDIR}/lvm ${BINDIR}/lvremove \
+               ${BINDIR}/lvm ${BINDIR}/lvrename \
+               ${BINDIR}/lvm ${BINDIR}/lvresize \
+               ${BINDIR}/lvm ${BINDIR}/lvs \
+               ${BINDIR}/lvm ${BINDIR}/lvscan \
+               ${BINDIR}/lvm ${BINDIR}/pvchange \
+               ${BINDIR}/lvm ${BINDIR}/pvck \
+               ${BINDIR}/lvm ${BINDIR}/pvcreate \
+               ${BINDIR}/lvm ${BINDIR}/pvdisplay \
+               ${BINDIR}/lvm ${BINDIR}/pvmove \
+               ${BINDIR}/lvm ${BINDIR}/pvremove \
+               ${BINDIR}/lvm ${BINDIR}/pvresize \
+               ${BINDIR}/lvm ${BINDIR}/pvs \
+               ${BINDIR}/lvm ${BINDIR}/pvscan \
+               ${BINDIR}/lvm ${BINDIR}/vgcfgbackup \
+               ${BINDIR}/lvm ${BINDIR}/vgcfgrestore \
+               ${BINDIR}/lvm ${BINDIR}/vgchange \
+               ${BINDIR}/lvm ${BINDIR}/vgck \
+               ${BINDIR}/lvm ${BINDIR}/vgconvert \
+               ${BINDIR}/lvm ${BINDIR}/vgcreate \
+               ${BINDIR}/lvm ${BINDIR}/vgdisplay \
+               ${BINDIR}/lvm ${BINDIR}/vgexport \
+               ${BINDIR}/lvm ${BINDIR}/vgextend \
+               ${BINDIR}/lvm ${BINDIR}/vgimport \
+               ${BINDIR}/lvm ${BINDIR}/vgmerge \
+               ${BINDIR}/lvm ${BINDIR}/vgmknodes \
+               ${BINDIR}/lvm ${BINDIR}/vgreduce \
+               ${BINDIR}/lvm ${BINDIR}/vgremove \
+               ${BINDIR}/lvm ${BINDIR}/vgrename \
+               ${BINDIR}/lvm ${BINDIR}/vgs \
+               ${BINDIR}/lvm ${BINDIR}/vgscan \
+               ${BINDIR}/lvm ${BINDIR}/vgsplit
+
+MKLINKS+=      lvchange.8 lvchange.1 \
+                lvconvert.8 lvconvert.1 \
+                lvcreate.8 lvcreate.1 \
+                lvdisplay.8 lvdisplay.1 \
+                lvextend.8 lvextend.1 \
+                lvm.8 lvm.1 \
+                lvm.conf lvm.1 \
+                lvmchange.8 lvmchange.1 \
+                lvmdiskscan.8 lvmdiskscan.1 \
+                lvmdump.8 lvmdump.1 \
+                lvreduce.8 lvreduce.1 \
+                lvremove.8 lvremove.1 \
+                lvrename.8 lvrename.1 \
+                lvresize.8 lvresize.1 \
+                lvs.8 lvs.1 \
+                lvscan.8 lvscan.1 \
+                pvchange.8 pvchange.1 \
+                pvck.8 pvck.1 \
+                pvcreate.8 pvcreate.1 \
+                pvdisplay.8 pvdisplay.1 \
+                pvmove.8 pvmove.1 \
+                pvremove.8 pvremove.1 \
+                pvresize.8 pvresize.1 \
+                pvs.8 pvs.1 \
+                pvscan.8 pvscan.1 \
+                vgcfgbackup.8 vgcfgbackup.1 \
+                vgcfgrestore.8 vgcfgrestore.1 \
+                vgchange.8 vgchange.1 \
+                vgck.8 vgck.1 \
+                vgconvert.8 vgconvert.1 \
+                vgcreate.8 vgcreate.1 \
+                vgdisplay.8 vgdisplay.1 \
+                vgexport.8 vgexport.1 \
+                vgextend.8 vgextend.1 \
+                vgimport.8 vgimport.1 \
+                vgmerge.8 vgmerge.1 \
+                vgmknodes.8 vgmknodes.1 \
+                vgreduce.8 vgreduce.1 \
+                vgremove.8 vgremove.1 \
+                vgrename.8 vgrename.1 \
+                vgs.8 vgs.1 \
+                vgscan.8 vgscan.1 \
+                vgsplit.8 vgsplit.1
+
+LDADD+=         -L${.CURDIR}/../../lib/liblvm -llvm
+DPADD+=         ${.CURDIR}/../../lib/liblvm/liblvm.a
+
+LDADD+=         -L${.CURDIR}/../../lib/libdevmapper -ldevmapper
+DPADD+=         ${.CURDIR}/../../lib/libdevmapper/libdevmapper.a
+
+LDADD+=                -lprop -ledit -ltermcap
+
+.PATH: ${LVM2_DISTDIR}/tools
+
+.include <bsd.prog.mk>