1 /*
2 * ======== package.xs ========
3 *
4 */
7 /*
8 * ======== Package.getLibs ========
9 * This function is called when a program's configuration files are
10 * being generated and it returns the name of a library appropriate
11 * for the program's configuration.
12 */
14 function getLibs(prog)
15 {
16 var suffix;
18 /* find a compatible suffix */
19 if ("findSuffix" in prog.build.target) {
20 suffix = prog.build.target.findSuffix(this);
21 }
22 else {
23 suffix = prog.build.target.suffix;
24 }
26 var name = this.$name + ".a" + suffix;
27 var lib = "";
29 lib = "lib/" + name;
30 if (java.io.File(this.packageBase + lib).exists()) {
31 return lib;
32 }
34 /* could not find any library, throw exception */
35 throw Error("Library not found: " + name);
36 }
38 /*
39 * ======== package.close ========
40 */
41 function close()
42 {
43 if (xdc.om.$name != 'cfg') {
44 return;
45 }
46 }