bootloader: bumped the version to 2.1
[nios2ecos.git] / nios_env.sh
blobd4aed37d7fc2f9d88500a4b7b84c0f938814996a
1 # set up enviornment variables.
3 # cd nios2ecos
4 # source nios_env.sh
6 # Intended to work on Cygwin & Linux out of the box(tested on Ubuntu 9.04,
7 # 9.10 and Cygwin as of writing).
9 # Be afraid!!!! here we have to figure out the location of the
10 # script being sourced!!!! Requires bash 3.0 or later.
11 export NIOS2_ENV_PATH=$(dirname $BASH_ARGV)
12 export NIOS_ECOS=$(readlink -f $NIOS2_ENV_PATH/packages)
14 echo "Test $BASH_ARGV"
15 echo "NIOS_ECOS = $NIOS_ECOS"
17 if [ `uname` = Linux ] ;then
18 echo "Linux box"
19 if [ -d /opt/altera9.1 ]; then
20 export CYG_ALTERA_ROOTDIR=/opt/altera9.1
21 else
22 export CYG_ALTERA_ROOTDIR=/opt/altera9.0
24 # FIX!!!! check if nios2-elf-gcc is already added to path
25 export PATH=$PATH:$CYG_ALTERA_ROOTDIR/nios2eds/bin/nios2-gnutools/H-i686-pc-linux-gnu/bin
26 export TMP=/tmp
27 # SOPC_KIT_NIOS2 and QUARTUS_ROOTDIR exists in the
28 # Windows environment when Quartus 9 is installed
29 # and there are scripts that rely on their presence. Add
30 # them for Linux.
31 export SOPC_KIT_NIOS2=$CYG_ALTERA_ROOTDIR/nios2eds
32 export QUARTUS_ROOTDIR=$CYG_ALTERA_ROOTDIR/quartus
33 else
34 echo "Cygwin"
35 export CYGWIN=nontsec
36 # DANGER!!! here we need windows-like paths for compatibility.
37 export WIN_ALTERA_ROOTDIR=`cygpath -m $SOPC_KIT_NIOS2/.. | sed "s,/$,,"`
38 export CYG_ALTERA_ROOTDIR=`cygpath -u $WIN_ALTERA_ROOTDIR`
39 # FIX!!!! check if nios2-elf-gcc is already added to path
40 export PATH=$PATH:$CYG_ALTERA_ROOTDIR/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin
44 # This is the standard installation directory for eCos 3.0
45 # echo "Adding eCos 3.0 tools to path: ~/ecos/ecos-3.0/tools/bin"
46 # FIX!!! check if ecosconfig is already in the path and only add
47 # this to path if it isn't
48 # export PATH=$PATH:~/ecos/ecos-3.0/tools/bin
49 # FIX!!! ECOS_REPOSITORY must already be set up, add check
50 #export ECOS_REPOSITORY=~/ecos/ecos-3.0/packages
51 echo "Prepend Nios eCos repository to ECOS_REPOSITORY=$ECOS_REPOSITORY"
52 export ECOS_REPOSITORY=$NIOS_ECOS:$ECOS_REPOSITORY
54 # Enable the line below if you need to build libstdc++ posix threads
55 # This is the compat/posix support while we wait for a few more features
56 # to be added to the eCos CVS HEAD
57 #export ECOS_REPOSITORY=$NIOS_ECOS/../tools/gcc4libstdxx/ecos:$ECOS_REPOSITORY
58 echo "ECOS_REPOSITORY=$ECOS_REPOSITORY"
60 # generally place the altera stuff *LAST* in the path because it contains
61 # lots of obsolete stuff
62 export PATH=$PATH:$NIOS_ECOS/hal/nios2/arch/current/host
63 export PATH=$PATH:$CYG_ALTERA_ROOTDIR/quartus/sopc_builder/bin
65 # These two last paths are not necessary to build stuff, only to
66 # get tools to communicate with the FPGA(nios2-gdb-server, etc.)
68 export PATH=$PATH:$CYG_ALTERA_ROOTDIR/nios2eds/bin
69 export PATH=$PATH:$QUARTUS_ROOTDIR/bin
71 # Workaround for cygpath problems.
72 if [ `uname` = Linux ] ;then
73 export PATH=$PATH:$NIOS_ECOS/hal/nios2/arch/current/host/cygpath