tags:

views:

129

answers:

1

Hi,

I'm working on a C++ project using LLVM and I'd like to replace the LLVM build system (which uses autoconf and make) with scons. Unfortunately I've now run into a major problem. I want my project to compile on Linux as well as Windows. To compile on Windows I use mingw/msys which works perfectly with the autoconf/make system in place.

However scons modifies my library path and prefixes it with the drive letter, i.e. when I specify /usr/local/lib the actual parameter passed to the linker is -LD:\usr\local\lib which obviously doesn't contain my required libraries. I'm setting the library path in the following way:

env = Environment(LIBPATH = ['/usr/local/lib', 'build/lib/sample'])

Also env['LIBPATH'] still contains the correct path.

Is there any way to prevent scons from messing with that path?

thanks

A: 

I figured it out:

env = Environment(LIBPATH = ['/usr/local/lib'], platform = 'posix')

forces scons to initialize the environment for the posix platform which doesn't mess with the paths. Unfortunately it then fails to to find gcc. But this can be easily fixed by explicitly propagating the external environment

env = Environment(LIBPATH = ['/usr/local/lib'], platform = 'posix', ENV = os.environ)
jokkmokk
maybe I spoke too soon. While it seems to work scons is now printing the os.environ dictionary all over the place which is unacceptable. Only propagating the PATH doesn't work, i.e. gcc is not found. Furthermore although CheckLib does succeed config.log still shows that the linker is called with the drive letter prefix...wtf? This is driving me nuts...maybe I should stay with autoconf and make *sigh*
jokkmokk