Bug 949334 - Use FINAL_LIBRARY for webrtc. r=gps

This commit is contained in:
Mike Hommey 2013-12-14 11:38:53 +09:00
parent 2bff1a717b
commit 883bf3234f
7 changed files with 16 additions and 90 deletions

View File

@ -1,77 +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/.
# shared libs for webrtc
SHARED_LIBRARY_LIBS = \
$(call EXPAND_LIBNAME_PATH,common_video,$(DEPTH)/media/webrtc/trunk/webrtc/common_video/common_video_common_video) \
$(call EXPAND_LIBNAME_PATH,common_audio,$(DEPTH)/media/webrtc/trunk/webrtc/common_audio/common_audio_common_audio) \
$(call EXPAND_LIBNAME_PATH,video_capture_module,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_video_capture_module) \
$(call EXPAND_LIBNAME_PATH,webrtc_utility,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_webrtc_utility) \
$(call EXPAND_LIBNAME_PATH,audio_coding_module,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_audio_coding_module) \
$(call EXPAND_LIBNAME_PATH,acm2,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_acm2) \
$(call EXPAND_LIBNAME_PATH,CNG,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_CNG) \
$(call EXPAND_LIBNAME_PATH,G711,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_G711) \
$(call EXPAND_LIBNAME_PATH,PCM16B,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_PCM16B) \
$(call EXPAND_LIBNAME_PATH,NetEq,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_NetEq) \
$(call EXPAND_LIBNAME_PATH,NetEq4,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_NetEq4) \
$(call EXPAND_LIBNAME_PATH,system_wrappers,$(DEPTH)/media/webrtc/trunk/webrtc/system_wrappers/source/system_wrappers_system_wrappers) \
$(call EXPAND_LIBNAME_PATH,webrtc_video_coding,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_webrtc_video_coding) \
$(call EXPAND_LIBNAME_PATH,video_coding_utility,$(DEPTH)/media/webrtc/trunk/webrtc/modules/video_coding/utility/video_coding_utility_video_coding_utility) \
$(call EXPAND_LIBNAME_PATH,webrtc_i420,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_webrtc_i420) \
$(call EXPAND_LIBNAME_PATH,webrtc_vp8,$(DEPTH)/media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_webrtc_vp8) \
$(call EXPAND_LIBNAME_PATH,webrtc_opus,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_webrtc_opus) \
$(call EXPAND_LIBNAME_PATH,video_render_module,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_video_render_module) \
$(call EXPAND_LIBNAME_PATH,video_engine_core,$(DEPTH)/media/webrtc/trunk/webrtc/video_engine/video_engine_video_engine_core) \
$(call EXPAND_LIBNAME_PATH,voice_engine,$(DEPTH)/media/webrtc/trunk/webrtc/voice_engine/voice_engine_voice_engine) \
$(call EXPAND_LIBNAME_PATH,media_file,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_media_file) \
$(call EXPAND_LIBNAME_PATH,rtp_rtcp,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_rtp_rtcp) \
$(call EXPAND_LIBNAME_PATH,bitrate_controller,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_bitrate_controller) \
$(call EXPAND_LIBNAME_PATH,remote_bitrate_estimator,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_remote_bitrate_estimator) \
$(call EXPAND_LIBNAME_PATH,rbe_components,$(DEPTH)/media/webrtc/trunk/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_components_rbe_components) \
$(call EXPAND_LIBNAME_PATH,paced_sender,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_paced_sender) \
$(call EXPAND_LIBNAME_PATH,video_processing,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_video_processing) \
$(call EXPAND_LIBNAME_PATH,audio_conference_mixer,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_audio_conference_mixer) \
$(call EXPAND_LIBNAME_PATH,audio_device,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_audio_device) \
$(call EXPAND_LIBNAME_PATH,audio_processing,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_audio_processing) \
$(call EXPAND_LIBNAME_PATH,yuv,$(DEPTH)/media/webrtc/trunk/third_party/libyuv/libyuv_libyuv) \
$(call EXPAND_LIBNAME_PATH,nicer,$(DEPTH)/media/mtransport/third_party/nICEr/nicer_nicer) \
$(call EXPAND_LIBNAME_PATH,nrappkit,$(DEPTH)/media/mtransport/third_party/nrappkit/nrappkit_nrappkit) \
$(NULL)
# if we're on an intel arch, we want SSE2 optimizations
ifneq (,$(INTEL_ARCHITECTURE))
SHARED_LIBRARY_LIBS += \
$(call EXPAND_LIBNAME_PATH,video_processing_sse2,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_video_processing_sse2) \
$(call EXPAND_LIBNAME_PATH,audio_processing_sse2,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_audio_processing_sse2) \
$(call EXPAND_LIBNAME_PATH,common_audio_sse2,$(DEPTH)/media/webrtc/trunk/webrtc/common_audio/common_audio_common_audio_sse2) \
$(NULL)
endif
ifeq ($(CPU_ARCH), arm)
ifeq (Android,$(OS_TARGET))
# NEON detection on WebRTC is Android only. If WebRTC supports Linux/arm etc,
# we should remove OS check
# extra ARM libs
SHARED_LIBRARY_LIBS += \
$(call EXPAND_LIBNAME_PATH,cpu_features_android,$(DEPTH)/media/webrtc/trunk/webrtc/system_wrappers/source/system_wrappers_cpu_features_android) \
$(NULL)
# neon for ARM
ifeq ($(BUILD_ARM_NEON),1)
SHARED_LIBRARY_LIBS += \
$(call EXPAND_LIBNAME_PATH,common_audio_neon,$(DEPTH)/media/webrtc/trunk/webrtc/common_audio/common_audio_common_audio_neon) \
$(call EXPAND_LIBNAME_PATH,audio_processing_neon,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_audio_processing_neon) \
$(NULL)
endif
endif
endif
# If you enable one of these codecs in webrtc_config.gypi, you'll need to re-add the
# relevant library from this list:
#
# $(call EXPAND_LIBNAME_PATH,G722,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_G722) \
# $(call EXPAND_LIBNAME_PATH,iLBC,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_iLBC) \
# $(call EXPAND_LIBNAME_PATH,iSAC,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_iSAC) \
# $(call EXPAND_LIBNAME_PATH,iSACFix,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_iSACFix) \
#

View File

@ -13,6 +13,8 @@ GYP_DIRS += [
GYP_DIRS['nICEr'].input = 'nICEr/nicer.gyp'
GYP_DIRS['nICEr'].variables = gyp_vars
GYP_DIRS['nICEr'].sandbox_vars['FINAL_LIBRARY'] = 'webrtc'
GYP_DIRS['nrappkit'].input = 'nrappkit/nrappkit.gyp'
GYP_DIRS['nrappkit'].variables = gyp_vars
GYP_DIRS['nrappkit'].sandbox_vars['FINAL_LIBRARY'] = 'webrtc'

View File

@ -10,6 +10,7 @@ GYP_DIRS += ['trunk']
GYP_DIRS['trunk'].input = 'trunk/peerconnection.gyp'
GYP_DIRS['trunk'].variables = gyp_vars
GYP_DIRS['trunk'].sandbox_vars['FINAL_LIBRARY'] = 'webrtc'
if CONFIG['MOZ_WEBRTC_SIGNALING']:
GYP_DIRS += ['signaling']
@ -18,6 +19,7 @@ if CONFIG['MOZ_WEBRTC_SIGNALING']:
GYP_DIRS['signaling'].variables.update(
build_for_test=0
)
GYP_DIRS['signaling'].sandbox_vars['FINAL_LIBRARY'] = 'xul'
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
GYP_DIRS += ['trunk/testing']

View File

@ -340,7 +340,7 @@ class TreeMetadataEmitter(LoggingMixin):
LibraryDefinition(sandbox, libname)
if final_lib:
if sandbox.get('FORCE_STATIC_LIB'):
if isinstance(sandbox, MozbuildSandbox) and sandbox.get('FORCE_STATIC_LIB'):
raise SandboxValidationError('FINAL_LIBRARY implies FORCE_STATIC_LIB')
self._final_libs.append((sandbox['OBJDIR'], libname, final_lib))
passthru.variables['FORCE_STATIC_LIB'] = True

View File

@ -768,11 +768,13 @@ class BuildReader(object):
# configuration, but we need to add the gyp objdirs to that sandbox
# first.
from .gyp_reader import read_from_gyp
gyp_sandboxes.extend(read_from_gyp(self.config,
mozpath.join(curdir, gyp_dir.input),
mozpath.join(sandbox['OBJDIR'],
target_dir),
gyp_dir.variables))
for gyp_sandbox in read_from_gyp(self.config,
mozpath.join(curdir, gyp_dir.input),
mozpath.join(sandbox['OBJDIR'],
target_dir),
gyp_dir.variables):
gyp_sandbox.update(gyp_dir.sandbox_vars)
gyp_sandboxes.append(gyp_sandbox)
# Add the gyp subdirectories to DIRS. We don't care about trying to
# place some of them in PARALLEL_DIRS because they're only going to be

View File

@ -564,6 +564,7 @@ VARIABLES = {
'GYP_DIRS': (StrictOrderingOnAppendListWithFlagsFactory({
'variables': dict,
'input': unicode,
'sandbox_vars': dict,
}), list,
"""Defines a list of object directories handled by gyp configurations.
@ -575,6 +576,9 @@ VARIABLES = {
object directory.
- variables, a dictionary containing variables and values to pass
to the gyp processor.
- sandbox_vars, a dictionary containing variables and values to
pass to the mozbuild processor on top of those derived from gyp
configuration.
Typical use looks like:
GYP_DIRS += ['foo', 'bar']

View File

@ -183,13 +183,6 @@ endif
EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib)
ifdef MOZ_WEBRTC
ifdef MOZ_WEBRTC_SIGNALING
SHARED_LIBRARY_LIBS += \
$(DEPTH)/media/webrtc/signaling/signaling_ecc/$(LIB_PREFIX)ecc.$(LIB_SUFFIX) \
$(DEPTH)/media/webrtc/signaling/signaling_sipcc/$(LIB_PREFIX)sipcc.$(LIB_SUFFIX) \
$(NULL)
endif
ifeq (WINNT,$(OS_TARGET))
EXTRA_DSO_LDOPTS += \
-LIBPATH:'$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)' \