Pass the SYS_CONF_DIR to the compiler so that we can set a reasonable

default for CORIOLIS_TOP.
This commit is contained in:
Jean-Paul Chaput 2010-05-27 12:48:11 +00:00
parent 736d3346e4
commit 08aa1aa1ac
2 changed files with 21 additions and 9 deletions

View File

@ -18,7 +18,9 @@
${CRLCORE_SOURCE_DIR}/src/ccore/toolbox
)
add_definitions ( -DCORIOLIS_TOP="${PROJECT_BINARY_DIR}" )
add_definitions ( -DCORIOLIS_TOP="${PROJECT_BINARY_DIR}"
-DSYS_CONF_DIR="${SYS_CONF_DIR}"
)
set ( includes crlcore/Utilities.h
crlcore/Memory.h

View File

@ -35,10 +35,6 @@
#include "crlcore/Environment.h"
#undef CORIOLIS_TOP
#define CORIOLIS_TOP "/opt/coriolis2"
namespace {
@ -57,6 +53,8 @@ namespace {
"Environment::Environment() :\n"
" %s logical format \"%s\" incoherent with physical format \"%s\".\n";
const string sysConfDir = SYS_CONF_DIR;
class XmlEnvironmentParser : public XmlParser {
@ -210,8 +208,12 @@ namespace {
XmlEnvironmentParser ep ( env );
string envPath = path;
if ( path.empty() )
envPath = env.getCORIOLIS_TOP() + "/etc/coriolis2/environment.alliance.xml" ;
if ( path.empty() ) {
if ( sysConfDir[0] == '/' )
envPath = sysConfDir + "/coriolis2/environment.alliance.xml" ;
else
envPath = env.getCORIOLIS_TOP() + sysConfDir + "/coriolis2/environment.alliance.xml" ;
}
return ep._load ( envPath, warnNotFound );
}
@ -525,9 +527,9 @@ namespace CRL {
: _CORIOLIS_TOP (CORIOLIS_TOP)
, _displayStyle ()
, _SCALE_X (10)
, _SYMBOLIC_TECHNOLOGY(CORIOLIS_TOP "/etc/coriolis2/technology.symbolic.xml")
, _SYMBOLIC_TECHNOLOGY("")
, _LEF_TECHNOLOGY ("")
, _DISPLAY (CORIOLIS_TOP "/etc/coriolis2/display.xml")
, _DISPLAY ("")
, _IN_LO ("vst")
, _IN_PH ("ap")
, _OUT_LO ("vst")
@ -535,6 +537,14 @@ namespace CRL {
, _CATALOG ("CATAL")
, _inConstructor (true)
{
if ( sysConfDir[0] == '/' ) {
_SYMBOLIC_TECHNOLOGY = sysConfDir + "/coriolis2/technology.symbolic.xml";
_DISPLAY = sysConfDir + "/coriolis2/display.xml";
} else {
_SYMBOLIC_TECHNOLOGY = _CORIOLIS_TOP + sysConfDir + "/coriolis2/technology.symbolic.xml";
_DISPLAY = _CORIOLIS_TOP + sysConfDir + "/coriolis2/display.xml";
}
setPOWER ( "vdd" );
setGROUND ( "vss" );
setCLOCK ( "^ck$" );