Overview

The source code for AllJoyn is stored in a set of git projects that can be cloned individually or as a group using the repo tool.

AllJoyn is currently supported on the following target platforms:

Prerequisites

General Prerequisites

Linux Prerequites

Android Prerequisites for Google baseline phones (G1, Nexus One, etc)

Java Prerequisites

Documentation Prerequisites

Building the source code

Use scons -h for some basic settings. In the examples below, any of the scons variables' default values can be set as environment variables.

Building for Ubuntu 10.10 (x86 target)

    $ cd <workspace>
    $ scons OS=linux CPU=x86

Building for Ubuntu 10.10 (x86-64 target)

    $ cd <workspace>
    $ scons OS=linux CPU=x86-64

Building for Android Froyo (2.2)

To build for Android it is necessary to indicate where the NDK and the Android source is installed. The paths to these are idendicated using the ANDRIOD_NDK, and ANDROID_SRC variables. An example is shown below.

    $ cd <workspace>
    $ scons OS=android CPU=arm ANDROID_NDK=/usr/local/android-ndk ANDROID_SRC=/home/user/android-platform

Build variants

Building in "release mode" removes all symbol information and enables code optimization. To build in release mode, add the following build variable to your scons command line:

    VARIANT=release

If the variable is not defined the default configuration is to build the debug vairant.

Java Support

The AllJoyn Java code is built automatically; however, in order to build it, scons needs to know where the Java tools are located. Set two environment variables to tell scons where to find the tools:

    $ export JAVA_HOME=<path_of_sun-java-5>
    $ export CLASSPATH=<path_to_junit/junit4.jar>

Here are the paths used on a typical Ubuntu installation:

    $ export JAVA_HOME="/usr/lib/jvm/java-5-sun"
    $ export CLASSPATH="/usr/share/java/junit4.jar"

In some circumstances scons may not be able to find the Java tools even when JAVA_HOME is explicitly specified. This issue is described in this blog post. In short, the blog says that scons will only search for sun-java-5 somewhere in /usr/local/bin:/opt/bin:/bin:/usr/bin. As a work around for this issue you can add a symlink to one of the searched folders, for example:

    /usr/bin/java -> /opt/java/something/bin/java

NOTE: currently the scons scripts reqiure these variables to be defined to bild any of the AllJoyn code.

Build Products

A description of the output parameters can be found in the file build/<OS>/<CPU>/<variant>/dist/README.TXT. For example, for OS=linux, CPU=x86, VARIANT=release would result in the file being in the build/linux/x86/release/dist/ directory.

More info on Scons

The Scons User Guide is a good place to learn about the scons build system.