[Scons-users] modify linker command

Kraus Philipp philipp.kraus at flashpixx.de
Wed Jun 20 01:42:54 EDT 2012



Am 19.06.2012 um 22:12 schrieb gabor papp:


>> This uses on my system the *.dylib. I check eg for boost_iostream. If I run the CheckLib

>> Scons create the g++ flag -lboost_iostream

>> The forced option is, to use dynamic linking (see g++ FAQ).

>

> you can use CheckLib with autoadd=0, and add boost to the libs manually.

> something like this should work:

> env.Append(LIBS = [File('/usr/lib/libboost_iostream.a')])

>

> or if you use autoadd you can remove the lib first like this:

> env['LIBS'].remove('boost_iostream')

> then append the static one as above.

>

> if you don't know the path for the lib, i believe you can search for

> it like this:

> path = FindFile('libboost_iostream.a', env['LIBPATH'])


If I link static, I can not use autoconf, because no function can search the static library, so I must
write my own CheckStaticLibrary / CheckStaticLibraryWithHeaders
Is there any option to add a function to the scons general branch that checks also the static libs?

Only the SConf.py (and Conftest.py) my be modified or the signature of:
def CheckLib(context, library = None, symbol = "main", header = None, language = None, autoadd = 1):

must be changed to something like
def CheckLib(context, library = None, symbol = "main", header = None, language = None, autoadd = 1, static = 0):


More information about the Scons-users mailing list