From d667f4bb59191f487c118ff3d8a57112bc7ba0ca Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 30 Oct 2014 13:06:12 +0900 Subject: [PATCH] Bug 1077148 part 4 - Add and use new moz.build templates for Gecko programs and libraries. r=gps There are, sadly, many combinations of linkage in use throughout the tree. The main differentiator, though, is between program/libraries related to Gecko or not. Kind of. Some need mozglue, some don't. Some need dependent linkage, some standalone. Anyways, these new templates remove the need to manually define the right dependencies against xpcomglue, nspr, mozalloc and mozglue in most cases. Places that build programs and were resetting MOZ_GLUE_PROGRAM_LDFLAGS or that build libraries and were resetting MOZ_GLUE_LDFLAGS can now just not use those Gecko-specific templates. --- accessible/interfaces/ia2/moz.build | 2 +- accessible/interfaces/msaa/moz.build | 2 +- b2g/app/moz.build | 10 +- b2g/gaia/Makefile.in | 3 - browser/app/moz.build | 22 +-- .../shell/commandexecutehandler/Makefile.in | 5 - browser/metro/shell/testing/Makefile.in | 7 - build/clang-plugin/Makefile.in | 2 - build/docs/defining-binaries.rst | 30 +++- build/gecko_templates.mozbuild | 155 ++++++++++++++++++ build/templates.mozbuild | 26 +-- build/unix/elfhack/Makefile.in | 2 - build/win32/Makefile.in | 2 - build/win32/crashinjectdll/Makefile.in | 5 - build/win32/vmwarerecordinghelper/Makefile.in | 5 - config/config.mk | 12 +- config/external/nss/Makefile.in | 18 +- config/external/nss/moz.build | 8 +- config/rules.mk | 2 - configure.in | 51 ++---- dom/audiochannel/tests/moz.build | 9 +- dom/base/test/moz.build | 9 +- dom/canvas/compiledtest/moz.build | 9 +- dom/media/compiledtest/moz.build | 9 +- dom/media/webaudio/compiledtest/moz.build | 9 +- dom/plugins/ipc/hangui/Makefile.in | 7 - editor/txmgr/tests/moz.build | 9 +- embedding/tests/winEmbed/moz.build | 5 +- gfx/angle/src/libEGL/moz.build | 2 +- gfx/angle/src/libGLESv2/moz.build | 2 +- intl/lwbrk/tests/moz.build | 9 +- intl/unicharutil/tests/moz.build | 18 +- ipc/app/Makefile.in | 4 - ipc/app/moz.build | 13 +- ipc/ipdl/test/cxx/app/moz.build | 9 +- js/src/configure.in | 5 +- js/src/gdb/moz.build | 2 +- js/src/jsapi-tests/moz.build | 2 +- js/src/moz.build | 2 +- js/src/shell/moz.build | 2 +- js/xpconnect/shell/moz.build | 9 +- js/xpconnect/tests/moz.build | 7 - layout/media/moz.build | 2 +- media/gmp-clearkey/0.1/Makefile.in | 4 - media/libcubeb/tests/moz.build | 11 +- media/mtransport/test/moz.build | 10 +- media/webrtc/signaling/test/moz.build | 6 +- memory/build/Makefile.in | 2 +- memory/build/moz.build | 2 +- memory/build/replace_malloc.h | 5 +- memory/jemalloc/Makefile.in | 2 +- memory/jemalloc/moz.build | 2 +- memory/mozalloc/moz.build | 2 +- memory/mozalloc/tests/moz.build | 9 +- memory/replace/dmd/Makefile.in | 8 - memory/replace/dummy/Makefile.in | 6 - memory/replace/jemalloc/Makefile.in | 6 - memory/replace/logalloc/Makefile.in | 4 - memory/replace/logalloc/replay/Makefile.in | 5 - mfbt/tests/Makefile.in | 12 -- modules/libmar/tool/Makefile.in | 4 - mozglue/build/Makefile.in | 6 - mozglue/build/moz.build | 2 + mozglue/linker/tests/Makefile.in | 6 - mozglue/tests/moz.build | 4 +- netwerk/streamconv/test/moz.build | 9 +- netwerk/test/moz.build | 9 +- .../mozbuild/backend/recursivemake.py | 16 -- rdf/tests/rdfcat/moz.build | 9 +- rdf/tests/rdfpoll/moz.build | 9 +- rdf/tests/triplescat/moz.build | 9 +- security/manager/ssl/tests/compiled/moz.build | 9 +- .../ssl/tests/unit/tlsserver/cmd/moz.build | 4 +- security/sandbox/Makefile.in | 9 - .../sandbox/win/src/sandboxbroker/Makefile.in | 5 - startupcache/test/moz.build | 9 +- storage/test/moz.build | 8 +- testing/mochitest/ssltunnel/moz.build | 2 +- testing/tools/screenshot/Makefile.in | 5 - toolkit/components/ctypes/tests/Makefile.in | 2 - .../components/maintenanceservice/Makefile.in | 5 - toolkit/components/places/tests/cpp/moz.build | 9 +- .../breakpad-windows-standalone/Makefile.in | 5 - toolkit/crashreporter/client/Makefile.in | 4 - toolkit/crashreporter/injector/Makefile.in | 7 - toolkit/crashreporter/test/moz.build | 9 +- toolkit/library/moz.build | 4 +- toolkit/mozapps/update/tests/Makefile.in | 2 - toolkit/mozapps/update/updater/Makefile.in | 9 - toolkit/webapps/tests/Makefile.in | 7 - tools/trace-malloc/moz.build | 9 +- uriloader/exthandler/tests/moz.build | 4 +- webapprt/gtk/moz.build | 10 +- webapprt/mac/Makefile.in | 5 - webapprt/mac/moz.build | 3 + webapprt/win/Makefile.in | 4 - webapprt/win/moz.build | 3 + widget/tests/moz.build | 9 +- xpcom/reflect/xptcall/tests/moz.build | 9 +- xpcom/reflect/xptinfo/tests/moz.build | 9 +- xpcom/sample/program/moz.build | 19 +-- xpcom/tests/external/moz.build | 9 +- xpcom/tests/moz.build | 17 +- xpcom/tests/windows/moz.build | 9 +- xpcom/typelib/xpt/tests/Makefile.in | 7 - xulrunner/app/moz.build | 7 +- xulrunner/stub/Makefile.in | 3 - xulrunner/stub/moz.build | 16 +- xulrunner/tools/redit/moz.build | 8 +- 109 files changed, 318 insertions(+), 658 deletions(-) delete mode 100644 browser/metro/shell/testing/Makefile.in create mode 100644 build/gecko_templates.mozbuild delete mode 100644 build/win32/crashinjectdll/Makefile.in delete mode 100644 build/win32/vmwarerecordinghelper/Makefile.in delete mode 100644 dom/plugins/ipc/hangui/Makefile.in delete mode 100644 memory/replace/dmd/Makefile.in delete mode 100644 memory/replace/dummy/Makefile.in delete mode 100644 memory/replace/jemalloc/Makefile.in delete mode 100644 mfbt/tests/Makefile.in delete mode 100644 security/sandbox/Makefile.in delete mode 100644 security/sandbox/win/src/sandboxbroker/Makefile.in delete mode 100644 testing/tools/screenshot/Makefile.in delete mode 100644 toolkit/crashreporter/breakpad-windows-standalone/Makefile.in delete mode 100644 toolkit/crashreporter/injector/Makefile.in delete mode 100644 xpcom/typelib/xpt/tests/Makefile.in diff --git a/accessible/interfaces/ia2/moz.build b/accessible/interfaces/ia2/moz.build index 08ce9733f2d..471c74656f1 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/. -SharedLibrary('IA2Marshal') +GeckoSharedLibrary('IA2Marshal', linkage=None) DEFINES['REGISTER_PROXY_DLL'] = True diff --git a/accessible/interfaces/msaa/moz.build b/accessible/interfaces/msaa/moz.build index ff37abd0a07..e555fabd3cc 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/. -SharedLibrary('AccessibleMarshal') +GeckoSharedLibrary('AccessibleMarshal', linkage=None) GENERATED_SOURCES += [ 'dlldata.c', diff --git a/b2g/app/moz.build b/b2g/app/moz.build index 948e70a00e8..d2c2e6b1709 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") + GeckoProgram(CONFIG['MOZ_APP_NAME'] + "-bin") else: - Program(CONFIG['MOZ_APP_NAME']) + GeckoProgram(CONFIG['MOZ_APP_NAME']) if CONFIG['MOZ_B2G_LOADER']: SOURCES += [ 'B2GLoader.cpp', @@ -26,8 +26,6 @@ if not CONFIG['LIBXUL_SDK']: 'zlib', ] -DEFINES['XPCOM_GLUE'] = True - for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION', 'MOZ_UPDATER'): DEFINES[var] = CONFIG[var] @@ -70,10 +68,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': 'utils', ] -USE_LIBS += [ - 'xpcomglue', -] - DISABLE_STL_WRAPPING = True if CONFIG['OS_ARCH'] == 'WINNT': diff --git a/b2g/gaia/Makefile.in b/b2g/gaia/Makefile.in index 68ec5709d4f..2a1b4bc5521 100644 --- a/b2g/gaia/Makefile.in +++ b/b2g/gaia/Makefile.in @@ -4,9 +4,6 @@ GAIA_PATH := gaia/profile -# This is needed to avoid making run-b2g depend on mozglue -WRAP_LDFLAGS := - GENERATED_DIRS += $(DIST)/bin/$(GAIA_PATH) include $(topsrcdir)/config/rules.mk diff --git a/browser/app/moz.build b/browser/app/moz.build index fc2eec51339..8975859d88b 100644 --- a/browser/app/moz.build +++ b/browser/app/moz.build @@ -6,7 +6,10 @@ DIRS += ['profile/extensions'] -Program(CONFIG['MOZ_APP_NAME']) +if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_METRO']: + GeckoProgram(CONFIG['MOZ_APP_NAME']) +else: + GeckoProgram(CONFIG['MOZ_APP_NAME'], msvcrt='static') SOURCES += [ 'nsBrowserApp.cpp', @@ -18,8 +21,6 @@ for var in ('MOZILLA_OFFICIAL', 'LIBXUL_SDK'): if CONFIG[var]: DEFINES[var] = True -DEFINES['XPCOM_GLUE'] = True - GENERATED_INCLUDES += [ '/build', ] @@ -34,7 +35,10 @@ if not CONFIG['MOZ_METRO']: DELAYLOAD_DLLS += [ 'mozglue.dll', ] - USE_STATIC_LIBS = True + +USE_LIBS += [ + 'mozglue', +] if CONFIG['_MSC_VER']: # Always enter a Windows program through wmain, whether or not we're @@ -56,16 +60,6 @@ if CONFIG['OS_ARCH'] == 'WINNT': if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']: LDFLAGS += ['/HEAP:0x40000'] -if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['MOZ_METRO']: - USE_LIBS += [ - 'mozglue', - 'xpcomglue_staticruntime', - ] -else: - USE_LIBS += [ - 'xpcomglue', - ] - DISABLE_STL_WRAPPING = True if CONFIG['MOZ_LINKER']: diff --git a/browser/metro/shell/commandexecutehandler/Makefile.in b/browser/metro/shell/commandexecutehandler/Makefile.in index ad14ce3f5ed..76e1da1c3d8 100644 --- a/browser/metro/shell/commandexecutehandler/Makefile.in +++ b/browser/metro/shell/commandexecutehandler/Makefile.in @@ -6,11 +6,6 @@ ifndef MOZ_WINCONSOLE MOZ_WINCONSOLE = 0 endif -include $(topsrcdir)/config/config.mk include $(topsrcdir)/config/rules.mk DIST_PROGRAM = CommandExecuteHandler$(BIN_SUFFIX) - -# Don't link against mozglue.dll -MOZ_GLUE_LDFLAGS = -MOZ_GLUE_PROGRAM_LDFLAGS = diff --git a/browser/metro/shell/testing/Makefile.in b/browser/metro/shell/testing/Makefile.in deleted file mode 100644 index e4ec47bacdf..00000000000 --- a/browser/metro/shell/testing/Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -# don't use moz glue libs -MOZ_GLUE_LDFLAGS = -MOZ_GLUE_PROGRAM_LDFLAGS = diff --git a/build/clang-plugin/Makefile.in b/build/clang-plugin/Makefile.in index a3c15c4b031..7a0fc246b3b 100644 --- a/build/clang-plugin/Makefile.in +++ b/build/clang-plugin/Makefile.in @@ -5,8 +5,6 @@ # LLVM_CXXFLAGS comes with its own optimization flags. MOZ_OPTIMIZE = -MOZ_GLUE_LDFLAGS = - include $(topsrcdir)/config/config.mk # In the current moz.build world, we need to override essentially every diff --git a/build/docs/defining-binaries.rst b/build/docs/defining-binaries.rst index a4501f8557a..9ef0d727963 100644 --- a/build/docs/defining-binaries.rst +++ b/build/docs/defining-binaries.rst @@ -119,11 +119,6 @@ With a ``Framework`` name of ``foo``, the framework file name will be ``foo``. This template however affects the behavior on all platforms, so it needs to be set only on OSX. -Another special kind of library, XPCOM-specific, are XPCOM components. One can -build such a component with the ``XPCOMBinaryComponent`` template. - - XPCOMBinaryComponent('foo') - Executables =========== @@ -293,3 +288,28 @@ On e.g. Linux, the above ``myprog`` will have DT_NEEDED markers for ``libmylib.so`` and ``libfoo.so`` instead of ``libmylib.so`` and ``libotherlib.so`` if there weren't a ``SONAME``. This means the runtime requirement for ``myprog`` is ``libfoo.so`` instead of ``libotherlib.so``. + + +Gecko-related binaries +====================== + +Some programs or libraries are totally independent of Gecko, and can use the +above mentioned templates. Others are Gecko-related in some way, and may +need XPCOM linkage, mozglue. These things are tedious. A set of additional +templates exists to ease defining such programs and libraries. They are +essentially the same as the above mentioned templates, prefixed with "Gecko": + + - ``GeckoProgram`` + - ``GeckoSimplePrograms`` + - ``GeckoCppUnitTests`` + - ``GeckoSharedLibrary`` + - ``GeckoFramework`` + +There is also ``XPCOMBinaryComponent`` for XPCOM components, which is a +special kind of library. + +All the Gecko-prefixed templates take the same arguments as their +non-Gecko-prefixed counterparts, and can take a few more arguments +for non-standard cases. See the definition of ``GeckoBinary`` in +build/gecko_templates.mozbuild for more details, but most usecases +should not require these additional arguments. diff --git a/build/gecko_templates.mozbuild b/build/gecko_templates.mozbuild new file mode 100644 index 00000000000..ba5bfb665da --- /dev/null +++ b/build/gecko_templates.mozbuild @@ -0,0 +1,155 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +@template +def GeckoBinary(linkage='dependent', msvcrt='dynamic', mozglue=None): + '''Template for Gecko-related binaries. + + This template is meant to be used in other templates. + + `linkage` indicates the wanted xpcom linkage type. Valid values are + 'dependent', 'standalone' or None. 'dependent' is the default. It is + used for e.g. XPCOM components and executables with direct dependencies + on libxul. Most executables should use the 'standalone' linkage, which + uses the standalone XPCOM glue to load libxul. None means no XPCOM glue + or libxul linkage at all. + + `msvcrt` indicates which Microsoft Visual Studio CRT, for Windows build, + ought to be linked: 'static' or 'dynamic'. + + `mozglue` indicates whether to link against the mozglue library, and if + so, what linkage to apply. Valid values are None (mozglue not linked), + 'program' (mozglue linked to an executable program), or 'library' (mozglue + linked to a shared library). + ''' + if msvcrt == 'dynamic' or CONFIG['OS_ARCH'] != 'WINNT': + xpcomglue = 'xpcomglue' + elif msvcrt == 'static': + USE_STATIC_LIBS = True + xpcomglue = 'xpcomglue_staticruntime' + if not CONFIG['GNU_CC']: + mozglue = None + else: + error('msvcrt must be "dynamic" or "static"') + + if linkage == 'dependent': + USE_LIBS += [ + 'mozalloc', + 'nspr', + '%s_s' % xpcomglue, + 'xul', + ] + elif linkage == 'standalone': + DEFINES['XPCOM_GLUE'] = True + + USE_LIBS += [ + xpcomglue, + ] + elif linkage != None: + error('`linkage` must be "dependent", "standalone" or None') + + if mozglue: + if CONFIG['JS_STANDALONE']: + pass + elif CONFIG['MOZ_CRT']: + if msvcrt == 'dynamic': + USE_LIBS += ['mozcrt'] + elif msvcrt == 'static': + USE_LIBS += ['mozglue'] + else: + error('`msvcrt` must be "dynamic" or "static"') + else: + LDFLAGS += CONFIG['MOZ_GLUE_WRAP_LDFLAGS'] + if mozglue == 'program': + USE_LIBS += ['mozglue'] + if CONFIG['MOZ_GLUE_IN_PROGRAM']: + if CONFIG['GNU_CC']: + LDFLAGS += ['-rdynamic'] + if CONFIG['MOZ_MEMORY']: + USE_LIBS += ['memory'] + if CONFIG['MOZ_LINKER']: + OS_LIBS += CONFIG['MOZ_ZLIB_LIBS'] + elif mozglue == 'library': + if not CONFIG['MOZ_GLUE_IN_PROGRAM']: + USE_LIBS += ['mozglue'] + else: + error('`mozglue` must be "program" or "library"') + + +@template +def GeckoProgram(name, linkage='standalone', **kwargs): + '''Template for program executables related to Gecko. + + `name` identifies the executable base name. + + See the documentation for `GeckoBinary` for other possible arguments, + with the notable difference that the default for `linkage` is 'standalone'. + ''' + Program(name) + + GeckoBinary(linkage=linkage, mozglue='program', **kwargs) + + +@template +def GeckoSimplePrograms(names, **kwargs): + '''Template for simple program executables related to Gecko. + + `names` identifies the executable base names for each executable. + + See the documentation for `GeckoBinary` for other possible arguments. + ''' + SimplePrograms(names) + + GeckoBinary(mozglue='program', **kwargs) + + +@template +def GeckoCppUnitTests(names, **kwargs): + '''Template for C++ unit tests related to Gecko. + + `names` identifies the executable base names for each executable. + + See the documentation for `GeckoBinary` for other possible arguments. + ''' + CppUnitTests(names) + + GeckoBinary(mozglue='program', **kwargs) + + +@template +def GeckoSharedLibrary(name, **kwargs): + '''Template for shared libraries related to Gecko. + + `name` identifies the library base name. + See the documentation for `GeckoBinary` for other possible arguments. + ''' + SharedLibrary(name) + + GeckoBinary(mozglue='library', **kwargs) + + +@template +def GeckoFramework(name, **kwargs): + '''Template for OSX frameworks related to Gecko. + + `name` identifies the library base name. + See the documentation for `GeckoBinary` for other possible arguments. + ''' + Framework(name) + + GeckoBinary(mozglue='library', **kwargs) + + +@template +def XPCOMBinaryComponent(name): + '''Template defining an XPCOM binary component for Gecko. + + `name` is the name of the component. + ''' + GeckoSharedLibrary(name) + + IS_COMPONENT = True + diff --git a/build/templates.mozbuild b/build/templates.mozbuild index c3082b5d4c0..1d99f3a27dc 100644 --- a/build/templates.mozbuild +++ b/build/templates.mozbuild @@ -115,28 +115,4 @@ def HostLibrary(name): HOST_LIBRARY_NAME = name -@template -def GeckoBinary(): - '''Template for binaries using Gecko. - - This template is meant to be used in other templates. - ''' - USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', - ] - - -@template -def XPCOMBinaryComponent(name): - '''Template defining an XPCOM binary component for Gecko. - - name is the name of the component. - ''' - SharedLibrary(name) - - GeckoBinary() - - IS_COMPONENT = True +include('gecko_templates.mozbuild') diff --git a/build/unix/elfhack/Makefile.in b/build/unix/elfhack/Makefile.in index 3f2e4b122b8..fdc6ab10720 100644 --- a/build/unix/elfhack/Makefile.in +++ b/build/unix/elfhack/Makefile.in @@ -7,8 +7,6 @@ INTERNAL_TOOLS = 1 OS_CXXFLAGS := $(filter-out -fno-exceptions,$(OS_CXXFLAGS)) -fexceptions -WRAP_LDFLAGS= - include $(topsrcdir)/config/rules.mk test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX): %$(DLL_SUFFIX): %.$(OBJ_SUFFIX) elfhack diff --git a/build/win32/Makefile.in b/build/win32/Makefile.in index 6d1832d47c1..915c693db2d 100644 --- a/build/win32/Makefile.in +++ b/build/win32/Makefile.in @@ -2,8 +2,6 @@ # 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/. -MOZ_GLUE_LDFLAGS = - include $(topsrcdir)/config/rules.mk ifdef WIN32_REDIST_DIR diff --git a/build/win32/crashinjectdll/Makefile.in b/build/win32/crashinjectdll/Makefile.in deleted file mode 100644 index 9a0b3a6d1a1..00000000000 --- a/build/win32/crashinjectdll/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -MOZ_GLUE_LDFLAGS = diff --git a/build/win32/vmwarerecordinghelper/Makefile.in b/build/win32/vmwarerecordinghelper/Makefile.in deleted file mode 100644 index 9a0b3a6d1a1..00000000000 --- a/build/win32/vmwarerecordinghelper/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -MOZ_GLUE_LDFLAGS = diff --git a/config/config.mk b/config/config.mk index 3d63d6bf41f..a1fb0cbcf75 100644 --- a/config/config.mk +++ b/config/config.mk @@ -234,20 +234,10 @@ endif # NS_TRACE_MALLOC || MOZ_DMD endif # MOZ_DEBUG -# We don't build a static CRT when building a custom CRT, -# it appears to be broken. So don't link to jemalloc if -# the Makefile wants static CRT linking. -ifeq ($(MOZ_MEMORY)_$(USE_STATIC_LIBS),1_1) -# Disable default CRT libs and add the right lib path for the linker -MOZ_GLUE_LDFLAGS= -endif - endif # WINNT && !GNU_CC -ifdef MOZ_GLUE_PROGRAM_LDFLAGS +ifdef MOZ_GLUE_IN_PROGRAM DEFINES += -DMOZ_GLUE_IN_PROGRAM -else -MOZ_GLUE_PROGRAM_LDFLAGS=$(MOZ_GLUE_LDFLAGS) endif # diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in index 1ce0ff1d63d..020ce807996 100644 --- a/config/external/nss/Makefile.in +++ b/config/external/nss/Makefile.in @@ -10,12 +10,6 @@ CXX_WRAPPER = default:: -# When MOZ_CRT is set, we get mozcrt from moz.build instead of -# MOZ_GLUE_LDFLAGS -ifdef MOZ_CRT -MOZ_GLUE_LDFLAGS = -endif - include $(topsrcdir)/config/makefiles/functions.mk NSS_LIBS = \ @@ -223,9 +217,17 @@ endif endif ifdef WRAP_LDFLAGS +NSS_EXTRA_LDFLAGS += $(WRAP_LDFLAGS) +endif + +ifdef MOZ_GLUE_WRAP_LDFLAGS +NSS_EXTRA_LDFLAGS += $(SHARED_LIBS:$(DEPTH)%=$(MOZ_BUILD_ROOT)%) $(MOZ_GLUE_WRAP_LDFLAGS) +endif + +ifneq (,$(WRAP_LDFLAGS)$(MOZ_GLUE_WRAP_LDFLAGS)) DEFAULT_GMAKE_FLAGS += \ - LDFLAGS='$(LDFLAGS) $(WRAP_LDFLAGS)' \ - DSO_LDOPTS='$(DSO_LDOPTS) $(LDFLAGS) $(WRAP_LDFLAGS)' \ + LDFLAGS='$(LDFLAGS) $(NSS_EXTRA_LDFLAGS)' \ + DSO_LDOPTS='$(DSO_LDOPTS) $(LDFLAGS) $(NSS_EXTRA_LDFLAGS)' \ $(NULL) endif diff --git a/config/external/nss/moz.build b/config/external/nss/moz.build index 5e1abb99d24..2dfa7694157 100644 --- a/config/external/nss/moz.build +++ b/config/external/nss/moz.build @@ -10,7 +10,7 @@ if CONFIG['MOZ_NATIVE_NSS']: Library('nss') OS_LIBS += CONFIG['NSS_LIBS'] elif CONFIG['MOZ_FOLD_LIBS']: - SharedLibrary('nss') + GeckoSharedLibrary('nss', linkage=None) # TODO: The library name can be changed when bug 845217 is fixed. SHARED_LIBRARY_NAME = 'nss3' @@ -36,12 +36,6 @@ elif CONFIG['MOZ_FOLD_LIBS']: if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['GCC_USE_GNU_LD']: LD_VERSION_SCRIPT = 'nss3.def' - - # mozcrt needs at least one reference in a moz.build for the frontend - # not to raise an error. Here, it allows to avoid setting DLLFLAGS in - # configure.in. - if CONFIG['MOZ_CRT']: - USE_LIBS += ['mozcrt'] else: Library('nss') USE_LIBS += [ diff --git a/config/rules.mk b/config/rules.mk index 1dab3cc16c7..cf3aa89d419 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -641,8 +641,6 @@ endif endif # NO_PROFILE_GUIDED_OPTIMIZE -MOZ_PROGRAM_LDFLAGS += $(MOZ_GLUE_PROGRAM_LDFLAGS) - ############################################## checkout: diff --git a/configure.in b/configure.in index 7110e9bd53b..99a094f70b7 100644 --- a/configure.in +++ b/configure.in @@ -7072,28 +7072,15 @@ if test "$NS_TRACE_MALLOC"; then MOZ_MEMORY= fi -if test "${OS_TARGET}" = "Android"; then - dnl On Android, we use WRAP_LDFLAGS to link everything to mozglue - : -elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin"; then - dnl On Windows and OSX, we want to link all our binaries against mozglue - MOZ_GLUE_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)' -else - dnl On other Unix systems, we only want to link executables against mozglue - MOZ_GLUE_PROGRAM_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)' - dnl On other Unix systems, where mozglue is a static library, jemalloc is - dnl separated for the SDK, so we need to add it here. - if test "$MOZ_MEMORY" = 1 -o \( "$LIBXUL_SDK" -a -f "$LIBXUL_SDK/lib/${LIB_PREFIX}memory.${LIB_SUFFIX}" \); then - MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib)' - fi - if test -n "$GNU_CC"; then - dnl And we need mozglue symbols to be exported. - MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic" - fi - if test "$MOZ_LINKER" = 1; then - MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS $MOZ_ZLIB_LIBS" - fi -fi +case "${OS_TARGET}" in +Android|WINNT|Darwin) + MOZ_GLUE_IN_PROGRAM= + ;; +*) + dnl On !Android !Windows !OSX, we only want to link executables against mozglue + MOZ_GLUE_IN_PROGRAM=1 + ;; +esac dnl ======================================================== dnl = Enable dynamic replacement of malloc implementation @@ -7221,7 +7208,6 @@ else if test -n "$gonkdir"; then AC_DEFINE(MOZ_MEMORY_GONK) fi - MOZ_GLUE_LDFLAGS= ;; *-*linux*) AC_DEFINE(MOZ_MEMORY_LINUX) @@ -7241,7 +7227,6 @@ else lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH if grep -q '__imp__\{0,1\}free' crtdll.obj; then MOZ_CRT=1 - MOZ_GLUE_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcprt -DEFAULTLIB:mozcrt' fi rm crtdll.obj ;; @@ -7255,20 +7240,21 @@ AC_SUBST(MOZ_JEMALLOC3) AC_SUBST(MOZ_NATIVE_JEMALLOC) AC_SUBST(MOZ_CRT) export MOZ_CRT -AC_SUBST(MOZ_GLUE_LDFLAGS) -AC_SUBST(MOZ_GLUE_PROGRAM_LDFLAGS) +AC_SUBST(MOZ_GLUE_IN_PROGRAM) AC_SUBST_LIST(WIN32_CRT_LIBS) dnl We need to wrap dlopen and related functions on Android because we use dnl our own linker. if test "$OS_TARGET" = Android; then - WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozglue" - WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=PR_GetEnv,--wrap=PR_SetEnv" + MOZ_GLUE_WRAP_LDFLAGS="${MOZ_GLUE_WRAP_LDFLAGS} -Wl,--wrap=PR_GetEnv,--wrap=PR_SetEnv" if test "$MOZ_WIDGET_TOOLKIT" = gonk -a -n "$MOZ_NUWA_PROCESS"; then - WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=pthread_create,--wrap=epoll_wait,--wrap=poll,--wrap=pthread_cond_timedwait,--wrap=__pthread_cond_timedwait,--wrap=pthread_cond_wait,--wrap=epoll_create,--wrap=epoll_ctl,--wrap=close,--wrap=pthread_key_create,--wrap=pthread_key_delete,--wrap=socketpair,--wrap=pthread_self,--wrap=pthread_mutex_lock,--wrap=pthread_join,--wrap=pipe,--wrap=pipe2,--wrap=tgkill" + MOZ_GLUE_WRAP_LDFLAGS="${MOZ_GLUE_WRAP_LDFLAGS} -Wl,--wrap=pthread_create,--wrap=epoll_wait,--wrap=poll,--wrap=pthread_cond_timedwait,--wrap=__pthread_cond_timedwait,--wrap=pthread_cond_wait,--wrap=epoll_create,--wrap=epoll_ctl,--wrap=close,--wrap=pthread_key_create,--wrap=pthread_key_delete,--wrap=socketpair,--wrap=pthread_self,--wrap=pthread_mutex_lock,--wrap=pthread_join,--wrap=pipe,--wrap=pipe2,--wrap=tgkill" fi fi +AC_SUBST_LIST(MOZ_GLUE_WRAP_LDFLAGS) +export MOZ_GLUE_WRAP_LDFLAGS + dnl ======================================================== dnl = Use JS Call tracing dnl ======================================================== @@ -9297,11 +9283,8 @@ ac_configure_args="$ac_configure_args --prefix=$dist" if test "$MOZ_MEMORY"; then ac_configure_args="$ac_configure_args --enable-jemalloc" fi -if test -n "$MOZ_GLUE_LDFLAGS"; then - export MOZ_GLUE_LDFLAGS -fi -if test -n "$MOZ_GLUE_PROGRAM_LDFLAGS"; then - export MOZ_GLUE_PROGRAM_LDFLAGS +if test -n "$MOZ_GLUE_IN_PROGRAM"; then + export MOZ_GLUE_IN_PROGRAM fi if test -n "$ZLIB_IN_MOZGLUE"; then MOZ_ZLIB_LIBS= diff --git a/dom/audiochannel/tests/moz.build b/dom/audiochannel/tests/moz.build index 51ad846ebb8..b1bf003ce18 100644 --- a/dom/audiochannel/tests/moz.build +++ b/dom/audiochannel/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/. -CppUnitTests([ +GeckoCppUnitTests([ 'TestAudioChannelService', ]) @@ -14,10 +14,3 @@ if CONFIG['OS_ARCH'] == 'WINNT': MOCHITEST_MANIFESTS += ['mochitest.ini'] FAIL_ON_WARNINGS = True - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/dom/base/test/moz.build b/dom/base/test/moz.build index 881e0fab9b0..a31cab4aec5 100644 --- a/dom/base/test/moz.build +++ b/dom/base/test/moz.build @@ -10,7 +10,7 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] if CONFIG['OS_ARCH'] != 'Darwin': XPCSHELL_TESTS_MANIFESTS += ['unit_ipc/xpcshell.ini'] -CppUnitTests([ +GeckoCppUnitTests([ 'TestCSPParser', 'TestGetURL', 'TestNativeXMLHttpRequest', @@ -38,10 +38,3 @@ MOCHITEST_CHROME_MANIFESTS += [ ] BROWSER_CHROME_MANIFESTS += ['browser.ini'] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/dom/canvas/compiledtest/moz.build b/dom/canvas/compiledtest/moz.build index 062adb39637..c8a6c0fbc34 100644 --- a/dom/canvas/compiledtest/moz.build +++ b/dom/canvas/compiledtest/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/. -CppUnitTests([ +GeckoCppUnitTests([ 'TestWebGLElementArrayCache', ]) @@ -13,10 +13,3 @@ FAIL_ON_WARNINGS = True LOCAL_INCLUDES += [ '../', ] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/dom/media/compiledtest/moz.build b/dom/media/compiledtest/moz.build index cd818e4de6d..085afcdd5e9 100644 --- a/dom/media/compiledtest/moz.build +++ b/dom/media/compiledtest/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/. -CppUnitTests([ +GeckoCppUnitTests([ 'TestAudioBuffers', 'TestAudioMixer' ]) @@ -14,10 +14,3 @@ FAIL_ON_WARNINGS = True LOCAL_INCLUDES += [ '..', ] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/dom/media/webaudio/compiledtest/moz.build b/dom/media/webaudio/compiledtest/moz.build index 1cb059d6f48..1f06b9edc26 100644 --- a/dom/media/webaudio/compiledtest/moz.build +++ b/dom/media/webaudio/compiledtest/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/. -CppUnitTests([ +GeckoCppUnitTests([ 'TestAudioEventTimeline', ]) @@ -13,10 +13,3 @@ FAIL_ON_WARNINGS = True LOCAL_INCLUDES += [ '..', ] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/dom/plugins/ipc/hangui/Makefile.in b/dom/plugins/ipc/hangui/Makefile.in deleted file mode 100644 index 2dc367f8645..00000000000 --- a/dom/plugins/ipc/hangui/Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -MOZ_GLUE_LDFLAGS = - -include $(topsrcdir)/config/rules.mk diff --git a/editor/txmgr/tests/moz.build b/editor/txmgr/tests/moz.build index e2c223466c5..eb810960b0e 100644 --- a/editor/txmgr/tests/moz.build +++ b/editor/txmgr/tests/moz.build @@ -4,15 +4,8 @@ # 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/. -CppUnitTests([ +GeckoCppUnitTests([ 'TestTXMgr', ]) FAIL_ON_WARNINGS = True - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/embedding/tests/winEmbed/moz.build b/embedding/tests/winEmbed/moz.build index e7ff37a2374..c347aa2dcab 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') +GeckoProgram('winEmbed') SOURCES += [ 'WebBrowserChrome.cpp', @@ -14,8 +14,6 @@ SOURCES += [ XPI_NAME = 'winembed' -DEFINES['XPCOM_GLUE'] = True - RESFILE = 'winEmbed.res' if CONFIG['GNU_CC']: @@ -36,7 +34,6 @@ DISABLE_STL_WRAPPING = True USE_LIBS += [ 'profdirserviceprovidersa_s', - 'xpcomglue', ] OS_LIBS += [ diff --git a/gfx/angle/src/libEGL/moz.build b/gfx/angle/src/libEGL/moz.build index e822acfdba9..faed9e7b21f 100644 --- a/gfx/angle/src/libEGL/moz.build +++ b/gfx/angle/src/libEGL/moz.build @@ -56,7 +56,7 @@ DISABLE_STL_WRAPPING = True LOCAL_INCLUDES += [ '../../include', '../../src' ] USE_LIBS += [ 'libGLESv2' ] -SharedLibrary('libEGL') +GeckoSharedLibrary('libEGL', linkage=None) RCFILE = SRCDIR + '/libEGL.rc' DEFFILE = SRCDIR + '/libEGL.def' diff --git a/gfx/angle/src/libGLESv2/moz.build b/gfx/angle/src/libGLESv2/moz.build index d4455a4b181..b45bec4b448 100644 --- a/gfx/angle/src/libGLESv2/moz.build +++ b/gfx/angle/src/libGLESv2/moz.build @@ -223,7 +223,7 @@ else: '\'%s/lib/%s/dxguid.lib\'' % (CONFIG['MOZ_DIRECTX_SDK_PATH'], CONFIG['MOZ_D3D_CPU_SUFFIX']), ] -SharedLibrary('libGLESv2') +GeckoSharedLibrary('libGLESv2', linkage=None) RCFILE = SRCDIR + '/libGLESv2.rc' DEFFILE = SRCDIR + '/libGLESv2.def' diff --git a/intl/lwbrk/tests/moz.build b/intl/lwbrk/tests/moz.build index 1770e50da27..243b1900afb 100644 --- a/intl/lwbrk/tests/moz.build +++ b/intl/lwbrk/tests/moz.build @@ -4,13 +4,6 @@ # 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/. -CppUnitTests([ +GeckoCppUnitTests([ 'TestLineBreak', ]) - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/intl/unicharutil/tests/moz.build b/intl/unicharutil/tests/moz.build index 80fc3b2bc41..8cc74f51ad8 100644 --- a/intl/unicharutil/tests/moz.build +++ b/intl/unicharutil/tests/moz.build @@ -6,25 +6,11 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] -SimplePrograms([ +GeckoSimplePrograms([ 'NormalizationTest', 'UnicharSelfTest', -]) - -USE_STATIC_LIBS = True +], msvcrt='static') USE_LIBS += [ - 'mozalloc', - 'nspr', 'unicharutil_external_s', - 'xul', ] - -if CONFIG['OS_ARCH'] == 'WINNT': - USE_LIBS += [ - 'xpcomglue_staticruntime_s', - ] -else: - USE_LIBS += [ - 'xpcomglue_s', - ] diff --git a/ipc/app/Makefile.in b/ipc/app/Makefile.in index 85e28cf3f83..03f2b54ffdd 100644 --- a/ipc/app/Makefile.in +++ b/ipc/app/Makefile.in @@ -6,10 +6,6 @@ ifneq ($(dir $(PROGRAM)),./) GENERATED_DIRS = $(dir $(PROGRAM)) endif -ifeq (android,$(MOZ_WIDGET_TOOLKIT)) -WRAP_LDFLAGS = -endif - ifndef MOZ_WINCONSOLE ifdef MOZ_DEBUG MOZ_WINCONSOLE = 1 diff --git a/ipc/app/moz.build b/ipc/app/moz.build index 1c6e03a3068..e331b999e4b 100644 --- a/ipc/app/moz.build +++ b/ipc/app/moz.build @@ -4,13 +4,19 @@ # 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']) - if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': + Program(CONFIG['MOZ_CHILD_PROCESS_NAME']) SOURCES += [ 'MozillaRuntimeMainAndroid.cpp', ] else: + kwargs = { + 'linkage': None, + } + if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT': + kwargs['msvcrt'] = 'static' + GeckoProgram(CONFIG['MOZ_CHILD_PROCESS_NAME'], **kwargs) + SOURCES += [ 'MozillaRuntimeMain.cpp', ] @@ -42,7 +48,6 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT': 'nss3.dll', 'xul.dll' ] - USE_STATIC_LIBS = True if CONFIG['_MSC_VER']: # Always enter a Windows program through wmain, whether or not we're @@ -62,7 +67,7 @@ LDFLAGS += [CONFIG['MOZ_ALLOW_HEAP_EXECUTE_FLAGS']] if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']: LDFLAGS += ['/HEAP:0x40000'] -# Windows builds have dll linkage warnings due to USE_STATIC_LIBS +# Windows builds have dll linkage warnings due to msvcrt static linkage if CONFIG['OS_ARCH'] != 'WINNT': FAIL_ON_WARNINGS = True diff --git a/ipc/ipdl/test/cxx/app/moz.build b/ipc/ipdl/test/cxx/app/moz.build index 4f6a7b48ca9..72091b73e46 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') +GeckoProgram('ipdlunittest', linkage='dependent') SOURCES += [ 'TestIPDL.cpp', @@ -18,10 +18,3 @@ LOCAL_INCLUDES += [ if CONFIG['_MSC_VER']: WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup'] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/js/src/configure.in b/js/src/configure.in index c242bd78a89..4445a9a91e2 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -3113,7 +3113,6 @@ if test "$MOZ_MEMORY"; then ;; *-mingw*) AC_DEFINE(MOZ_MEMORY_WINDOWS) - # the interesting bits will get passed down in MOZ_GLUE_LDFLAGS ;; *) AC_MSG_ERROR([--enable-jemalloc not supported on ${target}]) @@ -3122,8 +3121,8 @@ if test "$MOZ_MEMORY"; then fi AC_SUBST(MOZ_MEMORY) AC_SUBST(MOZ_CRT) -AC_SUBST(MOZ_GLUE_LDFLAGS) -AC_SUBST(MOZ_GLUE_PROGRAM_LDFLAGS) +AC_SUBST(MOZ_GLUE_IN_PROGRAM) +AC_SUBST_LIST(MOZ_GLUE_WRAP_LDFLAGS) dnl ======================================================== dnl = Use malloc wrapper lib diff --git a/js/src/gdb/moz.build b/js/src/gdb/moz.build index 119e9eb7373..74831ad0dfe 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') +GeckoProgram('gdb-tests', linkage=None) UNIFIED_SOURCES += [ 'gdb-tests.cpp', diff --git a/js/src/jsapi-tests/moz.build b/js/src/jsapi-tests/moz.build index 43aec53c1db..111bdbcdf83 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') +GeckoProgram('jsapi-tests', linkage=None) UNIFIED_SOURCES += [ 'selfTest.cpp', diff --git a/js/src/moz.build b/js/src/moz.build index 8540e6dd8fb..df026df9262 100644 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -440,7 +440,7 @@ HostSimplePrograms([ # JS shell would like to link to the static library. if CONFIG['JS_SHARED_LIBRARY']: - SharedLibrary('js') + GeckoSharedLibrary('js', linkage=None) SHARED_LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME'] SDK_LIBRARY = True else: diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build index 14720715783..273371958de 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']) + GeckoProgram(CONFIG['JS_SHELL_NAME'], linkage=None) 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 289b5d17d81..de4a862d843 100644 --- a/js/xpconnect/shell/moz.build +++ b/js/xpconnect/shell/moz.build @@ -6,7 +6,7 @@ FAIL_ON_WARNINGS = True -Program('xpcshell') +GeckoProgram('xpcshell', linkage='dependent') SOURCES += [ 'xpcshell.cpp', @@ -35,10 +35,3 @@ if CONFIG['_MSC_VER']: if CONFIG['OS_ARCH'] == 'WINNT': RCINCLUDE = 'xpcshell.rc' - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/js/xpconnect/tests/moz.build b/js/xpconnect/tests/moz.build index 23aa36a1733..4b13d1ad04e 100644 --- a/js/xpconnect/tests/moz.build +++ b/js/xpconnect/tests/moz.build @@ -14,10 +14,3 @@ TEST_DIRS += [ ] XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/layout/media/moz.build b/layout/media/moz.build index 4fe8ea8fc76..a6d3eba4076 100644 --- a/layout/media/moz.build +++ b/layout/media/moz.build @@ -5,7 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['GKMEDIAS_SHARED_LIBRARY']: - SharedLibrary('gkmedias') + GeckoSharedLibrary('gkmedias', linkage=None) USE_LIBS += [ 'mozalloc', 'nspr', diff --git a/media/gmp-clearkey/0.1/Makefile.in b/media/gmp-clearkey/0.1/Makefile.in index 826bd88c1d3..1077ae7c240 100644 --- a/media/gmp-clearkey/0.1/Makefile.in +++ b/media/gmp-clearkey/0.1/Makefile.in @@ -9,7 +9,3 @@ CLEARKEY_CDM_FILES = \ $(SHARED_LIBRARY) \ clearkey.info \ $(NULL) - -MOZ_GLUE_LDFLAGS = - -include $(topsrcdir)/config/rules.mk diff --git a/media/libcubeb/tests/moz.build b/media/libcubeb/tests/moz.build index 7bf057a1b1b..bca57ba304d 100644 --- a/media/libcubeb/tests/moz.build +++ b/media/libcubeb/tests/moz.build @@ -4,12 +4,12 @@ # 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/. -CppUnitTests([ +GeckoCppUnitTests([ 'test_tone' ]) if CONFIG['OS_TARGET'] != 'Android': - CppUnitTests([ + GeckoCppUnitTests([ 'test_audio', 'test_latency', 'test_sanity' @@ -44,13 +44,6 @@ else: 'speex', ] -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] - if CONFIG['OS_TARGET'] == 'Darwin': OS_LIBS += [ '-framework AudioUnit', diff --git a/media/mtransport/test/moz.build b/media/mtransport/test/moz.build index f2aebe06f3b..75d00840524 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': - CppUnitTests([ + GeckoCppUnitTests([ 'buffered_stun_socket_unittest', 'nrappkit_unittest', 'rlogringbuffer_unittest', @@ -19,12 +19,12 @@ if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': # Bug 1037618 - Cross-tree (network related?) failures on OSX if CONFIG['OS_TARGET'] != 'Darwin': - CppUnitTests([ + GeckoCppUnitTests([ 'ice_unittest', ]) if CONFIG['MOZ_SCTP']: - CppUnitTests([ + GeckoCppUnitTests([ 'sctp_unittest', ]) @@ -88,14 +88,10 @@ LOCAL_INCLUDES += [ USE_LIBS += [ '/media/webrtc/trunk/testing/gtest_gtest/gtest', - 'mozalloc', 'mtransport_s', 'nicer', 'nrappkit', - 'nspr', 'nss', - 'xpcomglue_s', - 'xul', ] if not CONFIG['MOZ_NATIVE_NSS'] and not CONFIG['MOZ_FOLD_LIBS']: diff --git a/media/webrtc/signaling/test/moz.build b/media/webrtc/signaling/test/moz.build index e2af3824e4b..0f03b8739c5 100644 --- a/media/webrtc/signaling/test/moz.build +++ b/media/webrtc/signaling/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': - CppUnitTests([ + GeckoCppUnitTests([ 'mediaconduit_unittests', 'mediapipeline_unittest', 'sdp_unittests', @@ -94,14 +94,10 @@ USE_LIBS += [ '/media/webrtc/signalingtest/signaling_sipcc/sipcc', '/media/webrtc/trunk/testing/gtest_gtest/gtest', 'gkmedias', - 'mozalloc', 'mtransport_s', 'nksrtp_s', - 'nspr', 'nss', 'webrtc', - 'xpcomglue_s', - 'xul', 'yuv', 'zlib', ] diff --git a/memory/build/Makefile.in b/memory/build/Makefile.in index fd9086f973e..bf221dcf232 100644 --- a/memory/build/Makefile.in +++ b/memory/build/Makefile.in @@ -3,6 +3,6 @@ # You can obtain one at http://mozilla.org/MPL/2.0/. STLFLAGS = -ifdef MOZ_GLUE_PROGRAM_LDFLAGS +ifdef MOZ_GLUE_IN_PROGRAM DIST_INSTALL = 1 endif diff --git a/memory/build/moz.build b/memory/build/moz.build index 73ce1ac955a..f66d234bd9c 100644 --- a/memory/build/moz.build +++ b/memory/build/moz.build @@ -48,7 +48,7 @@ else: 'mozjemalloc', ] -if CONFIG['MOZ_GLUE_PROGRAM_LDFLAGS']: +if CONFIG['MOZ_GLUE_IN_PROGRAM']: SDK_LIBRARY = True # Keep jemalloc separated when mozglue is statically linked diff --git a/memory/build/replace_malloc.h b/memory/build/replace_malloc.h index 1feb4fe3267..0cbec17ea3f 100644 --- a/memory/build/replace_malloc.h +++ b/memory/build/replace_malloc.h @@ -51,10 +51,7 @@ * even more especially when these types come from XPCOM or other parts of the * Mozilla codebase. * It is recommended to add the following to a replace-malloc implementation's - * Makefile.in: - * MOZ_GLUE_LDFLAGS = # Don't link against mozglue - * WRAP_LDFLAGS = # Never wrap malloc function calls with -Wl,--wrap - * and the following to the implementation's moz.build: + * moz.build: * DISABLE_STL_WRAPPING = True # Avoid STL wrapping * * If your replace-malloc implementation lives under memory/replace, these diff --git a/memory/jemalloc/Makefile.in b/memory/jemalloc/Makefile.in index f20ce1a4fea..83efd1d9294 100644 --- a/memory/jemalloc/Makefile.in +++ b/memory/jemalloc/Makefile.in @@ -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/. -ifdef MOZ_GLUE_PROGRAM_LDFLAGS +ifdef MOZ_GLUE_IN_PROGRAM DIST_INSTALL = 1 endif diff --git a/memory/jemalloc/moz.build b/memory/jemalloc/moz.build index 0ab76125157..1ec3f80b79c 100644 --- a/memory/jemalloc/moz.build +++ b/memory/jemalloc/moz.build @@ -40,7 +40,7 @@ Library('jemalloc') FORCE_STATIC_LIB = True -if CONFIG['MOZ_GLUE_PROGRAM_LDFLAGS']: +if CONFIG['MOZ_GLUE_IN_PROGRAM']: SDK_LIBRARY = True if CONFIG['_MSC_VER']: diff --git a/memory/mozalloc/moz.build b/memory/mozalloc/moz.build index ccbbf2ac4c9..d8d622b98f2 100644 --- a/memory/mozalloc/moz.build +++ b/memory/mozalloc/moz.build @@ -60,7 +60,7 @@ else: if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': Library('mozalloc') else: - SharedLibrary('mozalloc') + GeckoSharedLibrary('mozalloc', linkage=None) SDK_LIBRARY = True # The strndup declaration in string.h is in an ifdef __USE_GNU section diff --git a/memory/mozalloc/tests/moz.build b/memory/mozalloc/tests/moz.build index fc540a1d587..3627343462c 100644 --- a/memory/mozalloc/tests/moz.build +++ b/memory/mozalloc/tests/moz.build @@ -4,13 +4,6 @@ # 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/. -CppUnitTests([ +GeckoCppUnitTests([ 'TestVolatileBuffer', ]) - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/memory/replace/dmd/Makefile.in b/memory/replace/dmd/Makefile.in deleted file mode 100644 index 7174f61b3be..00000000000 --- a/memory/replace/dmd/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -# Disable mozglue. -WRAP_LDFLAGS = -MOZ_GLUE_LDFLAGS= diff --git a/memory/replace/dummy/Makefile.in b/memory/replace/dummy/Makefile.in deleted file mode 100644 index 1c9745020a8..00000000000 --- a/memory/replace/dummy/Makefile.in +++ /dev/null @@ -1,6 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -MOZ_GLUE_LDFLAGS = # Don't link against mozglue -WRAP_LDFLAGS = # Never wrap malloc function calls with -Wl,--wrap diff --git a/memory/replace/jemalloc/Makefile.in b/memory/replace/jemalloc/Makefile.in deleted file mode 100644 index 1c9745020a8..00000000000 --- a/memory/replace/jemalloc/Makefile.in +++ /dev/null @@ -1,6 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -MOZ_GLUE_LDFLAGS = # Don't link against mozglue -WRAP_LDFLAGS = # Never wrap malloc function calls with -Wl,--wrap diff --git a/memory/replace/logalloc/Makefile.in b/memory/replace/logalloc/Makefile.in index 994db23b9aa..d60c79e9d7b 100644 --- a/memory/replace/logalloc/Makefile.in +++ b/memory/replace/logalloc/Makefile.in @@ -2,9 +2,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/. -# Disable mozglue. -WRAP_LDFLAGS = -MOZ_GLUE_LDFLAGS= - # Avoid Lock_impl code depending on mozilla::Logger MOZ_DEBUG_ENABLE_DEFS= diff --git a/memory/replace/logalloc/replay/Makefile.in b/memory/replace/logalloc/replay/Makefile.in index 599b44cc7bb..47e8c43ca63 100644 --- a/memory/replace/logalloc/replay/Makefile.in +++ b/memory/replace/logalloc/replay/Makefile.in @@ -2,11 +2,6 @@ # 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/. -# Disable mozglue. -WRAP_LDFLAGS = -MOZ_GLUE_LDFLAGS= -MOZ_GLUE_PROGRAM_LDFLAGS= - include $(topsrcdir)/mozglue/build/replace_malloc.mk ifndef CROSS_COMPILE diff --git a/mfbt/tests/Makefile.in b/mfbt/tests/Makefile.in deleted file mode 100644 index e1a1781ece7..00000000000 --- a/mfbt/tests/Makefile.in +++ /dev/null @@ -1,12 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this file, -# You can obtain one at http://mozilla.org/MPL/2.0/. - -# in order to prevent rules.mk from trying to link to libraries that are -# not available to MFBT, we have to reset these MOZ_GLUE*_LDFLAGS before including it -# and LIBS_ after including it. For WRAP_LDFLAGS, it shouldn't matter. -# See later comments in bug 732875. - -MOZ_GLUE_PROGRAM_LDFLAGS= -MOZ_GLUE_LDFLAGS = -WRAP_LDFLAGS= diff --git a/modules/libmar/tool/Makefile.in b/modules/libmar/tool/Makefile.in index 16274d43c82..20a7c475aa0 100644 --- a/modules/libmar/tool/Makefile.in +++ b/modules/libmar/tool/Makefile.in @@ -8,10 +8,6 @@ # would only be used by our build system and should not itself be included in a # Mozilla distribution. -# Don't link the against libmozglue because we don't need it. -MOZ_GLUE_LDFLAGS = -MOZ_GLUE_PROGRAM_LDFLAGS = - HOST_CFLAGS += \ -DNO_SIGN_VERIFY \ $(DEFINES) \ diff --git a/mozglue/build/Makefile.in b/mozglue/build/Makefile.in index e9f1765205e..ff04bcf62cb 100644 --- a/mozglue/build/Makefile.in +++ b/mozglue/build/Makefile.in @@ -8,8 +8,6 @@ DIST_INSTALL = 1 # For FORCE_SHARED_LIB include $(topsrcdir)/config/config.mk -MOZ_GLUE_LDFLAGS = # Don't link against ourselves - ifeq (WINNT,$(OS_TARGET)) mozglue.def: mozglue.def.in $(GLOBAL_DEPS) $(call py_action,preprocessor,$(if $(MOZ_REPLACE_MALLOC),-DMOZ_REPLACE_MALLOC) $(ACDEFINES) $< -o $@) @@ -31,7 +29,3 @@ OS_LDFLAGS += -Wl,-version-script,$(srcdir)/arm-eabi-filter endif endif - -ifeq (Android, $(OS_TARGET)) -WRAP_LDFLAGS := $(filter -Wl%,$(WRAP_LDFLAGS)) -endif diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build index ee209e73a00..d1c7f8725b3 100644 --- a/mozglue/build/moz.build +++ b/mozglue/build/moz.build @@ -83,3 +83,5 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': ] DEFINES['IMPL_MFBT'] = True + +LDFLAGS += CONFIG['MOZ_GLUE_WRAP_LDFLAGS'] diff --git a/mozglue/linker/tests/Makefile.in b/mozglue/linker/tests/Makefile.in index de4a95f4022..c6e299d44d0 100644 --- a/mozglue/linker/tests/Makefile.in +++ b/mozglue/linker/tests/Makefile.in @@ -2,12 +2,6 @@ # 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/. -ifdef MOZ_LINKER -# Only link against the linker, not mozglue -MOZ_GLUE_PROGRAM_LDFLAGS = -MOZ_GLUE_LDFLAGS = -endif - include $(topsrcdir)/config/rules.mk ifdef MOZ_LINKER diff --git a/mozglue/tests/moz.build b/mozglue/tests/moz.build index 47c4c333aff..353c5694956 100644 --- a/mozglue/tests/moz.build +++ b/mozglue/tests/moz.build @@ -6,6 +6,6 @@ DISABLE_STL_WRAPPING = True -CppUnitTests([ +GeckoCppUnitTests([ 'ShowSSEConfig', -]) +], linkage=None) diff --git a/netwerk/streamconv/test/moz.build b/netwerk/streamconv/test/moz.build index d62d4669197..8a92b70e01b 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') +GeckoProgram('TestStreamConv', linkage='dependent') UNIFIED_SOURCES += [ 'Converters.cpp', @@ -19,10 +19,3 @@ if CONFIG['OS_ARCH'] == 'WINNT': LDFLAGS += ['-mconsole'] else: LDFLAGS += ['-SUBSYSTEM:CONSOLE'] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/netwerk/test/moz.build b/netwerk/test/moz.build index 9d95514b369..17d758e3148 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'] -SimplePrograms([ +GeckoSimplePrograms([ 'PropertiesTest', 'ReadNTLM', 'TestBlockingSocket', @@ -58,11 +58,4 @@ RESOURCE_FILES += [ 'urlparse_unx.dat', ] -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] - CXXFLAGS += CONFIG['TK_CFLAGS'] diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py index f547d509cf1..e5fdbf0993d 100644 --- a/python/mozbuild/mozbuild/backend/recursivemake.py +++ b/python/mozbuild/mozbuild/backend/recursivemake.py @@ -1154,22 +1154,6 @@ INSTALL_TARGETS += %(prefix)s build_target = self._build_target_for_obj(obj) self._compile_graph[build_target] - # Until MOZ_GLUE_LDFLAGS/MOZ_GLUE_PROGRAM_LDFLAGS are properly - # handled in moz.build world, assume any program or shared library - # we build depends on it. - if obj.KIND == 'target' and not isinstance(obj, StaticLibrary) and \ - build_target not in ('mozglue/build/target', - 'mozglue/crt/target') and \ - not obj.config.substs.get('JS_STANDALONE') and \ - (not isinstance(obj, SharedLibrary) or - obj.basename != 'clang-plugin'): - if obj.config.substs.get('MOZ_CRT'): - self._compile_graph[build_target].add('mozglue/crt/target') - else: - self._compile_graph[build_target].add('mozglue/build/target') - if obj.config.substs.get('MOZ_MEMORY'): - self._compile_graph[build_target].add('memory/build/target') - for lib in obj.linked_libraries: if not isinstance(lib, ExternalLibrary): self._compile_graph[build_target].add( diff --git a/rdf/tests/rdfcat/moz.build b/rdf/tests/rdfcat/moz.build index 56b2f877539..98a83846800 100644 --- a/rdf/tests/rdfcat/moz.build +++ b/rdf/tests/rdfcat/moz.build @@ -4,17 +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/. -Program('rdfcat') +GeckoProgram('rdfcat', linkage='dependent') SOURCES += [ 'rdfcat.cpp', ] -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] - CXXFLAGS += CONFIG['TK_CFLAGS'] diff --git a/rdf/tests/rdfpoll/moz.build b/rdf/tests/rdfpoll/moz.build index 41ef0fd2579..dc81d64d72e 100644 --- a/rdf/tests/rdfpoll/moz.build +++ b/rdf/tests/rdfpoll/moz.build @@ -4,15 +4,8 @@ # 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') +GeckoProgram('rdfpoll', linkage='dependent') SOURCES += [ 'rdfpoll.cpp', ] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/rdf/tests/triplescat/moz.build b/rdf/tests/triplescat/moz.build index f1d0cfb0a7d..28ed7816d6a 100644 --- a/rdf/tests/triplescat/moz.build +++ b/rdf/tests/triplescat/moz.build @@ -4,17 +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/. -Program('triplescat') +GeckoProgram('triplescat', linkage='dependent') SOURCES += [ 'triplescat.cpp', ] -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] - CXXFLAGS += CONFIG['TK_CFLAGS'] diff --git a/security/manager/ssl/tests/compiled/moz.build b/security/manager/ssl/tests/compiled/moz.build index 7aaae8b3df5..26829651e10 100644 --- a/security/manager/ssl/tests/compiled/moz.build +++ b/security/manager/ssl/tests/compiled/moz.build @@ -4,13 +4,6 @@ # 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/. -CppUnitTests([ +GeckoCppUnitTests([ 'TestCertDB', ]) - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/security/manager/ssl/tests/unit/tlsserver/cmd/moz.build b/security/manager/ssl/tests/unit/tlsserver/cmd/moz.build index dd91bbbd0b0..6da2e4851f1 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 -SimplePrograms([ +GeckoSimplePrograms([ 'BadCertServer', 'ClientAuthServer', 'GenerateOCSPResponse', 'OCSPStaplingServer', -]) +], linkage=None) LOCAL_INCLUDES += [ '../lib', diff --git a/security/sandbox/Makefile.in b/security/sandbox/Makefile.in deleted file mode 100644 index 05cc77d5967..00000000000 --- a/security/sandbox/Makefile.in +++ /dev/null @@ -1,9 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -ifeq ($(OS_ARCH),WINNT) -MOZ_GLUE_LDFLAGS = -endif - -include $(topsrcdir)/config/rules.mk diff --git a/security/sandbox/win/src/sandboxbroker/Makefile.in b/security/sandbox/win/src/sandboxbroker/Makefile.in deleted file mode 100644 index 77795ab1321..00000000000 --- a/security/sandbox/win/src/sandboxbroker/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -MOZ_GLUE_LDFLAGS = diff --git a/startupcache/test/moz.build b/startupcache/test/moz.build index 6531d0dc022..30a4ad72398 100644 --- a/startupcache/test/moz.build +++ b/startupcache/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/. -CppUnitTests([ +GeckoCppUnitTests([ 'TestStartupCache', ]) @@ -12,10 +12,3 @@ EXTRA_COMPONENTS += [ 'TestStartupCacheTelemetry.js', 'TestStartupCacheTelemetry.manifest', ] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/storage/test/moz.build b/storage/test/moz.build index 8bcd80a1951..95481a301c9 100644 --- a/storage/test/moz.build +++ b/storage/test/moz.build @@ -6,7 +6,7 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] -CppUnitTests([ +GeckoCppUnitTests([ 'test_AsXXX_helpers', 'test_async_callbacks_with_spun_event_loops', 'test_asyncStatementExecution_transaction', @@ -24,7 +24,7 @@ CppUnitTests([ 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 - CppUnitTests([ + GeckoCppUnitTests([ 'test_deadlock_detector', ]) @@ -35,9 +35,5 @@ LOCAL_INCLUDES += [ FAIL_ON_WARNINGS = True USE_LIBS += [ - 'mozalloc', - 'nspr', 'sqlite', - 'xpcomglue_s', - 'xul', ] diff --git a/testing/mochitest/ssltunnel/moz.build b/testing/mochitest/ssltunnel/moz.build index dae73aff7c9..77bcdc4c611 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') +GeckoProgram('ssltunnel', linkage=None) SOURCES += [ 'ssltunnel.cpp', diff --git a/testing/tools/screenshot/Makefile.in b/testing/tools/screenshot/Makefile.in deleted file mode 100644 index 17579d28257..00000000000 --- a/testing/tools/screenshot/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -MOZ_GLUE_PROGRAM_LDFLAGS = diff --git a/toolkit/components/ctypes/tests/Makefile.in b/toolkit/components/ctypes/tests/Makefile.in index 9e9f63c36b3..60d248d296c 100644 --- a/toolkit/components/ctypes/tests/Makefile.in +++ b/toolkit/components/ctypes/tests/Makefile.in @@ -9,5 +9,3 @@ INSTALL_TARGETS += LIB_1 LIB_3_FILES = $(SHARED_LIBRARY) LIB_3_DEST = $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/chrome INSTALL_TARGETS += LIB_3 - -MOZ_GLUE_LDFLAGS = diff --git a/toolkit/components/maintenanceservice/Makefile.in b/toolkit/components/maintenanceservice/Makefile.in index f2bf59cd1b1..32f2dff9153 100644 --- a/toolkit/components/maintenanceservice/Makefile.in +++ b/toolkit/components/maintenanceservice/Makefile.in @@ -4,11 +4,6 @@ DIST_PROGRAM = maintenanceservice$(BIN_SUFFIX) -# Don't link the maintenanceservice against mozglue.dll. See bug 687139 and -# bug 725876 -MOZ_GLUE_LDFLAGS = -MOZ_GLUE_PROGRAM_LDFLAGS = - ifndef MOZ_WINCONSOLE ifdef MOZ_DEBUG MOZ_WINCONSOLE = 1 diff --git a/toolkit/components/places/tests/cpp/moz.build b/toolkit/components/places/tests/cpp/moz.build index b7935de0d26..a135adaafbd 100644 --- a/toolkit/components/places/tests/cpp/moz.build +++ b/toolkit/components/places/tests/cpp/moz.build @@ -4,19 +4,12 @@ # 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/. -CppUnitTests([ +GeckoCppUnitTests([ 'test_IHistory', ]) FAIL_ON_WARNINGS = True -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] - if CONFIG['JS_SHARED_LIBRARY']: USE_LIBS += [ 'js', diff --git a/toolkit/crashreporter/breakpad-windows-standalone/Makefile.in b/toolkit/crashreporter/breakpad-windows-standalone/Makefile.in deleted file mode 100644 index 9a0b3a6d1a1..00000000000 --- a/toolkit/crashreporter/breakpad-windows-standalone/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -MOZ_GLUE_LDFLAGS = diff --git a/toolkit/crashreporter/client/Makefile.in b/toolkit/crashreporter/client/Makefile.in index 45ed8d26acd..3de8d90a03f 100644 --- a/toolkit/crashreporter/client/Makefile.in +++ b/toolkit/crashreporter/client/Makefile.in @@ -5,10 +5,6 @@ ifneq ($(OS_TARGET),Android) DIST_PROGRAM = crashreporter$(BIN_SUFFIX) - -# Don't link the updater against libmozglue. -MOZ_GLUE_LDFLAGS = -MOZ_GLUE_PROGRAM_LDFLAGS = endif ifeq ($(OS_ARCH),WINNT) diff --git a/toolkit/crashreporter/injector/Makefile.in b/toolkit/crashreporter/injector/Makefile.in deleted file mode 100644 index 2dc367f8645..00000000000 --- a/toolkit/crashreporter/injector/Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -MOZ_GLUE_LDFLAGS = - -include $(topsrcdir)/config/rules.mk diff --git a/toolkit/crashreporter/test/moz.build b/toolkit/crashreporter/test/moz.build index 5334228684b..f1c05c8c965 100644 --- a/toolkit/crashreporter/test/moz.build +++ b/toolkit/crashreporter/test/moz.build @@ -17,7 +17,7 @@ UNIFIED_SOURCES += [ 'nsTestCrasher.cpp', ] -SharedLibrary('testcrasher') +GeckoSharedLibrary('testcrasher') EXTRA_JS_MODULES += [ 'CrashTestUtils.jsm', @@ -36,10 +36,3 @@ LOCAL_INCLUDES += [ ] include('/toolkit/crashreporter/crashreporter.mozbuild') - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build index ededc3b3761..e52ec058f80 100644 --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -11,10 +11,10 @@ def Libxul(name): if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': # This is going to be a framework named "XUL", not an ordinary library named # "libxul.dylib" - Framework(name) + GeckoFramework(name, linkage=None) SHARED_LIBRARY_NAME = 'XUL' else: - SharedLibrary(name) + GeckoSharedLibrary(name, linkage=None) SHARED_LIBRARY_NAME = 'xul' DELAYLOAD_DLLS += [ diff --git a/toolkit/mozapps/update/tests/Makefile.in b/toolkit/mozapps/update/tests/Makefile.in index 91b746b3019..a9b203c5731 100644 --- a/toolkit/mozapps/update/tests/Makefile.in +++ b/toolkit/mozapps/update/tests/Makefile.in @@ -60,8 +60,6 @@ INI_TEST_FILES = \ TestAUSReadStrings3.ini \ $(NULL) -MOZ_GLUE_LDFLAGS = -MOZ_GLUE_PROGRAM_LDFLAGS = MOZ_WINCONSOLE = 1 endif # Not Android diff --git a/toolkit/mozapps/update/updater/Makefile.in b/toolkit/mozapps/update/updater/Makefile.in index 7c5f888eb5a..07b1603e37b 100644 --- a/toolkit/mozapps/update/updater/Makefile.in +++ b/toolkit/mozapps/update/updater/Makefile.in @@ -3,15 +3,6 @@ # 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/. -# Don't link the updater against libmozglue. See bug 687139 -MOZ_GLUE_LDFLAGS = -MOZ_GLUE_PROGRAM_LDFLAGS = - -ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) #{ -# clear out all the --wrap flags and remove dependency on mozglue for Gonk -WRAP_LDFLAGS := -endif #} - ifndef MOZ_WINCONSOLE ifdef MOZ_DEBUG MOZ_WINCONSOLE = 1 diff --git a/toolkit/webapps/tests/Makefile.in b/toolkit/webapps/tests/Makefile.in index 29a2f1a5f86..8e6134759ec 100644 --- a/toolkit/webapps/tests/Makefile.in +++ b/toolkit/webapps/tests/Makefile.in @@ -3,10 +3,3 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. PROGRAMS_DEST = $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) - -include $(topsrcdir)/config/rules.mk - -# Don't create a dependency on mozglue, which is impossible (difficult?) -# to dynamically link into our executable, as we copy it to arbitrary locations. -MOZ_GLUE_LDFLAGS = -MOZ_GLUE_PROGRAM_LDFLAGS = diff --git a/tools/trace-malloc/moz.build b/tools/trace-malloc/moz.build index f602d44d516..cc3f78dc031 100644 --- a/tools/trace-malloc/moz.build +++ b/tools/trace-malloc/moz.build @@ -24,7 +24,7 @@ SimplePrograms([ 'tmstats', ], ext='.c') -SimplePrograms([ +GeckoSimplePrograms([ 'bloatblame', 'leaksoup', ]) @@ -32,10 +32,3 @@ SimplePrograms([ RESOURCE_FILES += [ 'spacetrace.css' ] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/uriloader/exthandler/tests/moz.build b/uriloader/exthandler/tests/moz.build index 0f940e82341..6a7503934fd 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'] -SimplePrograms([ +GeckoSimplePrograms([ 'WriteArgument', -]) +], linkage=None) USE_LIBS += [ 'nspr', diff --git a/webapprt/gtk/moz.build b/webapprt/gtk/moz.build index da4cc6fec4c..d782cc1bfaf 100644 --- a/webapprt/gtk/moz.build +++ b/webapprt/gtk/moz.build @@ -4,7 +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/. -Program('webapprt-stub') +# mozglue is statically linked into GeckoPrograms on gtk builds, so +# we can use GeckoProgram, contrary to other platforms. +GeckoProgram('webapprt-stub') SOURCES += [ 'webapprt.cpp', @@ -12,8 +14,6 @@ SOURCES += [ FAIL_ON_WARNINGS = True -DEFINES['XPCOM_GLUE'] = True - GENERATED_INCLUDES += ['/build'] LOCAL_INCLUDES += [ '/toolkit/xre', @@ -21,10 +21,6 @@ LOCAL_INCLUDES += [ '/xpcom/build', ] -USE_LIBS += [ - 'xpcomglue', -] - DISABLE_STL_WRAPPING = True CXXFLAGS += CONFIG['TK_CFLAGS'] diff --git a/webapprt/mac/Makefile.in b/webapprt/mac/Makefile.in index e0a09fffd95..005f1e05011 100644 --- a/webapprt/mac/Makefile.in +++ b/webapprt/mac/Makefile.in @@ -6,11 +6,6 @@ # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall. NSDISTMODE = copy -# Don't create a dependency on mozglue, which is impossible (difficult?) -# to dynamically link into our executable, as we copy it to arbitrary locations. -MOZ_GLUE_LDFLAGS = -MOZ_GLUE_PROGRAM_LDFLAGS = - PROGRAMS_DEST = $(DIST)/bin include $(topsrcdir)/config/rules.mk diff --git a/webapprt/mac/moz.build b/webapprt/mac/moz.build index 774971dcca2..2f6417c8bbb 100644 --- a/webapprt/mac/moz.build +++ b/webapprt/mac/moz.build @@ -4,6 +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/. +# Can't use GeckoProgram, because we don't want to create a dependency on +# mozglue, which is impossible (difficult?) to dynamically link into our +# executable, as we copy it to arbitrary locations. Program('webapprt-stub') SOURCES += [ diff --git a/webapprt/win/Makefile.in b/webapprt/win/Makefile.in index b3bc8497c92..7aea88a81bf 100644 --- a/webapprt/win/Makefile.in +++ b/webapprt/win/Makefile.in @@ -2,10 +2,6 @@ # 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/. -# Don't create a dependency on mozglue, which is impossible (difficult?) -# to dynamically link into our executable, as we copy it to arbitrary locations. -MOZ_GLUE_LDFLAGS = - ifndef MOZ_WINCONSOLE ifdef MOZ_DEBUG MOZ_WINCONSOLE = 1 diff --git a/webapprt/win/moz.build b/webapprt/win/moz.build index 7695e2ef291..a1d446d2eed 100644 --- a/webapprt/win/moz.build +++ b/webapprt/win/moz.build @@ -4,6 +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/. +# Can't use GeckoProgram, because we don't want to create a dependency on +# mozglue, which is impossible (difficult?) to dynamically link into our +# executable, as we copy it to arbitrary locations. Program('webapprt-stub') SOURCES += [ diff --git a/widget/tests/moz.build b/widget/tests/moz.build index ab93b2f7778..8fd29918572 100644 --- a/widget/tests/moz.build +++ b/widget/tests/moz.build @@ -8,7 +8,7 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] MOCHITEST_MANIFESTS += ['mochitest.ini'] MOCHITEST_CHROME_MANIFESTS += ['chrome.ini'] -CppUnitTests([ +GeckoCppUnitTests([ 'TestAppShellSteadyState', ]) @@ -23,10 +23,3 @@ FAIL_ON_WARNINGS = True # Test disabled because it requires the internal API. Re-enabling this test # is bug 652123. # CPP_UNIT_TESTS += ['TestChromeMargin'] - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/xpcom/reflect/xptcall/tests/moz.build b/xpcom/reflect/xptcall/tests/moz.build index 7bc7e8d8b9e..addb1aaa783 100644 --- a/xpcom/reflect/xptcall/tests/moz.build +++ b/xpcom/reflect/xptcall/tests/moz.build @@ -4,13 +4,6 @@ # 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/. -SimplePrograms([ +GeckoSimplePrograms([ 'TestXPTCInvoke', ]) - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/xpcom/reflect/xptinfo/tests/moz.build b/xpcom/reflect/xptinfo/tests/moz.build index 6022da61589..2a32c3cc07f 100644 --- a/xpcom/reflect/xptinfo/tests/moz.build +++ b/xpcom/reflect/xptinfo/tests/moz.build @@ -4,13 +4,6 @@ # 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/. -SimplePrograms([ +GeckoSimplePrograms([ 'TestInterfaceInfo' ]) - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/xpcom/sample/program/moz.build b/xpcom/sample/program/moz.build index d00630c0475..2dab0090679 100644 --- a/xpcom/sample/program/moz.build +++ b/xpcom/sample/program/moz.build @@ -4,22 +4,11 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# SIMPLE_PROGRAMS compiles a single .cpp file into an executable -SimplePrograms([ +# GeckoSimplePrograms compiles a single .cpp file into an executable +# depending on Gecko with standalone linkage. +GeckoSimplePrograms([ 'nsTestSample' -]) - -# Whatever code is going to be linked with the *standalone* glue must be -# built with the XPCOM_GLUE define set. -DEFINES['XPCOM_GLUE'] = True - -# USE_LIBS specifies the in-tree libraries to link when building an executable -# program from this directory. We link against the "standalone glue" which does -# not require# that the application be linked against the XPCOM dynamic library -# or the NSPR dynamic libraries. -USE_LIBS += [ - 'xpcomglue', -] +], linkage='standalone') # Need to link with CoreFoundation on Mac if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': diff --git a/xpcom/tests/external/moz.build b/xpcom/tests/external/moz.build index 9999fd2c29f..f54ce1ea3ba 100644 --- a/xpcom/tests/external/moz.build +++ b/xpcom/tests/external/moz.build @@ -4,13 +4,6 @@ # 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/. -SimplePrograms([ +GeckoSimplePrograms([ 'TestMinStringAPI', ]) - -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] diff --git a/xpcom/tests/moz.build b/xpcom/tests/moz.build index 6fc8b037927..ee09821376d 100644 --- a/xpcom/tests/moz.build +++ b/xpcom/tests/moz.build @@ -39,18 +39,18 @@ SimplePrograms([ ]) if CONFIG['OS_TARGET'] == 'WINNT': - SimplePrograms([ + GeckoSimplePrograms([ 'TestBase64', ]) if CONFIG['WRAP_STL_INCLUDES'] and not CONFIG['CLANG_CL']: - SimplePrograms([ + GeckoSimplePrograms([ 'TestSTLWrappers', ]) XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] -CppUnitTests([ +GeckoCppUnitTests([ 'ShowAlignments', 'TestAutoPtr', 'TestAutoRef', @@ -73,7 +73,7 @@ CppUnitTests([ ]) if CONFIG['MOZ_MEMORY']: - CppUnitTests([ + GeckoCppUnitTests([ 'TestJemalloc', ]) @@ -105,7 +105,7 @@ 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 - CppUnitTests([ + GeckoCppUnitTests([ 'TestDeadlockDetector', 'TestDeadlockDetectorScalability', ]) @@ -123,13 +123,6 @@ RESOURCE_FILES += [ 'test.properties', ] -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] - if CONFIG['MOZ_DMD']: USE_LIBS += [ 'dmd' diff --git a/xpcom/tests/windows/moz.build b/xpcom/tests/windows/moz.build index 0f06c8f8d1c..8c90d8508be 100644 --- a/xpcom/tests/windows/moz.build +++ b/xpcom/tests/windows/moz.build @@ -4,18 +4,11 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -CppUnitTests([ +GeckoCppUnitTests([ 'TestCOM', 'TestNtPathToDosPath', ]) -USE_LIBS += [ - 'mozalloc', - 'nspr', - 'xpcomglue_s', - 'xul', -] - OS_LIBS += [ 'rpcrt4', 'uuid', diff --git a/xpcom/typelib/xpt/tests/Makefile.in b/xpcom/typelib/xpt/tests/Makefile.in deleted file mode 100644 index eda9f2ad791..00000000000 --- a/xpcom/typelib/xpt/tests/Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -MOZ_GLUE_LDFLAGS = -MOZ_GLUE_PROGRAM_LDFLAGS = diff --git a/xulrunner/app/moz.build b/xulrunner/app/moz.build index 798be4d8216..93f76530a6c 100644 --- a/xulrunner/app/moz.build +++ b/xulrunner/app/moz.build @@ -6,14 +6,13 @@ DIRS += ['profile'] -Program('xulrunner') +GeckoProgram('xulrunner') SOURCES += [ 'nsXULRunnerApp.cpp', ] DEFINES['XULRUNNER_PROGNAME'] = '"xulrunner"' -DEFINES['XPCOM_GLUE'] = True if CONFIG['DEBUG']: DEFINES['DEBUG'] = True @@ -53,8 +52,4 @@ if CONFIG['OS_ARCH'] == 'WINNT': 'winspool', ] -USE_LIBS += [ - 'xpcomglue', -] - DISABLE_STL_WRAPPING = True diff --git a/xulrunner/stub/Makefile.in b/xulrunner/stub/Makefile.in index 2d940898aa5..0fa0cccf61e 100644 --- a/xulrunner/stub/Makefile.in +++ b/xulrunner/stub/Makefile.in @@ -2,9 +2,6 @@ # 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/. -# Don't create a dependency on mozglue -MOZ_GLUE_LDFLAGS = - ifndef MOZ_WINCONSOLE ifdef MOZ_DEBUG MOZ_WINCONSOLE = 1 diff --git a/xulrunner/stub/moz.build b/xulrunner/stub/moz.build index 1110c6d0b5f..7a10d250cc4 100644 --- a/xulrunner/stub/moz.build +++ b/xulrunner/stub/moz.build @@ -8,7 +8,10 @@ # 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']) + +# We don't want to create a dependency on mozglue. +# Statically link against the RTL on windows +GeckoProgram(CONFIG['XULRUNNER_STUB_NAME'], mozglue=None, msvcrt='static') SOURCES += [ 'nsXULStub.cpp', @@ -24,10 +27,6 @@ LOCAL_INCLUDES += [ '/xpcom/build', ] - -# Statically link against the RTL on windows -USE_STATIC_LIBS = True - if CONFIG['OS_ARCH'] == 'WINNT': LOCAL_INCLUDES += ['/toolkit/xre'] @@ -39,16 +38,9 @@ if CONFIG['OS_ARCH'] == 'WINNT': RCINCLUDE = 'xulrunner-stub.rc' if CONFIG['OS_ARCH'] == 'WINNT': - USE_LIBS += [ - 'xpcomglue_staticruntime', - ] OS_LIBS += [ 'shell32', ] -else: - USE_LIBS += [ - 'xpcomglue', - ] DISABLE_STL_WRAPPING = True diff --git a/xulrunner/tools/redit/moz.build b/xulrunner/tools/redit/moz.build index 2d83032f1a9..812a56578ee 100644 --- a/xulrunner/tools/redit/moz.build +++ b/xulrunner/tools/redit/moz.build @@ -5,15 +5,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['OS_ARCH'] == 'WINNT': - Program('redit') + GeckoProgram('redit') SOURCES += [ 'redit.cpp', ] - for var in ('WIN32_LEAN_AND_MEAN', 'UNICODE', '_UNICODE', 'XPCOM_GLUE'): + for var in ('WIN32_LEAN_AND_MEAN', 'UNICODE', '_UNICODE'): DEFINES[var] = True if CONFIG['GNU_CC']: WIN32_EXE_LDFLAGS += ['-municode'] - - USE_LIBS += [ - 'xpcomglue', - ]