Boost logo

Boost-Build :

From: Jim Douglas (jim_at_[hidden])
Date: 2006-02-17 11:00:46


Vladimir Prus wrote:
> Jim,
> a quick port of qcc toolset is attached.
>
> Can you test it? The testing instructions are available at:
>
> http://zigzag.cs.msu.su/boost.build/wiki/TestingNewToolset

I ran the 'hello' test and it built OK, but on closer inspection there
are some problems. Using "bjam -an qcc" I get:

...found 9 targets...
...updating 2 targets...
qcc.compile.c++ bin/qcc/debug/hello.o

     "QCC" -ftemplate-depth-100 -O0 -Wall -Wc,-fno-inline -Wc,-Wall
-gstabs+ -Wc,-fPIC -c -o "bin/qcc/debug/hello.o" "hello.cpp"

******************
1. The "-ftemplate-depth-100" is incorrect because it is hard coded into
the gcc action. It should be "-Wc,-ftemplate-depth-100"
2. Note the first "-Wall" which is incorrect, followed by "-Wc,-Wall"
which is correct. More hard coding perhaps?
******************

qcc.link bin/qcc/debug/hello

     "QCC" -o "bin/qcc/debug/hello" "bin/qcc/debug/hello.o"
-gstabs+ -Wc,-fPIC

*****************
1. The "-Wc,-fPIC" option should be "-Wl,-fPIC". c = compiler, l = linker
****************

I have modified qcc.jam, and it is attached. Note that the spurious
"-Wall" is still there. I cannot trace where it is coming from. The
results are now:

...updated 2 targets...
...found 9 targets...
...updating 2 targets...
qcc.compile.c++ bin/qcc/debug/hello.o

     "QCC" -Wc,-ftemplate-depth-100 -O0 -Wall -Wc,-fno-inline -Wc,-Wall
-Wc,-fPIC -gstabs+ -c -o "bin/qcc/debug/hello.o" "hello.cpp"

qcc.link bin/qcc/debug/hello

     "QCC" -o "bin/qcc/debug/hello" "bin/qcc/debug/hello.o"
-Wl,-fPIC -gstabs+

...updated 2 targets...

You will have seen that there are several qcc-*-tools.jam files in the
bbv1 directory. How do I invoke the variations that these files offer?
The current file just gives me the default options.

Thanks
Jim


# Copyright (c) 2005 Jim Douglas.
# 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)

import toolset ;
import feature ;
import toolset : flags ;

import gcc ;
import common ;
import errors ;
import generators ;

feature.extend toolset : qcc ;

toolset.inherit-generators qcc : gcc ;
generators.override qcc.prebuilt : builtin.lib-generator ;
generators.override qcc.prebuilt : builtin.prebuilt ;
generators.override qcc.searched-lib-generator : searched-lib-generator ;

toolset.inherit-rules qcc : gcc ;
toolset.inherit-flags qcc : gcc
        : <inlining>off <inlining>on <inlining>full <debug-symbols>on <link>shared ;
               
rule init ( version ? : command * : options * )
{
    local condition = [ common.check-init-parameters qcc : version $(version) ] ;
    
    command = [ common.get-invocation-command qcc : QCC : $(command) : ] ;
    
    if $(command)
    {
        local root = [ common.get-absolute-tool-path $(command[-1]) ] ;

        if $(root)
        {
            flags qcc.compile.c C_CONFIG_COMMAND : $(root)/qcc ;
        }
        else
        {
            # Just for legible output when testing.
            flags qcc.compile.c C_CONFIG_COMMAND : qcc ;
        }
    }
    command ?= QCC ;
                
    common.handle-options qcc : $(condition) : $(command) : $(options) ;
}

# For both compile and link.
flags qcc OPTIONS <debug-symbols>on : -gstabs+ ;

flags qcc.compile OPTIONS <inlining>off : -Wc,-fno-inline ;
flags qcc.compile OPTIONS <inlining>on : -Wc,-Wno-inline ;
flags qcc.compile OPTIONS <inlining>full : -Wc,-finline-functions,-Wno-inline ;
#flags qcc.compile CFLAGS : -Wc,-Wall,-Wno-non-virtual-dtor ;

flags qcc.compile OPTIONS <warnings>off : -Wc,-w ;
flags qcc.compile OPTIONS <warnings>all : -Wc,-Wall ;
flags qcc.compile OPTIONS <warnings-as-errors>on : -Wc,-Werror ;

#flags qcc OPTIONS <link>shared : -Wc,-fPIC ;

flags qcc.compile OPTIONS <link>shared : -Wc,-fPIC ;

flags qcc.link OPTIONS <link>shared : -Wl,-fPIC ;

flags qcc FINDLIBS : m ;

actions compile.c++
{
    "$(CONFIG_COMMAND)" $(LANG) -Wc,-ftemplate-depth-100 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}

actions compile.c
{
    "$(C_CONFIG_COMMAND)" $(LANG) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk