SPL_AC_TASK_CURR
SPL_AC_CTL_UNNUMBERED
SPL_AC_CTL_NAME
+ SPL_AC_VMALLOC_INFO
+ SPL_AC_PDE_DATA
SPL_AC_FLS64
SPL_AC_DEVICE_CREATE
SPL_AC_5ARGS_DEVICE_CREATE
SPL_AC_GET_ZONE_COUNTS
SPL_AC_USER_PATH_DIR
SPL_AC_SET_FS_PWD
- SPL_AC_2ARGS_SET_FS_PWD
+ SPL_AC_SET_FS_PWD_WITH_CONST
SPL_AC_2ARGS_VFS_UNLINK
SPL_AC_4ARGS_VFS_RENAME
SPL_AC_VFS_FSYNC
SPL_AC_INODE_TRUNCATE_RANGE
SPL_AC_FS_STRUCT_SPINLOCK
SPL_AC_CRED_STRUCT
+ SPL_AC_KUIDGID_T
SPL_AC_GROUPS_SEARCH
SPL_AC_PUT_TASK_STRUCT
SPL_AC_5ARGS_PROC_HANDLER
SPL_AC_SHRINK_CONTROL_STRUCT
SPL_AC_RWSEM_SPINLOCK_IS_RAW
SPL_AC_SCHED_RT_HEADER
+ SPL_AC_2ARGS_VFS_GETATTR
])
AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then
AC_MSG_ERROR([
*** Please make sure the kernel devel package for your distribution
- *** is installed. If your building with a custom kernel make sure the
+ *** is installed. If you are building with a custom kernel, make sure the
*** kernel is configured, built, and the '--with-linux=PATH' configure
*** option refers to the location of the kernel source.])
fi
if test ! -d "$kernelsrc"; then
AC_MSG_ERROR([
*** Please make sure the kernel devel package for your distribution
- *** is installed then try again. If that fails you can specify the
+ *** is installed and then try again. If that fails, you can specify the
*** location of the kernel source with the '--with-linux=PATH' option.])
fi
dnl #
dnl # Check for rpm+rpmbuild to build RPM packages. If these tools
-dnl # are missing it is non-fatal but you will not be able to build
+dnl # are missing, it is non-fatal, but you will not be able to build
dnl # RPM packages and will be warned if you try too.
dnl #
+dnl # By default, the generic spec file will be used because it requires
+dnl # minimal dependencies. Distribution specific spec files can be
+dnl # placed under the 'rpm/<distribution>' directory and enabled using
+dnl # the --with-spec=<distribution> configure option.
+dnl #
AC_DEFUN([SPL_AC_RPM], [
RPM=rpm
RPMBUILD=rpmbuild
AC_MSG_RESULT([$HAVE_RPMBUILD])
])
+ RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1" --define "$(DEBUG_LOG) 1" --define "$(DEBUG_KMEM) 1" --define "$(DEBUG_KMEM_TRACKING) 1"'
+ RPM_DEFINE_UTIL=
+ RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"'
+ RPM_DEFINE_DKMS=
+
+ SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
+ SRPM_DEFINE_UTIL=
+ SRPM_DEFINE_KMOD=
+ SRPM_DEFINE_DKMS=
+
+ RPM_SPEC_DIR="rpm/generic"
+ AC_ARG_WITH([spec],
+ AS_HELP_STRING([--with-spec=SPEC],
+ [Spec files 'generic|fedora']),
+ [RPM_SPEC_DIR="rpm/$withval"])
+
+ AC_MSG_CHECKING([whether spec files are available])
+ AC_MSG_RESULT([yes ($RPM_SPEC_DIR/*.spec.in)])
+
AC_SUBST(HAVE_RPM)
AC_SUBST(RPM)
AC_SUBST(RPM_VERSION)
AC_SUBST(HAVE_RPMBUILD)
AC_SUBST(RPMBUILD)
AC_SUBST(RPMBUILD_VERSION)
+
+ AC_SUBST(RPM_SPEC_DIR)
+ AC_SUBST(RPM_DEFINE_UTIL)
+ AC_SUBST(RPM_DEFINE_KMOD)
+ AC_SUBST(RPM_DEFINE_DKMS)
+ AC_SUBST(RPM_DEFINE_COMMON)
+ AC_SUBST(SRPM_DEFINE_UTIL)
+ AC_SUBST(SRPM_DEFINE_KMOD)
+ AC_SUBST(SRPM_DEFINE_DKMS)
+ AC_SUBST(SRPM_DEFINE_COMMON)
])
dnl #
])
])
+dnl #
+dnl # 3.10 API change,
+dnl # struct vmalloc_info is now declared in linux/vmalloc.h
+dnl #
+AC_DEFUN([SPL_AC_VMALLOC_INFO], [
+ AC_MSG_CHECKING([whether struct vmalloc_info is declared])
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/vmalloc.h>
+ struct vmalloc_info { void *a; };
+ ],[
+ return 0;
+ ],[
+ AC_MSG_RESULT(no)
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_VMALLOC_INFO, 1, [yes])
+ ])
+])
+
+dnl #
+dnl # 3.10 API change,
+dnl # PDE is replaced by PDE_DATA
+dnl #
+AC_DEFUN([SPL_AC_PDE_DATA], [
+ AC_MSG_CHECKING([whether PDE_DATA() is available])
+ SPL_LINUX_TRY_COMPILE_SYMBOL([
+ #include <linux/proc_fs.h>
+ ], [
+ PDE_DATA(NULL);
+ ], [PDE_DATA], [], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_PDE_DATA, 1, [yes])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
+
dnl #
dnl # 2.6.17 API change
dnl # The helper functions first_online_pgdat(), next_online_pgdat(), and
])
dnl #
-dnl # 2.6.25 API change,
-dnl # Simplied API by replacing mnt+dentry args with a single path arg.
+dnl # 3.9 API change
+dnl # set_fs_pwd takes const struct path *
dnl #
-AC_DEFUN([SPL_AC_2ARGS_SET_FS_PWD],
- [AC_MSG_CHECKING([whether set_fs_pwd() wants 2 args])
+AC_DEFUN([SPL_AC_SET_FS_PWD_WITH_CONST],
+ tmp_flags="$EXTRA_KCFLAGS"
+ EXTRA_KCFLAGS="-Werror"
+ [AC_MSG_CHECKING([whether set_fs_pwd() requires const struct path *])
SPL_LINUX_TRY_COMPILE([
- #include <linux/sched.h>
+ #include <linux/spinlock.h>
#include <linux/fs_struct.h>
+ #include <linux/path.h>
+ void (*const set_fs_pwd_func)
+ (struct fs_struct *, const struct path *)
+ = set_fs_pwd;
],[
- set_fs_pwd(NULL, NULL);
+ return 0;
],[
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_2ARGS_SET_FS_PWD, 1,
- [set_fs_pwd() wants 2 args])
- ],[
- AC_MSG_RESULT(no)
+ AC_DEFINE(HAVE_SET_FS_PWD_WITH_CONST, 1,
+ [set_fs_pwd() needs const path *])
+ ],[
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/spinlock.h>
+ #include <linux/fs_struct.h>
+ #include <linux/path.h>
+ void (*const set_fs_pwd_func)
+ (struct fs_struct *, struct path *)
+ = set_fs_pwd;
+ ],[
+ return 0;
+ ],[
+ AC_MSG_RESULT(no)
+ ],[
+ AC_MSG_ERROR(unknown)
+ ])
])
+ EXTRA_KCFLAGS="$tmp_flags"
])
dnl #
])
])
+
+dnl #
+dnl # User namespaces, use kuid_t in place of uid_t
+dnl # where available. Not strictly a user namespaces thing
+dnl # but it should prevent surprises
+dnl #
+AC_DEFUN([SPL_AC_KUIDGID_T], [
+ AC_MSG_CHECKING([whether kuid_t/kgid_t is available])
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/uidgid.h>
+ ], [
+ kuid_t userid = KUIDT_INIT(0);
+ kgid_t groupid = KGIDT_INIT(0);
+ ],[
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/uidgid.h>
+ ], [
+ kuid_t userid = 0;
+ kgid_t groupid = 0;
+ ],[
+ AC_MSG_RESULT(yes; optional)
+ ],[
+ AC_MSG_RESULT(yes; mandatory)
+ AC_DEFINE(HAVE_KUIDGID_T, 1, [kuid_t/kgid_t in use])
+ ])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
+
dnl #
dnl # Custom SPL patch may export this symbol.
dnl #
[AC_MSG_CHECKING([whether groups_search() is available])
SPL_LINUX_TRY_COMPILE_SYMBOL([
#include <linux/cred.h>
+ #ifdef HAVE_KUIDGID_T
+ #include <linux/uidgid.h>
+ #endif
], [
+ #ifdef HAVE_KUIDGID_T
+ groups_search(NULL, KGIDT_INIT(0));
+ #else
groups_search(NULL, 0);
+ #endif
], [groups_search], [], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GROUPS_SEARCH, 1, [groups_search() is available])
AC_MSG_RESULT(no)
])
])
+
+dnl #
+dnl # 3.9 API change,
+dnl # vfs_getattr() uses 2 args
+dnl # It takes struct path * instead of struct vfsmount * and struct dentry *
+dnl #
+AC_DEFUN([SPL_AC_2ARGS_VFS_GETATTR], [
+ AC_MSG_CHECKING([whether vfs_getattr() wants])
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ vfs_getattr((struct path *) NULL,
+ (struct kstat *)NULL);
+ ],[
+ AC_MSG_RESULT(2 args)
+ AC_DEFINE(HAVE_2ARGS_VFS_GETATTR, 1,
+ [vfs_getattr wants 2 args])
+ ],[
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ vfs_getattr((struct vfsmount *)NULL,
+ (struct dentry *)NULL,
+ (struct kstat *)NULL);
+ ],[
+ AC_MSG_RESULT(3 args)
+ ],[
+ AC_MSG_ERROR(unknown)
+ ])
+ ])
+])