Bug 968642 - Port RCFILE and RESFILE to moz.build; r=gps
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 10 Feb 2014 09:03:53 -0500
changeset 167894 d7de458158018de8659df32345c28151edae1eb4
parent 167893 c7566c3f5a48a52448b8747fc4c2074aecf4bf19
child 167895 f50a87548c0ee8735bcc425495356c16e68c2e22
push id26191
push userryanvm@gmail.com
push dateMon, 10 Feb 2014 20:42:58 +0000
treeherdermozilla-central@d812f80a0f1d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs968642
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 968642 - Port RCFILE and RESFILE to moz.build; r=gps
browser/app/Makefile.in
db/sqlite3/src/Makefile.in
db/sqlite3/src/moz.build
dom/plugins/test/testplugin/testplugin.mk
dom/plugins/test/testplugin/testplugin.mozbuild
embedding/tests/winEmbed/Makefile.in
embedding/tests/winEmbed/moz.build
gfx/angle/src/libEGL/Makefile.in
gfx/angle/src/libEGL/moz.build
gfx/angle/src/libGLESv2/Makefile.in
gfx/angle/src/libGLESv2/moz.build
js/src/Makefile.in
js/src/moz.build
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/frontend/sandbox_symbols.py
python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
python/mozbuild/mozbuild/test/frontend/test_emitter.py
toolkit/library/Makefile.in
toolkit/library/moz.build
widget/os2/Makefile.in
widget/os2/moz.build
widget/windows/Makefile.in
widget/windows/moz.build
xulrunner/app/Makefile.in
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -77,17 +77,16 @@ EXTRA_DEPS += firefox.exe.manifest
 ifndef GNU_CC
 RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
 else
 RCFLAGS += -DMOZ_PHOENIX --include-dir $(srcdir)
 endif
 endif
 
 ifeq ($(OS_ARCH),OS2)
-RESFILE=splashos2.res
 RCFLAGS += -DMOZ_PHOENIX
 RCFLAGS += -DFIREFOX_ICO='"$(DIST)/branding/firefox-os2.ico"' -DDOCUMENT_ICO='"$(DIST)/branding/document-os2.ico"'
 endif
 
 PROGRAMS_DEST = $(DIST)/bin
 
 include $(topsrcdir)/config/rules.mk
 
--- a/db/sqlite3/src/Makefile.in
+++ b/db/sqlite3/src/Makefile.in
@@ -2,18 +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/.
 
 LIB_IS_C_ONLY    = 1
 
 ifeq ($(OS_ARCH),WINNT)
 DEFFILE = $(CURDIR)/sqlite-processed.def
-RCFILE  = sqlite.rc
-RESFILE = sqlite.res
 
 GARBAGE += \
   sqlite-version.h \
   $(DEFFILE) \
   $(NULL)
 
 # We generate the appropriate version header file with our python script.
 sqlite-version.h: sqlite-version.py sqlite3.h
--- a/db/sqlite3/src/moz.build
+++ b/db/sqlite3/src/moz.build
@@ -61,8 +61,12 @@ if CONFIG['OS_TARGET'] == 'Android':
 # causes assertions on Win64. See bug 719579.
 if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_MEMORY']:
     DEFINES['HAVE_MALLOC_USABLE_SIZE'] = True
     DEFINES['SQLITE_WITHOUT_MSIZE'] = True
 
 # disable PGO for Sun Studio
 if CONFIG['SOLARIS_SUNPRO_CC']:
     NO_PGO = True
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+    RCFILE  = 'sqlite.rc'
+    RESFILE = 'sqlite.res'
--- a/dom/plugins/test/testplugin/testplugin.mk
+++ b/dom/plugins/test/testplugin/testplugin.mk
@@ -15,18 +15,16 @@ CXXFLAGS        += $(MOZ_QT_CFLAGS)
 CFLAGS          += $(MOZ_QT_CFLAGS)
 EXTRA_DSO_LDOPTS = \
                 $(MOZ_QT_LIBS) \
                 $(XLDFLAGS) \
                 $(XLIBS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
-RCFILE    = nptest.rc
-RESFILE   = nptest.res
 DEFFILE   = $(win_srcdir)/nptest.def
 OS_LIBS  += $(call EXPAND_LIBNAME,msimg32)
 
 # Windows opt builds without PGO break nptest.dll
 MOZ_OPTIMIZE=
 endif
 
 TEST_PLUGIN_FILES = $(SHARED_LIBRARY)
--- a/dom/plugins/test/testplugin/testplugin.mozbuild
+++ b/dom/plugins/test/testplugin/testplugin.mozbuild
@@ -37,8 +37,12 @@ elif toolkit == 'qt':
         relative_path + '/nptest_qt.cpp',
     ]
 elif toolkit == 'windows':
     UNIFIED_SOURCES += [
         relative_path + '/nptest_windows.cpp',
     ]
 
 FORCE_SHARED_LIB = True
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+    RCFILE  = 'nptest.rc'
+    RESFILE = 'nptest.res'
--- a/embedding/tests/winEmbed/Makefile.in
+++ b/embedding/tests/winEmbed/Makefile.in
@@ -22,18 +22,16 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 #
 # Contributor(s):
 #
 # ***** END LICENSE BLOCK *****
 
-RESFILE		= winEmbed.res
-
 LIBS = \
 	$(DEPTH)/profile/dirserviceprovider/standalone/$(LIB_PREFIX)profdirserviceprovidersa_s.$(LIB_SUFFIX) \
 	$(XPCOM_STANDALONE_GLUE_LDOPTS) \
 	$(NULL)
 
 STL_FLAGS=
 
 OS_LIBS		+= $(call EXPAND_LIBNAME,ole32 comdlg32 shell32 version)
--- a/embedding/tests/winEmbed/moz.build
+++ b/embedding/tests/winEmbed/moz.build
@@ -10,8 +10,10 @@ SOURCES += [
     'WebBrowserChrome.cpp',
     'WindowCreator.cpp',
     'winEmbed.cpp',
 ]
 
 XPI_NAME = 'winembed'
 
 DEFINES['XPCOM_GLUE'] = True
+
+RESFILE = 'winEmbed.res'
--- a/gfx/angle/src/libEGL/Makefile.in
+++ b/gfx/angle/src/libEGL/Makefile.in
@@ -9,17 +9,16 @@ ifndef GNU_CC
 # Enable unwind semantics for exception handlers in response to warning C4530.
 OS_CPPFLAGS += -EHsc
 endif
 
 # Below is a transcription of the EGL target from build_angle.gypi.
 # Target: 'libEGL'
 #   Links with: 'libGLESv2'
 DEFFILE = $(srcdir)/libEGL.def
-RCFILE  = $(srcdir)/libEGL.rc
 
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += -I'$(MOZ_DIRECTX_SDK_PATH)/include'
 
 #OS_LIBS += $(call EXPAND_LIBNAME,dwmapi)
 
 ifdef GNU_CC
--- a/gfx/angle/src/libEGL/moz.build
+++ b/gfx/angle/src/libEGL/moz.build
@@ -37,8 +37,10 @@ LOCAL_INCLUDES += [
 for var in ('LIBEGL_EXPORTS', 'ANGLE_BUILD', 'NOMINMAX',
             '_CRT_SECURE_NO_DEPRECATE', 'ANGLE_DISABLE_TRACE'):
     DEFINES[var] = True
 
 if not CONFIG['MOZ_DEBUG']:
     DEFINES['_SECURE_SCL'] = 0
 
 DEFINES['ANGLE_COMPILE_OPTIMIZATION_LEVEL'] = 'D3DCOMPILE_OPTIMIZATION_LEVEL1'
+
+RCFILE = SRCDIR + '/libEGL.rc'
--- a/gfx/angle/src/libGLESv2/Makefile.in
+++ b/gfx/angle/src/libGLESv2/Makefile.in
@@ -6,17 +6,16 @@
 STL_FLAGS =
 
 ifndef GNU_CC
 # Enable unwind semantics for exception handlers in response to warning C4530.
 OS_CPPFLAGS += -EHsc
 endif
 
 DEFFILE = $(srcdir)/libGLESv2.def
-RCFILE  = $(srcdir)/libGLESv2.rc
 
 # End build_angle.gypi transcription.
 
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += -I'$(MOZ_DIRECTX_SDK_PATH)/include'
 
 ifdef GNU_CC
--- a/gfx/angle/src/libGLESv2/moz.build
+++ b/gfx/angle/src/libGLESv2/moz.build
@@ -188,8 +188,10 @@ for var in ('LIBGLESV2_EXPORTS', 'ANGLE_
             '_CRT_SECURE_NO_DEPRECATE', 'ANGLE_DISABLE_TRACE',
             'COMPILER_IMPLEMENTATION'):
     DEFINES[var] = True
 
 if not CONFIG['MOZ_DEBUG']:
     DEFINES['_SECURE_SCL'] = 0
 
 DEFINES['ANGLE_COMPILE_OPTIMIZATION_LEVEL'] = 'D3DCOMPILE_OPTIMIZATION_LEVEL1'
+
+RCFILE = SRCDIR + '/libGLESv2.rc'
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -217,21 +217,16 @@ 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
 
-ifdef MOZ_ETW
-# This will get the ETW provider resources into the library mozjs.dll
-RESFILE = ETWProvider.res
-endif
-
 # HP-UX does not require the extra linking of "-lm"
 ifeq (,$(filter HP-UX WINNT OS2,$(OS_ARCH)))
 EXTRA_LIBS	+= -lm
 endif
 
 CFLAGS += $(MOZ_ZLIB_CFLAGS)
 EXTRA_LIBS += $(MOZ_ZLIB_LIBS)
 # Enable zlib usage if zlib has been located. When building the browser on
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -404,16 +404,18 @@ if CONFIG['JS_SHARED_LIBRARY']:
     FORCE_SHARED_LIB = True
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['MOZ_ETW']:
     GENERATED_FILES = [
         'ETWProvider.h',
     ]
+    # This will get the ETW provider resources into the library mozjs.dll
+    RESFILE = 'ETWProvider.res'
 
 if CONFIG['NIGHTLY_BUILD']:
     DEFINES['ENABLE_PARALLEL_JS'] = True
     DEFINES['ENABLE_BINARYDATA'] = True
 
 DEFINES['EXPORT_JS_API'] = True
 
 if CONFIG['JS_THREADSAFE']:
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -231,16 +231,18 @@ class TreeMetadataEmitter(LoggingMixin):
             'IS_COMPONENT',
             'IS_GYP_DIR',
             'JS_MODULES_PATH',
             'LIBS',
             'LIBXUL_LIBRARY',
             'MSVC_ENABLE_PGO',
             'NO_DIST_INSTALL',
             'OS_LIBS',
+            'RCFILE',
+            'RESFILE',
             'SDK_LIBRARY',
         ]
         for v in varlist:
             if v in sandbox and sandbox[v]:
                 passthru.variables[v] = sandbox[v]
 
         # NO_VISIBILITY_FLAGS is slightly different
         if sandbox['NO_VISIBILITY_FLAGS']:
--- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
+++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
@@ -317,16 +317,28 @@ VARIABLES = {
         """, None),
 
     'OS_LIBS': (list, list,
         """System link libraries.
 
         This variable contains a list of system libaries to link against.
         """, None),
 
+    'RCFILE': (unicode, unicode,
+        """The program .rc file.
+
+        This variable can only be used on Windows (and OS/2).
+        """, None),
+
+    'RESFILE': (unicode, unicode,
+        """The program .res file.
+
+        This variable can only be used on Windows (and OS/2).
+        """, None),
+
     'SDK_LIBRARY': (StrictOrderingOnAppendList, list,
         """Elements of the distributed SDK.
 
         Files on this list will be copied into ``SDK_LIB_DIR``
         (``$DIST/sdk/lib``).
         """, None),
 
     'SIMPLE_PROGRAMS': (StrictOrderingOnAppendList, list,
--- a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
+++ b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
@@ -30,8 +30,11 @@ SOURCES += ['bar.mm', 'foo.mm']
 SOURCES += ['baz.S', 'foo.S']
 
 FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 MSVC_ENABLE_PGO = True
 NO_VISIBILITY_FLAGS = True
 
 DELAYLOAD_DLLS = ['foo.dll', 'bar.dll']
+
+RCFILE = 'foo.rc'
+RESFILE = 'bar.res'
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -323,16 +323,22 @@ class TestRecursiveMakeBackend(BackendTe
             ],
             'DELAYLOAD_LDFLAGS': [
                 'DELAYLOAD_LDFLAGS += -DELAYLOAD:foo.dll',
                 'DELAYLOAD_LDFLAGS += -DELAYLOAD:bar.dll',
             ],
             'USE_DELAYIMP': [
                 'USE_DELAYIMP := 1',
             ],
+            'RCFILE': [
+                'RCFILE := foo.rc',
+            ],
+            'RESFILE': [
+                'RESFILE := bar.res',
+            ],
         }
 
         for var, val in expected.items():
             # print("test_variable_passthru[%s]" % (var))
             found = [str for str in lines if str.startswith(var)]
             self.assertEqual(found, val)
 
     def test_exports(self):
--- a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
+++ b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
@@ -36,8 +36,11 @@ MSVC_ENABLE_PGO = True
 NO_DIST_INSTALL = True
 
 FORCE_SHARED_LIB = True
 EXPORT_LIBRARY = True
 IS_COMPONENT = True
 NO_VISIBILITY_FLAGS = True
 
 DELAYLOAD_DLLS = ['foo.dll', 'bar.dll']
+
+RCFILE = 'foo.rc'
+RESFILE = 'bar.res'
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -166,16 +166,18 @@ class TestEmitterBasic(unittest.TestCase
             MSVC_ENABLE_PGO=True,
             NO_DIST_INSTALL=True,
             OS_LIBS=['foo.so', '-l123', 'aaa.a'],
             SDK_LIBRARY=['fans.sdk', 'tans.sdk'],
             SSRCS=['bans.S', 'fans.S'],
             VISIBILITY_FLAGS='',
             DELAYLOAD_LDFLAGS=['-DELAYLOAD:foo.dll', '-DELAYLOAD:bar.dll'],
             USE_DELAYIMP=True,
+            RCFILE='foo.rc',
+            RESFILE='bar.res',
         )
 
         variables = objs[0].variables
         maxDiff = self.maxDiff
         self.maxDiff = None
         self.assertEqual(wanted, variables)
         self.maxDiff = maxDiff
 
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -30,17 +30,16 @@ SHARED_LIBRARY_LIBS += \
 ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
 RCINCLUDE = xulrunner.rc
 
 LOCAL_INCLUDES += -I$(topsrcdir)/widget/windows
 LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
 endif
 
 ifeq ($(OS_ARCH),OS2)
-RESFILE = xulrunos2.res
 RCFLAGS += -i $(topsrcdir)/widget/os2
 
 LOCAL_INCLUDES += -I$(topsrcdir)/widget/os2
 LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
 endif
 
 # dependent libraries
 ifdef MOZ_B2G_BT_BLUEZ #{
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -39,16 +39,27 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] not in (
    CONFIG['MOZ_XUL']:
     DEFINES['MOZ_FILEVIEW'] = True
 
 # Platform-specific icon channel stuff - supported mostly-everywhere
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'os2', 'mac', 'cocoa',
                                     'gtk2', 'gtk3', 'qt', 'android'):
     DEFINES['ICON_DECODER'] = True
 
+LOCAL_INCLUDES += [
+    '/config',
+    # need widget/windows for resource.h (included from widget.rc)
+    '/widget/windows',
+]
+
+if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
+    LOCAL_INCLUDES += [
+        '/xpcom/base',
+    ]
+
 FAIL_ON_WARNINGS = True
 
 MSVC_ENABLE_PGO = True
 
 FORCE_SHARED_LIB = True
 
 DELAYLOAD_DLLS += [
     'comdlg32.dll',
--- a/widget/os2/Makefile.in
+++ b/widget/os2/Makefile.in
@@ -1,15 +1,13 @@
 #
 # 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/.
 
-RESFILE		= widget.res
-
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += $(MOZ_CAIRO_CFLAGS)
 
 install-readme:	README.$(MOZ_APP_NAME)
 ifneq (,$(filter-out xulrunner sunbird,$(MOZ_APP_NAME)))
 	cp -f $^ $(DIST)/bin/README.txt
 endif
--- a/widget/os2/moz.build
+++ b/widget/os2/moz.build
@@ -31,8 +31,10 @@ FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '../xpwidgets',
 ]
 
 
 DEFINES['USE_OS2_TOOLKIT_HEADERS'] = True
 
 DEFINES['MOZ_APP_DISPLAYNAME'] = '"%s"' % CONFIG['MOZ_APP_DISPLAYNAME']
+
+RESFILE = 'widget.res'
--- a/widget/windows/Makefile.in
+++ b/widget/windows/Makefile.in
@@ -1,10 +1,8 @@
 #
 # 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/.
 
-RESFILE		= widget.res
-
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += $(MOZ_CAIRO_CFLAGS)
--- a/widget/windows/moz.build
+++ b/widget/windows/moz.build
@@ -107,8 +107,10 @@ LOCAL_INCLUDES += [
     '/xpcom/base',
 ]
 
 DEFINES['MOZ_UNICODE'] = True
 
 for var in ('MOZ_ENABLE_D3D9_LAYER', 'MOZ_ENABLE_D3D10_LAYER'):
     if CONFIG[var]:
         DEFINES[var] = True
+
+RESFILE = 'widget.res'
--- a/xulrunner/app/Makefile.in
+++ b/xulrunner/app/Makefile.in
@@ -54,17 +54,16 @@ else
 RCFLAGS += -DMOZ_XULRUNNER --include-dir $(srcdir)
 endif
 ifdef DEBUG
 RCFLAGS += -DDEBUG
 endif
 endif
 
 ifeq ($(OS_ARCH),OS2)
-RESFILE=splashos2.res
 RCFLAGS += -DMOZ_XULRUNNER
 ifdef DEBUG
 RCFLAGS += -DDEBUG
 endif
 RCFLAGS += -DXULRUNNER_ICO='"$(DIST)/branding/xulrunner.ico"' -DDOCUMENT_ICO='"$(DIST)/branding/document.ico"'
 endif
 
 include $(topsrcdir)/config/rules.mk