Bug 900526, part 4: Migrate FINAL_TARGET and XPI_NAME to moz.build, r=gps
authorJoshua Cranmer <Pidgeot18@gmail.com>
Mon, 21 Oct 2013 13:09:06 -0500
changeset 160228 5452527770cb322cb7f50e8abedccf2eb6c8a4a0
parent 160227 6916000f7b8ce028107d3c078148bfe2c19e008e
child 160229 ec37f434044acfde23203d4a8b267689becc8109
push id4537
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 22:18:47 +0000
treeherdermozilla-aurora@60c6fd67470e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs900526
milestone27.0a1
Bug 900526, part 4: Migrate FINAL_TARGET and XPI_NAME to moz.build, r=gps
dom/indexedDB/test/extensions/Makefile.in
dom/indexedDB/test/extensions/moz.build
dom/workers/test/extensions/bootstrap/Makefile.in
dom/workers/test/extensions/bootstrap/moz.build
dom/workers/test/extensions/traditional/Makefile.in
dom/workers/test/extensions/traditional/moz.build
embedding/tests/winEmbed/Makefile.in
embedding/tests/winEmbed/moz.build
extensions/widgetutils/Makefile.in
extensions/widgetutils/moz.build
extensions/widgetutils/src/Makefile.in
extensions/widgetutils/src/moz.build
ipc/app/Makefile.in
ipc/app/moz.build
testing/mochitest/Makefile.in
testing/mochitest/moz.build
testing/specialpowers/Makefile.in
testing/specialpowers/moz.build
toolkit/crashreporter/google-breakpad/src/client/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build
toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
toolkit/crashreporter/google-breakpad/src/client/mac/handler/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
toolkit/crashreporter/google-breakpad/src/client/moz.build
toolkit/crashreporter/google-breakpad/src/client/solaris/handler/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
tools/quitter/Makefile.in
tools/quitter/moz.build
xulrunner/examples/simple/Makefile.in
xulrunner/examples/simple/components/public/Makefile.in
xulrunner/examples/simple/components/public/moz.build
xulrunner/examples/simple/components/src/Makefile.in
xulrunner/examples/simple/components/src/moz.build
xulrunner/examples/simple/moz.build
xulrunner/stub/Makefile.in
xulrunner/stub/moz.build
--- a/dom/indexedDB/test/extensions/Makefile.in
+++ b/dom/indexedDB/test/extensions/Makefile.in
@@ -1,14 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPI_NAME = indexedDB
-
 DIST_FILES = \
   bootstrap.js \
   install.rdf \
   $(NULL)
 
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
 
 GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
--- a/dom/indexedDB/test/extensions/moz.build
+++ b/dom/indexedDB/test/extensions/moz.build
@@ -1,6 +1,7 @@
 # -*- 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/.
 
+XPI_NAME = 'indexedDB'
--- a/dom/workers/test/extensions/bootstrap/Makefile.in
+++ b/dom/workers/test/extensions/bootstrap/Makefile.in
@@ -1,14 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPI_NAME = workerbootstrap
-
 DIST_FILES = \
   bootstrap.js \
   install.rdf \
   worker.js \
   $(NULL)
 
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
 
--- a/dom/workers/test/extensions/bootstrap/moz.build
+++ b/dom/workers/test/extensions/bootstrap/moz.build
@@ -1,6 +1,7 @@
 # -*- 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/.
 
+XPI_NAME = 'workerbootstrap'
--- a/dom/workers/test/extensions/traditional/Makefile.in
+++ b/dom/workers/test/extensions/traditional/Makefile.in
@@ -1,13 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPI_NAME = worker
 DIST_FILES = \
   install.rdf \
   worker.js \
   $(NULL)
 
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
 
 GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
--- a/dom/workers/test/extensions/traditional/moz.build
+++ b/dom/workers/test/extensions/traditional/moz.build
@@ -9,8 +9,10 @@ XPIDL_SOURCES += [
 ]
 
 XPIDL_MODULE = 'WorkerTest'
 
 EXTRA_COMPONENTS += [
     'WorkerTest.js',
     'WorkerTest.manifest',
 ]
+
+XPI_NAME = 'worker'
--- a/embedding/tests/winEmbed/Makefile.in
+++ b/embedding/tests/winEmbed/Makefile.in
@@ -22,18 +22,16 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 #
 # Contributor(s):
 #
 # ***** END LICENSE BLOCK *****
 
-XPI_NAME	= winembed
-
 RESFILE		= winEmbed.res
 
 LIBS = \
 	$(DEPTH)/profile/dirserviceprovider/standalone/$(LIB_PREFIX)profdirserviceprovidersa_s.$(LIB_SUFFIX) \
 	$(XPCOM_STANDALONE_GLUE_LDOPTS) \
 	$(NULL)
 
 LOCAL_INCLUDES	= -I$(srcdir)
--- a/embedding/tests/winEmbed/moz.build
+++ b/embedding/tests/winEmbed/moz.build
@@ -8,8 +8,10 @@ MODULE = 'winEmbed'
 
 PROGRAM = 'winEmbed'
 
 CPP_SOURCES += [
     'WebBrowserChrome.cpp',
     'WindowCreator.cpp',
     'winEmbed.cpp',
 ]
+
+XPI_NAME = 'winembed'
--- a/extensions/widgetutils/Makefile.in
+++ b/extensions/widgetutils/Makefile.in
@@ -1,15 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
-XPI_NAME = widgetutils
-
 INSTALL_EXTENSION_ID = widgetutils@extensions.mozilla.org
 DIST_FILES = install.rdf
 NO_JAR_AUTO_REG        = 1
 USE_EXTENSION_MANIFEST = 1
 XPI_PKGNAME            = widgetutils-$(MOZ_APP_VERSION)
 
 XULAPP_DEFINES = \
 	-DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
--- a/extensions/widgetutils/moz.build
+++ b/extensions/widgetutils/moz.build
@@ -3,8 +3,9 @@
 # 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/.
 
 DIRS += ['src']
 
 MODULE = 'widgetutils'
 
+XPI_NAME = 'widgetutils'
--- a/extensions/widgetutils/src/Makefile.in
+++ b/extensions/widgetutils/src/Makefile.in
@@ -1,18 +1,13 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # 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/.
 
-XPI_NAME	= widgetutils
 SHORT_LIBNAME = widgetutils
 FORCE_SHARED_LIB = 1
 
 EXTRA_DSO_LDOPTS = \
   $(XPCOM_GLUE_LDOPTS) \
   $(NSPR_LIBS) \
   $(MOZ_COMPONENT_LIBS) \
   $(NULL)
-
-ifdef TARGET_XPCOM_ABI
-FINAL_TARGET=$(DIST)/xpi-stage/$(XPI_NAME)/platform/$(OS_TARGET)_$(TARGET_XPCOM_ABI)
-endif
--- a/extensions/widgetutils/src/moz.build
+++ b/extensions/widgetutils/src/moz.build
@@ -9,8 +9,12 @@ MODULE = 'widgetutils'
 CPP_SOURCES += [
     'nsWidgetUtils.cpp',
 ]
 
 LIBRARY_NAME = 'widgetutils'
 
 IS_COMPONENT = True
 
+XPI_NAME = 'widgetutils'
+
+if CONFIG['TARGET_XPCOM_ABI']:
+    FINAL_TARGET += '/platform/%(OS_TARGET)s_%(TARGET_XPCOM_ABI)s' % CONFIG
--- a/ipc/app/Makefile.in
+++ b/ipc/app/Makefile.in
@@ -34,20 +34,16 @@ endif
 endif
 
 # This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
 # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
 NSDISTMODE = copy
 
 include $(topsrcdir)/config/config.mk
 
-ifeq (android,$(MOZ_WIDGET_TOOLKIT))
-FINAL_TARGET = $(DIST)/bin/lib
-endif
-
 ifdef _MSC_VER
 # Always enter a Windows program through wmain, whether or not we're
 # a console application.
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
 endif
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
--- a/ipc/app/moz.build
+++ b/ipc/app/moz.build
@@ -7,12 +7,13 @@
 MODULE = 'ipc'
 
 PROGRAM = CONFIG['MOZ_CHILD_PROCESS_NAME']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     CPP_SOURCES += [
         'MozillaRuntimeMainAndroid.cpp',
     ]
+    FINAL_TARGET = 'dist/bin/lib'
 else:
     CPP_SOURCES += [
         'MozillaRuntimeMain.cpp',
     ]
--- a/testing/mochitest/Makefile.in
+++ b/testing/mochitest/Makefile.in
@@ -5,18 +5,16 @@
 
 NO_JS_MANIFEST = 1
 MOZ_CHROME_FILE_FORMAT = jar
 DIST_FILES = install.rdf
 
 # Used in install.rdf
 USE_EXTENSION_MANIFEST = 1
 
-XPI_NAME = mochijar
-
 # we turn this off for UNIVERSAL_BINARY
 CHROME_JAR = 1
 
 include $(topsrcdir)/config/rules.mk
 # We're installing to _tests/testing/mochitest, so this is the depth
 # necessary for relative objdir paths.
 TARGET_DEPTH = ../../..
 include $(topsrcdir)/build/automation-build.mk
--- a/testing/mochitest/moz.build
+++ b/testing/mochitest/moz.build
@@ -10,8 +10,10 @@ DIRS += [
     'dynamic',
     'tests',
     'chrome',
     'ssltunnel',
 ]
 
 if CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
     DIRS += ['roboextender']
+
+XPI_NAME = 'mochijar'
--- a/testing/specialpowers/Makefile.in
+++ b/testing/specialpowers/Makefile.in
@@ -4,18 +4,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 NO_JS_MANIFEST = 1
 MOZ_CHROME_FILE_FORMAT = flat
 DIST_FILES = \
   install.rdf \
   $(NULL)
 
-XPI_NAME=specialpowers
-
 # Used in install.rdf
 USE_EXTENSION_MANIFEST=1
 
 TEST_EXTENSIONS_DIR = $(DEPTH)/testing/specialpowers
 
 include $(topsrcdir)/config/rules.mk
 
 libs-preqs = \
--- a/testing/specialpowers/moz.build
+++ b/testing/specialpowers/moz.build
@@ -2,8 +2,10 @@
 # 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/.
 
 EXTRA_COMPONENTS += [
     'components/SpecialPowersObserver.js',
 ]
+
+XPI_NAME = 'specialpowers'
--- a/toolkit/crashreporter/google-breakpad/src/client/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/client/Makefile.in
@@ -1,10 +1,8 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPI_NAME 	= crashreporter
-
 LOCAL_INCLUDES 	= -I$(srcdir)/..
 
 # need static lib
 FORCE_STATIC_LIB = 1
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in
@@ -11,18 +11,16 @@ ifdef MOZ_THUMB2 #{
 # as a clobbered register yet gcc error's.  The generated assembly for
 # sys_clone() looks OK, so we chalk this up to a gcc/gas quirk and
 # work around it by telling gcc that the THUMB frame pointer is a
 # vanilla callee-save register.
 OS_CXXFLAGS += -fomit-frame-pointer
 MOZ_FRAMEPTR_FLAGS := -fomit-frame-pointer
 endif #}
 
-XPI_NAME 	= crashreporter
-
 VPATH += $(srcdir)/../log
 
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src \
   $(NULL)
 
 # need static lib
 FORCE_STATIC_LIB = 1
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build
@@ -9,8 +9,9 @@ MODULE = 'handler'
 CPP_SOURCES += [
     'exception_handler.cc',
     '../log/log.cc',
     'minidump_descriptor.cc',
 ]
 
 LIBRARY_NAME = 'exception_handler_s'
 
+XPI_NAME = 'crashreporter'
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/Makefile.in
@@ -1,14 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPI_NAME 	= crashreporter
-
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src \
   $(NULL)
 
 # need static lib
 FORCE_STATIC_LIB = 1
 
 ifeq ($(OS_TARGET),Android)
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build
@@ -9,8 +9,9 @@ MODULE = 'writer'
 CPP_SOURCES += [
     'linux_dumper.cc',
     'linux_ptrace_dumper.cc',
     'minidump_writer.cc',
 ]
 
 LIBRARY_NAME = 'minidump_writer_s'
 
+XPI_NAME = 'crashreporter'
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Makefile.in
@@ -1,10 +1,8 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPI_NAME 	= crashreporter
-
 LOCAL_INCLUDES 	= -I$(srcdir)/../../..
 
 # need static lib
 FORCE_STATIC_LIB = 1
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
@@ -8,8 +8,9 @@ MODULE = 'crash_generation'
 
 CPP_SOURCES += [
     'crash_generation_client.cc',
     'crash_generation_server.cc',
 ]
 
 LIBRARY_NAME = 'crash_generation_s'
 
+XPI_NAME = 'crashreporter'
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/Makefile.in
@@ -1,10 +1,8 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPI_NAME 	= crashreporter
-
 LOCAL_INCLUDES 	= -I$(srcdir)/../../..
 
 # need static lib
 FORCE_STATIC_LIB = 1
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
@@ -10,8 +10,9 @@ CPP_SOURCES += [
     'breakpad_nlist_64.cc',
     'dynamic_images.cc',
     'exception_handler.cc',
     'minidump_generator.cc',
 ]
 
 LIBRARY_NAME = 'exception_handler_s'
 
+XPI_NAME = 'crashreporter'
--- a/toolkit/crashreporter/google-breakpad/src/client/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/moz.build
@@ -7,8 +7,9 @@
 MODULE = 'minidump_file_writer'
 
 CPP_SOURCES += [
     'minidump_file_writer.cc',
 ]
 
 LIBRARY_NAME = 'minidump_file_writer_s'
 
+XPI_NAME = 'crashreporter'
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/Makefile.in
@@ -1,10 +1,8 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPI_NAME 	= crashreporter
-
 LOCAL_INCLUDES 	= -I$(srcdir)/../../..
 
 # need static lib
 FORCE_STATIC_LIB = 1
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
@@ -9,8 +9,10 @@ MODULE = 'handler'
 CPP_SOURCES += [
     'exception_handler.cc',
     'minidump_generator.cc',
     'solaris_lwp.cc',
 ]
 
 LIBRARY_NAME = 'exception_handler_s'
 
+XPI_NAME = 'crashreporter'
+
--- a/tools/quitter/Makefile.in
+++ b/tools/quitter/Makefile.in
@@ -1,14 +1,13 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPI_NAME = quitter
 XPI_PKGNAME = quitter@mozilla.org
 NO_JS_MANIFEST = 1
 
 DIST_FILES = \
   install.rdf \
   chrome.manifest \
   $(NULL)
 
--- a/tools/quitter/moz.build
+++ b/tools/quitter/moz.build
@@ -2,8 +2,10 @@
 # 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/.
 
 EXTRA_COMPONENTS += [
     'QuitterObserver.js',
 ]
+
+XPI_NAME = 'quitter'
--- a/xulrunner/examples/simple/Makefile.in
+++ b/xulrunner/examples/simple/Makefile.in
@@ -1,15 +1,13 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # 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/.
 
-XPI_NAME	= simple
-
 PREF_JS_EXPORTS	= $(srcdir)/simple-prefs.js
 DIST_FILES	= application.ini
 
 ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
 ICONS		= icons/simple.ico
 endif
 
 include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/xulrunner/examples/simple/components/public/Makefile.in
+++ /dev/null
@@ -1,6 +0,0 @@
-# vim:set ts=8 sw=8 sts=8 noet:
-# 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/.
-
-XPI_NAME	= simple
--- a/xulrunner/examples/simple/components/public/moz.build
+++ b/xulrunner/examples/simple/components/public/moz.build
@@ -5,8 +5,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPIDL_SOURCES += [
     'nsISimpleTest.idl',
 ]
 
 MODULE = 'simple'
 
+XPI_NAME = 'simple'
--- a/xulrunner/examples/simple/components/src/Makefile.in
+++ b/xulrunner/examples/simple/components/src/Makefile.in
@@ -1,12 +1,11 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # 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/.
 
-XPI_NAME	= simple
 SHORT_LIBNAME = simpltst
 
 EXTRA_DSO_LDOPTS = \
 	$(XPCOM_GLUE_LDOPTS) \
 	$(NSPR_LIBS) \
 	$(NULL)
--- a/xulrunner/examples/simple/components/src/moz.build
+++ b/xulrunner/examples/simple/components/src/moz.build
@@ -14,8 +14,9 @@ LIBRARY_NAME = 'simpletest'
 
 EXTRA_COMPONENTS += [
     'SimpleTest.js',
     'SimpleTest.manifest',
 ]
 
 IS_COMPONENT = True
 
+XPI_NAME = 'simple'
--- a/xulrunner/examples/simple/moz.build
+++ b/xulrunner/examples/simple/moz.build
@@ -3,8 +3,9 @@
 # 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/.
 
 DIRS += ['components']
 
 MODULE = 'simple'
 
+XPI_NAME = 'simple'
--- a/xulrunner/stub/Makefile.in
+++ b/xulrunner/stub/Makefile.in
@@ -45,23 +45,13 @@ endif
 endif
 
 include $(topsrcdir)/config/config.mk
 
 ifdef _MSC_VER
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
 endif
 
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-
-FRAMEWORK_NAME = XUL
-FRAMEWORK_VERSION = $(MOZILLA_VERSION)
-
-FINAL_TARGET = \
-   $(DIST)/$(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)
-
-endif
-
 include $(topsrcdir)/config/rules.mk
 
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,shell32)
 endif
--- a/xulrunner/stub/moz.build
+++ b/xulrunner/stub/moz.build
@@ -10,8 +10,11 @@ MODULE = 'xulrunner'
 # apps to override it using the --with-xulrunner-stub-name=<appname> argument.
 # If this configure argument is not present then the default name is 'xulrunner'
 # for Mac OS X and 'xulrunner-stub' for all other platforms.
 PROGRAM = CONFIG['XULRUNNER_STUB_NAME']
 
 CPP_SOURCES += [
     'nsXULStub.cpp',
 ]
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+    FINAL_TARGET = 'dist/XUL.framework/Versions/%(MOZILLA_VERSION)s' % CONFIG