Bug 970727 - Move DEFFILE to moz.build; r=mshal
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 11 Feb 2014 11:28:54 -0500
changeset 168081 e93b626422f6b74d92a0d83054b5238cb80e43ee
parent 168080 1ffc31314d2dcc90b4bb4aac1840a4c16c94d883
child 168095 bd4f1281c3b756cbfb0a5de49110ef6e86b7a014
child 168240 e96704e1a7ea2da836ba0fe733c4ed7af7a8a0b7
push idunknown
push userunknown
push dateunknown
reviewersmshal
bugs970727
milestone30.0a1
Bug 970727 - Move DEFFILE to moz.build; r=mshal
accessible/public/ia2/Makefile.in
accessible/public/ia2/moz.build
accessible/public/msaa/Makefile.in
accessible/public/msaa/moz.build
build/win32/crashinjectdll/Makefile.in
build/win32/crashinjectdll/moz.build
build/win32/vmwarerecordinghelper/Makefile.in
build/win32/vmwarerecordinghelper/moz.build
dom/plugins/test/testplugin/testplugin.mk
dom/plugins/test/testplugin/testplugin.mozbuild
gfx/angle/src/libEGL/Makefile.in
gfx/angle/src/libEGL/moz.build
gfx/angle/src/libGLESv2/Makefile.in
gfx/angle/src/libGLESv2/moz.build
layout/media/Makefile.in
layout/media/moz.build
mozglue/build/Makefile.in
mozglue/build/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
security/build/Makefile.in
security/build/moz.build
tools/trace-malloc/lib/Makefile.in
tools/trace-malloc/lib/moz.build
--- a/accessible/public/ia2/Makefile.in
+++ b/accessible/public/ia2/Makefile.in
@@ -1,14 +1,12 @@
 # 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/.
 
-DEFFILE       = $(win_srcdir)/IA2Marshal.def
-
 IA2DIR        = $(topsrcdir)/other-licenses/ia2
 
 GARBAGE       += $(MIDL_GENERATED_FILES)
 
 # Please keep this list in sync with the moz.build file until the rest of this
 # Makefile is ported over.
 MIDL_INTERFACES = \
   Accessible2.idl \
--- a/accessible/public/ia2/moz.build
+++ b/accessible/public/ia2/moz.build
@@ -4,8 +4,10 @@
 # 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 = 'IA2Marshal'
 
 FORCE_SHARED_LIB = True
 
 DEFINES['REGISTER_PROXY_DLL'] = True
+
+DEFFILE = SRCDIR + '/IA2Marshal.def'
--- a/accessible/public/msaa/Makefile.in
+++ b/accessible/public/msaa/Makefile.in
@@ -1,14 +1,12 @@
 # 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/.
 
-DEFFILE = $(win_srcdir)/AccessibleMarshal.def
-
 GARBAGE += $(MIDL_GENERATED_FILES) done_gen dlldata.c
 
 MIDL_GENERATED_FILES = \
 	ISimpleDOMNode.h \
 	ISimpleDOMNode_p.c \
 	ISimpleDOMNode_i.c \
 	ISimpleDOMDocument.h \
 	ISimpleDOMDocument_p.c \
--- a/accessible/public/msaa/moz.build
+++ b/accessible/public/msaa/moz.build
@@ -14,8 +14,10 @@ GENERATED_SOURCES += [
     'ISimpleDOMNode_p.c',
     'ISimpleDOMText_i.c',
     'ISimpleDOMText_p.c',
 ]
 
 FORCE_SHARED_LIB = True
 
 DEFINES['REGISTER_PROXY_DLL'] = True
+
+DEFFILE = SRCDIR + '/AccessibleMarshal.def'
--- a/build/win32/crashinjectdll/Makefile.in
+++ b/build/win32/crashinjectdll/Makefile.in
@@ -1,7 +1,5 @@
 # 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/.
 
-DEFFILE = $(srcdir)/crashinjectdll.def
-
 MOZ_GLUE_LDFLAGS =
--- a/build/win32/crashinjectdll/moz.build
+++ b/build/win32/crashinjectdll/moz.build
@@ -7,9 +7,11 @@
 SOURCES += [
     'crashinjectdll.cpp',
 ]
 
 LIBRARY_NAME = 'crashinjectdll'
 
 FORCE_SHARED_LIB = True
 
+DEFFILE = SRCDIR + '/crashinjectdll.def'
+
 USE_STATIC_LIBS = True
--- a/build/win32/vmwarerecordinghelper/Makefile.in
+++ b/build/win32/vmwarerecordinghelper/Makefile.in
@@ -1,7 +1,5 @@
 # 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/.
 
-DEFFILE = $(srcdir)/$(LIBRARY_NAME).def
-
 MOZ_GLUE_LDFLAGS =
--- a/build/win32/vmwarerecordinghelper/moz.build
+++ b/build/win32/vmwarerecordinghelper/moz.build
@@ -7,9 +7,11 @@
 SOURCES += [
     'vmwarerecordinghelper.cpp',
 ]
 
 LIBRARY_NAME = 'vmwarerecordinghelper'
 
 FORCE_SHARED_LIB = True
 
+DEFFILE = '%s/%s.def' % (SRCDIR, LIBRARY_NAME)
+
 USE_STATIC_LIBS = True
--- a/dom/plugins/test/testplugin/testplugin.mk
+++ b/dom/plugins/test/testplugin/testplugin.mk
@@ -12,17 +12,16 @@ CXXFLAGS        += $(MOZ_QT_CFLAGS)
 CFLAGS          += $(MOZ_QT_CFLAGS)
 EXTRA_DSO_LDOPTS = \
                 $(MOZ_QT_LIBS) \
                 $(XLDFLAGS) \
                 $(XLIBS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
-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
@@ -40,8 +40,9 @@ elif toolkit == 'windows':
 FORCE_SHARED_LIB = True
 
 # must link statically with the CRT; nptest isn't Gecko code
 USE_STATIC_LIBS = True
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     RCFILE  = 'nptest.rc'
     RESFILE = 'nptest.res'
+    DEFFILE = SRCDIR + '/nptest.def'
--- a/gfx/angle/src/libEGL/Makefile.in
+++ b/gfx/angle/src/libEGL/Makefile.in
@@ -8,17 +8,16 @@ STL_FLAGS =
 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
 
 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
@@ -39,8 +39,9 @@ for var in ('LIBEGL_EXPORTS', 'ANGLE_BUI
     DEFINES[var] = True
 
 if not CONFIG['MOZ_DEBUG']:
     DEFINES['_SECURE_SCL'] = 0
 
 DEFINES['ANGLE_COMPILE_OPTIMIZATION_LEVEL'] = 'D3DCOMPILE_OPTIMIZATION_LEVEL1'
 
 RCFILE = SRCDIR + '/libEGL.rc'
+DEFFILE = SRCDIR + '/libEGL.def'
--- a/gfx/angle/src/libGLESv2/Makefile.in
+++ b/gfx/angle/src/libGLESv2/Makefile.in
@@ -5,18 +5,16 @@
 # ANGLE uses the STL, so we can't use our derpy STL wrappers.
 STL_FLAGS =
 
 ifndef GNU_CC
 # Enable unwind semantics for exception handlers in response to warning C4530.
 OS_CPPFLAGS += -EHsc
 endif
 
-DEFFILE = $(srcdir)/libGLESv2.def
-
 # 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
@@ -190,8 +190,9 @@ for var in ('LIBGLESV2_EXPORTS', 'ANGLE_
     DEFINES[var] = True
 
 if not CONFIG['MOZ_DEBUG']:
     DEFINES['_SECURE_SCL'] = 0
 
 DEFINES['ANGLE_COMPILE_OPTIMIZATION_LEVEL'] = 'D3DCOMPILE_OPTIMIZATION_LEVEL1'
 
 RCFILE = SRCDIR + '/libGLESv2.rc'
+DEFFILE = SRCDIR + '/libGLESv2.def'
--- a/layout/media/Makefile.in
+++ b/layout/media/Makefile.in
@@ -3,17 +3,16 @@
 # 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/.
 
 EXPORT_LIBRARY	= $(DIST)/lib
 
 ifeq (WINNT,$(OS_TARGET))
 EXTRA_DSO_LDOPTS = $(MOZALLOC_LIB) $(NSPR_LIBS)
 OS_LIBS += $(call EXPAND_LIBNAME,usp10 ole32)
-DEFFILE = symbols.def
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 ifeq (WINNT,$(OS_TARGET))
 symbols.def: symbols.def.in $(GLOBAL_DEPS)
 	$(call py_action,preprocessor,$(ACDEFINES) $< -o $@)
 
--- a/layout/media/moz.build
+++ b/layout/media/moz.build
@@ -6,8 +6,11 @@
 
 LIBRARY_NAME = 'gkmedias'
 
 if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
     FORCE_SHARED_LIB = True
 
 if CONFIG['MOZ_WEBRTC']:
     DIRS += ['webrtc']
+
+if CONFIG['OS_TARGET'] == 'WINNT':
+    DEFFILE = 'symbols.def'
--- a/mozglue/build/Makefile.in
+++ b/mozglue/build/Makefile.in
@@ -30,18 +30,16 @@ ifneq (,$(ZLIB_IN_MOZGLUE)$(MOZ_LINKER))
 ifdef MOZ_NATIVE_ZLIB
 EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
 else
 SHARED_LIBRARY_LIBS += $(MOZ_ZLIB_LIBS)
 endif
 endif
 
 ifeq (WINNT,$(OS_TARGET))
-DEFFILE = mozglue.def
-
 mozglue.def: mozglue.def.in
 	$(call py_action,preprocessor,$(if $(MOZ_REPLACE_MALLOC),-DMOZ_REPLACE_MALLOC) $(ACDEFINES) $< -o $@)
 
 GARBAGE += mozglue.def
 
 ifneq (,$(filter -DEFAULTLIB:mozcrt,$(MOZ_GLUE_LDFLAGS)))
 # Don't install the import library if we use mozcrt
 NO_INSTALL_IMPORT_LIBRARY = 1
--- a/mozglue/build/moz.build
+++ b/mozglue/build/moz.build
@@ -26,16 +26,17 @@ if CONFIG['OS_TARGET'] == 'Android':
     SOURCES += [
         'BionicGlue.cpp',
     ]
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     SOURCES += [
         'WindowsDllBlocklist.cpp',
     ]
+    DEFFILE = 'mozglue.def'
 
 if CONFIG['MOZ_NUWA_PROCESS']:
     EXPORTS.ipc += [
         'Nuwa.h',
     ]
     SOURCES += [
         'Nuwa.cpp',
     ]
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -235,16 +235,17 @@ class TreeMetadataEmitter(LoggingMixin):
             'JS_MODULES_PATH',
             'LIBS',
             'LIBXUL_LIBRARY',
             'MSVC_ENABLE_PGO',
             'NO_DIST_INSTALL',
             'OS_LIBS',
             'RCFILE',
             'RESFILE',
+            'DEFFILE',
             '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
@@ -336,16 +336,22 @@ VARIABLES = {
         """, None),
 
     'RESFILE': (unicode, unicode,
         """The program .res file.
 
         This variable can only be used on Windows.
         """, None),
 
+    'DEFFILE': (unicode, unicode,
+        """The program .def (module definition) file.
+
+        This variable can only be used on Windows.
+        """, None),
+
     'RESOURCE_FILES': (HierarchicalStringListWithFlagsFactory({'preprocess': bool}), list,
         """List of resources to be exported, and in which subdirectories.
 
         ``RESOURCE_FILES`` is used to list the resource files to be exported to
         ``dist/bin/res``, but it can be used for other files as well. This variable
         behaves as a list when appending filenames for resources in the top-level
         directory. Files can also be appended to a field to indicate which
         subdirectory they should be exported to. For example, to export
--- a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
+++ b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
@@ -33,10 +33,11 @@ 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'
+DEFFILE = 'baz.def'
 
 USE_STATIC_LIBS = True
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -329,16 +329,19 @@ class TestRecursiveMakeBackend(BackendTe
                 'USE_DELAYIMP := 1',
             ],
             'RCFILE': [
                 'RCFILE := foo.rc',
             ],
             'RESFILE': [
                 'RESFILE := bar.res',
             ],
+            'DEFFILE': [
+                'DEFFILE := baz.def',
+            ],
             'USE_STATIC_LIBS': [
                 'USE_STATIC_LIBS := 1',
             ],
         }
 
         for var, val in expected.items():
             # print("test_variable_passthru[%s]" % (var))
             found = [str for str in lines if str.startswith(var)]
--- a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
+++ b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
@@ -39,10 +39,11 @@ 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'
+DEFFILE = 'baz.def'
 
 USE_STATIC_LIBS = True
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -169,16 +169,17 @@ class TestEmitterBasic(unittest.TestCase
             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',
+            DEFFILE='baz.def',
             USE_STATIC_LIBS=True,
         )
 
         variables = objs[0].variables
         maxDiff = self.maxDiff
         self.maxDiff = None
         self.assertEqual(wanted, variables)
         self.maxDiff = maxDiff
--- a/security/build/Makefile.in
+++ b/security/build/Makefile.in
@@ -356,17 +356,16 @@ EXTRA_DSO_LDOPTS += $(DEPTH)/db/sqlite3/
 
 # Add all static libraries for nss, smime, ssl and nssutil
 SHARED_LIBRARY_LIBS = $(addprefix ../,$(NSS_STATIC_LIBS))
 
 ifeq (WINNT,$(OS_TARGET))
 # Create a .def file based on the various .def files for nss, smime, ssl and
 # nssutil.
 NSS_STATIC_LIBS_DEFS := $(wildcard $(addprefix $(srcdir)/../,$(NSS_STATIC_LIBS:.$(LIB_SUFFIX)=.def)))
-DEFFILE = nss3.def
 
 nss3.def: $(NSS_STATIC_LIBS_DEFS) $(DEPTH)/db/sqlite3/src/sqlite-processed.def
 	echo LIBRARY nss3$(DLL_SUFFIX) > $@.tmp
 	echo EXPORTS >> $@.tmp
 	grep -v -h -e ^LIBRARY -e ^EXPORTS -e ^\; $^ >> $@.tmp
 	mv $@.tmp $@
 endif
 
--- a/security/build/moz.build
+++ b/security/build/moz.build
@@ -4,8 +4,11 @@
 # 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/.
 
 if CONFIG['MOZ_FOLD_LIBS']:
     # TODO: The library name can be changed when bug 845217 is fixed.
     LIBRARY_NAME = 'nss3'
 
     FORCE_SHARED_LIB = True
+
+if CONFIG['OS_TARGET'] == 'WINNT':
+    DEFFILE = 'nss3.def'
--- a/tools/trace-malloc/lib/Makefile.in
+++ b/tools/trace-malloc/lib/Makefile.in
@@ -1,8 +1,6 @@
 #
 # 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/.
 
-DEFFILE		= $(win_srcdir)/tm.def
-
 STL_FLAGS	=
--- a/tools/trace-malloc/lib/moz.build
+++ b/tools/trace-malloc/lib/moz.build
@@ -23,8 +23,10 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     ]
 
 FINAL_LIBRARY = 'xpcom_core'
 
 if CONFIG['WRAP_SYSTEM_INCLUDES']:
     DEFINES['WRAP_SYSTEM_INCLUDES'] = True
 
 DEFINES['MOZ_NO_MOZALLOC'] = True
+
+DEFFILE = SRCDIR + '/tm.def'