[processor-sdk/performance-audio-sr.git] / psdk_cust / pdk_k2g_1_0_1_1_eng / packages / ti / board / package.xs
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 var board = this.Settings.boardName;
22 /* Read LIBDIR variable */
23 var lib = java.lang.System.getenv("LIBDIR");
25 /* If NULL, default to "lib" folder */
26 if (lib == null)
27 {
28 lib = "./lib";
29 } else {
30 print ("\tSystem environment LIBDIR variable defined : " + lib);
31 }
33 /* Get board name prefix */
34 lib = lib + "/" + board;
36 /* Get target folder */
37 if ( java.lang.String(suffix).contains('66') )
38 lib = lib + "/c66";
39 else if ( java.lang.String(suffix).contains('a15') )
40 lib = lib + "/armv7";
41 else if ( java.lang.String(suffix).contains('a8') )
42 lib = lib + "/armv7";
43 else if ( java.lang.String(suffix).contains('a9') )
44 lib = lib + "/armv7";
45 else if ( java.lang.String(suffix).contains('m4') )
46 lib = lib + "/m4";
48 /* Get library name with path */
49 lib = lib + "/" + name;
50 if (java.io.File(this.packageBase + lib).exists()) {
51 print ("\tLinking with library " + this.$name + ":" + lib);
52 return lib;
53 }
55 /* Could not find any library, throw exception */
56 throw new Error("\tLibrary not found: " + this.packageBase + lib);
57 }
59 /*
60 * ======== package.close ========
61 */
62 function close()
63 {
64 if (xdc.om.$name != 'cfg') {
65 return;
66 }
67 }