]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Make license compatibility checks consistent
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 3 Oct 2014 17:58:47 +0000 (10:58 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 17 Oct 2014 21:58:38 +0000 (14:58 -0700)
Apply the license specified in the META file to ensure the
compatibility checks are all performed consistently.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2757

META
config/kernel-acl.m4
config/kernel-blk-end-request.m4
config/kernel-blk-queue-flush.m4
config/kernel-blk-rq-bytes.m4
config/kernel.m4

diff --git a/META b/META
index 2a3cd3cfadf68879355d4a35ffbee54e2a69153d..5c82b23f45edf8b8b85c0b3945e59dec43fca34f 100644 (file)
--- a/META
+++ b/META
@@ -5,4 +5,4 @@ Version:      0.6.3
 Release:      1
 Release-Tags: relext
 License:      CDDL
-Author:       Sun Microsystems/Oracle, Lawrence Livermore National Laboratory
+Author:       OpenZFS on Linux
index a03ee5bffa8e26ca5a1b79502c0c53802fdccb01..1cb28b25a6f4dd58d791073e7ee7c365ced26a88 100644 (file)
@@ -1,6 +1,6 @@
 dnl #
-dnl # Check if posix_acl_release can be used from a CDDL module,
-dnl # The is_owner_or_cap macro was replaced by
+dnl # Check if posix_acl_release can be used from a ZFS_META_LICENSED
+dnl # module.  The is_owner_or_cap macro was replaced by
 dnl # inode_owner_or_capable
 dnl #
 AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
@@ -26,7 +26,7 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
                #include <linux/fs.h>
                #include <linux/posix_acl.h>
 
-               MODULE_LICENSE("CDDL");
+               MODULE_LICENSE("$ZFS_META_LICENSE");
        ],[
                struct posix_acl* tmp = posix_acl_alloc(1, 0);
                posix_acl_release(tmp);
index ca0a042840bf3076c741af657844658dff1fa86f..c2980e59364394d31ebc6b6340123fad8d570ff8 100644 (file)
@@ -25,7 +25,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_END_REQUEST], [
                #include <linux/module.h>
                #include <linux/blkdev.h>
                
-               MODULE_LICENSE("CDDL");
+               MODULE_LICENSE("$ZFS_META_LICENSE");
        ],[
                struct request *req = NULL;
                (void) blk_end_request(req, 0, 0);
index 261174735d9248760e17811873889ca20a4aa839..bb74ea1c59459a34ebfc9947373f9f234502ed8d 100644 (file)
@@ -31,7 +31,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
                #include <linux/module.h>
                #include <linux/blkdev.h>
 
-               MODULE_LICENSE("CDDL");
+               MODULE_LICENSE("$ZFS_META_LICENSE");
        ],[
                struct request_queue *q = NULL;
                (void) blk_queue_flush(q, REQ_FLUSH);
index a95f8a8ea390484368f44f36594aabeb7b9fe7ca..bedbcc6e33db153d18f971469f76c6848eba4d54 100644 (file)
@@ -26,7 +26,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_RQ_BYTES], [
                #include <linux/module.h>
                #include <linux/blkdev.h>
 
-               MODULE_LICENSE("CDDL");
+               MODULE_LICENSE("$ZFS_META_LICENSE");
        ],[
                struct request *req = NULL;
                (void) blk_rq_bytes(req);
index 67a4ef6d29048a0dcbd8393a34a1e5e7ff5fcf54..909415fd3211ba8adfbd708ff40cf4c5289f013e 100644 (file)
@@ -420,8 +420,8 @@ AC_DEFUN([ZFS_AC_SPL], [
 dnl #
 dnl # Basic toolchain sanity check.
 dnl #
-AC_DEFUN([ZFS_AC_TEST_MODULE],
-       [AC_MSG_CHECKING([whether modules can be built])
+AC_DEFUN([ZFS_AC_TEST_MODULE], [
+       AC_MSG_CHECKING([whether modules can be built])
        ZFS_LINUX_TRY_COMPILE([],[],[
                AC_MSG_RESULT([yes])
        ],[
@@ -442,10 +442,16 @@ dnl # detected at configure time and cause a build failure.  Otherwise
 dnl # modules may be successfully built that behave incorrectly.
 dnl #
 AC_DEFUN([ZFS_AC_KERNEL_CONFIG], [
-
-       AS_IF([test "$ZFS_META_LICENSE" = GPL], [
-               AC_DEFINE([HAVE_GPL_ONLY_SYMBOLS], [1],
-                       [Define to 1 if licensed under the GPL])
+       AC_RUN_IFELSE([
+               AC_LANG_PROGRAM([
+                       #include "$LINUX/include/linux/license.h"
+               ], [
+                       return !license_is_gpl_compatible("$ZFS_META_LICENSE");
+               ])
+       ], [
+               AC_DEFINE([ZFS_IS_GPL_COMPATIBLE], [1],
+                   [Define to 1 if GPL-only symbols can be used])
+       ], [
        ])
 
        ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC