Boost logo

Boost :

From: Dan Gohman (gohmandj_at_[hidden])
Date: 2001-12-14 13:06:40


Ok, I've fixed a lot of the problems with the mipspro-tools.jam
file I posted before. I've included the new version below.

I'm trying to figure out a good way to handle different types of
builds, where builds can be either 32-bit or 64-bit, and either
with mips3 or mips4 as the instruction set (these are orthogonal
to each other). They need different command-line flags as well as
different library paths (see the lines with FIXME by them below).
Would these be appropriate for entries in features.jam?
I'm thinking of something like this:

feature sgi-abi : n32 64 ;
feature sgi-isa : mips3 mips4 ;

Also, I quoted a bunch of things that weren't quoted in
gcc-tools.jam, such as the variables in the rules, CFLAGS,
MIPSPRO_BIN_DIRECTORY, and others.

Dan

Here's the updated mipspro-tools.jam (not attatched because of yahoo groups):

# This file was originally based on gcc-tools.jam by David Abrahams.

# compute directories for invoking MIPSPRO
MIPSPRO_ROOT_DIRECTORY ?= "/usr" ;
MIPSPRO_BIN_DIRECTORY ?= "$(MIPSPRO_ROOT_DIRECTORY)/bin" ;

MIPSPRO_INCLUDE_DIRECTORY ?= "$(MIPSPRO_ROOT_DIRECTORY)/include" ;
MIPSPRO_C++INCLUDE_DIRECTORY ?= "$(MIPSPRO_INCLUDE_DIRECTORY)/CC" ;

# FIXME: this hardcodes N32 with mips3
MIPSPRO_STDLIB_DIRECTORY ?= "$(MIPSPRO_ROOT_DIRECTORY)/lib32/mips3" "$(MIPSPRO_ROOT_DIRECTORY)/lib32" ;

flags mipspro LINKFLAGS : -nostdlib -LANG:std ;
flags mipspro LINKFLAGS <target-type>DLL : -shared ;
flags mipspro LINKFLAGS <runtime-link>static : -non_shared ;
flags mipspro LINKFLAGS <debug-symbols>on : -g ;

# FIXME: this hardcodes N32 with mips3
flags mipspro CFLAGS : -n32 -mips3 -nostdinc -c -LANG:std -OPT:Olimit=0 -OPT:IEEE_NaN_inf=ON ;

flags mipspro CFLAGS <debug-symbols>on : -g ;

flags mipspro CFLAGS <optimization>off : -O0 ;
flags mipspro CFLAGS <optimization>speed : -O3 ;
flags mipspro CFLAGS <optimization>space : -O2 ;

flags mipspro CFLAGS <inlining>off : -INLINE:none ;
flags mipspro CFLAGS <inlining>full : -INLINE:all ;

flags mipspro C++FLAGS <exception-handling>off : -LANG:exceptions=OFF ;

flags mipspro STDHDRS : "$(MIPSPRO_INCLUDE_DIRECTORY)" ;
flags mipspro STDC++HDRS : "$(MIPSPRO_C++INCLUDE_DIRECTORY)" "$(BOOST_ROOT)/boost/compatibility/cpp_c_headers" ;
flags mipspro STDLIBPATH : "$(MIPSPRO_STDLIB_DIRECTORY)" ;

flags mipspro HDRS <include> ;
flags mipspro UNDEFS <undef> ;
flags mipspro DEFINES <define> ;
flags mipspro CFLAGS <cflags> ;
flags mipspro C++FLAGS <cxxflags> ;
flags mipspro LIBPATH <library-path> ;
flags mipspro NEEDLIBS <library-file> ;
flags mipspro FINDLIBS <find-library> ;

#### Link (for C++) ####

rule Link-action
{
    mipspro-Link-action "$(<)" : "$(>)" ;
}

# for mipspro, we repeat all libraries so that dependencies are always resolved
actions mipspro-Link-action bind NEEDLIBS
{
    "$(MIPSPRO_BIN_DIRECTORY)/CC" "$(LINKFLAGS)" -o "$(<[1])" "-L$(LIBPATH)" "-L$(STDLIBPATH)" "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" "-l$(FINDLIBS)"
}

#### Cc #####

rule Cc-action
{
    mipspro-Cc-action "$(<)" : "$(>)" ;
}

actions mipspro-Cc-action
{
    "$(MIPSPRO_BIN_DIRECTORY)/cc" "-U$(UNDEFS)" "-D$(DEFINES)" "$(CFLAGS)" "-I$(HDRS)" "-I$(STDHDRS)" -o "$(<)" "$(>)"
}

#### C++ ####

rule C++-action
{
    mipspro-C++-action "$(<)" : "$(>)" ;
}

actions mipspro-C++-action
{
    "$(MIPSPRO_BIN_DIRECTORY)/CC" "-U$(UNDEFS)" "-D$(DEFINES)" "$(CFLAGS)" "$(C++FLAGS)" "-I$(HDRS)" "-I$(STDC++HDRS)" "-I$(STDHDRS)" -o "$(<)" "$(>)"
}

#### Archive ####

rule Archive-action
{
    mipspro-Archive-action "$(<)" : "$(>)" ;
}

actions updated together piecemeal mipspro-Archive-action
{
    "$(MIPSPRO_BIN_DIRECTORY)/ar" ru "$(<:T)" "$(>:T)"
}

-- 
Dan Gohman
gohmandj_at_[hidden]

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