wolfssl.bld 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * Generally there is no need to edit this file!
  3. *
  4. * This file controls which libraries are built, as well as compiler options
  5. * to use.
  6. *
  7. * The contents of this file usually don't change, but having it in your
  8. * ownership allows you to tweak your compiler options. If you do change
  9. * this file, however, on the next upgrade of the product we recommend
  10. * that you take "wolfssl.bld" file as supplied by the upgrade and then merge
  11. * your changes with it.
  12. */
  13. /*
  14. * ======== wolfssl.bld ========
  15. * This script is run prior to all build scripts. It sets host-system-
  16. * independent values for targets and platforms, then it attempts to
  17. * find the host-system-specific user.bld script that sets rootDirs.
  18. *
  19. * These settings may be a function of the following global variables:
  20. *
  21. * environment a hash table of environment strings
  22. *
  23. * arguments an array of string arguments to the _config.bld script
  24. * initialized as follows:
  25. * arguments[0] - the file name of the _config.bld script
  26. * arguments[1] - the first argument specified in XDCARGS
  27. * :
  28. * arguments[n] - the n'th argument in XDCARGS
  29. *
  30. * Build an alias for xdc.om.xdc.bld.BuildEnvironment
  31. */
  32. var armOpts = " -ms ";
  33. var gnuOpts = " -D_POSIX_SOURCE ";
  34. var iarOpts = " --diag_suppress=Pa134 ";
  35. var ndkDir = "";
  36. /* Uncomment the following lines to build libraries for debug mode: */
  37. // Pkg.attrs.profile = "debug";
  38. // armOpts += " -g -o0 ";
  39. // gnuOpts += " -g -D_POSIX_SOURCE ";
  40. // iarOpts += " --debug ";
  41. var ccOpts = {
  42. "ti.targets.arm.elf.M4" : armOpts,
  43. "ti.targets.arm.elf.M4F" : armOpts,
  44. "gnu.targets.arm.M4" : gnuOpts,
  45. "gnu.targets.arm.M4F" : gnuOpts,
  46. "iar.targets.arm.M4" : iarOpts,
  47. "iar.targets.arm.M4F" : iarOpts,
  48. };
  49. /* initialize local vars with those set in xdcpaths.mak (via XDCARGS) */
  50. for (arg = 0; arg < arguments.length; arg++) {
  51. /*
  52. * Get the compiler's installation directory.
  53. * For "ti.targets.arm.elf.M4F=/vendors/arm/6.1.0",
  54. * we get "/vendors/arm/6.1.0"
  55. */
  56. var targetName = arguments[arg].split("=")[0];
  57. var rootDir = arguments[arg].split("=")[1];
  58. /* only build for the specified compilers */
  59. if (rootDir == "" || rootDir == undefined) {
  60. continue;
  61. }
  62. if (targetName.match(/^NDK/) ) {
  63. ndkDir = rootDir;
  64. continue;
  65. }
  66. var target = xdc.useModule(targetName);
  67. target.rootDir = rootDir;
  68. target.ccOpts.suffix += ccOpts[targetName];
  69. Build.targets.$add(target);
  70. }
  71. /* Include Path (needed to find NDK headers) */
  72. var wolfsslPathInclude = " -I" + ndkDir + "/packages/ti/ndk/inc/bsd "
  73. + "-DWOLFSSL_TIRTOS ";
  74. /* lib/ is a generated directory that 'xdc clean' should remove */
  75. var Pkg = xdc.useModule('xdc.bld.PackageContents');
  76. Pkg.generatedFiles.$add("lib/");