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 = prog.build.target.suffix;
18 var name = this.$name + ".a" + suffix;
20 /* Read LIBDIR variable */
21 var lib = java.lang.System.getenv("LIBDIR");
23 /* If NULL, default to "lib" folder */
24 if (lib == null)
25 {
26 lib = "./lib";
27 } else {
28 print ("\tSystem environment LIBDIR variable defined : " + lib);
29 }
31 /* Get target folder, if applicable */
32 if ( java.lang.String(suffix).contains('66') )
33 lib = lib + "/c66";
35 /* Get library name with path */
36 lib = lib + "/" + name;
37 if (java.io.File(this.packageBase + lib).exists()) {
38 return lib;
39 }
41 /* Could not find any library, throw exception */
42 throw new Error("\tLibrary not found: " + this.packageBase + lib);
43 }
45 /*
46 * ======== package.close ========
47 */
48 function close()
49 {
50 if (xdc.om.$name != 'cfg') {
51 return;
52 }
53 }