security/manager/ssl/moz.build
author Ted Mielczarek <ted@mielczarek.org>
Tue, 11 Sep 2018 13:31:20 -0400
changeset 491555 e186d8665b004ef0c016b861a56c4de1103bd1cf
parent 491318 5cfda4227c6a2301c05900ee40d710b2324fb4a9
child 492008 be7177f566cb1981a0e436571542f2fc3db1197f
permissions -rw-r--r--
Bug 1399877 - globally define MOZ_DLL_PREFIX/MOZ_DLL_SUFFIX; r=gps Several source files use DLL_PREFIX/DLL_SUFFIX defines, and they all set them in moz.build using `DEFINES`. This is problematic for the WSL build because the quoting gets lost somewhere between bash and cl.exe. We cannot simply set them globally in moz.configure because their stringified definitions would conflict with the `set_config` of DLL_PREFIX/DLL_SUFFIX. Therefore, we globally define MOZ_DLL_PREFIX/MOZ_DLL_SUFFIX and change all define-related uses of DLL_PREFIX/DLL_SUFFIX to use their MOZ-equivalents instead.

# -*- 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/.

TEST_DIRS += [ 'tests' ]

XPIDL_SOURCES += [
    'nsIASN1Object.idl',
    'nsIASN1PrintableItem.idl',
    'nsIASN1Sequence.idl',
    'nsIAssociatedContentSecurity.idl',
    'nsIBadCertListener2.idl',
    'nsICertBlocklist.idl',
    'nsICertificateDialogs.idl',
    'nsICertOverrideService.idl',
    'nsIClientAuthDialogs.idl',
    'nsIContentSignatureVerifier.idl',
    'nsICryptoHash.idl',
    'nsICryptoHMAC.idl',
    'nsIGenKeypairInfoDlg.idl',
    'nsIKeygenThread.idl',
    'nsIKeyModule.idl',
    'nsILocalCertService.idl',
    'nsINSSComponent.idl',
    'nsINSSErrorsService.idl',
    'nsINSSVersion.idl',
    'nsIOSKeyStore.idl',
    'nsIPK11Token.idl',
    'nsIPK11TokenDB.idl',
    'nsIPKCS11Module.idl',
    'nsIPKCS11ModuleDB.idl',
    'nsIPKCS11Slot.idl',
    'nsIProtectedAuthThread.idl',
    'nsISecretDecoderRing.idl',
    'nsISecurityUITelemetry.idl',
    'nsISiteSecurityService.idl',
    'nsITokenDialogs.idl',
    'nsITokenPasswordDialogs.idl',
    'nsIX509Cert.idl',
    'nsIX509CertDB.idl',
    'nsIX509CertList.idl',
    'nsIX509CertValidity.idl',
]

if CONFIG['MOZ_XUL']:
    XPIDL_SOURCES += [
        'nsICertTree.idl',
    ]

XPIDL_MODULE = 'pipnss'

# These aren't actually used in production code yet, so we don't want to
# ship them with the browser.
TESTING_JS_MODULES.psm += [
    'DER.jsm',
    'X509.jsm',
]

EXPORTS += [
    'CryptoTask.h',
    'nsClientAuthRemember.h',
    'nsNSSCallbacks.h',
    'nsNSSCertificate.h',
    'nsNSSComponent.h',
    'nsNSSHelper.h',
    'nsRandomGenerator.h',
    'nsSecurityHeaderParser.h',
    'NSSErrorsService.h',
    'RootCertificateTelemetryUtils.h',
    'ScopedNSSTypes.h',
    'SharedCertVerifier.h',
]

EXPORTS.mozilla += [
    'DataStorage.h',
    'DataStorageList.h',
    'PublicSSL.h',
]

EXPORTS.mozilla.psm += [
    'PSMContentListener.h',
]

EXPORTS.ipc += [
    'DataStorageIPCUtils.h',
]

UNIFIED_SOURCES += [
    'CertBlocklist.cpp',
    'ContentSignatureVerifier.cpp',
    'CryptoTask.cpp',
    'CSTrustDomain.cpp',
    'DataStorage.cpp',
    'EnterpriseRoots.cpp',
    'LocalCertService.cpp',
    'nsCertOverrideService.cpp',
    'nsClientAuthRemember.cpp',
    'nsCryptoHash.cpp',
    'nsKeygenHandler.cpp',
    'nsKeygenHandlerContent.cpp',
    'nsKeygenThread.cpp',
    'nsKeyModule.cpp',
    'nsNSSASN1Object.cpp',
    'nsNSSCallbacks.cpp',
    'nsNSSCertHelper.cpp',
    'nsNSSCertificate.cpp',
    'nsNSSCertificateDB.cpp',
    'nsNSSCertTrust.cpp',
    'nsNSSCertValidity.cpp',
    'nsNSSComponent.cpp',
    'nsNSSIOLayer.cpp',
    'nsNSSModule.cpp',
    'nsNSSVersion.cpp',
    'nsNTLMAuthModule.cpp',
    'nsPK11TokenDB.cpp',
    'nsPKCS11Slot.cpp',
    'nsPKCS12Blob.cpp',
    'nsProtectedAuthThread.cpp',
    'nsRandomGenerator.cpp',
    'nsSecureBrowserUIImpl.cpp',
    'nsSecurityHeaderParser.cpp',
    'NSSErrorsService.cpp',
    'nsSiteSecurityService.cpp',
    'NSSKeyStore.cpp',
    'nsSSLSocketProvider.cpp',
    'nsTLSSocketProvider.cpp',
    'OSKeyStore.cpp',
    'PKCS11ModuleDB.cpp',
    'PSMContentListener.cpp',
    'PSMRunnable.cpp',
    'PublicKeyPinningService.cpp',
    'RootCertificateTelemetryUtils.cpp',
    'SecretDecoderRing.cpp',
    'SharedSSLState.cpp',
    'SSLServerCertVerification.cpp',
    'TransportSecurityInfo.cpp',
]

if CONFIG['MOZ_LIB_SECRET']:
    UNIFIED_SOURCES += [
        'LibSecret.cpp',
    ]
    CFLAGS += CONFIG['MOZ_LIB_SECRET_CFLAGS']
    CXXFLAGS += CONFIG['MOZ_LIB_SECRET_CFLAGS']

if CONFIG['OS_ARCH'] == 'Darwin':
    UNIFIED_SOURCES += [
        'KeychainSecret.cpp',
    ]
    OS_LIBS += [
        '-framework Security'
    ]

if CONFIG['OS_ARCH'] == 'WINNT':
    UNIFIED_SOURCES += [
        'CredentialManagerSecret.cpp',
    ]

IPDL_SOURCES += [
    'PPSMContentDownloader.ipdl',
]

if CONFIG['MOZ_XUL']:
    UNIFIED_SOURCES += [
        'nsCertTree.cpp',
    ]

UNIFIED_SOURCES += [
    'md4.c',
]

FINAL_LIBRARY = 'xul'

LOCAL_INCLUDES += [
    '/dom/base',
    '/dom/crypto',
    '/security/certverifier',
    '/security/pkix/include',
]

LOCAL_INCLUDES += [
    '!/dist/public/nss',
]

GENERATED_FILES = [
    'nsSTSPreloadList.h',
]
dafsa_data = GENERATED_FILES['nsSTSPreloadList.h']
dafsa_data.script = '../../../xpcom/ds/tools/make_dafsa.py'
dafsa_data.inputs = ['nsSTSPreloadList.inc']

if CONFIG['NSS_DISABLE_DBM']:
    DEFINES['NSS_DISABLE_DBM'] = '1'

DEFINES['SSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES'] = 'True'
DEFINES['NSS_ENABLE_ECC'] = 'True'

if not CONFIG['MOZ_SYSTEM_NSS']:
    USE_LIBS += [
        'crmf',
    ]

include('/ipc/chromium/chromium-config.mozbuild')

if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
    CXXFLAGS += [
        '-Wextra',
        # -Wextra enables this warning, but it's too noisy to be useful.
        '-Wno-missing-field-initializers',
    ]

    # Gecko headers aren't warning-free enough for us to enable these warnings.
    CXXFLAGS += [
        '-Wno-unused-parameter',
    ]

if CONFIG['CC_TYPE'] == 'clang-cl':
    AllowCompilerWarnings()  # workaround for bug 1090497