This repository has been archived by the owner on Jul 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathbuild_mbedtls.sh
executable file
·51 lines (47 loc) · 1.7 KB
/
build_mbedtls.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Copyright 2018-2020 Google LLC
#
# This is part of the Google Cloud IoT Device SDK for Embedded C.
# It is licensed under the BSD 3-Clause license; you may not use this file
# except in compliance with the License.
#
# You may obtain a copy of the License at:
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
echo
echo "--------------------------"
echo "| mbedTLS LICENSE Notice |"
echo "--------------------------"
echo
echo "Unless specifically indicated otherwise in a file, files are licensed"
echo "under the Apache 2.0 license, as can be found in: apache-2.0.txt"
echo
echo "the apache-2.0.txt file can be accessed here:"
echo " https://www.apache.org/licenses/LICENSE-2.0"
echo
echo "For more information about the mbedTLS license, please check the LICENSE"
echo "file of the mbedTLS directory after this auto-checkout procedure"
echo "completes, or check their github repository at the following address:"
echo " https://github.com/ARMmbed/mbedtls"
echo
read -p "Continue to auto-download and build mbedTLS? [Y/N] " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo
echo "exiting build."
echo
exit 1
fi
mkdir -p ../../third_party/tls
cd ../../third_party/tls
git clone -b mbedtls-2.12.0 https://github.com/ARMmbed/mbedtls.git
cd mbedtls
# "-O2" comes from mbedtls/library/Makefile "CFLAGS ?= -O2" define
make CFLAGS="-O2 -DMBEDTLS_PLATFORM_MEMORY $1"
echo "mbedTLS Build Complete."