Bug 1307626: Correctly define DEBUG substitution in debug artifact builds. r=glandium
authorKris Maglione <maglione.k@gmail.com>
Wed, 27 Jul 2016 15:14:52 -0700
changeset 346667 6ae03b78db7771db60b8ebc7c597a1cd62d78782
parent 346666 fd5aadb06d74dec6ee7787bd0f696a318ebcd40e
child 346668 239ce795d3d8b224a41197d9e79fb0f3ecc87d2e
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1307626
milestone52.0a1
Bug 1307626: Correctly define DEBUG substitution in debug artifact builds. r=glandium MozReview-Commit-ID: Io2eq64Bx7L
build/autoconf/compiler-opts.m4
old-configure.in
--- 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