Bug 973143 - Move some variables to moz.build; r=glandium
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 18 Feb 2014 02:02:00 -0500
changeset 186636 95b4dc85e526cfbd379ff24e24665510a2e11099
parent 186635 e43584cd2994f4522adba5b06dd63462554ad9ed
child 186637 183cb1d53c3569186c4c7232c74da0bdec044e59
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs973143
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 973143 - Move some variables to moz.build; r=glandium
configure.in
dom/apps/src/Makefile.in
dom/apps/src/Webapps.jsm
gfx/cairo/libpixman/src/Makefile.in
gfx/cairo/libpixman/src/moz.build
js/src/Makefile.in
js/src/moz.build
toolkit/mozapps/extensions/Makefile.in
toolkit/mozapps/extensions/moz.build
--- a/configure.in
+++ b/configure.in
@@ -8613,16 +8613,21 @@ AC_SUBST(LIBJPEG_TURBO_X64_ASM)
 AC_SUBST(LIBJPEG_TURBO_ARM_ASM)
 
 AC_SUBST(MOZ_PACKAGE_JSSHELL)
 AC_SUBST(MOZ_FOLD_LIBS)
 
 AC_SUBST(MOZ_ENABLE_SZIP)
 AC_SUBST(MOZ_SZIP_FLAGS)
 
+if test "$MOZ_DEBUG"; then
+    MOZ_EM_DEBUG=1
+fi
+AC_SUBST(MOZ_EM_DEBUG)
+
 if test -n "$COMPILE_ENVIRONMENT"; then
 AC_MSG_CHECKING([for posix_fallocate])
 AC_TRY_LINK([#define _XOPEN_SOURCE 600
   #include <fcntl.h>],
                  [posix_fallocate(0, 0, 0);],
                  [ac_cv___posix_fallocate=true],
                  [ac_cv___posix_fallocate=false])
 
deleted file mode 100644
--- a/dom/apps/src/Makefile.in
+++ /dev/null
@@ -1,7 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this file,
-# You can obtain one at http://mozilla.org/MPL/2.0/.
-
-ifdef MOZ_DEBUG
-  DEFINES += -DMOZ_DEBUG=1
-endif
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -50,17 +50,17 @@ Cu.import("resource://gre/modules/Promis
 #ifdef MOZ_WIDGET_GONK
 XPCOMUtils.defineLazyGetter(this, "libcutils", function() {
   Cu.import("resource://gre/modules/systemlibs.js");
   return libcutils;
 });
 #endif
 
 function debug(aMsg) {
-#ifdef MOZ_DEBUG
+#ifdef DEBUG
   dump("-*- Webapps.jsm : " + aMsg + "\n");
 #endif
 }
 
 function getNSPRErrorCode(err) {
   return -1 * ((err) & 0xffff);
 }
 
--- a/gfx/cairo/libpixman/src/Makefile.in
+++ b/gfx/cairo/libpixman/src/Makefile.in
@@ -4,42 +4,34 @@
 
 ifeq ($(OS_TARGET),Android)
 MODULE_OPTIMIZE_FLAGS = -O2
 endif
 
 # Build MMX code either with VC or with gcc-on-x86
 ifdef _MSC_VER
 ifeq (86,$(findstring 86,$(OS_TEST)))
-ifneq (64,$(findstring 64,$(OS_TEST)))
-USE_MMX=1
-endif
 USE_SSE2=1
 MMX_CFLAGS=
 ifneq (,$(filter 1400 1500, $(_MSC_VER)))
 # MSVC 2005 and 2008 generate code that breaks alignment
 # restrictions in debug mode so always optimize.
 # See bug 640250 for more info.
 SSE2_CFLAGS=-O2
 else
 SSE2_CFLAGS=
 endif
 endif
-ifeq (arm,$(findstring arm,$(OS_TEST)))
-USE_ARM_SIMD_MSVC=1
-endif
 endif
 
 ifdef GNU_CC
 ifeq (ppc,$(findstring ppc,$(OS_TEST)))
-USE_VMX=1
 VMX_CFLAGS=-maltivec
 endif
 ifeq (86,$(findstring 86,$(OS_TEST)))
-USE_MMX=1
 MMX_CFLAGS=-mmmx -Winline
 ifeq (64,$(findstring 64,$(OS_TEST)))
 USE_SSE2=1
 endif
 ifdef HAVE_GCC_ALIGN_ARG_POINTER
 USE_SSE2=1
 endif
 ifdef USE_SSE2
@@ -48,54 +40,24 @@ endif
 MMX_CFLAGS+=--param inline-unit-growth=10000 --param large-function-growth=10000
 endif
 ifeq (arm,$(findstring arm,$(OS_TEST)))
 # Apple's arm assembler doesn't support the same syntax as
 # the standard GNU assembler, so use the C fallback paths for now.
 # This may be fixable if clang's ARM/iOS assembler improves into a
 # viable solution in the future.
 ifneq (Darwin,$(OS_ARCH))
-ifdef HAVE_ARM_SIMD
-USE_ARM_SIMD_GCC=1
-endif
 ifdef HAVE_ARM_NEON
-USE_ARM_NEON_GCC=1
+ARM_NEON_CFLAGS = -mfpu=neon
 endif
 endif
 endif
 
 endif
 
-
-ifdef USE_MMX
-CSRCS += pixman-mmx.c
-DEFINES += -DUSE_MMX
-endif
-
-ifdef USE_SSE2
-CSRCS += pixman-sse2.c
-DEFINES += -DUSE_SSE -DUSE_SSE2
-endif
-
-ifdef USE_VMX
-CSRCS += pixman-vmx.c
-DEFINES += -DUSE_VMX
-endif
-
-ifdef USE_ARM_SIMD_GCC
-CSRCS += pixman-arm-simd.c
-DEFINES += -DUSE_ARM_SIMD
-endif
-
-ifdef USE_ARM_NEON_GCC
-CSRCS += pixman-arm-neon.c
-DEFINES += -DUSE_ARM_NEON
-ARM_NEON_CFLAGS = -mfpu=neon
-endif
-
 include $(topsrcdir)/config/rules.mk
 
 # Disable spammy "missing initializer" GCC warning
 ifdef GNU_CC
 CFLAGS += -Wno-missing-field-initializers
 endif # GNU_CC
 
 # special rule for pixman-mmx to get the right cflags
--- a/gfx/cairo/libpixman/src/moz.build
+++ b/gfx/cairo/libpixman/src/moz.build
@@ -70,8 +70,61 @@ if CONFIG['MOZ_USE_PTHREADS']:
     DEFINES['HAVE_PTHREAD_SETSPECIFIC'] = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['PIXMAN_USE_XP_DLL_TLS_WORKAROUND'] = True
 
 DEFINES['PACKAGE'] = 'mozpixman'
 
 DEFINES['_USE_MATH_DEFINES'] = True
+
+use_mmx = False
+use_sse2 = False
+use_vmx = False
+use_arm_simd_gcc = False
+use_arm_neon_gcc = False
+if '86' in CONFIG['OS_TEST']:
+    if '64' in CONFIG['OS_TEST']:
+        if CONFIG['GNU_CC']:
+            use_sse2 = True
+    else:
+        if CONFIG['_MSC_VER']:
+            use_mmx = True
+        if CONFIG['HAVE_GCC_ALIGN_ARG_POINTER']:
+            use_sse2 = True
+    if CONFIG['GNU_CC']:
+        use_mmx = True
+    if CONFIG['_MSC_VER']:
+        use_sse2 = True
+elif 'ppc' in CONFIG['OS_TEST']:
+    if CONFIG['GNU_CC']:
+        use_vmx = True
+# Apple's arm assembler doesn't support the same syntax as
+# the standard GNU assembler, so use the C fallback paths for now.
+# This may be fixable if clang's ARM/iOS assembler improves into a
+# viable solution in the future.
+elif 'arm' in CONFIG['OS_TEST']:
+    if CONFIG['OS_ARCH'] != 'Darwin':
+        if CONFIG['HAVE_ARM_SIMD']:
+            use_arm_simd_gcc = True
+        if CONFIG['HAVE_ARM_NEON']:
+            use_arm_neon_gcc = True
+
+if use_mmx:
+    DEFINES['USE_MMX'] = True
+    SOURCES += ['pixman-mmx.c']
+
+if use_sse2:
+    DEFINES['USE_SSE'] = True
+    DEFINES['USE_SSE2'] = True
+    SOURCES += ['pixman-sse2.c']
+
+if use_vmx:
+    DEFINES['USE_VMX'] = True
+    SOURCES += ['pixman-vmx.c']
+
+if use_arm_simd_gcc:
+    DEFINES['USE_ARM_SIMD'] = True
+    SOURCES += ['pixman-arm-simd.c']
+
+if use_arm_neon_gcc:
+    DEFINES['USE_ARM_NEON'] = True
+    SOURCES += ['pixman-arm-neon.c']
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -198,21 +198,16 @@ DIST_GARBAGE = config.cache config.log c
    backend.mk config/backend.mk devtools/backend.mk editline/backend.mk \
    gdb/backend.mk jsapi-tests/backend.mk shell/backend.mk tests/backend.mk \
    backend.RecursiveMakeBackend backend.RecursiveMakeBackend.pp \
    devtools/rootAnalysis/Makefile
 
 distclean::
 	$(RM) $(DIST_GARBAGE)
 
-ifneq (,$(filter WINNT,$(OS_ARCH)))
-# _CRT_RAND_S must be #defined before #including stdlib.h to get rand_s()
-DEFINES         += -D_CRT_RAND_S
-endif
-
 ifneq ($(findstring -L,$(NSPR_LIBS)),)
 NSPR_STATIC_PATH = $(subst -L,,$(findstring -L,$(NSPR_LIBS)))
 else
 NSPR_STATIC_PATH = $(DIST)/lib
 endif
 
 # HP-UX does not require the extra linking of "-lm"
 ifeq (,$(filter HP-UX WINNT,$(OS_ARCH)))
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -338,16 +338,18 @@ if CONFIG['ENABLE_ION']:
                 'jit/arm/Simulator-arm.cpp'
             ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         'assembler/jit/ExecutableAllocatorWin.cpp',
         'yarr/OSAllocatorWin.cpp',
     ]
+    # _CRT_RAND_S must be #defined before #including stdlib.h to get rand_s()
+    DEFINES['_CRT_RAND_S'] = True
 else:
     SOURCES += [
         'assembler/jit/ExecutableAllocatorPosix.cpp',
         'yarr/OSAllocatorPosix.cpp',
     ]
 
 if CONFIG['ENABLE_ION'] or CONFIG['ENABLE_YARR_JIT']:
     if CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']:
deleted file mode 100644
--- a/toolkit/mozapps/extensions/Makefile.in
+++ /dev/null
@@ -1,9 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# Additional debugging info is exposed by setting the MOZ_EM_DEBUG
-# environment variable when building.
-ifneq (,$(MOZ_EM_DEBUG))
-DEFINES += -DMOZ_EM_DEBUG=1
-endif
--- a/toolkit/mozapps/extensions/moz.build
+++ b/toolkit/mozapps/extensions/moz.build
@@ -48,12 +48,12 @@ EXTRA_PP_JS_MODULES += [
 if CONFIG['MOZ_UPDATE_CHANNEL'] not in ('aurora', 'beta', 'release', 'esr'):
     DEFINES['MOZ_COMPATIBILITY_NIGHTLY'] = 1
 
 # This is used in multiple places, so is defined here to avoid it getting
 # out of sync.
 DEFINES['MOZ_EXTENSIONS_DB_SCHEMA'] = 16
 
 # Additional debugging info is exposed in debug builds
-if CONFIG['MOZ_DEBUG']:
+if CONFIG['MOZ_EM_DEBUG']:
     DEFINES['MOZ_EM_DEBUG'] = 1
 
-JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file
+JAR_MANIFESTS += ['jar.mn']