Bug 1294490 - Part 5. Add --with-system-webp switch to build. r=glandium
☠☠ backed out by 649c36f9f0a6 ☠ ☠
authorAndrew Osmond <aosmond@mozilla.com>
Wed, 03 Oct 2018 17:40:47 -0400
changeset 499601 7b9bc181d09982fce1c0a7bef0c5f7fdc5892ebc
parent 499600 2a06794651b25e9e4d39f8d4a43830b74a1f7899
child 499602 fecbc475cf5490c001463fc61d8dddad29d0a14a
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1294490
milestone65.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 1294490 - Part 5. Add --with-system-webp switch to build. r=glandium Differential Revision: https://phabricator.services.mozilla.com/D8118
config/external/moz.build
config/system-headers.mozbuild
toolkit/library/moz.build
toolkit/moz.configure
--- a/config/external/moz.build
+++ b/config/external/moz.build
@@ -37,29 +37,31 @@ if not CONFIG['MOZ_SYSTEM_LIBVPX']:
     external_dirs += ['media/libvpx']
 
 if CONFIG['MOZ_AV1']:
     external_dirs += ['media/libaom']
 
 if not CONFIG['MOZ_SYSTEM_PNG']:
     external_dirs += ['media/libpng']
 
+if not CONFIG['MOZ_SYSTEM_WEBP']:
+    external_dirs += ['media/libwebp']
+
 if CONFIG['CPU_ARCH'] == 'arm':
     external_dirs += ['media/openmax_dl/dl']
 
 if CONFIG['MOZ_FFVPX']:
     external_dirs += ['media/ffvpx']
 
 external_dirs += [
     'media/kiss_fft',
     'media/libcubeb',
     'media/libnestegg',
     'media/libogg',
     'media/libopus',
     'media/libtheora',
     'media/libspeex_resampler',
     'media/libsoundtouch',
-    'media/libwebp',
     'media/mp4parse-rust',
     'media/psshparser'
 ]
 
 DIRS += ['../../' + i for i in external_dirs]
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -1250,16 +1250,24 @@ if CONFIG['MOZ_LIBAV_FFT']:
         'libavcodec/avfft.h',
     ]
 
 if CONFIG['MOZ_SYSTEM_PNG']:
     system_headers += [
         'png.h',
     ]
 
+if CONFIG['MOZ_SYSTEM_WEBP']:
+    system_headers += [
+        'webp/decode.h',
+        'webp/demux.h',
+        'webp/mux_types.h',
+        'webp/types.h',
+    ]
+
 if CONFIG['MOZ_SYSTEM_ZLIB']:
     system_headers += [
         'zlib.h',
     ]
 
 if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']:
     system_headers += [
         'libsn/sn-common.h',
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -218,16 +218,19 @@ if CONFIG['MOZ_LIB_SECRET']:
     OS_LIBS += CONFIG['MOZ_LIB_SECRET_LIBS']
 
 if CONFIG['MOZ_SYSTEM_JPEG']:
     OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
 
 if CONFIG['MOZ_SYSTEM_PNG']:
     OS_LIBS += CONFIG['MOZ_PNG_LIBS']
 
+if CONFIG['MOZ_SYSTEM_WEBP']:
+    OS_LIBS += CONFIG['MOZ_WEBP_LIBS']
+
 if CONFIG['MOZ_SYSTEM_LIBEVENT']:
     OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
 
 if CONFIG['MOZ_SYSTEM_LIBVPX']:
     OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
 
 if not CONFIG['MOZ_TREE_PIXMAN']:
     OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -823,16 +823,24 @@ def skia_includes(skia):
             '/gfx/skia/skia/include/core',
             '/gfx/skia/skia/include/gpu',
             '/gfx/skia/skia/include/utils',
         ]
     return includes
 
 set_config('SKIA_INCLUDES', skia_includes)
 
+option('--with-system-webp',
+       help='Use system libwebp (located with pkgconfig)')
+
+system_webp = pkg_check_modules('MOZ_WEBP', 'libwebp >= 1.0.0 libwebpdemux >= 1.0.0',
+                                when='--with-system-webp')
+
+set_config('MOZ_SYSTEM_WEBP', depends(when=system_webp)(lambda: True))
+
 # Build Freetype in the tree
 # ==============================================================
 @depends(target, skia_pdf)
 def tree_freetype(target, skia_pdf):
     if target.os == 'Android' or (skia_pdf and target.os == 'WINNT'):
         return True
 
 set_define('MOZ_TREE_FREETYPE', tree_freetype)