diff options
author | Brian Behlendorf <[email protected]> | 2014-09-29 16:01:22 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-10-17 15:07:28 -0700 |
commit | 62032954383dc6d1200890f07f56bb0ad85451be (patch) | |
tree | 6d500c46beefefbac4b25e336b3f62fe64e39eb1 /config | |
parent | de2a22fcb3e7e8d7c4f695aeb0caf9cdc8f82c9a (diff) |
Make license compatibility checks consistent
Apply the license specified in the META file to ensure the
compatibility checks are all performed consistently.
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'config')
-rw-r--r-- | config/spl-build.m4 | 23 | ||||
-rw-r--r-- | config/spl-meta.m4 | 8 |
2 files changed, 26 insertions, 5 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4 index 4b821e980..f9287e2de 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -426,11 +426,11 @@ AC_DEFUN([SPL_AC_PACKAGE], [ ]) AC_DEFUN([SPL_AC_LICENSE], [ + AC_MSG_CHECKING([spl author]) + AC_MSG_RESULT([$SPL_META_AUTHOR]) + AC_MSG_CHECKING([spl license]) - LICENSE=GPL - AC_MSG_RESULT([$LICENSE]) - KERNELCPPFLAGS="${KERNELCPPFLAGS} -DHAVE_GPL_ONLY_SYMBOLS" - AC_SUBST(LICENSE) + AC_MSG_RESULT([$SPL_META_LICENSE]) ]) AC_DEFUN([SPL_AC_CONFIG], [ @@ -737,7 +737,8 @@ AC_DEFUN([SPL_CHECK_HEADER], ]) dnl # -dnl # Basic toolchain sanity check. +dnl # Basic toolchain sanity check. Verify that kernel modules can +dnl # be built and which symbols can be used. dnl # AC_DEFUN([SPL_AC_TEST_MODULE], [AC_MSG_CHECKING([whether modules can be built]) @@ -753,6 +754,18 @@ AC_DEFUN([SPL_AC_TEST_MODULE], *** Please run 'make scripts' inside the kernel source tree.]) fi ]) + + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([ + #include "$LINUX/include/linux/license.h" + ], [ + return !license_is_gpl_compatible("$SPL_META_LICENSE"); + ]) + ], [ + AC_DEFINE([SPL_IS_GPL_COMPATIBLE], [1], + [Define to 1 if GPL-only symbols can be used]) + ], [ + ]) ]) dnl # diff --git a/config/spl-meta.m4 b/config/spl-meta.m4 index e98cc2ea6..0561fbbc5 100644 --- a/config/spl-meta.m4 +++ b/config/spl-meta.m4 @@ -76,6 +76,14 @@ AC_DEFUN([SPL_AC_META], [ AC_SUBST([RELEASE]) fi + SPL_META_LICENSE=_SPL_AC_META_GETVAL([License]); + if test -n "$SPL_META_LICENSE"; then + AC_DEFINE_UNQUOTED([SPL_META_LICENSE], ["$SPL_META_LICENSE"], + [Define the project license.] + ) + AC_SUBST([SPL_META_LICENSE]) + fi + if test -n "$SPL_META_NAME" -a -n "$SPL_META_VERSION"; then SPL_META_ALIAS="$SPL_META_NAME-$SPL_META_VERSION" test -n "$SPL_META_RELEASE" && |