未验证 提交 b55df7a1 编写于 作者: O openharmony_ci 提交者: Gitee

!34 fix: L0 master: 变更mbedtls编译方式

Merge pull request !34 from Kiita/220117_mbedtls_compile
......@@ -13,87 +13,14 @@
# limitations under the License.
#
mbedtls_sources = [
"library/aes.c",
"library/aesni.c",
"library/arc4.c",
"library/aria.c",
"library/asn1parse.c",
"library/asn1write.c",
"library/base64.c",
"library/bignum.c",
"library/blowfish.c",
"library/camellia.c",
"library/ccm.c",
"library/chacha20.c",
"library/chachapoly.c",
"library/cipher.c",
"library/cipher_wrap.c",
"library/cmac.c",
"library/ctr_drbg.c",
"library/des.c",
"library/dhm.c",
"library/ecdh.c",
"library/ecdsa.c",
"library/ecjpake.c",
"library/ecp.c",
"library/ecp_curves.c",
"library/entropy.c",
"library/entropy_poll.c",
"library/error.c",
"library/gcm.c",
"library/havege.c",
"library/hkdf.c",
"library/hmac_drbg.c",
"library/md.c",
"library/md2.c",
"library/md4.c",
"library/md5.c",
"library/md_wrap.c",
"library/memory_buffer_alloc.c",
"library/net_sockets.c",
"library/nist_kw.c",
"library/oid.c",
"library/padlock.c",
"library/pem.c",
"library/pk.c",
"library/pk_wrap.c",
"library/pkcs12.c",
"library/pkcs5.c",
"library/pkparse.c",
"library/pkwrite.c",
"library/platform.c",
"library/platform_util.c",
"library/poly1305.c",
"library/ripemd160.c",
"library/rsa.c",
"library/rsa_internal.c",
"library/sha1.c",
"library/sha256.c",
"library/sha512.c",
"library/ssl_ciphersuites.c",
"library/ssl_cli.c",
"library/ssl_tls.c",
"library/threading.c",
"library/timing.c",
"library/version.c",
"library/version_features.c",
"library/x509.c",
"library/x509_crl.c",
"library/x509_crt.c",
"library/xtea.c",
]
import("//third_party/mbedtls/mbedtls.gni")
if (defined(ohos_lite)) {
import("//build/lite/config/component/lite_component.gni")
import("//build/lite/ndk/ndk.gni")
defines = []
config("mbedtls_config") {
include_dirs = [
"./include",
"./include/mbedtls",
]
include_dirs = MBEDTLS_INLCUDE_DIRS
if (ohos_kernel_type == "liteos_m") {
defines += [
"__unix__",
......@@ -112,27 +39,23 @@ if (defined(ohos_lite)) {
target_type = "shared_library"
public_configs = [ ":mbedtls_config" ]
output_name = "mbedtls"
sources = mbedtls_sources
sources = MBEDTLS_SOURCES
}
lite_library("mbedtls_static") {
target_type = "static_library"
public_configs = [ ":mbedtls_config" ]
if (ohos_kernel_type == "liteos_m") {
include_dirs = [
"//kernel/liteos_m/kal/posix/include",
"//kernel/liteos_m/kernel/include",
"//kernel/liteos_m/utils",
"//third_party/musl/porting/liteos_m/kernel/include/",
]
}
output_name = "mbedtls"
sources = mbedtls_sources
sources = MBEDTLS_SOURCES
}
group("mbedtls") {
if (ohos_kernel_type == "liteos_m") {
deps = [ ":mbedtls_static" ]
if (ohos_security_huks_mbedtls_porting_path != "") {
deps = [ ohos_security_huks_mbedtls_porting_path ]
} else {
deps = [ ":mbedtls_static" ]
}
} else {
deps = [ ":mbedtls_shared" ]
}
......@@ -166,8 +89,7 @@ if (defined(ohos_lite)) {
]
}
mbedtls_sources += [
"library/certs.c",
MBEDTLS_SOURCES += [
"library/debug.c",
"library/pkcs11.c",
"library/ssl_cache.c",
......@@ -181,7 +103,7 @@ if (defined(ohos_lite)) {
]
static_library("mbedtls_gt") {
sources = mbedtls_sources
sources = MBEDTLS_SOURCES
output_name = "mbedtls_gt"
public_configs = [ ":mbedtls_profile_test" ]
}
......@@ -189,10 +111,7 @@ if (defined(ohos_lite)) {
} else {
import("//build/ohos.gni")
config("mbedtls_config") {
include_dirs = [
"./include",
"./include/mbedtls",
]
include_dirs = MBEDTLS_INLCUDE_DIRS
}
ohos_shared_library("mbedtls_shared") {
......@@ -200,7 +119,7 @@ if (defined(ohos_lite)) {
output_name = "mbedtls"
subsystem_name = "common"
part_name = "dsoftbus_standard"
sources = mbedtls_sources
sources = MBEDTLS_SOURCES
}
group("mbedtls") {
......
# Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MBEDTLSDIR = "//third_party/mbedtls/"
KERNELDIR = "//kernel/liteos_m/"
defines = []
declare_args() {
# custom compile flag for bestechnic
ohos_security_huks_mbedtls_porting_path = ""
}
LIBRARYFILES = [
"$MBEDTLSDIR/library/aes.c",
"$MBEDTLSDIR/library/aesni.c",
"$MBEDTLSDIR/library/arc4.c",
"$MBEDTLSDIR/library/aria.c",
"$MBEDTLSDIR/library/asn1parse.c",
"$MBEDTLSDIR/library/asn1write.c",
"$MBEDTLSDIR/library/base64.c",
"$MBEDTLSDIR/library/bignum.c",
"$MBEDTLSDIR/library/blowfish.c",
"$MBEDTLSDIR/library/camellia.c",
"$MBEDTLSDIR/library/ccm.c",
"$MBEDTLSDIR/library/certs.c",
"$MBEDTLSDIR/library/chacha20.c",
"$MBEDTLSDIR/library/chachapoly.c",
"$MBEDTLSDIR/library/cipher.c",
"$MBEDTLSDIR/library/cipher_wrap.c",
"$MBEDTLSDIR/library/cmac.c",
"$MBEDTLSDIR/library/ctr_drbg.c",
"$MBEDTLSDIR/library/des.c",
"$MBEDTLSDIR/library/dhm.c",
"$MBEDTLSDIR/library/ecdh.c",
"$MBEDTLSDIR/library/ecdsa.c",
"$MBEDTLSDIR/library/ecjpake.c",
"$MBEDTLSDIR/library/ecp.c",
"$MBEDTLSDIR/library/ecp_curves.c",
"$MBEDTLSDIR/library/entropy.c",
"$MBEDTLSDIR/library/entropy_poll.c",
"$MBEDTLSDIR/library/error.c",
"$MBEDTLSDIR/library/gcm.c",
"$MBEDTLSDIR/library/havege.c",
"$MBEDTLSDIR/library/hkdf.c",
"$MBEDTLSDIR/library/hmac_drbg.c",
"$MBEDTLSDIR/library/md.c",
"$MBEDTLSDIR/library/md2.c",
"$MBEDTLSDIR/library/md4.c",
"$MBEDTLSDIR/library/md5.c",
"$MBEDTLSDIR/library/md_wrap.c",
"$MBEDTLSDIR/library/memory_buffer_alloc.c",
"$MBEDTLSDIR/library/net_sockets.c",
"$MBEDTLSDIR/library/nist_kw.c",
"$MBEDTLSDIR/library/oid.c",
"$MBEDTLSDIR/library/padlock.c",
"$MBEDTLSDIR/library/pem.c",
"$MBEDTLSDIR/library/pk.c",
"$MBEDTLSDIR/library/pk_wrap.c",
"$MBEDTLSDIR/library/pkcs12.c",
"$MBEDTLSDIR/library/pkcs5.c",
"$MBEDTLSDIR/library/pkparse.c",
"$MBEDTLSDIR/library/pkwrite.c",
"$MBEDTLSDIR/library/platform.c",
"$MBEDTLSDIR/library/platform_util.c",
"$MBEDTLSDIR/library/poly1305.c",
"$MBEDTLSDIR/library/ripemd160.c",
"$MBEDTLSDIR/library/rsa.c",
"$MBEDTLSDIR/library/rsa_internal.c",
"$MBEDTLSDIR/library/sha1.c",
"$MBEDTLSDIR/library/sha256.c",
"$MBEDTLSDIR/library/sha512.c",
"$MBEDTLSDIR/library/ssl_ciphersuites.c",
"$MBEDTLSDIR/library/ssl_cli.c",
"$MBEDTLSDIR/library/ssl_tls.c",
"$MBEDTLSDIR/library/threading.c",
"$MBEDTLSDIR/library/timing.c",
"$MBEDTLSDIR/library/version.c",
"$MBEDTLSDIR/library/version_features.c",
"$MBEDTLSDIR/library/x509.c",
"$MBEDTLSDIR/library/x509_crl.c",
"$MBEDTLSDIR/library/x509_crt.c",
"$MBEDTLSDIR/library/xtea.c",
]
# MBEDTLS_SOURCES: All MBEDTLS files
MBEDTLS_SOURCES = LIBRARYFILES
MBEDTLS_INLCUDE_DIRS = [
"$MBEDTLSDIR/include",
"$MBEDTLSDIR/include/mbedtls",
]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册