bug 870406: move CSRCS to mozbuild (config batch #2) r=mshal
authorJoey Armstrong <joey@mozilla.com>
Tue, 04 Jun 2013 11:08:44 -0400
changeset 141048 e5b6545901b0c7437c8e13581c154e790085dc98
parent 141047 ac483563ea14ed599668b0db4e7d8d06196796a1
child 141049 92178edfeb6e1a305f15a3d1eec30879ded0263c
push id3911
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 20:17:26 +0000
treeherdermozilla-aurora@7e26ca8db92b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs870406
milestone24.0a1
bug 870406: move CSRCS to mozbuild (config batch #2) r=mshal
media/kiss_fft/Makefile.in
media/kiss_fft/moz.build
media/libcubeb/src/Makefile.in
media/libcubeb/src/moz.build
media/libjpeg/Makefile.in
media/libjpeg/moz.build
media/libnestegg/src/Makefile.in
media/libnestegg/src/moz.build
media/libogg/src/Makefile.in
media/libogg/src/moz.build
media/libpng/Makefile.in
media/libpng/moz.build
memory/build/Makefile.in
memory/build/moz.build
memory/jemalloc/Makefile.in
memory/jemalloc/moz.build
memory/mozjemalloc/Makefile.in
memory/mozjemalloc/moz.build
memory/replace/dmd/Makefile.in
memory/replace/dmd/moz.build
memory/replace/dummy/Makefile.in
memory/replace/dummy/moz.build
memory/replace/jemalloc/Makefile.in
memory/replace/jemalloc/moz.build
--- a/media/kiss_fft/Makefile.in
+++ b/media/kiss_fft/Makefile.in
@@ -8,12 +8,12 @@ srcdir = @srcdir@
 VPATH = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME = kiss_fft
 ifeq (WINNT,$(OS_TARGET))
 VISIBILITY_FLAGS =
 endif
-CSRCS = kiss_fft.c kiss_fftr.c
+DISABLED_CSRCS = kiss_fft.c kiss_fftr.c
 
 include $(topsrcdir)/config/rules.mk
 
--- a/media/kiss_fft/moz.build
+++ b/media/kiss_fft/moz.build
@@ -1,12 +1,17 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 MODULE = 'kiss_fft'
 
 EXPORTS.kiss_fft += [
     'kiss_fft.h',
     'kiss_fftr.h',
 ]
 
+CSRCS += [
+    'kiss_fft.c',
+    'kiss_fftr.c',
+]
--- a/media/libcubeb/src/Makefile.in
+++ b/media/libcubeb/src/Makefile.in
@@ -11,63 +11,63 @@ include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME    = cubeb
 MSVC_ENABLE_PGO := 1
 FORCE_STATIC_LIB= 1
 ifeq ($(OS_TARGET),WINNT)
 VISIBILITY_FLAGS =
 endif
 
-CSRCS           = \
+DISABLED_CSRCS           = \
                 cubeb.c \
                 $(NULL)
 
 ifeq ($(OS_TARGET),WINNT)
-CSRCS           += \
+DISABLED_CSRCS           += \
                 cubeb_winmm.c \
                 $(NULL)
 DEFINES         += -DUSE_WINMM
 endif
 
 ifeq ($(OS_TARGET),Android)
 ifneq ($(MOZ_WIDGET_TOOLKIT),gonk)
-CSRCS           += \
+DISABLED_CSRCS           += \
                 cubeb_audiotrack.c \
                 $(NULL)
 DEFINES         += -DUSE_AUDIOTRACK
 endif
-CSRCS           += \
+DISABLED_CSRCS           += \
                 cubeb_opensl.c \
                 $(NULL)
 DEFINES         += -DUSE_OPENSL
 endif
 
 ifeq ($(OS_TARGET),Darwin)
-CSRCS           += \
+DISABLED_CSRCS           += \
                 cubeb_audiounit.c \
                 $(NULL)
 DEFINES         += -DUSE_AUDIOUNIT
 endif
 
 ifeq ($(OS_ARCH),OpenBSD)
-CSRCS           += \
+DISABLED_CSRCS           += \
                 cubeb_sndio.c \
                 $(NULL)
 DEFINES         += -DUSE_SNDIO
 endif
 
 ifdef MOZ_ALSA
-CSRCS           += \
+DISABLED_CSRCS           += \
                 cubeb_alsa.c \
                 $(NULL)
 DEFINES         += -DUSE_ALSA
 endif
 
 ifdef MOZ_PULSEAUDIO
-CSRCS           += \
+DISABLED_CSRCS           += \
                 cubeb_pulse.c \
                 $(NULL)
 DEFINES         += -DUSE_PULSE
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 CFLAGS += \
--- a/media/libcubeb/src/moz.build
+++ b/media/libcubeb/src/moz.build
@@ -1,8 +1,45 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 MODULE = 'cubeb'
 
+CSRCS += [
+    'cubeb.c',
+]
+
+if CONFIG['MOZ_ALSA']:
+    CSRCS += [
+        'cubeb_alsa.c',
+    ]
+
+if CONFIG['MOZ_PULSEAUDIO']:
+    CSRCS += [
+        'cubeb_pulse.c',
+    ]
+
+if CONFIG['OS_ARCH'] == 'OpenBSD':
+    CSRCS += [
+        'cubeb_sndio.c',
+    ]
+
+if CONFIG['OS_TARGET'] == 'Darwin':
+    CSRCS += [
+        'cubeb_audiounit.c',
+    ]
+
+if CONFIG['OS_TARGET'] == 'WINNT':
+    CSRCS += [
+        'cubeb_winmm.c',
+    ]
+
+if CONFIG['OS_TARGET'] == 'Android':
+    CSRCS += [
+        'cubeb_opensl.c',
+    ]
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
+        CSRCS += [
+            'cubeb_audiotrack.c',
+        ]
--- a/media/libjpeg/Makefile.in
+++ b/media/libjpeg/Makefile.in
@@ -12,17 +12,17 @@ include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME	= mozjpeg
 MSVC_ENABLE_PGO := 1
 
 ifeq ($(OS_ARCH),WINNT)
 VISIBILITY_FLAGS	=
 endif
 
-CSRCS		= \
+DISABLED_CSRCS		= \
 		jcomapi.c \
 		jdapimin.c \
 		jdapistd.c \
 		jdatadst.c \
 		jdatasrc.c \
 		jdcoefct.c \
 		jdcolor.c \
 		jddctmgr.c \
@@ -47,17 +47,17 @@ CSRCS		= \
 		jmemmgr.c \
 		jmemnobs.c \
 		jquant1.c \
 		jquant2.c \
 		jutils.c \
 		$(NULL)
 
 # These files enable support for writing JPEGs
-CSRCS		+= \
+DISABLED_CSRCS		+= \
 		jcapimin.c \
 		jcapistd.c \
 		jccoefct.c \
 		jccolor.c \
 		jcdctmgr.c \
 		jchuff.c \
 		jcinit.c \
 		jcmainct.c \
@@ -76,26 +76,26 @@ ASFLAGS=$(LIBJPEG_TURBO_ASFLAGS) -I$(top
 
 ifeq ($(AS),yasm)
   # yasm doesn't like -c
   AS_DASH_C_FLAG=
 endif
 
 # No SIMD support?
 ifeq (,$(LIBJPEG_TURBO_X86_ASM)$(LIBJPEG_TURBO_X64_ASM)$(LIBJPEG_TURBO_ARM_ASM))
-  CSRCS += jsimd_none.c
+  DISABLED_CSRCS += jsimd_none.c
 endif
 
 ifeq (1,$(LIBJPEG_TURBO_ARM_ASM))
-  CSRCS += simd/jsimd_arm.c
+  DISABLED_CSRCS += simd/jsimd_arm.c
   SSRCS += simd/jsimd_arm_neon.S
 endif
 
 ifeq (1,$(LIBJPEG_TURBO_X64_ASM))
-  CSRCS   += simd/jsimd_x86_64.c
+  DISABLED_CSRCS   += simd/jsimd_x86_64.c
   DISABLED_ASFILES += \
 	simd/jccolss2-64.asm \
 	simd/jcgrass2-64.asm \
 	simd/jcqnts2f-64.asm \
 	simd/jcqnts2i-64.asm \
 	simd/jcsamss2-64.asm \
 	simd/jdcolss2-64.asm \
 	simd/jdmerss2-64.asm \
@@ -106,17 +106,17 @@ ifeq (1,$(LIBJPEG_TURBO_X64_ASM))
 	simd/jiss2flt-64.asm \
 	simd/jiss2fst-64.asm \
 	simd/jiss2int-64.asm \
 	simd/jiss2red-64.asm \
 	$(NULL)
 endif
 
 ifeq (1,$(LIBJPEG_TURBO_X86_ASM))
-  CSRCS   +=simd/jsimd_i386.c
+  DISABLED_CSRCS   +=simd/jsimd_i386.c
   DISABLED_ASFILES += \
 	simd/jccolmmx.asm \
 	simd/jccolss2.asm \
 	simd/jcgrammx.asm \
 	simd/jcgrass2.asm \
 	simd/jcqnt3dn.asm \
 	simd/jcqntmmx.asm \
 	simd/jcqnts2f.asm \
--- a/media/libjpeg/moz.build
+++ b/media/libjpeg/moz.build
@@ -68,8 +68,79 @@ if CONFIG['LIBJPEG_TURBO_X86_ASM']:
         'simd/jimmxred.asm',
         'simd/jiss2flt.asm',
         'simd/jiss2fst.asm',
         'simd/jiss2int.asm',
         'simd/jiss2red.asm',
         'simd/jisseflt.asm',
         'simd/jsimdcpu.asm',
 ]
+
+CSRCS += [
+    'jcomapi.c',
+    'jdapimin.c',
+    'jdapistd.c',
+    'jdatadst.c',
+    'jdatasrc.c',
+    'jdcoefct.c',
+    'jdcolor.c',
+    'jddctmgr.c',
+    'jdhuff.c',
+    'jdinput.c',
+    'jdmainct.c',
+    'jdmarker.c',
+    'jdmaster.c',
+    'jdmerge.c',
+    'jdphuff.c',
+    'jdpostct.c',
+    'jdsample.c',
+    'jdtrans.c',
+    'jerror.c',
+    'jfdctflt.c',
+    'jfdctfst.c',
+    'jfdctint.c',
+    'jidctflt.c',
+    'jidctfst.c',
+    'jidctint.c',
+    'jidctred.c',
+    'jmemmgr.c',
+    'jmemnobs.c',
+    'jquant1.c',
+    'jquant2.c',
+    'jutils.c',
+]
+
+# These files enable support for writing JPEGs
+CSRCS += [
+    'jcapimin.c',
+    'jcapistd.c',
+    'jccoefct.c',
+    'jccolor.c',
+    'jcdctmgr.c',
+    'jchuff.c',
+    'jcinit.c',
+    'jcmainct.c',
+    'jcmarker.c',
+    'jcmaster.c',
+    'jcparam.c',
+    'jcphuff.c',
+    'jcprepct.c',
+    'jcsample.c',
+    'jctrans.c',
+]
+
+
+if CONFIG['LIBJPEG_TURBO_ARM_ASM']:
+    CSRCS += [
+        'simd/jsimd_arm.c',
+    ]
+elif CONFIG['LIBJPEG_TURBO_X64_ASM']:
+    CSRCS += [
+        'simd/jsimd_x86_64.c',
+    ]
+elif CONFIG['LIBJPEG_TURBO_X86_ASM']:
+    CSRCS += [
+        'simd/jsimd_i386.c',
+    ]
+else: # No SIMD support?
+    CSRCS += [
+        'jsimd_none.c',
+    ]
--- a/media/libnestegg/src/Makefile.in
+++ b/media/libnestegg/src/Makefile.in
@@ -11,14 +11,14 @@ include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME	= nestegg
 MSVC_ENABLE_PGO := 1
 FORCE_STATIC_LIB= 1
 ifeq (WINNT,$(OS_TARGET))
 VISIBILITY_FLAGS =
 endif
 
-CSRCS		= \
+DISABLED_CSRCS		= \
 		nestegg.c \
 		halloc.c \
 		$(NULL)
 		
 include $(topsrcdir)/config/rules.mk
--- a/media/libnestegg/src/moz.build
+++ b/media/libnestegg/src/moz.build
@@ -1,8 +1,12 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 MODULE = 'nestegg'
 
+CSRCS += [
+    'halloc.c',
+    'nestegg.c',
+]
--- a/media/libogg/src/Makefile.in
+++ b/media/libogg/src/Makefile.in
@@ -11,14 +11,14 @@ include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME	= ogg
 MSVC_ENABLE_PGO := 1
 FORCE_STATIC_LIB= 1
 ifeq (WINNT,$(OS_TARGET))
 VISIBILITY_FLAGS =
 endif
 
-CSRCS		= \
+DISABLED_CSRCS		= \
 		ogg_bitwise.c \
 		ogg_framing.c \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/media/libogg/src/moz.build
+++ b/media/libogg/src/moz.build
@@ -1,8 +1,12 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 MODULE = 'ogg'
 
+CSRCS += [
+    'ogg_bitwise.c',
+    'ogg_framing.c',
+]
--- a/media/libpng/Makefile.in
+++ b/media/libpng/Makefile.in
@@ -13,27 +13,27 @@ include $(DEPTH)/config/autoconf.mk
 LIBRARY_NAME	= mozpng
 MSVC_ENABLE_PGO := 1
 FORCE_STATIC_LIB= 1
 ifeq ($(OS_ARCH),WINNT)
 VISIBILITY_FLAGS=
 endif
 
 
-CSRCS		= \
+DISABLED_CSRCS		= \
 		png.c \
 		pngerror.c \
 		pngget.c \
 		pngmem.c \
 		pngset.c \
 		pngtrans.c \
 		$(NULL)
 
 # These files enable support for reading/writing PNGs
-CSRCS		+= \
+DISABLED_CSRCS		+= \
 		pngpread.c \
 		pngread.c \
 		pngrio.c \
 		pngrtran.c \
 		pngrutil.c \
 		pngwio.c \
 		pngwrite.c \
 		pngwtran.c \
--- a/media/libpng/moz.build
+++ b/media/libpng/moz.build
@@ -7,8 +7,29 @@
 MODULE = 'png'
 
 EXPORTS += [
     'mozpngconf.h',
     'png.h',
     'pngconf.h',
 ]
 
+CSRCS += [
+    'png.c',
+    'pngerror.c',
+    'pngget.c',
+    'pngmem.c',
+    'pngset.c',
+    'pngtrans.c',
+]
+
+# These files enable support for reading/writing PNGs
+CSRCS += [
+    'pngpread.c',
+    'pngread.c',
+    'pngrio.c',
+    'pngrtran.c',
+    'pngrutil.c',
+    'pngwio.c',
+    'pngwrite.c',
+    'pngwtran.c',
+    'pngwutil.c',
+]
--- a/memory/build/Makefile.in
+++ b/memory/build/Makefile.in
@@ -14,38 +14,38 @@ FORCE_STATIC_LIB = 1
 STLFLAGS =
 ifdef MOZ_GLUE_PROGRAM_LDFLAGS
 SDK_LIBRARY = $(REAL_LIBRARY)
 DIST_INSTALL = 1
 endif
 
 DEFINES += -DMOZ_MEMORY_IMPL
 
-CSRCS = \
+DISABLED_CSRCS = \
   mozmemory_wrap.c \
   jemalloc_config.c \
   $(NULL)
 
 ifdef MOZ_JEMALLOC3
-CSRCS += mozjemalloc_compat.c
+DISABLED_CSRCS += mozjemalloc_compat.c
 LOCAL_INCLUDES += -I../jemalloc/src/include
 ifdef _MSC_VER
 LOCAL_INCLUDES += -I$(topsrcdir)/memory/jemalloc/src/include/msvc_compat
 endif
 
 ifndef MOZ_NATIVE_JEMALLOC
 SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DEPTH)/memory/jemalloc)
 endif
 else
 SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DEPTH)/memory/mozjemalloc)
 endif
 
 ifdef MOZ_REPLACE_MALLOC
 DEFINES += -DMOZ_REPLACE_MALLOC
-CSRCS += replace_malloc.c
+DISABLED_CSRCS += replace_malloc.c
 
 # The zone allocator for OSX needs some jemalloc internal functions
 ifeq (Darwin,$(OS_TARGET))
 LOCAL_INCLUDES += -I$(topsrcdir)/memory/jemalloc/src/include
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/memory/build/moz.build
+++ b/memory/build/moz.build
@@ -11,8 +11,22 @@ EXPORTS += [
     'mozmemory_wrap.h',
 ]
 
 if CONFIG['MOZ_REPLACE_MALLOC']:
     EXPORTS += [
         'malloc_decls.h',
         'replace_malloc.h',
     ]
+CSRCS += [
+    'jemalloc_config.c',
+    'mozmemory_wrap.c',
+]
+
+if CONFIG['MOZ_JEMALLOC3']:
+    CSRCS += [
+        'mozjemalloc_compat.c',
+    ]
+
+if CONFIG['MOZ_REPLACE_MALLOC']:
+    CSRCS += [
+        'replace_malloc.c',
+    ]
--- a/memory/jemalloc/Makefile.in
+++ b/memory/jemalloc/Makefile.in
@@ -13,21 +13,21 @@ include $(DEPTH)/config/autoconf.mk
 LIBRARY_NAME = jemalloc
 FORCE_STATIC_LIB = 1
 
 ifdef MOZ_GLUE_PROGRAM_LDFLAGS
 SDK_LIBRARY = $(REAL_LIBRARY)
 DIST_INSTALL = 1
 endif
 
-CSRCS := $(notdir $(wildcard $(srcdir)/src/src/*.c))
+DISABLED_CSRCS := $(notdir $(wildcard $(srcdir)/src/src/*.c))
 # Only OSX needs the zone allocation implementation, but only if
 # replace-malloc is not enabled.
 ifneq ($(OS_TARGET)$(MOZ_REPLACE_MALLOC),Darwin)
-CSRCS := $(filter-out zone.c,$(CSRCS))
+DISABLED_CSRCS := $(filter-out zone.c,$(CSRCS))
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += \
   -I$(srcdir)/src/include \
   -Isrc/include \
   $(NULL)
--- a/memory/jemalloc/moz.build
+++ b/memory/jemalloc/moz.build
@@ -1,8 +1,39 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 MODULE = 'jemalloc'
 
+CSRCS += [
+    'arena.c',
+    'atomic.c',
+    'base.c',
+    'bitmap.c',
+    'chunk.c',
+    'chunk_dss.c',
+    'chunk_mmap.c',
+    'ckh.c',
+    'ctl.c',
+    'extent.c',
+    'hash.c',
+    'huge.c',
+    'jemalloc.c',
+    'mb.c',
+    'mutex.c',
+    'prof.c',
+    'quarantine.c',
+    'rtree.c',
+    'stats.c',
+    'tcache.c',
+    'tsd.c',
+    'util.c',
+]
+
+# Only OSX needs the zone allocation implementation,
+# but only if replace-malloc is not enabled.
+if CONFIG['OS_TARGET'] == 'Darwin' and not CONFIG['MOZ_REPLACE_MALLOC']:
+    CSRCS += [
+        'zone.c',
+    ]
--- a/memory/mozjemalloc/Makefile.in
+++ b/memory/mozjemalloc/Makefile.in
@@ -6,17 +6,17 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 ifndef MOZ_JEMALLOC3
-CSRCS = jemalloc.c
+DISABLED_CSRCS = jemalloc.c
 
 LIBRARY_NAME = jemalloc
 FORCE_STATIC_LIB= 1
 
 ifeq ($(OS_ARCH),SunOS)
 ifndef GNU_CC
 MODULE_OPTIMIZE_FLAGS = -xO5
 endif
--- a/memory/mozjemalloc/moz.build
+++ b/memory/mozjemalloc/moz.build
@@ -5,8 +5,12 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'jemalloc'
 
 EXPORTS += [
     'jemalloc_types.h',
 ]
 
+if not CONFIG['MOZ_JEMALLOC3']:
+    CSRCS += [
+        'jemalloc.c',
+    ]
--- a/memory/replace/dmd/Makefile.in
+++ b/memory/replace/dmd/Makefile.in
@@ -12,17 +12,17 @@ include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME	= dmd
 FORCE_SHARED_LIB= 1
 
 DEFINES 	+= -DMOZ_NO_MOZALLOC
 
 VPATH 		+= $(topsrcdir)/xpcom/base
 VPATH 		+= $(topsrcdir)/nsprpub/lib/libc/src
-CSRCS 		+= strcpy.c
+DISABLED_CSRCS 		+= strcpy.c
 
 VPATH 		+= $(topsrcdir)/mfbt
 
 # Disable mozglue.
 WRAP_LDFLAGS 	=
 MOZ_GLUE_LDFLAGS=
 
 STL_FLAGS 	=
--- a/memory/replace/dmd/moz.build
+++ b/memory/replace/dmd/moz.build
@@ -11,8 +11,11 @@ EXPORTS += [
 ]
 
 CPP_SOURCES += [
     'DMD.cpp',
     'HashFunctions.cpp',
     'nsStackWalk.cpp',
 ]
 
+CSRCS += [
+    'strcpy.c',
+]
--- a/memory/replace/dummy/Makefile.in
+++ b/memory/replace/dummy/Makefile.in
@@ -8,11 +8,11 @@ srcdir          = @srcdir@
 VPATH           = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME = replace_malloc
 FORCE_SHARED_LIB = 1
 NO_DIST_INSTALL = 1
 
-CSRCS = dummy_replace_malloc.c
+DISABLED_CSRCS = dummy_replace_malloc.c
 
 include $(topsrcdir)/config/rules.mk
--- a/memory/replace/dummy/moz.build
+++ b/memory/replace/dummy/moz.build
@@ -1,8 +1,11 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 MODULE = 'memory'
 
+CSRCS += [
+    'dummy_replace_malloc.c',
+]
--- a/memory/replace/jemalloc/Makefile.in
+++ b/memory/replace/jemalloc/Makefile.in
@@ -17,24 +17,24 @@ SHARED_LIBRARY_LIBS = $(call EXPAND_LIBN
 DEFINES += -DMOZ_JEMALLOC3 -DMOZ_REPLACE_JEMALLOC
 LOCAL_INCLUDES += -I../../jemalloc/src/include
 ifdef _MSC_VER
 LOCAL_INCLUDES += -I$(topsrcdir)/memory/jemalloc/src/include/msvc_compat
 endif
 
 VPATH += $(topsrcdir)/memory/build
 
-CSRCS = \
+DISABLED_CSRCS = \
   mozjemalloc_compat.c \
   jemalloc_config.c \
   $(NULL)
 
 MOZ_GLUE_LDFLAGS = # Don't link against mozglue
 WRAP_LDFLAGS = # Never wrap malloc function calls with -Wl,--wrap
 
 # Android doesn't have pthread_atfork, so just implement a dummy function.
 # It shouldn't make much problem, as the use of fork is pretty limited on
 # Android.
 ifeq ($(MOZ_WIDGET_TOOLKIT),android)
-CSRCS += pthread_atfork.c
+DISABLED_CSRCS += pthread_atfork.c
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/memory/replace/jemalloc/moz.build
+++ b/memory/replace/jemalloc/moz.build
@@ -1,8 +1,20 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 MODULE = 'memory'
 
+CSRCS += [
+    'jemalloc_config.c',
+    'mozjemalloc_compat.c',
+]
+
+# Android doesn't have pthread_atfork, so just implement a dummy function.
+# It shouldn't make much problem, as the use of fork is pretty limited on
+# Android.
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
+    CSRCS += [
+        'pthread_atfork.c',
+    ]