1 # set up enviornment variables.
6 # Intended to work on Cygwin & Linux out of the box(tested on Ubuntu 9.04
7 # 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"
16 echo "NIOS_ECOS = $NIOS_ECOS"
18 if [ `uname` = Linux
] ;then
20 export CYG_ALTERA_ROOTDIR
=/opt
/altera9.0
21 # FIX!!!! check if nios2-elf-gcc is already added to path
22 export PATH
=$PATH:$CYG_ALTERA_ROOTDIR/nios2eds
/bin
/nios2-gnutools
/H-i686-pc-linux-gnu
/bin
24 # SOPC_KIT_NIOS2 and QUARTUS_ROOTDIR exists in the
25 # Windows environment when Quartus 9 is installed
26 # and there are scripts that rely on their presence. Add
28 export SOPC_KIT_NIOS2
=$CYG_ALTERA_ROOTDIR/nios2eds
29 export QUARTUS_ROOTDIR
=$CYG_ALTERA_ROOTDIR/quartus
33 # DANGER!!! here we need windows-like paths for compatibility.
34 export WIN_ALTERA_ROOTDIR
=`cygpath -m $SOPC_KIT_NIOS2/.. | sed "s,/$,,"`
35 export CYG_ALTERA_ROOTDIR
=`cygpath -u $WIN_ALTERA_ROOTDIR`
36 # FIX!!!! check if nios2-elf-gcc is already added to path
37 export PATH
=$PATH:$CYG_ALTERA_ROOTDIR/nios2eds
/bin
/nios2-gnutools
/H-i686-pc-cygwin
/bin
41 # This is the standard installation directory for eCos 3.0
42 # echo "Adding eCos 3.0 tools to path: ~/ecos/ecos-3.0/tools/bin"
43 # FIX!!! check if ecosconfig is already in the path and only add
44 # this to path if it isn't
45 # export PATH=$PATH:~/ecos/ecos-3.0/tools/bin
46 # FIX!!! ECOS_REPOSITORY must already be set up, add check
47 #export ECOS_REPOSITORY=~/ecos/ecos-3.0/packages
48 echo "Prepend Nios eCos repository to ECOS_REPOSITORY=$ECOS_REPOSITORY"
49 export ECOS_REPOSITORY
=$NIOS_ECOS:$ECOS_REPOSITORY
51 # Enable the line below if you need to build libstdc++ posix threads
52 # This is the compat/posix support while we wait for a few more features
53 # to be added to the eCos CVS HEAD
54 #export ECOS_REPOSITORY=$NIOS_ECOS/../tools/gcc4libstdxx/ecos:$ECOS_REPOSITORY
55 echo "ECOS_REPOSITORY=$ECOS_REPOSITORY"
58 # generally place the altera stuff *LAST* in the path because it contains
59 # lots of obsolete stuff
60 export PATH
=$PATH:$NIOS_ECOS/hal
/nios
2/arch
/current
/host
61 export PATH
=$PATH:$CYG_ALTERA_ROOTDIR/quartus
/sopc_builder
/bin
63 # These two last paths are not necessary to build stuff, only to
64 # get tools to communicate with the FPGA(nios2-gdb-server, etc.)
65 export PATH
=$PATH:$CYG_ALTERA_ROOTDIR/nios2eds
/bin
66 export PATH
=$PATH:$QUARTUS_ROOTDIR/bin
69 # Workaround for cygpath problems.
70 if [ `uname` = Linux
] ;then
71 export PATH
=$PATH:$NIOS_ECOS/hal
/nios
2/arch
/current
/host
/cygpath