]> git.proxmox.com Git - mirror_spl-debian.git/blobdiff - config/spl-build.m4
Imported Upstream version 0.6.2
[mirror_spl-debian.git] / config / spl-build.m4
index 233eea0049bff18a268df6bd524835ccc1d49493..f54c5b166bb8eac72143d7d6988608dcbbecbc60 100644 (file)
@@ -33,6 +33,8 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        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
@@ -71,6 +73,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        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
@@ -105,7 +108,7 @@ 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
@@ -156,7 +159,7 @@ AC_DEFUN([SPL_AC_KERNEL], [
        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
 
@@ -229,10 +232,10 @@ AC_DEFUN([SPL_AC_CONFIG_USER], [])
 
 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 # 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.
@@ -1357,6 +1360,43 @@ AC_DEFUN([SPL_AC_GET_VMALLOC_INFO],
        ])
 ])
 
+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
@@ -1827,6 +1867,36 @@ AC_DEFUN([SPL_AC_CRED_STRUCT], [
        ])
 ])
 
+
+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 #
@@ -1834,8 +1904,15 @@ AC_DEFUN([SPL_AC_GROUPS_SEARCH],
        [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])