diff --git a/m4macros/xdt-features.m4 b/m4macros/xdt-features.m4 index ea0c685..43189d2 100644 --- a/m4macros/xdt-features.m4 +++ b/m4macros/xdt-features.m4 @@ -182,7 +182,11 @@ AC_DEFUN([XDT_FEATURE_LINKER_OPTS], [Disable linker optimizations]), [enable_linker_opts=$enableval], [enable_linker_opts=yes]) - if test "x$enable_linker_opts" != "xno"; then + if test "x$enable_debug" = "x"; then + AC_MSG_ERROR([Linker optimizations cannot detect is debugging is active]) + elif test "x$enable_debug" = "xfull" -o "x$enable_debug" = "xyes"; then + AC_MSG_NOTICE([Linker optimizations disabled for debugging]) + elif test "x$enable_linker_opts" != "xno"; then AC_MSG_CHECKING([whether $LD accepts --as-needed]) case `$LD --as-needed -v 2>&1 &1