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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [utils/] [setup/] [minsoc-setup.sh] - Diff between revs 122 and 141

Only display areas with differences | Details | Blame | View Log

Rev 122 Rev 141
#!/bin/bash
#!/bin/bash
# Author: Constantinos Xanthopoulos & Raul Fajardo
# Author: Constantinos Xanthopoulos & Raul Fajardo
# This script install MinSOC tree
# This script install MinSOC tree
# under a specific directory.
# under a specific directory.
 
 
# ===== CONFIGURATIONS =====
# ===== CONFIGURATIONS =====
# ==========================
# ==========================
 
 
export SCRIPT_DIR="$( cd -P "$( dirname "$0" )" && pwd )"
export SCRIPT_DIR="$( cd -P "$( dirname "$0" )" && pwd )"
export DIR_TO_INSTALL=`pwd`
export DIR_TO_INSTALL=`pwd`
# Debug ?
# Debug ?
export DEBUG=0;
export DEBUG=0;
. ${SCRIPT_DIR}/beautify.sh
. ${SCRIPT_DIR}/beautify.sh
 
 
function testtool
function testtool
{
{
    #    is_missing=`which $1 2>&1 | grep no`
    #    is_missing=`which $1 2>&1 | grep no`
    is_missing=`whereis -b $1 2>&1 | grep :$`
    is_missing=`whereis -b $1 2>&1 | grep :$`
    if [ -z "$is_missing" ]
    if [ -z "$is_missing" ]
    then
    then
        cecho "$1 is installed, pass"
        cecho "$1 is installed, pass"
    else
    else
        errormsg "$1 is not installed, install it and re-run this installation script."
        errormsg "$1 is not installed, install it and re-run this installation script."
    fi
    fi
}
}
 
 
 
 
#Setting environment
#Setting environment
ENV=`uname -o`
ENV=`uname -o`
if [ "$ENV" != "GNU/Linux" ] && [ "$ENV" != "Cygwin" ]
if [ "$ENV" != "GNU/Linux" ] && [ "$ENV" != "Cygwin" ]
then
then
    errormsg "Environment $ENV not supported by this script."
    errormsg "Environment $ENV not supported by this script."
fi
fi
cecho "Building tools for ${ENV} system"
cecho "Building tools for ${ENV} system"
 
 
is_arch64=`uname -m | grep 64`
is_arch64=`uname -m | grep 64`
if [ -z $is_arch64 ]
if [ -z $is_arch64 ]
then
then
    KERNEL_ARCH="32"
    KERNEL_ARCH="32"
else
else
    KERNEL_ARCH="64"
    KERNEL_ARCH="64"
fi
fi
 
 
 
 
# User check!
# User check!
if [ `whoami` = "root" ];
if [ `whoami` = "root" ];
then
then
    errormsg "You shouldn't be root for this script to run.";
    errormsg "You shouldn't be root for this script to run.";
fi;
fi;
 
 
 
 
# Testing necessary tools
# Testing necessary tools
cecho "Testing if necessary tools are installed, program "whereis" is required."
cecho "Testing if necessary tools are installed, program "whereis" is required."
testtool sed
testtool sed
testtool patch
testtool patch
 
 
# Wizard
# Wizard
if [ -z "${ALTDIR}" ]
if [ -z "${ALTDIR}" ]
then
then
    cnecho "Give full path (ex. /home/foo/) of the directory where minsoc is under or leave empty for "${DIR_TO_INSTALL}": ";
    cnecho "Give full path (ex. /home/foo/) of the directory where minsoc is under or leave empty for "${DIR_TO_INSTALL}": ";
    read ALTDIR;
    read ALTDIR;
    if [ ! -z "${ALTDIR}" ]
    if [ ! -z "${ALTDIR}" ]
    then
    then
        DIR_TO_INSTALL=${ALTDIR}
        DIR_TO_INSTALL=${ALTDIR}
    fi
    fi
    cecho "${DIR_TO_INSTALL} selected";
    cecho "${DIR_TO_INSTALL} selected";
fi
fi
 
 
if [ ! -d ${DIR_TO_INSTALL} ]
if [ ! -d ${DIR_TO_INSTALL} ]
then
then
    errormsg "Directory doesn't exist. Please create it";
    errormsg "Directory doesn't exist. Please create it";
fi;
fi;
 
 
bash ${SCRIPT_DIR}/configure.sh
bash ${SCRIPT_DIR}/configure.sh
 
 

powered by: WebSVN 2.1.0

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