modules/libmar/verify/moz.build
author Mike Hommey <mh+mozilla@glandium.org>
Wed, 19 Jun 2019 23:26:40 +0000
changeset 533988 b632ea1ae36e49a6ab60ed2b34ee2e967dcb26d9
parent 346136 3ec6380fca8207fa199693206a3ca24975bf9833
permissions -rw-r--r--
Bug 1547217 - Reshuffle how verifymar is linked. r=chmanchester, a=jcristau The conditions under which verifymar is built were not aligned with what kind of setups are actually doing something. For instance --disable-signmar --enable-verify-mar was building the verifymar library but not doing anything with it. OTOH, building with --enable-signmar --disable-verify-mar did build it but its code was eliminated at link time because it's unused. Finally, the conditions between modules/libmar/verify/moz.build and toolkit/mozapps/update/updater/updater-common.build weren't aligned and broke some non-Linux tier-3 platforms. We remedy the latter by moving the flags and libraries verifymar needs to verifymar, so that things that link verifymar inherit them. And while in the vicinity, replace a use of NSPR_LIBS with the pseudo-library `nspr` which has the same effect. Differential Revision: https://phabricator.services.mozilla.com/D34620

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# 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/.

Library('verifymar')

UNIFIED_SOURCES += [
    'cryptox.c',
    'mar_verify.c',
]

FORCE_STATIC_LIB = True

if CONFIG['OS_ARCH'] == 'WINNT':
    USE_STATIC_LIBS = True
elif CONFIG['OS_ARCH'] == 'Darwin':
    UNIFIED_SOURCES += [
      'MacVerifyCrypto.cpp',
    ]
    OS_LIBS += [
      '-framework Security',
    ]
else:
    DEFINES['MAR_NSS'] = True
    LOCAL_INCLUDES += ['../sign']
    USE_LIBS += [
        'nspr',
        'nss',
        'signmar',
    ]
    # Ideally, this would be '-Wl,-rpath=$ORIGIN', but the build system
    # doesn't do the right escaping yet. Even more ideally, this would
    # be LDFLAGS, but the build system doesn't propagate those like USE_LIBS
    # and OS_LIBS. Bug #1041943.
    OS_LIBS += [
        '-Wl,-rpath=\\$$ORIGIN',
    ]

LOCAL_INCLUDES += [
    '../src',
]