Difference between revisions of "Android"

From sigrok
Jump to navigation Jump to search
(Created page with "== Building from source == === Requirements === * Android NDK == Initial setup == First, download the latest [http://developer.android.com/tools/sdk/ndk/index.html Android...")
 
m
Line 1: Line 1:
'''NOTE:''' This page is work in progress!
== Building from source ==
== Building from source ==


Line 14: Line 16:
  $ '''wget http://dl.google.com/android/ndk/android-ndk-r8d-linux-x86.tar.bz2'''
  $ '''wget http://dl.google.com/android/ndk/android-ndk-r8d-linux-x86.tar.bz2'''
  $ '''tar xfvj android-ndk-r8d-linux-x86.tar.bz2'''
  $ '''tar xfvj android-ndk-r8d-linux-x86.tar.bz2'''
$ '''cd android-ndk-r8d'''
Now, create a toolchain installation that can be used for cross-compiling for Android (adapt '''--platform''' and '''--arch''' as needed):
$ '''./build/tools/make-standalone-toolchain.sh --platform=''android-9'' --install-dir=$HOME/android/android-arm-toolchain --arch=''arm'''''
You now have a working toolchain and build environment in '''$HOME/android/android-arm-toolchain'''.
Now prepend the toolchain's '''bin''' directory to your $PATH:
$ '''export PATH=$HOME/android/android-arm-toolchain/bin:$PATH'''
We can now cross-compile packages for Android. Most autotools-using packages will usually just need a '''./configure --host=arm-linux-androideabi''', the rest is pretty straight-forward.


Now setup the path to the respective toolchain:
=== libzip ===


  $ '''export PATH=$HOME/android/android-ndk-r8d/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86/bin:$PATH''''
  $ '''wget http://www.nih.at/libzip/libzip-0.10.1.tar.gz'''
$ '''tar xfvz libzip-0.10.1.tar.gz'''
$ '''cd libzip-0.10.1'''
$ '''autoreconf -i -f'''
$ '''./configure --host=arm-linux-androideabi --prefix=$HOME/sr_android && make && make install'''


=== libsigrok ===
=== libsigrok ===
Line 24: Line 43:


  $ '''git clone git://sigrok.org/libsigrok'''
  $ '''git clone git://sigrok.org/libsigrok'''
  $ '''./configure --host=arm-linux-androideabi --prefix=$HOME/sr_android'''
$ '''cd libsigrok'''
$ '''make'''
$ '''./autogen.sh'''
$ '''make install'''
  $ '''./configure --host=arm-linux-androideabi --prefix=$HOME/sr_android && make && make install'''

Revision as of 21:55, 18 January 2013

NOTE: This page is work in progress!

Building from source

Requirements

  • Android NDK

Initial setup

First, download the latest Android NDK and extract it, e.g. in $HOME/android.

$ cd $HOME
$ mkdir android
$ cd android
$ wget http://dl.google.com/android/ndk/android-ndk-r8d-linux-x86.tar.bz2
$ tar xfvj android-ndk-r8d-linux-x86.tar.bz2
$ cd android-ndk-r8d

Now, create a toolchain installation that can be used for cross-compiling for Android (adapt --platform and --arch as needed):

$ ./build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=$HOME/android/android-arm-toolchain --arch=arm

You now have a working toolchain and build environment in $HOME/android/android-arm-toolchain.

Now prepend the toolchain's bin directory to your $PATH:

$ export PATH=$HOME/android/android-arm-toolchain/bin:$PATH

We can now cross-compile packages for Android. Most autotools-using packages will usually just need a ./configure --host=arm-linux-androideabi, the rest is pretty straight-forward.

libzip

$ wget http://www.nih.at/libzip/libzip-0.10.1.tar.gz
$ tar xfvz libzip-0.10.1.tar.gz
$ cd libzip-0.10.1
$ autoreconf -i -f
$ ./configure --host=arm-linux-androideabi --prefix=$HOME/sr_android && make && make install

libsigrok

In a temporary build directory we can now build (the install directory will be $HOME/sr_android):

$ git clone git://sigrok.org/libsigrok
$ cd libsigrok
$ ./autogen.sh
$ ./configure --host=arm-linux-androideabi --prefix=$HOME/sr_android && make && make install