SCons D tool: need help with building static library

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Dec 13 14:49:33 PST 2012


Hi Russel,

I've been using your BitBucket scons_d_tooling version of SCons for my D
projects, and it's been great! However, I needed to make a static
library today and I'm having some trouble with it.  Here's a reduced
testcase:

	env = Environment(
		DC = '/usr/src/d/dmd/src/dmd'
	)
	env.StaticLibrary('mylib', Split("""
		a.d
		b.d
	"""))

Here's the output:

	scons: Reading SConscript files ...
	scons: done reading SConscript files.
	scons: Building targets ...
	/usr/src/d/dmd/src/dmd -I. -c -ofa.o a.d
	/usr/src/d/dmd/src/dmd -I. -c -ofb.o b.d
	lib -c libmylib.a a.o b.o
	sh: 1: lib: not found
	scons: *** [libmylib.a] Error 127
	scons: building terminated because of errors.

The compilation steps work fine, but when it should be running ar to
create the library archive, it runs a non-existent 'lib' instead, which
fails.

I've tracked down the problem to the presub command $SMART_ARCOM, but it
appears to be a function disguised as a magical variable, so I've no
idea how to go further.

Am I missing some setting in the Environment? How can I convince it to
use 'ar' (as it should) instead of 'lib'?

Thanks!


T

-- 
Who told you to swim in Crocodile Lake without life insurance??


More information about the Digitalmars-d mailing list