Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

tools/build/v1/stlport.jam

# (C) Copyright Gennadiy Rozental 2002. Permission to copy, use,
# modify, sell and distribute this software is granted provided this
# copyright notice appears in all copies. This software is provided
# "as is" without express or implied warranty, and with no claim as
# to its suitability for any purpose.

# Use this toolset to add STLport flavor for any base toolset
# define STLPORT_LIB_BASE_NAME to the shared between debug and release 
# versions prefix for stlport library name for example stlport_sunpro
# Define STLPORT_AUTOLINK to use the autolink facilities of the new
# STLport-5.0

# STLport iostreams or native iostreams
feature stlport-iostream : on off ;

# STLport extensions
feature stlport-extensions : on off ;

# STLport anachronisms
feature stlport-anachronisms : on off ;

# STLport debug allocation
feature stlport-debug-alloc : off on ;

# ?
feature stlport-cstd-namespace : std global ;

# STLport-5 libraries are located in cross-compilation individual subdirectories.
feature stlport-cross : off on ;

CURR_TOOLSET = $(gCURRENT_TOOLSET) ;

# STLport versions
STLPORT_VERSIONS(default) ?= 4.6.2 ;
STLPORT_VERSIONS(4) ?= 4.6.2 4.6 4.5.3 4.5 ;
STLPORT_VERSIONS(5) ?= 5.0 ;
STLPORT_VERSION ?= $(STLPORT_VERSION(default)) ;
STLPORT_VERSIONS ?= $(STLPORT_VERSIONS(4)) $(STLPORT_VERSIONS(5)) ;
feature stlport-version : [ unique $(STLPORT_VERSION) $(STLPORT_VERSIONS) ] ;
flags $(CURR_TOOLSET) STLPORT_VERSION_RELEVANT_FEATURE <stlport-version> ;

# singleton variables...
set-as-singleton STLPORT_INCLUDE_DIRECTORY STLPORT_LIB_DIRECTORY STLPORT_PATH STLPORT_ROOT ;

#############################################################################

# Returns a path which is assumed to be the root of the STLport installation.
#
# The result depends on the current version X.Y of STLport.
# 1. If global STLPORT_<X.Y>_PATH is set, return it.
# 2. If global STLPORT_PATH is set, return $(STLPORT_PATH)/STLport-<X.Y>
#
rule get-stlport-root
{
    local version = [ get-values <stlport-version> : $(gBUILD_PROPERTIES) ] ;
    version ?= $(STLPORT_VERSION) ;

    local path ;
    path ?= $(STLPORT_$(version)_PATH) ;
    path ?= $(STLPORT_PATH)$(SLASH)STLport-$(version) ;
    path ?= $(STLPORT_ROOT) ; #<< For backward compatability.
    
    if $(version) && ! $(path)
    {
        local dollar = "$" ;
        ECHO **** No STLPORT_PATH configured. *** ;
        ECHO To configure STLport for use with the $(CURR_TOOLSET) toolset, the following variables can be set: ;
        ECHO ;
        ECHO STLPORT_PATH - A directory containing at least one subdirectory of the form /STLport-<version> ;
        ECHO "        where STLport installations can be found." ;
        ECHO ;
        ECHO STLPORT_<version>_PATH - The directory where the specific STLport <version> installation can be ;
        ECHO "        found, in case there is no central location appropriate for STLPORT_PATH, above, or a" ;
        ECHO  "        particular version's installation is not located in the usual place." ;
        ECHO ;
        ECHO STLPORT_VERSION - The version of STLport in use by default. Defaults to \"$(STLPORT_VERSIONS(default))\". Other ;
        ECHO "       values can be selected in parallel setting the build property <stlport-version> to" ;
        ECHO "       values from the list of $(dollar)(STLPORT_VERSIONS)" ;
        ECHO ;
        ECHO STLPORT_VERSIONS - Alternate versions of STLport available on this machine. Defaults to $(STLPORT_VERSIONS:J=" ") . ;
        ECHO ;
        ECHO "Note that STLport iostreams are /not/ in use by default. To enable them, you must place" ;
        ECHO "        <stlport-iostream>on in your BUILD variable or in target requirements." ;
        EXIT ;
    }

    return $(path) ;
}

#############################################################################

STLPORT_INCLUDE_DIRECTORY ?= stlport ;
STLPORT_LIB_DIRECTORY ?= lib ;
STLPORT_BIN_DIRECTORY ?= bin ;
STLPORT_LIB_DEBUG_SUFFIX ?= _stldebug ;

# Clear out the STD paths so that the real toolset doesn't include
# anything but the STLport as the STD. But also set the STDLIBPATH to
# include the compiler libs afterwards as STLport still relies on the
# rest of the runtime.
local .stdlibpath = $(STDLIBPATH) ;
STDHDRS = ;
STDLIBPATH = ;

### Common options.

flags $(CURR_TOOLSET) STDHDRS : [ join [ get-stlport-root ] $(SLASH)$(STLPORT_INCLUDE_DIRECTORY) ] ;
flags $(CURR_TOOLSET) DEFINES <stlport-extensions>off : _STLP_NO_EXTENSIONS=1 ;
flags $(CURR_TOOLSET) DEFINES <stlport-anachronisms>off : _STLP_NO_ANACHRONISMS=1 ;
flags $(CURR_TOOLSET) DEFINES <stlport-cstd-namespace>global : _STLP_VENDOR_GLOBAL_CSTD=1 ;
flags $(CURR_TOOLSET) DEFINES <exception-handling>off : _STLP_NO_EXCEPTIONS=1 ;
flags $(CURR_TOOLSET) DEFINES <stlport-debug-alloc>on : _STLP_DEBUG_ALLOC=1 ;
flags $(CURR_TOOLSET) DEFINES <runtime-build>debug : _STLP_DEBUG=1 _STLP_DEBUG_UNINITIALIZED=1 ;
flags $(CURR_TOOLSET) DEFINES <runtime-link>dynamic : _STLP_USE_DYNAMIC_LIB=1 ;

### STLport 4.x

flags $(CURR_TOOLSET) DEFINES
    <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>off :
    _STLP_NO_OWN_IOSTREAMS=1 _STLP_HAS_NO_NEW_IOSTREAMS=1 ;
flags $(CURR_TOOLSET) STDLIBPATH
    <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>on :
    [ join [ get-stlport-root ] $(SLASH)$(STLPORT_LIB_DIRECTORY) ]
    $(.stdlibpath) ;
flags $(CURR_TOOLSET) FINDLIBS
    <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>on/<runtime-build>debug/<runtime-link>static :
    $(STLPORT_LIB_BASE_NAME)$(STLPORT_LIB_DEBUG_SUFFIX)$(STLPORT_LIB_STATIC_SUFFIX) ;
flags $(CURR_TOOLSET) FINDLIBS
    <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>on/<runtime-build>debug/<runtime-link>dynamic :
    $(STLPORT_LIB_BASE_NAME)$(STLPORT_LIB_DEBUG_SUFFIX) ;
flags $(CURR_TOOLSET) FINDLIBS
    <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>on/<runtime-build>release/<runtime-link>static :
    $(STLPORT_LIB_BASE_NAME)$(STLPORT_LIB_STATIC_SUFFIX) ;
flags $(CURR_TOOLSET) FINDLIBS
    <stlport-version>$(STLPORT_VERSIONS(4))/<stlport-iostream>on/<runtime-build>release/<runtime-link>dynamic :
    $(STLPORT_LIB_BASE_NAME) ;

### STLport 5.x

switch $(CURR_TOOLSET)
{
    case msvc* : STLPORT_AUTOLINK = TRUE ;
    case vc* : STLPORT_AUTOLINK = TRUE ;
}

switch $(CURR_TOOLSET)
{
    case intel-win32* : STLPORT_CROSS_DIR ?= icl ;
    case iw* : STLPORT_CROSS_DIR ?= icl ;
    case msvc* : STLPORT_CROSS_DIR ?= vc6 ;
    case vc-6* : STLPORT_CROSS_DIR ?= vc6 ;
    case vc-7-* : STLPORT_CROSS_DIR ?= vc70 ;
    case vc-7_0* : STLPORT_CROSS_DIR ?= vc70 ;
    case vc-7_1* : STLPORT_CROSS_DIR ?= vc71 ;
    case vc-8* : STLPORT_CROSS_DIR ?= vc8 ;
}

switch $(CURR_TOOLSET)
{
    # GCC compilers have 'g' to indicate debug.
    case gcc* : STLPORT_DEBUG_SUFFIX ?= g ;
    case mingw* : STLPORT_DEBUG_SUFFIX ?= g ;
    case darwin* : STLPORT_DEBUG_SUFFIX ?= g ;
    # The others use 'd'.
    case * : STLPORT_DEBUG_SUFFIX ?= d ;
}

# STLport-5 doesn't directly support single-threaded builds. There is an open
# question if single-threaded application code can be combined with the
# multi-threaded STLport-5. Until that's answered this is commented out and
# boost-base.jam requires all builds to be multi-threaded.
#~ flags $(CURR_TOOLSET) DEFINES
    #~ <stlport-version>$(STLPORT_VERSIONS(5)) :
    #~ _STLP_THREADS=1 ;

flags $(CURR_TOOLSET) STDLIBPATH
    <stlport-version>$(STLPORT_VERSIONS(5))/<stlport-cross>off :
    [ join [ get-stlport-root ] $(SLASH)$(STLPORT_LIB_DIRECTORY) ]
    [ join [ get-stlport-root ] $(SLASH)$(STLPORT_BIN_DIRECTORY) ]
    $(.stdlibpath) ;
flags $(CURR_TOOLSET) STDLIBPATH
    <stlport-version>$(STLPORT_VERSIONS(5))/<stlport-cross>on :
    [ join [ get-stlport-root ] $(SLASH)$(STLPORT_LIB_DIRECTORY) $(SLASH)$(STLPORT_CROSS_DIR) ]
    [ join [ get-stlport-root ] $(SLASH)$(STLPORT_BIN_DIRECTORY) $(SLASH)$(STLPORT_CROSS_DIR) ]
    $(.stdlibpath) ;

if ! $(STLPORT_AUTOLINK)
{
    STLPORT_LIB_STATIC_SUFFIX ?= "" ;
    for local v in $(STLPORT_VERSIONS(5))
    {
        flags $(CURR_TOOLSET) FINDLIBS
            <stlport-version>$(v)/<runtime-build>debug/<runtime-link>static :
            stlportstl$(STLPORT_DEBUG_SUFFIX)$(STLPORT_LIB_STATIC_SUFFIX).$(v) ;
        flags $(CURR_TOOLSET) FINDLIBS
            <stlport-version>$(v)/<runtime-build>debug/<runtime-link>dynamic :
            stlportstl$(STLPORT_DEBUG_SUFFIX).$(v) ;
        flags $(CURR_TOOLSET) FINDLIBS
            <stlport-version>$(v)/<runtime-build>release/<runtime-link>static :
            stlport$(STLPORT_LIB_STATIC_SUFFIX).$(v) ;
        flags $(CURR_TOOLSET) FINDLIBS
            <stlport-version>$(v)/<runtime-build>release/<runtime-link>dynamic :
            stlport.$(v) ;
    }
}