-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathenv-setup.sh
executable file
·144 lines (109 loc) · 3.73 KB
/
env-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
# Retrieve NDK path to use
NDK=$1
if [ "${NDK}" == "" ] || [ ! -e ${NDK}/build/tools/make-standalone-toolchain.sh ]
then
echo "Please specify a valid NDK path."
return 1
fi
export SDK="${NDK}"
if [ -z $2 ]
then
export PROXY=""
else
export PROXY="-x $2"
fi
export ANDROID_API_LEVEL="14"
export ARM_TARGET="armv7"
# Project version to use to build minizip (changing this may break the build)
export MINIZIP_VERSION="11"
# Project version to use to build icu (changing this may break the build)
#export ICU_VERSION="4.8.1.1"
export ICU_VERSION="50.1.1"
# Project version to use to build c-ares (changing this may break the build)
export CARES_VERSION="1.9.1"
# Project version to use to build bzip2 (changing this may break the build)
export BZIP2_VERSION="1.0.6"
# Project version to use to build libidn (changing this may break the build)
export LIBIDN_VERSION="1.26"
# GNU Crypto libraries
export LIBGPG_ERROR_VERSION="1.10"
export LIBGCRYPT_VERSION="1.5.0"
export GNUPG_VERSION="1.4.13"
# Project versions to use to build openssl (changing this may break the build)
export OPENSSL_VERSION="1.0.1"
# Project versions to use to build libssh2 and cURL (changing this may break the build)
export LIBSSH2_VERSION="1.3.0"
export CURL_VERSION="7.28.1"
# Project Version to use to build libgsasl
export LIBGSASL_VERSION="1.8.0"
# Project version to use to build boost C++ libraries
export BOOST_VERSION="1.52.0"
export BOOST_LIBS="chrono context date_time exception filesystem graph graph_parallel iostreams mpi program_options random regex serialization signals system test thread timer wave"
# Project version to use to build tinyxml
export TINYXML_VERSION="2.6.2"
export TINYXML_FILE="2_6_2"
# Project version to use to build expat (changing this may break the build)
export EXPAT_VERSION="2.0.1"
# Project version to use to build yajl (changing this may break the build)
export YAJL_VERSION="2.0.3"
# Project version to use to build sqlcipher (changing this may break the build)
export SQLCIPHER_VERSION="2.1.1"
# Project versions to use for SOCI (Sqlite3 C++ database library)
export SOCI_VERSION="3.1.0"
# Project version to use to build pion (changing this may break the build)
export PION_VERSION="master"
# Project version to use to build protobuf (changing this may break the build)
export PROTOBUF_VERSION="2.5.0"
# Create dist folder
export BUILDDIR=$(dirname $0)
pushd $BUILDDIR
export TOPDIR=$(dirname $(pwd))
export BINDIR=$TOPDIR/bin/droid
export LOGDIR=$TOPDIR/log/droid
export TMPDIR=$TOPDIR/tmp
popd
rm -rf $LOGDIR
mkdir -p $LOGDIR
mkdir -p $TMPDIR
pushd $TMPDIR
if [ -z $TOOLCHAIN_VERSION ]
then
export TOOLCHAIN_VERSION="4.7"
fi
# Platforms to build for (changing this may break the build)
PLATFORMS="arm-linux-androideabi"
# Create tool chains for each supported platform
for PLATFORM in ${PLATFORMS}
do
echo "Creating toolchain for platform ${PLATFORM}..."
if [ ! -d "${TMPDIR}/droidtoolchains/${PLATFORM}" ]
then
$NDK/build/tools/make-standalone-toolchain.sh \
--verbose \
--platform=android-${ANDROID_API_LEVEL} \
--toolchain=${PLATFORM}-${TOOLCHAIN_VERSION} \
--install-dir=${TMPDIR}/droidtoolchains/${PLATFORM}
fi
done
# Set Up single build env var
if [ -z "${BUILD_ALL}" ]
then
echo "Setting up single build env variables"
PLATFORM="arm-linux-androideabi"
LOGPATH="${LOGDIR}/${PLATFORM}"
ROOTDIR="${TMPDIR}/build/droid/${PLATFORM}"
mkdir -p "${ROOTDIR}"
if [ "${PLATFORM}" == "arm-linux-androideabi" ]
then
export ARCH=${ARM_TARGET}
else
export ARCH="x86"
fi
export ROOTDIR=${ROOTDIR}
export PLATFORM=${PLATFORM}
export TOOLCHAIN=${TMPDIR}/droidtoolchains/${PLATFORM}
export DROIDTOOLS=${TOOLCHAIN}/bin/${PLATFORM}
export SYSROOT=${TOOLCHAIN}/sysroot
fi
popd