mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-25 19:09:52 +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:
parent
eb776cf14c
commit
7f499d0e5f
12
.ci/before_install.sh
Normal file
12
.ci/before_install.sh
Normal 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
|
@ -1,20 +1,20 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
download_openssl () {
|
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/ \
|
wget -P download-cache/ \
|
||||||
"https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz"
|
"https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
build_openssl () {
|
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"
|
tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz"
|
||||||
cd "openssl-${OPENSSL_VERSION}/"
|
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
|
make all install_sw
|
||||||
echo "${OPENSSL_VERSION}" > "${PREFIX}/.openssl-version"
|
echo "${OPENSSL_VERSION}" > "${OPENSSL_INSTALL_DIR}/.openssl-version"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
.ci/script.sh
Normal file
17
.ci/script.sh
Normal 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
|
25
.travis.yml
25
.travis.yml
@ -1,19 +1,10 @@
|
|||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
os: linux
|
|
||||||
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages: [ debhelper ]
|
|
||||||
|
|
||||||
language: c
|
language: c
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- PREFIX="${HOME}/opt"
|
- OPENSSL_INSTALL_DIR="${HOME}/opt"
|
||||||
- CFLAGS="-I${PREFIX}/include"
|
|
||||||
- LDFLAGS="-L${PREFIX}/lib"
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
@ -29,16 +20,18 @@ matrix:
|
|||||||
- env: OPENSSL_VERSION="1.1.0f"
|
- env: OPENSSL_VERSION="1.1.0f"
|
||||||
os: linux
|
os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
|
- os: osx
|
||||||
|
compiler: gcc
|
||||||
|
- os: osx
|
||||||
|
compiler: clang
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- download-cache
|
- download-cache
|
||||||
- ${HOME}/opt
|
- ${HOME}/opt
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- bash .ci/before_install.sh
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- .ci/build-openssl.sh > build-deps.log 2>&1 || (cat build-deps.log && exit 1)
|
- bash .ci/script.sh
|
||||||
- export LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH:-}"
|
|
||||||
- ./configure
|
|
||||||
- make
|
|
||||||
- ldd bin/vpnserver/vpnserver
|
|
||||||
- dh build-arch
|
|
||||||
|
@ -25,13 +25,13 @@
|
|||||||
|
|
||||||
#CC=gcc
|
#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_BINDIR=/usr/bin/
|
||||||
INSTALL_VPNSERVER_DIR=/usr/vpnserver/
|
INSTALL_VPNSERVER_DIR=/usr/vpnserver/
|
||||||
|
@ -25,13 +25,13 @@
|
|||||||
|
|
||||||
#CC=gcc
|
#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_BINDIR=/usr/bin/
|
||||||
INSTALL_VPNSERVER_DIR=/usr/vpnserver/
|
INSTALL_VPNSERVER_DIR=/usr/vpnserver/
|
||||||
|
Loading…
Reference in New Issue
Block a user