2015-12-21 03:17:05 +01:00
# How to build from source?
2015-07-31 18:32:15 +02:00
2016-04-02 18:59:30 +02:00
Both development environment and GCS are supported on Windows, Linux and Mac OS X.
2015-07-31 18:32:15 +02:00
2016-04-02 18:59:30 +02:00
# Install prerequisites
2015-12-21 03:17:05 +01:00
2015-07-31 18:32:15 +02:00
The first step is to Install all OS specific prerequisites.
2015-12-21 03:17:05 +01:00
2016-04-02 18:59:30 +02:00
## Mac OS X
2015-12-21 03:17:05 +01:00
2016-01-22 22:50:18 +01:00
Install XCode and its relatated command line tools (follow Apple documentation). Install git, curl and p7zip.
You can use brew with `brew install git curl p7zip` or macport with `sudo port install git curl p7zip` .
2015-07-31 18:32:15 +02:00
2016-04-02 18:59:30 +02:00
## Ubuntu
2015-12-21 03:17:05 +01:00
2016-01-22 22:50:18 +01:00
sudo apt-get install git build-essential curl gdb wget debhelper p7zip-full unzip flex bison libsdl1.2-dev libudev-dev libusb-1.0-0-dev libc6-i386 mesa-common-dev
2015-12-21 03:17:05 +01:00
2016-04-02 18:59:30 +02:00
## Windows
2015-07-31 18:32:15 +02:00
2016-04-02 18:59:30 +02:00
### Install [Msys2](https://msys2.github.io/)
2016-01-22 22:50:18 +01:00
2016-03-20 18:11:20 +01:00
Follow the instructions on the web site. You can either install the i686 (Win32) or x86_64 (Win64) version.
It is recommended to go for the Win64 Shell if possible.
The x86_64 version has both Win32 and Win64 shells and it is possible to build both i686 and x86_64 applications.
2015-07-31 18:32:15 +02:00
2016-04-02 18:59:30 +02:00
### Add the LibrePilot MinGW package repository
2015-07-31 18:32:15 +02:00
2016-03-20 18:11:20 +01:00
Add the following lines at the end of your /etc/pacman.conf file:
2015-07-31 18:32:15 +02:00
2016-03-20 18:11:20 +01:00
[librepilot-mingw]
SigLevel = Optional TrustAll
Server = http://download.librepilot.org/repo/mingw
2015-07-31 18:32:15 +02:00
2016-04-02 18:59:30 +02:00
### Install required packages
2015-07-31 18:32:15 +02:00
2016-04-02 18:59:30 +02:00
#### For i686 applications
2016-03-20 18:11:20 +01:00
Start a MinGW-w64 Win64 Shell or a MinGW-w64 Win32 Shell.
pacman -Sy
pacman -S --needed git unzip tar mingw-w64-i686-toolchain mingw-w64-i686-ccache mingw-w64-i686-qt5 mingw-w64-i686-SDL mingw-w64-i686-mesa mingw-w64-i686-openssl mingw-w64-i686-gdal-minimal mingw-w64-i686-OpenSceneGraph mingw-w64-i686-osgearth
Optionally install debug packages:
pacman -S --needed mingw-w64-i686-OpenSceneGraph-debug mingw-w64-i686-osgearth-debug
2016-04-02 18:59:30 +02:00
#### For x86_64 applications
2016-03-20 18:11:20 +01:00
Start a MinGW-w64 Win64 Shell.
pacman -Sy
pacman -S --needed git unzip tar mingw-w64-x86_64-toolchain mingw-w64-x86_64-ccache mingw-w64-x86_64-qt5 mingw-w64-x86_64-SDL mingw-w64-x86_64-mesa mingw-w64-x86_64-openssl mingw-w64-x86_64-gdal-minimal mingw-w64-x86_64-OpenSceneGraph mingw-w64-x86_64-osgearth
Optionally install debug packages:
pacman -S --needed mingw-w64-x86_64-OpenSceneGraph-debug mingw-w64-x86_64-osgearth-debug
2015-12-21 03:17:05 +01:00
2016-01-22 22:50:18 +01:00
**NOTE** On Windows you need to run the mingw version of make, which is `mingw32-make`
2015-12-21 03:17:05 +01:00
2016-04-02 18:59:30 +02:00
# Setup the build environment and build
2015-07-31 18:32:15 +02:00
2016-01-22 22:50:18 +01:00
The `all_sdk_install` target will automatically retrieve and install all needed tools (qt, arm gcc, etc.) in a local folder `/path/to/LibrePilot_root/tools`
2015-07-31 18:32:15 +02:00
2016-04-02 18:59:30 +02:00
## Ubuntu / Mac OS X
2015-12-21 03:17:05 +01:00
2016-01-22 22:50:18 +01:00
make all_sdk_install
make package
2015-12-21 03:17:05 +01:00
2016-04-02 18:59:30 +02:00
## Windows
2015-07-31 18:32:15 +02:00
2016-01-22 22:50:18 +01:00
mingw32-make all_sdk_install
mingw32-make package
The `package` target will build the complete installable package for the current platform.
2015-07-31 18:32:15 +02:00
2016-01-22 22:50:18 +01:00
You can build the `all` target to just build the software.
2015-07-31 18:32:15 +02:00
2016-01-22 22:50:18 +01:00
Run `make` with no arguments to show the complete list of supported targets.