#~ Copyright David Abrahams 2001.
#~ Copyright Rene Rivera 2004.

#~ Distributed under the Boost Software License, Version 1.0.
#~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

# A summary of features:
#
# - "feature" has a fixed list of values, of which the first is the default.
#   Affect link compatability.
#
# - "free-feature" has a variable or fixed list of values, default is empty.
#   Does not affect link compatability.
#
# - "path-feature" has a variable list of path values, default is empty.
#   Does not affect link compatability.
#
# - "dependency-feature" like "path-feature" but affects dependency rebuilds.

# Profiling feature support by Toon Knapen <toon@si-lab.com>.
feature profiling : off on ;

# C/C++ alignment of structure members
feature struct-alignment : auto 1 2 4 8 16 ;

# Type of exceptions to use, Metrowerks/CodeWarrior only.
feature eh-model : default fast msvc ;

# ??, GCC only.
feature vtable-thunks : default on off ;

# Generate code to support, or not threading.
feature threading : single multi ;

# Link to the language runtime libraries as a shared object, or statically
# link them into the produced object.
feature runtime-link : dynamic static ;

# Use either the debug or release versions of the language runtime,
# when available.
feature runtime-build : debug release ;

# Compilation optimization level.
feature optimization : off speed space ;

# Inlining, "off" disables it, "on" enables with "inline" keywords, and
# "full" enables it for specified functions and any others the compiler
# deams inline-able.
feature inlining : off on full ;

# Generate and include debug symbol information.
feature debug-symbols : on off ;

# ??.
free-feature debug-store : object database ;

# What type of OS subsystem to target. Windows only.
free-feature user-interface : console gui ;

# ??.
feature unicode-application : on off ;

# Enable/disable exceptions.
feature exception-handling : on off ;

# Enable/disable C++ runtime type information.
feature rtti : on off ;

# Set the feature to "no" in order to skip the build of this target.
# Useful to disable known non-working compilers or variants.
feature build : yes no ;

# ??.
feature stdlib : "default" gcc stlport ;

# Used to specify "default-BUILD" properties that will be used if not
# overridden by the BUILD variable.
free-feature "default" ;

# Custom flags for the various build procedures.
free-feature cflags ;
free-feature linkflags ;
free-feature cxxflags ;
free-feature arflags ;

# Preprocessor definitions.
free-feature define ; # <define>PYTHON=foo
free-feature undef ; # <undef>PYTHON=foo

# Add a user include path (#include "x.h").
path-feature "include" ; # <include>../foo/bar/mumble

# Add a system include path (#include <x.h>).
path-feature sysinclude ; # <sysinclude>/fu/man/chu

# Finding libraries needs a search path and a base library name.
path-feature library-path ;
free-feature find-library ;

# Link in an external library file.
dependency-feature library-file ;

# The version of a shared object. <dllversion>1.27.0 (for use with soname-ing)
free-feature dllversion ;

# Add a name tag to a target, see Boost.Build documentation for details.
free-feature tag ;

# ??.
free-feature version ;

# Control warnings, to turn the on, off, how many, and which ones.
# Values are toolset dependent, but the ones listed here must
# be supported...
# - "on", default has warnings enabled.
# - "off", no warnings.
# - "error", turn warnings into errors.
# For toolsets that support it specifying a number
# will limit the number of warnings produced.
free-feature warnings ;

# Control how many errors to tollerate.
free-feature errors ;

# Include file as prefix before all other includes.
free-feature prefix ;

# How to interpret relative paths in includes.
# - "relative", as GCC search relative to inclusion point.
# - "directory", relative to current directory.
# - "source", realtive to original source file.
# - "paths", only search given include and sysinclude paths.
free-feature include-search : relative directory source paths ;

# Can the target participate in a shared library?
feature shared-linkable : false true ;

# The addressing model to generate code for.
# Currently a limited set only specifying the bit size of pointers.
feature address-model : default 16 32 64 ;

# Type of CPU architecture to compile for.
feature architecture :
    # The default is the machine we are on, i.e. nothing
    native
    # x86 and compatible
    x86
    # Sparc
    sparc
    # RS/6000 & PowerPC
    power
    # MIPS/SGI
    mips1 mips2 mips3 mips4
    ;

# The specific instruction set in an architecture to compile.
feature instruction-set :
    # Default should probably always be the lowest common denominator.
    default
    # x86 and compatible
    i386 i486 i586 i686 pentium pentium-mmx pentiumpro pentium2 pentium3 pentium4
    k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp
    # Sparc
    v7 cypress v8 supersparc sparclite hypersparc sparclite86x
    f930 f934 sparclet tsc701 v9 ultrasparc
    # RS/6000 & PowerPC
    rios rios1 rsc rios2 rs64a
    601 602 603 603e 604 604e 620 630 740 750
    power power2 powerpc power64
    403 505 801 821 823 860
    power-common
    # MIPS
    r2000 r3000 r3900 r4000 r4100 r4300 r4400 r4600 r4650 r5000 r6000 r8000 orion
    ;

# The object model the compiler uses when compiling C++ code. Currently only
# relevant for Compaq C++ V6.3 and newer.
feature object-model :
    # Use the default object model which works best for boost. This most
    # probably should be 'ansi' in all cases.
    default
    # Explicitly select the 'arm' object model. Used for backward compatible
    # binaries.
    arm
    # Explicitly select the 'ansi' object model. Used to support the complete
    # standard.
    ansi
    ;

gLINK_COMPATIBLE = <shared-linkable>true <target-type> <inlining> ;

gALWAYS_RELEVANT = <target-type> <tag> <default> <build> ;

##### Requirements by target type #####
gTARGET_TYPE_REQUIREMENTS(DLL) = <shared-linkable>true ;

##### Variant definitions ####
variant common :
    <vtable-thunks>default
    <struct-alignment>auto
    <eh-model>default
    <threading>single
    <unicode-application>off
    <exception-handling>on
    <rtti>on
    <shared-linkable>false
    <address-model>default
    <architecture>native
    <instruction-set>default
    <profiling>off
    <object-model>default
    ;

variant debug : common :
    <debug-symbols>on
    <runtime-build>debug
    <optimization>off
    <inlining>off
    ;

if $(NT)    
{
    variant debug-python : debug :
      <define>BOOST_DEBUG_PYTHON
      <gcc><define>Py_DEBUG
      ;
}
else
{
    variant debug-python : debug :
      <define>BOOST_DEBUG_PYTHON
      <define>Py_DEBUG
      ;
}

variant release : common :
    <debug-symbols>off
    <runtime-build>release
    <optimization>speed
    <inlining>full
    <define>NDEBUG
    ;

# Profiling variant by Toon Knapen <toon@si-lab.com>
variant profile : release :
    <profiling>on
    <debug-symbols>on
    ;

