diff --git a/SConstruct b/SConstruct index 6f78fbdbd..6419b5cb7 100644 --- a/SConstruct +++ b/SConstruct @@ -348,7 +348,7 @@ def defineBuildTargets(env, artifacts): artifacts['corelib'] = core artifacts['support'] = lLib artifacts['lumiera'] = ( env.Program('lumiera', ['src/lumiera/main.cpp'], LIBS=core, install=True) - + env.ConfigData(env.path.srcConf+'setup.ini') + + env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN') + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini') ) diff --git a/admin/scons/LumieraEnvironment.py b/admin/scons/LumieraEnvironment.py index 21b1f9ecb..c0ce77375 100644 --- a/admin/scons/LumieraEnvironment.py +++ b/admin/scons/LumieraEnvironment.py @@ -165,10 +165,27 @@ def register_LumieraResourceBuilder(env): env.Install (toInstall, source) return env.Install(toBuild, source) - def ConfigData(env, source): + def ConfigData(env, source, targetDir=None): + """ install (copy) configuration- and metadata. + target dir is either the install location configured (in SConstruct), + or an explicitly given absolute or relative path segment, which might refer + to the location of the executable through the $ORIGIN token + """ subdir = getDirname(str(source), env.path.srcConf) # removes source location path prefix - toBuild = env.path.buildConf+subdir - toInstall = env.path.installConf+subdir + if targetDir: + if path.isabs(targetDir): + toBuild = toInstall = path.join(targetDir,subdir) + else: + if targetDir.startswith('$ORIGIN'): + targetDir = targetDir[len('$ORIGIN'):] + toBuild = path.join(env.path.buildExe, targetDir, subdir) + toInstall = path.join(env.path.installExe, targetDir, subdir) + else: + toBuild = path.join(env.path.buildConf, targetDir, subdir) + toInstall = path.join(env.path.installConf, targetDir, subdir) + else: + toBuild = path.join(env.path.buildConf,subdir) + toInstall = path.join(env.path.installConf,subdir) env.Install (toInstall, source) return env.Install(toBuild, source) diff --git a/data/config/setup.ini b/data/config/setup.ini index b9723bc0f..43f4b9317 100644 --- a/data/config/setup.ini +++ b/data/config/setup.ini @@ -10,7 +10,7 @@ # gui = gtk_gui.lum modulepath = $ORIGIN/modules -configpath = $ORIGIN/../../share/lumiera/config:~/.lumiera +configpath = $ORIGIN/../../share/lumiera/config:$ORIGIN/config:~/.lumiera # unused currently (2/2011) title = Lumiera version = 0.pre.01 website = http://www.lumiera.org diff --git a/src/common/appstate.cpp b/src/common/appstate.cpp index c0036fdf9..fca9c31b2 100644 --- a/src/common/appstate.cpp +++ b/src/common/appstate.cpp @@ -42,8 +42,6 @@ using util::cStr; using lib::Literal; -#define LOCATION_OF_BOOTSTRAP_INI "$ORIGIN/config/setup.ini" - namespace lumiera { @@ -80,7 +78,7 @@ namespace lumiera { * client codes POV it just behaves like intended). */ AppState::AppState() - : setup_(LOCATION_OF_BOOTSTRAP_INI) + : setup_(LUMIERA_LOCATION_OF_BOOTSTRAP_INI) , subsystems_(0) , emergency_(false) , core_up_ (false) diff --git a/src/common/basic-setup.hpp b/src/common/basic-setup.hpp index d35f25d38..1385dd270 100644 --- a/src/common/basic-setup.hpp +++ b/src/common/basic-setup.hpp @@ -33,6 +33,11 @@ #include +/** "bootstrapIni" : the basic setup configuration to load */ +#define LUMIERA_LOCATION_OF_BOOTSTRAP_INI "$ORIGIN/setup.ini" + + + namespace lumiera { using std::string;