From d59f314b110088fccab706033fd78e44b0e568b9 Mon Sep 17 00:00:00 2001 From: Minh Diep Date: Thu, 24 May 2012 13:06:58 -0700 Subject: [PATCH] LU-1398 build: Module.symvers dependencies 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 Change-Id: I5333e226f69ca75b6a959cc1ed673d640da22b23 Reviewed-on: http://review.whamcloud.com/2898 Tested-by: Hudson Reviewed-by: Brian J. Murrell Reviewed-by: Brian Behlendorf Tested-by: Maloo Reviewed-by: Andreas Dilger --- autoMakefile.am | 42 +++++++++++++++++++++--------------------- build/autoMakefile.am.toplevel | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/autoMakefile.am b/autoMakefile.am index de00088..a774f63 100644 --- a/autoMakefile.am +++ b/autoMakefile.am @@ -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 diff --git a/build/autoMakefile.am.toplevel b/build/autoMakefile.am.toplevel index bd4c1d9..2dccfa4 100644 --- a/build/autoMakefile.am.toplevel +++ b/build/autoMakefile.am.toplevel @@ -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 -- 1.8.3.1