This page describes how to setup a build environment on OSX.
Setup a build environment
You need Xcode and it's command line tools. Download Xcode from App Store, then start Xcode to approve the license agreement.
Install Command Line Tools:
# For Xcode >= 8
sudo ln -s xcodebuild xcrun
# note - in order to compile directly in Xcode 8 IDE, remove the xcrun symbolic link
Make sure Command Line Tools are specified in the Xcode preferences
Homebrew and friends
You also need Homebrew for a little more convenient OSS software installations. The following should get you started:
brew install curl
brew install p7zip
brew install gnu-tar
brew install cmake
brew install gdal
brew install geos
Note on gnu-tar: It may be that the packager for firmware wants to use gnu-tar and not the bsdtar that comes with OSX. Make sure you know how to put it to path or update the symlinks.
SDL 1.2 can be downloaded from https://www.libsdl.org and copied to /Library/Frameworks. It should work out of the box, but when you have trouble maybe the following helps.
SDL/SDL.h not found error on compile
If you do have trouble similar to LP-188 building the sdlgamepad lib with <SDL/SDL.h> not found error, make sure you add the symlink as following:
# Create a symlink to "nest" headers under SDL as expected by code
ln -s SDL .
If this doesn't work and it still can't find the framework, copy the framework into ./ground/gcs/src/libs/sdlgamepad and modify the sdlgamepad.pro file to use this new header and framework path.
Get the code using Git
OSX most likely has Git already installed.
Choose/create a dir where you want LibrePilot code:
mkdir -p ~/code
Checkout code :
git clone https://bitbucket.org/librepilot/librepilot.git
Better to fork the repo and clone from your own copy. Easier to create pull requests later.
Change current directory to ~/code/librepilot:
Now you can checkout code from remote Git server:
git checkout next
Note!: Future dev happens in next branch. Keep your fork up to date with that.
Install development libraries and tools, these will be downloaded and automatically installed using root Makefile:
Build - Run software locally
Take also a look to the Make Basics page and running "make" to see all the options to build pieces of Librepilot individually.
make -j8 opfw_resource
make -j8 gcs
# open the app, refresh the views, create gcs.log in home dir
open ./build/librepilot-gcs_release/LibrePilot\ GCS.app --args -reset -log ~/gcs.log
Note: ./build/librepilot-gcs_release contains the latest .app if you prefer to navigate to it.
Build a .dmg package (of course, -j8 could be anything less/more depending the number of cores):
Again it ends up in ./build directory.
Now that you are done, go and create your first pull request with amazing new feature or bugfix!