Migrate circle config to 2.1 goodness
This commit is contained in:
parent
6f9401f174
commit
1ff853ada9
|
|
@ -1,229 +1,268 @@
|
||||||
restore_registry: &RESTORE_REGISTRY
|
version: 2.1
|
||||||
restore_cache:
|
|
||||||
key: registry-4
|
|
||||||
save_registry: &SAVE_REGISTRY
|
|
||||||
save_cache:
|
|
||||||
key: registry-4-{{ .BuildNum }}
|
|
||||||
paths:
|
|
||||||
- /usr/local/cargo/registry/index
|
|
||||||
openssl_key: &OPENSSL_KEY
|
|
||||||
key: lib-{{ checksum "~/lib_key" }}-{{ checksum "test/build_openssl.sh" }}
|
|
||||||
restore_openssl: &RESTORE_OPENSSL
|
|
||||||
restore_cache:
|
|
||||||
<<: *OPENSSL_KEY
|
|
||||||
save_openssl: &SAVE_OPENSSL
|
|
||||||
save_cache:
|
|
||||||
<<: *OPENSSL_KEY
|
|
||||||
paths:
|
|
||||||
- /openssl
|
|
||||||
deps_key: &DEPS_KEY
|
|
||||||
key: deps-1.24.1-{{ checksum "Cargo.lock" }}-{{ checksum "~/lib_key" }}-2
|
|
||||||
restore_deps: &RESTORE_DEPS
|
|
||||||
restore_cache:
|
|
||||||
<<: *DEPS_KEY
|
|
||||||
save_deps: &SAVE_DEPS
|
|
||||||
save_cache:
|
|
||||||
<<: *DEPS_KEY
|
|
||||||
paths:
|
|
||||||
- target
|
|
||||||
- /usr/local/cargo/registry/cache
|
|
||||||
|
|
||||||
job: &JOB
|
|
||||||
working_directory: ~/build
|
|
||||||
docker:
|
|
||||||
- image: rust:1.24.1
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run: apt-get update
|
|
||||||
- run: apt-get remove -y libssl-dev
|
|
||||||
- run: ./test/add_target.sh
|
|
||||||
- *RESTORE_REGISTRY
|
|
||||||
- run: cargo generate-lockfile --verbose
|
|
||||||
- *SAVE_REGISTRY
|
|
||||||
- run: echo "${LIBRARY}-${VERSION}-${TARGET}" > ~/lib_key
|
|
||||||
- *RESTORE_OPENSSL
|
|
||||||
- run: ./test/build_openssl.sh
|
|
||||||
- *SAVE_OPENSSL
|
|
||||||
- *RESTORE_DEPS
|
|
||||||
- run: cargo run --manifest-path=systest/Cargo.toml --target $TARGET --features "$FEATURES"
|
|
||||||
- run: |
|
|
||||||
ulimit -c unlimited
|
|
||||||
export PATH=$OPENSSL_DIR/bin:$PATH
|
|
||||||
if [ "${NO_RUN}" = "1" ]; then
|
|
||||||
TEST_ARGS=--no-run
|
|
||||||
fi
|
|
||||||
cargo test \
|
|
||||||
--manifest-path=openssl/Cargo.toml \
|
|
||||||
--target $TARGET \
|
|
||||||
--features "$FEATURES" \
|
|
||||||
$TEST_ARGS
|
|
||||||
- run:
|
|
||||||
command: |
|
|
||||||
mkdir -p /tmp/core_dumps
|
|
||||||
find . -name "core.*" -exec cp \{\} /tmp/core_dumps \;
|
|
||||||
cp target/$TARGET/debug/openssl-* /tmp/core_dumps
|
|
||||||
when: on_fail
|
|
||||||
- store_artifacts:
|
|
||||||
path: /tmp/core_dumps
|
|
||||||
- *SAVE_DEPS
|
|
||||||
|
|
||||||
macos_job: &MACOS_JOB
|
|
||||||
macos:
|
|
||||||
xcode: "9.0"
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run: sudo mkdir /opt
|
|
||||||
- run: sudo chown -R $USER /usr/local /opt
|
|
||||||
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.24.1
|
|
||||||
- run: sudo ln -s $CARGO_HOME/bin/* /usr/local/bin
|
|
||||||
- run: cargo generate-lockfile --verbose
|
|
||||||
- run: echo "homebrew-x86_64-apple-darwin" > ~/lib_key
|
|
||||||
- *RESTORE_DEPS
|
|
||||||
- run: cargo run --manifest-path=systest/Cargo.toml --features "$FEATURES"
|
|
||||||
- run: |
|
|
||||||
PATH=/usr/local/opt/openssl/bin:$PATH
|
|
||||||
cargo test --manifest-path=openssl/Cargo.toml --features "$FEATURES"
|
|
||||||
- *SAVE_DEPS
|
|
||||||
macos_env: &MACOS_ENV
|
|
||||||
RUSTUP_HOME: /usr/local/rustup
|
|
||||||
CARGO_HOME: /usr/local/cargo
|
|
||||||
|
|
||||||
vendored: &VENDORED
|
|
||||||
FEATURES: vendored
|
|
||||||
LIBRARY: ""
|
|
||||||
openssl_111: &OPENSSL_111
|
|
||||||
LIBRARY: openssl
|
|
||||||
VERSION: 1.1.1
|
|
||||||
openssl_110: &OPENSSL_110
|
|
||||||
LIBRARY: openssl
|
|
||||||
VERSION: 1.1.0i
|
|
||||||
openssl_102: &OPENSSL_102
|
|
||||||
LIBRARY: openssl
|
|
||||||
VERSION: 1.0.2p
|
|
||||||
openssl_101: &OPENSSL_101
|
|
||||||
LIBRARY: openssl
|
|
||||||
VERSION: 1.0.1u
|
|
||||||
libressl_250: &LIBRESSL_250
|
|
||||||
LIBRARY: libressl
|
|
||||||
VERSION: 2.5.0
|
|
||||||
libressl_290: &LIBRESSL_290
|
|
||||||
LIBRARY: libressl
|
|
||||||
VERSION: 2.9.0
|
|
||||||
|
|
||||||
x86_64: &X86_64
|
|
||||||
TARGET: x86_64-unknown-linux-gnu
|
|
||||||
musl: &MUSL
|
|
||||||
TARGET: x86_64-unknown-linux-musl
|
|
||||||
i686: &I686
|
|
||||||
TARGET: i686-unknown-linux-gnu
|
|
||||||
armhf: &ARMHF
|
|
||||||
TARGET: arm-unknown-linux-gnueabihf
|
|
||||||
NO_RUN: 1
|
|
||||||
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
|
||||||
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_AR: arm-linux-gnueabihf-ar
|
|
||||||
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER: qemu-arm-static
|
|
||||||
darwin: &DARWIN
|
|
||||||
TARGET: x86_64-apple-darwin
|
|
||||||
|
|
||||||
base: &BASE
|
|
||||||
RUST_BACKTRACE: 1
|
|
||||||
OPENSSL_DIR: /openssl
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
jobs:
|
jobs:
|
||||||
musl-vendored:
|
linux:
|
||||||
<<: *JOB
|
parameters:
|
||||||
|
target:
|
||||||
|
type: string
|
||||||
|
library:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
version:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
vendored:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
no_run:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
docker:
|
docker:
|
||||||
- image: rust:1.24.1
|
- image: rust:1.24.1
|
||||||
environment:
|
environment:
|
||||||
<<: [*VENDORED, *MUSL, *BASE]
|
RUST_BACKTRACE: 1
|
||||||
x86_64-vendored:
|
OPENSSL_DIR: /opt/openssl
|
||||||
<<: *JOB
|
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
||||||
environment:
|
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_AR: arm-linux-gnueabihf-ar
|
||||||
<<: [*VENDORED, *X86_64, *BASE]
|
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER: qemu-arm-static
|
||||||
x86_64-openssl-1.1.1:
|
steps:
|
||||||
<<: *JOB
|
- checkout
|
||||||
environment:
|
- run: apt-get update
|
||||||
<<: [*OPENSSL_111, *X86_64, *BASE]
|
- run: apt-get remove -y libssl-dev
|
||||||
x86_64-openssl-1.1.0:
|
- run: |
|
||||||
<<: *JOB
|
case "<< parameters.target >>" in
|
||||||
environment:
|
"i686-unknown-linux-gnu")
|
||||||
<<: [*OPENSSL_110, *X86_64, *BASE]
|
apt-get install -y --no-install-recommends gcc-multilib
|
||||||
x86_64-openssl-1.0.2:
|
;;
|
||||||
<<: *JOB
|
"x86_64-unknown-linux-musl")
|
||||||
environment:
|
apt-get install -y --no-install-recommends musl-tools
|
||||||
<<: [*OPENSSL_102, *X86_64, *BASE]
|
;;
|
||||||
x86_64-openssl-1.0.1:
|
"arm-unknown-linux-gnueabihf")
|
||||||
<<: *JOB
|
dpkg --add-architecture armhf
|
||||||
environment:
|
apt-get update
|
||||||
<<: [*OPENSSL_101, *X86_64, *BASE]
|
apt-get install -y --no-install-recommends \
|
||||||
i686-vendored:
|
gcc-arm-linux-gnueabihf \
|
||||||
<<: *JOB
|
libc6-dev:armhf \
|
||||||
environment:
|
qemu-user-static
|
||||||
<<: [*VENDORED, *I686, *BASE]
|
;;
|
||||||
i686-openssl-1.1.1:
|
"x86_64-unknown-linux-gnu")
|
||||||
<<: *JOB
|
exit 0
|
||||||
environment:
|
esac
|
||||||
<<: [*OPENSSL_111, *I686, *BASE]
|
|
||||||
i686-openssl-1.1.0:
|
rustup target add << parameters.target >>
|
||||||
<<: *JOB
|
- restore_cache:
|
||||||
environment:
|
key: openssl-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>
|
||||||
<<: [*OPENSSL_110, *I686, *BASE]
|
- run: |
|
||||||
i686-openssl-1.0.2:
|
if [ -d "$OPENSSL_DIR" ]; then
|
||||||
<<: *JOB
|
exit 0
|
||||||
environment:
|
fi
|
||||||
<<: [*OPENSSL_102, *I686, *BASE]
|
|
||||||
armhf-vendored:
|
case "<< parameters.library >>" in
|
||||||
<<: *JOB
|
"libressl")
|
||||||
environment:
|
URL="https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-<< parameters.version >>.tar.gz"
|
||||||
<<: [*VENDORED, *ARMHF, *BASE]
|
;;
|
||||||
armhf-openssl-1.1.1:
|
"openssl")
|
||||||
<<: *JOB
|
URL="https://openssl.org/source/openssl-<< parameters.version >>.tar.gz"
|
||||||
environment:
|
;;
|
||||||
<<: [*OPENSSL_111, *ARMHF, *BASE]
|
"")
|
||||||
armhf-openssl-1.1.0:
|
exit 0
|
||||||
<<: *JOB
|
;;
|
||||||
environment:
|
esac
|
||||||
<<: [*OPENSSL_110, *ARMHF, *BASE]
|
|
||||||
armhf-openssl-1.0.2:
|
case "<< parameters.target >>" in
|
||||||
<<: *JOB
|
"x86_64-unknown-linux-gnu")
|
||||||
environment:
|
OS_COMPILER=linux-x86_64
|
||||||
<<: [*OPENSSL_102, *ARMHF, *BASE]
|
OS_FLAGS=""
|
||||||
x86_64-libressl-2.5.0:
|
;;
|
||||||
<<: *JOB
|
"i686-unknown-linux-gnu")
|
||||||
environment:
|
OS_COMPILER=linux-elf
|
||||||
<<: [*LIBRESSL_250, *X86_64, *BASE]
|
OS_FLAGS=-m32
|
||||||
x86_64-libressl-2.9.0:
|
;;
|
||||||
<<: *JOB
|
"arm-unknown-linux-gnueabihf")
|
||||||
environment:
|
OS_COMPILER=linux-armv4
|
||||||
<<: [*LIBRESSL_290, *X86_64, *BASE]
|
OS_FLAGS=""
|
||||||
|
export AR=arm-linux-gnueabihf-ar
|
||||||
|
export CC=arm-linux-gnueabihf-gcc
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
mkdir /tmp/build
|
||||||
|
cd /tmp/build
|
||||||
|
|
||||||
|
curl -L $URL | tar --strip-components=1 -xzf -
|
||||||
|
|
||||||
|
case "<< parameters.library >>" in
|
||||||
|
"openssl")
|
||||||
|
./Configure --prefix=$OPENSSL_DIR $OS_COMPILER -fPIC -g $OS_FLAGS no-shared
|
||||||
|
;;
|
||||||
|
"libressl")
|
||||||
|
./configure --prefix=$OPENSSL_DIR --disable-shared --with-pic
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
make
|
||||||
|
make install_sw
|
||||||
|
- save_cache:
|
||||||
|
key: openssl-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>
|
||||||
|
paths:
|
||||||
|
- /opt/openssl
|
||||||
|
- restore_cache:
|
||||||
|
key: registry
|
||||||
|
- run: cargo generate-lockfile
|
||||||
|
- save_cache:
|
||||||
|
key: registry-{{ .BuildNum }}
|
||||||
|
paths:
|
||||||
|
- /usr/local/cargo/registry/index
|
||||||
|
- restore_cache:
|
||||||
|
key: deps-1.24.1-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>-{{ checksum "Cargo.lock" }}
|
||||||
|
- run: |
|
||||||
|
cargo run \
|
||||||
|
--manifest-path=systest/Cargo.toml \
|
||||||
|
<<# parameters.vendored >>--features vendored<</ parameters.vendored >> \
|
||||||
|
--target << parameters.target >>
|
||||||
|
- run: |
|
||||||
|
ulimit -c unlimited
|
||||||
|
export PATH=$OPENSSL_DIR/bin:$PATH
|
||||||
|
cargo test \
|
||||||
|
--manifest-path=openssl/Cargo.toml \
|
||||||
|
<<# parameters.vendored >>--features vendored<</ parameters.vendored >> \
|
||||||
|
--target << parameters.target >> \
|
||||||
|
<<# parameters.no_run >>--no-run<</ parameters.no_run >>
|
||||||
|
- save_cache:
|
||||||
|
key: deps-1.24.1-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>-{{ checksum "Cargo.lock" }}
|
||||||
|
paths:
|
||||||
|
- /usr/local/cargo/registry/cache
|
||||||
|
- target
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
mkdir -p /tmp/core_dumps
|
||||||
|
find . -name "core.*" -exec cp \{\} /tmp/core_dumps \;
|
||||||
|
cp target/<< parameters.target >>/debug/openssl-* /tmp/core_dumps
|
||||||
|
when: on_fail
|
||||||
|
- store_artifacts:
|
||||||
|
path: /tmp/core_dumps
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
<<: *MACOS_JOB
|
parameters:
|
||||||
|
vendored:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
macos:
|
||||||
|
xcode: "9.0"
|
||||||
environment:
|
environment:
|
||||||
<<: [*MACOS_ENV]
|
RUST_BACKTRACE: 1
|
||||||
macos-vendored:
|
steps:
|
||||||
<<: *MACOS_JOB
|
- checkout
|
||||||
environment:
|
- run: sudo mkdir /opt
|
||||||
<<: [*VENDORED, *MACOS_ENV]
|
- run: sudo chown -R $USER /usr/local/ /opt
|
||||||
|
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.24.1
|
||||||
|
- run: sudo ln -s ~/.cargo/bin/* /usr/local/bin
|
||||||
|
- run: cargo generate-lockfile
|
||||||
|
- restore_cache:
|
||||||
|
key: deps-1.24.1-macos-<< parameters.vendored >>-{{ checksum "Cargo.lock" }}
|
||||||
|
- run: |
|
||||||
|
cargo run \
|
||||||
|
--manifest-path=systest/Cargo.toml \
|
||||||
|
<<# parameters.vendored >> --features vendored <</ parameters.vendored >>
|
||||||
|
- run: |
|
||||||
|
PATH=/usr/local/opt/openssl/bin:$PATH
|
||||||
|
cargo test \
|
||||||
|
--manifest-path=openssl/Cargo.toml \
|
||||||
|
<<# parameters.vendored >> --features vendored <</ parameters.vendored >>
|
||||||
|
- save_cache:
|
||||||
|
key: deps-1.24.1-macos-<< parameters.vendored >>-{{ checksum "Cargo.lock" }}
|
||||||
|
paths:
|
||||||
|
- ~/.cargo/registry/cache
|
||||||
|
- target
|
||||||
|
|
||||||
|
openssl_111: &openssl_111
|
||||||
|
library: openssl
|
||||||
|
version: 1.1.1a
|
||||||
|
openssl_110: &openssl_110
|
||||||
|
library: openssl
|
||||||
|
version: 1.1.0j
|
||||||
|
openssl_102: &openssl_102
|
||||||
|
library: openssl
|
||||||
|
version: 1.0.2q
|
||||||
|
openssl_101: &openssl_101
|
||||||
|
library: openssl
|
||||||
|
version: 1.0.1u
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
test:
|
||||||
tests:
|
|
||||||
jobs:
|
jobs:
|
||||||
- musl-vendored
|
- linux:
|
||||||
- x86_64-vendored
|
name: musl-vendored
|
||||||
- x86_64-openssl-1.1.1
|
target: x86_64-unknown-linux-musl
|
||||||
- x86_64-openssl-1.1.0
|
vendored: true
|
||||||
- x86_64-openssl-1.0.2
|
- linux:
|
||||||
- x86_64-openssl-1.0.1
|
name: x86_64-vendored
|
||||||
- i686-vendored
|
target: x86_64-unknown-linux-gnu
|
||||||
- i686-openssl-1.1.1
|
vendored: true
|
||||||
- i686-openssl-1.1.0
|
- linux:
|
||||||
- i686-openssl-1.0.2
|
<<: *openssl_111
|
||||||
- armhf-vendored
|
name: x86_64-openssl-1.1.1
|
||||||
- armhf-openssl-1.1.1
|
target: x86_64-unknown-linux-gnu
|
||||||
- armhf-openssl-1.1.0
|
- linux:
|
||||||
- armhf-openssl-1.0.2
|
<<: *openssl_110
|
||||||
- x86_64-libressl-2.5.0
|
name: x86_64-openssl-1.1.0
|
||||||
- x86_64-libressl-2.9.0
|
target: x86_64-unknown-linux-gnu
|
||||||
- macos
|
- linux:
|
||||||
- macos-vendored
|
<<: *openssl_102
|
||||||
|
name: x86_64-openssl-1.0.2
|
||||||
|
target: x86_64-unknown-linux-gnu
|
||||||
|
- linux:
|
||||||
|
<<: *openssl_101
|
||||||
|
name: x86_64-openssl-1.0.1
|
||||||
|
target: x86_64-unknown-linux-gnu
|
||||||
|
- linux:
|
||||||
|
name: i686-vendored
|
||||||
|
target: i686-unknown-linux-gnu
|
||||||
|
vendored: true
|
||||||
|
- linux:
|
||||||
|
<<: *openssl_111
|
||||||
|
name: i686-openssl-1.1.1
|
||||||
|
target: i686-unknown-linux-gnu
|
||||||
|
- linux:
|
||||||
|
<<: *openssl_110
|
||||||
|
name: i686-openssl-1.1.0
|
||||||
|
target: i686-unknown-linux-gnu
|
||||||
|
- linux:
|
||||||
|
<<: *openssl_102
|
||||||
|
name: i686-openssl-1.0.2
|
||||||
|
target: i686-unknown-linux-gnu
|
||||||
|
- linux:
|
||||||
|
name: armhf-vendored
|
||||||
|
target: arm-unknown-linux-gnueabihf
|
||||||
|
vendored: true
|
||||||
|
no_run: true
|
||||||
|
- linux:
|
||||||
|
<<: *openssl_111
|
||||||
|
name: armhf-openssl-1.1.1
|
||||||
|
target: arm-unknown-linux-gnueabihf
|
||||||
|
no_run: true
|
||||||
|
- linux:
|
||||||
|
<<: *openssl_110
|
||||||
|
name: armhf-openssl-1.1.0
|
||||||
|
target: arm-unknown-linux-gnueabihf
|
||||||
|
no_run: true
|
||||||
|
- linux:
|
||||||
|
<<: *openssl_102
|
||||||
|
name: armhf-openssl-1.0.2
|
||||||
|
target: arm-unknown-linux-gnueabihf
|
||||||
|
no_run: true
|
||||||
|
- linux:
|
||||||
|
name: x86_64-libressl-2.5
|
||||||
|
target: x86_64-unknown-linux-gnu
|
||||||
|
library: libressl
|
||||||
|
version: 2.5.5
|
||||||
|
- linux:
|
||||||
|
name: x86_64-libressl-2.9
|
||||||
|
target: x86_64-unknown-linux-gnu
|
||||||
|
library: libressl
|
||||||
|
version: 2.9.0
|
||||||
|
- macos:
|
||||||
|
name: macos
|
||||||
|
- macos:
|
||||||
|
name: macos-vendored
|
||||||
|
vendored: true
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
case "${TARGET}" in
|
|
||||||
"x86_64-unknown-linux-gnu")
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
"i686-unknown-linux-gnu")
|
|
||||||
apt-get install -y --no-install-recommends gcc-multilib
|
|
||||||
;;
|
|
||||||
"x86_64-unknown-linux-musl")
|
|
||||||
apt-get install -y --no-install-recommends musl-tools
|
|
||||||
;;
|
|
||||||
"arm-unknown-linux-gnueabihf")
|
|
||||||
dpkg --add-architecture armhf
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
gcc-arm-linux-gnueabihf \
|
|
||||||
libc6-dev:armhf \
|
|
||||||
qemu-user-static
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
rustup target add ${TARGET}
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
if [ -d "${OPENSSL_DIR}" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${LIBRARY}" in
|
|
||||||
"libressl")
|
|
||||||
URL1="http://ftp3.usa.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz"
|
|
||||||
URL2="http://ftp.eu.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz"
|
|
||||||
;;
|
|
||||||
"openssl")
|
|
||||||
URL1="https://openssl.org/source/openssl-${VERSION}.tar.gz"
|
|
||||||
URL2="http://mirrors.ibiblio.org/openssl/source/openssl-${VERSION}.tar.gz"
|
|
||||||
;;
|
|
||||||
"")
|
|
||||||
# using the vendored builds
|
|
||||||
exit 0;
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
apt-get install -y --no-install-recommends curl
|
|
||||||
|
|
||||||
case "${TARGET}" in
|
|
||||||
"x86_64-unknown-linux-gnu")
|
|
||||||
OS_COMPILER=linux-x86_64
|
|
||||||
OS_FLAGS=""
|
|
||||||
;;
|
|
||||||
"i686-unknown-linux-gnu")
|
|
||||||
OS_COMPILER=linux-elf
|
|
||||||
OS_FLAGS=-m32
|
|
||||||
;;
|
|
||||||
"arm-unknown-linux-gnueabihf")
|
|
||||||
OS_COMPILER=linux-armv4
|
|
||||||
OS_FLAGS=""
|
|
||||||
export AR=arm-linux-gnueabihf-ar
|
|
||||||
export CC=arm-linux-gnueabihf-gcc
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
mkdir -p /tmp/build
|
|
||||||
cd /tmp/build
|
|
||||||
|
|
||||||
OUT=/tmp/openssl.tgz
|
|
||||||
MAX_REDIRECTS=5
|
|
||||||
curl -o ${OUT} -L --max-redirs ${MAX_REDIRECTS} ${URL1} \
|
|
||||||
|| curl -o ${OUT} -L --max-redirs ${MAX_REDIRECTS} ${URL2}
|
|
||||||
|
|
||||||
tar --strip-components=1 -xzf ${OUT}
|
|
||||||
|
|
||||||
case "${LIBRARY}" in
|
|
||||||
"openssl")
|
|
||||||
./Configure --prefix=${OPENSSL_DIR} ${OS_COMPILER} -fPIC -g ${OS_FLAGS} no-shared
|
|
||||||
;;
|
|
||||||
"libressl")
|
|
||||||
./configure --prefix=${OPENSSL_DIR} --disable-shared --with-pic
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
make -j$(nproc)
|
|
||||||
make install_sw
|
|
||||||
Loading…
Reference in New Issue