mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
FreeBSD module --enable-debug --enable-invariants
Wire up the --enable-debug flag for configure to the FreeBSD module build. Add --enable-invariants. The running FreeBSD kernel config is used to detect whether to enable INVARIANTS if not explicitly specified with --enable-invariants or --disable-invariants. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #11678
This commit is contained in:
@@ -11,6 +11,7 @@ AC_DEFUN([ZFS_AC_DEBUG_ENABLE], [
|
||||
DEBUG_CPPFLAGS="-DDEBUG -UNDEBUG"
|
||||
DEBUG_LDFLAGS=""
|
||||
DEBUG_ZFS="_with_debug"
|
||||
WITH_DEBUG="true"
|
||||
AC_DEFINE(ZFS_DEBUG, 1, [zfs debugging enabled])
|
||||
|
||||
KERNEL_DEBUG_CFLAGS="-Werror"
|
||||
@@ -22,6 +23,7 @@ AC_DEFUN([ZFS_AC_DEBUG_DISABLE], [
|
||||
DEBUG_CPPFLAGS="-UDEBUG -DNDEBUG"
|
||||
DEBUG_LDFLAGS=""
|
||||
DEBUG_ZFS="_without_debug"
|
||||
WITH_DEBUG=""
|
||||
|
||||
KERNEL_DEBUG_CFLAGS=""
|
||||
KERNEL_DEBUG_CPPFLAGS="-UDEBUG -DNDEBUG"
|
||||
@@ -51,6 +53,7 @@ AC_DEFUN([ZFS_AC_DEBUG], [
|
||||
AC_SUBST(DEBUG_CPPFLAGS)
|
||||
AC_SUBST(DEBUG_LDFLAGS)
|
||||
AC_SUBST(DEBUG_ZFS)
|
||||
AC_SUBST(WITH_DEBUG)
|
||||
|
||||
AC_SUBST(KERNEL_DEBUG_CFLAGS)
|
||||
AC_SUBST(KERNEL_DEBUG_CPPFLAGS)
|
||||
@@ -152,6 +155,39 @@ AC_DEFUN([ZFS_AC_DEBUG_KMEM_TRACKING], [
|
||||
AC_MSG_RESULT([$enable_debug_kmem_tracking])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD], [
|
||||
AS_IF([sysctl -n kern.conftxt | fgrep -qx $'options\tINVARIANTS'],
|
||||
[enable_invariants="yes"],
|
||||
[enable_invariants="no"])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT], [
|
||||
AM_COND_IF([BUILD_FREEBSD],
|
||||
[ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD],
|
||||
[enable_invariants="no"])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Detected for the running kernel by default, enables INVARIANTS features
|
||||
dnl # in the FreeBSD kernel module. This feature must be used when building
|
||||
dnl # for a FreeBSD kernel with "options INVARIANTS" in the KERNCONF and must
|
||||
dnl # not be used when the INVARIANTS option is absent.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS], [
|
||||
AC_MSG_CHECKING([whether FreeBSD kernel INVARIANTS checks are enabled])
|
||||
AC_ARG_ENABLE([invariants],
|
||||
[AS_HELP_STRING([--enable-invariants],
|
||||
[Enable FreeBSD kernel INVARIANTS checks [[default: detect]]])],
|
||||
[], [ZFS_AC_DEBUG_INVARIANTS_DETECT])
|
||||
|
||||
AS_IF([test "x$enable_invariants" = xyes],
|
||||
[WITH_INVARIANTS="true"],
|
||||
[WITH_INVARIANTS=""])
|
||||
AC_SUBST(WITH_INVARIANTS)
|
||||
|
||||
AC_MSG_RESULT([$enable_invariants])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
||||
AX_COUNT_CPUS([])
|
||||
AC_SUBST(CPU_COUNT)
|
||||
|
||||
Reference in New Issue
Block a user