blob: f4eee22e3f3be9f6521d439edd9588770e0a729f (
plain) (
blame)
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
51
52
53
54
55
56
57
58
59
60
|
#!/usr/bin/env bash
# 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/.
set -o errexit
set -o nounset
set -o pipefail
if [[ -z "${OPENSSL_DIR}" ]]; then
echo "No OPENSSL_DIR."
exit 1
fi
if [[ -z "${OPENSSL_VERSION}" ]]; then
echo "No OPENSSL_VERSION."
exit 1
fi
if [[ -f "${OPENSSL_DIR}/lib/libssl.so" ]] && \
[[ "${OPENSSL_DIR}/lib/libssl.so" -nt "${0}" ]] ; then
exit 0
fi
echo "Building ${OPENSSL_DIR}/lib/libssl.so"
S3_BUCKET="https://servo-deps.s3.amazonaws.com/android-deps"
S3_URL="${S3_BUCKET}/openssl-${OPENSSL_VERSION}.tar.gz"
if [[ ! -d "${OPENSSL_DIR}/src/openssl-${OPENSSL_VERSION}" ]]; then
mkdir -p "${OPENSSL_DIR}/src"
curl "${S3_URL}" | tar xzf - -C "${OPENSSL_DIR}/src"
fi
if [[ ! -d "${OPENSSL_DIR}/src/openssl-${OPENSSL_VERSION}" ]]; then
echo "Failed to download ${OPENSSL_DIR}/src/openssl-${OPENSSL_VERSION}"
exit 1
fi
cd "${OPENSSL_DIR}/src/openssl-${OPENSSL_VERSION}"
./Configure shared \
--prefix="${OPENSSL_DIR}" \
--openssldir="${OPENSSL_DIR}" \
-no-ssl2 -no-ssl3 -no-comp -no-engine -no-hw \
linux-generic64 \
-fPIC -fno-omit-frame-pointer \
-Wall -Wno-error=macro-redefined -Wno-unknown-attributes \
${CFLAGS:-}
make depend
make all
make install_sw
if [[ ! -f "${OPENSSL_DIR}/lib/libssl.so" ]]; then
echo "Failed to build ${OPENSSL_DIR}/lib/libssl.so"
exit 1
fi
|