On Thursday 20 July 2006 07:47 pm, Kun Pang wrote:
>    Does anybody can tell me how to set TinyOS 2.x environment variable?
> From the installing instruction "You'll put them in a shell script that
> will run when your shell starts", what's the file of shell script for
> cygwin? Where can I find it? An example to edit the shell script will be
> greatly appreciated. Thanks in advance.

Cygwin uses the /etc/profile "stuff", not unlike Linux and other Unix-like 
OSes.  To add new environment information (not just variables...), simply add 
an appropriate file containing what you need in /etc/profile.d; these files 
are sourced during login.

Here's my TinyOS 2.x env file, /etc/profile.d/tinyos.sh.  I'm running it on 
Linux and Cygwin.  It's derived from the instructions at 
http://www.tinyos.net/tinyos-2.x/doc/html/install-tinyos.html . I first saw 
the trick to handle setting an env var in Linux and Cygwin in the moteiv 
distribution.  Note that if you have reason for other stuff in CLASSPATH, 
you'll need to make changes.
-----------------------
# Set the tinyos 2.x environment
TOSROOT="/opt/tinyos-2.x"
if [ -d "$TOSROOT" -a -d "$TOSROOT/tos" ]; then
    export TOSROOT
    export TOSDIR="$TOSROOT/tos"
    export MAKERULES="$TOSROOT/support/make/Makerules"
    # This hacks up other changes to CLASSPATH
    if [ -f /bin/cygwin1.dll ]; then
        export CLASSPATH="`cygpath -w $TOSROOT/support/sdk/java/tinyos.jar`;."
    else
        export CLASSPATH="$TOSROOT/support/sdk/java/tinyos.jar:."
    fi
else
    echo "Error: TOS tools not configured" >&2
fi
-----------------------

Don't forget that the path to java and to /usr/local/bin also need to be in 
PATH.  These are often set by other profile snippets, but if not, just add 
one in to get the job done.

All the best,
Steve McKown
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to