]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: restructure to match kernel layout
authorDave Chinner <dchinner@redhat.com>
Fri, 5 Jun 2015 00:13:30 +0000 (10:13 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 5 Jun 2015 00:13:30 +0000 (10:13 +1000)
The kernel now has a libxfs directory, so we need to restructure the
userspace libxfs source tree to match the kernel layout. This
involves changing the location of libxfs include files and how they
are linked into include/xfs for all the subdirectories to see them.

This is a bit convoluted as an initial conversion step - we move all
the libxfs headers files from include/ to libxfs/ and then add build
rules to symlink the files directly to include/xfs so everything
still "sees" the same header files. This changes the build
dependencies slightly, as libxfs now must be built after include
(unchanged) but before anything else (new) so that we have a
complete include/xfs directory. This also affects install and
packaging rules, as header install rules are now split across
include and libxfs Makefiles.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
33 files changed:
Makefile
include/Makefile
include/buildrules
libxfs/Makefile
libxfs/xfs_ag.h [moved from include/xfs_ag.h with 100% similarity]
libxfs/xfs_alloc.h [moved from include/xfs_alloc.h with 100% similarity]
libxfs/xfs_alloc_btree.h [moved from include/xfs_alloc_btree.h with 100% similarity]
libxfs/xfs_attr_leaf.h [moved from include/xfs_attr_leaf.h with 100% similarity]
libxfs/xfs_attr_remote.h [moved from include/xfs_attr_remote.h with 100% similarity]
libxfs/xfs_attr_sf.h [moved from include/xfs_attr_sf.h with 100% similarity]
libxfs/xfs_bit.h [moved from include/xfs_bit.h with 100% similarity]
libxfs/xfs_bmap.h [moved from include/xfs_bmap.h with 100% similarity]
libxfs/xfs_bmap_btree.h [moved from include/xfs_bmap_btree.h with 100% similarity]
libxfs/xfs_btree.h [moved from include/xfs_btree.h with 100% similarity]
libxfs/xfs_cksum.h [moved from include/xfs_cksum.h with 100% similarity]
libxfs/xfs_da_btree.h [moved from include/xfs_da_btree.h with 100% similarity]
libxfs/xfs_da_format.h [moved from include/xfs_da_format.h with 100% similarity]
libxfs/xfs_dinode.h [moved from include/xfs_dinode.h with 100% similarity]
libxfs/xfs_dir2.h [moved from include/xfs_dir2.h with 100% similarity]
libxfs/xfs_format.h [moved from include/xfs_format.h with 100% similarity]
libxfs/xfs_fs.h [moved from include/xfs_fs.h with 100% similarity]
libxfs/xfs_ialloc.h [moved from include/xfs_ialloc.h with 100% similarity]
libxfs/xfs_ialloc_btree.h [moved from include/xfs_ialloc_btree.h with 100% similarity]
libxfs/xfs_inode_buf.h [moved from include/xfs_inode_buf.h with 100% similarity]
libxfs/xfs_inode_fork.h [moved from include/xfs_inode_fork.h with 100% similarity]
libxfs/xfs_inum.h [moved from include/xfs_inum.h with 100% similarity]
libxfs/xfs_log_format.h [moved from include/xfs_log_format.h with 100% similarity]
libxfs/xfs_quota_defs.h [moved from include/xfs_quota_defs.h with 100% similarity]
libxfs/xfs_sb.h [moved from include/xfs_sb.h with 100% similarity]
libxfs/xfs_shared.h [moved from include/xfs_shared.h with 100% similarity]
libxfs/xfs_trans_resv.h [moved from include/xfs_trans_resv.h with 100% similarity]
libxfs/xfs_trans_space.h [moved from include/xfs_trans_space.h with 100% similarity]
libxfs/xfs_types.h [moved from include/xfs_types.h with 100% similarity]

index f56aebd9cb4db6f58c5de669e1e86a556c77913d..d04f853b652e7bc3c3cf2062a21b5344e096cf3f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,9 @@ LDIRDIRT = $(SRCDIR)
 LDIRT += $(SRCTAR)
 endif
 
-LIB_SUBDIRS = libxfs libxlog libxcmd libhandle libdisk
+
+DLIB_SUBDIRS = libxlog libxcmd libhandle libdisk
+LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS)
 TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \
                mdrestore repair rtcp m4 man doc po debian
 
@@ -54,15 +56,16 @@ else
 endif
 
 # tool/lib dependencies
+# note: include/xfs is set up by libxfs, too, so everything is dependent on it.
 $(LIB_SUBDIRS) $(TOOL_SUBDIRS): include
-copy mdrestore: libxfs
-db logprint: libxfs libxlog
+$(DLIB_SUBDIRS) $(TOOL_SUBDIRS): libxfs
+db logprint: libxlog
 fsr: libhandle
-growfs: libxfs libxcmd
+growfs: libxcmd
 io: libxcmd libhandle
-mkfs: libxfs
 quota: libxcmd
-repair: libxfs libxlog
+repair: libxlog
+
 
 ifneq ($(ENABLE_BLKID), yes)
 mkfs: libdisk
index a867516c8a6d0a5a2da0f11616e65b5ccf698182..7976bf5d150a5f2042fa984b8e328e44a3375691 100644 (file)
@@ -21,46 +21,39 @@ include $(TOPDIR)/include/builddefs
 QAHFILES = libxfs.h libxlog.h \
        atomic.h bitops.h cache.h kmem.h list.h hlist.h parent.h radix-tree.h \
        swab.h \
-       xfs_ag.h xfs_alloc.h xfs_alloc_btree.h xfs_arch.h xfs_attr_leaf.h \
-       xfs_attr_sf.h xfs_bit.h xfs_bmap.h xfs_bmap_btree.h xfs_btree.h \
-       xfs_attr_remote.h \
+       xfs_arch.h \
        xfs_btree_trace.h \
-       xfs_cksum.h \
-       xfs_da_btree.h \
-       xfs_da_format.h \
-       xfs_dinode.h \
-       xfs_dir2.h \
-       xfs_format.h \
-       xfs_ialloc.h \
-       xfs_ialloc_btree.h \
-       xfs_inode_buf.h \
-       xfs_inode_fork.h \
-       xfs_inum.h \
-       xfs_log_format.h \
        xfs_log_recover.h \
        xfs_metadump.h \
-       xfs_quota_defs.h \
-       xfs_sb.h \
-       xfs_shared.h \
-       xfs_trace.h \
-       xfs_trans_resv.h \
-       xfs_trans_space.h
+       xfs_trace.h
 
-HFILES = handle.h jdm.h xqm.h xfs.h xfs_fs.h xfs_types.h
+HFILES = handle.h jdm.h xqm.h xfs.h
 HFILES += $(PKG_PLATFORM).h
 PHFILES = darwin.h freebsd.h irix.h linux.h gnukfreebsd.h
 DKHFILES = volume.h fstyp.h dvh.h
+LIBHFILES = command.h input.h path.h project.h
 LSRCFILES = $(shell echo $(PHFILES) | sed -e "s/$(PKG_PLATFORM).h//g")
 LSRCFILES += platform_defs.h.in builddefs.in buildmacros buildrules install-sh
-LSRCFILES += $(DKHFILES) command.h input.h path.h project.h
-LDIRT = xfs disk
+LSRCFILES += $(DKHFILES) $(LIBHFILES)
+LDIRT = disk
+LDIRDIRT = xfs
 
-default install: xfs disk
+default install: .xfs disk
 
-xfs disk:
+disk:
        @echo "    [LN]     $@"
        $(Q)$(LN_S) . $@
 
+# set up include/xfs header directory
+.xfs: $(addsuffix -hdrs, $(HFILES) $(QAHFILES) $(PHFILES) $(DKHFILES) $(LIBHFILES))
+
+%-hdrs: xfs
+       $(Q)$(LN_S) -f $(PWD)/include/$* xfs/$*
+
+xfs:
+       @mkdir -p xfs
+
+
 include $(BUILDRULES)
 
 install-dev: default
@@ -70,3 +63,4 @@ install-dev: default
 
 install-qa: install-dev
        $(INSTALL) -m 644 $(QAHFILES) $(PKG_INC_DIR)
+
index 399635e0c37312d148f09a118f9f04b85dea3692..dbd9e10a7045ffe08b2fb5d206e583c9e1993c27 100644 (file)
@@ -94,7 +94,7 @@ MAKEDEP := $(MAKEDEPEND) $(CFLAGS)
 ltdepend: rmltdep .ltdep
 
 rmltdep:
-       @rm -f .ltdep
+       $(Q)rm -f .ltdep
 
 .ltdep: $(CFILES) $(HFILES)
        $(Q)$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' > .ltdep
@@ -102,7 +102,7 @@ rmltdep:
 depend: rmdep .dep
 
 rmdep:
-       @rm -f .dep
+       $(Q)rm -f .dep
 
 .dep: $(CFILES) $(HFILES)
        $(Q)$(MAKEDEP) $(CFILES) > .dep
index b44599839408a791793279a4d84d5b34421eeafb..801282389ccabc9d66ad78ece13ac28b51b6bc3d 100644 (file)
@@ -10,7 +10,46 @@ LT_CURRENT = 0
 LT_REVISION = 0
 LT_AGE = 0
 
-HFILES = xfs.h init.h xfs_dir2_priv.h crc32defs.h crc32table.h
+# headers to install in include/xfs
+PKGHFILES = xfs_fs.h \
+       xfs_types.h
+
+# headers with build dependencies
+HFILES = xfs.h \
+       init.h \
+       crc32defs.h \
+       crc32table.h \
+       xfs_dir2_priv.h \
+
+# headers installed in QA targets
+QAHFILES = xfs_ag.h \
+       xfs_alloc.h \
+       xfs_alloc_btree.h \
+       xfs_attr_leaf.h \
+       xfs_attr_sf.h \
+       xfs_bit.h \
+       xfs_bmap.h \
+       xfs_bmap_btree.h \
+       xfs_btree.h \
+       xfs_attr_remote.h \
+       xfs_cksum.h \
+       xfs_da_btree.h \
+       xfs_da_format.h \
+       xfs_dinode.h \
+       xfs_dir2.h \
+       xfs_format.h \
+       xfs_ialloc.h \
+       xfs_ialloc_btree.h \
+       xfs_inode_buf.h \
+       xfs_inode_fork.h \
+       xfs_inum.h \
+       xfs_log_format.h \
+       xfs_quota_defs.h \
+       xfs_sb.h \
+       xfs_shared.h \
+       xfs_trans_resv.h \
+       xfs_trans_space.h
+
 CFILES = cache.c \
        crc32.c \
        init.c kmem.c logitem.c radix-tree.c rdwr.c trans.c util.c \
@@ -64,7 +103,7 @@ DEBUG = -DNDEBUG
 
 LDIRT = gen_crc32table crc32table.h crc32selftest
 
-default: crc32selftest ltdepend $(LTLIBRARY)
+default: xfs crc32selftest ltdepend $(LTLIBRARY)
 
 crc32table.h: gen_crc32table.c
        @echo "    [CC]     gen_crc32table"
@@ -82,12 +121,21 @@ crc32selftest: gen_crc32table.c crc32table.h crc32.c
        $(Q) $(CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@
        $(Q) ./$@
 
+# set up include/xfs header directory
+xfs: $(addsuffix -hdrs, $(PKGHFILES) $(QAHFILES))
+
+%-hdrs:
+       $(Q)$(LN_S) -f $(PWD)/libxfs/$* $(TOPDIR)/include/xfs/$*
+
 include $(BUILDRULES)
 
 install: default
 
-install-dev: default
+install-dev: install
+       $(INSTALL) -m 644 $(HFILES) $(PKG_INC_DIR)
 
-install-qa: default
+install-qa: install-dev
+       $(INSTALL) -m 644 $(QAHFILES) $(PKG_INC_DIR)
 
 -include .ltdep
+
similarity index 100%
rename from include/xfs_ag.h
rename to libxfs/xfs_ag.h
similarity index 100%
rename from include/xfs_alloc.h
rename to libxfs/xfs_alloc.h
similarity index 100%
rename from include/xfs_attr_sf.h
rename to libxfs/xfs_attr_sf.h
similarity index 100%
rename from include/xfs_bit.h
rename to libxfs/xfs_bit.h
similarity index 100%
rename from include/xfs_bmap.h
rename to libxfs/xfs_bmap.h
similarity index 100%
rename from include/xfs_btree.h
rename to libxfs/xfs_btree.h
similarity index 100%
rename from include/xfs_cksum.h
rename to libxfs/xfs_cksum.h
similarity index 100%
rename from include/xfs_da_btree.h
rename to libxfs/xfs_da_btree.h
similarity index 100%
rename from include/xfs_dinode.h
rename to libxfs/xfs_dinode.h
similarity index 100%
rename from include/xfs_dir2.h
rename to libxfs/xfs_dir2.h
similarity index 100%
rename from include/xfs_format.h
rename to libxfs/xfs_format.h
similarity index 100%
rename from include/xfs_fs.h
rename to libxfs/xfs_fs.h
similarity index 100%
rename from include/xfs_ialloc.h
rename to libxfs/xfs_ialloc.h
similarity index 100%
rename from include/xfs_inum.h
rename to libxfs/xfs_inum.h
similarity index 100%
rename from include/xfs_sb.h
rename to libxfs/xfs_sb.h
similarity index 100%
rename from include/xfs_shared.h
rename to libxfs/xfs_shared.h
similarity index 100%
rename from include/xfs_types.h
rename to libxfs/xfs_types.h