File: build_android

package info (click to toggle)
aubio 0.4.9-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,720 kB
  • sloc: python: 20,447; ansic: 20,127; makefile: 348; sh: 232
file content (41 lines) | stat: -rwxr-xr-x 1,099 bytes parent folder | download | duplicates (5)
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
#! /bin/bash

set -e
set -x

# location of android NDK
NDK_PATH=$PWD/../contrib/android-ndk-r12

WAFOPTS="--disable-avcodec --disable-samplerate --disable-jack --disable-sndfile"

# set these variables to change the default values
[ -z $PLATFORM ] && PLATFORM=android-19
[ -z $ARCH ] && ARCH=arm

# location nof the standalone toolchains, created with
# $NDK_PATH/build/tools/make-standalone-toolchains.sh
NDK_TOOLCHAINS=$PWD/contrib

# location of the current toolchain
CURRENT_TOOLCHAIN=$NDK_TOOLCHAINS/toolchain-$PLATFORM-$ARCH

# if it does not exist, create the toolchain
[ -d $CURRENT_TOOLCHAIN ] || \
  $NDK_PATH/build/tools/make-standalone-toolchain.sh \
    --platform=$PLATFORM --arch=$ARCH \
    --install-dir=$CURRENT_TOOLCHAIN

# aubio install destination directory
DESTDIR=$PWD/dist-$PLATFORM-$ARCH

# wipe it out if it exists
[ -d $DESTDIR ] && rm -rf $DESTDIR

# get the link to gcc
CC=`ls $CURRENT_TOOLCHAIN/*-linux-android*/bin/gcc`

CFLAGS="-Os" \
  CC=$CC \
  ./waf distclean configure build install --destdir=$DESTDIR \
   --verbose \
   --with-target-platform=android $WAFOPTS