Skip to content

Commit cfcdbbf

Browse files
Merge pull request #4 from bandrews-spirent/upgrade
Upgrade to v2.10.7
2 parents 9185140 + 001e4a9 commit cfcdbbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1866
-1025
lines changed

.gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Visual Studio files
1+
# Visual Studio files
22
*.o
33
*.d
44
*.so
@@ -38,7 +38,7 @@
3838
*~
3939
ipch/
4040
obj/
41-
#OSX files
41+
# OSX files
4242
*.xccheckout
4343
*.pbxuser
4444
*.mode1v3
@@ -67,7 +67,9 @@ Intermediate/
6767
# Ignore cmake building directories
6868
build.*/
6969
docs/
70-
# ignore NuGet artifacts
70+
# Ignore NuGet artifacts
7171
.nuget/
72-
73-
Generated Files/
72+
Build_android/build/
73+
Generated Files/
74+
# Ignore iOS temp build directories
75+
Build_iOS/Apple-Boost-BuildScript

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "vcpkg"]
22
path = vcpkg
33
url = https://github.com/Microsoft/vcpkg
4+
[submodule "websocketspp"]
5+
path = Release/libs/websocketpp
6+
url = https://github.com/zaphoyd/websocketpp/

Build_android/configure.sh

Lines changed: 89 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313

1414
set -e
1515

16-
# Note: we require android ndk r10e available from
17-
# http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.tar.bz2
18-
# http://dl.google.com/android/ndk/android-ndk-r10e-windows-x86_64.zip
16+
# The Android NDK r10e or later may work, but we test with r18b. To download, see the following link:
17+
# https://developer.android.com/ndk/downloads/index.html
1918

2019
# -----------------
2120
# Parse args
@@ -25,40 +24,58 @@ DO_BOOST=1
2524
DO_OPENSSL=1
2625
DO_CPPRESTSDK=1
2726

27+
BOOSTVER=1.65.1
28+
OPENSSLVER=1.0.2k
29+
30+
API=15
31+
STL=c++_static
32+
2833
function usage {
2934
echo "Usage: $0 [--skip-boost] [--skip-openssl] [--skip-cpprestsdk] [-h] [--ndk <android-ndk>]"
3035
echo ""
3136
echo " --skip-boost Skip fetching and compiling boost"
3237
echo " --skip-openssl Skip fetching and compiling openssl"
3338
echo " --skip-cpprestsdk Skip compiling cpprestsdk"
34-
echo " -h,--help,-? Display this information"
39+
echo " --boost <version> Override the Boost version to build (default is ${BOOSTVER})"
40+
echo " --openssl <version> Override the OpenSSL version to build (default is ${OPENSSLVER})"
3541
echo " --ndk <android-ndk> If specified, overrides the ANDROID_NDK environment variable"
42+
echo " -h,--help,-? Display this information"
3643
}
3744

3845
while [[ $# > 0 ]]
3946
do
4047
case $1 in
41-
"--skip-boost")
42-
DO_BOOST=0
43-
;;
44-
"--skip-openssl")
45-
DO_OPENSSL=0
46-
;;
47-
"--skip-cpprestsdk")
48-
DO_CPPRESTSDK=0
49-
;;
50-
"-?"|"-h"|"--help")
51-
usage
52-
exit
53-
;;
54-
"--ndk")
55-
shift
56-
export ANDROID_NDK=$1
57-
;;
58-
*)
59-
usage
60-
exit 1
61-
;;
48+
"--skip-boost")
49+
DO_BOOST=0
50+
;;
51+
"--skip-openssl")
52+
DO_OPENSSL=0
53+
;;
54+
"--skip-cpprestsdk")
55+
DO_CPPRESTSDK=0
56+
;;
57+
"--boost")
58+
shift
59+
DO_BOOST=1
60+
BOOSTVER=$1
61+
;;
62+
"--openssl")
63+
shift
64+
DO_OPENSSL=1
65+
OPENSSLVER=$1
66+
;;
67+
"--ndk")
68+
shift
69+
export ANDROID_NDK=$1
70+
;;
71+
"-?"|"-h"|"--help")
72+
usage
73+
exit
74+
;;
75+
*)
76+
usage
77+
exit 1
78+
;;
6279
esac
6380
shift
6481
done
@@ -74,6 +91,13 @@ fi
7491
NDK_DIR=`cd "${ANDROID_NDK}" && pwd`
7592
SRC_DIR=`pwd`
7693

94+
if [ -z "$NCPU" ]; then
95+
NCPU=4
96+
if uname -s | grep -i "linux" > /dev/null ; then
97+
NCPU=`cat /proc/cpuinfo | grep -c -i processor`
98+
fi
99+
fi
100+
77101
# -----------------------
78102
# Identify the script dir
79103
# -----------------------
@@ -102,140 +126,55 @@ fi
102126

103127
# This steps are based on the official openssl build instructions
104128
# http://wiki.openssl.org/index.php/Android
105-
if [ "${DO_OPENSSL}" == "1" ]
106-
then
107-
(
129+
if [ "${DO_OPENSSL}" == "1" ]; then (
108130
if [ ! -d "openssl" ]; then mkdir openssl; fi
109131
cd openssl
110-
cp "${DIR}/openssl/Makefile" .
111-
export ANDROID_NDK_ROOT="${NDK_DIR}"
112-
make all
113-
)
114-
fi
115-
132+
cp -af "${DIR}/openssl/." .
133+
make all ANDROID_NDK="${NDK_DIR}" ANDROID_TOOLCHAIN=clang ANDROID_GCC_VERSION=4.9 ANDROID_ABI=armeabi-v7a OPENSSL_PREFIX=armeabi-v7a OPENSSL_VERSION=$OPENSSLVER
134+
make all ANDROID_NDK="${NDK_DIR}" ANDROID_TOOLCHAIN=clang ANDROID_GCC_VERSION=4.9 ANDROID_ABI=x86 OPENSSL_PREFIX=x86 OPENSSL_VERSION=$OPENSSLVER
135+
) fi
116136

117137
# -----
118138
# Boost
119139
# -----
120-
# Uses the script from MysticTreeGames
121-
122-
if [ "${DO_BOOST}" == "1" ]
123-
then
124-
(
125-
(
126-
if [ ! -d "Boost-for-Android" ]
127-
then
128-
git clone https://github.com/MysticTreeGames/Boost-for-Android.git
129-
fi
130-
cd Boost-for-Android
131-
if [ ! -e "cpprestsdk.patched.stamp" ]
132-
then
133-
git checkout 1c95d349d5f92c5ac1c24e0ec6985272a3e3883c
134-
git reset --hard HEAD
135-
git apply "$DIR/boost-for-android.patch"
136-
touch cpprestsdk.patched.stamp
137-
fi
138-
139-
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
140-
)
141-
142-
(
143-
if [ ! -d "Boost-for-Android-x86" ]
144-
then
145-
git clone Boost-for-Android Boost-for-Android-x86
146-
fi
147-
cd Boost-for-Android-x86
148-
if [ ! -e "cpprestsdk.patched.stamp" ]
149-
then
150-
git checkout 1c95d349d5f92c5ac1c24e0ec6985272a3e3883c
151-
git reset --hard HEAD
152-
git apply "$DIR/boost-for-android-x86.patch"
153-
ln -s ../Boost-for-Android/boost_1_55_0.tar.bz2 .
154-
touch cpprestsdk.patched.stamp
155-
fi
156-
157-
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=atomic,random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
158-
)
159-
)
160-
fi
161-
162-
if [ "${DO_CPPRESTSDK}" == "1" ]
163-
then
164-
(
165-
# -------------
166-
# android-cmake
167-
# -------------
168-
if [ ! -e android-cmake ]
169-
then
170-
git clone https://github.com/taka-no-me/android-cmake.git
171-
fi
140+
# Uses the build script from Moritz Wundke (formerly MysticTreeGames)
141+
# https://github.com/moritz-wundke/Boost-for-Android
142+
143+
if [ "${DO_BOOST}" == "1" ]; then (
144+
if [ ! -d 'Boost-for-Android' ]; then git clone https://github.com/moritz-wundke/Boost-for-Android; fi
145+
cd Boost-for-Android
146+
git checkout 84973078a3d7668067d422d4654696ef59ab9d6d
147+
PATH="$PATH:$NDK_DIR" \
148+
CXXFLAGS="-std=gnu++11" \
149+
./build-android.sh \
150+
--boost=$BOOSTVER \
151+
--arch=armeabi-v7a,x86 \
152+
--with-libraries=atomic,random,date_time,filesystem,system,thread,chrono \
153+
"${NDK_DIR}" || exit 1
154+
) fi
172155

173156
# ----------
174157
# casablanca
175158
# ----------
176159

177-
(
178-
mkdir -p build.armv7.debug
179-
cd build.armv7.debug
180-
cmake "$DIR/../Release/" \
181-
-DCMAKE_TOOLCHAIN_FILE=../android-cmake/android.toolchain.cmake \
182-
-DANDROID_ABI=armeabi-v7a \
183-
-DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-clang3.8 \
184-
-DANDROID_STL=none \
185-
-DANDROID_STL_FORCE_FEATURES=ON \
186-
-DANDROID_NATIVE_API_LEVEL=android-9 \
187-
-DANDROID_GOLD_LINKER=OFF \
188-
-DCMAKE_BUILD_TYPE=Debug \
189-
-DANDROID_NDK="${ANDROID_NDK}"
190-
make -j 1
191-
)
192-
193-
(
194-
mkdir -p build.armv7.release
195-
cd build.armv7.release
196-
cmake "$DIR/../Release/" \
197-
-DCMAKE_TOOLCHAIN_FILE=../android-cmake/android.toolchain.cmake \
198-
-DANDROID_ABI=armeabi-v7a \
199-
-DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-clang3.8 \
200-
-DANDROID_STL=none \
201-
-DANDROID_STL_FORCE_FEATURES=ON \
202-
-DANDROID_NDK="${ANDROID_NDK}" \
203-
-DANDROID_NATIVE_API_LEVEL=android-9 \
204-
-DANDROID_GOLD_LINKER=OFF \
205-
-DCMAKE_BUILD_TYPE=Release
206-
make -j 1
207-
)
208-
209-
(
210-
mkdir -p build.x86.debug
211-
cd build.x86.debug
212-
cmake "$DIR/../Release/" \
213-
-DCMAKE_TOOLCHAIN_FILE=../android-cmake/android.toolchain.cmake \
214-
-DANDROID_ABI=x86 \
215-
-DANDROID_TOOLCHAIN_NAME=x86-clang3.8 \
216-
-DANDROID_STL=none \
217-
-DANDROID_STL_FORCE_FEATURES=ON \
218-
-DANDROID_NATIVE_API_LEVEL=android-9 \
219-
-DANDROID_GOLD_LINKER=OFF \
220-
-DCMAKE_BUILD_TYPE=Debug \
221-
-DANDROID_NDK="${ANDROID_NDK}"
222-
make -j 1
223-
)
224-
225-
(
226-
mkdir -p build.x86.release
227-
cd build.x86.release
228-
cmake "$DIR/../Release/" \
229-
-DCMAKE_TOOLCHAIN_FILE=../android-cmake/android.toolchain.cmake \
230-
-DANDROID_ABI=x86 \
231-
-DANDROID_TOOLCHAIN_NAME=x86-clang3.8 \
232-
-DANDROID_STL=none \
233-
-DANDROID_STL_FORCE_FEATURES=ON \
234-
-DANDROID_NDK="${ANDROID_NDK}" \
235-
-DANDROID_NATIVE_API_LEVEL=android-9 \
236-
-DANDROID_GOLD_LINKER=OFF \
237-
-DCMAKE_BUILD_TYPE=Release
238-
make -j 1
239-
)
240-
)
160+
if [ "${DO_CPPRESTSDK}" == "1" ]; then
161+
# Use the builtin CMake toolchain configuration that comes with the NDK
162+
function build_cpprestsdk { (
163+
mkdir -p $1
164+
cd $1
165+
cmake "${DIR}/.." \
166+
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
167+
-DANDROID_NDK="${ANDROID_NDK}" \
168+
-DANDROID_TOOLCHAIN=clang \
169+
-DANDROID_ABI=$2 \
170+
-DBOOST_VERSION="${BOOSTVER}" \
171+
-DCMAKE_BUILD_TYPE=$3
172+
make -j $NCPU
173+
) }
174+
175+
# Build the cpprestsdk for each target configuration
176+
build_cpprestsdk build.armv7.debug armeabi-v7a Debug
177+
build_cpprestsdk build.armv7.release armeabi-v7a Release
178+
build_cpprestsdk build.x86.debug x86 Debug
179+
build_cpprestsdk build.x86.release x86 Release
241180
fi

0 commit comments

Comments
 (0)