SCons: rearrange output directory to target/modules

This commit is contained in:
Fischlurch 2011-01-29 02:06:21 +01:00
parent 764a38abe6
commit 35953b335b
12 changed files with 38 additions and 39 deletions

2
.gitignore vendored
View file

@ -10,7 +10,7 @@
optcache
Makefile.in
build/*
bin/*
target/*
autom4te.cache/*
scripts/*
configure

View file

@ -26,9 +26,9 @@
OPTIONSCACHEFILE = 'optcache'
CUSTOPTIONSFILE = 'custom-options'
SRCDIR = 'src'
BINDIR = 'bin'
LIBDIR = '.libs'
PLUGDIR = '.libs'
TARDIR = 'target'
LIBDIR = 'modules'
PLUGDIR = 'modules'
TESTDIR = 'tests'
ICONDIR = 'icons'
VERSION = '0.1+pre.01'
@ -76,7 +76,7 @@ def setupBasicEnvironment():
env.Append ( SHCCCOM=' -std=gnu99') # workaround for a bug: CCCOM currently doesn't honour CFLAGS, only CCFLAGS
env.Replace( VERSION=VERSION
, SRCDIR=SRCDIR
, BINDIR=BINDIR
, TARDIR=TARDIR
, LIBDIR=LIBDIR
, PLUGDIR=PLUGDIR
, ICONDIR=ICONDIR
@ -96,8 +96,8 @@ def setupBasicEnvironment():
appendVal(env,'DEBUG', 'CCFLAGS', val=' -ggdb')
# setup search path for Lumiera plugins
appendCppDefine(env,'PKGLIBDIR','LUMIERA_PLUGIN_PATH=\\"$PKGLIBDIR/:./.libs\\"'
,'LUMIERA_PLUGIN_PATH=\\"$DESTDIR/lib/lumiera/:./.libs\\"')
appendCppDefine(env,'PKGLIBDIR','LUMIERA_PLUGIN_PATH=\\"$PKGLIBDIR/:./modules\\"'
,'LUMIERA_PLUGIN_PATH=\\"$DESTDIR/lib/lumiera/:./modules\\"')
appendCppDefine(env,'PKGDATADIR','LUMIERA_CONFIG_PATH=\\"$PKGLIBDIR/:.\\"'
,'LUMIERA_CONFIG_PATH=\\"$DESTDIR/share/lumiera/:.\\"')
@ -344,7 +344,7 @@ def defineBuildTargets(env, artifacts):
core = lLib+lApp+lBack+lProc
artifacts['lumiera'] = env.LumieraExe('$BINDIR/lumiera', ['$SRCDIR/lumiera/main.cpp'], LIBS=core)
artifacts['lumiera'] = env.LumieraExe('$TARDIR/lumiera', ['$SRCDIR/lumiera/main.cpp'], LIBS=core)
artifacts['corelib'] = lLib+lApp
artifacts['support'] = lLib
@ -368,7 +368,7 @@ def defineBuildTargets(env, artifacts):
objgui = srcSubtree(envGtk,'$SRCDIR/gui')
guimodule = envGtk.LoadableModule('$LIBDIR/gtk_gui', objgui, SHLIBPREFIX='', SHLIBSUFFIX='.lum')
artifacts['gui'] = ( guimodule
+ env.Install('$BINDIR', env.Glob('$SRCDIR/gui/*.rc'))
+ env.Install('$TARDIR', env.Glob('$SRCDIR/gui/*.rc'))
+ artifacts['icons']
)

View file

@ -203,11 +203,11 @@ def RegisterIcon_Builder(env):
"""
import render_icon as renderer # load Joel's python script for invoking the rsvg-convert (SVG render)
renderer.rsvgPath = env.subst("$BINDIR/rsvg-convert")
renderer.rsvgPath = env.subst("$TARDIR/rsvg-convert")
def invokeRenderer(target, source, env):
source = str(source[0])
targetdir = env.subst("$BINDIR")
targetdir = env.subst("$TARDIR")
renderer.main([source,targetdir])
return 0
@ -216,12 +216,12 @@ def RegisterIcon_Builder(env):
source = str(source[0])
targetdir = os.path.basename(str(target[0]))
targetfiles = renderer.getTargetNames(source) # parse SVG
return (["$BINDIR/%s" % name for name in targetfiles], source)
return (["$TARDIR/%s" % name for name in targetfiles], source)
def IconCopy(env, source):
"""Copy icon to corresponding icon dir. """
subdir = getDirname(source)
return env.Install("$BINDIR/%s" % subdir, source)
return env.Install("$TARDIR/%s" % subdir, source)
buildIcon = env.Builder( action = Action(invokeRenderer, "rendering Icon: $SOURCE --> $TARGETS")

View file

@ -83,12 +83,12 @@ class LumieraEnvironment(Environment):
def LumieraLibrary (self, *args,**kw):
""" add some tweaks missing in SCons 1.0
like proper handling for SONAME
""" augments the built-in SharedLibrary() builder to add
some tweaks missing in SCons 1.0, like setting a SONAME proper
instead of just passing the relative pathname to the linker
"""
print "hurgha"
if 'soname' in kw:
soname = self.subst(kw['soname'])
soname = self.subst(kw['soname']) # explicitely defined by user
else:
if len(args) > 0:
pathname = args[0]
@ -96,30 +96,28 @@ class LumieraEnvironment(Environment):
pathname = kw['target']
else:
raise SyntaxError("Library builder requires target spec. Arguments: %s %s" % (args,kw))
print "SharedLib: path=%s" % pathname
(dirprefix, libname) = path.split(pathname)
if not libname:
raise ValueError("Library name missing. Only got a directory: "+pathname)
libname = "${SHLIBPREFIX}%s$SHLIBSUFFIX" % libname
print "name = "+libname
soname = self.subst(libname)
print "konstruierter name "+soname
soname = self.subst(libname) # else: use the library filename as DT_SONAME
assert soname
subEnv = self.Clone()
subEnv.Append(LINKFLAGS = "-Wl,-soname="+soname )
libBuilder = self.get_builder('SharedLibrary')
print "libBuilder=%s" % libBuilder
print "args = %s, kw = %s" % (args,kw)
return libBuilder(subEnv, *args,**kw);
return libBuilder(subEnv, *args,**kw); # invoke the predefined builder on the augmented environment
def LumieraExe (self, *args,**kw):
""" add handling for rpath with $ORIGIN
""" augments the built-in Program() builder to add a fixed rpath based on $ORIGIN
That is: after searching LD_LIBRARY_PATH, but before the standard linker search,
the directory relative to the position of the executable ($ORIGIN) is searched.
This search path is active not only for the executable, but for all libraries
it is linked with
"""
print "progrom"
subEnv = self.Clone()
subEnv.Append( LINKFLAGS = "-Wl,-rpath=\\$$ORIGIN/$LIBDIR,--enable-new-dtags" )

View file

@ -1 +0,0 @@
../.libs

View file

@ -1 +0,0 @@
Lumiera executable(s) and libraries will be built here

1
modules Symbolic link
View file

@ -0,0 +1 @@
target/modules

View file

@ -15,7 +15,7 @@
namespace lumiera {
const char * const GUI_MODULE_NAME = ".libs/gtk_gui.lum";
const char * const GUI_MODULE_NAME = "modules/gtk_gui.lum";
typedef void (*VoidFunc)(void);

View file

@ -12,12 +12,12 @@ envSvg.mergeConf(['librsvg-2.0'])
envSvg.Append(LIBS=support_lib)
luidgen = env.LumieraExe('#$BINDIR/luidgen', 'luidgen.c', LIBS=support_lib) ## for generating Lumiera-UIDs
rsvg = envSvg.LumieraExe('#$BINDIR/rsvg-convert','rsvg-convert.c') ## for rendering SVG icons (uses librsvg)
luidgen = env.LumieraExe('#$TARDIR/luidgen', 'luidgen.c', LIBS=support_lib) ## for generating Lumiera-UIDs
rsvg = envSvg.LumieraExe('#$TARDIR/rsvg-convert','rsvg-convert.c') ## for rendering SVG icons (uses librsvg)
# build additional test and administrative tools....
artifacts['tools'] = [ env.LumieraExe('#$BINDIR/hello-world','hello.c') #### hello world (checks C build)
+ env.LumieraExe('#$BINDIR/try', 'try.cpp') #### to try out some feature...
artifacts['tools'] = [ env.LumieraExe('#$TARDIR/hello-world','hello.c') #### hello world (checks C build)
+ env.LumieraExe('#$TARDIR/try', 'try.cpp') #### to try out some feature...
# + luidgen
+ rsvg
]

1
target/DIR_INFO Normal file
View file

@ -0,0 +1 @@
Lumiera program package tree, holding executable(s) and libraries to be built

1
target/modules/DIR_INFO Normal file
View file

@ -0,0 +1 @@
Lumiera subsystems and other dynamically loadable application components

View file

@ -35,7 +35,7 @@ def testExecutable(env,tree, exeName=None, obj=None):
obj = srcSubtree(env,tree, isShared=False) # use all sourcefiles found in subtree
if not exeName:
exeName = 'test-%s' % tree
return env.LumieraExe('#$BINDIR/'+exeName, obj + core)
return env.LumieraExe('#$TARDIR/'+exeName, obj + core)
def testCollection(env,dir):
@ -44,7 +44,7 @@ def testCollection(env,dir):
"""
srcpatt = ['test-*.c']
exeName = lambda p: path.basename(path.splitext(p)[0])
buildIt = lambda p: env.LumieraExe("#$BINDIR/"+exeName(p), [p] + core)
buildIt = lambda p: env.LumieraExe("#$TARDIR/"+exeName(p), [p] + core)
return [buildIt(f) for f in scanSubtree(dir,srcpatt)]
@ -67,7 +67,7 @@ artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in ['bugs'] ]
# for creating a Valgrind-Suppression file
vgsuppr = env.LumieraExe('#$BINDIR/vgsuppression','tool/vgsuppression.c', LIBS=core) ## for suppressing false valgrind alarms
vgsuppr = env.LumieraExe('#$TARDIR/vgsuppression','tool/vgsuppression.c', LIBS=core) ## for suppressing false valgrind alarms
artifacts['tools'] += [vgsuppr]
Depends(ts,vgsuppr)
@ -103,10 +103,10 @@ if testsuites:
testEnv['ENV']['TEST_CONF'] = env.File("test.conf").abspath
testDir = env.Dir('#$BINDIR')
testDir = env.Dir('#$TARDIR')
runTest = env.File("test.sh").abspath
runTs = testEnv.Command('#$BINDIR/,testlog', ts, runTest, chdir=testDir)
runTs = testEnv.Command('#$TARDIR/,testlog', ts, runTest, chdir=testDir)