Bug 968623 - Port the DEFINES variable in toolkit/library/Makefile.in to moz.build; r=glandium
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Wed, 05 Feb 2014 23:14:32 -0500
changeset 167144 9b6d7332710c2b929e3d8abb2343992b9ccd8679
parent 167143 9b13a5bd841a07a359e562b8b4813718dd319139
child 167145 97ee8ec34362e77e7f2fa5627eee07380049d02a
push id26159
push usercbook@mozilla.com
push dateThu, 06 Feb 2014 11:50:11 +0000
treeherdermozilla-central@b04e2524e2eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs968623
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 968623 - Port the DEFINES variable in toolkit/library/Makefile.in to moz.build; r=glandium
toolkit/library/Makefile.in
toolkit/library/moz.build
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -61,60 +61,16 @@ EXTRA_DSO_LDOPTS += -Wl,-version-script,
 symverscript: symverscript.in
 	$(call py_action,preprocessor, \
 		-DVERSION='$(LIBRARY_NAME)$(MOZILLA_SYMBOLVERSION)' $< -o $@)
 
 EXTRA_DEPS += symverscript
 endif
 endif
 
-# component libraries
-ifdef MOZ_JSDEBUGGER
-DEFINES += -DMOZ_JSDEBUGGER
-endif
-
-ifdef MOZ_PREF_EXTENSIONS
-DEFINES += -DMOZ_PREF_EXTENSIONS
-endif
-
-ifdef MOZ_AUTH_EXTENSION
-DEFINES += -DMOZ_AUTH_EXTENSION
-endif
-
-ifdef MOZ_PERMISSIONS
-DEFINES += -DMOZ_PERMISSIONS
-endif
-
-ifdef MOZ_UNIVERSALCHARDET
-DEFINES += -DMOZ_UNIVERSALCHARDET
-endif
-
-ifeq (,$(filter android gonk qt os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
-ifdef MOZ_XUL
-DEFINES += -DMOZ_FILEVIEW
-endif
-endif
-
-# Platform-specific icon channel stuff - supported mostly-everywhere
-ifneq (,$(filter windows os2 mac cocoa gtk2 gtk3 qt android,$(MOZ_WIDGET_TOOLKIT)))
-DEFINES += -DICON_DECODER
-endif
-
-ifdef MOZ_SPELLCHECK
-DEFINES += -DMOZ_SPELLCHECK
-endif
-
-ifdef MOZ_ZIPWRITER
-DEFINES += -DMOZ_ZIPWRITER
-endif
-
-ifdef MOZ_GIO_COMPONENT
-DEFINES += -DMOZ_GIO_COMPONENT
-endif
-
 ifdef MOZ_APP_COMPONENT_LIBS
 COMPONENT_LIBS += $(MOZ_APP_COMPONENT_LIBS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 OS_LIBS += -framework OpenGL -lcups
 endif
 
@@ -388,22 +344,16 @@ LOCAL_INCLUDES += \
   $(NULL)
 
 OS_LIBS += $(LIBICONV)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 OS_LIBS += $(call EXPAND_LIBNAME,usp10 oleaut32)
 endif
 
-ifdef MOZ_DEBUG
-ifdef ENABLE_TESTS
-DEFINES += -DENABLE_LAYOUTDEBUG
-endif
-endif
-
 ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_PROFILE_USE))
 # Wrap linker to measure peak virtual memory usage.
 LD := $(PYTHON) $(topsrcdir)/build/link.py $(CURDIR)/linker-vsize $(LD)
 endif
 
 ifndef LINK_GTEST
 ifdef COMPILE_ENVIRONMENT
 libs:: $(FINAL_TARGET)/dependentlibs.list
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -10,13 +10,42 @@ SOURCES += [
     'nsStaticXULComponents.cpp',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         'nsDllMain.cpp',
     ]
 
+# component libraries
+additional_defines = (
+    'MOZ_AUTH_EXTENSION',
+    'MOZ_GIO_COMPONENT',
+    'MOZ_JSDEBUGGER',
+    'MOZ_PERMISSIONS',
+    'MOZ_PREF_EXTENSIONS',
+    'MOZ_SPELLCHECK',
+    'MOZ_UNIVERSALCHARDET',
+    'MOZ_ZIPWRITER',
+)
+
+for var in additional_defines:
+    if CONFIG[var]:
+        DEFINES[var] = True
+
+if CONFIG['MOZ_DEBUG'] and CONFIG['ENABLE_TESTS']:
+    DEFINES['ENABLE_LAYOUTDEBUG'] = True
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] not in ('android', 'gonk', 'qt', 'os2',
+                                        'cocoa', 'windows') and \
+   CONFIG['MOZ_XUL']:
+    DEFINES['MOZ_FILEVIEW'] = True
+
+# Platform-specific icon channel stuff - supported mostly-everywhere
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'os2', 'mac', 'cocoa',
+                                    'gtk2', 'gtk3', 'qt', 'android'):
+    DEFINES['ICON_DECODER'] = True
+
 FAIL_ON_WARNINGS = True
 
 MSVC_ENABLE_PGO = True
 
 FORCE_SHARED_LIB = True