From 4365c4442555d8a64c8a3bae4403cc322f5b5588 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 3 Feb 2009 09:59:54 -0800 Subject: [PATCH] Properly detect and set HAVE_GPL_ONLY_SYMBOLS based on license --- config/user-ioctl.m4 | 2 +- config/zfs-build.m4 | 11 +++++++---- configure.ac | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/config/user-ioctl.m4 b/config/user-ioctl.m4 index 453e0f1f60..53fb118fc8 100644 --- a/config/user-ioctl.m4 +++ b/config/user-ioctl.m4 @@ -2,7 +2,7 @@ dnl # dnl # Check for ioctl() dnl # AC_DEFUN([ZFS_AC_CONFIG_USER_IOCTL], [ - AC_MSG_CHECKING(checking for ioctl()) + AC_MSG_CHECKING(for ioctl()) AC_EGREP_HEADER(ioctl, unistd.h, is_unistd=yes, is_unistd=no) AC_EGREP_HEADER(ioctl, sys/ioctl.h, is_sys_ioctl=yes, is_sys_ioctl=no) AC_EGREP_HEADER(ioctl, stropts.h, is_stropts=yes, is_stropts=no) diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index a12e133e53..8bfc05f6a4 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -168,10 +168,13 @@ AC_DEFUN([ZFS_AC_SPL], [ ]) AC_DEFUN([ZFS_AC_LICENSE], [ - AC_MSG_CHECKING([license]) - AC_MSG_RESULT([CDDL]) -dnl # AC_DEFINE([HAVE_GPL_ONLY_SYMBOLS], [1], -dnl # [Define to 1 if module is licensed under the GPL]) + AC_MSG_CHECKING([zfs license]) + license=`grep MODULE_LICENSE module/zfs/zfs_ioctl.c | cut -f2 -d'"'` + AC_MSG_RESULT([$license]) + if test "$license" = GPL; then + AC_DEFINE([HAVE_GPL_ONLY_SYMBOLS], [1], + [Define to 1 if module is licensed under the GPL]) + fi ]) AC_DEFUN([ZFS_AC_DEBUG], [ diff --git a/configure.ac b/configure.ac index 8920064bec..bdd98ed4d2 100644 --- a/configure.ac +++ b/configure.ac @@ -52,8 +52,8 @@ splbuild= ZFS_AC_KERNEL ZFS_AC_SPL -ZFS_AC_CONFIG ZFS_AC_LICENSE +ZFS_AC_CONFIG ZFS_AC_DEBUG AC_CONFIG_FILES([