imported patch mozbuild-defines-conditional
authorJoshua Cranmer <Pidgeot18@gmail.com>
Sun, 26 May 2013 18:48:09 -0500
changeset 17803 45dd3cb96b98418f303f0c89b8f39d547d391645
parent 17802 71b3e6397e98c7be2ae5938789218816f73fc07e
child 17804 1319fe7a87ae3bf22715c4b72936d9073d6a4020
push id778
push userPidgeot18@gmail.com
push dateMon, 27 May 2013 01:27:57 +0000
treeherdertry-comm-central@6f1896b14429 [default view] [failures only]
imported patch mozbuild-defines-conditional
calendar/installer/Makefile.in
calendar/installer/windows/Makefile.in
calendar/libical/src/libical/Makefile.in
calendar/libical/src/libical/moz.build
calendar/lightning/Makefile.in
calendar/lightning/moz.build
calendar/locales/Makefile.in
calendar/locales/moz.build
calendar/resources/Makefile.in
calendar/sunbird/app/Makefile.in
calendar/sunbird/app/moz.build
calendar/sunbird/base/Makefile.in
ldap/xpcom/src/Makefile.in
ldap/xpcom/src/moz.build
mailnews/addrbook/src/Makefile.in
mailnews/addrbook/src/moz.build
mailnews/base/src/Makefile.in
mailnews/base/src/moz.build
mailnews/base/util/Makefile.in
mailnews/base/util/moz.build
mailnews/build/Makefile.in
mailnews/build/moz.build
mailnews/compose/src/Makefile.in
mailnews/local/public/Makefile.in
mailnews/local/public/moz.build
mailnews/local/src/Makefile.in
mailnews/local/src/moz.build
mailnews/mime/src/Makefile.in
mailnews/mime/src/moz.build
--- a/calendar/installer/Makefile.in
+++ b/calendar/installer/Makefile.in
@@ -41,20 +41,16 @@ endif
 
 MOZ_NONLOCALIZED_PKG_LIST = \
     xpcom \
     calendar \
     $(NULL)
 
 MOZ_LOCALIZED_PKG_LIST = $(AB_CD)
 
-ifdef MOZ_UPDATER
-DEFINES += -DMOZ_UPDATER=1
-endif
-
 ifdef MOZ_PKG_MANIFEST_P
 MOZ_PKG_MANIFEST = packages-static
 
 $(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) $(GLOBAL_DEPS)
 	$(PYTHON) $(MOZILLA_SRCDIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $< > $@
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
--- a/calendar/installer/windows/Makefile.in
+++ b/calendar/installer/windows/Makefile.in
@@ -9,20 +9,16 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk
 
 CONFIG_DIR = instgen
 SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/sunbird/7zSD.sfx
 
-ifdef MOZ_UPDATER
-DEFINES += -DMOZ_UPDATER=1
-endif
-
 PP_LOCALIZED_FILES = \
 	packages-static \
 	$(NULL)
 
 INSTALLER_FILES = \
 	app.tag \
 	nsis/installer.nsi \
 	nsis/uninstaller.nsi \
--- a/calendar/libical/src/libical/Makefile.in
+++ b/calendar/libical/src/libical/Makefile.in
@@ -44,20 +44,16 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME     = mozical
 MODULE_NAME      = mozIcalModule
 FORCE_STATIC_LIB = 1
 FORCE_USE_PIC    = 1 # Force use of PIC
 USE_STATIC_LIBS  = 1
 
-ifneq (,$(filter BeOS Darwin OpenVMS NetBSD FreeBSD,$(OS_ARCH)))
-DEFINES	+= -D__USE_BSD=1
-endif
-
 LOCAL_INCLUDES = -I$(srcdir)/../.. -I$(srcdir) -I.
 
 SRCS_IN_OBJDIR	= 1
 
 include $(topsrcdir)/config/rules.mk
 
 ######################################################################
 #
--- a/calendar/libical/src/libical/moz.build
+++ b/calendar/libical/src/libical/moz.build
@@ -37,8 +37,10 @@ CSRCS += [
     'sspm.c',
     'vsnprintf.c',
 ]
 
 DEFINES += [
     '-DHAVE_CONFIG_H',
 ]
 
+if CONFIG['OS_ARCH'] in ('BeOS', 'Darwin', 'OpenVMS', 'NetBSD', 'FreeBSD'):
+    DEFINES += ['-D__USE_BSD=1']
--- a/calendar/lightning/Makefile.in
+++ b/calendar/lightning/Makefile.in
@@ -42,48 +42,28 @@ SEAMONKEY_MAXVERSION := $(SEAMONKEY_VERS
 ifneq (a,$(findstring a,$(SEAMONKEY_VERSION)))
 SEAMONKEY_MAXVERSION := $(shell echo $(SEAMONKEY_VERSION) | sed "s|\(^[0-9]*.[0-9]*\).*|\1|" ).*
 endif
 
 ifneq (,$(findstring a,$(LIGHTNING_VERSION)))
 DEFINES += -DLIGHTNING_PRERELEASE_VERSION=1
 endif
 
-# Enable nightly updates on aurora and nightly channel
-ifeq (nightly,$(subst aurora,nightly,$(MOZ_UPDATE_CHANNEL)))
-DEFINES += -DLIGHTNING_UPDATE_LOCATION=https://calendar.mozilla.org/update.php
-endif
-
 # Gecko milestone
 GRE_MILESTONE = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
-ifdef GRE_MILESTONE
-DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE)
-endif
 
 # comm-central source repo and stamp
 SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
-ifdef SOURCE_STAMP
-DEFINES += -DSOURCE_STAMP="$(SOURCE_STAMP)"
-endif
 
 SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
-ifdef SOURCE_REPO
-DEFINES += -DSOURCE_REPO="$(SOURCE_REPO)"
-endif
 
 # Mozilla source repo and stamps
 MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(MOZILLA_SRCDIR) parent --template="{node|short}\n" 2>/dev/null))
-ifdef MOZ_SOURCE_STAMP
-DEFINES += -DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"
-endif
 
 MOZ_SOURCE_REPO := $(shell hg -R $(MOZILLA_SRCDIR) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
-ifdef MOZ_SOURCE_REPO
-DEFINES += -DMOZ_SOURCE_REPO="$(MOZ_SOURCE_REPO)"
-endif
 
 # include config.mk here so myconfig or app-config can set DISABLE_LIGHTNING_INSTALL
 include $(topsrcdir)/config/config.mk
 
 # installing lightning in a thunderbird build causes problems on tinderboxes
 # (see bug 406441 and bug 440017), so we need to provide a hook for the
 # tinderboxen to disable that.
 ifndef DISABLE_LIGHTNING_INSTALL
--- a/calendar/lightning/moz.build
+++ b/calendar/lightning/moz.build
@@ -16,18 +16,26 @@ DIRS += [
 
 TEST_DIRS += ['../test']
 
 MODULE = 'lightning'
 
 DEFINES += [
     '-DAB_CD=$(AB_CD)',
     '-DGRE_BUILDID=$(GRE_BUILDID)',
+    '-DGRE_MILESTONE=$(GRE_MILESTONE)',
     '-DLIGHTNING_VERSION=$(LIGHTNING_VERSION)',
+    '-DMOZ_SOURCE_REPO="$(MOZ_SOURCE_REPO)"',
+    '-DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"',
     '-DSEAMONKEY_MAXVERSION=$(SEAMONKEY_MAXVERSION)',
     '-DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION)',
+    '-DSOURCE_REPO="$(SOURCE_REPO)"',
+    '-DSOURCE_STAMP="$(SOURCE_STAMP)"',
     '-DTARGET_PLATFORM=$(OS_TARGET)_$(TARGET_XPCOM_ABI)',
     '-DTHEME=$(THEME)',
     '-DTHUNDERBIRD_MAXVERSION=$(THUNDERBIRD_MAXVERSION)',
     '-DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION)',
     '-DXPI_EM_ID=$(XPI_EM_ID)',
 ]
 
+# Enable nightly updates on aurora and nightly channel
+if CONFIG['MOZ_UPDATE_CHANNEL'] in ('aurora', 'nightly'):
+    DEFINES += ['-DLIGHTNING_UPDATE_LOCATION=https://calendar.mozilla.org/update.php']
--- a/calendar/locales/Makefile.in
+++ b/calendar/locales/Makefile.in
@@ -20,21 +20,16 @@ run_for_effects := $(shell if test ! -d 
 
 SUBMAKEFILES += $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile
 
 # This makefile uses variable overrides from the libs-% target to
 # build non-default locales to non-default dist/ locations. Be aware!
 
 AB = $(firstword $(subst -, ,$(AB_CD)))
 
-ifdef MOZ_SUNBIRD
-APP_VERSION = $(SUNBIRD_VERSION)
-DEFINES += -DAPP_VERSION="$(APP_VERSION)"
-endif
-
 # These are defaulted to be compatible with the files the wget-en-US target
 # pulls. You may override them if you provide your own files. You _must_
 # override them when MOZ_PKG_PRETTYNAMES is defined - the defaults will not
 # work in that case.
 ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
 WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
 ifdef MOZ_SUNBIRD
 RETRIEVE_WINDOWS_INSTALLER = 1
--- a/calendar/locales/moz.build
+++ b/calendar/locales/moz.build
@@ -11,8 +11,10 @@ DEFINES += [
     '-DLOCALE_SRCDIR=$(LOCALE_SRCDIR)',
     '-DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION)',
     '-DMOZ_APP_VERSION=$(MOZ_APP_VERSION)',
     '-DMOZ_LANGPACK_EID=langpack-$(AB_CD)@sunbird.mozilla.org',
     '-DPKG_BASENAME="$(PKG_BASENAME)"',
     '-DPKG_INST_BASENAME="$(PKG_INST_BASENAME)"',
 ]
 
+if CONFIG['MOZ_SUNBIRD']:
+    DEFINES += ['-DAPP_VERSION=$(SUNBIRD_VERSION)']
--- a/calendar/resources/Makefile.in
+++ b/calendar/resources/Makefile.in
@@ -15,13 +15,9 @@ EXTRA_COMPONENTS = \
 include $(DEPTH)/config/autoconf.mk
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 THEME = osx
 else
 THEME = windows
 endif
 
-ifdef MOZ_UPDATER
-DEFINES += -DMOZ_UPDATER=1
-endif
-
 include $(topsrcdir)/config/rules.mk
--- a/calendar/sunbird/app/Makefile.in
+++ b/calendar/sunbird/app/Makefile.in
@@ -19,24 +19,18 @@ AB_CD = en-US
 APP_VERSION = $(SUNBIRD_VERSION)
 APP_UA_NAME = $(shell echo $(MOZ_APP_DISPLAYNAME) | sed -e's/[^A-Za-z]//g')
 DIST_FILES = application.ini
 
 GRE_MILESTONE = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
 GRE_BUILDID = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
  
 MOZ_SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
-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
  
 ifndef LIBXUL_SDK
 # Build a binary bootstrapping with XRE_main
 
 CPPSRCS = nsCalendarApp.cpp
 
 LOCAL_INCLUDES += \
   -I$(MOZILLA_SRCDIR)/toolkit/xre \
@@ -113,17 +107,16 @@ endif
 ifndef BUILD_STATIC_LIBS
 
 else
 include $(topsrcdir)/config/static-config.mk
 
 EXTRA_DEPS	+= \
 	$(STATIC_EXTRA_DEPS) \
 	$(NULL)
-DEFINES		+= $(STATIC_DEFINES)
 CPPSRCS		+= $(STATIC_CPPSRCS)
 EXTRA_DSO_LIBS	+= $(STATIC_EXTRA_DSO_LIBS)
 EXTRA_LIBS	+= $(STATIC_EXTRA_LIBS)
 
 # OpenGL is required by (mozilla/)content/canvas: see (mozilla/)layout/build/Makefile.in.
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 OS_LIBS += -framework OpenGL
 endif
@@ -162,22 +155,16 @@ endif
 ifdef DEBUG
 RCFLAGS += -DDEBUG
 endif
 RCFLAGS += -DSUNBIRD_ICO=\"$(DIST)/branding/sunbird.ico\"
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-ifdef MOZILLA_OFFICIAL
-DEFINES += -DMOZILLA_OFFICIAL
-endif
-
-DEFINES += -DSUNBIRD_ICO=\"$(DIST)/branding/sunbird.ico\"
-
 ifdef BUILD_STATIC_LIBS
 include $(topsrcdir)/config/static-rules.mk
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 ifdef BUILD_STATIC_LIBS
 LIBS	+= -framework QuickTime -framework IOKit
 endif
--- a/calendar/sunbird/app/moz.build
+++ b/calendar/sunbird/app/moz.build
@@ -6,16 +6,26 @@
 DIRS += ['profile/extensions']
 
 if not CONFIG['LIBXUL_SDK']:
     if CONFIG['OS_ARCH'] == "OS2" or CONFIG['OS_ARCH'] == "WINNT":
         PROGRAM = CONFIG['MOZ_APP_NAME']
     else
         PROGRAM = CONFIG['MOZ_APP_NAME'] + '-bin'
 
+    if CONFIG['BUILD_STATIC_LIBS']:
+        DEFINES += ['$(STATIC_DEFINES)']
+
+    if CONFIG['MOZILLA_OFFICIAL']:
+        DEFINES += ['-DMOZILLA_OFFICIAL']
+
+    DEFINES += ['-DSUNBIRD_ICO=\"$(DIST)/branding/sunbird.ico\"']
+
 DEFINES += [
     '-DAB_CD=$(AB_CD)',
     '-DAPP_UA_NAME="$(APP_UA_NAME)"',
     '-DAPP_VERSION="$(APP_VERSION)"',
     '-DGRE_BUILDID=$(GRE_BUILDID)',
     '-DGRE_MILESTONE=$(GRE_MILESTONE)',
+    '-DMOZ_SOURCE_STAMP=$(MOZ_SOURCE_STAMP)',
+    '-DMOZ_SOURCE_REPO=$(MOZ_SOURCE_REPO)',
 ]
 
--- a/calendar/sunbird/base/Makefile.in
+++ b/calendar/sunbird/base/Makefile.in
@@ -13,13 +13,9 @@ include $(DEPTH)/config/autoconf.mk
 APP_VERSION = $(shell cat $(srcdir)/../config/version.txt)
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 THEME = osx
 else
 THEME = windows
 endif
 
-ifdef MOZ_UPDATER
-DEFINES += -DMOZ_UPDATER=1
-endif
-
 include $(topsrcdir)/config/rules.mk
--- a/ldap/xpcom/src/Makefile.in
+++ b/ldap/xpcom/src/Makefile.in
@@ -37,23 +37,20 @@ CPPSRCS		= \
 		nsLDAPService.cpp \
 		nsLDAPBERValue.cpp \
 		nsLDAPControl.cpp \
 		nsLDAPBERElement.cpp \
 		nsLDAPModification.cpp \
 		$(NULL)
 
 ifdef MOZ_PREF_EXTENSIONS
-DEFINES += -DMOZ_PREF_EXTENSIONS
-
 CPPSRCS += nsLDAPSyncQuery.cpp
 endif
 
 ifdef MOZ_PSM
-DEFINES		+= -DMOZ_PSM
 CPPSRCS		+= \
 		nsLDAPSecurityGlue.cpp \
 		$(NULL)
 endif
 
 EXTRA_DSO_LDOPTS += $(LDAP_LIBS)
 ifndef MOZ_INCOMPLETE_EXTERNAL_LINKAGE
 EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS)
--- a/ldap/xpcom/src/moz.build
+++ b/ldap/xpcom/src/moz.build
@@ -1,7 +1,13 @@
 # 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/.
 
 MODULE = 'mozldap'
 
+if CONFIG['MOZ_PREF_EXTENSIONS']:
+    DEFINES += ['-DMOZ_PREF_EXTENSIONS']
+
+if CONFIG['MOZ_PSM']:
+    DEFINES += ['-DMOZ_PSM']
+
--- a/mailnews/addrbook/src/Makefile.in
+++ b/mailnews/addrbook/src/Makefile.in
@@ -64,18 +64,16 @@ CPPSRCS		+= \
 		nsMapiAddressBook.cpp \
 		nsWabAddressBook.cpp \
 		$(NULL)
 
 endif
 endif
 
 ifdef MOZ_LDAP_XPCOM
-DEFINES += -DMOZ_LDAP_XPCOM
-
 CPPSRCS		+= \
 		nsAbLDAPDirectory.cpp \
 		nsAbLDAPDirFactory.cpp	\
 		nsAbLDAPCard.cpp \
 		nsAbLDAPListenerBase.cpp \
 		nsAbLDAPDirectoryQuery.cpp \
 		nsAbLDAPDirectoryModify.cpp \
 		nsAbBoolExprToLDAPFilter.cpp \
@@ -85,17 +83,16 @@ CPPSRCS		+= \
 		$(NULL)
 
 ifndef MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE
 CPPSRCS		+= \
 		nsAbLDAPAutoCompFormatter.cpp \
 		nsLDAPAutoCompleteSession.cpp \
 		$(NULL)
 else
-DEFINES += -DMOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE
 EXTRA_COMPONENTS += \
 		nsAbLDAPAutoCompleteSearch.js \
 		$(NULL)
 endif
 
 # XXX These files are not being built as they don't work. Bug 311632 should
 # fix them.
 # nsAbLDAPChangeLogQuery.cpp
--- a/mailnews/addrbook/src/moz.build
+++ b/mailnews/addrbook/src/moz.build
@@ -4,8 +4,14 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'addrbook'
 
 EXPORTS += [
     'nsVCardObj.h',
 ]
 
+if CONFIG['MOZ_LDAP_XPCOM']:
+    DEFINES += ['-DMOZ_LDAP_XPCOM']
+
+    if CONFIG['MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE']:
+        DEFINES += ['-DMOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE']
+
--- a/mailnews/base/src/Makefile.in
+++ b/mailnews/base/src/Makefile.in
@@ -75,32 +75,23 @@ endif
 ifeq ($(OS_ARCH),OS2)
 CPPSRCS		+= nsMessengerOS2Integration.cpp 
 endif
 
 ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),gtk gtk2))
 CPPSRCS		+= nsMessengerUnixIntegration.cpp 
 endif
 
-ifdef MOZ_LDAP_XPCOM
-DEFINES         += -DMOZ_LDAP_XPCOM
-endif
-
 EXTRA_COMPONENTS = \
 		nsMailNewsCommandLineHandler.js \
 		msgAsyncPrompter.js \
 		newMailNotificationService.js \
 		msgBase.manifest \
 		$(NULL)
 
 EXTRA_JS_MODULES = \
 		virtualFolderWrapper.js \
 		$(NULL)
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/rules.mk
-
-ifdef MOZ_MOVEMAIL
-DEFINES	+= -DHAVE_MOVEMAIL
-endif
-
--- a/mailnews/base/src/moz.build
+++ b/mailnews/base/src/moz.build
@@ -6,8 +6,14 @@
 MODULE = 'msgbase'
 
 EXPORTS += [
     'nsMailDirServiceDefs.h',
     'nsMsgRDFDataSource.h',
     'nsMsgRDFUtils.h',
 ]
 
+if CONFIG['MOZ_LDAP_XPCOM']:
+    DEFINES += ['-DMOZ_LDAP_XPCOM']
+
+if CONFIG['MOZ_MOVEMAIL']:
+    DEFINES += ['-DHAVE_MOVEMAIL']
+
--- a/mailnews/base/util/Makefile.in
+++ b/mailnews/base/util/Makefile.in
@@ -52,14 +52,13 @@ EXTRA_JS_MODULES = \
 		hostnameUtils.jsm \
 		JXON.js \
 		$(NULL)
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 ifeq ($(OS_ARCH),WINNT)
-DEFINES		+= -DZLIB_DLL
 OS_CXXFLAGS	+= -DNOMINMAX
 endif
 
 include $(topsrcdir)/config/rules.mk
 
--- a/mailnews/base/util/moz.build
+++ b/mailnews/base/util/moz.build
@@ -28,8 +28,10 @@ EXPORTS.mozilla.mailnews += [
     'ServiceList.h',
     'Services.h',
 ]
 
 DEFINES += [
     '-D_IMPL_NS_MSG_BASE',
 ]
 
+if CONFIG['OS_ARCH'] == 'WINNT':
+    DEFINES += ['-DZLIB_DLL']
--- a/mailnews/build/Makefile.in
+++ b/mailnews/build/Makefile.in
@@ -18,27 +18,16 @@ MOZILLA_INTERNAL_API = 1
 LIBXUL_LIBRARY	= 1
 else
 FORCE_SHARED_LIB = 1
 endif
 FORCE_USE_PIC   = 1
 
 MODULE_NAME	= nsMailModule
 
-ifdef MOZ_LDAP_XPCOM
-DEFINES		+= -DMOZ_LDAP_XPCOM
-ifdef MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE
-DEFINES += -DMOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE
-endif
-endif
-
-ifeq ($(OS_ARCH),WINNT)
-DEFINES		+= -DZLIB_DLL
-endif
-
 CPPSRCS		= nsMailModule.cpp
 
 SHARED_LIBRARY_LIBS = \
 	        ../base/util/$(LIB_PREFIX)msgbsutl_s.$(LIB_SUFFIX) \
 		../base/src/$(LIB_PREFIX)msgbase_s.$(LIB_SUFFIX) \
 		../base/search/src/$(LIB_PREFIX)msgsearch_s.$(LIB_SUFFIX) \
 		../local/src//$(LIB_PREFIX)msglocal_s.$(LIB_SUFFIX) \
 	        ../compose/src/$(LIB_PREFIX)msgcompose_s.$(LIB_SUFFIX) \
@@ -107,11 +96,8 @@ LOCAL_INCLUDES = -I$(srcdir) \
                  $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS	+= $(call EXPAND_LIBNAME,shell32)
 endif
 
-ifdef MOZ_MOVEMAIL
-DEFINES	+= -DHAVE_MOVEMAIL
-endif
--- a/mailnews/build/moz.build
+++ b/mailnews/build/moz.build
@@ -1,7 +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/.
 
 MODULE = 'mail'
 
+if CONFIG['MOZ_LDAP_XPCOM']:
+    DEFINES += ['-DMOZ_LDAP_XPCOM']
+
+    if CONFIG['MOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE']:
+        DEFINES += ['-DMOZ_INCOMPLETE_TOOLKIT_LDAP_AUTOCOMPLETE']
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+    DEFINES += ['-DZLIB_DLL']
+
+if CONFIG['MOZ_MOVEMAIL']:
+    DEFINES += ['-DHAVE_MOVEMAIL']
--- a/mailnews/compose/src/Makefile.in
+++ b/mailnews/compose/src/Makefile.in
@@ -51,14 +51,8 @@ CPPSRCS += \
 	nsMsgAppleEncode.cpp \
 	$(NULL)
 endif
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/rules.mk
-
-ifeq ($(OS_ARCH),WINNT)
-ifdef MOZ_UNICODE
-DEFINES		+= -DMOZ_UNICODE
-endif
-endif
deleted file mode 100644
--- a/mailnews/local/public/Makefile.in
+++ /dev/null
@@ -1,17 +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
-
-ifdef MOZ_MOVEMAIL
-DEFINES	+= -DHAVE_MOVEMAIL
-endif
--- a/mailnews/local/public/moz.build
+++ b/mailnews/local/public/moz.build
@@ -28,8 +28,11 @@ XPIDL_FLAGS += [
 ]
 
 MODULE = 'msglocal'
 
 EXPORTS += [
     'nsMsgLocalCID.h',
 ]
 
+if CONFIG['MOZ_MOVEMAIL']:
+    DEFINES += ['-DHAVE_MOVEMAIL']
+
--- a/mailnews/local/src/Makefile.in
+++ b/mailnews/local/src/Makefile.in
@@ -45,12 +45,8 @@ CPPSRCS		+= \
 		nsMovemailService.cpp \
 		nsMovemailIncomingServer.cpp
 endif
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/rules.mk
-
-ifdef MOZ_MOVEMAIL
-DEFINES	+= -DHAVE_MOVEMAIL
-endif
--- a/mailnews/local/src/moz.build
+++ b/mailnews/local/src/moz.build
@@ -1,7 +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/.
 
 MODULE = 'msglocal'
 
+if CONFIG['MOZ_MOVEMAIL']:
+    DEFINES += ['-DHAVE_MOVEMAIL']
+
--- a/mailnews/mime/src/Makefile.in
+++ b/mailnews/mime/src/Makefile.in
@@ -9,20 +9,16 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 ifdef MOZ_PSM
 BUILD_SMIME=1
 endif
 
-ifdef BUILD_SMIME
-DEFINES		+= -DENABLE_SMIME
-endif
-
 LIBRARY_NAME	= mime_s
 ifndef MOZ_INCOMPLETE_EXTERNAL_LINKAGE
 MOZILLA_INTERNAL_API = 1
 LIBXUL_LIBRARY = 1
 endif
 
 CPPSRCS		= \
 		nsMimeObjectClassAccess.cpp \
--- a/mailnews/mime/src/moz.build
+++ b/mailnews/mime/src/moz.build
@@ -20,8 +20,10 @@ EXPORTS += [
     'mimepbuf.h',
     'mimetext.h',
     'modlmime.h',
     'modmimee.h',
     'nsMimeStringResources.h',
     'nsStreamConverter.h',
 ]
 
+if CONFIG['MOZ_PSM']:
+    DEFINES += ['-DENABLE_SMIME']