Boost logo

Boost :

From: Marcello Pietrobon (teiffel_at_[hidden])
Date: 2006-04-21 13:04:50


Hi,

just in order to make life a bit simpler I desire to write some simple
imformations about how I did compile
boost with vc80 and STLport, as this is not in the boost help yet.

The command line is:

STLport was installed in the directory
D:\Projs\Libraries\BSD\STLPort\STLport-Active
and I build it with the cross compilation option on.

I went to the boost installation directory and run:
bjam "-sTOOLS=vc-8_0-stlport" "-sSTLPORT_VERSION=5.0.2"
"-sSTLPORT_5.0.2_PATH=D:\Projs\Libraries\BSD\STLPort
\STLport-Active" "-sBUILD=debug release <runtime-link>static/dynamic
<threading>multi <native-wchar_t>on <stlport-cross>on"
"--without-python" install

The option "<native-wchar_t>on" is not necessary as in vc80 *wchar_t* is
already a built in type by default ( and stlport 5.0 assumes the same by
default when compiled with vc80 )

I also had to modify the file tools\build\v1\stlport.jam and modify the
line:
STLPORT_VERSIONS(5) ?= 5.0.2 5.0.1 5.0 ;
( by adding 5.0.2 )

And I had to create the file:
tools\build\v1\vc-8_0-stlport-tools.jam

which I created by comparing
vc-8_0-tools.jam, vc-7_1-tools.jam, and vc-7_1-stlport-tools.jam

I attached those files to this post.

Everything seems fine now,

Hope it helps,
Marcello

P.S. After switching to vc80 I decided to switch back to the previous
version, because too slow, and tired after three weeks of working around
bugs and problems with native C++ in that release...


# (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.2 5.0.1 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) ;
    }
}

extends-toolset msvc ;

flags $(gCURRENT_TOOLSET) STLPORT_LIB_BASE_NAME ;
STLPORT_LIB_BASE_NAME = stlport_vc80 ;

# bring in the STLPort configuration
SEARCH on stlport.jam = $(BOOST_BUILD_PATH) ;
include stlport.jam ;

# singleton variables...
set-as-singleton VC80_ROOT ;

if ! $(MSVCDir)
{
    if $(VS80COMNTOOLS)
    {
        VC80_ROOT ?= $(VS80COMNTOOLS:J=" ")..\\..\\VC ;
    }
    else
    {
        ProgramFiles ?= $(PROGRAMFILES) ;
        VC80_ROOT ?= $(ProgramFiles:J=" ")"\\Microsoft Visual Studio 8\\VC" ;
    }
}

if $(VC80_ROOT)
{
    VC_TOOL_PATH = "$(VC80_ROOT)"\\bin\\ ;
    VC_SETUP = "CALL \"$(VC_TOOL_PATH)vcvars32.BAT\" >nul" ;
}

VC_PDB_NAME = vc80 ;
VC_MANIFEST = "mt -manifest " ;
VC_OUTPUTRESOURCE = -outputresource: ;

# feature native-wchar_t : on off ; # commented as the default in vc80

# flags vc-8_0-stlport CFLAGS : /fp:precise ; # this is the old /Op ; /fp:precise is slower but really precise and handles NaN well. But then I should recompile STLport ? In the doubt I commented it.
# flags vc-8_0-stlport C++FLAGS : /wd4675 ; # Doesn't warn about the use of ADL
# flags vc-8_0-stlport C++FLAGS : /Zc:forScope ; # commented as the default in vc80
# flags vc-8_0-stlport C++FLAGS <native-wchar_t>on : /Zc:wchar_t ; # commented as the default in vc80

flags vc-8_0-stlport C++FLAGS : /wd4996 ; # disables _CRT_SECURE_NO_DEPRECATE warning. This is like _SCL_SECURE_NO_DEPRECATE. see tools/build/v1/vc-8_0-tools.html

# The following #// line will be used by the regression test table generation
# program as the column heading for HTML tables. Must not include version number.
#//Micro-
soft
VC++
<br>STLport


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk