Whamcloud - gitweb
LU-1398 build: Module.symvers dependencies
authorMinh Diep <mdiep@whamcloud.com>
Thu, 24 May 2012 20:06:58 +0000 (13:06 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 26 May 2012 16:12:28 +0000 (12:12 -0400)
Ensure a Module.symvers file is generated with the correct
symbols for the configured lustre backend filesystems. This
is accomplished by adding a generic module-symvers rule which
depends on a filesystem specific version of the rule.  When a
filesystem is not configured the result is an empty rule.

Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Change-Id: I5333e226f69ca75b6a959cc1ed673d640da22b23
Reviewed-on: http://review.whamcloud.com/2898
Tested-by: Hudson
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
autoMakefile.am
build/autoMakefile.am.toplevel

index de00088..a774f63 100644 (file)
@@ -1,12 +1,8 @@
 SUBDIRS := @LDISKFS_SUBDIR@ @SPL_SUBDIR@ @ZFS_SUBDIR@ . @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ @LUSTREIOKIT_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre
-DIST_SUBDIRS := @SNMP_DIST_SUBDIR@ libsysio ldiskfs lustre-iokit @LIBCFS_SUBDIR@ lnet lustre 
+DIST_SUBDIRS := @SNMP_DIST_SUBDIR@ libsysio ldiskfs lustre-iokit @LIBCFS_SUBDIR@ lnet lustre
 SOURCES_SUBDIRS := @LDISKFS_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre
 RPM_SUBDIRS := @LDISKFS_SUBDIR@ @LUSTREIOKIT_SUBDIR@
-if LDISKFS_ENABLED
-if !LDISKFS_IN_KERNEL
-SYMVERFILE_DEPENDECY := @SYMVERFILE@
-endif
-endif
+MODULE_SYMVERS_DEPS = module-symvers
 
 @TESTS_TRUE@BUILD_TESTS = true
 @TESTS_FALSE@BUILD_TESTS = false
@@ -23,17 +19,21 @@ if USES_DPKG
 EXTRA_DIST += debian/*
 endif
 
+module-symvers-ldiskfs:
 if LDISKFS_ENABLED
-if !LDISKFS_IN_KERNEL
-
-EXTRA_DIST += @SYMVERFILE@
+       @if [ -f @LDISKFS_DIR@/@SYMVERFILE@ ]; then \
+               cat @LDISKFS_DIR@/@SYMVERFILE@ >>@SYMVERFILE@; \
+       elif [ -f @LDISKFS_DIR@/ldiskfs/@SYMVERFILE@ ]; then \
+               cat @LDISKFS_DIR@/ldiskfs/@SYMVERFILE@ >>@SYMVERFILE@; \
+       else \
+               echo -e "\n" \
+               "*** Missing ldiskfs symbols. Ensure you have built ldiskfs:\n"\
+               "*** - @LDISKFS_OBJ@/ldiskfs/@SYMVERFILE@\n"; \
+               exit 1; \
+       fi
+endif # LDISKFS_ENABLED
 
-@SYMVERFILE@: @LDISKFS_DIR@/@SYMVERFILE@
-       touch @SYMVERFILE@
-       -grep -v ldiskfs @SYMVERFILE@ > @SYMVERFILE@.old
-       cat @SYMVERFILE@.old @LDISKFS_DIR@/@SYMVERFILE@ > @SYMVERFILE@
-endif
-endif
+module-symvers: module-symvers-ldiskfs
 
 CSTK=/tmp/checkstack
 CSTKO=/tmp/checkstack.orig
@@ -53,12 +53,12 @@ checkstack-clean:
 
 module-dist-hook:
        if [ -d CVS -o -d .git ]; then \
-           perl lustre/scripts/make_META.pl > $(distdir)/META; \
-           cp $(distdir)/META $(distdir)/ldiskfs/META; \
+               perl lustre/scripts/make_META.pl > $(distdir)/META; \
+               cp $(distdir)/META $(distdir)/ldiskfs/META; \
        elif [ -f META ]; then \
-           cp META $(distdir)/META; \
-           cp $(distdir)/META $(distdir)/ldiskfs/META; \
+               cp META $(distdir)/META; \
+               cp $(distdir)/META $(distdir)/ldiskfs/META; \
        else \
-           echo -e "I have no idea how to create a META file in $(distdir).\nPlease file a bug at http://bugzilla.lustre.org/"; \
-           exit 1; \
+               echo -e "I have no idea how to create a META file in $(distdir).\nPlease file a bug at http://bugzilla.lustre.org/"; \
+               exit 1; \
        fi
index bd4c1d9..2dccfa4 100644 (file)
@@ -50,7 +50,7 @@ doxygen-%: build/doxyfile.%
 if MODULES
 sources: all-sources
 
-all-sources: $(SYMVERFILE_DEPENDECY)
+all-sources: $(MODULE_SYMVERS_DEPS)
        for dir in $(SOURCES_SUBDIRS) ; do \
                $(MAKE) sources -C $$dir || exit $$? ; \
        done