]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/tcp3d-lld.git/blob - package.xs
Merge branch 'releases/mcsdk_03.01.00.00'
[keystone-rtos/tcp3d-lld.git] / package.xs
1 /*\r
2  *  ======== package.xs ========\r
3  *\r
4  */\r
5 \r
6 \r
7 /*\r
8  *  ======== Package.getLibs ========\r
9  *  This function is called when a program's configuration files are\r
10  *  being generated and it returns the name of a library appropriate\r
11  *  for the program's configuration.\r
12  */\r
13 \r
14 function getLibs(prog)\r
15 {\r
16     var suffix = prog.build.target.suffix;\r
17 \r
18     var name = this.$name + ".a" + suffix;\r
19 \r
20     /* Read LIBDIR variable */\r
21     var lib = java.lang.System.getenv("LIBDIR");\r
22 \r
23     /* If NULL, default to "lib" folder */\r
24     if (lib == null)\r
25     {\r
26         lib = "./lib";\r
27     } else {\r
28         print ("\tSystem environment LIBDIR variable defined : " + lib);\r
29     }\r
30 \r
31     /* Device types supported */\r
32     var deviceTypes = [\r
33                         'k2k',\r
34                         'k2h',\r
35                         'k2l',\r
36                       ];\r
37     \r
38     /* Search for the supported devices (defined in config.bld) */\r
39     for each(var device in deviceTypes)\r
40     {\r
41         if (this.Settings.deviceType.equals(device))\r
42         {\r
43             lib = lib + "/" + device;\r
44             break;\r
45         }\r
46     }\r
47 \r
48     /* Get target folder, if applicable */\r
49     if ( java.lang.String(suffix).contains('66') )\r
50         lib = lib + "/c66";\r
51 \r
52     /* Get library name with path */\r
53     lib = lib + "/" + name;\r
54     if (java.io.File(this.packageBase + lib).exists()) {\r
55        print ("\tLinking with library " + this.$name + ":" + lib);\r
56        return lib;\r
57     }\r
58 \r
59     /* Could not find any library, throw exception */\r
60     throw new Error("\tLibrary not found: " + this.packageBase + lib);\r
61 }\r
62 \r
63 /*\r
64  *  ======== package.close ========\r
65  */\r
66 function close()\r
67 {    \r
68     if (xdc.om.$name != 'cfg') {\r
69         return;\r
70     }\r
71 }\r