Installing up to date Cygwin

From TinyOS Wiki
Jump to: navigation, search

This documentation was written and checked at January 2013, but tinyos will be probably compatible with newer cygwins as well.

Picking the right JDK

You could usually use the newest one, but currently you have to use the x86 version, even on a 64 bit Windows.

Installing Cygwin

Download setup.exe from Cygwin's Official Site and start it. Go through the installation, until the “Select Packages” window. Here, you will need the following extra packages for using tinyos:

  • gcc-core
  • make
  • python (currently, python installs python2. If there is a python2 package, install that)
  • perl
  • rpm

After that, you can install the tinyos rpms. If you’re using Windows Vista, or newer, you should start cygwin as root for tinyos-tools installation. If you forgot it, it doesn’t matter, you can run tos-install-jni later manually to install the missing files.

If you want to install cygwin packages later just run the setup.exe again, and go through the installation until the "Select Packages" window.

Extra packages

There are some useful packages you might want to install:

  • git (to use the tinyos repository directly from cygwin)
  • bash-completion (completes your command if you press tab)
  • mc (midnight commander, great file manager)

To generate the tinyos rpms, you need some more:

  • autoconf
  • automake
  • mingw64-x86_64-gcc-core
  • mingw64-x86_64-gcc-g++
  • mingw64-i686-gcc-core
  • mingw64-i686-gcc-g++
  • bison
  • flex
  • libiconv
  • patch
  • util-linux
  • wget
  • rpm-build
  • rpm-devel
  • rsync
  • diffutils

TinyOS environment variables

I usually create the file cygwin/etc/profile.d/tinyos.sh with the following contents

export TOSROOT="/opt/tinyos-2.x"
export CLASSPATH="$CLASSPATH;c:\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar;."
export MAKERULES="$TOSROOT/support/make/Makerules"
export TOSDIR="$TOSROOT/tos"

export PATH=:$PATH:`/usr/bin/tos-locate-jre --java`:`/usr/bin/tos-locate-jre --javac`