Skip to content

Commit 9923071

Browse files
committed
Add clang and CyaSSL to the build matrix
We use the travis cache to avoid re-building CyaSSL. On a cold cache, CyaSSL is downloaded from github into dependencies-src/ and installed into dependencies-installed/. Both directories are added to the Travis cache.
1 parent 40deb49 commit 9923071

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.travis.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
# Use newer, container based infrastructure
2+
# Does not allow use of apt-get, but enables
3+
# caching support
4+
sudo: false
15
language: c
26
compiler:
37
- gcc
8+
- clang
49
install:
510
- ./autogen.sh
611
script:
7-
- ./configure && make
12+
- ./.travis_configure_wrapper.sh && make
13+
env:
14+
- BUILD_TYPE=normal
15+
- CYASSL="3.3.2" BUILD_TYPE=cyassl
16+
cache:
17+
directories:
18+
- dependencies-src
19+
- dependencies-installed

.travis_configure_wrapper.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
3+
if [[ -z "$BUILD_TYPE" ]]; then
4+
echo "BUILD_TYPE not set. Bye."
5+
exit 1
6+
fi
7+
8+
if [[ "$BUILD_TYPE" == "normal" ]]; then
9+
10+
echo "Running Wifidog configure"
11+
./configure $@
12+
13+
elif [[ "$BUILD_TYPE" == "cyassl" ]]; then
14+
if [[ -z "$CYASSL" ]]; then
15+
echo "CYASSL not set."
16+
exit 1
17+
fi
18+
CUR=`pwd`
19+
mkdir -p dependencies-src || true
20+
mkdir -p dependencies-installed || true
21+
if [[ ! -f dependencies-installed/include/cyassl/ssl.h ]]; then
22+
echo "Cached CyaSSL install not found. Installing."
23+
cd dependencies-src
24+
# Check if travis cache is there
25+
if [[ -f cyassl-${CYASSL}/autogen.sh ]]; then
26+
echo "Found cached CyaSSL package"
27+
else
28+
echo "No cache, downloading CyaSSL"
29+
wget https://github.com/cyassl/cyassl/archive/v${CYASSL}.tar.gz \
30+
-O cyassl-${CYASSL}.tar.gz
31+
tar -xzf cyassl-${CYASSL}.tar.gz
32+
fi
33+
cd cyassl-${CYASSL}
34+
echo "Content of cyassl-${CYASSL}:"
35+
ls
36+
echo "Running CyaSSL autogen.sh"
37+
./autogen.sh
38+
echo "Running CyaSSL configure"
39+
./configure --prefix="$CUR"/dependencies-installed/ --enable-ecc
40+
# make will pick up the cached object files - real savings
41+
# happen here
42+
echo "Running CyaSSL make"
43+
make
44+
echo "Running CyaSSL make install"
45+
make install
46+
cd "$CUR"
47+
else
48+
echo "Cached CyaSSL install found."
49+
fi
50+
echo "Running Wifidog configure"
51+
export CFLAGS="-I${CUR}/dependencies-installed/include/"
52+
export LDFLAGS="-L${CUR}/dependencies-installed/lib/"
53+
./configure --enable-cyassl $@
54+
else
55+
echo "Unknow BUILD_TYPE $BUILD_TYPE"
56+
exit 1
57+
fi

0 commit comments

Comments
 (0)