Skip to content

Commit bcb793c

Browse files
solbjornandrewc12
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 openzfs#14006
1 parent 8d31b85 commit bcb793c

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
@@ -940,8 +940,15 @@ dnl # like ZFS_LINUX_TRY_COMPILE, except the contents conftest.h are
940940
dnl # provided via the fifth parameter
941941
dnl #
942942
AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [
943-
ZFS_LINUX_COMPILE_IFELSE(
944-
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]], [[ZFS_META_LICENSE]])],
945-
[test -f build/conftest/conftest.ko],
946-
[$3], [$4], [$5])
943+
AS_IF([test "x$enable_linux_builtin" = "xyes"], [
944+
ZFS_LINUX_COMPILE_IFELSE(
945+
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
946+
[[ZFS_META_LICENSE]])],
947+
[test -f build/conftest/conftest.o], [$3], [$4], [$5])
948+
], [
949+
ZFS_LINUX_COMPILE_IFELSE(
950+
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
951+
[[ZFS_META_LICENSE]])],
952+
[test -f build/conftest/conftest.ko], [$3], [$4], [$5])
953+
])
947954
])

0 commit comments

Comments
 (0)