Darren,

The _javascript_ build ("XDC build") imports one environment variable from the Unix/DOS shell: "TOOLS". So if you do
    setenv TOOLS /my/tools/path
from your shell before invoking the build, then
    print( environment["TOOLS"] );
in your user.bld will print "/my/tools/path".

Not sure how documented that one is, so it might be good to add a line like
    print( "Note: using environment variable TOOLS=" +
           environment["TOOLS"] + " to determine tool paths." );

to your user.bld, to avoid surprises with possible new releases of XDC tools -- or in general, should your Unix TOOLS env. var accidentally change.

If you need more than one path to pass from the shell to user.bld, you'll have to pack all the info in TOOLS and unpack it from environment["TOOLS"]. For example, if you need two paths you can do this:
    setenv TOOLS /mytools/1stpath:/myothertools/2ndpath
-- i.e. separate them by, for example, colon -- from your shell before invoking the build; then
    var path1 = environment["TOOLS"].split(":")[0];  
    var path2 = environment["TOOLS"].split(":")[1];
    print( "1st path = " + path1 + ", 2nd path = " + path2 );
in user.bld will parse and print the segments accordingly.

(The example above uses the split(delimiter) method on a string that breaks the string into an array of delimiter-separated substrings, then we read element [0] i.e. [1] from that array. There are other ways to manipulate _javascript_ strings; you can find more if you search the Web for "string core _javascript_", for example here.)

Btw if needed you can access some built-in _javascript_ environment varibles, like environment["user.home"] etc. You can see which ones are available if you do
    for (var i in environment) print( i + " = " + environment[i] );

Note, however, that the reason XDC build does not import any (other) environment variables is to avoid the mess that comes from depending on too many of them, since they are volatile (as opposed to having all the paths written in a hard file somewhere.)

Regards,
Davor

Darren J Longhorn wrote:
Is there a way of poking an environment variable into the _javascript_
parts of the build system as there was when compiling .tcf files using
tconf?

Specifically, I'm trying to set a path in
dvevm_1_10/codec_engine_1_02/examples/user.bld relative to an
environment variable, but user.bld appears to be _javascript_ and I don't
know how to access environment variables from there.

Cheers

Darren
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

  
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to