scons

SCons to make a shared library (.so) with a static libarary (.a)

I'm trying to get SCons to make a shared library. One of the items going into the .so is a .a static lib. I have a line like: env_2.SharedLibrary('libstuff.so', Split("""stuff.cxx mylib/libMine.a""") And upon running get an error: scons: * Source file: mylib/libMine.a is static and is not compatible with shared target: libstuff.so How...

SCons - convert all images in a directory

Hi, I'd like to write an SConstruct file that will convert (e.g.) all the JPEG files in a directory into PNGs. I think I have the Builder alright: ConvToPNG = Builder(action = 'convert $SOURCE $TARGET', suffix = '.png', src_suffix = '.jpg') env['BUILDERS']['ConvToPNG'] = ConvToPNG But then I'm not sure how to make a l...

scons setting CXXFLAGS in one module affects another one

in dirA/SConscript I have: Import('env') probeenv = env.Clone() probeenv['CXXFLAGS'] += ['-fno-rtti','-Wnon-virtual-dtor'] ... stuff that uses probeenv in dirB/SConscript I have Import('env') sipenv = env.Clone() ... stuff that uses sipenv Now, c++ files in dirB that gets compiled, gets the CXXFLAGS from dirA - how come ? This doe...

Anyone use libtool as backend for scons?

I'm interested in examples. ...

Are there ruby gems out there with SCons type features?

For kicks, I'm setting up the build process of my C++ program using rake. I'd rather not reinvent the wheel, however. Are there any ruby gems that have build features similar to the cool ones in SCons (e.g., C++ dependency detection, md5 difference detection, cross-platform pathing, multi-threading, etc.)? ...

Controlling distutils from Scons

I have a C++ library that I build using Scons which is eventually linked into (among other things) a Python extension. Once I have built the library with scons, I have written a standard setup.py script which I call to build and install the extension. My main problem is that setup.py does not recognize when the library has been rebuilt...

scons: non-dependency actions ("phantom targets" ?)

I'm not quite sure how to do this... I want to declare some kind of action in an SConscript file: Import('env'); arguments = ['foo','bar','baz']; phantomTarget = env.DoSomething(arguments); Return('phantomTarget'); and in the SConstruct file: env['BUILDERS']['DoSomething'] = Builder(action='c:/foodir/foo.exe $ARGUMENTS'); ... p...

scons LIBPATH on windows with msys

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 plac...

SCons: Copy external libraries to build output directory

We're using SCons + swtoolkit for our build system on Mac, Linux, and Windows. We have a svn repository that contains all of our external library dependencies, the path to which is located in the environment variable EXTERNAL_SDKS. In each of our target SConscripts, I'd like to find a method that will look up what libraries located u...

scons LIBPATH generates additional library paths

I'm building a C project using scons, some internal static libraries are build and the exe files are linked to it. However, setting: env['LIBPATH'] = ['#build/libs'] generates a -Llibs and a -Lbuild/libs argument to gcc: gcc -o edecode main.o pack16.o pack16le.o pack32.o pack32le.o pack64.o -Lbuild/libs -Llibs -lutillib Why's that ...

How do I set scons system include path

Using scons I can easily set my include paths: env.Append( CPPPATH=['foo'] ) This passes the flag -Ifoo to gcc However I'm trying to compile with a lot of warnings enabled. In particular with env.Append( CPPFLAGS=['-Werror', '-Wall', '-Wextra'] ) which dies horribly on certain boost includes ... I can fix this by adding the b...

Find out target platform of build?

How do I find out what platform SCons is building for (Linux, Mac OS X, Windows, &c-- not concerned with architecture). ...

SCons: How to use the same builders for multiple variants (release/debug) of a program

The SCons User Guide tells about the usage of Multiple Construction Environments to build build multiple versions of a single program and gives the following example: opt = Environment(CCFLAGS = '-O2') dbg = Environment(CCFLAGS = '-g') o = opt.Object('foo-opt', 'foo.c') opt.Program(o) d = dbg.Object('foo-dbg', 'foo.c') dbg.Program(d) ...

SCons does not clean all files

I have a file system containing directories of "builds", each of which contains a file called "build-info.xml". However some of the builds happened before the build script generated "build-info.xml" so in that case I have a somewhat non-trivial SCons SConstruct that is used to generate a skeleton build-info.xml so that it can be used as ...

Building external code trees with SCons

Hello, I'm trying to use SCons for building a piece of software that depends on a library that is available in sources that are installed in system. For example in /usr/share/somewhere/src. *.cpp in that directory should be built into static library and linked with my own code. Library sources have no SConscript among them. Since libra...

Using SCons as a build engine for distutils

I have a python package with some C code needed to build an extension (with some non-trivial building needs). I have used SCons as my build system because it's really good and flexible. I'm looking for a way to compile my python extensions with SCons ready to be distributed with distutils. I want that the user simply types setup.py inst...

How to generate a specific CPPDEFINE such as -DOEM="FOO BAR" using Scons

My intention is to end up with a compiler command line including -DOEM="FOO BAR" I have the following in my SConstruct file: opts = Options( 'overrides.py', ARGUMENTS ) opts.Add( 'OEM_NAME', 'Any string can be used here', 'UNDEFINED' ) . . . if (env.Dictionary('OEM_NAME') != 'UNDEFINED'): OEM_DEFINE = 'OEM=' + str(env.Dictionary(...

Changing default compiler in Linux, using SCons

On my Linux platform, I have several versions of gcc. Under usr/bin I have: gcc34 gcc44 gcc Here are some outputs: $ gcc --version gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48) $ gcc44 --version gcc44 (GCC) 4.4.0 20090514 (Red Hat 4.4.0-6) I need to use the 4.4 version of gcc however the default seems to the 4.1 one. I there a wa...

Why does output of fltk-config truncate arguments to gcc?

I'm trying to build an application I've downloaded which uses the SCONS "make replacement" and the Fast Light Tool Kit Gui. The SConstruct code to detect the presence of fltk is: guienv = Environment(CPPFLAGS = '') guiconf = Configure(guienv) if not guiconf.CheckLibWithHeader('lo', 'lo/lo.h','c'): print 'Did not find liblo for OSC...

netbeans + scons

I need to call an external build system from netbeans. In this particular case it is Scons, but let's say I just need to execute a shell script to compile and later specify the executable. How do I do this with netbeans? ...