diff options
author | Brian Behlendorf <[email protected]> | 2009-03-05 09:08:07 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-03-09 15:56:55 -0700 |
commit | c5f704607bbdc5e6a89b4ac088dff16a6c1eeb5e (patch) | |
tree | 182cb70d67bde33e9697623ca0b0533985407528 /config | |
parent | 32f74c5280ca9a753991b97370e7c4c1a4e34ede (diff) |
Build system and packaging (RPM support)
An update to the build system to properly support all commonly
used Makefile targets these include:
make all # Build everything
make install # Install everything
make clean # Clean up build products
make distclean # Clean up everything
make dist # Create package tarball
make srpm # Create package source RPM
make rpm # Create package binary RPMs
make tags # Create ctags and etags for everything
Extra care was taken to ensure that the source RPMs are fully
rebuildable against Fedora/RHEL/Chaos kernels. To build binary
RPMs from the source RPM for your system simply run:
rpmbuild --rebuild spl-x.y.z-1.src.rpm
This will produce two binary RPMs with correct 'requires'
dependencies for your kernel. One will contain all spl modules
and support utilities, the other is a devel package for compiling
additional kernel modules which are dependant on the spl.
spl-x.y.z-1_<kernel version>.x86_64.rpm
spl-devel-x.y.2-1_<kernel version>.x86_64.rpm
Diffstat (limited to 'config')
-rw-r--r-- | config/spl-build.m4 | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4 index a90fb6170..b6e44a7f2 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -32,6 +32,10 @@ AC_DEFUN([SPL_AC_KERNEL], [ *** Please specify the location of the kernel source *** with the '--with-linux=PATH' option]) fi + else + if test "$kernelsrc" = "NONE"; then + kernsrcver=NONE + fi fi AC_MSG_RESULT([$kernelsrc]) @@ -65,13 +69,28 @@ AC_DEFUN([SPL_AC_KERNEL], [ AC_MSG_RESULT([$kernsrcver]) - kmoduledir=${INSTALL_MOD_PATH}/lib/modules/$kernsrcver LINUX=${kernelsrc} LINUX_OBJ=${kernelbuild} + LINUX_VERSION=${kernsrcver} + + abs_srcdir=`readlink -f ${srcdir}` + kerninclude="-I${abs_srcdir} -I${abs_srcdir}/include" + kernwarn="-Wstrict-prototypes -Werror" + + if test "${LINUX_OBJ}" != "${LINUX}"; then + kernobjs="O=$kernelbuild" + fi + + KERNELCFLAGS= + KERNELCPPFLAGS="${kerninclude} ${kernwarn}" + KERNELMAKE_PARAMS="${kernobjs}" AC_SUBST(LINUX) AC_SUBST(LINUX_OBJ) - AC_SUBST(kmoduledir) + AC_SUBST(LINUX_VERSION) + AC_SUBST(KERNELMAKE_PARAMS) + AC_SUBST(KERNELCPPFLAGS) + AC_SUBST(KERNELCFLAGS) ]) AC_DEFUN([SPL_AC_LICENSE], [ @@ -218,15 +237,15 @@ dnl # dnl # SPL_LINUX_COMPILE_IFELSE / like AC_COMPILE_IFELSE dnl # AC_DEFUN([SPL_LINUX_COMPILE_IFELSE], [ -m4_ifvaln([$1], [SPL_LINUX_CONFTEST([$1])])dnl -rm -f build/conftest.o build/conftest.mod.c build/conftest.ko build/Makefile -echo "obj-m := conftest.o" >build/Makefile -dnl AS_IF([AC_TRY_COMMAND(cp conftest.c build && make [$2] CC="$CC" -f $PWD/build/Makefile LINUXINCLUDE="-Iinclude -Iinclude2 -I$LINUX/include -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM SUBDIRS=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], -AS_IF([AC_TRY_COMMAND(cp conftest.c build && make [$2] CC="$CC" LINUXINCLUDE="-Iinclude -Iinclude2 -I$LINUX/include -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], - [$4], - [_AC_MSG_LOG_CONFTEST -m4_ifvaln([$5],[$5])dnl])dnl -rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o build/conftest.ko m4_ifval([$1], [build/conftest.c conftest.c])[]dnl + m4_ifvaln([$1], [SPL_LINUX_CONFTEST([$1])]) + rm -Rf build && mkdir -p build + echo "obj-m := conftest.o" >build/Makefile + AS_IF( + [AC_TRY_COMMAND(cp conftest.c build && make [$2] CC="$CC" LINUXINCLUDE="-Iinclude -Iinclude2 -I$LINUX/include -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], + [$4], + [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])] + ) + rm -Rf build ]) dnl # |