diff options
author | Brian Behlendorf <[email protected]> | 2020-02-28 09:23:48 -0800 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2020-05-12 10:53:32 -0700 |
commit | 13bfad0c9615574ff08947e755decb9f30409d3f (patch) | |
tree | 9f1664933b51e3467e95f79d4c142d3ae290485e | |
parent | 49f065d5a445dc45a80fa0e58363ce7009c9587b (diff) |
Fix CONFIG_MODULES=no Linux kernel config
When configuring as builtin (--enable-linux-builtin) for kernels
without loadable module support (CONFIG_MODULES=n) only the object
file is created. Never a loadable kmod.
Update ZFS_LINUX_TRY_COMPILE to handle this in a manor similar to
the ZFS_LINUX_TEST_COMPILE_ALL macro.
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #9887
Closes #10063
-rw-r--r-- | config/kernel.m4 | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/config/kernel.m4 b/config/kernel.m4 index 16cc4568b..7f3e18d59 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -811,11 +811,20 @@ dnl # $2 - source dnl # $3 - run on success (valid .ko generated) dnl # $4 - run on failure (unable to compile) dnl # +dnl # When configuring as builtin (--enable-linux-builtin) for kernels +dnl # without loadable module support (CONFIG_MODULES=n) only the object +dnl # file is created. See ZFS_LINUX_TEST_COMPILE_ALL for details. +dnl # AC_DEFUN([ZFS_LINUX_TRY_COMPILE], [ - ZFS_LINUX_COMPILE_IFELSE( - [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])], - [test -f build/conftest/conftest.ko], - [$3], [$4]) + AS_IF([test "x$enable_linux_builtin" = "xyes"], [ + ZFS_LINUX_COMPILE_IFELSE( + [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])], + [test -f build/conftest/conftest.o], [$3], [$4]) + ], [ + ZFS_LINUX_COMPILE_IFELSE( + [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])], + [test -f build/conftest/conftest.ko], [$3], [$4]) + ]) ]) dnl # |