Build From Source - iOS and OS X
Development Environment Requirements
The AllJoyn™ build environment requires:
- Apple computer system with OS X 10.11 (El Capitan) or later.
- Xcode 7.x or higher for AllJoyn 16.04
- Xcode 6.x or higher for AllJoyn 15.04
NOTE: This document is based on OS X 10.11.6 with Xcode 7.3.1 newly installed. Both are the latest versions at time of publication.
Installation
Install the following on your OS X 10.11 or above system:
Xcode
- Click on the Apple icon in the upper left of your desktop.
- Click on App Store...
- Search for Xcode.
- Download and install Xcode.
- After successful installation, you may open Xcode from your Applications folder.
NOTE: This document recommends using Xcode 7 and is written as such. However, if you are using Xcode 6.x to build AllJoyn 15.04 you may need to run the following command from a terminal window to install the Command Line Tools:
$ xcode-select --install
Homebrew
Use Homebrew to deploy SCons, Git, and Uncrustify to your OS X system.
To install Homebrew, open a terminal window, and type the following command:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
NOTE: More information on Homebrew can be found at http://mxcl.github.com/homebrew.
SCons
Use the SCons build tool to generate the AllJoyn C++ API binaries for iOS and OS X.
To install SCons, open a terminal window, and type the following command:
$ brew install scons
Git
Use Git for source control.
To install Git, open a terminal window, and type the following command:
$ brew install git
Appledoc, Doxygen, and Graphviz
NOTE: Appledoc, Doxygen, and Graphviz are only required if you want to generate the API Reference Manual.
The Appledoc and Doxygen tools generates documentation for the AllJoyn Objective-C and C++ language bindings respectively. Graphviz diagrams class hierarchies. More information is available at the following websites.
- Appledoc - http://gentlebytes.com/appledoc/
- Doxygen - http://www.doxygen.org
- Graphviz - http://www.graphviz.org
To install these programs, open a terminal window and type the following commands:
$ brew install appledoc
$ brew install doxygen
$ brew install graphviz
Obtaining the AllJoyn source
To download the AllJoyn source code, select the version you'd like, and follow the steps below:
16.04
Open a terminal window and type the following commands:
$ mkdir ~/alljoyn_src
$ cd ~/alljoyn_src
$ git clone https://git.allseenalliance.org/gerrit/core/alljoyn.git
$ cd alljoyn
$ git checkout RB16.04
15.04
Open a terminal window and type the following commands:
$ mkdir ~/alljoyn_src
$ cd ~/alljoyn_src
$ git clone https://git.allseenalliance.org/gerrit/core/alljoyn.git
$ cd alljoyn
$ git checkout RB15.04
$ Download the patch
$ cp ~/Downloads/alljoyn_darwin.patch .
$ git apply alljoyn_darwin.patch
Obtaining OpenSSL
OpenSSL is an open source toolkit for implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1).
NOTE: OpenSSL is only required if building 15.04. If you are building 16.04, please skip to Building the Alljoyn Framework. NOTE: You may put these files wherever you’d like. For the purposes of this document, they will be put in their own directories under ~/openssl_src/ NOTE: If you are building for 32 bit, replace step 6 below with ./config.
To install OpenSSL, open a terminal window, and type the following commands:
$ mkdir ~/openssl_src
$ cd ~/openssl_src
$ git clone https://github.com/openssl/openssl.git
$ cd openssl
$ git checkout OpenSSL_1_0_1-stable
$ ./Configure darwin64-x86_64-cc
$ cd ~/openssl_src
$ git clone https://github.com/jmartinezhern/openssl-xcode.git
$ cd openssl-xcode
$ mv ~/openssl_src/openssl .
Open the openssl.xcodeproj in Xcode.
- File menu > Open
- Navigate to ~/openssl_src/openssl-xcode/ in Finder
- Select openssl.xcodeproj
- Click on Open
In Xcode, build the crypto target (libssl.a and libcrypto.a) for each platform that you need for your project.
NOTE: As an example, this document will use Generic iOS Device for OpenSSL and alljoyn_core_arm64 for the AllJoyn section below.
- In the menu, go to Product > Destination
- Select Generic iOS Device
- Go to Product > Build (Or Press Play)
Next, copy the libraries to your OpenSSL directory.
Open a terminal window and type the following commands:
$ cd ~/openssl_src/openssl-xcode/openssl
$ mkdir build
$ cd ~/Library/Developer/Xcode/DerivedData
$ ls to find the openssl libraries you just built.
$ cd openssl-xxxxxxxxxxxxxxx/Build/Products
$ cp -R Debug-iphoneios ~/openssl_src/openssl-xcode/openssl/build/
NOTE: You’ll want to repeat the last step for each platform that you’ll be using.
Building the AllJoyn Framework
Using the Xcode Integrated Development Environment (IDE) to build AllJoyn is recommended, but command line instructions are below.
Xcode IDE build for 16.04
- Open Xcode.
- In the menu, go to File > Open
- Navigate Finder to ~/alljoyn_src/alljoyn/alljoyn_objc/alljoyn_darwin.xcodeproj and click Open.
- Go to Product > Scheme > alljoyn_core_arm64
- Go to Product > Destination > Generic iOS Device
- Go to Product > Build (Or Press Play)
Xcode IDE build for 15.04
- Open Xcode.
- In the menu, go to File > Open
- Navigate Finder to ~/alljoyn_src/alljoyn/alljoyn_objc/alljoyn_darwin.xcodeproj and click Open.
- On the left panel, click on alljoyn_darwin
- On the middle panel, click on info
- Enter "OPENSSL_ROOT=
" before "--$(ACTION)". NOTE Include the quotes - Press Return
- Go to Product > Scheme > alljoyn_core_arm64
- Go to Product > Destination > Generic iOS Device
- Go to Product > Build (Or Press Play)
You can find the output in the follow directories:
~/alljoyn_src/alljoyn/build/darwin/arm64/iphoneos/debug/dist/cpp
NOTE: Each platform will appear in it's own directory in .../darwin/<architecture>/<platform>/<build>/dist/cpp.
Command line build
Open a terminal window and type the following commands
- cd ~/alljoyn_src/alljoyn/alljoyn_objc/
64-bit iOS devices, run the following command:
$ /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project alljoyn_darwin.xcodeproj -scheme alljoyn_core_arm64 -sdk iphoneos -configuration Debug
For all other iOS devices, run the following command:
$ /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project alljoyn_darwin.xcodeproj -scheme alljoyn_core_ios -sdk iphoneos -configuration Debug
iOS simulator, run the following command:
$ /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project alljoyn_darwin.xcodeproj -scheme alljoyn_core_ios -sdk iphonesimulator -configuration Debug
OS X, run the following command:
$ /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project alljoyn_darwin.xcodeproj -scheme alljoyn_core_osx
Social Links