summaryrefslogtreecommitdiffstats
path: root/config/zfs-build.m4
diff options
context:
space:
mode:
Diffstat (limited to 'config/zfs-build.m4')
-rw-r--r--config/zfs-build.m433
1 files changed, 32 insertions, 1 deletions
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
index 78a87aef7..a8609b829 100644
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -38,12 +38,43 @@ AC_DEFUN([ZFS_AC_DEBUG], [
[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