Bug 1162779 - Move NO_EXPAND_LIBS to moz.build. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 07 May 2015 16:25:18 +0900
changeset 243326 3b3465149f3886f3bade4b5892741e902560c6fc
parent 243325 0c80b9af0593a336d074a45b0f036f24f281e865
child 243327 18bd273a594ba40900af8a3843282bc3ae450b1b
push id59654
push usermh@glandium.org
push dateMon, 11 May 2015 22:56:27 +0000
treeherdermozilla-inbound@9bc266372d00 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1162779
milestone40.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 1162779 - Move NO_EXPAND_LIBS to moz.build. r=mshal
build/stlport/Makefile.in
build/stlport/moz.build
js/src/Makefile.in
js/src/moz.build
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/frontend/context.py
python/mozbuild/mozbuild/frontend/data.py
python/mozbuild/mozbuild/frontend/emitter.py
xpcom/glue/Makefile.in
xpcom/glue/moz.build
xpcom/glue/standalone/Makefile.in
xpcom/glue/standalone/moz.build
xpcom/glue/standalone/staticruntime/Makefile.in
xpcom/glue/standalone/staticruntime/moz.build
xpcom/glue/staticruntime/Makefile.in
xpcom/glue/staticruntime/moz.build
--- a/build/stlport/Makefile.in
+++ b/build/stlport/Makefile.in
@@ -1,13 +1,9 @@
 # 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/.
 
 MODULES = stlport
 
-# Force to build a static library, instead of a fake library, without
-# installing it in dist/lib.
-NO_EXPAND_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += -fuse-cxa-atexit
--- a/build/stlport/moz.build
+++ b/build/stlport/moz.build
@@ -60,8 +60,12 @@ NO_VISIBILITY_FLAGS = True
 
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CXX']:
     CXXFLAGS += [
         '-Wno-empty-body',
         '-Wno-type-limits',
         '-Wno-unused-local-typedefs',
     ]
+
+# Force to build a static library, instead of a fake library, without
+# installing it in dist/lib.
+NO_EXPAND_LIBS = True
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -12,17 +12,16 @@ ifneq ($(make_min_ver),$(firstword $(sor
 $(error GNU Make $(make_min_ver) or higher is required)
 endif
 
 TOPLEVEL_BUILD := 1
 
 run_for_side_effects := $(shell echo 'MAKE: $(MAKE)')
 
 DIST_INSTALL = 1
-NO_EXPAND_LIBS = 1
 
 ifdef JS_HAS_CTYPES
 ifdef MOZ_NATIVE_FFI
 LOCAL_INCLUDES = $(MOZ_FFI_CFLAGS)
 endif
 
 # Windows needs this to be linked with a static library.
 ifndef MOZ_NATIVE_FFI
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -561,8 +561,10 @@ if CONFIG['OS_ARCH'] == 'SunOS':
         'posix4',
         'dl',
         'nsl',
         'socket',
     ]
 
 if CONFIG['GNU_CXX']:
     FAIL_ON_WARNINGS = True
+
+NO_EXPAND_LIBS = True
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -94,16 +94,17 @@ MOZBUILD_VARIABLES = [
     'JAR_MANIFEST',
     'JAVA_JAR_TARGETS',
     'LD_VERSION_SCRIPT',
     'LIBRARY_NAME',
     'LIBS',
     'MAKE_FRAMEWORK',
     'MODULE',
     'NO_DIST_INSTALL',
+    'NO_EXPAND_LIBS',
     'NO_JS_MANIFEST',
     'OS_LIBS',
     'PARALLEL_DIRS',
     'PREF_JS_EXPORTS',
     'PROGRAM',
     'PYTHON_UNIT_TESTS',
     'RESOURCE_FILES',
     'SDK_HEADERS',
@@ -1212,16 +1213,18 @@ INSTALL_TARGETS += %(prefix)s
             backend_file.write('SDK_LIBRARY := %s\n' % libdef.import_name)
 
     def _process_static_library(self, libdef, backend_file):
         backend_file.write_once('LIBRARY_NAME := %s\n' % libdef.basename)
         backend_file.write('FORCE_STATIC_LIB := 1\n')
         backend_file.write('REAL_LIBRARY := %s\n' % libdef.lib_name)
         if libdef.is_sdk:
             backend_file.write('SDK_LIBRARY := %s\n' % libdef.import_name)
+        if libdef.no_expand_lib:
+            backend_file.write('NO_EXPAND_LIBS := 1\n')
 
     def _process_host_library(self, libdef, backend_file):
         backend_file.write('HOST_LIBRARY_NAME = %s\n' % libdef.basename)
 
     def _build_target_for_obj(self, obj):
         return '%s/%s' % (mozpath.relpath(obj.objdir,
             self.environment.topobjdir), obj.KIND)
 
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1399,16 +1399,21 @@ VARIABLES = {
         to export ``foo.py`` to ``_tests/foo``, append to
         ``TEST_HARNESS_FILES`` like so::
            TEST_HARNESS_FILES.foo += ['foo.py']
 
         Files from topsrcdir and the objdir can also be installed by prefixing
         the path(s) with a '/' character and a '!' character, respectively::
            TEST_HARNESS_FILES.path += ['/build/bar.py', '!quux.py']
         """, 'libs'),
+
+    'NO_EXPAND_LIBS': (bool, bool,
+        """Forces to build a real static library, and no corresponding fake
+           library.
+        """, None),
 }
 
 # Sanity check: we don't want any variable above to have a list as storage type.
 for name, (storage_type, input_types, docs, tier) in VARIABLES.items():
     if storage_type == list:
         raise RuntimeError('%s has a "list" storage type. Use "List" instead.'
             % name)
 
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -497,22 +497,24 @@ class Library(BaseLibrary):
         self.basename = basename
         self.is_sdk = is_sdk
 
 
 class StaticLibrary(Library):
     """Context derived container object for a static library"""
     __slots__ = (
         'link_into',
+        'no_expand_lib',
     )
 
     def __init__(self, context, basename, real_name=None, is_sdk=False,
-        link_into=None):
+        link_into=None, no_expand_lib=False):
         Library.__init__(self, context, basename, real_name, is_sdk)
         self.link_into = link_into
+        self.no_expand_lib = no_expand_lib
 
 
 class SharedLibrary(Library):
     """Context derived container object for a shared library"""
     __slots__ = (
         'soname',
         'variant',
     )
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -451,16 +451,23 @@ class TreeMetadataEmitter(LoggingMixin):
             # If both a shared and a static library are created, only the
             # shared library is meant to be a SDK library.
             if context.get('SDK_LIBRARY'):
                 if shared_lib:
                     shared_args['is_sdk'] = True
                 elif static_lib:
                     static_args['is_sdk'] = True
 
+            if context.get('NO_EXPAND_LIBS'):
+                if not static_lib:
+                    raise SandboxValidationError(
+                        'NO_EXPAND_LIBS can only be set for static libraries.',
+                        context)
+                static_args['no_expand_lib'] = True
+
             if shared_lib and static_lib:
                 if not static_name and not shared_name:
                     raise SandboxValidationError(
                         'Both FORCE_STATIC_LIB and FORCE_SHARED_LIB are True, '
                         'but neither STATIC_LIBRARY_NAME or '
                         'SHARED_LIBRARY_NAME is set. At least one is required.',
                         context)
                 if static_name and not shared_name and static_name == libname:
--- a/xpcom/glue/Makefile.in
+++ b/xpcom/glue/Makefile.in
@@ -1,8 +1,6 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # 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
-# Force to build a static library only
-NO_EXPAND_LIBS = 1
--- a/xpcom/glue/moz.build
+++ b/xpcom/glue/moz.build
@@ -111,8 +111,11 @@ if CONFIG['ENABLE_TESTS']:
     DIRS += ['tests/gtest']
 
 FAIL_ON_WARNINGS = True
 
 # Include fallible for third party code using the xpcom glue
 USE_LIBS += [
     'fallible',
 ]
+
+# Force to build a static library only
+NO_EXPAND_LIBS = True
--- a/xpcom/glue/standalone/Makefile.in
+++ b/xpcom/glue/standalone/Makefile.in
@@ -1,8 +1,6 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # 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
-# Force to build a static library only
-NO_EXPAND_LIBS = 1
--- a/xpcom/glue/standalone/moz.build
+++ b/xpcom/glue/standalone/moz.build
@@ -44,8 +44,11 @@ LOCAL_INCLUDES += [
 DISABLE_STL_WRAPPING = True
 
 FAIL_ON_WARNINGS = True
 
 # Include fallible for third party code using the xpcom glue
 USE_LIBS += [
     'fallible',
 ]
+
+# Force to build a static library only
+NO_EXPAND_LIBS = True
--- a/xpcom/glue/standalone/staticruntime/Makefile.in
+++ b/xpcom/glue/standalone/staticruntime/Makefile.in
@@ -1,7 +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
-# Force to build a static library only
-NO_EXPAND_LIBS = 1
--- a/xpcom/glue/standalone/staticruntime/moz.build
+++ b/xpcom/glue/standalone/staticruntime/moz.build
@@ -39,8 +39,11 @@ USE_STATIC_LIBS = True
 DISABLE_STL_WRAPPING = True
 
 FAIL_ON_WARNINGS = True
 
 # Include fallible for third party code using the xpcom glue
 USE_LIBS += [
     'fallible',
 ]
+
+# Force to build a static library only
+NO_EXPAND_LIBS = True
--- a/xpcom/glue/staticruntime/Makefile.in
+++ b/xpcom/glue/staticruntime/Makefile.in
@@ -1,8 +1,6 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # 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
-# Force to build a static library only
-NO_EXPAND_LIBS = 1
--- a/xpcom/glue/staticruntime/moz.build
+++ b/xpcom/glue/staticruntime/moz.build
@@ -37,8 +37,11 @@ USE_STATIC_LIBS = True
 DISABLE_STL_WRAPPING = True
 
 FAIL_ON_WARNINGS = True
 
 # Include fallible for third party code using the xpcom glue
 USE_LIBS += [
     'fallible',
 ]
+
+# Force to build a static library only
+NO_EXPAND_LIBS = True