Skip to content

Commit 3e767e3

Browse files
solbjornbehlendorf
authored andcommitted
Linux compat: fix DECLARE_EVENT_CLASS() test when ZFS is built-in
ZFS_LINUX_TRY_COMPILE_HEADER macro doesn't take CONFIG_ZFS=y into account. As a result, on several latest Linux versions, configure script marks DECLARE_EVENT_CLASS() available for non-GPL when ZFS is being built as a module, but marks it unavailable when ZFS is built-in. Follow the logic of the neighbor macros and adjust ZFS_LINUX_TRY_COMPILE_HEADER accordingly, so that it doesn't try to look for a .ko when ZFS is built-in. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Yao <[email protected]> Signed-off-by: Alexander Lobakin <[email protected]> Closes #14006
1 parent df00027 commit 3e767e3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

config/kernel.m4

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,15 @@ dnl # like ZFS_LINUX_TRY_COMPILE, except the contents conftest.h are
932932
dnl # provided via the fifth parameter
933933
dnl #
934934
AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [
935-
ZFS_LINUX_COMPILE_IFELSE(
936-
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]], [[ZFS_META_LICENSE]])],
937-
[test -f build/conftest/conftest.ko],
938-
[$3], [$4], [$5])
935+
AS_IF([test "x$enable_linux_builtin" = "xyes"], [
936+
ZFS_LINUX_COMPILE_IFELSE(
937+
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
938+
[[ZFS_META_LICENSE]])],
939+
[test -f build/conftest/conftest.o], [$3], [$4], [$5])
940+
], [
941+
ZFS_LINUX_COMPILE_IFELSE(
942+
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
943+
[[ZFS_META_LICENSE]])],
944+
[test -f build/conftest/conftest.ko], [$3], [$4], [$5])
945+
])
939946
])

0 commit comments

Comments
 (0)