OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [utils/] [contributions/] [setup/] [toolchain-install.sh] - Blame information for rev 125

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 41 rfajardo
#!/bin/bash
2
# Xanthopoulos Constantinos
3
# Installing OR GNU Toolchain.
4
# Only tested in Debian Squeeze.
5
 
6
 
7
# ===== CONFIGURATIONS =====
8
# ==========================
9
 
10
# Where will I put the binaries?
11
# ex. /opt/openrisc/bin
12
DIR_TO_INSTALL="";
13
 
14
# Debian's kernel architecture {32,64}
15
# ex. KERNEL_ARCH="32"
16
KERNEL_ARCH=""
17
 
18
# ===== SCRIPT ======
19
# ===================
20
export DEBUG=0;
21
. conxshlib.sh
22
 
23
if [ `whoami` == "root" ];
24
then
25
        errormsg "You shouldn't be root for this script to run.";
26
fi;
27
 
28
if [ ! -d $DIR_TO_INSTALL ]
29
then
30
        errormsg "Directory doesn't exist. Please create it";
31
fi;
32
 
33
execcmd "Change permissions" "chmod 777 $DIR_TO_INSTALL";
34
 
35
cd $DIR_TO_INSTALL;
36
 
37
if [ $KERNEL_ARCH == "32" ];
38
then
39
        execcmd "Download toolchain (it may take a while)" "wget ftp://ocuser:oc@opencores.org/toolchain/or32-elf-linux-x86.tar.bz2";
40
elif [ $KERNEL_ARCH == "64"];
41
then
42
        execcmd "Download toolchain (it may take a while)" "wget ftp://ocuser:oc@opencores.org/toolchain/or32-elf-linux-x86_64.tar.bz2";
43
else
44
        errormsg "Not a correct architecture. Check Configurations";
45
fi
46
 
47
execcmd "Un-tar" "tar xf *bz2";
48
 
49
execcmd "Adding toolchain to PATH" "echo \"PATH=\\\$PATH:$DIR_TO_INSTALL/or32-elf/bin/\" >> /home/$(whoami)/.bashrc;";
50
 
51
cecho "Install completed"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.