Bug 641212 Part 2 - Adjust mar/signmar/updater build files to link liblzma instead of bzip. r?rstrong, r?glandium draft
authorMatt Howell <mhowell@mozilla.com>
Sun, 09 Jul 2017 10:50:15 -0700
changeset 607654 fe09b87130af0f31c33113408495309062f59c79
parent 607653 8aaf488065ab15c8ab290052b59a71d8a6b86685
child 607655 531b395baa57783489b21a55579e2b5385cca974
push id68072
push usermhowell@mozilla.com
push dateWed, 12 Jul 2017 17:32:12 +0000
reviewersrstrong, glandium
bugs641212
milestone56.0a1
Bug 641212 Part 2 - Adjust mar/signmar/updater build files to link liblzma instead of bzip. r?rstrong, r?glandium MozReview-Commit-ID: Abqeeo4ATwc
modules/libmar/moz.build
modules/libmar/src/moz.build
modules/libmar/tool/moz.build
toolkit/mozapps/update/updater/updater-common.build
--- a/modules/libmar/moz.build
+++ b/modules/libmar/moz.build
@@ -2,19 +2,19 @@
 # vim: set filetype=python:
 # 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/.
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Application Update')
 
-DIRS += ['src']
+if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
+    DIRS += ['src']
 
-if CONFIG['MOZ_ENABLE_SIGNMAR']:
-    DIRS += ['sign', 'verify']
-    TEST_DIRS += ['tests']
-elif CONFIG['MOZ_VERIFY_MAR_SIGNATURE']:
-    DIRS += ['verify']
+    if CONFIG['MOZ_ENABLE_SIGNMAR']:
+        DIRS += ['sign', 'verify']
+        TEST_DIRS += ['tests']
+    elif CONFIG['MOZ_VERIFY_MAR_SIGNATURE']:
+        DIRS += ['verify']
 
-# If we are building ./sign and ./verify then ./tool must come after it
-DIRS += ['tool']
-
+    # If we are building ./sign and ./verify then ./tool must come after it
+    DIRS += ['tool']
--- a/modules/libmar/src/moz.build
+++ b/modules/libmar/src/moz.build
@@ -23,8 +23,11 @@ UNIFIED_SOURCES += [
     'mar_extract.c',
     'mar_read.c',
 ]
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     USE_STATIC_LIBS = True
+
+DEFINES['LZMA_API_STATIC'] = 1
+HOST_DEFINES['LZMA_API_STATIC'] = 1
--- a/modules/libmar/tool/moz.build
+++ b/modules/libmar/tool/moz.build
@@ -5,26 +5,28 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 HOST_SOURCES += [
     'mar.c',
 ]
 
 HostProgram('mar')
 
-HOST_USE_LIBS += [
-    'hostmar',
-]
+# These libraries must be added in this order, to prevent linkers which are
+# dependent on the order of command-line parameters from falling over.
+HOST_USE_LIBS += [ 'hostmar' ]
+HOST_USE_LIBS += [ 'hostlzma' ]
 
 if CONFIG['MOZ_ENABLE_SIGNMAR']:
     Program('signmar')
 
     SOURCES += HOST_SOURCES
 
     USE_LIBS += [
+        'lzma',
         'mar',
         'signmar',
         'verifymar',
     ]
 
 for var in ('MAR_CHANNEL_ID', 'MOZ_APP_VERSION'):
     DEFINES[var] = '"%s"' % CONFIG[var]
     HOST_DEFINES[var] = DEFINES[var]
--- a/toolkit/mozapps/update/updater/updater-common.build
+++ b/toolkit/mozapps/update/updater/updater-common.build
@@ -52,25 +52,22 @@ elif CONFIG['OS_ARCH'] == 'Linux' and CO
     ]
     OS_LIBS += CONFIG['NSPR_LIBS']
 else:
     USE_LIBS += [
         'updatecommon',
     ]
 
 USE_LIBS += [
+    'lzma',
     'mar',
 ]
 
-if CONFIG['MOZ_SYSTEM_BZ2']:
-    OS_LIBS += CONFIG['MOZ_BZ2_LIBS']
-else:
-    USE_LIBS += [
-        'bz2',
-    ]
+DEFINES['LZMA_API_STATIC'] = 1
+HOST_DEFINES['LZMA_API_STATIC'] = 1
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     have_progressui = 1
     srcs += [
         'progressui_gtk.cpp',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':