Port |Bug 874266 - Move all DEFINES that can be moved to moz.build| to c-c draft
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sun, 17 Aug 2014 18:12:18 +0100
changeset 25582 9f68c5444b1241c4a5e0fe75a13f3cf3290c8d84
parent 25581 3cb035991d194ff26308a951e7f5ed4c8797c163
child 25583 e3d4246d40f0d2e42809c2e00f09e2215082d503
push id1654
push useriann_cvs@blueyonder.co.uk
push dateSun, 17 Aug 2014 17:13:07 +0000
treeherdertry-comm-central@e3d4246d40f0 [default view] [failures only]
bugs874266
Port |Bug 874266 - Move all DEFINES that can be moved to moz.build| to c-c
im/app/Makefile.in
im/app/moz.build
im/app/profile/Makefile.in
im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/moz.build
im/app/profile/moz.build
im/branding/halloween/locales/Makefile.in
im/branding/halloween/locales/moz.build
im/branding/nightly/locales/Makefile.in
im/branding/nightly/locales/moz.build
im/content/Makefile.in
im/content/moz.build
im/locales/Makefile.in
im/locales/moz.build
mail/app/Makefile.in
mail/app/moz.build
mail/base/Makefile.in
mail/base/moz.build
mail/branding/aurora/locales/Makefile.in
mail/branding/aurora/locales/moz.build
mail/branding/nightly/locales/Makefile.in
mail/branding/nightly/locales/moz.build
mail/components/preferences/Makefile.in
mail/components/preferences/moz.build
mail/components/shell/Makefile.in
mail/components/shell/moz.build
mail/locales/Makefile.in
mail/locales/moz.build
mailnews/mapi/mapiDll/Makefile.in
mailnews/mapi/mapiDll/moz.build
mailnews/mapi/mapihook/build/Makefile.in
mailnews/mapi/mapihook/build/moz.build
mailnews/mapi/mapihook/src/Makefile.in
mailnews/mapi/mapihook/src/moz.build
other-licenses/branding/instantbird/locales/Makefile.in
other-licenses/branding/instantbird/locales/moz.build
suite/app/Makefile.in
suite/app/moz.build
suite/browser/Makefile.in
suite/browser/moz.build
suite/common/Makefile.in
suite/common/moz.build
suite/locales/Makefile.in
suite/locales/moz.build
suite/themes/classic/Makefile.in
suite/themes/classic/moz.build
suite/themes/modern/Makefile.in
suite/themes/modern/moz.build
--- a/im/app/Makefile.in
+++ b/im/app/Makefile.in
@@ -21,42 +21,35 @@ ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"
 endif
 
 SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 ifdef SOURCE_REPO
 DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
 endif
 
-ifdef MOZILLA_OFFICIAL
-DEFINES += -DMOZILLA_OFFICIAL
-endif
-
 PREF_JS_EXPORTS = \
     $(srcdir)/profile/all-instantbird.js \
     $(srcdir)/profile/channel-prefs.js \
     $(NULL)
 
 DEFINES += \
   -DAB_CD=$(AB_CD) \
-  -DAPP_VERSION="$(MOZ_APP_VERSION)" \
   -DINSTANTBIRD_ICO=\"$(DIST)/branding/instantbird.ico\" \
   -DGRE_MILESTONE=$(GRE_MILESTONE) \
   -DGRE_BUILDID=$(GRE_BUILDID) \
    $(NULL)
 
 ifdef LIBXUL_SDK
 include $(topsrcdir)/config/rules.mk
 else
 # Build a binary bootstrapping with XRE_main
 
 DIST_FILES = application.ini
 
-DEFINES += -DXPCOM_GLUE
-
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
 else
 MOZ_WINCONSOLE = 0
 endif
 endif
 
--- a/im/app/moz.build
+++ b/im/app/moz.build
@@ -36,9 +36,16 @@ if not CONFIG['LIBXUL_SDK']:
     #
     # Set it to 256k.  See bug 127069.
     if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
         LDFLAGS += ['/HEAP:0x40000']
 
     if CONFIG['MOZ_LINKER']:
         OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
+DEFINES['APP_VERSION'] = '"%s"' % CONFIG['MOZ_APP_VERSION']
+
+if CONFIG['MOZILLA_OFFICIAL']:
+    DEFINES['MOZILLA_OFFICIAL'] = True
+
+DEFINES['XPCOM_GLUE'] = True
+
 DISABLE_STL_WRAPPING = True
--- a/im/app/profile/Makefile.in
+++ b/im/app/profile/Makefile.in
@@ -15,12 +15,8 @@ include $(topsrcdir)/config/rules.mk
 FILES := \
 	mimeTypes.rdf \
     localstore.rdf \
 	$(NULL)
 
 libs:: $(FILES)
 	$(SYSINSTALL) $^ $(DIST)/bin/defaults/profile
 	$(SYSINSTALL) $^ $(DIST)/bin/defaults/profile/US
-
-ifneq (,$(filter gtk2 mac cocoa, $(MOZ_WIDGET_TOOLKIT)))
-DEFINES += -DHAVE_SHELL_SERVICE=1
-endif
--- a/im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
+++ b/im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
@@ -6,18 +6,16 @@
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
-DEFINES += -DINSTANTBIRD_VERSION=$(INSTANTBIRD_VERSION)
-
 FILES := \
 	install.rdf \
 	chrome.manifest \
 	preview.png \
 	$(NULL)
 
 install.rdf: install.rdf.in
 	$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $< -o $@)
--- a/im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/moz.build
+++ b/im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/moz.build
@@ -1,4 +1,6 @@
 # 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/.
+
+DEFINES['INSTANTBIRD_VERSION'] = CONFIG['INSTANTBIRD_VERSION']
--- a/im/app/profile/moz.build
+++ b/im/app/profile/moz.build
@@ -1,6 +1,9 @@
 # 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/.
 
 DIRS += ['extensions']
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'mac', 'cocoa'):
+    DEFINES['HAVE_SHELL_SERVICE'] = 1
--- a/im/branding/halloween/locales/Makefile.in
+++ b/im/branding/halloween/locales/Makefile.in
@@ -5,11 +5,11 @@
 DEPTH          = @DEPTH@
 topsrcdir      = @top_srcdir@
 srcdir         = @srcdir@
 VPATH          = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DEFINES += -DAB_CD=$(AB_CD) -DMOZ_DISTRIBUTION_ID_UNQUOTED=$(MOZ_DISTRIBUTION_ID)
+DEFINES += -DAB_CD=$(AB_CD)
 
 include $(topsrcdir)/config/rules.mk
--- a/im/branding/halloween/locales/moz.build
+++ b/im/branding/halloween/locales/moz.build
@@ -1,6 +1,8 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['MOZ_DISTRIBUTION_ID_UNQUOTED'] = CONFIG['MOZ_DISTRIBUTION_ID']
--- a/im/branding/nightly/locales/Makefile.in
+++ b/im/branding/nightly/locales/Makefile.in
@@ -5,11 +5,11 @@
 DEPTH          = @DEPTH@
 topsrcdir      = @top_srcdir@
 srcdir         = @srcdir@
 VPATH          = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DEFINES += -DAB_CD=$(AB_CD) -DMOZ_DISTRIBUTION_ID_UNQUOTED=$(MOZ_DISTRIBUTION_ID)
+DEFINES += -DAB_CD=$(AB_CD)
 
 include $(topsrcdir)/config/rules.mk
--- a/im/branding/nightly/locales/moz.build
+++ b/im/branding/nightly/locales/moz.build
@@ -1,6 +1,8 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['MOZ_DISTRIBUTION_ID_UNQUOTED'] = CONFIG['MOZ_DISTRIBUTION_ID']
deleted file mode 100644
--- a/im/content/Makefile.in
+++ /dev/null
@@ -1,30 +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/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-# defines used for preference window files
-DEFINES += \
-	-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
-	-DMOZ_MACBUNDLE_NAME=$(MOZ_MACBUNDLE_NAME) \
-	$(NULL)
-
-# ifneq (,$(filter windows gtk2 mac cocoa, $(MOZ_WIDGET_TOOLKIT)))
-# DEFINES += -DHAVE_SHELL_SERVICE=1
-# endif
-
-ifdef MOZ_UPDATER
-DEFINES += -DMOZ_UPDATER=1
-endif
-
-abs_srcdir = $(abspath $(srcdir))
-CHROME_DEPS += $(abs_srcdir)/overrides/app-license.html
-DEFINES += -DAPP_LICENSE_BLOCK=$(abs_srcdir)/overrides/app-license.html
--- a/im/content/moz.build
+++ b/im/content/moz.build
@@ -1,6 +1,18 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+# defines used for preference window files
+for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'):
+    DEFINES[var] = CONFIG[var]
+
+#if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'mac', 'cocoa'):
+#    DEFINES['HAVE_SHELL_SERVICE'] = 1
+
+if CONFIG['MOZ_UPDATER']:
+    DEFINES['MOZ_UPDATER'] = 1
+
+DEFINES['APP_LICENSE_BLOCK'] = '%s/overrides/app-license.html' % SRCDIR
--- a/im/locales/Makefile.in
+++ b/im/locales/Makefile.in
@@ -7,18 +7,16 @@ topsrcdir       = @top_srcdir@
 srcdir          = @srcdir@
 VPATH           = @srcdir@
 relativesrcdir  = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-DEFINES += -DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION)
-
 vpath %.xml @srcdir@/en-US/searchplugins
 vpath %.xml $(LOCALE_SRCDIR)/searchplugins
 
 _ABS_SRCDIR := $(abspath $(topsrcdir))
 
 ifndef MOZ_BRANDING_DIRECTORY
 MOZ_BRANDING_DIRECTORY = im/branding/nightly
 endif
--- a/im/locales/moz.build
+++ b/im/locales/moz.build
@@ -1,6 +1,8 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
--- a/mail/app/Makefile.in
+++ b/mail/app/Makefile.in
@@ -19,40 +19,33 @@ ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"
 endif
 
 SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 ifdef SOURCE_REPO
 DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
 endif
 
-ifdef MOZILLA_OFFICIAL
-DEFINES += -DMOZILLA_OFFICIAL
-endif
-
 PREF_JS_EXPORTS = \
     $(srcdir)/profile/all-thunderbird.js \
     $(srcdir)/profile/channel-prefs.js \
     $(NULL)
 
 DEFINES += \
   -DAB_CD=$(AB_CD) \
-  -DAPP_VERSION="$(MOZ_APP_VERSION)" \
   -DTHUNDERBIRD_ICO='"$(DIST)/branding/thunderbird.ico"' \
   -DGRE_MILESTONE=$(GRE_MILESTONE) \
   -DGRE_BUILDID=$(GRE_BUILDID) \
    $(NULL)
 
 ifdef LIBXUL_SDK
 include $(topsrcdir)/config/rules.mk
 else
 # Build a binary bootstrapping with XRE_main
 
-DEFINES += -DXPCOM_GLUE
-
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
 else
 MOZ_WINCONSOLE = 0
 endif
 endif
 
--- a/mail/app/moz.build
+++ b/mail/app/moz.build
@@ -40,9 +40,16 @@ if not CONFIG['LIBXUL_SDK']:
     #
     # Set it to 256k.  See bug 127069.
     if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
         LDFLAGS += ['/HEAP:0x40000']
 
     if CONFIG['MOZ_LINKER']:
         OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
+DEFINES['APP_VERSION'] = '"%s"' % CONFIG['MOZ_APP_VERSION']
+
+if CONFIG['MOZILLA_OFFICIAL']:
+    DEFINES['MOZILLA_OFFICIAL'] = True
+
+DEFINES['XPCOM_GLUE'] = True
+
 DISABLE_STL_WRAPPING = True
--- a/mail/base/Makefile.in
+++ b/mail/base/Makefile.in
@@ -8,35 +8,12 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/mozilla/config/printprereleasesuffix.py \
                       $(MOZ_APP_VERSION))
 
-DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
-           -DPRE_RELEASE_SUFFIX=""
-
-ifdef MOZILLA_OFFICIAL
-DEFINES += -DOFFICIAL_BUILD=1
-endif
-
-ifneq (,$(filter windows gtk2 cocoa, $(MOZ_WIDGET_TOOLKIT)))
-DEFINES += -DHAVE_SHELL_SERVICE=1
-endif
-
-ifdef MOZ_UPDATER
-DEFINES += -DMOZ_UPDATER=1
-endif
-
-ifneq (,$(filter windows cocoa, $(MOZ_WIDGET_TOOLKIT)))
-DEFINES += -DCAN_DRAW_IN_TITLEBAR=1
-endif
-
-abs_srcdir = $(abspath $(srcdir))
-
-CHROME_DEPS += $(abs_srcdir)/content/overrides/app-license.html
-
-DEFINES += -DAPP_LICENSE_BLOCK=$(abs_srcdir)/content/overrides/app-license.html
+DEFINES += -DPRE_RELEASE_SUFFIX=""
 
 include $(topsrcdir)/config/rules.mk
 
--- a/mail/base/moz.build
+++ b/mail/base/moz.build
@@ -3,8 +3,23 @@
 # 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 += ['modules']
 
 TEST_DIRS += ['test']
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
+DEFINES['APP_LICENSE_BLOCK'] = '%s/content/overrides/app-license.html' % SRCDIR
+
+if CONFIG['MOZILLA_OFFICIAL']:
+    DEFINES['OFFICIAL_BUILD'] = 1
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'cocoa'):
+    DEFINES['HAVE_SHELL_SERVICE'] = 1
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
+    DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
+
+if CONFIG['MOZ_UPDATER']:
+    DEFINES['MOZ_UPDATER'] = 1
--- a/mail/branding/aurora/locales/Makefile.in
+++ b/mail/branding/aurora/locales/Makefile.in
@@ -5,11 +5,11 @@
 DEPTH          = @DEPTH@
 topsrcdir      = @top_srcdir@
 srcdir         = @srcdir@
 VPATH          = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DEFINES += -DAB_CD=$(AB_CD) -DMOZ_DISTRIBUTION_ID_UNQUOTED=$(MOZ_DISTRIBUTION_ID)
+DEFINES += -DAB_CD=$(AB_CD)
 
 include $(topsrcdir)/config/rules.mk
--- a/mail/branding/aurora/locales/moz.build
+++ b/mail/branding/aurora/locales/moz.build
@@ -1,6 +1,8 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['MOZ_DISTRIBUTION_ID_UNQUOTED'] = CONFIG['MOZ_DISTRIBUTION_ID']
--- a/mail/branding/nightly/locales/Makefile.in
+++ b/mail/branding/nightly/locales/Makefile.in
@@ -5,11 +5,11 @@
 DEPTH          = @DEPTH@
 topsrcdir      = @top_srcdir@
 srcdir         = @srcdir@
 VPATH          = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DEFINES += -DAB_CD=$(AB_CD) -DMOZ_DISTRIBUTION_ID_UNQUOTED=$(MOZ_DISTRIBUTION_ID)
+DEFINES += -DAB_CD=$(AB_CD)
 
 include $(topsrcdir)/config/rules.mk
--- a/mail/branding/nightly/locales/moz.build
+++ b/mail/branding/nightly/locales/moz.build
@@ -1,6 +1,8 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['MOZ_DISTRIBUTION_ID_UNQUOTED'] = CONFIG['MOZ_DISTRIBUTION_ID']
deleted file mode 100644
--- a/mail/components/preferences/Makefile.in
+++ /dev/null
@@ -1,23 +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/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-DEFINES += -DMOZ_MACBUNDLE_NAME=$(MOZ_MACBUNDLE_NAME)
-
-ifneq (,$(filter windows gtk2 cocoa, $(MOZ_WIDGET_TOOLKIT)))
-DEFINES += -DHAVE_SHELL_SERVICE=1
-endif
-
-ifdef MOZ_UPDATER
-DEFINES += -DMOZ_UPDATER=1
-endif
--- a/mail/components/preferences/moz.build
+++ b/mail/components/preferences/moz.build
@@ -1,6 +1,14 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['MOZ_MACBUNDLE_NAME'] = CONFIG['MOZ_MACBUNDLE_NAME']
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'cocoa'):
+    DEFINES['HAVE_SHELL_SERVICE'] = 1
+
+if CONFIG['MOZ_UPDATER']:
+    DEFINES['MOZ_UPDATER'] = 1
deleted file mode 100644
--- a/mail/components/shell/Makefile.in
+++ /dev/null
@@ -1,14 +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/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-DEFINES += -DMOZ_APP_NAME=\"$(MOZ_APP_NAME)\"
-
-include $(topsrcdir)/config/rules.mk
--- a/mail/components/shell/moz.build
+++ b/mail/components/shell/moz.build
@@ -4,16 +4,18 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += ['public']
 
 SOURCES += [
     'DirectoryProvider.cpp',
 ]
 
+DEFINES['MOZ_APP_NAME'] = '"%s"' % CONFIG['MOZ_APP_NAME']
+
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += ['nsMailWinIntegration.cpp']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
     SOURCES += ['nsMailGNOMEIntegration.cpp']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     SOURCES += ['nsMailMacIntegration.cpp']
--- a/mail/locales/Makefile.in
+++ b/mail/locales/Makefile.in
@@ -7,18 +7,16 @@ topsrcdir       = @top_srcdir@
 srcdir          = @srcdir@
 VPATH           = @srcdir@
 relativesrcdir  = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-DEFINES += -DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION)
-
 vpath %.xml @srcdir@/en-US/searchplugins
 vpath %.xml $(LOCALE_SRCDIR)/searchplugins
 
 _ABS_SRCDIR := $(abspath $(topsrcdir))
 
 SUBMAKEFILES += \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
--- a/mail/locales/moz.build
+++ b/mail/locales/moz.build
@@ -1,6 +1,8 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
--- a/mailnews/mapi/mapiDll/Makefile.in
+++ b/mailnews/mapi/mapiDll/Makefile.in
@@ -16,10 +16,8 @@ USE_STATIC_LIBS = 1
 
 ifndef MOZ_INCOMPLETE_EXTERNAL_LINKAGE
 MOZILLA_INTERNAL_API = 1
 endif
 
 EMBED_MANIFEST_AT = 2
 
 include $(topsrcdir)/config/rules.mk
-
-DEFINES	+= -DUNICODE -D_UNICODE
--- a/mailnews/mapi/mapiDll/moz.build
+++ b/mailnews/mapi/mapiDll/moz.build
@@ -9,9 +9,13 @@ SOURCES += [
     'MapiDll.cpp',
 ]
 
 FORCE_SHARED_LIB = True
 
 OS_LIBS += [
     'ole32',
 ]
+
+DEFINES['UNICODE'] = True
+DEFINES['_UNICODE'] = True
+
 DEFFILE	= SRCDIR + '/Mapi32.def'
--- a/mailnews/mapi/mapihook/build/Makefile.in
+++ b/mailnews/mapi/mapihook/build/Makefile.in
@@ -30,18 +30,16 @@ EMBED_MANIFEST_AT = 2
 CSRCS += \
   dlldata.c \
   msgMapi_i.c \
   msgMapi_p.c \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
-DEFINES += -DREGISTER_PROXY_DLL -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x400
-
 $(MIDL_GENERATED_FILES): done_gen
 
 done_gen: msgMapi.idl
 	$(RM) $(SRCDIR_CSRCS)
 	$(MIDL) $(MIDL_FLAGS) $(UNICODE_FLAGS) $(srcdir)/msgMapi.idl
 	touch $@
 
 export:: done_gen
--- a/mailnews/mapi/mapihook/build/moz.build
+++ b/mailnews/mapi/mapihook/build/moz.build
@@ -5,9 +5,15 @@
 
 LIBRARY_NAME = 'MapiProxy'
 
 FORCE_SHARED_LIB = True
 
 OS_LIBS += [
     'rpcrt4',
 ]
+
+for var in ('REGISTER_PROXY_DLL', 'UNICODE', '_UNICODE'):
+    DEFINES[var] = True
+
+DEFINES['_WIN32_WINNT'] = '0x400'
+
 DEFFILE = SRCDIR + '/MapiProxy.def'
--- a/mailnews/mapi/mapihook/src/Makefile.in
+++ b/mailnews/mapi/mapihook/src/Makefile.in
@@ -8,10 +8,8 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 CSRCS += ../build/msgMapi_i.c
 
 include $(topsrcdir)/config/rules.mk
-
-DEFINES	+= -DUNICODE -D_UNICODE
--- a/mailnews/mapi/mapihook/src/moz.build
+++ b/mailnews/mapi/mapihook/src/moz.build
@@ -17,8 +17,11 @@ SOURCES += [
 if CONFIG['MOZ_INCOMPLETE_EXTERNAL_LINKAGE']:
     IS_COMPONENT = True
 else:
     FINAL_LIBRARY = 'xul'
 
 OS_LIBS += [
     'ole32',
 ]
+
+DEFINES['UNICODE'] = True
+DEFINES['_UNICODE'] = True
--- a/other-licenses/branding/instantbird/locales/Makefile.in
+++ b/other-licenses/branding/instantbird/locales/Makefile.in
@@ -5,11 +5,11 @@
 DEPTH          = @DEPTH@
 topsrcdir      = @top_srcdir@
 srcdir         = @srcdir@
 VPATH          = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DEFINES += -DAB_CD=$(AB_CD) -DMOZ_DISTRIBUTION_ID_UNQUOTED=$(MOZ_DISTRIBUTION_ID)
+DEFINES += -DAB_CD=$(AB_CD)
 
 include $(topsrcdir)/config/rules.mk
--- a/other-licenses/branding/instantbird/locales/moz.build
+++ b/other-licenses/branding/instantbird/locales/moz.build
@@ -1,6 +1,8 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['MOZ_DISTRIBUTION_ID_UNQUOTED'] = CONFIG['MOZ_DISTRIBUTION_ID']
--- a/suite/app/Makefile.in
+++ b/suite/app/Makefile.in
@@ -9,27 +9,23 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 AB_CD = $(MOZ_UI_LOCALE) 
 
 DEFINES += \
 	-DSEAMONKEY_ICO=\"$(DIST)/branding/seamonkey.ico\" \
 	-DHTML_FILE_ICO=\"$(DIST)/branding/html-file.ico\" \
-	-DAPP_VERSION="$(MOZ_APP_VERSION)" \
-	-DNO_BLOCKLIST_CRASHREPORTER \
 	$(NULL)
 
 ifdef LIBXUL_SDK
 include $(topsrcdir)/config/rules.mk
 else
 # Build a binary bootstrapping with XRE_main
 
-DEFINES += -DXPCOM_GLUE
-
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
 else
 MOZ_WINCONSOLE = 0
 endif
 endif
 
--- a/suite/app/moz.build
+++ b/suite/app/moz.build
@@ -35,9 +35,15 @@ if not CONFIG['LIBXUL_SDK']:
     #
     # Set it to 256k.  See bug 127069.
     if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
         LDFLAGS += ['/HEAP:0x40000']
 
     if CONFIG['MOZ_LINKER']:
         OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
+DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
+
+DEFINES['NO_BLOCKLIST_CRASHREPORTER'] = True
+
+DEFINES['XPCOM_GLUE'] = True
+
 DISABLE_STL_WRAPPING = True
--- a/suite/browser/Makefile.in
+++ b/suite/browser/Makefile.in
@@ -15,24 +15,15 @@ PREF_JS_EXPORTS = \
 	$(NULL)
 
 ifdef LIBXUL_SDK
 PREF_JS_EXPORTS += \
 	$(srcdir)/channel-prefs.js
 	$(NULL)
 endif
 
-DEFINES += -DMOZ_APP_NAME="$(MOZ_APP_NAME)" \
-           -DMOZ_APP_DISPLAYNAME="$(MOZ_APP_DISPLAYNAME)" \
-           -DMOZ_APP_VERSION="$(MOZ_APP_VERSION)" \
-           $(NULL)
-
-ifdef MOZILLA_OFFICIAL
-DEFINES += -DOFFICIAL_BUILD=1
-endif
-
 include $(topsrcdir)/config/rules.mk
 
 ifndef LIBXUL_SDK
 # channel-prefs.js is handled separate from other prefs due to bug 756325.
 libs:: $(srcdir)/channel-prefs.js
 	$(call py_action,preprocessor,$(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)
 endif
--- a/suite/browser/moz.build
+++ b/suite/browser/moz.build
@@ -7,8 +7,14 @@ TEST_DIRS += ['test']
 
 EXTRA_COMPONENTS += [
     'nsBrowserContentHandler.js',
     'nsTypeAheadFind.js',
     'SuiteBrowser.manifest',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
+
+for var in ('MOZ_APP_NAME', 'MOZ_APP_DISPLAYNAME', 'MOZ_APP_VERSION'):
+    DEFINES[var] = '"%s"' % CONFIG[var]
+
+if CONFIG['MOZILLA_OFFICIAL']:
+    DEFINES['OFFICIAL_BUILD'] = 1
deleted file mode 100644
--- a/suite/common/Makefile.in
+++ /dev/null
@@ -1,24 +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/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-abs_srcdir = $(abspath $(srcdir))
-
-# DEFINES for preprocessing
-# Use suite/common/app-license.html as input when generating 
-# chrome://content/communicator/license.html to override 
-# chrome://global/content/license.html (about:license)
-DEFINES += -DAPP_LICENSE_BLOCK=$(abs_srcdir)/app-license.html \
-           -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
-           -DMOZ_MACBUNDLE_NAME=$(MOZ_MACBUNDLE_NAME) \
-           $(NULL)
-
--- a/suite/common/moz.build
+++ b/suite/common/moz.build
@@ -11,8 +11,17 @@ DIRS += [
 TEST_DIRS += [
     'tests',
     'dataman/tests',
     'downloads/tests',
     'places/tests',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
+
+# DEFINES for preprocessing
+# Use suite/common/app-license.html as input when generating 
+# chrome://content/communicator/license.html to override 
+# chrome://global/content/license.html (about:license)
+DEFINES['APP_LICENSE_BLOCK'] = '%s/app-license.html' % SRCDIR
+
+for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'):
+    DEFINES[var] = CONFIG[var]
--- a/suite/locales/Makefile.in
+++ b/suite/locales/Makefile.in
@@ -7,18 +7,16 @@ topsrcdir      = @top_srcdir@
 srcdir         = @srcdir@
 VPATH          = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-DEFINES += -DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION)
-
 _ABS_SRCDIR := $(abspath $(topsrcdir))
 
 vpath %.xml @srcdir@/en-US/searchplugins
 vpath %.xml $(LOCALE_SRCDIR)/searchplugins
 
 SUBMAKEFILES += \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
 	$(NULL)
--- a/suite/locales/moz.build
+++ b/suite/locales/moz.build
@@ -1,6 +1,8 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
--- a/suite/themes/classic/Makefile.in
+++ b/suite/themes/classic/Makefile.in
@@ -8,19 +8,17 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/rules.mk
 
 CLASSIC_EXTENSION_DIR = {972ce4c6-7e08-4474-a285-3208198ce6fd}
 
-DEFINES += -DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION)
-
 FILES = \
 	$(srcdir)/chrome.manifest \
 	$(srcdir)/icon.png \
 	$(srcdir)/preview.png \
 	$(NULL)
 
 libs::
-	$(INSTALL) $(FILES) $(DIST)/bin/extensions/$(CLASSIC_EXTENSION_DIR)
+	$(INSTALL) $(FILES) $(DIST)/bin/extensions/$(CLASSIC_EXTENSION_DIR)
 	$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $(srcdir)/install.rdf -o $(DIST)/bin/extensions/$(CLASSIC_EXTENSION_DIR)/install.rdf)
--- a/suite/themes/classic/moz.build
+++ b/suite/themes/classic/moz.build
@@ -1,6 +1,8 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['SEAMONKEY_VERSION'] = CONFIG['SEAMONKEY_VERSION']
--- a/suite/themes/modern/Makefile.in
+++ b/suite/themes/modern/Makefile.in
@@ -7,18 +7,16 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 USE_EXTENSION_MANIFEST = 1
 
 include $(topsrcdir)/config/config.mk
 
-DEFINES += -DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION)
-
 DIST_FILES = \
 	install.rdf \
 	$(NULL)
 
 FILES = \
 	$(srcdir)/preview.png \
 	$(srcdir)/icon.png \
 	$(NULL)
--- a/suite/themes/modern/moz.build
+++ b/suite/themes/modern/moz.build
@@ -1,8 +1,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/.
 
 DIST_SUBDIR = 'extensions/modern@themes.mozilla.org'
 
 JAR_MANIFESTS += ['jar.mn']
+
+DEFINES['SEAMONKEY_VERSION'] = CONFIG['SEAMONKEY_VERSION']