xref: /rockchip-linux_mpp/build/android/x86/make-Android.bash (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1#!/bin/bash
2# Run this from within a bash shell
3HOST_IP=`hostname --all-ip-addresses`
4if [ ${HOST_IP} == "10.10.10.65" ] || [ ${HOST_IP} == "10.10.10.67" ]; then
5    ANDROID_NDK=/home/pub/ndk/android-ndk-r10d/
6else
7    ANDROID_NDK=~/work/android/ndk/android-ndk-r10d/
8fi
9
10PLATFORM=$ANDROID_NDK/platforms/android-21/arch-x86
11
12cmake -DCMAKE_TOOLCHAIN_FILE=../android.toolchain.cmake                     \
13      -DCMAKE_BUILD_TYPE=Release                                            \
14      -DANDROID_FORCE_ARM_BUILD=ON                                          \
15      -DANDROID_NDK=${ANDROID_NDK}                                          \
16      -DANDROID_SYSROOT=${PLATFORM}                                         \
17      -DANDROID_ABI="x86"                                                   \
18      -DANDROID_TOOLCHAIN_NAME="x86-4.8"                                    \
19      -DANDROID_NATIVE_API_LEVEL=android-21                                 \
20      -DANDROID_STL=system                                                  \
21      -DRKPLATFORM=ON                                                       \
22      ../../../
23
24# ----------------------------------------------------------------------------
25# usefull cmake debug flag
26# ----------------------------------------------------------------------------
27      #-DCMAKE_BUILD_TYPE=Debug                                              \
28      #-DCMAKE_VERBOSE_MAKEFILE=true                                         \
29      #--trace                                                               \
30      #--debug-output                                                        \
31
32#cmake --build . --clean-first -- V=1
33cmake --build .
34
35# ----------------------------------------------------------------------------
36# test script
37# ----------------------------------------------------------------------------
38#adb push osal/test/rk_log_test /system/bin/
39#adb push osal/test/rk_thread_test /system/bin/
40#adb shell sync
41#adb shell logcat -c
42#adb shell rk_log_test
43#adb shell rk_thread_test
44#adb logcat -d|tail -30
45
46
47