aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorTurbo Fredriksson <[email protected]>2014-06-09 23:55:31 +0200
committerBrian Behlendorf <[email protected]>2015-07-17 13:42:51 -0700
commit47a4a6fd5fa1f1f60bcf6af19e453ecf0292f7d1 (patch)
tree00c149a4fc58c4a0467c3ef68fbc29628966aa2b /config
parent2a53e2dacc7a7c0a8c63ff2eef3aff95f6ac80b1 (diff)
Support parallel build trees (VPATH builds)
Build products from an out of tree build should be written relative to the build directory. Sources should be referred to by their locations in the source directory. This is accomplished by adding the 'src' and 'obj' variables for the module Makefile.am, using relative paths to reference source files, and by setting VPATH when source files are not co-located with the Makefile. This enables the following: $ mkdir build $ cd build $ ../configure \ --with-spl=$HOME/src/git/spl/ \ --with-spl-obj=$HOME/src/git/spl/build $ make -s This change also has the advantage of resolving the following warning which is generated by modern versions of automake. Makefile.am:00: warning: source file 'xxx' is in a subdirectory, Makefile.am:00: but option 'subdir-objects' is disabled Signed-off-by: Turbo Fredriksson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1082
Diffstat (limited to 'config')
-rw-r--r--config/kernel.m42
-rw-r--r--config/rpm.am2
2 files changed, 3 insertions, 1 deletions
diff --git a/config/kernel.m4 b/config/kernel.m4
index 5c97659c7..8e8922ec7 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -338,6 +338,8 @@ AC_DEFUN([ZFS_AC_SPL], [
splbuild="${splsrc}/${LINUX_VERSION}"
], [ test -e "${splsrc}/spl_config.h" ], [
splbuild="${splsrc}"
+ ], [ find -L "${splsrc}" -name spl_config.h 2> /dev/null | grep -wq spl_config.h ], [
+ splbuild=$(find -L "${splsrc}" -name spl_config.h | sed 's,/spl_config.h,,')
], [
splbuild="[Not found]"
])
diff --git a/config/rpm.am b/config/rpm.am
index 311c754d4..51a20b3e6 100644
--- a/config/rpm.am
+++ b/config/rpm.am
@@ -51,7 +51,7 @@ rpm-local:
mkdir -p $(rpmbuild)/SPECS && \
cp ${RPM_SPEC_DIR}/$(rpmspec) $(rpmbuild)/SPECS && \
mkdir -p $(rpmbuild)/SOURCES && \
- cp scripts/kmodtool $(rpmbuild)/SOURCES && \
+ cp $(top_srcdir)/scripts/kmodtool $(rpmbuild)/SOURCES && \
cp $(distdir).tar.gz $(rpmbuild)/SOURCES)
srpm-common: dist