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
This commit is contained in:
henrike@webrtc.org 2014-10-06 22:30:46 +00:00
parent 2fe5893748
commit 8234fa6f0e
2 changed files with 92 additions and 115 deletions

View File

@ -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" ]
}
}
}
}

View File

@ -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)',
],
}],
],
}],
],
},
],