Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section describes additional details of the SCons build script used to compile the AP Bridge software. TODO: describe that this is only necessary if you have custom pathsYou may need to further modify the SConstruct file if you install the toolchain or other dependencies in a different location than described in the build instructions. 


TODO: update SCons snippets and provide where paths should be set (instead of where it is used)

Certain parts of the build scripts may need to be adjusted to specify the location of files on the host build platform. The SConstruct file defines a build environment that contains the path to the compiler(s) and the search paths for headers and libarieslibraries

Info

SCons defines it's own default PATH for finding executables. If any of the build tools are located outside of the default locations, either the absolute path must be provided in the build environment defined in the SConstruct file or the user_path=1 option must be used when running scons commands.

...

Code Block
def get_raspi2_platform(env):
    'Set architecture-specific flags for raspberry pi 2'
    # compiler location
    env['CXX']  = '$toolchain_dir/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++'
    env['LINK'] = '$toolchain_dir/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++'
    ...
    # other variables are defined in this function to customize the build process for this target
    env['PLATFORM'] = 'armpi-linux'



Manually overriding SConstruct variables

...

Certain variables, such as target can be specified on the scons command line. For example, to use a toolchain installed in /tools/armpi-linux/arm-bcm2708:

No Format
$ scons toolchain_dir=/tools/armpi-linux/arm-bcm2708 apbridge


By default, scons prints a help message containing a list of all the variables and their default values. Some variables are used internally as part of the Dust build and release process. 

No Format
$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
default(["default"], [])

To build the AP Bridge software:

 $ scons apbridge                      # build the AP Bridge for i386
 $ scons apbridge target=armpi         # build the AP Bridge for Raspberry Pi

 $ scons apbridge_pkg                  # Create AP Bridge package for i386
 $ scons apbridge_pkg target=armpi     # Create AP Bridge package for Raspbery Pi

For internal use, to build an AP Bridge release:

 $ scons apbridge_release

Options for building:

debug: Build with debug symbols
    default: True
    actual: True

opt: Build with optimization
    default: False
    actual: False
...