diff options
author | henrike@webrtc.org <henrike@webrtc.org> | 2014-10-06 22:30:46 +0000 |
---|---|---|
committer | henrike@webrtc.org <henrike@webrtc.org> | 2014-10-06 22:30:46 +0000 |
commit | 8234fa6f0ef4c142fa0dc3d7d8d43ade45216008 (patch) | |
tree | b6c18c1efb64f784abeec8d9499b3257715a2890 /webrtc | |
parent | 2fe589374833629011e6e3e11a1e76203afcfee7 (diff) | |
download | webrtc-8234fa6f0ef4c142fa0dc3d7d8d43ade45216008.tar.gz |
Only configure the SSL library in one place.
Build settings now use use_openssl in both Chromium and standalone builds. It
moves all the platform-specific SSL-related build checks to be conditioned on
this flag as appropriate.
This is to avoid colliding with Chromium's transition away from NSS.
BUG=chromium:413497
R=henrike@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/29559004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7378 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'webrtc')
-rw-r--r-- | webrtc/base/BUILD.gn | 48 | ||||
-rw-r--r-- | webrtc/base/base.gyp | 159 |
2 files changed, 92 insertions, 115 deletions
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn index 3be8a3aeca..d59ad38441 100644 --- a/webrtc/base/BUILD.gn +++ b/webrtc/base/BUILD.gn @@ -40,7 +40,7 @@ config("openssl_config") { ] } -config("no_openssl_config") { +config("nss_config") { defines = [ "SSL_USE_NSS", "HAVE_NSS_SSL_H", @@ -463,24 +463,30 @@ static_library("webrtc_base") { "opensslstreamadapter.h", ] } else { - public_configs += [ ":no_openssl_config" ] + public_configs += [ ":nss_config" ] + if (rtc_build_ssl) { + if (build_with_chromium) { + deps += [ "//crypto:platform" ] + } else { + deps += [ "//net/third_party/nss/ssl:libssl" ] + if (is_linux) { + deps += [ ":linux_system_ssl" ] + } else { + deps += [ + "//third_party/nss:nspr", + "//third_party/nss:nss", + ] + } + } + } else { + configs += [ "external_ssl_library" ] + } sources += [ "nssidentity.cc", "nssidentity.h", "nssstreamadapter.cc", "nssstreamadapter.h", ] - if (is_mac || is_ios || is_win) { - if (rtc_build_ssl) { - deps += [ - "//net/third_party/nss/ssl:libssl", - "//third_party/nss:nspr", - "//third_party/nss:nss", - ] - } else { - configs += [ "external_ssl_library" ] - } - } } if (is_android) { @@ -516,13 +522,9 @@ static_library("webrtc_base") { if (is_linux) { libs += [ - "crypto", "dl", "rt", ] - if (rtc_build_ssl) { - configs += [ "//third_party/nss:system_nss_no_ssl_config" ] - } } if (is_mac) { @@ -593,16 +595,4 @@ static_library("webrtc_base") { "linux.h", ] } - - if (is_posix && !is_mac && !is_ios && !is_android) { - if (build_with_chromium) { - deps += [ "//crypto:platform" ] - } else { - if (rtc_build_ssl) { - deps += [ ":linux_system_ssl" ] - } else { - configs += [ "external_ssl_library" ] - } - } - } } diff --git a/webrtc/base/base.gyp b/webrtc/base/base.gyp index 07f4c0bae0..881e43856c 100644 --- a/webrtc/base/base.gyp +++ b/webrtc/base/base.gyp @@ -23,6 +23,25 @@ ], }], ], + 'variables': { + 'openssl_sources': [ + 'openssl.h', + 'openssladapter.cc', + 'openssladapter.h', + 'openssldigest.cc', + 'openssldigest.h', + 'opensslidentity.cc', + 'opensslidentity.h', + 'opensslstreamadapter.cc', + 'opensslstreamadapter.h', + ], + 'nss_sources': [ + 'nssidentity.cc', + 'nssidentity.h', + 'nssstreamadapter.cc', + 'nssstreamadapter.h', + ], + }, 'targets': [ { # Temporary target until Chromium's @@ -482,48 +501,52 @@ '../overrides/webrtc/base/logging.h', ], }], - ['use_openssl==1', { - 'defines': [ - 'SSL_USE_OPENSSL', - 'HAVE_OPENSSL_SSL_H', - ], - 'direct_dependent_settings': { - 'defines': [ - 'SSL_USE_OPENSSL', - 'HAVE_OPENSSL_SSL_H', - ], - }, + ['use_legacy_ssl_defaults==1', { + # SSL backend is set via sslconfig.h. Pull in both NSS and OpenSSL + # support code. The appropriate set is configured via preprocessor + # defines. 'sources': [ - 'openssl.h', - 'openssladapter.cc', - 'openssladapter.h', - 'openssldigest.cc', - 'openssldigest.h', - 'opensslidentity.cc', - 'opensslidentity.h', - 'opensslstreamadapter.cc', - 'opensslstreamadapter.h', + '<@(openssl_sources)', + '<@(nss_sources)', ], 'conditions': [ - ['build_ssl==1', { - 'dependencies': [ - '<(DEPTH)/third_party/boringssl/boringssl.gyp:boringssl', - ], - }, { + ['build_ssl!=1', { 'include_dirs': [ '<(ssl_root)', ], }], ], }, { - 'sources': [ - 'nssidentity.cc', - 'nssidentity.h', - 'nssstreamadapter.cc', - 'nssstreamadapter.h', - ], 'conditions': [ - ['use_legacy_ssl_defaults!=1', { + ['use_openssl==1', { + # Configure for OpenSSL/BoringSSL. + 'defines': [ + 'SSL_USE_OPENSSL', + 'HAVE_OPENSSL_SSL_H', + ], + 'direct_dependent_settings': { + 'defines': [ + 'SSL_USE_OPENSSL', + 'HAVE_OPENSSL_SSL_H', + ], + }, + 'sources': [ + '<@(openssl_sources)', + ], + 'conditions': [ + # Pull in the external or bundled OpenSSL as appropriate. + ['build_ssl==1', { + 'dependencies': [ + '<(DEPTH)/third_party/boringssl/boringssl.gyp:boringssl', + ], + }, { + 'include_dirs': [ + '<(ssl_root)', + ], + }], + ], + }, { + # Configure for NSS. 'defines': [ 'SSL_USE_NSS', 'HAVE_NSS_SSL_H', @@ -536,14 +559,28 @@ 'SSL_USE_NSS_RNG', ], }, - }], - ['OS=="mac" or OS=="ios" or OS=="win"', { + 'sources': [ + '<@(nss_sources)', + ], 'conditions': [ + # Pull in the external or bundled NSS as appropriate. ['build_ssl==1', { 'dependencies': [ '<(DEPTH)/net/third_party/nss/ssl.gyp:libssl', - '<(DEPTH)/third_party/nss/nss.gyp:nspr', - '<(DEPTH)/third_party/nss/nss.gyp:nss', + ], + 'conditions': [ + # On some platforms, the rest of NSS is bundled. On others, + # it's pulled from the system. + ['OS == "mac" or OS == "ios" or OS == "win"', { + 'dependencies': [ + '<(DEPTH)/third_party/nss/nss.gyp:nspr', + '<(DEPTH)/third_party/nss/nss.gyp:nss', + ], + }, { + 'dependencies': [ + '<(DEPTH)/build/linux/system.gyp:ssl', + ], + }], ], }, { 'include_dirs': [ @@ -555,14 +592,6 @@ ], }], ['OS == "android"', { - 'defines': [ - 'HAVE_OPENSSL_SSL_H' - ], - 'direct_dependent_settings': { - 'defines': [ - 'HAVE_OPENSSL_SSL_H' - ], - }, 'link_settings': { 'libraries': [ '-llog', @@ -570,20 +599,6 @@ ], }, }, { - 'conditions': [ - ['use_legacy_ssl_defaults!=1', { - 'defines': [ - 'HAVE_NSS_SSL_H', - 'SSL_USE_NSS_RNG', - ], - 'direct_dependent_settings': { - 'defines': [ - 'HAVE_NSS_SSL_H', - 'SSL_USE_NSS_RNG', - ], - }, - }], - ], 'sources!': [ 'ifaddrs-android.cc', 'ifaddrs-android.h', @@ -625,21 +640,6 @@ '-lrt', ], }, - 'conditions': [ - ['build_ssl==1', { - 'link_settings': { - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")', - ], - }, - 'cflags': [ - '<!@(<(pkg-config) --cflags nss)', - ], - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)', - ], - }], - ], }, { 'sources!': [ 'dbus.cc', @@ -755,19 +755,6 @@ 'linux.h', ], }], - ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', { - 'conditions': [ - ['build_ssl==1', { - 'dependencies': [ - '<(DEPTH)/build/linux/system.gyp:ssl', - ], - }, { - 'include_dirs': [ - '<(ssl_root)', - ], - }], - ], - }], ], }, ], |