~mir-team/mir/trunk

« back to all changes in this revision

Viewing changes to cross-compile.sh

  • Committer: Kevin DuBois
  • Date: 2012-11-19 19:21:52 UTC
  • mto: This revision was merged to the branch mainline in revision 270.
  • Revision ID: kevin.dubois@canonical.com-20121119192152-buo2v87mgxf5yc7w
update compile scripts for consistency and fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Script to help in cross compiling for Android.
2
 
# Assumes that a standalone ndk is available, that
3
 
# contains all of mir's dependencies in its subfolder
4
 
# sysroot.
5
 
# Please adjust ANDROID_STANDALONE_TOOLCHAIN to your own setup.
6
 
 
7
 
cwd=`pwd`
8
 
mkdir $1
9
 
cd $1
 
1
#!/bin/sh
 
2
# build script for Mir on android arm devices
 
3
# set $MIR_ANDROID_NDK_DIR to the android toolchain noted in DEPENDENCIES
 
4
# test run requires package 'android-tools-adb' 
 
5
#
 
6
set -e
 
7
 
 
8
if [ ! -e $MIR_ANDROID_NDK_DIR ]; then
 
9
    echo "aborting: MIR_ANDROID_NDK_DIR not set. set to path containing mir NDK"
 
10
    exit
 
11
fi
 
12
 
10
13
export MIR_NDK_PATH=$MIR_ANDROID_NDK_DIR
11
 
 
12
 
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/AndroidCrossCompile.cmake \
13
 
-DBoost_COMPILER=-gcc \
14
 
-DMIR_ENABLE_DEATH_TESTS=NO \
15
 
-DMIR_INPUT_ENABLE_EVEMU=NO \
16
 
-DMIR_PLATFORM=android \
17
 
$cwd
18
 
 
19
 
make 
20
 
 
21
 
$MIR_ANDROID_SDK_DIR/platform-tools/adb push lib/libmirclient.so.0.0.1 /data/user
22
 
 
23
 
$MIR_ANDROID_SDK_DIR/platform-tools/adb push bin/acceptance-tests /data/user
24
 
$MIR_ANDROID_SDK_DIR/platform-tools/adb shell 'cd /data/user && LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH GTEST_OUTPUT=xml:./ ./acceptance-tests'
25
 
$MIR_ANDROID_SDK_DIR/platform-tools/adb pull '/data/user/acceptance-tests.xml'
26
 
 
27
 
$MIR_ANDROID_SDK_DIR/platform-tools/adb push bin/integration-tests /data/user
28
 
$MIR_ANDROID_SDK_DIR/platform-tools/adb shell 'cd /data/user && LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH GTEST_OUTPUT=xml:./ ./integration-tests'
29
 
$MIR_ANDROID_SDK_DIR/platform-tools/adb pull '/data/user/integration-tests.xml'
30
 
 
31
 
$MIR_ANDROID_SDK_DIR/platform-tools/adb push bin/unit-tests /data/user
32
 
$MIR_ANDROID_SDK_DIR/platform-tools/adb shell 'cd /data/user && LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH GTEST_OUTPUT=xml:./ ./unit-tests'
33
 
$MIR_ANDROID_SDK_DIR/platform-tools/adb pull '/data/user/unit-tests.xml'
 
14
BUILD_DIR=build-android-arm
 
15
if [ ! -e ${BUILD_DIR} ]; then
 
16
    mkdir ${BUILD_DIR}
 
17
    ( cd ${BUILD_DIR} &&
 
18
      cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/AndroidCrossCompile.cmake \
 
19
          -DBoost_COMPILER=-gcc \
 
20
          -DMIR_ENABLE_DEATH_TESTS=NO \
 
21
          -DMIR_INPUT_ENABLE_EVEMU=NO \
 
22
          -DMIR_PLATFORM=android \
 
23
          .. )
 
24
fi
 
25
 
 
26
cmake --build ${BUILD_DIR}
 
27
 
 
28
adb push ${BUILD_DIR}/lib/libmirclient.so.0.0.1 /data
 
29
 
 
30
adb push ${BUILD_DIR}/bin/acceptance-tests /data
 
31
adb shell 'cd /data && LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH GTEST_OUTPUT=xml:./ ./acceptance-tests'
 
32
adb pull '/data/acceptance-tests.xml'
 
33
 
 
34
adb push ${BUILD_DIR}/bin/integration-tests /data
 
35
adb shell 'cd /data && LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH GTEST_OUTPUT=xml:./ ./integration-tests'
 
36
adb pull '/data/integration-tests.xml'
 
37
 
 
38
adb push ${BUILD_DIR}/bin/unit-tests /data
 
39
adb shell 'cd /data && LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH GTEST_OUTPUT=xml:./ ./unit-tests'
 
40
adb pull '/data/unit-tests.xml'