Bug 1305145 - Make libs and flags set by pkg_check_modules available to the caller. r=glandium
☠☠ backed out by acee3d0166dc ☠ ☠
authorChris Manchester <cmanchester@mozilla.com>
Fri, 14 Oct 2016 11:06:30 -0700
changeset 318105 33e563d2d834a9b7c27802aeec0d1085d1506a41
parent 318104 e984459f2b0f99c9b366ca6570e13fd43339cdd8
child 318106 85082a1118068529ac58b413772246bd83428c0f
push id30830
push usercbook@mozilla.com
push dateMon, 17 Oct 2016 09:19:24 +0000
treeherdermozilla-central@94b0fddf96b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1305145
milestone52.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 1305145 - Make libs and flags set by pkg_check_modules available to the caller. r=glandium MozReview-Commit-ID: 7uZheAOXKwE
build/moz.configure/pkg.configure
js/ffi.configure
moz.configure
toolkit/moz.configure
--- a/build/moz.configure/pkg.configure
+++ b/build/moz.configure/pkg.configure
@@ -82,12 +82,16 @@ def pkg_check_modules(var, package_desc,
 
     @depends_when(pkg_config, package_desc, when=package)
     @checking('%s_LIBS' % var, callback=lambda t: ' '.join(t))
     def pkg_libs(pkg_config, package_desc):
         libs = check_cmd_output(pkg_config, '--libs', package_desc)
         # Remove evil flags like -Wl,--export-dynamic
         return tuple(libs.replace('-Wl,--export-dynamic', '').split())
 
+    @depends_when(pkg_cflags, pkg_libs, when=package)
+    def pkg_info(cflags, libs):
+        return namespace(cflags=cflags, libs=libs)
+
     set_config('%s_CFLAGS' % var, pkg_cflags)
     set_config('%s_LIBS' % var, pkg_libs)
 
-    return package
+    return pkg_info
--- a/js/ffi.configure
+++ b/js/ffi.configure
@@ -15,20 +15,20 @@ imply_option('--with-system-ffi', force_
 js_option('--with-system-ffi',
           help='Use system libffi (located with pkgconfig)')
 
 use_system_ffi = depends_if('--with-system-ffi')(lambda _: True)
 
 system_ffi = pkg_check_modules('MOZ_FFI', 'libffi > 3.0.9',
                                when=use_system_ffi)
 
-building_ffi = depends(system_ffi)(lambda v: not bool(v))
+building_ffi = depends(system_ffi)(lambda v: not bool(v is not None))
 
-set_config('MOZ_SYSTEM_FFI', system_ffi)
-add_old_configure_assignment('MOZ_SYSTEM_FFI', system_ffi)
+set_config('MOZ_SYSTEM_FFI', depends_if(system_ffi)(lambda _: True))
+add_old_configure_assignment('MOZ_SYSTEM_FFI', depends_if(system_ffi)(lambda _: True))
 
 # Target selection, based on ffi/configure.ac.
 @depends_when(target, when=building_ffi)
 def ffi_target(target):
     if target.cpu not in ('x86', 'x86_64', 'arm', 'aarch64'):
         die('Building libffi from the tree is not supported on this platform. '
             'Use --with-system-ffi instead.')
 
--- a/moz.configure
+++ b/moz.configure
@@ -270,17 +270,17 @@ option('--enable-system-hunspell',
 
 @depends('--enable-system-hunspell', compile_environment)
 def check_for_hunspell(value, compile_env):
     return value and compile_env
 
 system_hunspell = pkg_check_modules('MOZ_HUNSPELL', 'hunspell',
                                     when=check_for_hunspell)
 
-set_config('MOZ_SYSTEM_HUNSPELL', system_hunspell)
+set_config('MOZ_SYSTEM_HUNSPELL', depends_if(system_hunspell)(lambda _: True))
 
 
 @depends(target)
 @imports('os')
 def makensis_progs(target):
     if target.kernel != 'WINNT':
         return
 
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -468,17 +468,17 @@ option('--enable-gpsd', env='MOZ_GPSD',
 
 @depends('--enable-gpsd')
 def gpsd(value):
     return bool(value)
 
 system_gpsd = pkg_check_modules('MOZ_GPSD', 'libgps >= 3.11',
                                 when=gpsd)
 
-set_config('MOZ_GPSD', system_gpsd)
+set_config('MOZ_GPSD', depends_if(system_gpsd)(lambda _: True))
 
 # Miscellaneous programs
 # ==============================================================
 
 check_prog('TAR', ('gnutar', 'gtar', 'tar'))
 check_prog('UNZIP', ('unzip',))
 check_prog('ZIP', ('zip',))