diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index ce6ed6b0d09f..e26cafccfe4a 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -38,12 +38,44 @@ 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_DEBUG_DMU_TX], [ AC_ARG_ENABLE([debug-dmu-tx], [AS_HELP_STRING([--enable-debug-dmu-tx], diff --git a/configure.ac b/configure.ac index bad15bd16e46..1bbb7b2f93e3 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,7 @@ ZFS_AC_LICENSE ZFS_AC_PACKAGE ZFS_AC_CONFIG ZFS_AC_DEBUG +ZFS_AC_DEBUGINFO ZFS_AC_DEBUG_DMU_TX AC_CONFIG_FILES([