aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@irt-systemx.fr>2018-03-21 14:16:02 +0100
committerAngelo Mantellini <angelo.mantellini@irt-systemx.fr>2018-03-21 20:46:00 +0100
commit5d308865d0783d0cd70f7453c77980835ac5648e (patch)
treeaea91e7109a81669e5b19443296cf1dec6876532 /scripts
parente90a1ec7c82519127b63931a96535ad4bc31342d (diff)
update android-sdk. Now it is possible to compile with clangandroid-sdk/master
Change-Id: I156aa48dd90467a2a7540eec11839c0111b13bd2 Signed-off-by: Angelo Mantellini <angelo.mantellini@irt-systemx.fr>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/_shared.sh117
-rw-r--r--scripts/build-apk.sh61
-rw-r--r--scripts/build-boost.sh8
-rwxr-xr-xscripts/build-curl4android.sh82
-rwxr-xr-xscripts/build-openssl4android.sh98
-rwxr-xr-xscripts/compile_androidviper.sh10
-rwxr-xr-xscripts/compile_httpserver.sh16
-rwxr-xr-xscripts/compile_iget.sh8
-rwxr-xr-xscripts/compile_metisforwarder.sh8
-rwxr-xr-xscripts/init.sh255
-rwxr-xr-xscripts/init_qt.sh137
-rwxr-xr-xscripts/update.sh7
12 files changed, 563 insertions, 244 deletions
diff --git a/scripts/_shared.sh b/scripts/_shared.sh
new file mode 100644
index 00000000..fe50abd3
--- /dev/null
+++ b/scripts/_shared.sh
@@ -0,0 +1,117 @@
+#!/bin/bash
+
+TOOLS_ROOT=`pwd`
+
+#
+# Warning !!! Android Build !!!
+#
+# Default to API 21 for it is the minimum requirement for 64 bit archs.
+# IF you need to build for min api level 16, you need to modify it to 14 and will not build for 64 bit archs.
+# api level 16 build is better because api level 21 and higher may have problem like
+#
+# https://github.com/openssl/openssl/issues/988
+# http://stackoverflow.com/questions/37122126/whats-the-exact-significance-of-android-ndk-platform-version-compared-to-api-le
+#
+# So if you not need 64 bit arch api level 16 is better
+#
+# But but but cURL could not build by android-20 and earlier :-(
+# So you can build openssl with android-16 then build cURL with android-21
+#
+ANDROID_API=${ANDROID_API:-26}
+ARCHS=("android" "android64-aarch64" "android-armeabi" "android-x86" "android64")
+ABIS=("armeabi" "arm64-v8a" "armeabi-v7a" "x86" "x86_64")
+# ANDROID_API=${ANDROID_API:-21}
+# ARCHS=("android" "android-armeabi" "android64-aarch64" "android-x86" "android64" "android-mips" "android-mips64")
+# ABIS=("armeabi" "armeabi-v7a" "arm64-v8a" "x86" "x86_64" "mips" "mips64")
+#NDK=${ANDROID_NDK}
+
+configure() {
+ ARCH=$1; OUT=$2; CLANG=${3:-""};
+
+ TOOLCHAIN_ROOT=${TOOLCHAIN} #${TOOLS_ROOT}/${OUT}-android-toolchain
+
+ if [ "$ARCH" == "android" ]; then
+ export ARCH_FLAGS="-mthumb"
+ export ARCH_LINK=""
+ export TOOL="arm-linux-androideabi"
+ NDK_FLAGS="--arch=arm"
+ elif [ "$ARCH" == "android-armeabi" ]; then
+ export ARCH_FLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -mfpu=neon"
+ export ARCH_LINK="-march=armv7-a -Wl,--fix-cortex-a8"
+ export TOOL="arm-linux-androideabi"
+ NDK_FLAGS="--arch=arm"
+ elif [ "$ARCH" == "android64-aarch64" ]; then
+ export ARCH_FLAGS=""
+ export ARCH_LINK=""
+ export TOOL="aarch64-linux-android"
+ NDK_FLAGS="--arch=arm64"
+ elif [ "$ARCH" == "android-x86" ]; then
+ export ARCH_FLAGS="-march=i686 -mtune=intel -msse3 -mfpmath=sse -m32"
+ export ARCH_LINK=""
+ export TOOL="i686-linux-android"
+ NDK_FLAGS="--arch=x86"
+ elif [ "$ARCH" == "android64" ]; then
+ export ARCH_FLAGS="-march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel"
+ export ARCH_LINK=""
+ export TOOL="x86_64-linux-android"
+ NDK_FLAGS="--arch=x86_64"
+ elif [ "$ARCH" == "android-mips" ]; then
+ export ARCH_FLAGS=""
+ export ARCH_LINK=""
+ export TOOL="mipsel-linux-android"
+ NDK_FLAGS="--arch=mips"
+ elif [ "$ARCH" == "android-mips64" ]; then
+ export ARCH="linux64-mips64"
+ export ARCH_FLAGS=""
+ export ARCH_LINK=""
+ export TOOL="mips64el-linux-android"
+ NDK_FLAGS="--arch=mips64"
+ fi;
+
+ [ -d ${TOOLCHAIN_ROOT} ] || python $NDK/build/tools/make_standalone_toolchain.py \
+ --api ${ANDROID_API} \
+ --stl libc++ \
+ --install-dir=${TOOLCHAIN_ROOT} \
+ $NDK_FLAGS
+
+ export TOOLCHAIN_PATH=${TOOLCHAIN_ROOT}/bin
+ export NDK_TOOLCHAIN_BASENAME=${TOOLCHAIN_PATH}/${TOOL}
+ export SYSROOT=${TOOLCHAIN_ROOT}/sysroot
+ export CROSS_SYSROOT=$SYSROOT
+ #if [ -z "${CLANG}" ]; then
+ # export CC=${NDK_TOOLCHAIN_BASENAME}-gcc
+ # export CXX=${NDK_TOOLCHAIN_BASENAME}-g++
+ #else
+ export CC=${NDK_TOOLCHAIN_BASENAME}-clang
+ export CXX=${NDK_TOOLCHAIN_BASENAME}-clang++
+ #fi;
+ export LINK=${CXX}
+ export LD=${NDK_TOOLCHAIN_BASENAME}-ld
+ export AR=${NDK_TOOLCHAIN_BASENAME}-ar
+ export RANLIB=${NDK_TOOLCHAIN_BASENAME}-ranlib
+ export STRIP=${NDK_TOOLCHAIN_BASENAME}-strip
+ export CPPFLAGS=${CPPFLAGS:-""}
+ export LIBS=${LIBS:-""}
+ export CFLAGS="${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64"
+ export CXXFLAGS="${CFLAGS} -std=c++11 -frtti -fexceptions"
+ export LDFLAGS="${ARCH_LINK}"
+ echo "**********************************************"
+ echo "use ANDROID_API=${ANDROID_API}"
+ echo "use NDK=${NDK}"
+ echo "export ARCH=${ARCH}"
+ echo "export NDK_TOOLCHAIN_BASENAME=${NDK_TOOLCHAIN_BASENAME}"
+ echo "export SYSROOT=${SYSROOT}"
+ echo "export CC=${CC}"
+ echo "export CXX=${CXX}"
+ echo "export LINK=${LINK}"
+ echo "export LD=${LD}"
+ echo "export AR=${AR}"
+ echo "export RANLIB=${RANLIB}"
+ echo "export STRIP=${STRIP}"
+ echo "export CPPFLAGS=${CPPFLAGS}"
+ echo "export CFLAGS=${CFLAGS}"
+ echo "export CXXFLAGS=${CXXFLAGS}"
+ echo "export LDFLAGS=${LDFLAGS}"
+ echo "export LIBS=${LIBS}"
+ echo "**********************************************"
+}
diff --git a/scripts/build-apk.sh b/scripts/build-apk.sh
index d86c176f..bf10c359 100644
--- a/scripts/build-apk.sh
+++ b/scripts/build-apk.sh
@@ -7,36 +7,25 @@ SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
APT_PATH=`which apt-get` || true
apt_get=${APT_PATH:-"/usr/local/bin/apt-get"}
-BUILD_TOOLS="p7zip-full build-essential automake libconfig9 libtool lib32stdc++6 lib32z1 unzip default-jdk libx11-xcb-dev libfontconfig1 libgl1-mesa-dev cmake"
+BUILD_TOOLS="build-essential automake libconfig9 libtool lib32stdc++6 lib32z1 unzip default-jdk cmake clang"
# Parameters:
# $1 = Distribution [Trusty / CentOS]
#
+
update_cmake_repo() {
- DISTRIBUTION=$1
+ cat /etc/resolv.conf
+ echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
+ cat /etc/resolv.conf
- if [ "$DISTRIBUTION" == "trusty" ]; then
- sudo ${apt_get} install -y --allow-unauthenticated software-properties-common
- sudo add-apt-repository --yes ppa:george-edison55/cmake-3.x
- elif [ "$DISTRIBUTION" == "CentOS" ]; then
- sudo cat << EOF > cmake.repo
-[cmake-repo]
-name=Repo for cmake3
-baseurl=http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64/
-enabled=1
-gpgcheck=0
-EOF
- sudo cat << EOF > jsoncpp.repo
-[jsoncp-repo]
-name=Repo for jsoncpp
-baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64/
-enabled=1
-gpgcheck=0
-EOF
- sudo mv cmake.repo /etc/yum.repos.d/cmake.repo
- sudo mv jsoncpp.repo /etc/yum.repos.d/jsoncpp.repo
- fi
+ CMAKE_INSTALL_SCRIPT_URL="https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.sh"
+ CMAKE_INSTALL_SCRIPT="/tmp/install_cmake.sh"
+ curl ${CMAKE_INSTALL_SCRIPT_URL} > ${CMAKE_INSTALL_SCRIPT}
+
+ sudo mkdir -p /opt/cmake
+ sudo bash ${CMAKE_INSTALL_SCRIPT} --skip-license --prefix=/opt/cmake
+ export PATH=/opt/cmake/bin:$PATH
}
# Parameters:
@@ -99,13 +88,9 @@ setup() {
DISTRIB_ID=$1
DISTRIB_CODENAME=$2
-
if [ "$DISTRIB_ID" == "Ubuntu" ]; then
- if [ "$DISTRIB_CODENAME" == "trusty" ]; then
- update_cmake_repo $DISTRIB_CODENAME
- fi
-
- update_fdio_repo $DISTRIB_ID $DISTRIB_CODENAME
+ update_cmake_repo $DISTRIB_CODENAME
+ update_fdio_repo $DISTRIB_ID $DISTRIB_CODENAME
sudo ${apt_get} update || true
@@ -164,15 +149,17 @@ fi
pushd $SCRIPT_PATH/..
# Install dependencies and CCNx modules
+export ANDROID_ARCH="arm"
make all
-
-# Compile metis for android app
-make android_metis
-
-# Compile iget
-make android_iget
-
-# Compile viper
make android_viper
+export ANDROID_ARCH="x86_64"
+make all
+export ANDROID_ARCH="arm64"
+make all
+export ANDROID_ARCH="x86"
+make all
+make android_metisforwarder
+make android_httpserver
+make android_iget
popd
diff --git a/scripts/build-boost.sh b/scripts/build-boost.sh
index 38b45db0..81648fe0 100644
--- a/scripts/build-boost.sh
+++ b/scripts/build-boost.sh
@@ -6,7 +6,7 @@ PREFIX=`pwd`/install_boost
if [ $ABI = armeabi-v7a ]; then
./b2 link=static threading=multi threadapi=pthread target-os=android --with-system\
- toolset=gcc-arm architecture=arm address-model=32 \
+ toolset=clang-arm architecture=arm address-model=32 \
abi=aapcs binary-format=elf define=BOOST_MATH_DISABLE_FLOAT128 \
include=$NDK/sources/cxx-stl/gnu-libstdc++/4.9/include \
include=$NDK/sources/cxx-stl/gnu-libstdc++/4.9/libs/${ABI}/include \
@@ -15,7 +15,7 @@ if [ $ABI = armeabi-v7a ]; then
install
elif [ $ABI = x86 ]; then
./b2 link=static threading=multi threadapi=pthread target-os=android --with-system\
- toolset=gcc-x86 architecture=x86 address-model=32 \
+ toolset=clang-x86 architecture=x86 address-model=32 \
abi=aapcs binary-format=elf define=BOOST_MATH_DISABLE_FLOAT128 \
include=$NDK/sources/cxx-stl/gnu-libstdc++/4.9/include \
include=$NDK/sources/cxx-stl/gnu-libstdc++/4.9/libs/${ABI}/include \
@@ -24,7 +24,7 @@ elif [ $ABI = x86 ]; then
install
elif [ $ABI = x86_64 ]; then
./b2 link=static threading=multi threadapi=pthread target-os=android --with-system\
- toolset=gcc-x86_64 architecture=x86_64 address-model=64 \
+ toolset=clang-x86_64 architecture=x86_64 address-model=64 \
abi=aapcs binary-format=elf define=BOOST_MATH_DISABLE_FLOAT128 \
include=$NDK/sources/cxx-stl/gnu-libstdc++/4.9/include \
include=$NDK/sources/cxx-stl/gnu-libstdc++/4.9/libs/${ABI}/include \
@@ -33,7 +33,7 @@ elif [ $ABI = x86_64 ]; then
install
else
./b2 link=static threading=multi threadapi=pthread target-os=android --with-system\
- toolset=gcc-arm64 architecture=arm64-v8a address-model=64 \
+ toolset=clang-arm64 architecture=arm64-v8a address-model=64 \
abi=aapcs binary-format=elf define=BOOST_MATH_DISABLE_FLOAT128 \
include=$NDK/sources/cxx-stl/gnu-libstdc++/4.9/include \
include=$NDK/sources/cxx-stl/gnu-libstdc++/4.9/libs/${ABI}/include \
diff --git a/scripts/build-curl4android.sh b/scripts/build-curl4android.sh
new file mode 100755
index 00000000..5151b25d
--- /dev/null
+++ b/scripts/build-curl4android.sh
@@ -0,0 +1,82 @@
+#!/bin/bash
+#
+# Copyright 2016 leenjewel
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -u
+
+source $BASE_DIR/scripts/_shared.sh
+
+cd external
+
+# Setup architectures, library name and other vars + cleanup from previous runs
+TOOLS_ROOT=`pwd`
+LIB_NAME="curl-7.54.1"
+LIB_DEST_DIR=`pwd`/install_curl/libs
+[ -f ${LIB_NAME}.tar.gz ] || wget https://curl.haxx.se/download/${LIB_NAME}.tar.gz
+# Unarchive library, then configure and make for specified architectures
+configure_make() {
+ ARCH=$1; ABI=$2;
+ [ -d "${LIB_NAME}" ] && rm -rf "${LIB_NAME}"
+ tar xfz "${LIB_NAME}.tar.gz"
+ pushd "${LIB_NAME}";
+
+ configure $*
+ # fix me
+ #cp ${TOOLS_ROOT}/../output/android/openssl-${ABI}/lib/libssl.a ${SYSROOT}/usr/lib
+ #cp ${TOOLS_ROOT}/../output/android/openssl-${ABI}/lib/libcrypto.a ${SYSROOT}/usr/lib
+ #cp -r ${TOOLS_ROOT}/../output/android/openssl-${ABI}/include/openssl ${SYSROOT}/usr/include
+
+ mkdir -p ${LIB_DEST_DIR}/${ABI}
+ ./configure --prefix=${LIB_DEST_DIR}/${ABI} \
+ --with-sysroot=${SYSROOT} \
+ --host=${TOOL} \
+ --with-ssl=/Users/angelomantelini/bitbucket_new/android-sdk/usr \
+ --enable-ipv6 \
+ --enable-static \
+ --enable-threaded-resolver \
+ --disable-dict \
+ --disable-gopher \
+ --disable-ldap --disable-ldaps \
+ --disable-manual \
+ --disable-pop3 --disable-smtp --disable-imap \
+ --disable-rtsp \
+ --disable-shared \
+ --disable-smb \
+ --disable-telnet \
+ --disable-verbose
+ PATH=$TOOLCHAIN_PATH:$PATH
+ make clean
+ if make -j4
+ then
+ make install
+
+ OUTPUT_ROOT=${TOOLS_ROOT}/../output/android/curl-${ABI}
+ [ -d ${OUTPUT_ROOT}/include ] || mkdir -p ${OUTPUT_ROOT}/include
+ cp -r ${LIB_DEST_DIR}/${ABI}/include/curl ${OUTPUT_ROOT}/include
+
+ [ -d ${OUTPUT_ROOT}/lib ] || mkdir -p ${OUTPUT_ROOT}/lib
+ cp ${LIB_DEST_DIR}/${ABI}/lib/libcurl.a ${OUTPUT_ROOT}/lib
+ fi;
+ popd;
+}
+
+for ((i=0; i < ${#ARCHS[@]}; i++))
+do
+ echo "${ARCHS[i]}"
+ if [[ $# -eq 0 ]] || [[ "$1" == "${ARCHS[i]}" ]]; then
+ [[ ${ANDROID_API} < 21 ]] && ( echo "${ABIS[i]}" | grep 64 > /dev/null ) && continue;
+ configure_make "${ARCHS[i]}" "${ABIS[i]}"
+ fi
+done
diff --git a/scripts/build-openssl4android.sh b/scripts/build-openssl4android.sh
new file mode 100755
index 00000000..2d5c0905
--- /dev/null
+++ b/scripts/build-openssl4android.sh
@@ -0,0 +1,98 @@
+#!/bin/bash
+#
+# Copyright 2016 leenjewel
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ux
+
+source $BASE_DIR/scripts/_shared.sh
+
+cd external
+# Setup architectures, library name and other vars + cleanup from previous runs
+LIB_NAME="openssl-1.1.0f"
+LIB_DEST_DIR=`pwd`/install_openssl/libs
+#[ -d ${LIB_DEST_DIR} ] && rm -rf ${LIB_DEST_DIR}
+[ -f "${LIB_NAME}.tar.gz" ] || wget https://www.openssl.org/source/${LIB_NAME}.tar.gz;
+
+# Unarchive library, then configure and make for specified architectures
+configure_make() {
+ ARCH=$1; ABI=$2;
+ #rm -rf "${LIB_NAME}"
+ if [ ! -d ${LIB_NAME} ]; then
+ #exit 1
+ tar xfz "${LIB_NAME}.tar.gz"
+ echo "correct openssl configuration file"
+ if [ $OS = darwin ]; then
+ sed -i '' 's/-mandroid//g' ${LIB_NAME}/Configurations/10-main.conf
+ else
+ sed -i 's/-mandroid//g' ${LIB_NAME}/Configurations/10-main.conf
+ fi
+
+ #exit 1
+ fi
+ pushd "${LIB_NAME}"
+
+ configure $*
+
+ #support openssl-1.0.x
+ if [[ $LIB_NAME != openssl-1.1.* ]]; then
+ if [[ $ARCH == "android-armeabi" ]]; then
+ ARCH="android-armv7"
+ elif [[ $ARCH == "android64" ]]; then
+ ARCH="linux-x86_64 shared no-ssl2 no-ssl3 no-hw "
+ elif [[ "$ARCH" == "android64-aarch64" ]]; then
+ ARCH="android shared no-ssl2 no-ssl3 no-hw "
+ fi
+ fi
+echo "-->${LIB_DEST_DIR}/${ABI}"
+#exit 1
+ ./Configure $ARCH \
+ --prefix=${LIB_DEST_DIR}/${ABI} \
+ --with-zlib-include=$SYSROOT/usr/include \
+ --with-zlib-lib=$SYSROOT/usr/lib \
+ no-hw no-dso \
+ zlib-dynamic \
+ no-asm \
+ no-shared \
+ no-unit-test
+ PATH=$TOOLCHAIN_PATH:$PATH
+
+ make clean
+
+ if make -j4; then
+ # make install
+ make install_sw
+ make install_ssldirs
+
+ OUTPUT_ROOT=${TOOLS_ROOT}/../output/$ABI
+ [ -d ${OUTPUT_ROOT}/include ] || mkdir -p ${OUTPUT_ROOT}/include
+ cp -r ${LIB_DEST_DIR}/${ABI}/include/openssl ${OUTPUT_ROOT}/include
+
+ [ -d ${OUTPUT_ROOT}/lib ] || mkdir -p ${OUTPUT_ROOT}/lib
+ cp ${LIB_DEST_DIR}/${ABI}/lib/libcrypto.a ${OUTPUT_ROOT}/lib
+ cp ${LIB_DEST_DIR}/${ABI}/lib/libssl.a ${OUTPUT_ROOT}/lib
+ fi;
+ popd
+
+}
+
+for ((i=0; i < ${#ARCHS[@]}; i++))
+do
+ if [[ $# -eq 0 ]] || [[ "$1" == "${ARCHS[i]}" ]]; then
+ # Do not build 64 bit arch if ANDROID_API is less than 21 which is
+ # the minimum supported API level for 64 bit.
+ [[ ${ANDROID_API} < 21 ]] && ( echo "${ABIS[i]}" | grep 64 > /dev/null ) && continue;
+ configure_make "${ARCHS[i]}" "${ABIS[i]}"
+ fi
+done
diff --git a/scripts/compile_androidviper.sh b/scripts/compile_androidviper.sh
index e3f6b0b7..c5fbd83a 100755
--- a/scripts/compile_androidviper.sh
+++ b/scripts/compile_androidviper.sh
@@ -18,6 +18,7 @@
#!/bin/bash
set -e
+ANDROID_ARCH=armv7
export ANDROID_HOME=${SDK}
export ANDROID_NDK_HOST=${OS}-${ARCH}
export ANDROID_NDK_PLATFORM=android-23
@@ -30,14 +31,15 @@ export ANDROID_API_VERSION=android-23
export PATH=$PATH:${ANDROID_HOME}/tools:${JAVA_HOME}/bin
echo $QT_HOME
cd ${DISTILLERY_ROOT_DIR}
+export DISTILLARY_INSTALLATION_PATH=${DISTILLERY_ROOT_DIR}/usr_armv7-a
mkdir -p ${DISTILLERY_BUILD_DIR}/viper
cd ${DISTILLERY_BUILD_DIR}/viper
-${QT_HOME}/5.7/android_${ANDROID_ARCH}/bin/qmake -r -spec android-g++ ${DISTILLERY_ROOT_DIR}/src/viper/viper.pro "TRANSPORT_LIBRARY = ICNET"
+${QT_HOME}/5.8/android_${ANDROID_ARCH}/bin/qmake -r -spec android-g++ ${DISTILLERY_ROOT_DIR}/src/viper/viper.pro
make
make install INSTALL_ROOT=viper-${ANDROID_ARCH}
if [ "$1" = "DEBUG" ]; then
- ${QT_HOME}/5.7/android_${ANDROID_ARCH}/bin/androiddeployqt --output viper-${ANDROID_ARCH} --verbose --input android-libviper.so-deployment-settings.json --gradle --android-platform android-23 --stacktrace --debug --target android-23 --debug --sign ${DISTILLERY_ROOT_DIR}/src/viper/android/viper.keystore viper --storepass icn_viper
+ ${QT_HOME}/5.8/android_${ANDROID_ARCH}/bin/androiddeployqt --output viper-${ANDROID_ARCH} --verbose --input android-libviper.so-deployment-settings.json --gradle --android-platform android-23 --stacktrace --debug --target android-23 --debug --sign ${DISTILLERY_ROOT_DIR}/src/viper/android/viper.keystore viper --storepass icn_viper
else
- ${QT_HOME}/5.7/android_${ANDROID_ARCH}/bin/androiddeployqt --output viper-${ANDROID_ARCH} --verbose --input android-libviper.so-deployment-settings.json --gradle --android-platform android-23 --stacktrace --debug --target android-23 --release --sign ${DISTILLERY_ROOT_DIR}/src/viper/android/viper.keystore viper --storepass icn_viper
+ ${QT_HOME}/5.8/android_${ANDROID_ARCH}/bin/androiddeployqt --output viper-${ANDROID_ARCH} --verbose --input android-libviper.so-deployment-settings.json --gradle --android-platform android-23 --stacktrace --debug --target android-23 --release --sign ${DISTILLERY_ROOT_DIR}/src/viper/android/viper.keystore viper --storepass icn_viper
fi
-cd .. \ No newline at end of file
+cd ..
diff --git a/scripts/compile_httpserver.sh b/scripts/compile_httpserver.sh
new file mode 100755
index 00000000..ecf5f2f6
--- /dev/null
+++ b/scripts/compile_httpserver.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+cd HttpServer
+if [ ! -f local.properties ]; then
+ echo sdk.dir=${SDK} > local.properties
+ echo ndk.dir=${NDK} >> local.properties
+fi
+
+if [ "$1" = "DEBUG" ]; then
+ ./gradlew assembleDebug
+else
+ ./gradlew assembleRelease
+fi
+
+echo "Apks are inside HttpServer/app/build/outputs/apk"
+cd .. \ No newline at end of file
diff --git a/scripts/compile_iget.sh b/scripts/compile_iget.sh
index 984dae07..ddc7cafc 100755
--- a/scripts/compile_iget.sh
+++ b/scripts/compile_iget.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-
-cd iGetAndroid
+set -e
+cd IGetAndroid
if [ ! -f local.properties ]; then
echo sdk.dir=${SDK} > local.properties
echo ndk.dir=${NDK} >> local.properties
@@ -12,5 +12,5 @@ else
./gradlew assembleRelease
fi
-echo "Apks are inside iGetAndroid/app/build/outputs/apk"
-cd ..
+echo "Apks are inside IGetAndroid/app/build/outputs/apk"
+cd .. \ No newline at end of file
diff --git a/scripts/compile_metisforwarder.sh b/scripts/compile_metisforwarder.sh
index 7632149c..30dd8287 100755
--- a/scripts/compile_metisforwarder.sh
+++ b/scripts/compile_metisforwarder.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-
-cd MetisForwarder
+set -e
+cd MetisForwarderAndroid
if [ ! -f local.properties ]; then
echo sdk.dir=${SDK} > local.properties
echo ndk.dir=${NDK} >> local.properties
@@ -12,5 +12,5 @@ else
./gradlew assembleRelease
fi
-echo "Apks are inside MetisForwarder/app/build/outputs/apk"
-cd ..
+echo "Apks are inside MetisForwarderAndroid/app/build/outputs/apk"
+cd .. \ No newline at end of file
diff --git a/scripts/init.sh b/scripts/init.sh
index 26e8394b..5bd4deca 100755
--- a/scripts/init.sh
+++ b/scripts/init.sh
@@ -15,14 +15,12 @@
#!/bin/bash
-set -e
-
+set -ex
ABI=$1
-
INSTALLATION_DIR=$2
OS=`echo $OS | tr '[:upper:]' '[:lower:]'`
-BASE_DIR=`pwd`
-echo "SDK_PATH ${SDK}"
+export BASE_DIR=`pwd`
+
if [ -z ${SDK_PATH} ]; then
mkdir -p sdk
cd sdk
@@ -31,17 +29,19 @@ if [ -z ${SDK_PATH} ]; then
if [ ! -f android-sdk_r24.4.1-macosx.zip ]; then
wget http://dl.google.com/android/android-sdk_r24.4.1-macosx.zip
fi
+
+ echo "unzip android-sdk"
unzip -q android-sdk_r24.4.1-macosx.zip
mv android-sdk-macosx sdk
else
- if [ ! -f android-sdk_r24.4.1-linux.zip ]; then
+ if [ ! -f android-sdk_r24.4.1-linux.tgz ]; then
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
fi
+ echo "untar android-sdk"
tar zxf android-sdk_r24.4.1-linux.tgz
mv android-sdk-linux sdk
fi
mkdir -p sdk/licenses
- mkdir -p sdk/licenses
echo "\nd56f5187479451eabf01fb78af6dfcb131a6481e" > "sdk/licenses/android-sdk-license"
echo "\n84831b9409646a918e30573bab4c9c91346d8abd" > "sdk/licenses/android-sdk-preview-license"
echo "y" | ./sdk/tools/android update sdk --filter platform-tools,build-tools-23.0.2,android-23,extra-android-m2repository,extra-google-m2repository --no-ui --all --force
@@ -55,39 +55,38 @@ if [ -z ${NDK_PATH} ]; then
mkdir -p sdk
cd sdk
if [ ! -d ndk-bundle ]; then
- if [ ! -f android-ndk-r14b-${OS}-${ARCH}.zip ]; then
- wget https://dl.google.com/android/repository/android-ndk-r14b-${OS}-${ARCH}.zip
+ if [ ! -f android-ndk-r15c-${OS}-${ARCH}.zip ]; then
+ wget https://dl.google.com/android/repository/android-ndk-r15c-${OS}-${ARCH}.zip
fi
- unzip -q android-ndk-r14b-${OS}-${ARCH}.zip
- mv android-ndk-r14b ndk-bundle
+
+ echo "unzip android-ndk"
+ unzip -q android-ndk-r15c-${OS}-${ARCH}.zip
+ mv android-ndk-r15c ndk-bundle
+ cp $BASE_DIR/external/glob.h ndk-bundle/sysroot/usr/include/
fi
cd ..
fi
-if [ -z ${CMAKE_PATH} ]; then
- mkdir -p sdk
- cd sdk
- if [ ! -d cmake ]; then
- if [ ! -f cmake-3.6.3155560-${OS}-${ARCH}.zip ]; then
- wget https://dl.google.com/android/repository/cmake-3.6.3155560-${OS}-${ARCH}.zip
- fi
- unzip -q cmake-3.6.3155560-${OS}-${ARCH}.zip -d cmake
- fi
- cd ..
+export TOOLCHAIN=$BASE_DIR/sdk/toolchain_$ABI
+
+if [ ! -d $TOOLCHAIN ];then
+ echo "creating toolchain"
+ $NDK/build/tools/make_standalone_toolchain.py --arch $ABI --api 26 --install-dir $TOOLCHAIN
fi
mkdir -p src
cd src
-if [ ! -d ccnxlibs ]; then
- echo "ccnxlibs not found"
- git clone -b ccnxlibs/master https://gerrit.fd.io/r/cicn ccnxlibs
-fi
if [ ! -d cframework ]; then
echo "cframework not found"
git clone -b cframework/master https://gerrit.fd.io/r/cicn cframework
fi
+if [ ! -d ccnxlibs ]; then
+ echo "ccnxlibs not found"
+ git clone -b ccnxlibs/master https://gerrit.fd.io/r/cicn ccnxlibs
+fi
+
if [ ! -d sb-forwarder ]; then
echo "sb-forwarder not found"
git clone -b sb-forwarder/master https://gerrit.fd.io/r/cicn sb-forwarder
@@ -101,123 +100,139 @@ if [ ! -d viper ]; then
git clone -b viper/master https://gerrit.fd.io/r/cicn viper
fi
+if [ ! -d http-server ]; then
+ echo "http-server not found"
+ git clone -b http-server/master https://gerrit.fd.io/r/cicn http-server
+fi
+
+if [ ! -d libxml2 ]; then
+ echo "libxml2 not found"
+ git clone https://github.com/GNOME/libxml2.git
+ cp $BASE_DIR/external/libxml2/CMakeLists.txt libxml2
+ cp $BASE_DIR/external/libxml2/xmlversion.h libxml2/include/libxml
+ cp $BASE_DIR/external/libxml2/config.h libxml2
+ if [ $OS = darwin ]; then
+ sed -i '' '1s/^/#include <errno.h>/' libxml2/triodef.h
+ else
+ sed -i '1s/^/#include <errno.h>/' libxml2/triodef.h
+ fi
+fi
+
+if [ ! -d libevent ]; then
+ echo "libevent not found"
+ git clone https://github.com/libevent/libevent.git
+ cp $BASE_DIR/external/libevent/AddEventLibrary.cmake libevent/cmake/
+fi
+
+if [ ! -d jsoncpp ]; then
+ echo "jsoncpp not found"
+ git clone https://github.com/open-source-parsers/jsoncpp.git
+ cp $BASE_DIR/external/jsoncpp/CMakeLists.txt jsoncpp/
+fi
+
cd ../
-cd external
+echo ${INSTALLATION_DIR}
mkdir -p ${INSTALLATION_DIR}
mkdir -p ${INSTALLATION_DIR}/include
mkdir -p ${INSTALLATION_DIR}/lib
+
if [ ! -d ${INSTALLATION_DIR}/include/openssl ]; then
echo "OpenSSL Libs not found!"
- if [ ! -d openssl-1.0.2k ]; then
- echo "OpenSSL Directory not found"
- if [ ! -f openssl-1.0.2k.tar.gz ]; then
- echo "OpenSSL Archive not found"
- wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
- fi
- tar -xzf openssl-1.0.2k.tar.gz
+ if [ "$ABI" = "arm" ]; then
+ bash scripts/build-openssl4android.sh android-armeabi
+ cp external/install_openssl/libs/armeabi-v7a/lib/*.a $INSTALLATION_DIR/lib/
+ cp -rf external/install_openssl/libs/armeabi-v7a/include/openssl $INSTALLATION_DIR/include/
+ elif [ "$ABI" = "arm64" ]; then
+ bash scripts/build-openssl4android.sh android64-aarch64
+ cp external/install_openssl/libs/arm64-v8a/lib/*.a $INSTALLATION_DIR/lib/
+ cp -rf external/install_openssl/libs/arm64-v8a/include/openssl $INSTALLATION_DIR/include/
+ elif [ "$ABI" = "x86" ]; then
+ bash scripts/build-openssl4android.sh android-x86
+ cp external/install_openssl/libs/x86/lib/*.a $INSTALLATION_DIR/lib/
+ cp -rf external/install_openssl/libs/x86/include/openssl $INSTALLATION_DIR/include/
+ else
+ bash scripts/build-openssl4android.sh android64
+ cp external/install_openssl/libs/x86_64/lib/*.a $INSTALLATION_DIR/lib/
+ cp -rf external/install_openssl/libs/x86_64/include/openssl $INSTALLATION_DIR/include/
fi
- echo "Compile OpenSSL"
- if [ ! -d ${NDK}/sources/openssl/1.0.2 ]; then
- export ANDROID_NDK_ROOT=$NDK
- bash ${BASE_DIR}/scripts/tools/build-target-openssl.sh --abis=$ABI openssl-1.0.2k --ndk-dir=${NDK}
+fi
+
+
+if [ ! -d ${INSTALLATION_DIR}/include/curl ]; then
+ echo "Curl Libs not found!"
+ if [ "$ABI" = "arm" ]; then
+ bash scripts/build-curl4android.sh android-armeabi
+ cp external/install_curl/libs/armeabi-v7a/lib/*.a $INSTALLATION_DIR/lib/
+ cp -rf external/install_curl/libs/armeabi-v7a/include/curl $INSTALLATION_DIR/include/
+ elif [ "$ABI" = "arm64" ]; then
+ bash scripts/build-curl4android.sh android64-aarch64
+ cp external/install_curl/libs/arm64-v8a/lib/*.a $INSTALLATION_DIR/lib/
+ cp -rf external/install_curl/libs/arm64-v8a/include/curl $INSTALLATION_DIR/include/
+ elif [ "$ABI" = "x86" ]; then
+ bash scripts/build-curl4android.sh android-x86
+ cp external/install_curl/libs/x86/lib/*.a $INSTALLATION_DIR/lib/
+ cp -rf external/install_curl/libs/x86/include/curl $INSTALLATION_DIR/include/
+ else
+ bash scripts/build-curl4android.sh android64
+ cp external/install_curl/libs/x86_64/lib/*.a $INSTALLATION_DIR/lib/
+ cp -rf external/install_curl/libs/x86_64/include/curl $INSTALLATION_DIR/include/
fi
- echo "Copy libssl and libcrypto in workspace"
- cp -rf ${NDK}/sources/openssl/1.0.2k/include/* ${INSTALLATION_DIR}/include/
- cp -f ${INSTALLATION_DIR}/include/openssl/opensslconf_armeabi_v7a.h ${INSTALLATION_DIR}/include/openssl/opensslconf_armeabi.h
- cp -f ${NDK}/sources/openssl/1.0.2k/libs/${ABI}/*.a ${INSTALLATION_DIR}/lib/
- rm -rf ${NDK}/sources/openssl/1.0.2k
+
fi
+cd external
if [ ! -d ${INSTALLATION_DIR}/include/boost ]; then
echo "Boost Libs not found!"
- if [ ! -d boost_1_63_0 ]; then
+ if [ ! -d boost_1_66_0 ]; then
echo "Boost Directory not found"
- if [ ! -f boost_1_63_0.tar.gz ]; then
+ if [ ! -f boost_1_66_0.tar.gz ]; then
echo "Boost Archive not found"
- wget https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.gz
+ wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
fi
- tar -xzf boost_1_63_0.tar.gz
+ tar -xzf boost_1_66_0.tar.gz
fi
- cd boost_1_63_0
+ cd boost_1_66_0
+ rm -rf install_boost
if [ ! -d install_boost ]; then
echo "Compile Boost"
- ./bootstrap.sh
- echo "import option ;" > project-config.jam
- if [ $ABI = armeabi-v7a ]; then
- echo "using gcc : arm : arm-linux-androideabi-g++ ;" >> project-config.jam
- export PATH=$PATH:${NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/${OS}-${ARCH}/bin
- elif [ $ABI = x86 ]; then
- echo "using gcc : x86 : i686-linux-android-g++ ;" >> project-config.jam
- export PATH=$PATH:${NDK}/toolchains/x86-4.9/prebuilt/${OS}-${ARCH}/bin
- elif [ $ABI = x86_64 ]; then
- echo "using gcc : x86_64 : x86_64-linux-android-g++ ;" >> project-config.jam
- export PATH=$PATH:${NDK}/toolchains/x86_64-4.9/prebuilt/${OS}-${ARCH}/bin
+
+ rm -rf stage/lib
+ rm -f bjam
+ rm -f index.htmproject-config.jam.1
+ rm -f project-config.jam.2
+ rm -f bootstrap.log
+ rm -f b2
+ rm -rf bin.v2/
+ rm -f project-config.jam
+ PREFIX=`pwd`/install_boost
+ ./bootstrap.sh --with-toolset=clang
+
+ if [ "$ABI" = "arm" ]; then
+ PATH=$TOOLCHAIN/bin:$PATH ./b2 toolset=clang link=static threading=multi threadapi=pthread target-os=android --with-system --with-filesystem --with-regex abi=aapcs binary-format=elf define=BOOST_MATH_DISABLE_FLOAT128 --prefix=$PREFIX install
+ cp -rf $PREFIX/include/boost $INSTALLATION_DIR/include
+ PATH=$TOOLCHAIN/bin:$PATH arm-linux-androideabi-ranlib $PREFIX/lib/*
+ cp -rf $PREFIX/lib/* $INSTALLATION_DIR/lib
+ elif [ "$ABI" = "arm64" ]; then
+ PATH=$TOOLCHAIN/bin:$PATH ./b2 -d+2 toolset=clang-arm64 link=static threading=multi threadapi=pthread target-os=android --with-system --with-filesystem --with-regex binary-format=elf define=BOOST_MATH_DISABLE_FLOAT128 --prefix=$PREFIX install
+ cp -rf $PREFIX/include/boost $INSTALLATION_DIR/include
+ PATH=$TOOLCHAIN/bin:$PATH aarch64-linux-android-ranlib $PREFIX/lib/*
+ cp -rf $PREFIX/lib/* $INSTALLATION_DIR/lib
+ elif [ "$ABI" = "x86" ]; then
+ PATH=$TOOLCHAIN/bin:$PATH ./b2 -d+2 toolset=clang-x86 link=static threading=multi threadapi=pthread target-os=android --with-system --with-filesystem --with-regex binary-format=elf define=BOOST_MATH_DISABLE_FLOAT128 --prefix=$PREFIX install
+ cp -rf $PREFIX/include/boost $INSTALLATION_DIR/include
+ PATH=$TOOLCHAIN/bin:$PATH i686-linux-android-ranlib $PREFIX/lib/*
+ cp -rf $PREFIX/lib/* $INSTALLATION_DIR/lib
else
- echo "using gcc : arm64-v8a : aarch64-linux-android-g++ ;" >> project-config.jam
- export PATH=$PATH:${NDK}/toolchains/aarch64-4.9/prebuilt/${OS}-${ARCH}/bin
+ PATH=$TOOLCHAIN/bin:$PATH ./b2 toolset=clang-x86_64 link=static threading=multi threadapi=pthread target-os=android --with-system --with-filesystem --with-regex abi=aapcs binary-format=elf define=BOOST_MATH_DISABLE_FLOAT128 --prefix=$PREFIX install
+ cp -rf $PREFIX/include/boost $INSTALLATION_DIR/include
+ PATH=$TOOLCHAIN/bin:$PATH x86_64-linux-android-ranlib $PREFIX/lib/*
+ cp -rf $PREFIX/lib/* $INSTALLATION_DIR/lib
fi
- echo "option.set keep-going : false ;" >> project-config.jam
- echo "before compile"
- bash ${BASE_DIR}/scripts/build-boost.sh
- echo "after compile"
- fi
- echo "Copy boost libs in workspace"
- cp -rf install_boost/include/* ${INSTALLATION_DIR}/include/
- cp -rf install_boost/lib/* ${INSTALLATION_DIR}/lib/
- cd ..
-fi
-
-echo "Create libevent"
-
-if [ ! -d ${INSTALLATION_DIR}/include/event2 ]; then
- if [ ! -d libevent ]; then
- git clone -b nougat-release https://android.googlesource.com/platform/external/libevent
- fi
- cd libevent
- cp -rf ../libevent_files/* .
- ${NDK}/ndk-build NDK_APPLICATION_MK=`pwd`/Application.mk
- echo "Copy libevent in workspace"
- cp -rf include/event2 ${INSTALLATION_DIR}/include/
- cp -rf android/event2/* ${INSTALLATION_DIR}/include/event2/
- cp -f obj/local/${ABI}/libevent.a ${INSTALLATION_DIR}/lib/
- cd ..
-fi
-
-echo "Create libdash dependencies"
-
-if [ ! -d ${INSTALLATION_DIR}/include/curl ]; then
- cd libcurl_android
- ${NDK}/ndk-build
- echo "Copy libcurl in workspace"
- cp -rf jni/libcurl/include/curl ${INSTALLATION_DIR}/include/
- cp -f obj/local/${ABI}/libcurl*.a ${INSTALLATION_DIR}/lib/
- cd ..
-fi
-
-if [ ! -d ${INSTALLATION_DIR}/include/libxml ]; then
- if [ ! -d libxml2 ]; then
- git clone git://git.gnome.org/libxml2
+
+
fi
- cd libxml2
- mkdir -p ../libxml2_android/jni/libxml2/include/libxml
- find . -maxdepth 1 -name "*.[c|h]" -exec cp {} ../libxml2_android/jni/libxml2/ \;
- cp -rf include/libxml ../libxml2_android/jni/libxml2/include/
- cp -rf include/win32config.h ../libxml2_android/jni/libxml2/include/
- cp -rf include/wsockcompat.h ../libxml2_android/jni/libxml2/include/
- cp -rf ../libxml2_files/config.h ../libxml2_android/jni/
- cp -rf ../libxml2_files/xmlversion.h ../libxml2_android/jni/libxml2/include/libxml
- cd ..
- echo `pwd`
- cd libxml2_android
- ${NDK}/ndk-build
- echo "Copy libxml2 in workspace"
- cp -rf jni/libxml2/include/* ${INSTALLATION_DIR}/include/
- cp -f obj/local/${ABI}/libxml2.a ${INSTALLATION_DIR}/lib/
- cd ..
-fi
-
-cd ..
+fi \ No newline at end of file
diff --git a/scripts/init_qt.sh b/scripts/init_qt.sh
index c082b6bd..fec0d5d5 100755
--- a/scripts/init_qt.sh
+++ b/scripts/init_qt.sh
@@ -15,77 +15,80 @@
#!/bin/bash
-set -e
+set -ex
-if [ $ARCH = "x86" ]; then
- echo "Qt is not available for x86 systems"
- exit 1
-fi
+if [ "$ANDROID_ARCH" = "arm" ]; then
+ TOOLCHAIN=`pwd`/sdk/toolchain
+ BASE_PATH=`pwd`
+ mkdir -p qt
+ cd qt
+ export QT_HOME=`pwd`/Qt
+ if [ ! -d ${QT_HOME} ]; then
+ if [ $OS = "darwin" ]; then
+ if [ ! -f qt-opensource-mac-x64-android-ios-5.8.0.dmg ]; then
+ wget http://download.qt.io/archive/qt/5.8/5.8.0/qt-opensource-mac-x64-android-ios-5.8.0.dmg
+ fi
+ VOLUME=$(hdiutil attach qt-opensource-mac-x64-android-ios-5.8.0.dmg | tail -1 | awk '{print $3}')
+ $VOLUME/qt-opensource-mac-x64-android-ios-5.8.0.app/Contents/MacOS/qt-opensource-mac-x64-android-ios-5.8.0 --script ../scripts/install_script.sh -platform minimal --verbose
+ diskutil unmount $VOLUME
+ else
+ if [ ! -f qt-opensource-linux-x64-android-5.8.0.run ]; then
+ wget http://download.qt.io/archive/qt/5.8/5.8.0/qt-opensource-linux-x64-android-5.8.0.run
+ fi
+ chmod +x qt-opensource-linux-x64-android-5.8.0.run
+ ./qt-opensource-linux-x64-android-5.8.0.run --script ../scripts/install_script.sh -platform minimal --verbose
+ fi
+ fi
-mkdir -p qt
-cd qt
-export QT_HOME=`pwd`/Qt
-if [ ! -d ${QT_HOME} ]; then
- if [ $OS = "darwin" ]; then
- if [ ! -f qt-opensource-mac-x64-android-5.7.1.dmg ]; then
- wget http://download.qt.io/archive/qt/5.7/5.7.1/qt-opensource-mac-x64-android-5.7.1.dmg
- fi
-
- VOLUME=$(hdiutil attach qt-opensource-mac-x64-android-5.7.1.dmg | tail -1 | awk '{print $3}')
- $VOLUME/qt-opensource-mac-x64-android-5.7.1.app/Contents/MacOS/qt-opensource-mac-x64-android-5.7.1 --script ../scripts/install_script.sh -platform minimal --verbose
- diskutil unmount $VOLUME
- else
- if [ ! -f qt-opensource-linux-x64-android-5.7.1.run ]; then
- wget http://download.qt.io/archive/qt/5.7/5.7.1/qt-opensource-linux-x64-android-5.7.1.run
- fi
- chmod +x qt-opensource-linux-x64-android-5.7.1.run
- ./qt-opensource-linux-x64-android-5.7.1.run --script ../scripts/install_script.sh -platform minimal --verbose
+ if [ ! -d ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/boost ]; then
+ ln -s $DISTILLERY_INSTALL_DIR/include/ccnx ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ ln -s $DISTILLERY_INSTALL_DIR/include/boost ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ ln -s $DISTILLERY_INSTALL_DIR/include/parc ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ ln -s $DISTILLERY_INSTALL_DIR/include/LongBow ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ ln -s $DISTILLERY_INSTALL_DIR/include/icnet ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ ln -s $DISTILLERY_INSTALL_DIR/include/dash ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
fi
-fi
-cp -f $DISTILLERY_INSTALL_DIR/lib/libdash.so ${QT_HOME}/5.7/android_${ANDROID_ARCH}/lib/
+ echo "clone and compile ffmpeg"
+ if [ ! -f $DISTILLERY_INSTALL_DIR/lib/libavcodec.so -o ! -f $DISTILLERY_INSTALL_DIR/libavfilter.so -o ! -f $DISTILLERY_INSTALL_DIR/lib/libavformat.so -o ! -f $DISTILLERY_INSTALL_DIR/lib/libavutil.so -o ! -f $DISTILLERY_INSTALL_DIR/lib/libswresample.so -o ! -f $DISTILLERY_INSTALL_DIR/lib/libswscale.so ]; then
-if [ ! -d ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/boost ]; then
- ln -s $DISTILLERY_INSTALL_DIR/include/ccnx ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- ln -s $DISTILLERY_INSTALL_DIR/include/boost ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- ln -s $DISTILLERY_INSTALL_DIR/include/parc ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- ln -s $DISTILLERY_INSTALL_DIR/include/LongBow ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- ln -s $DISTILLERY_INSTALL_DIR/include/icnet ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- ln -s $DISTILLERY_INSTALL_DIR/include/dash ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
-fi
+ if [ ! -d ffmpeg ]; then
+ git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
+ fi
+ fi
-if [ ! -d ffmpeg ]; then
- git clone -b release/3.3 https://git.ffmpeg.org/ffmpeg.git ffmpeg
-fi
-export FFSRC=`pwd`/ffmpeg
-export ANDROID_NDK=${NDK}
-export ANDROID_HOME=${SDK}
-export ANDROID_NDK_HOST=${OS}-${ARCH}
-export ANDROID_NDK_PLATFORM=${ANDROID_PLATFORM}
-export ANDROID_NDK_ROOT=${NDK}
-export ANDROID_NDK_TOOLCHAIN_PREFIX=arm-linux-androideabi
-export ANDROID_NDK_TOOLCHAIN_VERSION=4.9
-export ANDROID_NDK_TOOLS_PREFIX=arm-linux-androideabi
-export ANDROID_SDK_ROOT=${SDK}
-export ANDROID_API_VERSION=${ANDROID_PLATFORM}
-export PATH=$PATH:${ANDROID_HOME}/tools:${JAVA_HOME}/bin
-if [ ! -d ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/QtAV ]; then
- if [ ! -d QtAv ]; then
- git clone https://github.com/wang-bin/QtAV.git
- fi
- cd QtAV
- git submodule update --init
- cd tools/build_ffmpeg
- ./avbuild.sh android armv7
- cp sdk-android-gcc/lib/armeabi-v7a/lib* ${QT_HOME}/5.7/android_${ANDROID_ARCH}/lib/
- cp -r sdk-android-gcc/include/* ${QT_HOME}/5.7/android_${ANDROID_ARCH}/include/
- cd ../..
- mkdir -p ${DISTILLERY_BUILD_DIR}/qtav
- cd ${DISTILLERY_BUILD_DIR}/qtav
- ${QT_HOME}/5.7/android_${ANDROID_ARCH}/bin/qmake -r -spec android-g++ ${DISTILLERY_ROOT_DIR}/qt/QtAV/QtAV.pro
- make
- make install INSTALL_ROOT=android
- sh sdk_install.sh
-fi
-cd ${DISTILLERY_ROOT_DIR}
+ export FFSRC=`pwd`/ffmpeg
+ export ANDROID_NDK=${NDK}
+ export ANDROID_HOME=${SDK}
+ export ANDROID_NDK_HOST=${OS}-${ARCH}
+ export ANDROID_NDK_PLATFORM=android-26
+ export ANDROID_NDK_ROOT=${NDK}
+ export ANDROID_NDK_TOOLCHAIN_PREFIX=arm-linux-androideabi
+ export ANDROID_NDK_TOOLCHAIN_VERSION=4.9
+ export ANDROID_NDK_TOOLS_PREFIX=arm-linux-androideabi
+ export ANDROID_SDK_ROOT=${SDK}
+ export ANDROID_API_VERSION=${ANDROID_PLATFORM}
+ export PATH=$PATH:${ANDROID_HOME}/tools:${JAVA_HOME}/bin
+ if [ ! -d ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/QtAV ]; then
+ if [ ! -d QtAV ]; then
+ git clone https://github.com/wang-bin/QtAV.git
+ fi
+ cd QtAV
+ echo "INCLUDEPATH += ${DISTILLERY_INSTALL_DIR}/include" >> .qmake.conf
+ echo "LIBS += -L${DISTILLERY_INSTALL_DIR}/lib" >> .qmake.conf
+ git submodule update --init
+ cd tools/build_ffmpeg
+ ./avbuild.sh android armv7
+ cp sdk-android-gcc/lib/armeabi-v7a/lib* ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/lib/
+ cp -r sdk-android-gcc/include/* ${QT_HOME}/5.8/android_${ANDROID_ARCH}v7/include/
+ cd ../..
+ mkdir -p ${DISTILLERY_BUILD_DIR}/qtav
+ cd ${DISTILLERY_BUILD_DIR}/qtav
+ ${QT_HOME}/5.8/android_armv7/bin/qmake -r -spec android-g++ $BASE_PATH/qt/QtAV/QtAV.pro
+ make
+ make install INSTALL_ROOT=android
+ sh sdk_install.sh
+ fi
+ cd ${DISTILLERY_ROOT_DIR}
+fi \ No newline at end of file
diff --git a/scripts/update.sh b/scripts/update.sh
index 66211203..e647b3fc 100755
--- a/scripts/update.sh
+++ b/scripts/update.sh
@@ -16,19 +16,18 @@
#!/bin/bash
set -e
-#git pull
+git pull
cd src/ccnxlibs
git pull
cd ../..
cd src/cframework
git pull
cd ../..
-cd src/sb-forwarder
-git pull
-cd ../..
cd src/libicnet
git pull
cd ../..
cd src/viper
git pull
cd ../..
+cd src/httpserver
+git pull