diff --git a/accessible/interfaces/ia2/moz.build b/accessible/interfaces/ia2/moz.build index 6c73a1a2bf5..3aae77cd38b 100644 --- a/accessible/interfaces/ia2/moz.build +++ b/accessible/interfaces/ia2/moz.build @@ -4,7 +4,7 @@ # 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' +Library('IA2Marshal') FORCE_SHARED_LIB = True diff --git a/accessible/interfaces/msaa/moz.build b/accessible/interfaces/msaa/moz.build index 94ed2889cc4..e6d5f2f0937 100644 --- a/accessible/interfaces/msaa/moz.build +++ b/accessible/interfaces/msaa/moz.build @@ -4,7 +4,7 @@ # 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 = 'AccessibleMarshal' +Library('AccessibleMarshal') GENERATED_SOURCES += [ 'dlldata.c', diff --git a/b2g/app/moz.build b/b2g/app/moz.build index abc17ee4512..948e70a00e8 100644 --- a/b2g/app/moz.build +++ b/b2g/app/moz.build @@ -6,9 +6,9 @@ if not CONFIG['LIBXUL_SDK']: if CONFIG['GAIADIR']: - PROGRAM = CONFIG['MOZ_APP_NAME'] + "-bin" + Program(CONFIG['MOZ_APP_NAME'] + "-bin") else: - PROGRAM = CONFIG['MOZ_APP_NAME'] + Program(CONFIG['MOZ_APP_NAME']) if CONFIG['MOZ_B2G_LOADER']: SOURCES += [ 'B2GLoader.cpp', diff --git a/b2g/gaia/moz.build b/b2g/gaia/moz.build index 282c716c25f..c0c06424909 100644 --- a/b2g/gaia/moz.build +++ b/b2g/gaia/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = CONFIG['MOZ_APP_NAME'] +Program(CONFIG['MOZ_APP_NAME']) if CONFIG['OS_ARCH'] == 'WINNT': SOURCES += [ diff --git a/browser/app/moz.build b/browser/app/moz.build index 0e78b951500..3d22eab10b0 100644 --- a/browser/app/moz.build +++ b/browser/app/moz.build @@ -6,7 +6,7 @@ DIRS += ['profile/extensions'] -PROGRAM = CONFIG['MOZ_APP_NAME'] +Program(CONFIG['MOZ_APP_NAME']) SOURCES += [ 'nsBrowserApp.cpp', diff --git a/browser/metro/shell/commandexecutehandler/moz.build b/browser/metro/shell/commandexecutehandler/moz.build index 9e671d8ff17..fb47441be41 100644 --- a/browser/metro/shell/commandexecutehandler/moz.build +++ b/browser/metro/shell/commandexecutehandler/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'CommandExecuteHandler' +Program('CommandExecuteHandler') SOURCES += [ 'CEHHelper.cpp', diff --git a/browser/metro/shell/linktool/moz.build b/browser/metro/shell/linktool/moz.build index 20b154e1e9b..223928bf18c 100644 --- a/browser/metro/shell/linktool/moz.build +++ b/browser/metro/shell/linktool/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'linktool' +Program('linktool') SOURCES += [ 'linktool.cpp', diff --git a/browser/metro/shell/testing/moz.build b/browser/metro/shell/testing/moz.build index 8ff0f896bf6..151d98bf1ff 100644 --- a/browser/metro/shell/testing/moz.build +++ b/browser/metro/shell/testing/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'metrotestharness' +Program('metrotestharness') SOURCES += [ 'metrotestharness.cpp', diff --git a/build/docs/defining-binaries.rst b/build/docs/defining-binaries.rst index 1cfd855e8c5..fd155917a18 100644 --- a/build/docs/defining-binaries.rst +++ b/build/docs/defining-binaries.rst @@ -39,20 +39,20 @@ Static Libraries ================ To build a static library, other than defining the source files (see above), one -just needs to define a library name with the ``LIBRARY_NAME`` variable. +just needs to define a library name with the ``Library`` template. - LIBRARY_NAME = 'foo' + Library('foo') The library file name will be ``libfoo.a`` on UNIX systems and ``foo.lib`` on Windows. If the static library needs to aggregate other static libraries, a list of -``LIBRARY_NAME`` can be added to the ``USE_LIBS`` variable. Like ``SOURCES``, it +``Library`` names can be added to the ``USE_LIBS`` variable. Like ``SOURCES``, it requires the appended list to be alphanumerically ordered. USE_LIBS += ['bar', 'baz'] -If there are multiple directories containing the same ``LIBRARY_NAME``, it is +If there are multiple directories containing the same ``Library`` name, it is possible to disambiguate by prefixing with the path to the wanted one (relative or absolute): @@ -61,7 +61,7 @@ or absolute): '../relative/baz', ] -Note that the leaf name in those paths is the ``LIBRARY_NAME``, not an actual +Note that the leaf name in those paths is the ``Library`` name, not an actual file name. Note that currently, the build system may not create an actual library for @@ -84,10 +84,10 @@ be linked to that bigger library, with the ``FINAL_LIBRARY`` variable. FINAL_LIBRARY = 'xul' -The ``FINAL_LIBRARY`` value must match a unique ``LIBRARY_NAME`` somewhere +The ``FINAL_LIBRARY`` value must match a unique ``Library`` name somewhere in the tree. -As a special rule, those intermediate libraries don't need a ``LIBRARY_NAME`` +As a special rule, those intermediate libraries don't need a ``Library`` name for themselves. @@ -103,7 +103,7 @@ the ``FORCE_SHARED_LIB`` boolean variable: When this variable is set, no static library is built. See further below to build both types of libraries. -With a ``LIBRARY_NAME`` of ``foo``, the library file name will be +With a ``Library`` name of ``foo``, the library file name will be ``libfoo.dylib`` on OSX, ``libfoo.so`` on ELF systems (Linux, etc.), and ``foo.dll`` on Windows. On Windows, there is also an import library named ``foo.lib``, used on the linker command line. ``libfoo.dylib`` and @@ -115,7 +115,7 @@ This is done with the ``IS_FRAMEWORK`` boolean variable. IS_FRAMEWORK = True -With a ``LIBRARY_NAME`` of ``foo``, the framework file name will be ``foo``. +With a ``Library`` name of ``foo``, the framework file name will be ``foo``. This variable however affects the behavior on all platforms, so it needs to be set only on OSX. @@ -129,23 +129,24 @@ Executables =========== Executables, a.k.a. programs, are, in the simplest form, defined with the -``PROGRAM`` variable. +``Program`` template. - PROGRAM = 'foobar' + Program('foobar') On UNIX systems, the executable file name will be ``foobar``, while on Windows, it will be ``foobar.exe``. Like static and shared libraries, the build system can be instructed to link -libraries to the executable with ``USE_LIBS``, listing various ``LIBRARY_NAME``. +libraries to the executable with ``USE_LIBS``, listing various ``Library`` +names. In some cases, we want to create an executable per source file in the current -directory, in which case we can use the ``SIMPLE_PROGRAMS`` list: +directory, in which case we can use the ``SimplePrograms`` template - SIMPLE_PROGRAMS = [ + SimplePrograms([ 'FirstProgram', 'SecondProgram', - ] + ]) The corresponding ``SOURCES`` must match: @@ -154,8 +155,8 @@ The corresponding ``SOURCES`` must match: 'SecondProgram.c', ] -Similar to ``SIMPLE_PROGRAMS``, is ``CPP_UNIT_TESTS``, which defines, with the -same rules, C++ unit tests programs. +Similar to ``SimplePrograms``, is the ``CppUnitTests`` template, which defines, +with the same rules, C++ unit tests programs. Linking with system libraries @@ -189,10 +190,10 @@ Libraries from third party build system ======================================= Some libraries in the tree are not built by the moz.build-governed build -system, and there is no ``LIBRARY_NAME`` corresponding to them. +system, and there is no ``Library`` corresponding to them. However, ``USE_LIBS`` allows to reference such libraries by giving a full -path (like when disambiguating identical ``LIBRARY_NAME``). The same naming +path (like when disambiguating identical ``Library`` names). The same naming rules apply as other uses of ``USE_LIBS``, so only the library name without prefix and suffix shall be given. @@ -217,12 +218,12 @@ When both types of libraries are required, one needs to set both But because static libraries and Windows import libraries have the same file names, either the static or the shared library name needs to be different -than ``LIBRARY_NAME``. +than the name given to the ``Library`` template. The ``STATIC_LIBRARY_NAME`` and ``SHARED_LIBRARY_NAME`` variables can be used to change either the static or the shared library name. - LIBRARY_NAME = 'foo' + Library('foo') STATIC_LIBRARY_NAME = 'foo_s' With the above, on Windows, ``foo_s.lib`` will be the static library, @@ -231,25 +232,25 @@ With the above, on Windows, ``foo_s.lib`` will be the static library, In some cases, for convenience, it is possible to set both ``STATIC_LIBRARY_NAME`` and ``SHARED_LIBRARY_NAME``. For example: - LIBRARY_NAME = 'mylib' + Library('mylib') STATIC_LIBRARY_NAME = 'mylib_s' SHARED_LIBRARY_NAME = CONFIG['SHARED_NAME'] This allows to use ``mylib`` in the ``USE_LIBS`` of another library or executable. -When refering to a ``LIBRARY_NAME`` building both types of libraries in +When refering to a ``Library`` name building both types of libraries in ``USE_LIBS``, the shared library is chosen to be linked. But sometimes, -it is wanted to link the static version, in which case the ``LIBRARY_NAME`` +it is wanted to link the static version, in which case the ``Library`` name needs to be prefixed with ``static:`` in ``USE_LIBS`` a/moz.build: - LIBRARY_NAME = 'mylib' + Library('mylib') FORCE_SHARED_LIB = True FORCE_STATIC_LIB = True STATIC_LIBRARY_NAME = 'mylib_s' b/moz.build: - PROGRAM = 'myprog' + Program('myprog') USE_LIBS += [ 'static:mylib', ] @@ -262,18 +263,18 @@ The ``SDK_LIBRARY`` boolean variable defines whether the library in the current directory is going to be installed in the SDK. The ``SONAME`` variable declares a "shared object name" for the library. It -defaults to the ``LIBRARY_NAME`` or the ``SHARED_LIBRARY_NAME`` if set. When +defaults to the ``Library`` name or the ``SHARED_LIBRARY_NAME`` if set. When linking to a library with a ``SONAME``, the resulting library or program will have a dependency on the library with the name corresponding to the ``SONAME`` -instead of ``LIBRARY_NAME``. This only impacts ELF systems. +instead of the ``Library`` name. This only impacts ELF systems. a/moz.build: - LIBRARY_NAME = 'mylib' + Library('mylib') b/moz.build: - LIBRARY_NAME = 'otherlib' + Library('otherlib') SONAME = 'foo' c/moz.build: - PROGRAM = 'myprog' + Program('myprog') USE_LIBS += [ 'mylib', 'otherlib', diff --git a/build/stlport/moz.build b/build/stlport/moz.build index af9be36a0fa..649ce0b27f7 100644 --- a/build/stlport/moz.build +++ b/build/stlport/moz.build @@ -4,7 +4,7 @@ # 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' +Library('stlport_static') FORCE_STATIC_LIB = True diff --git a/build/templates.mozbuild b/build/templates.mozbuild index 0dff49d667e..6df5f1411e3 100644 --- a/build/templates.mozbuild +++ b/build/templates.mozbuild @@ -4,6 +4,57 @@ # 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/. +@template +def Program(name): + '''Template for program executables.''' + PROGRAM = name + + +@template +def SimplePrograms(names): + '''Template for simple program executables. + + Those have a single source with the same base name as the executable. + ''' + SIMPLE_PROGRAMS += names + + +@template +def CppUnitTests(names): + '''Template for C++ unit tests. + + Those have a single source with the same base name as the executable. + ''' + CPP_UNIT_TESTS += names + + +@template +def Library(name): + '''Template for libraries.''' + LIBRARY_NAME = name + + +@template +def HostProgram(name): + '''Template for build tools executables.''' + HOST_PROGRAM = name + + +@template +def HostSimplePrograms(names): + '''Template for simple build tools executables. + + Those have a single source with the same base name as the executable. + ''' + HOST_SIMPLE_PROGRAMS += names + + +@template +def HostLibrary(name): + '''Template for build tools libraries.''' + HOST_LIBRARY_NAME = name + + @template def GeckoBinary(): '''Template for binaries using Gecko. diff --git a/build/unix/elfhack/moz.build b/build/unix/elfhack/moz.build index 65a968bf394..a3cb69c9b18 100644 --- a/build/unix/elfhack/moz.build +++ b/build/unix/elfhack/moz.build @@ -19,7 +19,7 @@ HOST_SOURCES += [ 'elfhack.cpp', ] -HOST_PROGRAM = 'elfhack' +HostProgram('elfhack') DEFINES['ELFHACK_BUILD'] = True diff --git a/build/unix/stdc++compat/moz.build b/build/unix/stdc++compat/moz.build index d9247607920..73f4e22e1d9 100644 --- a/build/unix/stdc++compat/moz.build +++ b/build/unix/stdc++compat/moz.build @@ -5,11 +5,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']: - LIBRARY_NAME = 'stdc++compat' + Library('stdc++compat') SOURCES += ['stdc++compat.cpp'] if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']: - HOST_LIBRARY_NAME = 'host_stdc++compat' + HostLibrary('host_stdc++compat') HOST_SOURCES += [ 'stdc++compat.cpp', ] diff --git a/build/win32/crashinjectdll/moz.build b/build/win32/crashinjectdll/moz.build index 24655529ab6..6f1fc4cab12 100644 --- a/build/win32/crashinjectdll/moz.build +++ b/build/win32/crashinjectdll/moz.build @@ -8,7 +8,7 @@ SOURCES += [ 'crashinjectdll.cpp', ] -LIBRARY_NAME = 'crashinjectdll' +Library('crashinjectdll') FORCE_SHARED_LIB = True diff --git a/build/win32/moz.build b/build/win32/moz.build index ece8f8067db..0d14f247d28 100644 --- a/build/win32/moz.build +++ b/build/win32/moz.build @@ -10,7 +10,7 @@ if CONFIG['_MSC_VER'] and CONFIG['OS_TEST'] != 'x86_64': TEST_DIRS += ['crashinjectdll'] if CONFIG['ENABLE_TESTS']: - PROGRAM = 'crashinject' + Program('crashinject') SOURCES += [ 'crashinject.cpp', ] diff --git a/build/win32/vmwarerecordinghelper/moz.build b/build/win32/vmwarerecordinghelper/moz.build index 4cfdc4f64f6..55e842e2b98 100644 --- a/build/win32/vmwarerecordinghelper/moz.build +++ b/build/win32/vmwarerecordinghelper/moz.build @@ -8,7 +8,7 @@ SOURCES += [ 'vmwarerecordinghelper.cpp', ] -LIBRARY_NAME = 'vmwarerecordinghelper' +Library('vmwarerecordinghelper') FORCE_SHARED_LIB = True diff --git a/config/external/ffi/moz.build b/config/external/ffi/moz.build index 130e35b39e5..725b483153f 100644 --- a/config/external/ffi/moz.build +++ b/config/external/ffi/moz.build @@ -4,7 +4,7 @@ # 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 = 'ffi' +Library('ffi') if CONFIG['MOZ_NATIVE_FFI']: OS_LIBS += CONFIG['MOZ_FFI_LIBS'] diff --git a/config/external/freetype2/moz.build b/config/external/freetype2/moz.build index 1c9b09e8762..fc52d25bda7 100644 --- a/config/external/freetype2/moz.build +++ b/config/external/freetype2/moz.build @@ -4,7 +4,7 @@ # 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 = 'freetype' +Library('freetype') if CONFIG['MOZ_TREE_FREETYPE']: USE_LIBS += [ diff --git a/config/external/icu/moz.build b/config/external/icu/moz.build index 32422d4bb20..eda9c4c561c 100644 --- a/config/external/icu/moz.build +++ b/config/external/icu/moz.build @@ -4,7 +4,7 @@ # 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 = 'icu' +Library('icu') if CONFIG['MOZ_NATIVE_ICU']: OS_LIBS += CONFIG['MOZ_ICU_LIBS'] diff --git a/config/external/nspr/moz.build b/config/external/nspr/moz.build index 34e0369bafa..424119e8a63 100644 --- a/config/external/nspr/moz.build +++ b/config/external/nspr/moz.build @@ -4,7 +4,7 @@ # 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 = 'nspr' +Library('nspr') if CONFIG['MOZ_FOLD_LIBS']: # When folding libraries, nspr is actually in the nss library. diff --git a/config/external/nss/crmf/moz.build b/config/external/nss/crmf/moz.build index d0ceb4bd9cf..9b8005f96e2 100644 --- a/config/external/nss/crmf/moz.build +++ b/config/external/nss/crmf/moz.build @@ -4,7 +4,7 @@ # 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 = 'crmf' +Library('crmf') if CONFIG['MOZ_NATIVE_NSS']: OS_LIBS += [l for l in CONFIG['NSS_LIBS'] if l.startswith('-L')] diff --git a/config/external/nss/moz.build b/config/external/nss/moz.build index 2ebfa800657..b7b69e7017b 100644 --- a/config/external/nss/moz.build +++ b/config/external/nss/moz.build @@ -4,7 +4,7 @@ # 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 = 'nss' +Library('nss') DIRS += ['crmf'] diff --git a/config/external/sqlite/moz.build b/config/external/sqlite/moz.build index b765049d06c..9826ced3f77 100644 --- a/config/external/sqlite/moz.build +++ b/config/external/sqlite/moz.build @@ -4,7 +4,7 @@ # 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 = 'sqlite' +Library('sqlite') if CONFIG['MOZ_NATIVE_SQLITE']: OS_LIBS += CONFIG['SQLITE_LIBS'] diff --git a/config/external/zlib/moz.build b/config/external/zlib/moz.build index e6c14a73f4a..f1efe437af3 100644 --- a/config/external/zlib/moz.build +++ b/config/external/zlib/moz.build @@ -4,7 +4,7 @@ # 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 = 'zlib' +Library('zlib') if CONFIG['MOZ_NATIVE_ZLIB']: OS_LIBS += CONFIG['MOZ_ZLIB_LIBS'] diff --git a/config/moz.build b/config/moz.build index d355cb5e79e..9e6ab581bc6 100644 --- a/config/moz.build +++ b/config/moz.build @@ -21,7 +21,7 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT': 'nsinstall.c', 'pathsub.c', ] - HOST_PROGRAM = 'nsinstall_real' + HostProgram('nsinstall_real') if CONFIG['GKMEDIAS_SHARED_LIBRARY']: DEFINES['GKMEDIAS_SHARED_LIBRARY'] = True diff --git a/content/base/test/moz.build b/content/base/test/moz.build index f4fd51a587f..ec05b17e996 100644 --- a/content/base/test/moz.build +++ b/content/base/test/moz.build @@ -10,12 +10,12 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] if CONFIG['OS_ARCH'] != 'Darwin': XPCSHELL_TESTS_MANIFESTS += ['unit_ipc/xpcshell.ini'] -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestCSPParser', 'TestGetURL', 'TestNativeXMLHttpRequest', 'TestPlainTextSerializer', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/content/media/compiledtest/moz.build b/content/media/compiledtest/moz.build index a8ea07907d9..0da44099221 100644 --- a/content/media/compiledtest/moz.build +++ b/content/media/compiledtest/moz.build @@ -4,10 +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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestAudioBuffers', 'TestAudioMixer' -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/content/media/webaudio/compiledtest/moz.build b/content/media/webaudio/compiledtest/moz.build index 55c96401da1..e584c2016a5 100644 --- a/content/media/webaudio/compiledtest/moz.build +++ b/content/media/webaudio/compiledtest/moz.build @@ -4,9 +4,9 @@ # 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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestAudioEventTimeline', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/dom/audiochannel/tests/moz.build b/dom/audiochannel/tests/moz.build index ffa7abe72a0..64304545b10 100644 --- a/dom/audiochannel/tests/moz.build +++ b/dom/audiochannel/tests/moz.build @@ -4,9 +4,9 @@ # 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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestAudioChannelService', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/dom/bindings/test/moz.build b/dom/bindings/test/moz.build index f5fe25f3a99..afa87cc7e4e 100644 --- a/dom/bindings/test/moz.build +++ b/dom/bindings/test/moz.build @@ -12,7 +12,7 @@ DEFINES.update({ # Do NOT export this library. We don't actually want our test code # being added to libxul or anything. -LIBRARY_NAME = 'dombindings_test_s' +Library('dombindings_test_s') EXTRA_COMPONENTS += [ 'TestInterfaceJS.js', diff --git a/dom/canvas/compiledtest/moz.build b/dom/canvas/compiledtest/moz.build index 376b321970b..6e3a66ea13c 100644 --- a/dom/canvas/compiledtest/moz.build +++ b/dom/canvas/compiledtest/moz.build @@ -4,9 +4,9 @@ # 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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestWebGLElementArrayCache', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/dom/media/gmp-plugin/moz.build b/dom/media/gmp-plugin/moz.build index 2b066082bd9..27774758ff2 100644 --- a/dom/media/gmp-plugin/moz.build +++ b/dom/media/gmp-plugin/moz.build @@ -9,7 +9,7 @@ SOURCES += [ 'gmp-fake.cpp' ] -LIBRARY_NAME = "fake" +Library("fake") USE_STATIC_LIBS = True FORCE_SHARED_LIB = True diff --git a/dom/plugins/ipc/hangui/moz.build b/dom/plugins/ipc/hangui/moz.build index 15e41686853..8b803c961dd 100644 --- a/dom/plugins/ipc/hangui/moz.build +++ b/dom/plugins/ipc/hangui/moz.build @@ -6,7 +6,7 @@ FAIL_ON_WARNINGS = True -PROGRAM = 'plugin-hang-ui' +Program('plugin-hang-ui') UNIFIED_SOURCES += [ 'MiniShmChild.cpp', diff --git a/dom/plugins/ipc/interpose/moz.build b/dom/plugins/ipc/interpose/moz.build index 3818e1ece36..e80b868b419 100644 --- a/dom/plugins/ipc/interpose/moz.build +++ b/dom/plugins/ipc/interpose/moz.build @@ -4,7 +4,7 @@ # 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 = 'plugin_child_interpose' +Library('plugin_child_interpose') UNIFIED_SOURCES += [ "%s.mm" % (LIBRARY_NAME) ] diff --git a/dom/plugins/test/testplugin/javaplugin/moz.build b/dom/plugins/test/testplugin/javaplugin/moz.build index 4dd056fcd0e..2c7f6a0f73c 100644 --- a/dom/plugins/test/testplugin/javaplugin/moz.build +++ b/dom/plugins/test/testplugin/javaplugin/moz.build @@ -4,7 +4,7 @@ # 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 = 'nptestjava' +Library('nptestjava') relative_path = '..' include('../testplugin.mozbuild') diff --git a/dom/plugins/test/testplugin/moz.build b/dom/plugins/test/testplugin/moz.build index 678c75f2b66..705995b20cd 100644 --- a/dom/plugins/test/testplugin/moz.build +++ b/dom/plugins/test/testplugin/moz.build @@ -6,7 +6,7 @@ DIRS += ['secondplugin', 'javaplugin'] -LIBRARY_NAME = 'nptest' +Library('nptest') FAIL_ON_WARNINGS = not CONFIG['_MSC_VER'] diff --git a/dom/plugins/test/testplugin/secondplugin/moz.build b/dom/plugins/test/testplugin/secondplugin/moz.build index a9e6cca1e70..c9c6215ee2e 100644 --- a/dom/plugins/test/testplugin/secondplugin/moz.build +++ b/dom/plugins/test/testplugin/secondplugin/moz.build @@ -4,7 +4,7 @@ # 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 = 'npsecondtest' +Library('npsecondtest') relative_path = '..' include('../testplugin.mozbuild') diff --git a/editor/txmgr/tests/moz.build b/editor/txmgr/tests/moz.build index e113d7309d7..316d7a80b5b 100644 --- a/editor/txmgr/tests/moz.build +++ b/editor/txmgr/tests/moz.build @@ -4,9 +4,9 @@ # 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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestTXMgr', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/embedding/tests/winEmbed/moz.build b/embedding/tests/winEmbed/moz.build index 74a8adc7d43..e7ff37a2374 100644 --- a/embedding/tests/winEmbed/moz.build +++ b/embedding/tests/winEmbed/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'winEmbed' +Program('winEmbed') SOURCES += [ 'WebBrowserChrome.cpp', diff --git a/gfx/angle/src/libEGL/moz.build b/gfx/angle/src/libEGL/moz.build index 4dc7ba8ee2a..96f105e7652 100644 --- a/gfx/angle/src/libEGL/moz.build +++ b/gfx/angle/src/libEGL/moz.build @@ -54,7 +54,7 @@ DISABLE_STL_WRAPPING = True LOCAL_INCLUDES += [ '../../include', '../../src' ] USE_LIBS += [ 'libGLESv2' ] -LIBRARY_NAME = 'libEGL' +Library('libEGL') FORCE_SHARED_LIB = True RCFILE = SRCDIR + '/libEGL.rc' diff --git a/gfx/angle/src/libGLESv2/moz.build b/gfx/angle/src/libGLESv2/moz.build index 3704ba8c94a..131868dd09f 100644 --- a/gfx/angle/src/libGLESv2/moz.build +++ b/gfx/angle/src/libGLESv2/moz.build @@ -204,7 +204,7 @@ else: '\'%s/lib/%s/dxguid.lib\'' % (CONFIG['MOZ_DIRECTX_SDK_PATH'], CONFIG['MOZ_D3D_CPU_SUFFIX']), ] -LIBRARY_NAME = 'libGLESv2' +Library('libGLESv2') FORCE_SHARED_LIB = True RCFILE = SRCDIR + '/libGLESv2.rc' diff --git a/intl/lwbrk/tests/moz.build b/intl/lwbrk/tests/moz.build index 795aacb3fa2..8beb091cf2c 100644 --- a/intl/lwbrk/tests/moz.build +++ b/intl/lwbrk/tests/moz.build @@ -4,9 +4,9 @@ # 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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestLineBreak', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/intl/uconv/tools/moz.build b/intl/uconv/tools/moz.build index c8086e62032..fa7756ae9a9 100644 --- a/intl/uconv/tools/moz.build +++ b/intl/uconv/tools/moz.build @@ -4,9 +4,9 @@ # 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/. -SIMPLE_PROGRAMS += [ +SimplePrograms([ 'umaptable', -] +]) SOURCES += [ '%s.c' % s for s in SIMPLE_PROGRAMS diff --git a/intl/unicharutil/tests/moz.build b/intl/unicharutil/tests/moz.build index 8a5ff8f0680..9820a2de05e 100644 --- a/intl/unicharutil/tests/moz.build +++ b/intl/unicharutil/tests/moz.build @@ -11,9 +11,9 @@ SOURCES += [ 'UnicharSelfTest.cpp', ] -SIMPLE_PROGRAMS += [ +SimplePrograms([ "%s" % (fyl[0:-4]) for fyl in SOURCES -] +]) USE_STATIC_LIBS = True diff --git a/intl/unicharutil/tools/moz.build b/intl/unicharutil/tools/moz.build index cbd55a1f230..a46688a2532 100644 --- a/intl/unicharutil/tools/moz.build +++ b/intl/unicharutil/tools/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'ucgendat' +Program('ucgendat') SOURCES += [ 'ucgendat.c', diff --git a/intl/unicharutil/util/moz.build b/intl/unicharutil/util/moz.build index 8e87514378c..e9bf0ed4b04 100644 --- a/intl/unicharutil/util/moz.build +++ b/intl/unicharutil/util/moz.build @@ -21,7 +21,7 @@ include('objs.mozbuild') UNIFIED_SOURCES += intl_unicharutil_util_cppsrcs -LIBRARY_NAME = 'unicharutil_external_s' +Library('unicharutil_external_s') FORCE_STATIC_LIB = True diff --git a/ipc/app/moz.build b/ipc/app/moz.build index fc4a3f846c4..e72c3f26258 100644 --- a/ipc/app/moz.build +++ b/ipc/app/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = CONFIG['MOZ_CHILD_PROCESS_NAME'] +Program(CONFIG['MOZ_CHILD_PROCESS_NAME']) if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': SOURCES += [ diff --git a/ipc/contentproc/moz.build b/ipc/contentproc/moz.build index 39b5d327379..2a6756346e7 100644 --- a/ipc/contentproc/moz.build +++ b/ipc/contentproc/moz.build @@ -4,7 +4,7 @@ # 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 = 'plugin-container' +Library('plugin-container') if CONFIG['MOZ_B2G_LOADER']: FINAL_LIBRARY = 'xul' diff --git a/ipc/ipdl/test/cxx/app/moz.build b/ipc/ipdl/test/cxx/app/moz.build index 848ad2ada5b..4f6a7b48ca9 100644 --- a/ipc/ipdl/test/cxx/app/moz.build +++ b/ipc/ipdl/test/cxx/app/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'ipdlunittest' +Program('ipdlunittest') SOURCES += [ 'TestIPDL.cpp', diff --git a/js/src/editline/moz.build b/js/src/editline/moz.build index 63afd7f4042..ab3841f7ccb 100644 --- a/js/src/editline/moz.build +++ b/js/src/editline/moz.build @@ -4,7 +4,7 @@ # 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 = 'editline' +Library('editline') UNIFIED_SOURCES += [ 'editline.c', diff --git a/js/src/gdb/moz.build b/js/src/gdb/moz.build index 27b15ea7b2d..119e9eb7373 100644 --- a/js/src/gdb/moz.build +++ b/js/src/gdb/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'gdb-tests' +Program('gdb-tests') UNIFIED_SOURCES += [ 'gdb-tests.cpp', diff --git a/js/src/jsapi-tests/moz.build b/js/src/jsapi-tests/moz.build index 3e485bf5c6e..099da704b2b 100644 --- a/js/src/jsapi-tests/moz.build +++ b/js/src/jsapi-tests/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'jsapi-tests' +Program('jsapi-tests') UNIFIED_SOURCES += [ 'selfTest.cpp', diff --git a/js/src/moz.build b/js/src/moz.build index 31a0d4cfe6f..6eb7736b19d 100644 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -427,9 +427,9 @@ HOST_SOURCES += [ 'jskwgen.cpp', ] -HOST_SIMPLE_PROGRAMS += [ +HostSimplePrograms([ 'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES -] +]) # JavaScript must be built shared, even for static builds, as it is used by # other modules which are always built shared. Failure to do so results in @@ -439,7 +439,7 @@ HOST_SIMPLE_PROGRAMS += [ # In fact, we now build both a static and a shared library, as the # JS shell would like to link to the static library. -LIBRARY_NAME = 'js' +Library('js') if CONFIG['JS_SHARED_LIBRARY']: FORCE_SHARED_LIB = True diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build index 10a930cba58..b88334f1548 100644 --- a/js/src/shell/moz.build +++ b/js/src/shell/moz.build @@ -5,7 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['JS_SHELL_NAME']: - PROGRAM = CONFIG['JS_SHELL_NAME'] + Program(CONFIG['JS_SHELL_NAME']) if CONFIG['JS_BUNDLED_EDITLINE']: USE_LIBS += ['editline'] USE_LIBS += ['static:js'] diff --git a/js/xpconnect/shell/moz.build b/js/xpconnect/shell/moz.build index 36b19bb16dc..289b5d17d81 100644 --- a/js/xpconnect/shell/moz.build +++ b/js/xpconnect/shell/moz.build @@ -6,7 +6,7 @@ FAIL_ON_WARNINGS = True -PROGRAM = 'xpcshell' +Program('xpcshell') SOURCES += [ 'xpcshell.cpp', diff --git a/layout/media/moz.build b/layout/media/moz.build index a10875dd15c..fd2101cf99f 100644 --- a/layout/media/moz.build +++ b/layout/media/moz.build @@ -4,7 +4,7 @@ # 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 = 'gkmedias' +Library('gkmedias') if CONFIG['GKMEDIAS_SHARED_LIBRARY']: FORCE_SHARED_LIB = True diff --git a/layout/media/webrtc/moz.build b/layout/media/webrtc/moz.build index 8a0701f6382..32f5e78d335 100644 --- a/layout/media/webrtc/moz.build +++ b/layout/media/webrtc/moz.build @@ -4,5 +4,5 @@ # 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 = 'webrtc' +Library('webrtc') FINAL_LIBRARY = 'xul' diff --git a/layout/style/test/moz.build b/layout/style/test/moz.build index bc62ec5cb0f..96f7636f3c4 100644 --- a/layout/style/test/moz.build +++ b/layout/style/test/moz.build @@ -8,9 +8,9 @@ HOST_SOURCES += [ 'ListCSSProperties.cpp', ] -HOST_SIMPLE_PROGRAMS += [ +HostSimplePrograms([ 'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES -] +]) MOCHITEST_MANIFESTS += [ 'chrome/mochitest.ini', diff --git a/media/libcubeb/src/moz.build b/media/libcubeb/src/moz.build index 944744d07eb..8b7a0dd1b03 100644 --- a/media/libcubeb/src/moz.build +++ b/media/libcubeb/src/moz.build @@ -4,7 +4,7 @@ # 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 = 'cubeb' +Library('cubeb') SOURCES += [ 'cubeb.c', diff --git a/media/libcubeb/tests/moz.build b/media/libcubeb/tests/moz.build index 08e6b94d15c..e7869a529ca 100644 --- a/media/libcubeb/tests/moz.build +++ b/media/libcubeb/tests/moz.build @@ -4,16 +4,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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'test_tone' -] +]) if CONFIG['OS_TARGET'] != 'Android': - CPP_UNIT_TESTS += [ + CppUnitTests([ 'test_audio', 'test_latency', 'test_sanity' - ] + ]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/media/libpng/moz.build b/media/libpng/moz.build index 330f5ff7515..b95c00779a9 100644 --- a/media/libpng/moz.build +++ b/media/libpng/moz.build @@ -38,7 +38,7 @@ if CONFIG['MOZ_PNG_ARM_NEON']: 'arm/filter_neon.S' ] -LIBRARY_NAME = 'mozpng' +Library('mozpng') MSVC_ENABLE_PGO = True diff --git a/media/libspeex_resampler/src/moz.build b/media/libspeex_resampler/src/moz.build index 850cd926023..5ab9d06825b 100644 --- a/media/libspeex_resampler/src/moz.build +++ b/media/libspeex_resampler/src/moz.build @@ -4,7 +4,7 @@ # 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 = 'speex' +Library('speex') EXPORTS.speex += [ 'speex_resampler.h', diff --git a/media/libvpx/moz.build b/media/libvpx/moz.build index 4e97a486568..03aa3edd5aa 100644 --- a/media/libvpx/moz.build +++ b/media/libvpx/moz.build @@ -13,7 +13,7 @@ if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']: 'build/make/obj_int_extract.c', ] - HOST_PROGRAM = 'host_obj_int_extract' + HostProgram('host_obj_int_extract') # Unify fewer files together to reduce the chance of name collision FILES_PER_UNIFIED_FILE = 8 diff --git a/media/mtransport/standalone/moz.build b/media/mtransport/standalone/moz.build index e15cc713638..e9f28d5507e 100644 --- a/media/mtransport/standalone/moz.build +++ b/media/mtransport/standalone/moz.build @@ -9,7 +9,7 @@ include('../objs.mozbuild') # These files cannot be built in unified mode because they force NSPR logging. SOURCES += mtransport_cppsrcs -LIBRARY_NAME = 'mtransport_s' +Library('mtransport_s') LOCAL_INCLUDES += [ '/media/mtransport/', diff --git a/media/mtransport/test/moz.build b/media/mtransport/test/moz.build index cd08fbfc869..fd2c8fb29e8 100644 --- a/media/mtransport/test/moz.build +++ b/media/mtransport/test/moz.build @@ -5,7 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': - CPP_UNIT_TESTS += [ + CppUnitTests([ 'buffered_stun_socket_unittest', 'ice_unittest', 'nrappkit_unittest', @@ -16,12 +16,12 @@ if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': 'TestSyncRunnable', 'transport_unittests', 'turn_unittest', - ] + ]) if CONFIG['MOZ_SCTP']: - CPP_UNIT_TESTS += [ + CppUnitTests([ 'sctp_unittest', - ] + ]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/media/omx-plugin/froyo/moz.build b/media/omx-plugin/froyo/moz.build index 6faa233c2d2..dc530b2134c 100644 --- a/media/omx-plugin/froyo/moz.build +++ b/media/omx-plugin/froyo/moz.build @@ -8,7 +8,7 @@ SOURCES += [ 'OmxPluginFroyo.cpp', ] -LIBRARY_NAME = 'omxpluginfroyo' +Library('omxpluginfroyo') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/gb/moz.build b/media/omx-plugin/gb/moz.build index 755b92870e9..c7616aaa8dd 100644 --- a/media/omx-plugin/gb/moz.build +++ b/media/omx-plugin/gb/moz.build @@ -8,7 +8,7 @@ SOURCES += [ 'OmxPlugin236.cpp', ] -LIBRARY_NAME = 'omxplugingb' +Library('omxplugingb') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/gb235/moz.build b/media/omx-plugin/gb235/moz.build index 8cae2d6dcfe..c25bed8b144 100644 --- a/media/omx-plugin/gb235/moz.build +++ b/media/omx-plugin/gb235/moz.build @@ -8,7 +8,7 @@ SOURCES += [ 'OmxPlugin235.cpp', ] -LIBRARY_NAME = 'omxplugingb235' +Library('omxplugingb235') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/hc/moz.build b/media/omx-plugin/hc/moz.build index 4de7ee83fff..9ad3794f7e2 100644 --- a/media/omx-plugin/hc/moz.build +++ b/media/omx-plugin/hc/moz.build @@ -8,7 +8,7 @@ SOURCES += [ 'OmxPluginHoneycomb.cpp', ] -LIBRARY_NAME = 'omxpluginhc' +Library('omxpluginhc') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/kk/moz.build b/media/omx-plugin/kk/moz.build index 974b057a7a6..4667493d803 100644 --- a/media/omx-plugin/kk/moz.build +++ b/media/omx-plugin/kk/moz.build @@ -8,7 +8,7 @@ SOURCES += [ 'OmxPluginKitKat.cpp', ] -LIBRARY_NAME = 'omxpluginkk' +Library('omxpluginkk') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/lib/froyo/libstagefright/moz.build b/media/omx-plugin/lib/froyo/libstagefright/moz.build index 2061ad10a8d..0632ae65f5b 100644 --- a/media/omx-plugin/lib/froyo/libstagefright/moz.build +++ b/media/omx-plugin/lib/froyo/libstagefright/moz.build @@ -10,7 +10,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': 'libstagefright.cpp', ] -LIBRARY_NAME = 'stagefright' +Library('stagefright') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/lib/gb/libstagefright/moz.build b/media/omx-plugin/lib/gb/libstagefright/moz.build index 3d9a3da02e0..209ceb46d1b 100644 --- a/media/omx-plugin/lib/gb/libstagefright/moz.build +++ b/media/omx-plugin/lib/gb/libstagefright/moz.build @@ -10,7 +10,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': 'libstagefright.cpp', ] -LIBRARY_NAME = 'stagefright' +Library('stagefright') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/lib/gb/libstagefright_color_conversion/moz.build b/media/omx-plugin/lib/gb/libstagefright_color_conversion/moz.build index f2deef9aa55..efbd44f49e8 100644 --- a/media/omx-plugin/lib/gb/libstagefright_color_conversion/moz.build +++ b/media/omx-plugin/lib/gb/libstagefright_color_conversion/moz.build @@ -10,7 +10,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': 'libstagefright_color_conversion.cpp', ] -LIBRARY_NAME = 'stagefright_color_conversion' +Library('stagefright_color_conversion') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/lib/gb/libutils/moz.build b/media/omx-plugin/lib/gb/libutils/moz.build index f1d6f969eac..a131edf0ad6 100644 --- a/media/omx-plugin/lib/gb/libutils/moz.build +++ b/media/omx-plugin/lib/gb/libutils/moz.build @@ -10,7 +10,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': 'libutils.cpp', ] -LIBRARY_NAME = 'utils' +Library('utils') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/lib/gb235/libstagefright/moz.build b/media/omx-plugin/lib/gb235/libstagefright/moz.build index 3d9a3da02e0..209ceb46d1b 100644 --- a/media/omx-plugin/lib/gb235/libstagefright/moz.build +++ b/media/omx-plugin/lib/gb235/libstagefright/moz.build @@ -10,7 +10,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': 'libstagefright.cpp', ] -LIBRARY_NAME = 'stagefright' +Library('stagefright') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/lib/hc/libstagefright/moz.build b/media/omx-plugin/lib/hc/libstagefright/moz.build index 3d9a3da02e0..209ceb46d1b 100644 --- a/media/omx-plugin/lib/hc/libstagefright/moz.build +++ b/media/omx-plugin/lib/hc/libstagefright/moz.build @@ -10,7 +10,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': 'libstagefright.cpp', ] -LIBRARY_NAME = 'stagefright' +Library('stagefright') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/lib/ics/libstagefright/moz.build b/media/omx-plugin/lib/ics/libstagefright/moz.build index 3f95e12fc84..c22b723f5cc 100644 --- a/media/omx-plugin/lib/ics/libstagefright/moz.build +++ b/media/omx-plugin/lib/ics/libstagefright/moz.build @@ -10,7 +10,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': 'libstagefright.cpp', ] -LIBRARY_NAME = 'stagefright' +Library('stagefright') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/lib/ics/libutils/moz.build b/media/omx-plugin/lib/ics/libutils/moz.build index b5c914d5162..409b4e712ba 100644 --- a/media/omx-plugin/lib/ics/libutils/moz.build +++ b/media/omx-plugin/lib/ics/libutils/moz.build @@ -10,7 +10,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': 'libutils.cpp', ] -LIBRARY_NAME = 'utils' +Library('utils') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build b/media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build index 99859c8fe80..b250510128d 100644 --- a/media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build +++ b/media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build @@ -10,7 +10,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': 'libvideoeditorplayer.cpp', ] -LIBRARY_NAME = 'videoeditorplayer' +Library('videoeditorplayer') FORCE_SHARED_LIB = True diff --git a/media/omx-plugin/moz.build b/media/omx-plugin/moz.build index 05bc4c20f4f..1507a4094c0 100644 --- a/media/omx-plugin/moz.build +++ b/media/omx-plugin/moz.build @@ -18,7 +18,7 @@ SOURCES += [ 'OmxPlugin.cpp', ] -LIBRARY_NAME = 'omxplugin' +Library('omxplugin') FORCE_SHARED_LIB = True diff --git a/media/webrtc/signaling/test/moz.build b/media/webrtc/signaling/test/moz.build index 5e32f53f872..5ce5002546b 100644 --- a/media/webrtc/signaling/test/moz.build +++ b/media/webrtc/signaling/test/moz.build @@ -5,12 +5,12 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': - CPP_UNIT_TESTS += [ + CppUnitTests([ 'mediaconduit_unittests', 'mediapipeline_unittest', 'sdp_unittests', 'signaling_unittests', - ] + ]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/memory/build/moz.build b/memory/build/moz.build index 447d02f85a4..73ce1ac955a 100644 --- a/memory/build/moz.build +++ b/memory/build/moz.build @@ -36,7 +36,7 @@ if CONFIG['MOZ_REPLACE_MALLOC']: 'replace_malloc.c', ] -LIBRARY_NAME = 'memory' +Library('memory') if CONFIG['MOZ_JEMALLOC3']: if not CONFIG['MOZ_NATIVE_JEMALLOC']: diff --git a/memory/jemalloc/moz.build b/memory/jemalloc/moz.build index 310a55a4988..0ab76125157 100644 --- a/memory/jemalloc/moz.build +++ b/memory/jemalloc/moz.build @@ -36,7 +36,7 @@ if CONFIG['OS_TARGET'] == 'Darwin' and not CONFIG['MOZ_REPLACE_MALLOC']: 'src/src/zone.c', ] -LIBRARY_NAME = 'jemalloc' +Library('jemalloc') FORCE_STATIC_LIB = True diff --git a/memory/mozalloc/moz.build b/memory/mozalloc/moz.build index 704ce673d98..d279faaedf0 100644 --- a/memory/mozalloc/moz.build +++ b/memory/mozalloc/moz.build @@ -57,7 +57,7 @@ else: 'VolatileBufferFallback.cpp', ] -LIBRARY_NAME = 'mozalloc' +Library('mozalloc') if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': FORCE_STATIC_LIB = True diff --git a/memory/mozalloc/tests/moz.build b/memory/mozalloc/tests/moz.build index b7a99656703..6b265f5beb9 100644 --- a/memory/mozalloc/tests/moz.build +++ b/memory/mozalloc/tests/moz.build @@ -4,9 +4,9 @@ # 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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestVolatileBuffer', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/memory/mozjemalloc/moz.build b/memory/mozjemalloc/moz.build index d5b58e5ea5d..f887ae1903a 100644 --- a/memory/mozjemalloc/moz.build +++ b/memory/mozjemalloc/moz.build @@ -12,7 +12,7 @@ if not CONFIG['MOZ_JEMALLOC3']: SOURCES += [ 'jemalloc.c', ] - LIBRARY_NAME = 'mozjemalloc' + Library('mozjemalloc') STATIC_LIBRARY_NAME = 'jemalloc' FORCE_STATIC_LIB = True diff --git a/memory/replace/dmd/moz.build b/memory/replace/dmd/moz.build index acf4c2ebe06..c8f15f2dae3 100644 --- a/memory/replace/dmd/moz.build +++ b/memory/replace/dmd/moz.build @@ -18,7 +18,7 @@ SOURCES += [ '../../../nsprpub/lib/libc/src/strcpy.c', ] -LIBRARY_NAME = 'dmd' +Library('dmd') FORCE_SHARED_LIB = True diff --git a/memory/replace/dummy/moz.build b/memory/replace/dummy/moz.build index 7d2c185c85e..2aeda4fb26c 100644 --- a/memory/replace/dummy/moz.build +++ b/memory/replace/dummy/moz.build @@ -9,7 +9,7 @@ SOURCES += [ 'dummy_replace_malloc.c', ] -LIBRARY_NAME = 'replace_malloc' +Library('replace_malloc') FORCE_SHARED_LIB = True diff --git a/memory/replace/jemalloc/moz.build b/memory/replace/jemalloc/moz.build index 1759d60cab0..65c5999f6c8 100644 --- a/memory/replace/jemalloc/moz.build +++ b/memory/replace/jemalloc/moz.build @@ -17,7 +17,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': 'pthread_atfork.c', ] -LIBRARY_NAME = 'replace_jemalloc' +Library('replace_jemalloc') USE_LIBS += [ 'jemalloc', diff --git a/mfbt/moz.build b/mfbt/moz.build index 90ef1aae540..b51eac53c0f 100644 --- a/mfbt/moz.build +++ b/mfbt/moz.build @@ -6,7 +6,7 @@ TEST_DIRS += ['tests'] -LIBRARY_NAME = 'mfbt' +Library('mfbt') EXPORTS.mozilla = [ 'Alignment.h', diff --git a/mfbt/tests/moz.build b/mfbt/tests/moz.build index 9520369fe90..48c2fde8e71 100644 --- a/mfbt/tests/moz.build +++ b/mfbt/tests/moz.build @@ -4,7 +4,7 @@ # 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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestArrayUtils', 'TestAtomics', 'TestBinarySearch', @@ -30,12 +30,12 @@ CPP_UNIT_TESTS += [ 'TestTypeTraits', 'TestUniquePtr', 'TestWeakPtr', -] +]) if not CONFIG['MOZ_ASAN']: - CPP_UNIT_TESTS += [ + CppUnitTests([ 'TestPoisonArea', - ] + ]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/modules/libbz2/src/moz.build b/modules/libbz2/src/moz.build index fade621e6b9..68f46a9998b 100644 --- a/modules/libbz2/src/moz.build +++ b/modules/libbz2/src/moz.build @@ -20,9 +20,9 @@ csrcs = [ ] HOST_SOURCES += csrcs -HOST_LIBRARY_NAME = 'hostbz2' +HostLibrary('hostbz2') -LIBRARY_NAME = 'bz2' +Library('bz2') UNIFIED_SOURCES += [ 'blocksort.c', diff --git a/modules/libmar/sign/moz.build b/modules/libmar/sign/moz.build index a6d0308e0f0..d7b8d1f8b30 100644 --- a/modules/libmar/sign/moz.build +++ b/modules/libmar/sign/moz.build @@ -4,7 +4,7 @@ # 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 = 'signmar' +Library('signmar') UNIFIED_SOURCES += [ 'mar_sign.c', diff --git a/modules/libmar/src/moz.build b/modules/libmar/src/moz.build index e40ed05673e..2d25e0849af 100644 --- a/modules/libmar/src/moz.build +++ b/modules/libmar/src/moz.build @@ -14,9 +14,9 @@ HOST_SOURCES += [ 'mar_extract.c', 'mar_read.c', ] -HOST_LIBRARY_NAME = 'hostmar' +HostLibrary('hostmar') -LIBRARY_NAME = 'mar' +Library('mar') UNIFIED_SOURCES += [ 'mar_create.c', diff --git a/modules/libmar/tool/moz.build b/modules/libmar/tool/moz.build index 638c8ea744d..7cb27da298d 100644 --- a/modules/libmar/tool/moz.build +++ b/modules/libmar/tool/moz.build @@ -8,14 +8,14 @@ HOST_SOURCES += [ 'mar.c', ] -HOST_PROGRAM = 'mar' +HostProgram('mar') HOST_USE_LIBS += [ 'hostmar', ] if CONFIG['MOZ_ENABLE_SIGNMAR']: - PROGRAM = 'signmar' + Program('signmar') SOURCES += HOST_SOURCES diff --git a/modules/libmar/verify/moz.build b/modules/libmar/verify/moz.build index eea09b9cc47..7a6a1422730 100644 --- a/modules/libmar/verify/moz.build +++ b/modules/libmar/verify/moz.build @@ -4,7 +4,7 @@ # 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 = 'verifymar' +Library('verifymar') UNIFIED_SOURCES += [ 'cryptox.c', diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build index d0e90f0b71d..e97a8f258d2 100644 --- a/mozglue/build/moz.build +++ b/mozglue/build/moz.build @@ -69,7 +69,7 @@ if CONFIG['MOZ_ASAN']: ] -LIBRARY_NAME = 'mozglue' +Library('mozglue') USE_LIBS += [ 'mfbt', diff --git a/mozglue/linker/moz.build b/mozglue/linker/moz.build index 4b7ccdcf3ad..c44bd429fd2 100644 --- a/mozglue/linker/moz.build +++ b/mozglue/linker/moz.build @@ -12,14 +12,14 @@ SOURCES += [ 'Zip.cpp', ] -LIBRARY_NAME = 'linker' +Library('linker') HOST_SOURCES += [ 'SeekableZStream.cpp', 'szip.cpp', ] -HOST_PROGRAM = 'szip' +HostProgram('szip') FINAL_LIBRARY = 'mozglue' diff --git a/mozglue/linker/tests/moz.build b/mozglue/linker/tests/moz.build index 73c4585ebe8..4d1468bcfa0 100644 --- a/mozglue/linker/tests/moz.build +++ b/mozglue/linker/tests/moz.build @@ -9,9 +9,9 @@ NO_DIST_INSTALL = True SOURCES += [ 'TestZip.cpp', ] -SIMPLE_PROGRAMS += [ +SimplePrograms([ 'TestZip', -] +]) LOCAL_INCLUDES += ['..'] USE_LIBS += [ 'linker', diff --git a/mozglue/tests/moz.build b/mozglue/tests/moz.build index 01fb5234f39..7b8d5ef7376 100644 --- a/mozglue/tests/moz.build +++ b/mozglue/tests/moz.build @@ -10,6 +10,6 @@ SOURCES += [ 'ShowSSEConfig.cpp', ] -CPP_UNIT_TESTS += [ +CppUnitTests([ 'ShowSSEConfig', -] +]) diff --git a/netwerk/sctp/src/moz.build b/netwerk/sctp/src/moz.build index 39fc3176f4a..95c058250b5 100644 --- a/netwerk/sctp/src/moz.build +++ b/netwerk/sctp/src/moz.build @@ -40,7 +40,7 @@ if CONFIG['OS_TARGET'] == 'Android': 'ifaddrs_android.cpp', ] -LIBRARY_NAME = 'nksctp_s' +Library('nksctp_s') include('/ipc/chromium/chromium-config.mozbuild') diff --git a/netwerk/srtp/src/moz.build b/netwerk/srtp/src/moz.build index 3fe725ab3c8..ff564203140 100644 --- a/netwerk/srtp/src/moz.build +++ b/netwerk/srtp/src/moz.build @@ -31,7 +31,7 @@ UNIFIED_SOURCES += [ 'srtp/srtp.c', ] -LIBRARY_NAME = 'nksrtp_s' +Library('nksrtp_s') include('/ipc/chromium/chromium-config.mozbuild') diff --git a/netwerk/streamconv/test/moz.build b/netwerk/streamconv/test/moz.build index b5a9f98b2f4..d62d4669197 100644 --- a/netwerk/streamconv/test/moz.build +++ b/netwerk/streamconv/test/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'TestStreamConv' +Program('TestStreamConv') UNIFIED_SOURCES += [ 'Converters.cpp', diff --git a/netwerk/test/moz.build b/netwerk/test/moz.build index 5a6e7d370ac..c86196ed4ae 100644 --- a/netwerk/test/moz.build +++ b/netwerk/test/moz.build @@ -16,7 +16,7 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] if CONFIG['OS_ARCH'] != 'Darwin': XPCSHELL_TESTS_MANIFESTS += ['unit_ipc/xpcshell.ini'] -SIMPLE_PROGRAMS = [ +SimplePrograms([ 'PropertiesTest', 'ReadNTLM', 'TestBlockingSocket', @@ -32,7 +32,7 @@ SIMPLE_PROGRAMS = [ 'TestUpload', 'TestURLParser', 'urltest', -] +]) # XXX Make this work in libxul builds. #SIMPLE_PROGRAMS += [ @@ -50,11 +50,11 @@ SOURCES += [ '%s.cpp' % s for s in SIMPLE_PROGRAMS ] -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestCookie', 'TestSTSParser', 'TestUDPSocket', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/other-licenses/bsdiff/moz.build b/other-licenses/bsdiff/moz.build index a341e449613..e12a40f8853 100644 --- a/other-licenses/bsdiff/moz.build +++ b/other-licenses/bsdiff/moz.build @@ -8,7 +8,7 @@ HOST_SOURCES += [ 'bsdiff.c', ] -HOST_PROGRAM = 'mbsdiff' +HostProgram('mbsdiff') if CONFIG['MOZ_NATIVE_BZ2']: HOST_OS_LIBS += CONFIG['MOZ_BZ2_LIBS'] diff --git a/profile/dirserviceprovider/moz.build b/profile/dirserviceprovider/moz.build index b576c8da6c6..a55af7f5086 100644 --- a/profile/dirserviceprovider/moz.build +++ b/profile/dirserviceprovider/moz.build @@ -15,7 +15,7 @@ if CONFIG['MOZ_PROFILELOCKING']: UNIFIED_SOURCES += ['ProfileUnlockerWin.cpp'] EXPORTS.mozilla += ['ProfileUnlockerWin.h'] -LIBRARY_NAME = 'profdirserviceprovidersa_s' +Library('profdirserviceprovidersa_s') FORCE_STATIC_LIB = True diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py index 339ab7610dd..346cae03ccd 100644 --- a/python/mozbuild/mozbuild/frontend/context.py +++ b/python/mozbuild/mozbuild/frontend/context.py @@ -122,14 +122,14 @@ class Context(KeyedDefaultDict): else: return default() - def _validate(self, key, value): + def _validate(self, key, value, is_template=False): """Validates whether the key is allowed and if the value's type matches. """ stored_type, input_type, docs, tier = \ self._allowed_variables.get(key, (None, None, None, None)) - if stored_type is None: + if stored_type is None or not is_template and key in TEMPLATE_VARIABLES: raise KeyError('global_ns', 'set_unknown', key, value) # If the incoming value is not the type we store, we try to convert @@ -182,6 +182,11 @@ class Context(KeyedDefaultDict): return set(tier for tier in tiers if tier) +class TemplateContext(Context): + def _validate(self, key, value): + return Context._validate(self, key, value, True) + + class FinalTargetValue(ContextDerivedValue, unicode): def __new__(cls, context, value=""): if not value: @@ -946,6 +951,27 @@ for name, (storage_type, input_types, docs, tier) in VARIABLES.items(): raise RuntimeError('%s has a "list" storage type. Use "List" instead.' % name) +# Set of variables that are only allowed in templates: +TEMPLATE_VARIABLES = { + 'CPP_UNIT_TESTS', + 'HOST_PROGRAM', + 'HOST_LIBRARY_NAME', + 'HOST_SIMPLE_PROGRAMS', + 'LIBRARY_NAME', + 'PROGRAM', + 'SIMPLE_PROGRAMS', +} + +# Add a note to template variable documentation. +for name in TEMPLATE_VARIABLES: + if name not in VARIABLES: + raise RuntimeError('%s is in TEMPLATE_VARIABLES but not in VARIABLES.' + % name) + storage_type, input_types, docs, tier = VARIABLES[name] + docs += 'This variable is only available in templates.\n' + VARIABLES[name] = (storage_type, input_types, docs, tier) + + # The set of functions exposed to the sandbox. # # Each entry is a tuple of: @@ -1211,7 +1237,84 @@ SPECIAL_VARIABLES = { # Deprecation hints. DEPRECATION_HINTS = { + 'CPP_UNIT_TESTS': ''' + Please use' + + CppUnitTests(['foo', 'bar']) + + instead of + + CPP_UNIT_TESTS += ['foo', 'bar'] + ''', + + 'HOST_PROGRAM': ''' + Please use + + HostProgram('foo') + + instead of + + HOST_PROGRAM = 'foo' + ''', + + 'HOST_LIBRARY_NAME': ''' + Please use + + HostLibrary('foo') + + instead of + + HOST_LIBRARY_NAME = 'foo' + ''', + + 'HOST_SIMPLE_PROGRAMS': ''' + Please use + + HostSimplePrograms(['foo', 'bar']) + + instead of + + HOST_SIMPLE_PROGRAMS += ['foo', 'bar']" + ''', + + 'LIBRARY_NAME': ''' + Please use + + Library('foo') + + instead of + + LIBRARY_NAME = 'foo' + ''', + + 'PROGRAM': ''' + Please use + + Program('foo') + + instead of + + PROGRAM = 'foo'" + ''', + + 'SIMPLE_PROGRAMS': ''' + Please use + + SimplePrograms(['foo', 'bar']) + + instead of + + SIMPLE_PROGRAMS += ['foo', 'bar']" + ''', + 'TOOL_DIRS': 'Please use the DIRS variable instead.', + 'TEST_TOOL_DIRS': 'Please use the TEST_DIRS variable instead.', + 'PARALLEL_DIRS': 'Please use the DIRS variable instead.', } + +# Make sure that all template variables have a deprecation hint. +for name in TEMPLATE_VARIABLES: + if name not in DEPRECATION_HINTS: + raise RuntimeError('Missing deprecation hint for %s' % name) diff --git a/python/mozbuild/mozbuild/frontend/gyp_reader.py b/python/mozbuild/mozbuild/frontend/gyp_reader.py index 63a335d175a..4e9b6a16bc7 100644 --- a/python/mozbuild/mozbuild/frontend/gyp_reader.py +++ b/python/mozbuild/mozbuild/frontend/gyp_reader.py @@ -11,7 +11,7 @@ import mozpack.path as mozpath from mozpack.files import FileFinder from .sandbox import alphabetical_sorted from .context import ( - Context, + TemplateContext, VARIABLES, ) from mozbuild.util import ( @@ -52,7 +52,7 @@ for unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME', generator_default_variables[unused] = b'' -class GypContext(Context): +class GypContext(TemplateContext): """Specialized Context for use with data extracted from Gyp. config is the ConfigEnvironment for this context. @@ -61,7 +61,8 @@ class GypContext(Context): """ def __init__(self, config, relobjdir): self._relobjdir = relobjdir - Context.__init__(self, allowed_variables=self.VARIABLES(), config=config) + TemplateContext.__init__(self, allowed_variables=self.VARIABLES(), + config=config) @classmethod @memoize diff --git a/python/mozbuild/mozbuild/frontend/reader.py b/python/mozbuild/mozbuild/frontend/reader.py index 17f187e3b17..d6a731ffa9e 100644 --- a/python/mozbuild/mozbuild/frontend/reader.py +++ b/python/mozbuild/mozbuild/frontend/reader.py @@ -22,6 +22,7 @@ import inspect import logging import os import sys +import textwrap import time import tokenize import traceback @@ -59,6 +60,7 @@ from .context import ( VARIABLES, DEPRECATION_HINTS, SPECIAL_VARIABLES, + TemplateContext, ) if sys.version_info.major == 2: @@ -379,7 +381,7 @@ class MozbuildSandbox(Sandbox): func, code, path = template def template_function(*args, **kwargs): - context = Context(VARIABLES, self._context.config) + context = TemplateContext(VARIABLES, self._context.config) context.add_source(self._execution_stack[-1]) for p in self._context.all_paths: context.add_source(p) @@ -390,6 +392,10 @@ class MozbuildSandbox(Sandbox): sandbox.exec_source(code, path) + # This is gross, but allows the merge to happen. Eventually, the + # merging will go away and template contexts emitted independently. + klass = self._context.__class__ + self._context.__class__ = TemplateContext # The sandbox will do all the necessary checks for these merges. for key, value in context.items(): if isinstance(value, dict): @@ -398,6 +404,7 @@ class MozbuildSandbox(Sandbox): self[key] += value else: self[key] = value + self._context.__class__ = klass for p in context.all_paths: self._context.add_source(p) @@ -668,7 +675,8 @@ class BuildReaderError(Exception): s.write('\n') if inner.args[2] in DEPRECATION_HINTS: - s.write('%s\n' % DEPRECATION_HINTS[inner.args[2]]) + s.write('%s\n' % + textwrap.dedent(DEPRECATION_HINTS[inner.args[2]]).strip()) return s.write('Please change the file to not use this variable.\n') diff --git a/python/mozbuild/mozbuild/test/backend/data/visual-studio/moz.build b/python/mozbuild/mozbuild/test/backend/data/visual-studio/moz.build index e52acb3794f..ae3153f2aa0 100644 --- a/python/mozbuild/mozbuild/test/backend/data/visual-studio/moz.build +++ b/python/mozbuild/mozbuild/test/backend/data/visual-studio/moz.build @@ -4,4 +4,4 @@ add_tier_dir('libs', ['dir1']) -LIBRARY_NAME = 'test' +Library('test') diff --git a/python/mozbuild/mozbuild/test/frontend/data/program/moz.build b/python/mozbuild/mozbuild/test/frontend/data/program/moz.build index 4f315a4619a..4c19b90cd54 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/program/moz.build +++ b/python/mozbuild/mozbuild/test/frontend/data/program/moz.build @@ -1,6 +1,15 @@ # Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ -PROGRAM = 'test_program' +@template +def Program(name): + PROGRAM = name -SIMPLE_PROGRAMS = [ 'test_program1', 'test_program2' ] + +@template +def SimplePrograms(names): + SIMPLE_PROGRAMS += names + +Program('test_program') + +SimplePrograms([ 'test_program1', 'test_program2' ]) diff --git a/rdf/tests/rdfcat/moz.build b/rdf/tests/rdfcat/moz.build index f4b730ad887..56b2f877539 100644 --- a/rdf/tests/rdfcat/moz.build +++ b/rdf/tests/rdfcat/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'rdfcat' +Program('rdfcat') SOURCES += [ 'rdfcat.cpp', diff --git a/rdf/tests/rdfpoll/moz.build b/rdf/tests/rdfpoll/moz.build index 7367378dbcc..41ef0fd2579 100644 --- a/rdf/tests/rdfpoll/moz.build +++ b/rdf/tests/rdfpoll/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'rdfpoll' +Program('rdfpoll') SOURCES += [ 'rdfpoll.cpp', diff --git a/rdf/tests/triplescat/moz.build b/rdf/tests/triplescat/moz.build index 13953e1714e..f1d0cfb0a7d 100644 --- a/rdf/tests/triplescat/moz.build +++ b/rdf/tests/triplescat/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'triplescat' +Program('triplescat') SOURCES += [ 'triplescat.cpp', diff --git a/rdf/util/moz.build b/rdf/util/moz.build index 917916bd220..b99bea462c0 100644 --- a/rdf/util/moz.build +++ b/rdf/util/moz.build @@ -14,7 +14,7 @@ include('objs.mozbuild') SOURCES += rdf_util_src_cppsrcs -LIBRARY_NAME = 'rdfutil_external_s' +Library('rdfutil_external_s') # we don't want the shared lib, but we want to force the creation of a static lib. FORCE_STATIC_LIB = True diff --git a/security/manager/ssl/tests/compiled/moz.build b/security/manager/ssl/tests/compiled/moz.build index 4c201f0b035..6ed376dd9da 100644 --- a/security/manager/ssl/tests/compiled/moz.build +++ b/security/manager/ssl/tests/compiled/moz.build @@ -4,9 +4,9 @@ # 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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestCertDB', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/security/manager/ssl/tests/unit/pkcs11testmodule/moz.build b/security/manager/ssl/tests/unit/pkcs11testmodule/moz.build index 5f9716aee57..9543ee60073 100644 --- a/security/manager/ssl/tests/unit/pkcs11testmodule/moz.build +++ b/security/manager/ssl/tests/unit/pkcs11testmodule/moz.build @@ -8,7 +8,7 @@ UNIFIED_SOURCES += [ 'pkcs11testmodule.cpp', ] -LIBRARY_NAME = 'pkcs11testmodule' +Library('pkcs11testmodule') FORCE_SHARED_LIB = True # C_GetFunctionList needs to be exported. As it turns out, it's much easier to diff --git a/security/manager/ssl/tests/unit/tlsserver/cmd/moz.build b/security/manager/ssl/tests/unit/tlsserver/cmd/moz.build index a679f8a0b90..416fb35a1c4 100644 --- a/security/manager/ssl/tests/unit/tlsserver/cmd/moz.build +++ b/security/manager/ssl/tests/unit/tlsserver/cmd/moz.build @@ -6,12 +6,12 @@ FAIL_ON_WARNINGS = True -SIMPLE_PROGRAMS = [ +SimplePrograms([ 'BadCertServer', 'ClientAuthServer', 'GenerateOCSPResponse', 'OCSPStaplingServer', -] +]) SOURCES += [ '%s.cpp' % s for s in SIMPLE_PROGRAMS diff --git a/security/manager/ssl/tests/unit/tlsserver/lib/moz.build b/security/manager/ssl/tests/unit/tlsserver/lib/moz.build index d2ce36eca6e..28df99a529c 100644 --- a/security/manager/ssl/tests/unit/tlsserver/lib/moz.build +++ b/security/manager/ssl/tests/unit/tlsserver/lib/moz.build @@ -14,4 +14,4 @@ LOCAL_INCLUDES += [ '../../../../../../pkix/test/lib', ] -LIBRARY_NAME = 'tlsserver' +Library('tlsserver') diff --git a/security/pkix/moz.build b/security/pkix/moz.build index 5e8570429c3..3c3a4dbf541 100644 --- a/security/pkix/moz.build +++ b/security/pkix/moz.build @@ -37,6 +37,6 @@ if CONFIG['_MSC_VER']: FAIL_ON_WARNINGS = True -LIBRARY_NAME = 'mozillapkix' +Library('mozillapkix') FINAL_LIBRARY = 'xul' diff --git a/security/pkix/test/lib/moz.build b/security/pkix/test/lib/moz.build index cfaa1f3fff2..9374ea43302 100644 --- a/security/pkix/test/lib/moz.build +++ b/security/pkix/test/lib/moz.build @@ -24,7 +24,7 @@ SOURCES += [ 'pkixtestutil.cpp', ] -LIBRARY_NAME = 'pkixtestutil' +Library('pkixtestutil') LOCAL_INCLUDES += [ '../../include', diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build index 9aa1e0b1b8b..74c1736a4b4 100644 --- a/security/sandbox/linux/moz.build +++ b/security/sandbox/linux/moz.build @@ -6,7 +6,7 @@ FAIL_ON_WARNINGS = True -LIBRARY_NAME = 'mozsandbox' +Library('mozsandbox') FORCE_SHARED_LIB = True EXPORTS.mozilla += [ diff --git a/security/sandbox/moz.build b/security/sandbox/moz.build index 716fc22630b..113a143724a 100644 --- a/security/sandbox/moz.build +++ b/security/sandbox/moz.build @@ -9,7 +9,7 @@ if CONFIG['OS_ARCH'] == 'Linux': elif CONFIG['OS_ARCH'] == 'Darwin': DIRS += ['mac'] elif CONFIG['OS_ARCH'] == 'WINNT': - LIBRARY_NAME = 'sandbox_s' + Library('sandbox_s') FORCE_STATIC_LIB = True DIRS += [ diff --git a/security/sandbox/staticruntime/moz.build b/security/sandbox/staticruntime/moz.build index 33775efd1c8..ad6ddfe976f 100644 --- a/security/sandbox/staticruntime/moz.build +++ b/security/sandbox/staticruntime/moz.build @@ -5,7 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['OS_ARCH'] == 'WINNT': - LIBRARY_NAME = 'sandbox_staticruntime_s' + Library('sandbox_staticruntime_s') FORCE_STATIC_LIB = True USE_STATIC_LIBS = True diff --git a/security/sandbox/win/src/sandboxbroker/moz.build b/security/sandbox/win/src/sandboxbroker/moz.build index f95623820e5..eed82492d5a 100644 --- a/security/sandbox/win/src/sandboxbroker/moz.build +++ b/security/sandbox/win/src/sandboxbroker/moz.build @@ -4,7 +4,7 @@ # 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 = 'sandboxbroker' +Library('sandboxbroker') USE_LIBS += [ 'nspr', diff --git a/startupcache/test/moz.build b/startupcache/test/moz.build index 2347e19ec73..7d6a4e7f7cc 100644 --- a/startupcache/test/moz.build +++ b/startupcache/test/moz.build @@ -4,9 +4,9 @@ # 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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestStartupCache', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/storage/test/moz.build b/storage/test/moz.build index f8ea008dad0..02d25832bab 100644 --- a/storage/test/moz.build +++ b/storage/test/moz.build @@ -6,7 +6,7 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] -CPP_UNIT_TESTS += [ +CppUnitTests([ 'test_AsXXX_helpers', 'test_async_callbacks_with_spun_event_loops', 'test_asyncStatementExecution_transaction', @@ -19,14 +19,14 @@ CPP_UNIT_TESTS += [ 'test_transaction_helper', 'test_true_async', 'test_unlock_notify', -] +]) if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT', 'Darwin'): # FIXME bug 523392: test_deadlock_detector doesn't like Windows # FIXME bug 523378: also fails on OS X - CPP_UNIT_TESTS += [ + CppUnitTests([ 'test_deadlock_detector', - ] + ]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/testing/gtest/moz.build b/testing/gtest/moz.build index ac4de39e011..fb19ada2451 100644 --- a/testing/gtest/moz.build +++ b/testing/gtest/moz.build @@ -62,7 +62,7 @@ if CONFIG['ENABLE_TESTS']: 'mozilla/GTestRunner.cpp', ] - LIBRARY_NAME = 'gtest' + Library('gtest') SOURCES += [ 'mozilla/SanityTest.cpp', diff --git a/testing/mochitest/ssltunnel/moz.build b/testing/mochitest/ssltunnel/moz.build index 863d26128f2..dae73aff7c9 100644 --- a/testing/mochitest/ssltunnel/moz.build +++ b/testing/mochitest/ssltunnel/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'ssltunnel' +Program('ssltunnel') SOURCES += [ 'ssltunnel.cpp', diff --git a/testing/tools/screenshot/moz.build b/testing/tools/screenshot/moz.build index 67970cda79d..50732236ee4 100644 --- a/testing/tools/screenshot/moz.build +++ b/testing/tools/screenshot/moz.build @@ -5,7 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['MOZ_WIDGET_GTK'] and CONFIG['MOZ_X11']: - PROGRAM = 'screentopng' + Program('screentopng') SOURCES += [ 'gdk-screenshot.cpp', ] @@ -13,7 +13,7 @@ if CONFIG['MOZ_WIDGET_GTK'] and CONFIG['MOZ_X11']: OS_LIBS += CONFIG['TK_LIBS'] OS_LIBS += CONFIG['XSS_LIBS'] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': - PROGRAM = 'screenshot' + Program('screenshot') SOURCES += [ 'win32-screenshot.cpp', ] diff --git a/toolkit/components/ctypes/tests/moz.build b/toolkit/components/ctypes/tests/moz.build index 2db986b2572..749ccd4622c 100644 --- a/toolkit/components/ctypes/tests/moz.build +++ b/toolkit/components/ctypes/tests/moz.build @@ -14,7 +14,7 @@ UNIFIED_SOURCES += [ 'jsctypes-test.cpp', ] -LIBRARY_NAME = 'jsctypes-test' +Library('jsctypes-test') FORCE_SHARED_LIB = True diff --git a/toolkit/components/maintenanceservice/moz.build b/toolkit/components/maintenanceservice/moz.build index 05045542b05..c2e5921b1f2 100644 --- a/toolkit/components/maintenanceservice/moz.build +++ b/toolkit/components/maintenanceservice/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'maintenanceservice' +Program('maintenanceservice') SOURCES += [ 'certificatecheck.cpp', diff --git a/toolkit/components/places/tests/cpp/moz.build b/toolkit/components/places/tests/cpp/moz.build index 9aa5a2a93cb..c5488e751fe 100644 --- a/toolkit/components/places/tests/cpp/moz.build +++ b/toolkit/components/places/tests/cpp/moz.build @@ -4,9 +4,9 @@ # 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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'test_IHistory', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/toolkit/crashreporter/breakpad-windows-libxul/moz.build b/toolkit/crashreporter/breakpad-windows-libxul/moz.build index 8e8f4ae0529..d638b4ef0f1 100644 --- a/toolkit/crashreporter/breakpad-windows-libxul/moz.build +++ b/toolkit/crashreporter/breakpad-windows-libxul/moz.build @@ -12,7 +12,7 @@ SOURCES += [ '../google-breakpad/src/common/windows/http_upload.cc', ] -LIBRARY_NAME = 'google_breakpad_libxul_s' +Library('google_breakpad_libxul_s') FINAL_LIBRARY = 'xul' diff --git a/toolkit/crashreporter/breakpad-windows-libxul/staticruntime/moz.build b/toolkit/crashreporter/breakpad-windows-libxul/staticruntime/moz.build index 4ab4f8ac6f0..f7b45f2ecb2 100644 --- a/toolkit/crashreporter/breakpad-windows-libxul/staticruntime/moz.build +++ b/toolkit/crashreporter/breakpad-windows-libxul/staticruntime/moz.build @@ -8,7 +8,7 @@ SOURCES += [ '../../google-breakpad/src/common/windows/http_upload.cc', ] -LIBRARY_NAME = 'google_breakpad_libxul_staticruntime_s' +Library('google_breakpad_libxul_staticruntime_s') for var in ('UNICODE', 'UNICODE_', 'BREAKPAD_NO_TERMINATE_THREAD', 'NOMINMAX'): DEFINES[var] = True diff --git a/toolkit/crashreporter/client/moz.build b/toolkit/crashreporter/client/moz.build index 3762ebf93cb..865d3d73f88 100644 --- a/toolkit/crashreporter/client/moz.build +++ b/toolkit/crashreporter/client/moz.build @@ -5,7 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['OS_TARGET'] != 'Android': - PROGRAM = 'crashreporter' + Program('crashreporter') UNIFIED_SOURCES += [ 'crashreporter.cpp', diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build b/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build index 496c2e0183c..58f958beb28 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build @@ -5,7 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['MOZ_CRASHREPORTER']: - HOST_LIBRARY_NAME = 'host_breakpad_dwarf_s' + HostLibrary('host_breakpad_dwarf_s') HOST_SOURCES += [ 'bytereader.cc', 'dwarf2diehandler.cc', diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build b/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build index 396a22f3ae4..13446dd3387 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build @@ -23,7 +23,7 @@ if CONFIG['OS_TARGET'] != 'Android': ] if CONFIG['MOZ_CRASHREPORTER']: - HOST_LIBRARY_NAME = 'host_breakpad_linux_common_s' + HostLibrary('host_breakpad_linux_common_s') HOST_SOURCES += [ 'dump_symbols.cc', 'elf_symbols_to_module.cc', @@ -34,7 +34,7 @@ if CONFIG['MOZ_CRASHREPORTER']: 'memory_mapped_file.cc', ] -LIBRARY_NAME = 'breakpad_linux_common_s' +Library('breakpad_linux_common_s') FINAL_LIBRARY = 'xul' diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build b/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build index e896b44694d..7d2860b82d5 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build @@ -23,14 +23,14 @@ if CONFIG['MOZ_CRASHREPORTER']: HOST_SOURCES += [ 'dump_syms.mm', ] - HOST_LIBRARY_NAME = 'host_breakpad_mac_common_s' + HostLibrary('host_breakpad_mac_common_s') SOURCES += [ 'HTTPMultipartUpload.m', 'MachIPC.mm', ] -LIBRARY_NAME = 'breakpad_mac_common_s' +Library('breakpad_mac_common_s') FINAL_LIBRARY = 'xul' diff --git a/toolkit/crashreporter/google-breakpad/src/common/moz.build b/toolkit/crashreporter/google-breakpad/src/common/moz.build index a0ce6d1cbfc..be0a02cc572 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/common/moz.build @@ -47,7 +47,7 @@ else: if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_CRASHREPORTER']: HOST_SOURCES += [ 'convert_UTF.c' ] - HOST_LIBRARY_NAME = 'host_breakpad_common_s' + HostLibrary('host_breakpad_common_s') HOST_SOURCES += [ 'arm_ex_reader.cc', 'arm_ex_to_module.cc', @@ -76,7 +76,7 @@ if CONFIG['OS_TARGET'] == 'Android': 'android/breakpad_getcontext.S', ] -LIBRARY_NAME = 'breakpad_common_s' +Library('breakpad_common_s') MSVC_ENABLE_PGO = True diff --git a/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build b/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build index cb3e39956d8..d3286166eda 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build @@ -10,9 +10,9 @@ UNIFIED_SOURCES += [ 'guid_creator.cc', ] -HOST_LIBRARY_NAME = 'host_breakpad_solaris_common_s' +HostLibrary('host_breakpad_solaris_common_s') -LIBRARY_NAME = 'breakpad_solaris_common_s' +Library('breakpad_solaris_common_s') # not compiling http_upload.cc currently # since it depends on libcurl diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build b/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build index 2689c37a940..4a1d11fbd34 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build @@ -8,7 +8,7 @@ HOST_SOURCES += [ 'dump_syms.cc', ] -HOST_PROGRAM = 'dump_syms' +HostProgram('dump_syms') # host_breakpad_linux_common_s needs to come first HOST_USE_LIBS += [ diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build index 0d766f9c0e8..385f8980da2 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build @@ -8,7 +8,7 @@ HOST_SOURCES += [ 'dump_syms_tool.mm', ] -HOST_PROGRAM = 'dump_syms' +HostProgram('dump_syms') HOST_USE_LIBS += [ 'host_breakpad_common_s', diff --git a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build index 5ce6cd5b1e4..203c8d762cd 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build @@ -8,7 +8,7 @@ HOST_SOURCES += [ 'dump_syms.cc', ] -HOST_PROGRAM = 'dump_syms' +HostProgram('dump_syms') HOST_USE_LIBS += [ 'host_breakpad_common_s', diff --git a/toolkit/crashreporter/injector/moz.build b/toolkit/crashreporter/injector/moz.build index 1f706d20ec1..83d02b14c30 100644 --- a/toolkit/crashreporter/injector/moz.build +++ b/toolkit/crashreporter/injector/moz.build @@ -8,7 +8,7 @@ SOURCES += [ 'injector.cpp', ] -LIBRARY_NAME = 'breakpadinjector' +Library('breakpadinjector') include('/ipc/chromium/chromium-config.mozbuild') diff --git a/toolkit/crashreporter/test/moz.build b/toolkit/crashreporter/test/moz.build index 0fc93e03ceb..9d93cbf94d4 100644 --- a/toolkit/crashreporter/test/moz.build +++ b/toolkit/crashreporter/test/moz.build @@ -17,7 +17,7 @@ UNIFIED_SOURCES += [ 'nsTestCrasher.cpp', ] -LIBRARY_NAME = 'testcrasher' +Library('testcrasher') EXTRA_JS_MODULES += [ 'CrashTestUtils.jsm', diff --git a/toolkit/library/StaticXULComponentsEnd/moz.build b/toolkit/library/StaticXULComponentsEnd/moz.build index 752d50000e5..67989edd490 100644 --- a/toolkit/library/StaticXULComponentsEnd/moz.build +++ b/toolkit/library/StaticXULComponentsEnd/moz.build @@ -10,6 +10,6 @@ SOURCES += [ if '-flto' in CONFIG['OS_CXXFLAGS']: SOURCES['StaticXULComponentsEnd.cpp'].flags += ['-fno-lto'] -LIBRARY_NAME = 'StaticXULComponentsEnd' +Library('StaticXULComponentsEnd') DEFINES['MOZILLA_INTERNAL_API'] = True diff --git a/toolkit/library/gtest/moz.build b/toolkit/library/gtest/moz.build index f8538df8ce0..04dc296bcb4 100644 --- a/toolkit/library/gtest/moz.build +++ b/toolkit/library/gtest/moz.build @@ -4,7 +4,7 @@ # 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 = 'xul-gtest' +Library('xul-gtest') FINAL_TARGET = 'dist/bin/gtest' diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build index b1b0472afb6..f3784c5eb1a 100644 --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -4,7 +4,7 @@ # 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 = 'xul' +Library('xul') SDK_LIBRARY = True diff --git a/toolkit/mozapps/plugins/tests/moz.build b/toolkit/mozapps/plugins/tests/moz.build index 5f32668cc03..ab0d7f17dd7 100644 --- a/toolkit/mozapps/plugins/tests/moz.build +++ b/toolkit/mozapps/plugins/tests/moz.build @@ -4,10 +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/. -SIMPLE_PROGRAMS = [ +SimplePrograms([ 'BadPlugin', 'GoodPlugin', -] +]) SOURCES += [ '%s.cpp' % s for s in SIMPLE_PROGRAMS diff --git a/toolkit/mozapps/update/common-standalone/moz.build b/toolkit/mozapps/update/common-standalone/moz.build index 34d543df730..dbc787b437b 100644 --- a/toolkit/mozapps/update/common-standalone/moz.build +++ b/toolkit/mozapps/update/common-standalone/moz.build @@ -2,7 +2,7 @@ # 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 = 'updatecommon-standalone' +Library('updatecommon-standalone') srcdir = '../common' diff --git a/toolkit/mozapps/update/common/moz.build b/toolkit/mozapps/update/common/moz.build index 46ad07746e4..2e9b89d747b 100644 --- a/toolkit/mozapps/update/common/moz.build +++ b/toolkit/mozapps/update/common/moz.build @@ -18,7 +18,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': 'updatehelper.h', ] -LIBRARY_NAME = 'updatecommon' +Library('updatecommon') srcdir = '.' diff --git a/toolkit/mozapps/update/tests/moz.build b/toolkit/mozapps/update/tests/moz.build index f3764fc7fbe..49688d73e71 100644 --- a/toolkit/mozapps/update/tests/moz.build +++ b/toolkit/mozapps/update/tests/moz.build @@ -13,10 +13,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android': if CONFIG['MOZ_MAINTENANCE_SERVICE'] and not CONFIG['HAVE_64BIT_BUILD']: XPCSHELL_TESTS_MANIFESTS += ['unit_service_updater/xpcshell.ini'] - SIMPLE_PROGRAMS = [ + SimplePrograms([ 'TestAUSHelper', 'TestAUSReadStrings', - ] + ]) SOURCES += [ '%s.cpp' % s for s in SIMPLE_PROGRAMS diff --git a/toolkit/mozapps/update/updater/moz.build b/toolkit/mozapps/update/updater/moz.build index fb69758993d..153217539d6 100644 --- a/toolkit/mozapps/update/updater/moz.build +++ b/toolkit/mozapps/update/updater/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'updater' +Program('updater') SOURCES += [ 'archivereader.cpp', diff --git a/toolkit/webapps/tests/moz.build b/toolkit/webapps/tests/moz.build index b39ce28c6f8..943219eb9da 100644 --- a/toolkit/webapps/tests/moz.build +++ b/toolkit/webapps/tests/moz.build @@ -6,4 +6,4 @@ MOCHITEST_CHROME_MANIFESTS += ['chrome.ini'] SOURCES += ['TestWebappRT.cpp' ] -SIMPLE_PROGRAMS += ['TestWebappRT'] +SimplePrograms(['TestWebappRT']) diff --git a/toolkit/xre/test/win/moz.build b/toolkit/xre/test/win/moz.build index d69dbf6d7aa..e99c6d2cf97 100644 --- a/toolkit/xre/test/win/moz.build +++ b/toolkit/xre/test/win/moz.build @@ -4,17 +4,17 @@ # 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/. -SIMPLE_PROGRAMS = [ +SimplePrograms([ 'TestXREMakeCommandLineWin', -] +]) SOURCES += [ '%s.cpp' % s for s in SIMPLE_PROGRAMS ] -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestDllInterceptor', -] +]) SOURCES += [ '%s.cpp' % s for s in CPP_UNIT_TESTS diff --git a/tools/jprof/moz.build b/tools/jprof/moz.build index 5074e7a81c4..4410e2de61c 100644 --- a/tools/jprof/moz.build +++ b/tools/jprof/moz.build @@ -6,7 +6,7 @@ DIRS += ['stub'] -PROGRAM = 'jprof' +Program('jprof') SOURCES += [ 'bfd.cpp', diff --git a/tools/jprof/stub/moz.build b/tools/jprof/stub/moz.build index 169b08076aa..1ed19f49227 100644 --- a/tools/jprof/stub/moz.build +++ b/tools/jprof/stub/moz.build @@ -12,7 +12,7 @@ SOURCES += [ 'libmalloc.cpp', ] -LIBRARY_NAME = 'jprof' +Library('jprof') FORCE_SHARED_LIB = True diff --git a/tools/trace-malloc/moz.build b/tools/trace-malloc/moz.build index 2d662c4a543..9c754913242 100644 --- a/tools/trace-malloc/moz.build +++ b/tools/trace-malloc/moz.build @@ -5,7 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if not CONFIG['MOZ_PROFILE_GENERATE']: - PROGRAM = 'spacetrace' + Program('spacetrace') SOURCES += [ 'formdata.c', 'spacecategory.c', @@ -27,7 +27,7 @@ SOURCES += [ 'tmreader.c', ] -SIMPLE_PROGRAMS += simple_c_sources +SimplePrograms(simple_c_sources) simple_cpp_sources = [ 'bloatblame', @@ -38,7 +38,7 @@ SOURCES += [ '%s.cpp' % s for s in simple_cpp_sources ] -SIMPLE_PROGRAMS += simple_cpp_sources +SimplePrograms(simple_cpp_sources) RESOURCE_FILES += [ 'spacetrace.css' diff --git a/uriloader/exthandler/tests/moz.build b/uriloader/exthandler/tests/moz.build index e0a7c7ad3b8..057d93da396 100644 --- a/uriloader/exthandler/tests/moz.build +++ b/uriloader/exthandler/tests/moz.build @@ -16,9 +16,9 @@ if CONFIG['OS_ARCH'] != 'Darwin': if not CONFIG['MOZ_JSDOWNLOADS']: XPCSHELL_TESTS_MANIFESTS += ['unit_ipc/xpcshell.ini'] -SIMPLE_PROGRAMS = [ +SimplePrograms([ 'WriteArgument', -] +]) SOURCES += [ '%s.cpp' % s for s in SIMPLE_PROGRAMS diff --git a/webapprt/gtk/moz.build b/webapprt/gtk/moz.build index 4aff81f7934..da4cc6fec4c 100644 --- a/webapprt/gtk/moz.build +++ b/webapprt/gtk/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'webapprt-stub' +Program('webapprt-stub') SOURCES += [ 'webapprt.cpp', diff --git a/webapprt/mac/moz.build b/webapprt/mac/moz.build index f91b9db48d2..774971dcca2 100644 --- a/webapprt/mac/moz.build +++ b/webapprt/mac/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'webapprt-stub' +Program('webapprt-stub') SOURCES += [ 'webapprt.mm', diff --git a/webapprt/win/moz.build b/webapprt/win/moz.build index beda2248b7a..7695e2ef291 100644 --- a/webapprt/win/moz.build +++ b/webapprt/win/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'webapprt-stub' +Program('webapprt-stub') SOURCES += [ 'webapprt.cpp', diff --git a/widget/gonk/libdisplay/moz.build b/widget/gonk/libdisplay/moz.build index 94f825a57bc..1fd69b1a106 100644 --- a/widget/gonk/libdisplay/moz.build +++ b/widget/gonk/libdisplay/moz.build @@ -36,7 +36,7 @@ elif CONFIG['ANDROID_VERSION'] == '15': elif CONFIG['ANDROID_VERSION'] and CONFIG['COMPILE_ENVIRONMENT']: error('Unsupported platform version: %s' % (CONFIG['ANDROID_VERSION'])) -LIBRARY_NAME = 'display' +Library('display') include('/ipc/chromium/chromium-config.mozbuild') diff --git a/widget/gtk/mozgtk/gtk2/moz.build b/widget/gtk/mozgtk/gtk2/moz.build index b21d9062f5f..b9f7d2f6237 100644 --- a/widget/gtk/mozgtk/gtk2/moz.build +++ b/widget/gtk/mozgtk/gtk2/moz.build @@ -10,7 +10,7 @@ SOURCES += [ DEFINES['GTK3_SYMBOLS'] = True -LIBRARY_NAME = 'mozgtk2' +Library('mozgtk2') SONAME = 'mozgtk' diff --git a/widget/gtk/mozgtk/gtk3/moz.build b/widget/gtk/mozgtk/gtk3/moz.build index 3355e3a3bdc..c8b5c3b7c91 100644 --- a/widget/gtk/mozgtk/gtk3/moz.build +++ b/widget/gtk/mozgtk/gtk3/moz.build @@ -10,7 +10,7 @@ SOURCES += [ DEFINES['GTK2_SYMBOLS'] = True -LIBRARY_NAME = 'mozgtk' +Library('mozgtk') SONAME = 'mozgtk' diff --git a/widget/gtk/mozgtk/stub/moz.build b/widget/gtk/mozgtk/stub/moz.build index 02675c98ff1..c1611acbbf9 100644 --- a/widget/gtk/mozgtk/stub/moz.build +++ b/widget/gtk/mozgtk/stub/moz.build @@ -11,7 +11,7 @@ SOURCES += [ for var in ('COMMON_SYMBOLS', 'GTK2_SYMBOLS', 'GTK3_SYMBOLS'): DEFINES[var] = True -LIBRARY_NAME = 'mozgtk_stub' +Library('mozgtk_stub') SONAME = 'mozgtk' diff --git a/widget/tests/moz.build b/widget/tests/moz.build index 576a2817ba5..31e6c40c177 100644 --- a/widget/tests/moz.build +++ b/widget/tests/moz.build @@ -8,9 +8,9 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] MOCHITEST_MANIFESTS += ['mochitest.ini'] MOCHITEST_CHROME_MANIFESTS += ['chrome.ini'] -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestAppShellSteadyState', -] +]) FAIL_ON_WARNINGS = True diff --git a/widget/xremoteclient/moz.build b/widget/xremoteclient/moz.build index 0888a6bc294..a5813d7cc85 100644 --- a/widget/xremoteclient/moz.build +++ b/widget/xremoteclient/moz.build @@ -4,7 +4,7 @@ # 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/. -PROGRAM = 'mozilla-xremote-client' +Program('mozilla-xremote-client') FINAL_LIBRARY = 'xul' diff --git a/xpcom/glue/moz.build b/xpcom/glue/moz.build index 4d68d8242dc..9a43c7436d1 100644 --- a/xpcom/glue/moz.build +++ b/xpcom/glue/moz.build @@ -95,7 +95,7 @@ UNIFIED_SOURCES += [ 'nsStringAPI.cpp', ] -LIBRARY_NAME = 'xpcomglue_s' +Library('xpcomglue_s') SDK_LIBRARY = True diff --git a/xpcom/glue/nomozalloc/moz.build b/xpcom/glue/nomozalloc/moz.build index 7a8c7abff54..179ccfa0ed9 100644 --- a/xpcom/glue/nomozalloc/moz.build +++ b/xpcom/glue/nomozalloc/moz.build @@ -14,7 +14,7 @@ UNIFIED_SOURCES += [ '../nsStringAPI.cpp', ] -LIBRARY_NAME = 'xpcomglue_s_nomozalloc' +Library('xpcomglue_s_nomozalloc') SDK_LIBRARY = True diff --git a/xpcom/glue/standalone/moz.build b/xpcom/glue/standalone/moz.build index fe526307f7a..84c9da2fa8d 100644 --- a/xpcom/glue/standalone/moz.build +++ b/xpcom/glue/standalone/moz.build @@ -18,7 +18,7 @@ SOURCES += [ 'nsXPCOMGlue.cpp', ] -LIBRARY_NAME = 'xpcomglue' +Library('xpcomglue') EXPORTS += [ 'nsXPCOMGlue.h', diff --git a/xpcom/glue/standalone/staticruntime/moz.build b/xpcom/glue/standalone/staticruntime/moz.build index 3aac7b504b2..caf31001553 100644 --- a/xpcom/glue/standalone/staticruntime/moz.build +++ b/xpcom/glue/standalone/staticruntime/moz.build @@ -13,7 +13,7 @@ SOURCES += [ '../nsXPCOMGlue.cpp', ] -LIBRARY_NAME = 'xpcomglue_staticruntime' +Library('xpcomglue_staticruntime') SDK_LIBRARY = True diff --git a/xpcom/glue/staticruntime/moz.build b/xpcom/glue/staticruntime/moz.build index f2bb031a4ec..33cba07ec67 100644 --- a/xpcom/glue/staticruntime/moz.build +++ b/xpcom/glue/staticruntime/moz.build @@ -14,7 +14,7 @@ UNIFIED_SOURCES += [ '../nsStringAPI.cpp', ] -LIBRARY_NAME = 'xpcomglue_staticruntime_s' +Library('xpcomglue_staticruntime_s') SDK_LIBRARY = True diff --git a/xpcom/reflect/xptcall/md/test/moz.build b/xpcom/reflect/xptcall/md/test/moz.build index 363100af847..65da3214d49 100644 --- a/xpcom/reflect/xptcall/md/test/moz.build +++ b/xpcom/reflect/xptcall/md/test/moz.build @@ -8,6 +8,6 @@ SOURCES += [ 'stub_test.cpp', ] -SIMPLE_PROGRAMS += [ +SimplePrograms([ 'stub_test', -] +]) diff --git a/xpcom/reflect/xptcall/tests/moz.build b/xpcom/reflect/xptcall/tests/moz.build index 13962035047..5297e3e6dd2 100644 --- a/xpcom/reflect/xptcall/tests/moz.build +++ b/xpcom/reflect/xptcall/tests/moz.build @@ -4,9 +4,9 @@ # 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/. -SIMPLE_PROGRAMS = [ +SimplePrograms([ 'TestXPTCInvoke', -] +]) SOURCES += [ '%s.cpp' % s for s in SIMPLE_PROGRAMS diff --git a/xpcom/reflect/xptinfo/tests/moz.build b/xpcom/reflect/xptinfo/tests/moz.build index 56d651d04b5..d3d3428bdcb 100644 --- a/xpcom/reflect/xptinfo/tests/moz.build +++ b/xpcom/reflect/xptinfo/tests/moz.build @@ -8,9 +8,9 @@ SOURCES += [ 'TestInterfaceInfo.cpp', ] -SIMPLE_PROGRAMS += [ +SimplePrograms([ 'TestInterfaceInfo' -] +]) USE_LIBS += [ 'mozalloc', diff --git a/xpcom/sample/program/moz.build b/xpcom/sample/program/moz.build index 065967ecdd9..0ada27f5d2e 100644 --- a/xpcom/sample/program/moz.build +++ b/xpcom/sample/program/moz.build @@ -11,9 +11,9 @@ SOURCES += [ ] # SIMPLE_PROGRAMS compiles a single .cpp file into an executable -SIMPLE_PROGRAMS += [ +SimplePrograms([ 'nsTestSample' -] +]) # Whatever code is going to be linked with the *standalone* glue must be # built with the XPCOM_GLUE define set. diff --git a/xpcom/tests/external/moz.build b/xpcom/tests/external/moz.build index b6cd6b94559..5de235bb470 100644 --- a/xpcom/tests/external/moz.build +++ b/xpcom/tests/external/moz.build @@ -4,9 +4,9 @@ # 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/. -SIMPLE_PROGRAMS = [ +SimplePrograms([ 'TestMinStringAPI', -] +]) SOURCES += [ '%s.cpp' % s for s in SIMPLE_PROGRAMS diff --git a/xpcom/tests/moz.build b/xpcom/tests/moz.build index 011891f38ff..d677d8fd99c 100644 --- a/xpcom/tests/moz.build +++ b/xpcom/tests/moz.build @@ -23,7 +23,7 @@ EXPORTS.testing += [ 'TestHarness.h', ] -SIMPLE_PROGRAMS = [ +SimplePrograms([ 'nsIFileEnumerator', 'TestArguments', 'TestBlockingProcess', @@ -36,17 +36,17 @@ SIMPLE_PROGRAMS = [ 'TestThreadPoolListener', 'TestTimers', 'TestUnicodeArguments', -] +]) if CONFIG['OS_TARGET'] == 'WINNT': - SIMPLE_PROGRAMS += [ + SimplePrograms([ 'TestBase64', - ] + ]) if CONFIG['WRAP_STL_INCLUDES'] and not CONFIG['CLANG_CL']: - SIMPLE_PROGRAMS += [ + SimplePrograms([ 'TestSTLWrappers', - ] + ]) SOURCES += [ '%s.cpp' % s for s in sorted(SIMPLE_PROGRAMS) @@ -54,7 +54,7 @@ SOURCES += [ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] -CPP_UNIT_TESTS += [ +CppUnitTests([ 'ShowAlignments', 'TestAutoPtr', 'TestAutoRef', @@ -74,12 +74,12 @@ CPP_UNIT_TESTS += [ 'TestTArray', 'TestTextFormatter', 'TestThreadUtils' -] +]) if CONFIG['MOZ_MEMORY']: - CPP_UNIT_TESTS += [ + CppUnitTests([ 'TestJemalloc', - ] + ]) # XXX Make these tests work in libxul builds. #CPP_UNIT_TESTS += [ @@ -109,10 +109,10 @@ if CONFIG['MOZ_MEMORY']: if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT'): # FIXME bug 523392: TestDeadlockDetector doesn't like Windows # FIXME bug 523378: also fails on OS X - CPP_UNIT_TESTS += [ + CppUnitTests([ 'TestDeadlockDetector', 'TestDeadlockDetectorScalability', - ] + ]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/xpcom/tests/windows/moz.build b/xpcom/tests/windows/moz.build index d8ff402c102..5214490f2d1 100644 --- a/xpcom/tests/windows/moz.build +++ b/xpcom/tests/windows/moz.build @@ -4,10 +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/. -CPP_UNIT_TESTS += [ +CppUnitTests([ 'TestCOM', 'TestNtPathToDosPath', -] +]) SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/xpcom/typelib/xpt/moz.build b/xpcom/typelib/xpt/moz.build index 16a4495ff54..34624102607 100644 --- a/xpcom/typelib/xpt/moz.build +++ b/xpcom/typelib/xpt/moz.build @@ -4,7 +4,7 @@ # 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 = 'xpt' +Library('xpt') DIRS += ['tools'] diff --git a/xpcom/typelib/xpt/tests/moz.build b/xpcom/typelib/xpt/tests/moz.build index 4acd0a3d858..e00c19f7b72 100644 --- a/xpcom/typelib/xpt/tests/moz.build +++ b/xpcom/typelib/xpt/tests/moz.build @@ -4,10 +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/. -SIMPLE_PROGRAMS = [ +SimplePrograms([ 'PrimitiveTest', 'SimpleTypeLib', -] +]) SOURCES += [ '%s.cpp' % s for s in SIMPLE_PROGRAMS diff --git a/xpcom/windbgdlg/moz.build b/xpcom/windbgdlg/moz.build index e62523f8095..744ecca5d9a 100644 --- a/xpcom/windbgdlg/moz.build +++ b/xpcom/windbgdlg/moz.build @@ -8,6 +8,6 @@ SOURCES += [ 'windbgdlg.cpp', ] -SIMPLE_PROGRAMS += [ +SimplePrograms([ 'windbgdlg' -] +]) diff --git a/xulrunner/app/moz.build b/xulrunner/app/moz.build index d3a8ea64367..798be4d8216 100644 --- a/xulrunner/app/moz.build +++ b/xulrunner/app/moz.build @@ -6,7 +6,7 @@ DIRS += ['profile'] -PROGRAM = 'xulrunner' +Program('xulrunner') SOURCES += [ 'nsXULRunnerApp.cpp', diff --git a/xulrunner/stub/moz.build b/xulrunner/stub/moz.build index 907c7d10ece..1110c6d0b5f 100644 --- a/xulrunner/stub/moz.build +++ b/xulrunner/stub/moz.build @@ -8,7 +8,7 @@ # apps to override it using the --with-xulrunner-stub-name= argument. # If this configure argument is not present then the default name is # 'xulrunner-stub'. -PROGRAM = CONFIG['XULRUNNER_STUB_NAME'] +Program(CONFIG['XULRUNNER_STUB_NAME']) SOURCES += [ 'nsXULStub.cpp', diff --git a/xulrunner/tools/redit/moz.build b/xulrunner/tools/redit/moz.build index 00fe698fa69..2d83032f1a9 100644 --- a/xulrunner/tools/redit/moz.build +++ b/xulrunner/tools/redit/moz.build @@ -5,7 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['OS_ARCH'] == 'WINNT': - PROGRAM = 'redit' + Program('redit') SOURCES += [ 'redit.cpp', ]