Skip to content

Building OpenWebRTC

superdump edited this page Oct 4, 2014 · 36 revisions

Platform-specific dependencies

Host (Build) Platforms

Mac OS X

We support the current version of Mac OS X 10.9 Mavericks however, it has also been tested and works fine on 10.8 Mountain Lion and 10.10 Yosemite previews.

To build on Mac OS X you need to install Xcode and the command line tools. We have used the framework with a few different versions of OS X but we try to support whatever the current stable releases are from Apple.

Linux

We currently only support Ubuntu 14.04 LTS and only 64-bit. You're welcome to try building on other distributions but we probably won't be able to help with build issues at the moment.

Target Platforms

iOS

We currently target the iOS 8.0 SDK.

Android

The NDK version r9d needs to be installed and the ndk-build program must be in the path. The latest SDK shall also be installed and the adb program needs to be available in your shell environment's PATH.

Obtaining the code

Fork the OpenWebRTC git and then clone it.

git clone --recursive https://github.com/<YourName>/openwebrtc.git
cd openwebrtc

Bootstrapping the build environment

Before we can start building OpenWebRTC we need to build some tools. This takes about 20-30 minutes on a dual core i5 2.4GHz running OS X 10.9.

Available targets

Host Platform Target Name
Mac OS X 10.9 osx
Ubuntu Linux 14.04 LTS 64-bit linux

Bootstrapping

This is done in the bootstrap directory:

cd scripts/bootstrap
./bootstrap.sh -r osx
cd -

If you are using a Linux computer instead of a Mac exchange the osx argument above to linux. Note: we currently only run and test on Ubuntu 14.04 LTS but it may work on other distributions.

Build the dependencies

The dependencies used by OpenWebRTC framework are built separately. This takes about 50-60 minutes on a dual core i5 2.4GHz running OS X 10.9 when building just for the osx target. It will take longer if using more than one target and the amount of time may vary across targets.

Available targets

Target Platform Target Name
Mac OS X 10.9 osx
iOS 8.0 ios
iOS 8.0 Simulator ios-simulator
Ubuntu Linux 14.04 LTS 64-bit linux
Android android

If building for multiple platforms as in the example below, it will take much longer. The android and linux targets build some different packages to the others that take quite a bit longer to build.

Build the dependencies

Use the following commands:

cd scripts/dependencies
./build-all.sh -r osx
./deploy_deps.sh
cd -

[Optional] If you want to build for multiple targets simultaneously, it will take much longer but you can list them one after the other:

cd scripts/dependencies
./build-all.sh -r osx ios ios-simulator android
./deploy_deps.sh
cd -

Build OpenWebRTC

Available targets

Target Platform Target Name
Mac OS X 10.9 osx
iOS 8.0 ios
iOS 8.0 Simulator ios-simulator
Ubuntu Linux 14.04 LTS 64-bit linux
Android android

The OpenWebRTC framework is built using one command from the root of the openwebrtc repository:

./build.sh -r osx

[Optional] Again, you can build for multiple targets simultaneously by listing them one after the other:

./build.sh -r osx ios ios-simulator android

Now the OpenWebRTC framework is compiled and ready to be incorporated into your application.

Troubleshooting

Bootstrap or dependencies fail to build

If part of the bootstrap or dependencies fails to build, it is most likely because your build environment has additional software that we do not have. Please check your environment variables and check you are using the supported versions of platforms and tools.

Do I have to rebuild everything if a dependency fails to build and I fix it?

The simple answer

If you aren't comfortable with editing shell scripts or debugging build issues, it is better if you file a report with some information about your system and the build failure.

The very advanced answer

If you are comfortable with debugging and shell scripts and you figure out how to fix the build issue in a clean way, please submit a pull request. 😃

Fixing a failing build dependency

The below is only for developers who know about build systems. If you start playing around with this stuff, we hope it's because you know what you're doing and are going to contribute your fixes.

You can hop into dependencies/build/<platform>/<package>/ to find the out of tree build directory. From there you can run make and so on. Running make install will install into dependencies/out/<platform>/.

If you fix it by editing the shell script and want to re-run the build completely cleanly, wiping out builds for all platforms, you can go into dependencies/ and run ./build-<package>.sh -C which will completely clean out all the build and checked out code for that package. You have been warned. 😐 Then you can run ./build-<package>.sh -r <short platforms> to try the build again.

If you fix it by editing the build system of the package (i.e. the checked out code in dependencies/package/) then you need to be more careful. If doing that, you can go into dependencies/build/<platform>/<package>/ and run make and so on in there as stated above.

Continuing the dependency build process

So you fixed your issue and you want to continue building the dependencies from where you left off, instead of rebuilding everything.

You can go into dependencies/, make a copy of build-all.sh to say continue.sh and then remove the build scripts for the packages that built successfully. Then you can run say ./continue.sh -r <short platforms> to continue building the rest of the dependencies.

Clone this wiki locally