aboutsummaryrefslogtreecommitdiff
path: root/test/build_openssl.sh
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2017-07-16 10:02:02 -0700
committerSteven Fackler <[email protected]>2017-07-16 14:15:09 -0700
commit3a7ca9c2ff607b65e0db2ea4bb167c1304da86e8 (patch)
tree7665b2f07eec21f461b6e55456bc8f04aa8a7858 /test/build_openssl.sh
parentTell docs.rs to build with all features (diff)
downloadrust-openssl-3a7ca9c2ff607b65e0db2ea4bb167c1304da86e8.tar.xz
rust-openssl-3a7ca9c2ff607b65e0db2ea4bb167c1304da86e8.zip
Switch over Linux tests to CircleCI
Diffstat (limited to 'test/build_openssl.sh')
-rwxr-xr-xtest/build_openssl.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/build_openssl.sh b/test/build_openssl.sh
new file mode 100755
index 00000000..124eabc9
--- /dev/null
+++ b/test/build_openssl.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+set -e
+
+if [ -d ~/openssl ]; 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"
+ ;;
+esac
+
+case "${TARGET}" in
+"x86_64-unknown-linux-gnu")
+ OS_COMPILER=linux-x86_64
+ ;;
+"i686-unknown-linux-gnu")
+ OS_COMPILER=linux-elf
+ OS_FLAGS=-m32
+ ;;
+"arm-unknown-linux-gnueabihf")
+ OS_COMPILER=linux-armv4
+ 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}
+
+PREFIX=${HOME}/openssl
+case "${LIBRARY}" in
+"openssl")
+ ./Configure --prefix=${PREFIX} ${OS_COMPILER} -fPIC ${OS_FLAGS} no-shared
+ ;;
+"libressl")
+ ./configure --prefix=${PREFIX} --disable-shared --with-pic
+ ;;
+esac
+
+make -j$(nproc)
+make install