[ZFS_AC_DEBUG_DISABLE],
[AC_MSG_ERROR([Unknown option $enable_debug])])
- AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(DEBUG_STACKFLAGS)
AC_SUBST(DEBUG_ZFS)
AC_MSG_RESULT([$enable_debug])
])
+AC_DEFUN([ZFS_AC_DEBUGINFO_KERNEL], [
+ KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS CONFIG_DEBUG_INFO=y"
+])
+
+AC_DEFUN([ZFS_AC_DEBUGINFO_USER], [
+ DEBUG_CFLAGS="$DEBUG_CFLAGS -g"
+])
+
+AC_DEFUN([ZFS_AC_DEBUGINFO], [
+ AC_MSG_CHECKING([whether debuginfo support will be forced])
+ AC_ARG_ENABLE([debuginfo],
+ [AS_HELP_STRING([--enable-debuginfo],
+ [Force generation of debuginfo @<:@default=no@:>@])],
+ [],
+ [enable_debuginfo=no])
+
+ AS_CASE(["x$enable_debuginfo"],
+ ["xyes"],
+ [ZFS_AC_DEBUGINFO_KERNEL
+ ZFS_AC_DEBUGINFO_USER],
+ ["xkernel"],
+ [ZFS_AC_DEBUGINFO_KERNEL],
+ ["xuser"],
+ [ZFS_AC_DEBUGINFO_USER],
+ ["xno"],
+ [],
+ [AC_MSG_ERROR([Unknown option $enable_debug])])
+
+ AC_SUBST(DEBUG_CFLAGS)
+ AC_MSG_RESULT([$enable_debuginfo])
+])
+
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE
ZFS_AC_CONFIG_ALWAYS_NO_BOOL_COMPARE