Bug 870406 part n - Move more CSRCS to moz.build. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 01 Nov 2013 10:30:45 +0900
changeset 167499 564210bf70b39f6cc0223eec802521e83a97151c
parent 167498 b019f38b651b9467b654cbc8dbc3e37cd5b62f1d
child 167500 f61be58972b6b0200a29f990add43d0e764c95e2
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs870406
milestone28.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 870406 part n - Move more CSRCS to moz.build. r=mshal
accessible/public/msaa/Makefile.in
accessible/public/msaa/moz.build
b2g/gaia/Makefile.in
b2g/gaia/moz.build
build/stlport/Makefile.in
build/stlport/moz.build
build/unix/elfhack/Makefile.in
build/unix/elfhack/inject/Makefile.in
build/unix/elfhack/inject/moz.build
gfx/cairo/cairo/src/Makefile.in
gfx/cairo/cairo/src/moz.build
gfx/ots/src/Makefile.in
ipc/chromium/Makefile.in
ipc/chromium/moz.build
media/libtheora/lib/Makefile.in
media/libtheora/lib/moz.build
xpcom/base/Makefile.in
xpcom/base/moz.build
xpcom/build/Makefile.in
xpcom/build/moz.build
--- a/accessible/public/msaa/Makefile.in
+++ b/accessible/public/msaa/Makefile.in
@@ -5,26 +5,16 @@
 DEFFILE = $(win_srcdir)/AccessibleMarshal.def
 
 DEFINES += -DREGISTER_PROXY_DLL
 
 GARBAGE += $(MIDL_GENERATED_FILES) done_gen dlldata.c
 
 FORCE_SHARED_LIB = 1
 
-CSRCS	= \
-	dlldata.c \
-	ISimpleDOMNode_p.c \
-	ISimpleDOMNode_i.c \
-	ISimpleDOMDocument_p.c \
-	ISimpleDOMDocument_i.c \
-	ISimpleDOMText_p.c \
-	ISimpleDOMText_i.c \
-	$(NULL)
-
 MIDL_GENERATED_FILES = \
 	ISimpleDOMNode.h \
 	ISimpleDOMNode_p.c \
 	ISimpleDOMNode_i.c \
 	ISimpleDOMDocument.h \
 	ISimpleDOMDocument_p.c \
 	ISimpleDOMDocument_i.c \
 	ISimpleDOMText.h \
--- a/accessible/public/msaa/moz.build
+++ b/accessible/public/msaa/moz.build
@@ -3,8 +3,17 @@
 # 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 = 'accessibility'
 
 LIBRARY_NAME = 'AccessibleMarshal'
 
+GENERATED_SOURCES += [
+    'dlldata.c',
+    'ISimpleDOMDocument_i.c',
+    'ISimpleDOMDocument_p.c',
+    'ISimpleDOMNode_i.c',
+    'ISimpleDOMNode_p.c',
+    'ISimpleDOMText_i.c',
+    'ISimpleDOMText_p.c',
+]
--- a/b2g/gaia/Makefile.in
+++ b/b2g/gaia/Makefile.in
@@ -5,17 +5,16 @@
 GAIA_PATH := gaia/profile
 
 ifeq ($(OS_ARCH),WINNT)
 DEFINES += \
   -DB2G_NAME=L\"$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)\" \
   -DGAIA_PATH=L\"$(subst /,\\\\,$(GAIA_PATH))\" \
   $(NULL)
 else # Non-windows machines use the same wrapper program
-CSRCS = run-b2g.c
 DEFINES += \
   -DB2G_NAME=\"$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)\" \
   -DGAIA_PATH=\"$(GAIA_PATH)\" \
   $(NULL)
 endif
 
 ifdef .PYMAKE
 # For use of GNU make in pymake builds.
--- a/b2g/gaia/moz.build
+++ b/b2g/gaia/moz.build
@@ -5,8 +5,12 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 PROGRAM = CONFIG['MOZ_APP_NAME']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         'run-b2g.cpp',
     ]
+else:
+    SOURCES += [
+        'run-b2g.c',
+    ]
--- a/build/stlport/Makefile.in
+++ b/build/stlport/Makefile.in
@@ -4,18 +4,13 @@
 
 MODULES = stlport
 STL_FLAGS =
 
 # Force to build a static library, instead of a fake library, without
 # installing it in dist/lib.
 LIBRARY = $(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX)
 
-VPATH += $(srcdir)/src
-
-CPPSRCS += $(notdir $(wildcard $(srcdir)/src/*.cpp))
-CSRCS = $(notdir $(wildcard $(srcdir)/src/*.c))
-
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -D_GNU_SOURCE
 CXXFLAGS += -fuse-cxa-atexit
 INCLUDES += -I$(srcdir)/stlport
--- a/build/stlport/moz.build
+++ b/build/stlport/moz.build
@@ -2,8 +2,46 @@
 # 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/.
 
 LIBRARY_NAME = 'stlport_static'
 
 FORCE_STATIC_LIB = True
+
+SOURCES += [
+    'src/allocators.cpp',
+    'src/bitset.cpp',
+    'src/codecvt.cpp',
+    'src/collate.cpp',
+    'src/complex.cpp',
+    'src/complex_io.cpp',
+    'src/complex_trig.cpp',
+    'src/ctype.cpp',
+    'src/dll_main.cpp',
+    'src/facets_byname.cpp',
+    'src/fstream.cpp',
+    'src/ios.cpp',
+    'src/iostream.cpp',
+    'src/istream.cpp',
+    'src/locale.cpp',
+    'src/locale_catalog.cpp',
+    'src/locale_impl.cpp',
+    'src/messages.cpp',
+    'src/monetary.cpp',
+    'src/num_get.cpp',
+    'src/num_get_float.cpp',
+    'src/num_put.cpp',
+    'src/num_put_float.cpp',
+    'src/numpunct.cpp',
+    'src/ostream.cpp',
+    'src/sstream.cpp',
+    'src/stdio_streambuf.cpp',
+    'src/string.cpp',
+    'src/strstream.cpp',
+    'src/time_facets.cpp',
+]
+
+SOURCES += [
+    'src/c_locale.c',
+    'src/cxa.c',
+]
--- a/build/unix/elfhack/Makefile.in
+++ b/build/unix/elfhack/Makefile.in
@@ -13,17 +13,17 @@ VPATH += $(topsrcdir)/build
 OS_CXXFLAGS := $(filter-out -fno-exceptions,$(OS_CXXFLAGS)) -fexceptions
 
 WRAP_LDFLAGS=
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DELFHACK_BUILD
 
-test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX): %$(DLL_SUFFIX): %.$(OBJ_SUFFIX) elfhack $(filter inject/%,$(CSRCS:.c=.$(OBJ_SUFFIX)))
+test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX): %$(DLL_SUFFIX): %.$(OBJ_SUFFIX) elfhack
 	$(MKSHLIB) $(LDFLAGS) $< -nostartfiles
 	@echo ===
 	@echo === If you get failures below, please file a bug describing the error
 	@echo === and your environment \(compiler and linker versions\), and use
 	@echo === --disable-elf-hack until this is fixed.
 	@echo ===
 	# Fail if the library doesn't have $(DT_TYPE) .dynamic info
 	$(TOOLCHAIN_PREFIX)readelf -d $@ | grep '($(DT_TYPE))'
--- a/build/unix/elfhack/inject/Makefile.in
+++ b/build/unix/elfhack/inject/Makefile.in
@@ -1,36 +1,21 @@
 #
 # 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/.
 
 INTERNAL_TOOLS = 1
 NO_PROFILE_GUIDED_OPTIMIZE = 1
 
-ifneq (,$(filter %86,$(TARGET_CPU)))
-CPU := x86
-else
-ifneq (,$(filter arm%,$(TARGET_CPU)))
-CPU := arm
-else
-CPU := $(TARGET_CPU)
-endif
-endif
-
-CSRCS := \
-  $(CPU).c \
-  $(CPU)-noinit.c \
-  $(NULL)
-
 include $(topsrcdir)/config/rules.mk
 
 export:: $(CSRCS:.c=.$(OBJ_SUFFIX))
 
 $(CSRCS): %.c: ../inject.c
 	cp $< $@
 
 GARBAGE += $(CSRCS)
 
 DEFINES += -DELFHACK_BUILD
 
 CFLAGS := -O2 -fno-stack-protector $(filter -m% -I%,$(CFLAGS))
-$(CPU)-noinit.$(OBJ_SUFFIX): DEFINES += -DNOINIT
+%-noinit.$(OBJ_SUFFIX): DEFINES += -DNOINIT
--- a/build/unix/elfhack/inject/moz.build
+++ b/build/unix/elfhack/inject/moz.build
@@ -1,7 +1,19 @@
 # -*- 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/.
 
 NO_DIST_INSTALL = True
+
+if CONFIG['TARGET_CPU'].endswith('86'):
+    cpu = 'x86'
+elif CONFIG['TARGET_CPU'].startswith('arm'):
+    cpu = 'arm'
+else:
+    cpu = CONFIG['TARGET_CPU']
+
+GENERATED_SOURCES += [ s % cpu for s in [
+    "%s-noinit.c",
+    "%s.c",
+]]
--- a/gfx/cairo/cairo/src/Makefile.in
+++ b/gfx/cairo/cairo/src/Makefile.in
@@ -4,88 +4,39 @@
 
 ifdef GNU_CC
 ifeq ($(OS_TARGET),Android)
 MODULE_OPTIMIZE_FLAGS = -O2
 endif
 endif
 
 
-ifneq ($(MOZ_WIDGET_TOOLKIT),cocoa)
-CSRCS += cairo-deflate-stream.c
-endif
-
-# cairo-type1-subset.c should be here, but it's only supported on freetype platforms
-
-PSPDF_BASE_CSRCS = \
-	cairo-base85-stream.c \
-	cairo-type1-fallback.c \
-	cairo-type3-glyph-surface.c \
-	cairo-truetype-subset.c \
-	cairo-cff-subset.c \
-	$(NULL)
-
-PDF_CSRCS = \
-	cairo-pdf-surface.c \
-	cairo-pdf-operators.c \
-	$(NULL)
-
-PS_CSRCS = cairo-ps-surface.c
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 DEFINES += -DDISABLE_SOME_FLOATING_POINT
-CSRCS	+=	cairo-win32-surface.c
-
-CSRCS	+=	cairo-win32-font.c
-
-ifdef NS_PRINTING
-CSRCS   += cairo-win32-printing-surface.c
-else
+ifndef NS_PRINTING
 DEFINES += -DCAIRO_OMIT_WIN32_PRINTING
 endif
-
-CSRCS   += $(PSPDF_BASE_CSRCS) $(PDF_CSRCS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
 DEFINES += -DOS2_USE_PLATFORM_ALLOC
 ifdef MOZ_OS2_HIGH_MEMORY
 DEFINES += -DOS2_HIGH_MEMORY
 endif
-CSRCS   += cairo-os2-surface.c
-CSRCS   += $(PSPDF_BASE_CSRCS) $(PDF_CSRCS)
-endif
-
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-CSRCS   += cairo-quartz-surface.c cairo-quartz-image-surface.c cairo-quartz-font.c
-endif
-
-ifdef MOZ_WIDGET_GTK
-CSRCS   += $(PSPDF_BASE_CSRCS) $(PDF_CSRCS) $(PS_CSRCS)
-endif
-
-ifneq (,$(filter android gonk,$(MOZ_WIDGET_TOOLKIT)))
-CSRCS   += $(PSPDF_BASE_CSRCS) $(PDF_CSRCS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
-CSRCS   += $(PSPDF_BASE_CSRCS) $(PDF_CSRCS) 
 OS_INCLUDES += $(MOZ_QT_CFLAGS)
 endif
 
 ifdef MOZ_X11
-CSRCS   += cairo-xlib-surface.c \
-	   cairo-xlib-screen.c \
-	   cairo-xlib-visual.c \
-	   cairo-xlib-display.c
 OS_INCLUDES += $(XCFLAGS)
 endif
 
 ifdef MOZ_ENABLE_CAIRO_FT
-CSRCS   += cairo-ft-font.c cairo-type1-subset.c
 OS_INCLUDES += $(CAIRO_FT_CFLAGS)
 endif
 
 LOCAL_INCLUDES  += -I$(srcdir)
 
 INSTALL_TARGETS += cairo_features
 cairo_features_FILES := cairo-features.h
 cairo_features_DEST = $(DIST)/include/cairo
--- a/gfx/cairo/cairo/src/moz.build
+++ b/gfx/cairo/cairo/src/moz.build
@@ -12,75 +12,112 @@ EXPORTS.cairo += [
     'cairo-deprecated.h',
     'cairo-platform.h',
     'cairo-rename.h',
     'cairo-tee.h',
     'cairo-version.h',
     'cairo.h',
 ]
 
+if CONFIG['MOZ_WIDGET_TOOLKIT'] not in ('cocoa', 'uikit'):
+    EXPORTS.cairo += [
+        'cairo-pdf.h',
+    ]
+    SOURCES += [
+        'cairo-base85-stream.c',
+        'cairo-cff-subset.c',
+        'cairo-deflate-stream.c',
+        'cairo-pdf-operators.c',
+        'cairo-pdf-surface.c',
+        'cairo-truetype-subset.c',
+        # cairo-type1-subset.c should be here, but it's only supported on freetype platforms
+        'cairo-type1-fallback.c',
+        'cairo-type3-glyph-surface.c',
+    ]
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     EXPORTS.cairo += [
-        'cairo-pdf.h',
         'cairo-win32.h',
     ]
     if CONFIG['MOZ_ENABLE_DWRITE_FONT']:
         SOURCES += [
             'cairo-dwrite-font.cpp',
         ]
     if CONFIG['MOZ_ENABLE_D2D_SURFACE']:
         SOURCES += [
             'cairo-d2d-surface.cpp',
         ]
+    SOURCES += [
+        'cairo-win32-font.c',
+        'cairo-win32-surface.c',
+    ]
+    if CONFIG['NS_PRINTING']:
+        SOURCES += [
+            'cairo-win32-printing-surface.c',
+        ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'os2':
     EXPORTS.cairo += [
         'cairo-os2-private.h',
         'cairo-os2.h',
-        'cairo-pdf.h',
+    ]
+    SOURCES += [
+        'cairo-os2-surface.c',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     EXPORTS.cairo += [
         'cairo-quartz-image.h',
         'cairo-quartz.h',
     ]
+    SOURCES += [
+        'cairo-quartz-font.c',
+        'cairo-quartz-image-surface.c',
+        'cairo-quartz-surface.c',
+    ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'beos':
     EXPORTS.cairo += [
         'cairo-beos.h',
     ]
     SOURCES += [
         'cairo-beos-surface.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_GTK']:
     EXPORTS.cairo += [
-        'cairo-pdf.h',
         'cairo-ps.h',
     ]
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk'):
-    EXPORTS.cairo += [
-        'cairo-pdf.h',
+    SOURCES += [
+        'cairo-ps-surface.c',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
     EXPORTS.cairo += [
-        'cairo-pdf.h',
         'cairo-qt.h',
     ]
     SOURCES += [
         'cairo-qt-surface.cpp',
     ]
 
 if CONFIG['MOZ_X11']:
     EXPORTS.cairo += [
         'cairo-xlib-xrender.h',
         'cairo-xlib.h',
     ]
+    SOURCES += [
+        'cairo-xlib-display.c',
+        'cairo-xlib-screen.c',
+        'cairo-xlib-surface.c',
+        'cairo-xlib-visual.c',
+    ]
 
 if CONFIG['MOZ_ENABLE_CAIRO_FT']:
     EXPORTS.cairo += [
         'cairo-ft.h',
     ]
+    SOURCES += [
+        'cairo-ft-font.c',
+        'cairo-type1-subset.c',
+    ]
 
 LIBRARY_NAME = 'mozcairo'
 
 LIBXUL_LIBRARY = True
 
 SOURCES += [
     'cairo-analysis-surface.c',
     'cairo-arc.c',
--- a/gfx/ots/src/Makefile.in
+++ b/gfx/ots/src/Makefile.in
@@ -23,19 +23,16 @@
 #
 # Mozilla author(s): Jonathan Kew
 #
 
 
 ifeq (WINNT,$(OS_TARGET))
 endif
 
-CSRCS =   \
-  $(NULL)
-
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DPACKAGE_VERSION="\"moz\""
 DEFINES += -DPACKAGE_BUGREPORT="\"http://bugzilla.mozilla.org/\""
 DEFINES += -DNOMINMAX
 DEFINES += -DMOZ_OTS_REPORT_ERRORS
 
 ifeq (WINNT,$(OS_TARGET))
--- a/ipc/chromium/Makefile.in
+++ b/ipc/chromium/Makefile.in
@@ -37,65 +37,34 @@ endif # } Not WINNT (OS_POSIX)
 ifndef MOZ_NATIVE_LIBEVENT # {
 
 ifneq ($(OS_ARCH),WINNT) # (if OS_POSIX) {
 
 LOCAL_INCLUDES += -I$(srcdir)/src/third_party/libevent
 LOCAL_INCLUDES += -I$(srcdir)/src/third_party/libevent/include
 DEFINES += -DHAVE_CONFIG_H
 
-CSRCS += \
-  buffer.c \
-  bufferevent.c \
-  bufferevent_sock.c \
-  bufferevent_ratelim.c \
-  evdns.c \
-  event.c \
-  event_tagging.c \
-  evmap.c \
-  evthread.c \
-  evthread_pthread.c \
-  evrpc.c \
-  evutil.c \
-  evutil_rand.c \
-  http.c \
-  listener.c \
-  log.c \
-  poll.c \
-  select.c \
-  signal.c \
-  strlcpy.c \
-  $(NULL)
-
 ifeq ($(OS_ARCH),Darwin) # (OS_MACOSX) {
 LOCAL_INCLUDES += -I$(srcdir)/src/third_party/libevent/mac
-CSRCS += kqueue.c
 
 else # } else {
 
 ifneq (,$(filter-out DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH))) # (OS_LINUX) {
 ifeq ($(OS_TARGET),Android) # {
 LOCAL_INCLUDES += -I$(srcdir)/src/third_party/libevent/android
 else # } else {
 LOCAL_INCLUDES += -I$(srcdir)/src/third_party/libevent/linux
-CSRCS += \
-  epoll_sub.c \
-  $(NULL)
 endif # }
-CSRCS += \
-  epoll.c \
-  $(NULL)
 
 else # } else (OS_BSD)  {
 
 ifneq (,$(filter DragonFly FreeBSD,$(OS_ARCH))) # (not OS_DRAGONFLY and not OS_FREEBSD) {
 DEFINES += -D_EVENT_HAVE_SENDFILE
 endif # }
 LOCAL_INCLUDES += -I$(srcdir)/src/third_party/libevent/bsd
-CSRCS += kqueue.c
 
 endif # }
 
 endif # }
 
 endif # }
 
 endif # }
--- a/ipc/chromium/moz.build
+++ b/ipc/chromium/moz.build
@@ -118,16 +118,39 @@ if os_win:
         'src/base/waitable_event_win.cc',
         'src/base/win_util.cc',
         'src/chrome/common/chrome_constants.cc',
         'src/chrome/common/chrome_paths_win.cc',
         'src/chrome/common/ipc_channel_win.cc',
         'src/chrome/common/process_watcher_win.cc',
         'src/chrome/common/transport_dib_win.cc',
     ]
+else:
+    SOURCES += [
+        'src/third_party/libevent/buffer.c',
+        'src/third_party/libevent/bufferevent.c',
+        'src/third_party/libevent/bufferevent_ratelim.c',
+        'src/third_party/libevent/bufferevent_sock.c',
+        'src/third_party/libevent/evdns.c',
+        'src/third_party/libevent/event.c',
+        'src/third_party/libevent/event_tagging.c',
+        'src/third_party/libevent/evmap.c',
+        'src/third_party/libevent/evrpc.c',
+        'src/third_party/libevent/evthread.c',
+        'src/third_party/libevent/evthread_pthread.c',
+        'src/third_party/libevent/evutil.c',
+        'src/third_party/libevent/evutil_rand.c',
+        'src/third_party/libevent/http.c',
+        'src/third_party/libevent/listener.c',
+        'src/third_party/libevent/log.c',
+        'src/third_party/libevent/poll.c',
+        'src/third_party/libevent/select.c',
+        'src/third_party/libevent/signal.c',
+        'src/third_party/libevent/strlcpy.c',
+    ]
 
 if os_posix:
     SOURCES += [
         'src/base/condition_variable_posix.cc',
         'src/base/debug_util_posix.cc',
         'src/base/event_recorder_stubs.cc',
         'src/base/file_descriptor_shuffle.cc',
         'src/base/file_util_posix.cc',
@@ -175,16 +198,19 @@ if os_macosx:
         'src/base/platform_thread_mac.mm',
         'src/base/process_util_mac.mm',
         'src/base/scoped_nsautorelease_pool.mm',
         'src/base/sys_string_conversions_mac.mm',
         'src/base/worker_pool_mac.mm',
         'src/chrome/common/chrome_paths_mac.mm',
         'src/chrome/common/mach_ipc_mac.mm',
     ]
+    SOURCES += [
+        'src/third_party/libevent/kqueue.c',
+    ]
 
 if os_linux:
     SOURCES += [
         'src/base/atomicops_internals_x86_gcc.cc',
         'src/base/base_paths_linux.cc',
         'src/base/file_version_info_linux.cc',
         'src/base/idle_timer_none.cc',
         'src/base/process_util_linux.cc',
@@ -194,16 +220,23 @@ if os_linux:
         SOURCES += [
             'src/base/message_pump_glib.cc',
         ]
     if CONFIG['MOZ_ENABLE_QT']:
         SOURCES += [
             'src/base/message_pump_qt.cc',
             'src/base/moc_message_pump_qt.cc',
         ]
+    if CONFIG['OS_TARGET'] != 'Android':
+        SOURCES += [
+            'src/third_party/libevent/epoll_sub.c',
+        ]
+    SOURCES += [
+        'src/third_party/libevent/epoll.c',
+    ]
 
 if os_bsd:
     SOURCES += [
         'src/base/atomicops_internals_x86_gcc.cc',
         'src/base/time_posix.cc',
     ]
     if CONFIG['OS_ARCH'] == 'GNU_kFreeBSD':
         SOURCES += [
@@ -217,16 +250,19 @@ if os_bsd:
         SOURCES += [
             'src/base/message_pump_glib.cc',
         ]
     if CONFIG['MOZ_ENABLE_QT']:
         SOURCES += [
             'src/base/message_pump_qt.cc',
             'src/base/moc_message_pump_qt.cc',
         ]
+    SOURCES += [
+        'src/third_party/libevent/kqueue.c',
+    ]
 
 if CONFIG['_MSC_VER']:
     SOURCES += [
         'src/base/debug_on_start.cc',
     ]
 
 ost = CONFIG['OS_TEST']
 if ost.find('86') == -1 and ost.find('arm') == -1 and ost.find('mips') == -1:
--- a/media/libtheora/lib/Makefile.in
+++ b/media/libtheora/lib/Makefile.in
@@ -12,55 +12,19 @@ ifneq ($(OS_ARCH)$(OS_TEST),WINNTx86_64)
 DEFINES += -DOC_X86_ASM
 ifeq (64,$(findstring 64,$(OS_TEST)))
 DEFINES += -DOC_X86_64_ASM
 endif
 endif
 endif
 endif
 
-VPATH := $(srcdir)
-
-ifeq ($(findstring 86,$(OS_TEST)), 86)
-ifdef _MSC_VER
-ifneq (64,$(findstring 64,$(OS_TEST)))
-VPATH += $(srcdir)/x86_vc
-
-CSRCS += \
-  mmxidct.c \
-  mmxfrag.c \
-  mmxstate.c \
-  x86state.c \
-  x86cpu.c \
-  $(NULL)
-endif
-else
-VPATH += $(srcdir)/x86
-
-CSRCS += \
-  mmxidct.c \
-  mmxfrag.c \
-  mmxstate.c \
-  sse2idct.c \
-  x86state.c \
-  x86cpu.c \
-  $(NULL)
-endif
-endif
-
 ifdef GNU_AS
 ifeq ($(findstring arm,$(OS_TEST)), arm)
 
-VPATH += $(srcdir)/arm
-
-CSRCS += \
-  armcpu.c \
-  armstate.c \
-  $(NULL)
-
 DEFINES += -DOC_ARM_ASM -DOC_ARM_ASM_EDSP -DOC_ARM_ASM_MEDIA -DOC_ARM_ASM_NEON
 
 # The Android NDK doesn't pre-define anything to indicate the OS it's on, so
 # do it for them.
 ifeq ($(OS_TARGET),Android)
 DEFINES += -D__linux__
 endif
 
@@ -69,20 +33,20 @@ endif
 ASFLAGS = -march=armv7-a -mfpu=neon
 
 armfrag-gnu.$(ASM_SUFFIX): armopts-gnu.S
 armidct-gnu.$(ASM_SUFFIX): armopts-gnu.S
 armloop-gnu.$(ASM_SUFFIX): armopts-gnu.S
 
 # armopts needs a specific rule, because arm2gnu.pl will always add the .S
 # suffix when translating the files that include it.
-armopts-gnu.S: armopts.s
+armopts-gnu.S: arm/armopts.s
 	$(PERL) $(srcdir)/arm/arm2gnu.pl < $< > $@
 # For all others, we can use an implicit rule with the configured $(ASM_SUFFIX).
-%-gnu.$(ASM_SUFFIX): %.s
+%-gnu.$(ASM_SUFFIX): arm/%.s
 	$(PERL) $(srcdir)/arm/arm2gnu.pl < $< > $@
 
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES = -I$(srcdir)
--- a/media/libtheora/lib/moz.build
+++ b/media/libtheora/lib/moz.build
@@ -27,14 +27,41 @@ SOURCES += [
 if CONFIG['OS_TEST'] == 'arm' and CONFIG['GNU_AS']:
     GENERATED_SOURCES += [ '%s.%s' % (f, CONFIG['ASM_SUFFIX']) for f in [
         'armbits-gnu',
         'armfrag-gnu',
         'armidct-gnu',
         'armloop-gnu',
     ]]
 
+if '86' in CONFIG['OS_TEST']:
+    if CONFIG['_MSC_VER']:
+        if '64' not in CONFIG['OS_TEST']:
+            SOURCES += [
+                'x86_vc/mmxfrag.c',
+                'x86_vc/mmxidct.c',
+                'x86_vc/mmxstate.c',
+                'x86_vc/x86cpu.c',
+                'x86_vc/x86state.c',
+            ]
+    else:
+        SOURCES += [
+            'x86/mmxfrag.c',
+            'x86/mmxidct.c',
+            'x86/mmxstate.c',
+            'x86/sse2idct.c',
+            'x86/x86cpu.c',
+            'x86/x86state.c',
+        ]
+
+if CONFIG['GNU_AS']:
+    if 'arm' in CONFIG['OS_TEST']:
+        SOURCES += [
+            'arm/armcpu.c',
+            'arm/armstate.c',
+        ]
+
 MSVC_ENABLE_PGO = True
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
--- a/xpcom/base/Makefile.in
+++ b/xpcom/base/Makefile.in
@@ -1,21 +1,14 @@
 #
 # 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/.
 
 MOZILLA_INTERNAL_API =1
-ifeq ($(OS_ARCH),WINNT)
-
-ifdef MOZ_DEBUG
-CSRCS		+= pure_api.c
-endif
-
-endif #if OS_ARCH == WINNT
 
 INSTALL_TARGETS += errorlist
 errorlist_FILES := \
   ErrorListCDefines.h \
   ErrorListCxxDefines.h \
   $(NULL)
 errorlist_DEST = $(DIST)/include
 errorlist_TARGET := export
--- a/xpcom/base/moz.build
+++ b/xpcom/base/moz.build
@@ -58,23 +58,23 @@ EXPORTS += [
     'nsISupportsBase.h',
     'nsISupportsObsolete.h',
     'nsObjCExceptions.h',
     'nsStackWalk.h',
     'nsTraceRefcntImpl.h',
     'nsWeakPtr.h',
 ]
 
-if CONFIG['MOZ_DEBUG']:
-    EXPORTS += ['pure.h']
-
 if CONFIG['OS_ARCH'] == 'WINNT':
     EXPORTS += [
         'nsWindowsHelpers.h',
     ]
+    if CONFIG['MOZ_DEBUG']:
+        EXPORTS += ['pure.h']
+        SOURCES += ['pure_api.c']
 
 EXPORTS.mozilla += [
     'AvailableMemoryTracker.h',
     'ClearOnShutdown.h',
     'CycleCollectedJSRuntime.h',
     'nsMemoryInfoDumper.h',
     'StackWalk.h',
     'StaticMutex.h',
--- a/xpcom/build/Makefile.in
+++ b/xpcom/build/Makefile.in
@@ -2,20 +2,16 @@
 #
 # 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/.
 
 
 MOZILLA_INTERNAL_API = 1
 
-ifeq (Darwin, $(OS_ARCH))
-CSRCS = mach_override.c
-endif
-
 SHARED_LIBRARY_LIBS = \
 		$(DEPTH)/chrome/src/$(LIB_PREFIX)chrome_s.$(LIB_SUFFIX) \
 		../ds/$(LIB_PREFIX)xpcomds_s.$(LIB_SUFFIX) \
 		../io/$(LIB_PREFIX)xpcomio_s.$(LIB_SUFFIX) \
 		../components/$(LIB_PREFIX)xpcomcomponents_s.$(LIB_SUFFIX) \
 		../threads/$(LIB_PREFIX)xpcomthreads_s.$(LIB_SUFFIX) \
 		../base/$(LIB_PREFIX)xpcombase_s.$(LIB_SUFFIX) \
 		../reflect/xptcall/src/$(LIB_PREFIX)xptcall.$(LIB_SUFFIX) \
--- a/xpcom/build/moz.build
+++ b/xpcom/build/moz.build
@@ -28,16 +28,17 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     EXPORTS.mozilla += ['perfprobe.h']
     SOURCES += [
         'mozPoisonWriteBase.cpp',
         'mozPoisonWriteWin.cpp',
         'perfprobe.cpp',
     ]
 elif CONFIG['OS_ARCH'] == 'Darwin':
     SOURCES += [
+        'mach_override.c',
         'mozPoisonWriteBase.cpp',
         'mozPoisonWriteMac.cpp',
     ]
 else:
     SOURCES += [
         'mozPoisonWriteStub.cpp',
     ]