Giter Club home page Giter Club logo

scons-build-tools's Introduction

SCons Tool Collection

The SCons tools are grouped by prefixing the tool name.

Note: The group prefixes should ideally be folders. Unfortunately this is not supported by SCons for all target platforms.

Group 'compiler'

Compiler named compiler_hosted_* compile for the host operating system, all others are cross-compiler. The cross-compilers follow the GCC naming schema:

arch_(vendor_)(os_)(abi_)gcc

Available tools:

  • compiler_hosted_gcc
  • compiler_hosted_gcc_coverage
  • compiler_hosted_llvm
  • compiler_hosted_llvm_sanitizer
  • compiler_arm_none_eabi_gcc
  • compiler_sparc_rtems_gcc
  • compiler_or1k_aac_rtems_gcc
  • compiler_or32_aac_elf_gcc

Build flags

The standard Unix build flags like CCFLAGS are split into several environment variables. With this the cross compiler can set several options while allowing the user to change other parts.

The following environment variables are available:

Options for C and C++ (CCFLAGS):

  • CCFLAGS_target
  • CCFLAGS_optimize
  • CCFLAGS_debug
  • CCFLAGS_warning
  • CCFLAGS_other

Options for C++ (CXXFLAGS)

  • CXXFLAGS_language
  • CXXFLAGS_dialect
  • CXXFLAGS_warning
  • CXXFLAGS_other

Options for C (CFLAGS)

  • CFLAGS_language
  • CFLAGS_dialect
  • CFLAGS_warning
  • CFLAGS_other

Options for the linker (LINKFLAGS)

  • LINKFLAGS_target
  • LINKFLAGS_other

Typically *_target, *_dialect and *_warning are set by the cross compilers, while the others variables can be freely changed by the user. It is also possible to overwrite the definitions from the cross-compiler by explicitly specifying the value.

Example:

env = Environment(toolpath=[...],
                  tools=['compiler_hosted_gcc'],
                  CXXFLAGS_language=['-std=c++11', '-pedantic'])
...
or
...
env['CXXFLAGS_language'] = ['-std=c++11', '-pedantic']

Group 'settings'

The setting tools configure the environment.

Available tools:

  • setttings_buildpath
  • setttings_gcc_default_internal
  • setttings_gcc_optionsfile

The setttings_gcc_default_internal tool is not intended to be used by the user but is loaded by the GCC based compilers to define a common set of options.

If the setttings_gcc_optionsfile tool is loaded the GCC command line options are passed in a temporary file to avoid problems with over-long command line arguments (especially under Windows).

With setttings_buildpath it is possible to perform out-of-source builds. The tool must be loaded after the compiler because it alters the emitters for object files and libraries. The build folder can be specified by setting the BUILDPATH and BASEPATH environment variables.

Group 'utils'

Tools in this folder add helper functions for writing SConstruct files.

Available tools:

  • utils_common
  • utils_buildformat
  • utils_buildsize
  • utils_gcc_version

The utils_buildformat tool defines COMSTR* variables for the standard tools generating a cleaner command line output. The actual command line options can be show by using scons verbose=1.

utils_buildsize is useful for embedded devices. It shows an overview of the used Flash (ROM) and RAM areas. The user need to specify sizes for Flash and RAM.

Example:

env = Environment(toolpath=[...],
                  tools=['compiler_sparc_rtems_gcc', 'utils_buildsize'],
                  DEVICE_SIZE={
                      'name' : 'Nexys 3',
                      'flash': 16777216,
                      'ram'  : 16777216
                  },)
...

With the utils_gcc_version tool it is possible to detect the used GCC version. Has to be loaded after the compiler. It is loaded by default from all GCC based compilers.

Group 'tools'

Tools from the 'tools' folder generate additional files.

Available tools:

License

The SCons tools are licensed under the Mozilla Public License v2.0 unless otherwise noted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.