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

Subversion Repositories minsoc

[/] [minsoc/] [branches/] [verilator/] [utils/] [setup/] [minsoc-setup.sh] - Blame information for rev 112

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

Line No. Rev Author Line
1 110 rfajardo
#!/bin/bash
2
# Author: Constantinos Xanthopoulos & Raul Fajardo
3
# This script install MinSOC tree
4
# under a specific directory.
5
 
6
# ===== CONFIGURATIONS =====
7
# ==========================
8
 
9 112 rfajardo
export DIR_TO_INSTALL=`pwd`
10 110 rfajardo
# Debug ?
11
export DEBUG=0;
12
. beautify.sh
13
 
14
function testtool
15
{
16
    #    is_missing=`which $1 2>&1 | grep no`
17
    is_missing=`whereis -b $1 2>&1 | grep :$`
18
    if [ -z "$is_missing" ]
19
    then
20
        cecho "$1 is installed, pass"
21
    else
22
        errormsg "$1 is not installed, install it and re-run this installation script."
23
    fi
24
}
25
 
26
 
27
#Setting environment
28
ENV=`uname -o`
29
if [ "$ENV" != "GNU/Linux" ] && [ "$ENV" != "Cygwin" ]
30
then
31
    errormsg "Environment $ENV not supported by this script."
32
fi
33
cecho "Building tools for ${ENV} system"
34
 
35
is_arch64=`uname -m | grep 64`
36
if [ -z $is_arch64 ]
37
then
38
    KERNEL_ARCH="32"
39
else
40
    KERNEL_ARCH="64"
41
fi
42
 
43
 
44
# User check!
45
if [ `whoami` = "root" ];
46
then
47
    errormsg "You shouldn't be root for this script to run.";
48
fi;
49
 
50
 
51
# Testing necessary tools
52
cecho "Testing if necessary tools are installed, program "whereis" is required."
53
testtool sed
54
testtool patch
55
 
56
# Wizard
57
if [ -z "${ALTDIR}" ]
58
then
59
    cnecho "Give full path (ex. /home/foo/) of the directory where minsoc is under or leave empty for "${DIR_TO_INSTALL}": ";
60
    read ALTDIR;
61
    if [ ! -z "${ALTDIR}" ]
62
    then
63
        DIR_TO_INSTALL=${ALTDIR}
64
    fi
65
    cecho "${DIR_TO_INSTALL} selected";
66
fi
67
 
68
if [ ! -d ${DIR_TO_INSTALL} ]
69
then
70
    errormsg "Directory doesn't exist. Please create it";
71
fi;
72
 
73
bash configure.sh

powered by: WebSVN 2.1.0

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