1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-26 01:59:53 +03:00

Travis CI: add MacOS target and create scripts files (#523)

* makefiles: add /usr/local/opt/openssl/include and /usr/local/opt/openssl/lib as include paths on MacOS

* Travis CI: add MacOS target and create scripts files
This commit is contained in:
Davide Beatrici 2018-05-02 23:12:01 +02:00 committed by Moataz Elmasry
parent eb776cf14c
commit 7f499d0e5f
6 changed files with 51 additions and 29 deletions

12
.ci/before_install.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
set -eux
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
sudo apt-get update
sudo apt-get -y install debhelper
bash .ci/build-openssl.sh > build-deps.log 2>&1 || (cat build-deps.log && exit 1)
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew update && brew upgrade openssl
else
exit 1
fi

View File

@ -1,20 +1,20 @@
#!/bin/sh
#!/bin/bash
set -eux
download_openssl () {
if [ ! -f "download-cache/openssl-${OPENSSL_VERSION}.tar.gz" ]; then
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 () {
if [ "$(cat ${PREFIX}/.openssl-version)" != "${OPENSSL_VERSION}" ]; then
if [[ "$(cat ${OPENSSL_INSTALL_DIR}/.openssl-version)" != "${OPENSSL_VERSION}" ]]; then
tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz"
cd "openssl-${OPENSSL_VERSION}/"
./config shared --prefix="${PREFIX}" --openssldir="${PREFIX}" -DPURIFY
./config shared --prefix="${OPENSSL_INSTALL_DIR}" --openssldir="${OPENSSL_INSTALL_DIR}" -DPURIFY
make all install_sw
echo "${OPENSSL_VERSION}" > "${PREFIX}/.openssl-version"
echo "${OPENSSL_VERSION}" > "${OPENSSL_INSTALL_DIR}/.openssl-version"
fi
}

17
.ci/script.sh Normal file
View File

@ -0,0 +1,17 @@
#!/bin/bash
set -eux
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
export LD_LIBRARY_PATH="${HOME}/opt/lib:${LD_LIBRARY_PATH:-}"
export CFLAGS="-I${HOME}/opt/include"
export LDFLAGS="-L${HOME}/opt/lib"
./configure
make
ldd bin/vpnserver/vpnserver
dh build-arch
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
./configure
make
else
exit 1
fi

View File

@ -1,19 +1,10 @@
sudo: required
dist: trusty
os: linux
addons:
apt:
packages: [ debhelper ]
language: c
env:
global:
- PREFIX="${HOME}/opt"
- CFLAGS="-I${PREFIX}/include"
- LDFLAGS="-L${PREFIX}/lib"
- OPENSSL_INSTALL_DIR="${HOME}/opt"
matrix:
include:
@ -29,16 +20,18 @@ matrix:
- env: OPENSSL_VERSION="1.1.0f"
os: linux
compiler: clang
- os: osx
compiler: gcc
- os: osx
compiler: clang
cache:
directories:
- download-cache
- ${HOME}/opt
before_install:
- bash .ci/before_install.sh
script:
- .ci/build-openssl.sh > build-deps.log 2>&1 || (cat build-deps.log && exit 1)
- export LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH:-}"
- ./configure
- make
- ldd bin/vpnserver/vpnserver
- dh build-arch
- bash .ci/script.sh

View File

@ -25,13 +25,13 @@
#CC=gcc
OPTIONS_COMPILE_DEBUG=-D_DEBUG -DDEBUG -DUNIX -DUNIX_MACOS -DBRIDGE_PCAP -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -g -fsigned-char
OPTIONS_COMPILE_DEBUG=-D_DEBUG -DDEBUG -DUNIX -DUNIX_MACOS -DBRIDGE_PCAP -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -I/usr/local/opt/openssl/include -g -fsigned-char
OPTIONS_LINK_DEBUG=-g -fsigned-char -lm -lpthread -lssl -lcrypto -liconv -lreadline -lncurses -lz -lpcap
OPTIONS_LINK_DEBUG=-g -fsigned-char -lm -lpthread -L/usr/local/opt/openssl/lib -lssl -lcrypto -liconv -lreadline -lncurses -lz -lpcap
OPTIONS_COMPILE_RELEASE=-DNDEBUG -DVPN_SPEED -DUNIX -DUNIX_MACOS -DBRIDGE_PCAP -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -O2 -fsigned-char
OPTIONS_COMPILE_RELEASE=-DNDEBUG -DVPN_SPEED -DUNIX -DUNIX_MACOS -DBRIDGE_PCAP -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -I/usr/local/opt/openssl/include -O2 -fsigned-char
OPTIONS_LINK_RELEASE=-O2 -fsigned-char -lm -lpthread -lssl -lcrypto -liconv -lreadline -lncurses -lz -lpcap
OPTIONS_LINK_RELEASE=-O2 -fsigned-char -lm -lpthread -L/usr/local/opt/openssl/lib -lssl -lcrypto -liconv -lreadline -lncurses -lz -lpcap
INSTALL_BINDIR=/usr/bin/
INSTALL_VPNSERVER_DIR=/usr/vpnserver/

View File

@ -25,13 +25,13 @@
#CC=gcc
OPTIONS_COMPILE_DEBUG=-D_DEBUG -DDEBUG -DUNIX -DUNIX_MACOS -DBRIDGE_PCAP -DCPU_64 -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -g -fsigned-char -m64
OPTIONS_COMPILE_DEBUG=-D_DEBUG -DDEBUG -DUNIX -DUNIX_MACOS -DBRIDGE_PCAP -DCPU_64 -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -I/usr/local/opt/openssl/include -g -fsigned-char -m64
OPTIONS_LINK_DEBUG=-g -fsigned-char -m64 -lm -lpthread -lssl -lcrypto -liconv -lreadline -lncurses -lz -lpcap
OPTIONS_LINK_DEBUG=-g -fsigned-char -m64 -lm -lpthread -L/usr/local/opt/openssl/lib -lssl -lcrypto -liconv -lreadline -lncurses -lz -lpcap
OPTIONS_COMPILE_RELEASE=-DNDEBUG -DVPN_SPEED -DUNIX -DUNIX_MACOS -DBRIDGE_PCAP -DCPU_64 -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -O2 -fsigned-char -m64
OPTIONS_COMPILE_RELEASE=-DNDEBUG -DVPN_SPEED -DUNIX -DUNIX_MACOS -DBRIDGE_PCAP -DCPU_64 -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -I/usr/local/opt/openssl/include -O2 -fsigned-char -m64
OPTIONS_LINK_RELEASE=-O2 -fsigned-char -m64 -lm -lpthread -lssl -lcrypto -liconv -lreadline -lncurses -lz -lpcap
OPTIONS_LINK_RELEASE=-O2 -fsigned-char -m64 -lm -lpthread -L/usr/local/opt/openssl/lib -lssl -lcrypto -liconv -lreadline -lncurses -lz -lpcap
INSTALL_BINDIR=/usr/bin/
INSTALL_VPNSERVER_DIR=/usr/vpnserver/