From 98ce19f04c5c4a5c627a0ff78af9e4fde9bbf891 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 11 Dec 2008 13:54:57 -0800 Subject: [PATCH] Update avl, nvpair, spl to unique build dirs --- Makefile.am | 28 +++++----------------- config/Makefile.am | 2 +- config/Rules.am | 15 ++++++++++++ config/kernel.m4 | 20 ---------------- configure.ac | 45 +++++++++++++---------------------- lib/Makefile.am | 1 + lib/libavl/Makefile.am | 10 ++++++++ lib/libnvpair/Makefile.am | 13 ++++++++++ lib/libspl/Makefile.am | 14 +++++++++++ module/avl/Makefile.in | 11 +++++++++ module/nvpair/Makefile.in | 12 ++++++++++ scripts/Makefile.am | 7 ++---- zfs/lib/Makefile.in | 8 ------- zfs/lib/libavl/Makefile.in | 30 ----------------------- zfs/lib/libavl/zu.c | 4 ---- zfs/lib/libnvpair/Makefile.in | 33 ------------------------- zfs/lib/libnvpair/zu.c | 4 ---- zfs/lib/libspl/Makefile.in | 23 ------------------ zfs/lib/libspl/zu.c | 4 ---- zfs/lib/libuutil/zu.c | 4 ---- zfs/lib/libzfs/zu.c | 4 ---- zfs/lib/libzpool/zu.c | 4 ---- 22 files changed, 101 insertions(+), 195 deletions(-) create mode 100644 config/Rules.am create mode 100644 lib/Makefile.am create mode 100644 lib/libavl/Makefile.am create mode 100644 lib/libnvpair/Makefile.am create mode 100644 lib/libspl/Makefile.am create mode 100644 module/avl/Makefile.in create mode 100644 module/nvpair/Makefile.in delete mode 100644 zfs/lib/Makefile.in delete mode 100644 zfs/lib/libavl/Makefile.in delete mode 100644 zfs/lib/libavl/zu.c delete mode 100644 zfs/lib/libnvpair/Makefile.in delete mode 100644 zfs/lib/libnvpair/zu.c delete mode 100644 zfs/lib/libspl/Makefile.in delete mode 100644 zfs/lib/libspl/zu.c delete mode 100644 zfs/lib/libuutil/zu.c delete mode 100644 zfs/lib/libzfs/zu.c delete mode 100644 zfs/lib/libzpool/zu.c diff --git a/Makefile.am b/Makefile.am index 39f3fd0848..cb0a654082 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,25 +1,9 @@ AUTOMAKE_OPTIONS = foreign dist-zip +EXTRA_DIST = autogen.sh AUTHORS COPYING COPYRIGHT ChangeLog DISCLAIMER +EXTRA_DIST += GIT META OPENSOLARIS.LICENSE README ZFS.RELEASE -SUBDIRS = doc scripts $(BUILDDIR) -CONFIG_CLEAN_FILES = aclocal.m4 config.guess config.sub -CONFIG_CLEAN_FILES += depcomp missing mkinstalldirs -EXTRA_DIST = autogen.sh +SUBDIRS = config doc scripts lib cmd module -.PHONY: quilt -quilt: .quilt-$(BUILDDIR) -autogen: .autogen-$(BUILDDIR) -config: .config-$(BUILDDIR) -.quilt-$(BUILDDIR): - ./scripts/quilt.sh -p $(NAME) -b $(BUILDDIR) -s $(SERIESFILE) -d $(PATCHDIR) - echo $(BUILDDIR) >$@ - -unquilt: - rm -rf $(BUILDDIR) - rm -f .quilt-$(BUILDDIR) - -clean-generic: - -distclean: unquilt - -rpms: dist Makefile - rpmbuild -ta $(distdir).tar.gz +.PHONY: rpm +rpms: dist-bzip2 + rpmbuild -ta $(distdir).tar.bz2 diff --git a/config/Makefile.am b/config/Makefile.am index 78256508f3..257d60f149 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -1 +1 @@ -EXTRA_DIST = zfs-build.m4 zfs-meta.m4 kernel.m4 lustre.m4 user.m4 +EXTRA_DIST = zfs-build.m4 zfs-meta.m4 kernel.m4 lustre.m4 user.m4 Rules.am diff --git a/config/Rules.am b/config/Rules.am new file mode 100644 index 0000000000..5b2b31311f --- /dev/null +++ b/config/Rules.am @@ -0,0 +1,15 @@ +# Default build options +AM_FLAGS = -ggdb -O2 -std=c99 +AM_FLAGS += -Wall -Wstrict-prototypes -Wshadow + +# FIXME: Quiet warnings not covered by the gcc-* patches. We should +# FIXME: consider removing this as soon as we reasonably can. +AM_FLAGS += -Wno-switch -Wno-unused -Wno-missing-braces +AM_FLAGS += -Wno-unknown-pragmas -Wno-parentheses +AM_FLAGS += -Wno-uninitialized -fno-strict-aliasing + +# Expected defines not covered by zfs_config.h or spl_config.h +AM_FLAGS += -D_GNU_SOURCE -D__EXTENSIONS__ +AM_FLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_FILE_OFFSET_BITS=64 +AM_FLAGS += -D_LARGEFILE64_SOURCE -D_REENTRANT +AM_FLAGS += -DTEXT_DOMAIN=\\\"zfs-linux-user\\\" diff --git a/config/kernel.m4 b/config/kernel.m4 index 8ba0b7aa1c..8563c9ae58 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -37,24 +37,4 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ AC_SUBST(KERNELMAKE_PARAMS) AC_SUBST(KERNELCPPFLAGS) AC_SUBST(HOSTCFLAGS) - - dnl # XXX: I really, really hate this... but to ensure the kernel - dnl # build system compiles C files shared between a library and a - dnl # kernel module, we need to ensure each file has a unique make - dnl # target. To do that I'm creating symlinks for each shared - dnl # file at configure time. It may be possible something better - dnl # can be done in the Makefile but it will take some serious - dnl # investigation and I don't have the time now. - - echo "creating symlinks for additional kernel make targets" - ln -f -s $LIBDIR/libavl/avl.c $LIBDIR/libavl/kavl.c - ln -f -s $LIBDIR/libavl/avl.c $LIBDIR/libavl/uavl.c - ln -f -s $LIBDIR/libnvpair/nvpair.c $LIBDIR/libnvpair/knvpair.c - ln -f -s $LIBDIR/libnvpair/nvpair.c $LIBDIR/libnvpair/unvpair.c - ln -f -s $LIBDIR/libzcommon/zfs_deleg.c $LIBDIR/libzcommon/kzfs_deleg.c - ln -f -s $LIBDIR/libzcommon/zfs_prop.c $LIBDIR/libzcommon/kzfs_prop.c - ln -f -s $LIBDIR/libzcommon/zprop_common.c $LIBDIR/libzcommon/kzprop_common.c - ln -f -s $LIBDIR/libzcommon/zfs_namecheck.c $LIBDIR/libzcommon/kzfs_namecheck.c - ln -f -s $LIBDIR/libzcommon/zfs_comutil.c $LIBDIR/libzcommon/kzfs_comutil.c - ln -f -s $LIBDIR/libzcommon/zpool_prop.c $LIBDIR/libzcommon/kzpool_prop.c ]) diff --git a/configure.ac b/configure.ac index 48aeb949bc..47162775dc 100644 --- a/configure.ac +++ b/configure.ac @@ -105,34 +105,21 @@ AC_CONFIG_FILES([ Makefile config/Makefile doc/Makefile scripts/Makefile - zfs/Makefile - zfs/lib/Makefile - zfs/lib/libnvpair/include/sys/Makefile - zfs/lib/libnvpair/include/Makefile - zfs/lib/libnvpair/Makefile - zfs/lib/libavl/include/sys/Makefile - zfs/lib/libavl/include/Makefile - zfs/lib/libavl/Makefile - zfs/lib/libuutil/include/Makefile - zfs/lib/libuutil/Makefile - zfs/lib/libzfs/include/Makefile - zfs/lib/libzfs/Makefile - zfs/lib/libzcommon/include/Makefile - zfs/lib/libzcommon/include/sys/fm/fs/Makefile - zfs/lib/libzcommon/include/sys/fm/Makefile - zfs/lib/libzcommon/include/sys/Makefile - zfs/lib/libzcommon/include/sys/fs/Makefile - zfs/lib/libzcommon/Makefile - zfs/lib/libzpool/Makefile - zfs/lib/libspl/include/sys/Makefile - zfs/lib/libspl/include/Makefile - zfs/lib/libspl/Makefile - zfs/zcmd/ztest/Makefile - zfs/zcmd/Makefile - zfs/zcmd/zfs/Makefile - zfs/zcmd/zdb/Makefile - zfs/zcmd/zinject/Makefile - zfs/zcmd/zdump/Makefile - zfs/zcmd/zpool/Makefile + lib/Makefile + lib/libspl/Makefile + lib/libavl/Makefile + lib/libnvpair/Makefile + lib/libuutil/Makefile + lib/libzcommon/Makefile + lib/libzpool/Makefile + lib/libzfs/Makefile + lib/libzfs/include/Makefile + cmd/Makefile + cmd/zdb/Makefile + cmd/zdump/Makefile + cmd/zfs/Makefile + cmd/zinject/Makefile + cmd/zpool/Makefile + cmd/ztest/Makefile ]) AC_OUTPUT diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000000..df55aacdc5 --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = libspl libavl libnvpair libuutil libzcommon libzpool libzfs diff --git a/lib/libavl/Makefile.am b/lib/libavl/Makefile.am new file mode 100644 index 0000000000..f11885f11e --- /dev/null +++ b/lib/libavl/Makefile.am @@ -0,0 +1,10 @@ +include $(top_srcdir)/config/Rules.am + +DEFAULT_INCLUDES = -I${moddir}/avl/include \ + -I${libdir}/libspl/include + +lib_LTLIBRARIES = libavl.la + +libavl_la_SOURCES = ${moddir}/avl/avl.c \ + ${moddir}/avl/include/sys/avl.h \ + ${moddir}/avl/include/sys/avl_impl.h diff --git a/lib/libnvpair/Makefile.am b/lib/libnvpair/Makefile.am new file mode 100644 index 0000000000..48c5f71b31 --- /dev/null +++ b/lib/libnvpair/Makefile.am @@ -0,0 +1,13 @@ +include $(top_srcdir)/config/Rules.am + +DEFAULT_INCLUDES = -I${moddir}/nvpair/include \ + -I${libdir}/libspl/include + +lib_LTLIBRARIES = libnvpair.la + +libnvpair_la_SOURCES = ${moddir}/nvpair/nvpair.c \ + ${libdir}/libnvpair/libnvpair.c \ + ${libdir}/libnvpair/nvpair_alloc_system.c \ + ${moddir}/nvpair/include/sys/nvpair.h \ + ${moddir}/nvpair/include/sys/nvpair_impl.h + ${libdir}/libnvpair/include/libnvpair.h diff --git a/lib/libspl/Makefile.am b/lib/libspl/Makefile.am new file mode 100644 index 0000000000..451995830f --- /dev/null +++ b/lib/libspl/Makefile.am @@ -0,0 +1,14 @@ +include $(top_srcdir)/config/Rules.am + +DEFAULT_INCLUDES = -I${libdir}/libspl/include + +lib_LTLIBRARIES = libspl.la + +libspl_la_SOURCES = list.c \ + mkdirp.c \ + strlcat.c \ + strlcpy.c \ + strnlen.c \ + u8_textprep.c \ + include/sys/list.h \ + include/sys/list_impl.h diff --git a/module/avl/Makefile.in b/module/avl/Makefile.in new file mode 100644 index 0000000000..5476125d73 --- /dev/null +++ b/module/avl/Makefile.in @@ -0,0 +1,11 @@ +subdir-m += include +DISTFILES = avl.c + +MODULE := zavl + +EXTRA_CFLAGS = @KERNELCPPFLAGS@ +EXTRA_CFLAGS += -I@MODDIR@/avl/include + +obj-m := ${MODULE}.o + +${MODULE}-objs += avl.o # Generic AVL support diff --git a/module/nvpair/Makefile.in b/module/nvpair/Makefile.in new file mode 100644 index 0000000000..c053ed9160 --- /dev/null +++ b/module/nvpair/Makefile.in @@ -0,0 +1,12 @@ +subdir-m += include +DISTFILES = nvpair.c + +MODULE := znvpair + +EXTRA_CFLAGS = @KERNELCPPFLAGS@ +EXTRA_CFLAGS += -I@MODDIR@/nvpair/include + +obj-m := ${MODULE}.o + +${MODULE}-objs += nvpair.o # Interfaces name/value pairs +${MODULE}-objs += nvpair_alloc_spl.o # Generic alloc/free support diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e708530758..daf6206542 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,8 +1,5 @@ -EXTRA_DIST = check.sh create-zpool.sh load-zfs.sh unload-zfs.sh -EXTRA_DIST += profile-kpios-disk.sh profile-kpios-pids.sh -EXTRA_DIST += profile-kpios-post.sh profile-kpios-pre.sh profile-kpios.sh -EXTRA_DIST += survey.sh update-zfs.sh zpios-jbod.sh zpios.sh +EXTRA_DIST = update-zfs.sh check.sh +EXTRA_DIST += load-zfs.sh unload-zfs.sh create-zpool.sh check: ./check.sh - diff --git a/zfs/lib/Makefile.in b/zfs/lib/Makefile.in deleted file mode 100644 index 0812d28329..0000000000 --- a/zfs/lib/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -subdir-m += libuutil # User space util support -subdir-m += libzfs # User space library support -subdir-m += libspl # User space compatibility library -subdir-m += libavl # Kernel &| User space AVL tree support -subdir-m += libnvpair # Kernel &| User space name/value support -subdir-m += libzcommon # Kernel &| User space common support -#subdir-m += libzpool # Kernel | User SPA/DMU/ZVOL/ZPL - diff --git a/zfs/lib/libavl/Makefile.in b/zfs/lib/libavl/Makefile.in deleted file mode 100644 index d8a5954bda..0000000000 --- a/zfs/lib/libavl/Makefile.in +++ /dev/null @@ -1,30 +0,0 @@ -subdir-m += include -DISTFILES = avl.c - -MODULE := zavl -LIBRARY := libavl - -# Compile as kernel module. Needed symlinks created for all -# k* objects created by top level configure script. - -EXTRA_CFLAGS = @KERNELCPPFLAGS@ -EXTRA_CFLAGS += -I@LIBDIR@/libavl/include - -obj-m := ${MODULE}.o - -${MODULE}-objs += kavl.o # Generic AVL support - -# Compile as shared library. There's an extra useless host program -# here called 'zu' because it was the easiest way I could convince -# the kernel build system to construct a user space shared library. - -HOSTCFLAGS += @HOSTCFLAGS@ -HOSTCFLAGS += -I@LIBDIR@/libspl/include -HOSTCFLAGS += -I@LIBDIR@/libavl/include - -hostprogs-y := zu -always := $(hostprogs-y) - -zu-objs := zu.o ${LIBRARY}.so - -${LIBRARY}-objs += uavl.o diff --git a/zfs/lib/libavl/zu.c b/zfs/lib/libavl/zu.c deleted file mode 100644 index 31dbf45bf9..0000000000 --- a/zfs/lib/libavl/zu.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(void) -{ - return 0; -} diff --git a/zfs/lib/libnvpair/Makefile.in b/zfs/lib/libnvpair/Makefile.in deleted file mode 100644 index f6f0937607..0000000000 --- a/zfs/lib/libnvpair/Makefile.in +++ /dev/null @@ -1,33 +0,0 @@ -subdir-m += include -DISTFILES = libnvpair.c nvpair.c nvpair_alloc_fixed.c nvpair_alloc_system.c - -MODULE := znvpair -LIBRARY := libnvpair - -# Compile as kernel module. Needed symlinks created for all -# k* objects created by top level configure script. - -EXTRA_CFLAGS = @KERNELCPPFLAGS@ -EXTRA_CFLAGS += -I@LIBDIR@/libnvpair/include - -obj-m := ${MODULE}.o - -${MODULE}-objs += knvpair.o # Interfaces name/value pairs -${MODULE}-objs += nvpair_alloc_spl.o # Generic alloc/free support - -# Compile as shared library. There's an extra useless host program -# here called 'zu' because it was the easiest way I could convince -# the kernel build system to construct a user space shared library. - -HOSTCFLAGS += @HOSTCFLAGS@ -HOSTCFLAGS += -I@LIBDIR@/libspl/include -HOSTCFLAGS += -I@LIBDIR@/libnvpair/include - -hostprogs-y := zu -always := $(hostprogs-y) - -zu-objs := zu.o ${LIBRARY}.so - -${LIBRARY}-objs += unvpair.o -${LIBRARY}-objs += nvpair_alloc_system.o -${LIBRARY}-objs += libnvpair.o diff --git a/zfs/lib/libnvpair/zu.c b/zfs/lib/libnvpair/zu.c deleted file mode 100644 index 31dbf45bf9..0000000000 --- a/zfs/lib/libnvpair/zu.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(void) -{ - return 0; -} diff --git a/zfs/lib/libspl/Makefile.in b/zfs/lib/libspl/Makefile.in deleted file mode 100644 index 0af8bf556e..0000000000 --- a/zfs/lib/libspl/Makefile.in +++ /dev/null @@ -1,23 +0,0 @@ -subdir-m += include -DISTFILES = list.c mkdirp.c strlcpy.c strlcat.c strnlen.c u8_textprep.c - -LIBRARY := libspl - -# Compile as shared library. There's an extra useless host program -# here called 'zu' because it was the easiest way I could convince -# the kernel build system to construct a user space shared library. - -HOSTCFLAGS += @HOSTCFLAGS@ -HOSTCFLAGS += -I@LIBDIR@/libspl/include - -hostprogs-y := zu -always := $(hostprogs-y) - -zu-objs := zu.o ${LIBRARY}.so - -${LIBRARY}-objs += mkdirp.o -${LIBRARY}-objs += strlcpy.o -${LIBRARY}-objs += list.o -${LIBRARY}-objs += strlcat.o -${LIBRARY}-objs += strnlen.o -${LIBRARY}-objs += u8_textprep.o diff --git a/zfs/lib/libspl/zu.c b/zfs/lib/libspl/zu.c deleted file mode 100644 index 31dbf45bf9..0000000000 --- a/zfs/lib/libspl/zu.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(void) -{ - return 0; -} diff --git a/zfs/lib/libuutil/zu.c b/zfs/lib/libuutil/zu.c deleted file mode 100644 index 31dbf45bf9..0000000000 --- a/zfs/lib/libuutil/zu.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(void) -{ - return 0; -} diff --git a/zfs/lib/libzfs/zu.c b/zfs/lib/libzfs/zu.c deleted file mode 100644 index 31dbf45bf9..0000000000 --- a/zfs/lib/libzfs/zu.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(void) -{ - return 0; -} diff --git a/zfs/lib/libzpool/zu.c b/zfs/lib/libzpool/zu.c deleted file mode 100644 index 31dbf45bf9..0000000000 --- a/zfs/lib/libzpool/zu.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(void) -{ - return 0; -}