Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
including refactoring by Steffan Karger, merged into a single commit. Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1473938808-3312-1-git-send-email-chipitsine@gmail.com> URL: http://www.mail-archive.com/search?l=mid&q=1473938808-3312-1-git-send-email-chipitsine@gmail.com Signed-off-by: Steffan Karger <steffan@karger.me> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1473938818-3375-1-git-send-email-chipitsine@gmail.com> URL: http://www.mail-archive.com/search?l=mid&q=1473938818-3375-1-git-send-email-chipitsine@gmail.com Signed-off-by: Gert Doering <gert@greenie.muc.de>
- Loading branch information
1 parent
d7ce876
commit 3689912
Showing
6 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
sudo: required | ||
dist: trusty | ||
|
||
os: linux | ||
|
||
language: c | ||
|
||
compiler: | ||
- gcc | ||
|
||
env: | ||
global: | ||
- JOBS=3 | ||
- PREFIX="${HOME}/opt" | ||
- MBEDTLS_VERSION="2.2.1" | ||
- MBEDTLS_CFLAGS="-I${PREFIX}/include" | ||
- MBEDTLS_LIBS="-L${PREFIX}/lib -lmbedtls -lmbedx509 -lmbedcrypto" | ||
- OPENSSL_VERSION="1.0.1t" | ||
- OPENSSL_CFLAGS="-I${PREFIX}/include" | ||
- OPENSSL_LIBS="-L${PREFIX}/lib -lssl -lcrypto" | ||
- LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH}" | ||
|
||
matrix: | ||
include: | ||
- env: SSLLIB="openssl" | ||
os: linux | ||
compiler: gcc | ||
- env: SSLLIB="openssl" | ||
os: linux | ||
compiler: clang | ||
- env: SSLLIB="mbedtls" | ||
os: linux | ||
compiler: gcc | ||
- env: SSLLIB="mbedtls" | ||
os: linux | ||
compiler: clang | ||
- env: SSLLIB="openssl" EXTRA_CONFIG="--disable-crypto" | ||
os: linux | ||
compiler: clang | ||
- env: SSLLIB="openssl" EXTRA_CONFIG="--disable-lzo" | ||
os: linux | ||
compiler: clang | ||
- env: SSLLIB="openssl" EXTRA_CONFIG="--enable-small" | ||
os: linux | ||
compiler: clang | ||
- env: SSLLIB="openssl" | ||
os: osx | ||
osx_image: xcode7.3 | ||
compiler: clang | ||
- env: SSLLIB="mbedtls" | ||
os: osx | ||
osx_image: xcode7.3 | ||
compiler: clang | ||
allow_failures: | ||
- env: SSLLIB="openssl" EXTRA_CONFIG="--disable-crypto" | ||
os: linux | ||
compiler: clang | ||
exclude: | ||
- compiler: gcc | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- liblzo2-dev | ||
- libpam0g-dev | ||
- liblz4-dev | ||
- linux-libc-dev | ||
|
||
cache: | ||
apt: true | ||
ccache: true | ||
directories: | ||
- download-cache | ||
- ${HOME}/opt | ||
|
||
before_install: | ||
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update ; fi | ||
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew install lzo; fi | ||
|
||
install: | ||
- .travis/build-deps.sh > build-deps.log 2>&1 || (cat build-deps.log && exit 1) | ||
|
||
script: | ||
- autoreconf -vi | ||
- ./configure --with-crypto-library="${SSLLIB}" ${EXTRA_CONFIG} || (cat config.log && exit 1) | ||
- make -j$JOBS | ||
- src/openvpn/openvpn --version || true | ||
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ldd src/openvpn/openvpn; fi | ||
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then otool -L src/openvpn/openvpn; fi | ||
- make check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/bin/sh | ||
set -eux | ||
|
||
# Set defaults | ||
MBEDTLS_VERSION="${MBEDTLS_VERSION:-2.2.1}" | ||
OPENSSL_VERSION="${OPENSSL_VERION:-1.0.2h}" | ||
PREFIX="${PREFIX:-${HOME}/opt}" | ||
|
||
download_mbedtls () { | ||
if [ ! -f "download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz" ]; then | ||
wget -P download-cache/ \ | ||
"https://tls.mbed.org/download/mbedtls-${MBEDTLS_VERSION}-apache.tgz" | ||
fi | ||
} | ||
|
||
build_mbedtls () { | ||
if [ "$(cat ${PREFIX}/.mbedtls-version)" != "${MBEDTLS_VERSION}" ]; then | ||
tar zxf download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz | ||
( | ||
cd "mbedtls-${MBEDTLS_VERSION}" | ||
make | ||
make install DESTDIR="${PREFIX}" | ||
) | ||
echo "${MBEDTLS_VERSION}" > "${PREFIX}/.mbedtls-version" | ||
fi | ||
} | ||
|
||
download_openssl () { | ||
if [ ! -f "download-cache/openssl-${OPENSSL_VERSION}.tar.gz" ]; then | ||
wget -P download-cache/ \ | ||
"https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" | ||
fi | ||
} | ||
|
||
build_openssl_linux () { | ||
tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz" | ||
( | ||
cd "openssl-${OPENSSL_VERSION}/" | ||
./config shared --openssldir="${PREFIX}" -DPURIFY | ||
make all install_sw | ||
) | ||
} | ||
|
||
build_openssl_osx () { | ||
tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz" | ||
( | ||
cd "openssl-${OPENSSL_VERSION}/" | ||
./Configure darwin64-x86_64-cc shared \ | ||
--openssldir="${PREFIX}" -DPURIFY | ||
make depend all install_sw | ||
) | ||
} | ||
|
||
build_openssl () { | ||
if [ "$(cat ${PREFIX}/.openssl-version)" != "${OPENSSL_VERSION}" ]; then | ||
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then | ||
build_openssl_osx | ||
elif [ "${TRAVIS_OS_NAME}" = "linux" ]; then | ||
build_openssl_linux | ||
fi | ||
echo "${OPENSSL_VERSION}" > "${PREFIX}/.openssl-version" | ||
fi | ||
} | ||
|
||
# Enable ccache | ||
if [ "${TRAVIS_OS_NAME}" != "osx" ]; then | ||
# ccache not available on osx, see: | ||
# https://github.com/travis-ci/travis-ci/issues/5567 | ||
mkdir -p "${HOME}/bin" | ||
ln -s "$(which ccache)" "${HOME}/bin/${CC}" | ||
PATH="${HOME}/bin:${PATH}" | ||
fi | ||
|
||
# Download and build crypto lib | ||
mkdir -p download-cache | ||
if [ "${SSLLIB}" = "openssl" ]; then | ||
download_openssl | ||
build_openssl | ||
elif [ "${SSLLIB}" = "mbedtls" ]; then | ||
download_mbedtls | ||
build_mbedtls | ||
else | ||
echo "Invalid crypto lib: ${SSLLIB}" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -f download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz ]; then | ||
wget -O download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz https://tls.mbed.org/download/mbedtls-${MBEDTLS_VERSION}-apache.tgz; | ||
fi | ||
|
||
tar zxf download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz | ||
cd mbedtls-${MBEDTLS_VERSION} && make > build.log 2>&1 || (cat build.log && exit 1) | ||
make install DESTDIR=$MBEDTLS_PREFIX && cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -f download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz ]; then | ||
wget -O download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz https://tls.mbed.org/download/mbedtls-${MBEDTLS_VERSION}-apache.tgz; | ||
fi | ||
|
||
tar zxf download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz | ||
cd mbedtls-${MBEDTLS_VERSION} && make > build.log 2>&1 || (cat build.log && exit 1) | ||
make install DESTDIR=$MBEDTLS_PREFIX && cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -f download-cache/openssl-${OPENSSL_VERSION}.tar.gz ]; then | ||
wget -O download-cache/openssl-${OPENSSL_VERSION}.tar.gz https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz; | ||
fi | ||
|
||
tar zxf download-cache/openssl-${OPENSSL_VERSION}.tar.gz | ||
cd openssl-${OPENSSL_VERSION}/ | ||
./config shared --prefix=$OPENSSL_PREFIX -DPURIFY > build.log 2>&1 || (cat build.log && exit 1) | ||
make > build.log 2>&1 || (cat build.log && exit 1) | ||
make install_sw > build.log 2>&1 || (cat build.log && exit 1) | ||
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -f download-cache/openssl-${OPENSSL_VERSION}.tar.gz ]; then | ||
wget -O download-cache/openssl-${OPENSSL_VERSION}.tar.gz https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz; | ||
fi | ||
|
||
tar zxf download-cache/openssl-${OPENSSL_VERSION}.tar.gz | ||
cd openssl-${OPENSSL_VERSION}/ | ||
./Configure darwin64-x86_64-cc shared --prefix=$OPENSSL_PREFIX -DPURIFY > build.log 2>&1 || (cat build.log && exit 1) | ||
make depend install > build.log 2>&1 || (cat build.log && exit 1) | ||
cd .. |