Boost logo

Boost Testing :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-11-19 12:04:48

Jim Douglas wrote:
> 1. As it stands the qcc-tools.jam file represents a 'virtual' tool and
> will produce undefined results if used on its own. Is there some way we
> can insert some default values for GXX/GCC in case this happens?

Yea you could do:

   local GXX ?= QCC ;
   local GCC ?= qcc ;
   extends-toolset gcc ;

That way it would use whatever the user has configured as the default
version and target.

> 2. I have overloaded the "gcc-C++-action" (should it be qcc-C++-action?)

No. If you did that the action would never get used as it's called by
the "gcc-C++-action" from the "C++-action" rule in gcc-tools.jam.

> because of the explicit "-W" & "-f" options that need to be prefixed. Is
> the text processing of bjam good enough to scan the command and insert a
> "-Wc," in front of every gcc "-W" & "-f" option?

a. Is it possible to use "-Wc,$(CFLAGS)", and also with CXXFLAGS, in the
action to prefix all the options?

b. If not, you can do any scanning manipulations of the options if you
override the "Cc-action" and "C++-action" rules, in which case you would
want to use "qcc-*-action" actions. For example, in qcc-tools.jam:

rule C++-action
   _ on $(<) = " " ;
   CFLAGS on $(<) = [ on $(<) return -Wc,$(CFLAGS) ] ;
   CXXFLAGS on $(<) = [ on $(<) return -Wc,$(CXXFLAGS) ] ;
   qcc-C++-action $(<) : $(>) ;

And of course you would do more complicated manipulations than just
prepending the "-Wc," as above. Like looping over the flags, using
regex, etc.

> I note that other
> libraries sometimes use additional compiler options and these should be
> prefixed also.
> 3. The "-Wno-non-virtual-dtor" option is there to suppress the blizzard
> of warnings produced by 'serialization'. Is there a way of making this
> library specific?

Already answered by Robert. But you could also add it unconditionally:

flags qcc CXXFLAGS : -Wno-non-virtual-dtor ;

> 4. The "gcc-Link-action" (qcc-?) is overloaded because I needed to add
> an explicit instruction to link against libm. For some reason QNX does
> not include libm on the default list of libraries. It is tacked onto the
> end of the command for now. What is the correct way of specifying
> additional link libraries so that we can use the rule inherited from the
> gcc tools?

Just add it to the flags unconditionally:

flags qcc FINDLIBS : m ;

> 5. Where is the "ar" rule defined. Theoretically QCC can be used to
> build archives, so I thought I might try it sometime.

It's also in the gcc-tools.jam, at the bottom as "rule Archive-action"
and "actions ... gcc-Archive-action".

> 6. Any further suggestions as to optimisation are welcome.

They seem reasonable so far. I suspect that after you move as option
into being set with the "flags" rule you'll end up not having to
override the gcc actions. But I just noticed that there is one change
that needs to get done to gcc-tools.jam to help with that, moving the
-Wall out of the actions.

> ------------------------------------------------------------------------
> # Copyright (c) 2005 Rene Rivera.

I think at this point it's safe to so say that the copyright should be
yours ;-)

-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. -
-- rrivera/ - grafik/
-- 102708583/icq - grafikrobot/aim - Grafik/

Boost-testing list run by mbergal at