From a6810957b49896634175d1cf5349296b3d5b419d Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 29 Jan 2011 14:10:19 +0100 Subject: [PATCH] Install: change organisation of target and output directory variables now supporting a PREFIX in addition to the INSTALLDIR. The latter is intended for package building --- SConstruct | 8 +++++--- admin/scons/Buildhelper.py | 2 +- admin/vg-run.sh | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index a633e0583..974b3d7c9 100644 --- a/SConstruct +++ b/SConstruct @@ -80,6 +80,7 @@ def setupBasicEnvironment(): , LIBDIR=LIBDIR , MODULES=MODULES , ICONDIR=ICONDIR + , DESTDIR=env.subst('$INSTALLDIR/$PREFIX') , CPPPATH=["#"+SRCDIR] # used to find includes, "#" means always absolute to build-root , CPPDEFINES=['-DLUMIERA_VERSION='+VERSION ] # note: it's a list to append further defines , CCFLAGS='-Wall -Wextra ' @@ -164,9 +165,10 @@ def defineCmdlineVariables(): # ,BoolVariable('OPENGL', 'Include support for OpenGL preview rendering', False) # ,EnumVariable('DIST_TARGET', 'Build target architecture', 'auto', # allowed_values=('auto', 'i386', 'i686', 'x86_64' ), ignorecase=2) - ,PathVariable('DESTDIR', 'Installation dir prefix', '/usr/local') - ,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to DESTDIR/lib/lumiera', '',PathVariable.PathAccept) - ,PathVariable('PKGDATADIR', 'Installation dir for default config, usually DESTDIR/share/lumiera', '',PathVariable.PathAccept) + ,PathVariable('PREFIX', 'Installation dir prefix', 'usr/local', PathVariable.PathAccept) + ,PathVariable('INSTALLDIR', 'Root output directory for install. Final installation will happen in INSTALLDIR/PREFIX/... ', '/', PathVariable.PathIsDir) + ,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to PREFIX/lib/lumiera/modules', '',PathVariable.PathAccept) + ,PathVariable('PKGDATADIR', 'Installation dir for default config, usually PREFIX/share/lumiera', '',PathVariable.PathAccept) ,PathVariable('SRCTAR', 'Create source tarball prior to compiling', '..', PathVariable.PathAccept) ,PathVariable('DOCTAR', 'Create tarball with developer documentation', '..', PathVariable.PathAccept) ) diff --git a/admin/scons/Buildhelper.py b/admin/scons/Buildhelper.py index f781aa730..f555489dd 100644 --- a/admin/scons/Buildhelper.py +++ b/admin/scons/Buildhelper.py @@ -151,7 +151,7 @@ def createPlugins(env, dir): """ investigate the given source directory to identify all contained source trees. @return: a list of build nodes defining a plugin for each of these source trees. """ - return [env.LoadableModule( '#$PLUGDIR/%s' % getDirname(tree) + return [env.LoadableModule( '#$TARDIR/$MODULES/%s' % getDirname(tree) , srcSubtree(env, tree) , SHLIBPREFIX='', SHLIBSUFFIX='.lum' ) diff --git a/admin/vg-run.sh b/admin/vg-run.sh index f8d82040b..3a3aa1f57 100644 --- a/admin/vg-run.sh +++ b/admin/vg-run.sh @@ -12,6 +12,7 @@ # LOGFILE=,valgrind.log SUPPRESS=vgsuppression +MODULEDIR=modules VALGRINDFLAGS=${VALGRINDFLAGS:---leak-check=yes --show-reachable=yes --demangle=yes} EXECUTABLE=$1 @@ -24,6 +25,9 @@ fi PATHPREFIX=${EXECUTABLE%/*} SUPPRESS="$PATHPREFIX/$SUPPRESS" +# need to set a library search path, because valgrind doesn't handle DT_RUNPATH and $ORIGIN properly +export LD_LIBRARY_PATH=$PATHPREFIX/$MODULEDIR:$LD_LIBRARY_PATH + if [[ -x $SUPPRESS ]]; then if [[ $SUPPRESS -nt $SUPPRESS.supp ]]; then echo 'generating valgrind supression file...' @@ -37,6 +41,7 @@ else echo 'no suppression.' fi + echo "running......$@" valgrind $VALGRINDFLAGS --log-file=$LOGFILE.%p $SUPPRESSIONFLAG $@ &