Bug 981428 - Move OSX -framework flags to moz.build; r=mshal
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 10 Mar 2014 20:18:33 -0400
changeset 172923 feebf1769138d91bbb9fab1a6f160052ad4fe737
parent 172922 c86d5a518965562322f76b11a4b672c739894069
child 172924 f86398fa5fac6dd2c59d4e2410b2c656ba1fa670
push id26384
push userryanvm@gmail.com
push dateTue, 11 Mar 2014 19:19:48 +0000
treeherdermozilla-central@9cdaf3f7c601 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs981428
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 981428 - Move OSX -framework flags to moz.build; r=mshal
content/media/apple/Makefile.in
content/media/apple/moz.build
dom/plugins/ipc/interpose/Makefile.in
dom/plugins/ipc/interpose/moz.build
dom/plugins/test/testplugin/testplugin.mk
dom/plugins/test/testplugin/testplugin.mozbuild
media/webrtc/signaling/test/Makefile.in
media/webrtc/signaling/test/moz.build
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/frontend/sandbox_symbols.py
toolkit/crashreporter/client/Makefile.in
toolkit/crashreporter/client/moz.build
toolkit/library/Makefile.in
toolkit/library/moz.build
toolkit/mozapps/update/updater/Makefile.in
toolkit/mozapps/update/updater/moz.build
deleted file mode 100644
--- a/content/media/apple/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/.
-
-LDFLAGS += \
-    -framework AudioToolbox \
-    $(NULL)
--- a/content/media/apple/moz.build
+++ b/content/media/apple/moz.build
@@ -12,8 +12,10 @@ EXPORTS += [
 UNIFIED_SOURCES += [
     'AppleDecoder.cpp',
     'AppleMP3Reader.cpp',
 ]
 
 FAIL_ON_WARNINGS = True
 
 FINAL_LIBRARY = 'gklayout'
+
+LDFLAGS += ['-framework AudioToolbox']
--- a/dom/plugins/ipc/interpose/Makefile.in
+++ b/dom/plugins/ipc/interpose/Makefile.in
@@ -1,10 +1,5 @@
 # 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_INSTALL     = 1
-
-
-EXTRA_DSO_LDOPTS += \
-  -framework Carbon \
-  $(NULL)
--- a/dom/plugins/ipc/interpose/moz.build
+++ b/dom/plugins/ipc/interpose/moz.build
@@ -8,8 +8,10 @@ LIBRARY_NAME = 'plugin_child_interpose'
 
 UNIFIED_SOURCES += [ "%s.mm" % (LIBRARY_NAME) ]
 
 UNIFIED_SOURCES += [
     'plugin_child_quirks.mm',
 ]
 
 FORCE_SHARED_LIB = True
+
+EXTRA_DSO_LDOPTS += ['-framework Carbon']
--- a/dom/plugins/test/testplugin/testplugin.mk
+++ b/dom/plugins/test/testplugin/testplugin.mk
@@ -32,19 +32,13 @@ INSTALL_TARGETS += \
 	$(NULL)
 else
 TEST_PLUGIN_DEST = $(DIST)/plugins
 INSTALL_TARGETS += TEST_PLUGIN
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-ifndef __LP64__
-ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
-EXTRA_DSO_LDOPTS += -framework Carbon
-endif
-endif
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 CXXFLAGS        += $(MOZ_GTK2_CFLAGS)
 CFLAGS          += $(MOZ_GTK2_CFLAGS)
 EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) $(XLDFLAGS) $(XLIBS) $(XEXT_LIBS)
 endif
--- a/dom/plugins/test/testplugin/testplugin.mozbuild
+++ b/dom/plugins/test/testplugin/testplugin.mozbuild
@@ -44,8 +44,11 @@ USE_STATIC_LIBS = True
 
 # Don't use STL wrappers; nptest isn't Gecko code
 DISABLE_STL_WRAPPING = True
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     RCFILE  = 'nptest.rc'
     RESFILE = 'nptest.res'
     DEFFILE = SRCDIR + '/nptest.def'
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' and '64' in CONFIG['OS_TEST']:
+    EXTRA_DSO_LDOPTS += ['-framework Carbon']
--- a/media/webrtc/signaling/test/Makefile.in
+++ b/media/webrtc/signaling/test/Makefile.in
@@ -86,27 +86,16 @@ endif
 ifneq (,$(filter Linux DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
 LIBS += \
   $(MOZ_CAIRO_OSLIBS) \
   $(NULL)
 endif
 
 ifeq ($(OS_TARGET),Darwin)
 LIBS += \
-  -framework AudioToolbox \
-  -framework AudioUnit \
-  -framework Carbon \
-  -framework CoreAudio \
-  -framework OpenGL \
-  -framework QTKit \
-  -framework QuartzCore \
-  -framework Security \
-  -framework SystemConfiguration \
-  -framework IOKit \
-  -F$(MACOS_PRIVATE_FRAMEWORKS_DIR) -framework CoreUI \
   $(TK_LIBS) \
   $(NULL)
 endif
 
 ifeq ($(OS_TARGET),WINNT)
 LIBS += \
   $(DEPTH)/staticlib/components/$(LIB_PREFIX)windowsproxy.$(LIB_SUFFIX) \
   $(NULL)
--- a/media/webrtc/signaling/test/moz.build
+++ b/media/webrtc/signaling/test/moz.build
@@ -64,14 +64,28 @@ if CONFIG['OS_TARGET'] == 'Linux':
     LOCAL_INCLUDES += [
         '/media/mtransport/third_party/nrappkit/src/port/linux/include',
     ]
 
 if CONFIG['OS_TARGET'] == 'Darwin':
     LOCAL_INCLUDES += [
         '/media/mtransport/third_party/nrappkit/src/port/darwin/include',
     ]
+    LDFLAGS += [
+        '-framework AudioToolbox',
+        '-framework AudioUnit',
+        '-framework Carbon',
+        '-framework CoreAudio',
+        '-framework OpenGL',
+        '-framework QTKit',
+        '-framework QuartzCore',
+        '-framework Security',
+        '-framework SystemConfiguration',
+        '-framework IOKit',
+        '-F%s' % CONFIG['MACOS_PRIVATE_FRAMEWORKS_DIR'],
+        '-framework CoreUI',
+    ]
 
 if CONFIG['OS_TARGET'] in ('DragonFly', 'FreeBSD', 'NetBSD', 'OpenBSD'):
     LOCAL_INCLUDES += [
         '/media/mtransport/third_party/nrappkit/src/port/darwin/include',
         '/media/mtransport/third_party/nrappkit/src/port/generic/include',
     ]
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -217,16 +217,17 @@ class TreeMetadataEmitter(LoggingMixin):
             'ANDROID_GENERATED_RESFILES',
             'ANDROID_RES_DIRS',
             'CPP_UNIT_TESTS',
             'DISABLE_STL_WRAPPING',
             'EXPORT_LIBRARY',
             'EXTRA_ASSEMBLER_FLAGS',
             'EXTRA_COMPILE_FLAGS',
             'EXTRA_COMPONENTS',
+            'EXTRA_DSO_LDOPTS',
             'EXTRA_JS_MODULES',
             'EXTRA_PP_COMPONENTS',
             'EXTRA_PP_JS_MODULES',
             'FAIL_ON_WARNINGS',
             'FILES_PER_UNIFIED_FILE',
             'FORCE_SHARED_LIB',
             'FORCE_STATIC_LIB',
             'USE_STATIC_LIBS',
--- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
+++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
@@ -735,16 +735,24 @@ VARIABLES = {
         """Flags passed to the linker when linking all of the libraries and
            executables declared in this directory.
 
            Note that the ordering of flags matters here; these flags will be
            added to the linker's command line in the same order as they
            appear in the moz.build file.
         """, 'libs'),
 
+    'EXTRA_DSO_LDOPTS': (list, list,
+        """Flags passed to the linker when linking a shared library.
+
+           Note that the ordering of flags matter here, these flags will be
+           added to the linker's command line in the same order as they
+           appear in the moz.build file.
+        """, 'libs'),
+
     'WIN32_EXE_LDFLAGS': (list, list,
         """Flags passed to the linker when linking a Windows .exe executable
            declared in this directory.
 
            Note that the ordering of flags matter here, these flags will be
            added to the linker's command line in the same order as they
            appear in the moz.build file.
 
--- a/toolkit/crashreporter/client/Makefile.in
+++ b/toolkit/crashreporter/client/Makefile.in
@@ -15,17 +15,16 @@ ifeq ($(OS_ARCH),WINNT)
 LIBS += \
   $(DEPTH)/toolkit/crashreporter/breakpad-windows-libxul/$(LIB_PREFIX)google_breakpad_libxul_s.$(LIB_SUFFIX)
   $(NULL)
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 shell32 wininet shlwapi)
 MOZ_WINCONSOLE = 0
 endif
 
 ifeq ($(OS_ARCH),Darwin)
-OS_LIBS += -framework Cocoa
 LIBS += \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)breakpad_common_s.$(LIB_SUFFIX) \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/mac/$(LIB_PREFIX)breakpad_mac_common_s.$(LIB_SUFFIX) \
   $(NULL)
 endif
 
 ifdef MOZ_WIDGET_GTK
 
--- a/toolkit/crashreporter/client/moz.build
+++ b/toolkit/crashreporter/client/moz.build
@@ -25,16 +25,17 @@ if CONFIG['OS_ARCH'] == 'WINNT':
 elif CONFIG['OS_ARCH'] == 'Darwin':
     UNIFIED_SOURCES += [
         'crashreporter_osx.mm',
         'crashreporter_unix_common.cpp',
     ]
     LOCAL_INCLUDES += [
         '../google-breakpad/src/common/mac',
     ]
+    LDFLAGS += ['-framework Cocoa']
 elif CONFIG['OS_ARCH'] == 'SunOS':
     SOURCES += [
         'crashreporter_linux.cpp',
         'crashreporter_unix.cpp',
     ]
 
 if CONFIG['MOZ_ENABLE_GTK']:
     UNIFIED_SOURCES += [
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -48,17 +48,17 @@ EXTRA_DEPS += symverscript
 endif
 endif
 
 ifdef MOZ_APP_COMPONENT_LIBS
 COMPONENT_LIBS += $(MOZ_APP_COMPONENT_LIBS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
-OS_LIBS += -framework OpenGL -lcups
+OS_LIBS += -lcups
 endif
 
 EXTRA_DSO_LDOPTS += \
   $(LIBS_DIR) \
   $(MOZ_JS_LIBS) \
   $(NSS_LIBS) \
   $(MOZ_CAIRO_OSLIBS) \
   $(MOZ_APP_EXTRA_LIBS) \
@@ -166,20 +166,16 @@ endif
 
 EXTRA_DSO_LDOPTS += $(LIBS_DIR)
 
 EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 CXXFLAGS += $(TK_CFLAGS)
 OS_LIBS += \
-  -framework SystemConfiguration \
-  -framework QTKit \
-  -framework IOKit \
-  -F$(MACOS_PRIVATE_FRAMEWORKS_DIR) -framework CoreUI \
   $(TK_LIBS) \
   $(NULL)
 endif
 
 ifeq (OpenBSD,$(OS_ARCH))
 EXTRA_DSO_LDOPTS += -lsndio
 endif
 
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -85,8 +85,18 @@ if CONFIG['MOZ_METRO']:
         'uiautomationcore.dll'
     ]
 
 if CONFIG['ACCESSIBILITY']:
     DELAYLOAD_DLLS += ['oleacc.dll']
 
 if CONFIG['MOZ_WEBRTC']:
     DELAYLOAD_DLLS += ['msdmo.dll']
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+    LDFLAGS += [
+        '-framework OpenGL',
+        '-framework SystemConfiguration',
+        '-framework QTKit',
+        '-framework IOKit',
+        '-F%s' % CONFIG['MACOS_PRIVATE_FRAMEWORKS_DIR'],
+        '-framework CoreUI',
+    ]
--- a/toolkit/mozapps/update/updater/Makefile.in
+++ b/toolkit/mozapps/update/updater/Makefile.in
@@ -23,20 +23,16 @@ LIBS += $(call EXPAND_LIBNAME_PATH,verif
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 ws2_32 shell32 shlwapi)
 endif
 
 ifdef MOZ_WIDGET_GTK
 OS_CXXFLAGS += $(TK_CFLAGS)
 OS_LIBS += $(TK_LIBS)
 endif
 
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-OS_LIBS += -framework Cocoa
-endif
-
 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) #{
 OS_LIBS += -lcutils -lsysutils
 # clear out all the --wrap flags and remove dependency on mozglue for Gonk
 WRAP_LDFLAGS :=
 endif #}
 
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
--- a/toolkit/mozapps/update/updater/moz.build
+++ b/toolkit/mozapps/update/updater/moz.build
@@ -33,35 +33,34 @@ if CONFIG['OS_ARCH'] == 'WINNT':
 if CONFIG['MOZ_ENABLE_GTK']:
     have_progressui = 1
     SOURCES += [
         'progressui_gtk.cpp',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     have_progressui = 1
+    SOURCES += [
+        'launchchild_osx.mm',
+        'progressui_osx.mm',
+    ]
+    LDFLAGS += ['-framework Cocoa']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     have_progressui = 1
     SOURCES += [
         'automounter_gonk.cpp',
         'progressui_gonk.cpp',
     ]
     DISABLE_STL_WRAPPING = True
 
 if have_progressui == 0:
     SOURCES += [
         'progressui_null.cpp',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
-    SOURCES += [
-        'launchchild_osx.mm',
-        'progressui_osx.mm',
-    ]
-
 DEFINES['NS_NO_XPCOM'] = True
 for var in ('MAR_CHANNEL_ID', 'MOZ_APP_VERSION'):
     DEFINES[var] = '"%s"' % CONFIG[var]
 
 LOCAL_INCLUDES += [
     '../common',
     '/xpcom/glue',
 ]