mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-03-10 12:26:27 +03:00
config: cleanup KERNEL_CC checks, fix broken status output
If $KERNEL_CC was not defined, configure status output would print an empty string where the kernel compiler should have been. Fix this and simplify the code generally. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name> Closes #16997
This commit is contained in:
parent
c539d6f211
commit
92579489e0
@ -231,19 +231,16 @@ dnl #
|
|||||||
dnl # Check if kernel cc supports -Winfinite-recursion option.
|
dnl # Check if kernel cc supports -Winfinite-recursion option.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_INFINITE_RECURSION], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_INFINITE_RECURSION], [
|
||||||
AC_MSG_CHECKING([whether $KERNEL_CC supports -Winfinite-recursion])
|
|
||||||
|
|
||||||
saved_cc="$CC"
|
saved_cc="$CC"
|
||||||
saved_flags="$CFLAGS"
|
AS_IF(
|
||||||
CC="gcc"
|
[ test -n "$KERNEL_CC" ], [ CC="$KERNEL_CC" ],
|
||||||
CFLAGS="$CFLAGS -Werror -Winfinite-recursion"
|
[ test -n "$KERNEL_LLVM" ], [ CC="clang" ],
|
||||||
|
[ CC="gcc" ]
|
||||||
|
)
|
||||||
|
AC_MSG_CHECKING([whether $CC supports -Winfinite-recursion])
|
||||||
|
|
||||||
AS_IF([ test -n "$KERNEL_CC" ], [
|
saved_flags="$CFLAGS"
|
||||||
CC="$KERNEL_CC"
|
CFLAGS="$CFLAGS -Werror -Winfinite-recursion"
|
||||||
])
|
|
||||||
AS_IF([ test -n "$KERNEL_LLVM" ], [
|
|
||||||
CC="clang"
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
||||||
KERNEL_INFINITE_RECURSION=-Winfinite-recursion
|
KERNEL_INFINITE_RECURSION=-Winfinite-recursion
|
||||||
@ -329,19 +326,16 @@ dnl #
|
|||||||
dnl # Check if kernel cc supports -fno-ipa-sra option.
|
dnl # Check if kernel cc supports -fno-ipa-sra option.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_NO_IPA_SRA], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_NO_IPA_SRA], [
|
||||||
AC_MSG_CHECKING([whether $KERNEL_CC supports -fno-ipa-sra])
|
|
||||||
|
|
||||||
saved_cc="$CC"
|
saved_cc="$CC"
|
||||||
saved_flags="$CFLAGS"
|
AS_IF(
|
||||||
CC="gcc"
|
[ test -n "$KERNEL_CC" ], [ CC="$KERNEL_CC" ],
|
||||||
CFLAGS="$CFLAGS -Werror -fno-ipa-sra"
|
[ test -n "$KERNEL_LLVM" ], [ CC="clang" ],
|
||||||
|
[ CC="gcc" ]
|
||||||
|
)
|
||||||
|
AC_MSG_CHECKING([whether $CC supports -fno-ipa-sra])
|
||||||
|
|
||||||
AS_IF([ test -n "$KERNEL_CC" ], [
|
saved_flags="$CFLAGS"
|
||||||
CC="$KERNEL_CC"
|
CFLAGS="$CFLAGS -Werror -fno-ipa-sra"
|
||||||
])
|
|
||||||
AS_IF([ test -n "$KERNEL_LLVM" ], [
|
|
||||||
CC="clang"
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
||||||
KERNEL_NO_IPA_SRA=-fno-ipa-sra
|
KERNEL_NO_IPA_SRA=-fno-ipa-sra
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user