Bug 1307626: Correctly define DEBUG substitution in debug artifact builds. r?glandium
MozReview-Commit-ID: Io2eq64Bx7L
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -87,28 +87,30 @@ MOZ_ARG_WITH_STRING(debug-label,
[ --with-debug-label=LABELS
Define DEBUG_<value> for each comma-separated
value given.],
[ for option in `echo $withval | sed 's/,/ /g'`; do
MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS DEBUG_${option}"
done])
if test -n "$MOZ_DEBUG"; then
- AC_MSG_CHECKING([for valid debug flags])
- _SAVE_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
- AC_TRY_COMPILE([#include <stdio.h>],
- [printf("Hello World\n");],
- _results=yes,
- _results=no)
- AC_MSG_RESULT([$_results])
- if test "$_results" = "no"; then
- AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
+ if test -n "$COMPILE_ENVIRONMENT"; then
+ AC_MSG_CHECKING([for valid debug flags])
+ _SAVE_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
+ AC_TRY_COMPILE([#include <stdio.h>],
+ [printf("Hello World\n");],
+ _results=yes,
+ _results=no)
+ AC_MSG_RESULT([$_results])
+ if test "$_results" = "no"; then
+ AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
+ fi
+ CFLAGS=$_SAVE_CFLAGS
fi
- CFLAGS=$_SAVE_CFLAGS
MOZ_DEBUG_DEFINES="$MOZ_DEBUG_ENABLE_DEFS"
else
MOZ_DEBUG_DEFINES="NDEBUG TRIMMED"
fi
AC_SUBST_LIST(MOZ_DEBUG_DEFINES)
--- a/old-configure.in
+++ b/old-configure.in
@@ -1334,16 +1334,17 @@ case "$target" in
fi
;;
esac
if test -z "$COMPILE_ENVIRONMENT"; then
SKIP_COMPILER_CHECKS=1
SKIP_LIBRARY_CHECKS=1
PKG_SKIP_STRIP=1
+ MOZ_DEBUGGING_OPTS
else
MOZ_COMPILER_OPTS
fi # COMPILE_ENVIRONMENT
if test -z "$SKIP_COMPILER_CHECKS"; then
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ========================================================
AC_C_CONST