blob: eb883c496cc7cfef5e88c10f9df67cabfa9ebd72 [file] [log] [blame]
/*
* ======== package/cfg/isqrtTest1-SPACE_x86GW.cfg ========
* This generated configuration script runs the user's configuration script
* the context of a specific target and platform in order to generate
* all the files necessary to create an executable; e.g., linker command
* files, static C/C++ data structures, etc.
*/
/*
* ======== _runescape ========
* Recursive unescape to decode serialized strings
*/
function _runescape(obj) {
for (var i in obj) {
if (obj[i] != null) {
if (typeof obj[i] == 'string') {
obj[i] = unescape(obj[i]);
}
else if (typeof obj[i] == 'object') {
_runescape(obj[i]);
}
}
}
}
/*
* ======== _getPlatCfg ========
*/
function _getPlatCfg() {
var tmp = {};
_runescape(tmp);
return (tmp);
}
/*
* ======== _cfginit ========
*/
function _cfginit() {
xdc.loadPackage('xdc.services.intern.cmd');
var prog = xdc.om['xdc.cfg.Program'];
/* initialize prog attrs from build model */
var build = {
releases: {
0: {
name: "charlie_sqrtlib_test",
attrs: {
prefix: "",
label: "default"
},
otherFiles: {}
}
},
target: {
$name:"gnu.targets.Mingw",
name: "Mingw",
suffix: "86GW",
compatibleSuffixes: {
$name:"gnu.targets.Mingw/compatibleSuffixes",
},
isa: "x86",
model: {
$name:"gnu.targets.Mingw/model",
endian: "little"
},
os: "Windows",
rts: "gnu.targets.rts86GW",
dllExt: ".so",
platform: "host.platforms.PC",
platforms: {
$name:"gnu.targets.Mingw/platforms",
0: "host.platforms.PC"
},
version: "gnu.targets.Mingw%7B1%2C0%2C3.4%2C5",
debugGen: {
$name:"gnu.targets.Mingw/debugGen",
},
extensions: {
$name:"gnu.targets.Mingw/extensions",
".asm": {
$name:"gnu.targets.Mingw/extensions/'.asm'",
suf: ".asm",
typ: "asm"
},
".c": {
$name:"gnu.targets.Mingw/extensions/'.c'",
suf: ".c",
typ: "c"
},
".cpp": {
$name:"gnu.targets.Mingw/extensions/'.cpp'",
suf: ".cpp",
typ: "cpp"
},
".cxx": {
$name:"gnu.targets.Mingw/extensions/'.cxx'",
suf: ".cxx",
typ: "cpp"
},
".C": {
$name:"gnu.targets.Mingw/extensions/'.C'",
suf: ".C",
typ: "cpp"
},
".cc": {
$name:"gnu.targets.Mingw/extensions/'.cc'",
suf: ".cc",
typ: "cpp"
},
".s86GW": {
$name:"gnu.targets.Mingw/extensions/'.s86GW'",
suf: ".s86GW",
typ: "asm"
}
},
versionMap: {
$name:"gnu.targets.Mingw/versionMap",
"gcc3.2": "1%2C0%2C3.2%2C0"
},
alignDirectiveSupported: false,
rootDir: "e%3A/rtsc/mingw",
profiles: {
$name:"gnu.targets.Mingw/profiles",
debug: {
$name:"gnu.targets.Mingw/profiles/'debug'",
compileOpts: {
$name:"gnu.targets.Mingw/profiles/'debug'/compileOpts",
copts: "-g",
defs: "-D_DEBUG_%3D1"
},
linkOpts: "-g",
filters: {
$name:"gnu.targets.Mingw/profiles/'debug'/filters",
}
},
release: {
$name:"gnu.targets.Mingw/profiles/'release'",
compileOpts: {
$name:"gnu.targets.Mingw/profiles/'release'/compileOpts",
copts: "-O2"
},
linkOpts: "",
filters: {
$name:"gnu.targets.Mingw/profiles/'release'/filters",
}
},
profile: {
$name:"gnu.targets.Mingw/profiles/'profile'",
compileOpts: {
$name:"gnu.targets.Mingw/profiles/'profile'/compileOpts",
copts: "-g%20-pg"
},
linkOpts: "-pg",
filters: {
$name:"gnu.targets.Mingw/profiles/'profile'/filters",
}
},
coverage: {
$name:"gnu.targets.Mingw/profiles/'coverage'",
compileOpts: {
$name:"gnu.targets.Mingw/profiles/'coverage'/compileOpts",
copts: "-fprofile-arcs%20-ftest-coverage"
},
linkOpts: "",
filters: {
$name:"gnu.targets.Mingw/profiles/'coverage'/filters",
}
}
},
sectMap: {
$name:"gnu.targets.Mingw/sectMap",
},
stdInclude: "gnu/targets/std.h",
stdTypes: {
$name:"gnu.targets.Mingw/stdTypes",
t_IArg: {
$name:"gnu.targets.Mingw/stdTypes/t_IArg",
size: 4,
align: 4
},
t_Char: {
$name:"gnu.targets.Mingw/stdTypes/t_Char",
size: 1,
align: 1
},
t_Double: {
$name:"gnu.targets.Mingw/stdTypes/t_Double",
size: 8,
align: 4
},
t_Float: {
$name:"gnu.targets.Mingw/stdTypes/t_Float",
size: 4,
align: 4
},
t_Fxn: {
$name:"gnu.targets.Mingw/stdTypes/t_Fxn",
size: 4,
align: 4
},
t_Int: {
$name:"gnu.targets.Mingw/stdTypes/t_Int",
size: 4,
align: 4
},
t_Int8: {
$name:"gnu.targets.Mingw/stdTypes/t_Int8",
size: 1,
align: 1
},
t_Int16: {
$name:"gnu.targets.Mingw/stdTypes/t_Int16",
size: 2,
align: 2
},
t_Int32: {
$name:"gnu.targets.Mingw/stdTypes/t_Int32",
size: 4,
align: 4
},
t_Int40: {
$name:"gnu.targets.Mingw/stdTypes/t_Int40",
},
t_Int64: {
$name:"gnu.targets.Mingw/stdTypes/t_Int64",
size: 8,
align: 4
},
t_Long: {
$name:"gnu.targets.Mingw/stdTypes/t_Long",
size: 4,
align: 4
},
t_LDouble: {
$name:"gnu.targets.Mingw/stdTypes/t_LDouble",
size: 12,
align: 4
},
t_LLong: {
$name:"gnu.targets.Mingw/stdTypes/t_LLong",
size: 8,
align: 4
},
t_Ptr: {
$name:"gnu.targets.Mingw/stdTypes/t_Ptr",
size: 4,
align: 4
},
t_Short: {
$name:"gnu.targets.Mingw/stdTypes/t_Short",
size: 2,
align: 2
}
},
bitsPerChar: 8,
GCCVERS: "3.4.5",
GCCTARG: "mingw32",
LONGNAME: "/bin/mingw32-gcc.exe",
CYGWIN: false,
ar: {
$name:"gnu.targets.Mingw/ar",
cmd: "%24%28rootDir%29/%24%28GCCTARG%29/bin/ar",
opts: "cr"
},
arOpts: {
$name:"gnu.targets.Mingw/arOpts",
prefix: "",
suffix: ""
},
lnk: {
$name:"gnu.targets.Mingw/lnk",
cmd: "%24%28rootDir%29/%24%28LONGNAME%29",
opts: ""
},
lnkOpts: {
$name:"gnu.targets.Mingw/lnkOpts",
prefix: "",
suffix: "-lstdc++%20-L%24%28rootDir%29/lib"
},
cc: {
$name:"gnu.targets.Mingw/cc",
cmd: "%24%28rootDir%29/%24%28LONGNAME%29%20-c%20-MD%20-MF%20%24@.dep",
opts: ""
},
ccOpts: {
$name:"gnu.targets.Mingw/ccOpts",
prefix: "-Wunused",
suffix: "-Dfar%3D%20"
},
asm: {
$name:"gnu.targets.Mingw/asm",
cmd: "%24%28rootDir%29/%24%28LONGNAME%29%20-c%20-x%20assembler",
opts: ""
},
asmOpts: {
$name:"gnu.targets.Mingw/asmOpts",
prefix: "",
suffix: ""
},
includeOpts: "",
cmdPrefix: ""
},
test: {},
cfgArgs: "%7BoptMode%3A%20%27SPACE%27%7D",
cfgScript: "isqrtTest1.cfg",
profile: "release"
};
build.target.findSuffix = function findSuffix(pkg) {
if (arguments.length < 1) {
throw new Error("The function ITarget.findSuffix() requires an " + "argument");
}
var suffixMap = {};
if ("build" in pkg) {
var build = pkg.build;
if (build.libraries.length != 0) {
if (build.libDesc[0].suffix != undefined) {
for (var i = 0; i < build.libDesc.length; i++) {
suffixMap[build.libDesc[i].suffix] = "";
}
} else {
for (var i = 0; i < build.libDesc.length; i++) {
if (build.libDesc[i].target == prog.build.target.$name) {
suffixMap[prog.build.target.suffix] = "";
break;
}
}
}
}
} else {
if ("length" in pkg) {
for (var i = 0; i < pkg.length; i++) {
suffixMap[pkg[i]] = "";
}
} else {
throw new Error("An invalid argument type supplied to " + "ITarget.findSuffix()");
}
}
var compTargs = [];
for (var prop in this.compatibleSuffixes) {
compTargs[prop] = this.compatibleSuffixes[prop];
}
if (this.suffix in suffixMap) {
return (this.suffix);
}
if (compTargs.length < 1) {
return (null);
}
for (var i = 0; i < compTargs.length; i++) {
if (compTargs[i] in suffixMap) {
return (compTargs[i]);
}
}
return (null);
};
build.target.selectSuffix = function selectSuffix(list) {
var suffixMap = {};
for (var i = 0; i < list.length; i++) {
suffixMap[list[i]] = "";
}
var compTargs = [];
for (var prop in this.compatibleSuffixes) {
compTargs[prop] = this.compatibleSuffixes[prop];
}
if (this.suffix in suffixMap) {
return (this.suffix);
}
if (compTargs.length < 1) {
return (null);
}
for (var i = 0; i < compTargs.length; i++) {
if (compTargs[i] in suffixMap) {
return (compTargs[i]);
}
}
return (null);
};
_runescape(build);
build.cfgArgs = {optMode: 'SPACE'};
prog.build = build;
prog.name = "isqrtTest1-SPACE.x86GW";
prog.endian = prog.build.target.model.endian;
/* use the platform package's Platform module */
var Platform = xdc.useModule("host.platforms.PC.Platform");
var platParams = _getPlatCfg();
for (var prop in platParams) {
if (!(prop in Platform.PARAMS)) {
delete platParams[prop];
}
}
prog.platformName = "host.platforms.PC";
prog.platform = Platform.create("", _getPlatCfg(), platParams);
/* record the executable's package name */
prog.buildPackage = "charlie.sqrtlib.test";
/* record build-model information required during config generation */
prog.$$bind("$$isasm", 0);
prog.$$bind("$$isrom", 0);
prog.$$bind("$$gentab", [
]);
/* bind prog to an appropriate execution context */
prog.cpu = prog.platform.getExeContext(prog);
/* import the target's run-time support pkg */
xdc.loadPackage("gnu.targets.rts86GW");
}
/* function to import the cfg script's package */
function _userscript($$legacy, script) {
var home;
var spath;
/* import the executable's package */
home = xdc.loadPackage("charlie.sqrtlib.test");
spath = '.';
xdc.om.$$bind('$homepkg', home);
if (script != null) {
utils.evaluateScript(script);
}
else {
/* load & run program cfg script and monitor all loaded files */
_runCfg("isqrtTest1.cfg", spath, "package/cfg/isqrtTest1-SPACE_x86GW",
false,
false,
_getPlatCfg());
}
/*
* ======== _runCfg ========
* Run a user supplied configuration script and prevent user's script from
* overwriting the global variable prog.
*/
function _runCfg(cfgScript, path, programName, legacyTcf, legacyCfg,
platParams)
{
if (legacyTcf) {
/* save current global variables */
var $save = {prog: utils.global.prog, Program: Program};
/* initialize global variables for legacy config scripts */
environment["config.programName"] = programName;
environment["config.platform"] = Program.platformName;
utils.seedPath = environment["config.importPath"];
utils.loadPlatform.params = platParams;
Program = $$legacy.Program; /* defined in cfg.tci */
/* run legacy config script with prog == to RTSC Program; this
* allows legacy script to read build atributes from RTSC model
* before re-creating the prog object
*/
utils.loadCapsule(cfgScript, false, path);
/* restore global variables; now prog == TCOM prog because
* utils.loadPlatform() creates the TCOM prog object.
*/
$$legacy.prog = utils.global.prog; /* in case XDC wants it */
utils.global.prog = $save.prog;
Program = $save.Program;
/* run XDC configuration script, if it exists */
if (legacyCfg) {
utils.importFile(cfgScript.replace(/\.tcf/, ".cfg"), path);
}
}
else {
utils.loadCapsule(cfgScript, false, path);
}
}
}
function _postinit() {
var cout = null;
var prog = xdc.om['xdc.cfg.Program'];
/* get the exec command for this executable */
if (prog.execCmd == null) {
prog.execCmd = prog.platform.getExecCmd(prog,
xdc.om["host.platforms.PC"].packageBase);
}
var cout = "define EXEC." + prog.name + '\n\n';
cout += prog.execCmd;
cout += "\nendef\n\n";
utils.genDep("package/cfg/isqrtTest1-SPACE_x86GW", "charlie.sqrtlib.test", utils.loadedFiles, cout, null);
}