[Scons-users] Overriding Object to force global dependency

Kyle J Strand Kyle.Strand at beckman.com
Thu Jul 5 17:05:48 EDT 2012


I don't know what's going on, exactly, but it seems a bit strange to me
that FileVersion.os has the .os extension while libSystemUtilitiesJNI.so
has the .so extension. I don't know exactly what the difference is.

-----------------------------------------------------------------------
Kyle Strand, Software Intern
Beckman Coulter, Inc., Life Sciences Division
4862 Innovation Drive, Fort Collins, Colorado, 80525
(970) 204-7036

scons-users-bounces at scons.org wrote on 07/05/2012 02:41:36 PM:


> Greg Ward <greg at gerg.ca>

> Sent by: scons-users-bounces at scons.org

>

> 07/05/2012 02:41 PM

>

> Please respond to

> SCons users mailing list <scons-users at scons.org>

>

> To

>

> SCons users mailing list <scons-users at scons.org>

>

> cc

>

> Subject

>

> Re: [Scons-users] Overriding Object to force global dependency

>

> On 05 July 2012, Greg Ward said:

> > On 29 June 2012, Pawel Tomulik said:

> > > It may be possible to use emitter for your purpose, I think.

> > > Dee API docs for SCons.Builder.BuilderBase, especially add_emitter()

> > > method. Try something like:

> > >

> > > def my_emitter(target, source, env):

> > > env.Depends(target, 'foo.txt')

> > > return target, source

> > >

> > > env = Environment()

> > >

> > > env['BUILDERS']['StaticObject'].add_emitter('.c', my_emitter)

> > > ob = env.Object('a.c')

> >

> > Awesome! That worked perfectly right out of the gate.

>

> Argghh. I spoke too soon. When I use this emitter *just* with

> StaticObject, it's fine. But I want it on SharedObject as well as

> StaticObject. So I did this:

>

> def lbe_emitter(target, source, env):

> env.Depends(target, '#dummy-lbe')

> return (target, source)

>

> env['BUILDERS']['StaticObject'].add_emitter('.cpp', lbe_emitter)

> env['BUILDERS']['SharedObject'].add_emitter('.cpp', lbe_emitter)

>

> ("lbe" = "local build environment", which is where our local copies of

> GCC, Boost, etc. live.)

>

> But when I do that, SCons thinks all of my shared object files (.os)

> are static:

>

> scons: building `buildout/lib/libSystemUtilitiesJNI.so' because it

> doesn't exist

> scons: *** [buildout/lib/libSystemUtilitiesJNI.so] Source file:

> Tools/Java/com/intelerad/tools/lib/FileVersion.os is static and is

> not compatible with shared target: buildout/lib/libSystemUtilitiesJNI.so

>

> But that's not true. FileVersion.os was built with a call to

> env.SharedObject. The command that built it was

>

> buildout/lbe/bin/g++ -o Tools/Java/com/intelerad/tools/lib/

> FileVersion.os -c -g -O2 -Wall -m32 -fPIC [...] Tools/Java/com/

> intelerad/tools/lib/FileVersion.cpp

>

> and the filename is ".os", which I thought was SCons' way of saying

> it's a shared object.

>

> I get the same problem if I leave the StaticObject builder alone,

> i.e. if I just have

>

> env['BUILDERS']['SharedObject'].add_emitter('.cpp', lbe_emitter)

>

> Any clue what's going on here?

>

> Greg

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users


The server made the following annotations

---------------------------------------------------------------------------------

This message contains information that may be privileged or confidential and is the property of Beckman Coulter, Inc. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

---------------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20120705/163ab882/attachment.htm>


More information about the Scons-users mailing list