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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [utils/] [setup/] [minsoc-setup.sh] - Blame information for rev 141

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

powered by: WebSVN 2.1.0

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