summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2020-02-28 09:23:48 -0800
committerGitHub <[email protected]>2020-02-28 09:23:48 -0800
commit3f99a3abc773bf50a0c0276ba530f1b43ea97dc9 (patch)
tree072cdef8a81996063b25f6ddafc29b3d38bdf9fa
parentbd0d24e09b089af589ebaecd9e85d9fd4ac31deb (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.m417
1 files changed, 13 insertions, 4 deletions
diff --git a/config/kernel.m4 b/config/kernel.m4
index a0fa2514e..c29de3494 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -772,11 +772,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 #