Boost logo

Boost-Build :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-08-06 07:15:16


Vladimir Prus wrote:
>
> Markus Schöpflin wrote:
>
> > Aha, I think I can work it out now. Let's see...
> >
> > rule link-oci-libs ( toolset variant : properties * )
> > {
> > switch $(toolset)
> > {
> > case gcc* :
> > {
> > return $(properties) <linkflags>"blah blah" ;
> > }
> > case msvc* :
> > {
> > return $(properties) <find-library>ociw32 ;
> > }
> > }
> > }
> >
> > exe foo : $(CPP_SOURCES).cpp : link_oci_libs ;
>
> Yea, that's probably simpler to use.
>
> > Hmm, is there any way to execute a shell command from within
> > a rule? Something like $(SHELL: make -f somefile echo_libs).
>
> Not directly. You can make a target which will receive output of make, then
> load that target in build actions, somethink like
>
> actions gcc-link {
> gcc ...... `cat file-with-options`
> }
>
> I suppose this is not what you want. Would it be OK to just run make once, to
> generate a file with list of options, and then include that file? Hmm...
> you'd need to make "make" output some variable declaration, such as
> OCI_LIBS_LINKER_FLAGS = ...... ;
> However, in this case, you won't be able to make anything depend on that file.

Ok, I think I'm going to generate a file which contains the needed defintions
for all the platforms I'm using and include that file.

I added a new free feature <linkflags2> which allows me to specify things
at the end of the linker command line.

But now it looks like I'm hitting some really strange internal jam limit.
I modified the rule above to read as follows:

case gcc* :
{
return $(properties) <linkflags2>$(OCI_LINK_FLAGS) ;
}

and the resulting command line gets truncated somewhere along the way.
The variable OCI_LINK_FLAGS contains about 5000 chars and this seems
a little too much for bjam.

If I simply say

exe foo : $(CPP_SOURCES).cpp : <linkflags2>$(OCI_LINK_FLAGS) ;

things are even worse. Bjam starts to "forget" values for
features specified in my Jamrules file. I guess I'll have to
resort to make to link my application. :-(

> - Volodya

Markus

 


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