aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-07-01 14:37:44 -0700
committerBrian Behlendorf <[email protected]>2009-07-01 14:37:44 -0700
commit86933a6e510bb00edb097095ffe3deb7a4fbe533 (patch)
tree7dd7222aade1e316ca070476074683aa8ecba52b /config
parent5c3c70adece1ea8724cae0cf0c6cd164a4439f19 (diff)
Simplify rpm build rules, added config/rpm.am.
Distro friendly changes such that the kernel modules are packaged seperately.
Diffstat (limited to 'config')
-rw-r--r--config/rpm.am43
-rw-r--r--config/spl-build.m4146
2 files changed, 162 insertions, 27 deletions
diff --git a/config/rpm.am b/config/rpm.am
new file mode 100644
index 000000000..b1c832674
--- /dev/null
+++ b/config/rpm.am
@@ -0,0 +1,43 @@
+rpm-local:
+ mkdir -p $(rpmbuild)/TMP && \
+ mkdir -p $(rpmbuild)/BUILD && \
+ mkdir -p $(rpmbuild)/RPMS && \
+ mkdir -p $(rpmbuild)/SRPMS && \
+ mkdir -p $(rpmbuild)/SPECS && cp $(rpmspec) $(rpmbuild)/SPECS && \
+ mkdir -p $(rpmbuild)/SOURCES && cp $(distdir).tar.gz $(rpmbuild)/SOURCES
+
+srpm-common: dist
+ rpmpkg=$(pkg)-$(SPL_META_VERSION)-$(SPL_META_RELEASE).src.rpm; \
+ rpmspec=$(pkg).spec; \
+ rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ rpmbuild="$$rpmbuild" \
+ rpmspec="$$rpmspec" \
+ rpm-local || exit 1; \
+ /usr/bin/rpmbuild \
+ --define "_tmppath $$rpmbuild/TMP" \
+ --define "_topdir $$rpmbuild" \
+ --define "build_src_rpm 1" \
+ --define "dist %{nil}" \
+ --nodeps -bs $$rpmbuild/SPECS/$$rpmspec || exit 1; \
+ cp $$rpmbuild/SRPMS/$$rpmpkg . || exit 1; \
+ $(RM) -R $$rpmbuild
+
+rpm-common:
+ rpmpkg=$(pkg)-$(SPL_META_VERSION)-$(SPL_META_RELEASE).src.rpm; \
+ rpmspec=$(pkg).spec; \
+ rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ rpmbuild="$$rpmbuild" \
+ rpmspec="$$rpmspec" \
+ rpm-local || exit 1; \
+ /usr/bin/rpmbuild \
+ --define "_tmppath $$rpmbuild/TMP" \
+ --define "_topdir $$rpmbuild" \
+ --define "dist %{nil}" \
+ --define "require_kdir $(LINUX)" \
+ --define "require_kobj $(LINUX_OBJ)" \
+ --define "require_kver $(LINUX_VERSION)" \
+ --nodeps --rebuild $$rpmpkg || exit 1; \
+ cp $$rpmbuild/RPMS/*/* . || exit 1; \
+ $(RM) -R $$rpmbuild
diff --git a/config/spl-build.m4 b/config/spl-build.m4
index 2f277a3b3..134831978 100644
--- a/config/spl-build.m4
+++ b/config/spl-build.m4
@@ -1,3 +1,82 @@
+dnl #
+dnl # Default SPL kernel configuration
+dnl #
+AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
+ SPL_AC_KERNEL
+
+ dnl # Kernel build make options
+ dnl # KERNELMAKE_PARAMS="V=1" # Enable verbose module build
+ KERNELMAKE_PARAMS="V=1"
+
+ dnl # -Wall -fno-strict-aliasing -Wstrict-prototypes and other
+ dnl # compiler options are added by the kernel build system.
+ abs_srcdir=`readlink -f ${srcdir}`
+ KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes -Werror"
+ KERNELCPPFLAGS="$KERNELCPPFLAGS -I${abs_srcdir} -I${abs_srcdir}/include"
+
+ if test "${LINUX_OBJ}" != "${LINUX}"; then
+ KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
+ fi
+
+ AC_SUBST(KERNELMAKE_PARAMS)
+ AC_SUBST(KERNELCPPFLAGS)
+
+ SPL_AC_DEBUG
+ SPL_AC_DEBUG_KMEM
+ SPL_AC_DEBUG_MUTEX
+ SPL_AC_DEBUG_KSTAT
+ SPL_AC_DEBUG_CALLB
+ SPL_AC_TYPE_UINTPTR_T
+ SPL_AC_TYPE_ATOMIC64_T
+ SPL_AC_3ARGS_INIT_WORK
+ SPL_AC_2ARGS_REGISTER_SYSCTL
+ SPL_AC_SET_SHRINKER
+ SPL_AC_PATH_IN_NAMEIDATA
+ SPL_AC_TASK_CURR
+ SPL_AC_CTL_UNNUMBERED
+ SPL_AC_FLS64
+ SPL_AC_DEVICE_CREATE
+ SPL_AC_5ARGS_DEVICE_CREATE
+ SPL_AC_CLASS_DEVICE_CREATE
+ SPL_AC_SET_NORMALIZED_TIMESPEC_EXPORT
+ SPL_AC_SET_NORMALIZED_TIMESPEC_INLINE
+ SPL_AC_TIMESPEC_SUB
+ SPL_AC_INIT_UTSNAME
+ SPL_AC_FDTABLE_HEADER
+ SPL_AC_FILES_FDTABLE
+ SPL_AC_UACCESS_HEADER
+ SPL_AC_KMALLOC_NODE
+ SPL_AC_MONOTONIC_CLOCK
+ SPL_AC_INODE_I_MUTEX
+ SPL_AC_MUTEX_LOCK_NESTED
+ SPL_AC_DIV64_64
+ SPL_AC_DIV64_U64
+ SPL_AC_3ARGS_ON_EACH_CPU
+ SPL_AC_KALLSYMS_LOOKUP_NAME
+ SPL_AC_GET_VMALLOC_INFO
+ SPL_AC_PGDAT_HELPERS
+ SPL_AC_FIRST_ONLINE_PGDAT
+ SPL_AC_NEXT_ONLINE_PGDAT
+ SPL_AC_NEXT_ZONE
+ SPL_AC_PGDAT_LIST
+ SPL_AC_GET_ZONE_COUNTS
+ SPL_AC_GLOBAL_PAGE_STATE
+ SPL_AC_ZONE_STAT_ITEM_FIA
+ SPL_AC_2ARGS_VFS_UNLINK
+ SPL_AC_4ARGS_VFS_RENAME
+])
+
+AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
+ AC_MSG_CHECKING([kernel file name for module symbols])
+ if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost; then
+ LINUX_SYMBOLS=Modules.symvers
+ else
+ LINUX_SYMBOLS=Module.symvers
+ fi
+ AC_MSG_RESULT($LINUX_SYMBOLS)
+ AC_SUBST(LINUX_SYMBOLS)
+])
+
AC_DEFUN([SPL_AC_KERNEL], [
AC_ARG_WITH([linux],
AS_HELP_STRING([--with-linux=PATH],
@@ -72,41 +151,54 @@ AC_DEFUN([SPL_AC_KERNEL], [
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(LINUX_VERSION)
- AC_SUBST(KERNELMAKE_PARAMS)
- AC_SUBST(KERNELCPPFLAGS)
- AC_SUBST(KERNELCFLAGS)
-])
-AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
- AC_MSG_CHECKING([kernel file name for module symbols])
- if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost; then
- LINUX_SYMBOLS=Modules.symvers
- else
- LINUX_SYMBOLS=Module.symvers
- fi
- AC_MSG_RESULT($LINUX_SYMBOLS)
- AC_SUBST(LINUX_SYMBOLS)
+ SPL_AC_MODULE_SYMVERS
])
+dnl #
+dnl # Default SPL user configuration
+dnl #
+AC_DEFUN([SPL_AC_CONFIG_USER], [])
+
AC_DEFUN([SPL_AC_LICENSE], [
- AC_MSG_CHECKING([license])
- AC_MSG_RESULT([GPL])
+ AC_MSG_CHECKING([spl license])
+ LICENSE=GPL
+ AC_MSG_RESULT([$LICENSE])
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DHAVE_GPL_ONLY_SYMBOLS"
+ AC_SUBST(LICENSE)
+])
+
+AC_DEFUN([SPL_AC_CONFIG], [
+ SPL_CONFIG=all
+ AC_ARG_WITH([config],
+ AS_HELP_STRING([--with-config=CONFIG],
+ [Config file 'kernel|user|all']),
+ [SPL_CONFIG="$withval"])
+
+ AC_MSG_CHECKING([spl config])
+ AC_MSG_RESULT([$SPL_CONFIG]);
+ AC_SUBST(SPL_CONFIG)
+
+ case "$SPL_CONFIG" in
+ kernel) SPL_AC_CONFIG_KERNEL ;;
+ user) SPL_AC_CONFIG_USER ;;
+ all) SPL_AC_CONFIG_KERNEL
+ SPL_AC_CONFIG_USER ;;
+ *)
+ AC_MSG_RESULT([Error!])
+ AC_MSG_ERROR([Bad value "$SPL_CONFIG" for --with-config,
+ user kernel|user|all]) ;;
+ esac
+
+ AM_CONDITIONAL([CONFIG_USER],
+ [test "$SPL_CONFIG" = user] ||
+ [test "$SPL_CONFIG" = all])
+ AM_CONDITIONAL([CONFIG_KERNEL],
+ [test "$SPL_CONFIG" = kernel] ||
+ [test "$SPL_CONFIG" = all])
])
AC_DEFUN([SPL_AC_DEBUG], [