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

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk
    from Rev 168 to Rev 169
    Reverse comparison

Rev 168 → Rev 169

/gnu-src/bld.sh
0,0 → 1,230
#!/bin/bash
 
# Copyright (C) 2009 Embecosm Limited
 
# Contributor Joern Rennecke <joern.rennecke@embecosm.com>
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
# This file is a script to build key elements of the OpenRISC tool chain
 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
 
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
 
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
 
component_dirs='binutils-2.18.50 newlib-1.17.0 gcc-4.2.2 gdb-6.8'
unified_src=srcw
build_dir=bld-or32
install_dir=/opt/or32-elf-new
 
# Sanity check!
case ${unified_src} in
"")
prefix='.'
;;
 
*/*)
echo "/ in <dest> not implemented"
exit 1
;;
 
*..*)
echo ".. in <dest> not implemented"
exit 1
;;
*)
prefix='..'
;;
esac
 
# Assume we have hardware multiply and divide. OK for Or1ksim, not the default
# for the Verilog.
export CFLAGS_FOR_TARGET='-mhard-mul -mhard-div -O2 -g'
 
# If /proc/cpuinfo is avaliable, limit load to launch extra jobs to
# number of processors + 1. If /proc/cpuinfo is not available, we use a
# constant of 2.
make_load="-j -l `(echo processor;cat /proc/cpuinfo 2>/dev/null || \
echo processor) | grep -c processor`"
 
# Parse options
 
# --force: Ensure the unified source directory and build directory are
# recreated.
# --dir: Specify the build directory
# --nolink: Don't build the unified source directory
# --noconfig: Don't run configure
# --noinstall: Don't run install
# --help: List these options and exit
nolink="false";
noconfig="false";
noinstall="false";
 
until
opt=$1
case ${opt}
in
--force)
rm -rf ${unified_src} ${build_dir}
;;
 
--dir)
build_dir=$2; shift
;;
 
--nolink)
nolink="true";
;;
 
--noconfig)
noconfig="true";
;;
 
--noinstall)
noinstall="true";
;;
 
--help)
echo "Usage: sh bld.sh [options]"
echo ""
echo "Options:"
echo " --force Ensure the unified source directory and build"
echo " directory are recreated."
echo " --dir <dir> Specify the build directory"
echo " --nolink Don't build the unified source directory"
echo " --noconfig Don't run configure"
echo " --noinstall Don't run install"
echo " --help List these options and exit"
exit 0
;;
 
*)
opt=""
;;
esac;
[ -z "${opt}" ]
do
shift
done
 
# Create a unified source directory.
if [ "x$nolink" == "xfalse" ]
then
if [ -n "${unified_src}" ]
then
if [ ! -d ${unified_src} ]
then
if [ -e ${unified_src} ]
then
echo "${unified_src} is not a directory";
exit 1
fi
mkdir ${unified_src}
fi
fi
cd ${unified_src}
ignore_list=". .. CVS .svn"
for srcdir in ${component_dirs}
do
echo "Component: $srcdir"
case srcdir
in
/* | [A-Za-z]:[\\/]*)
;;
*)
srcdir="${prefix}/${srcdir}"
;;
esac
files=`ls -a ${srcdir}`
for f in ${files}
do
found=
for i in ${ignore_list}
do
if [ "$f" = "$i" ]
then
found=yes
fi
done
if [ -z "${found}" ]
then
echo "$f ..linked"
ln -s ${srcdir}/$f .
fi
done
 
ignore_list="${ignore_list} ${files}"
done
 
if [ $? != 0 ]
then
echo "failed to create ${unified_src}"
exit 1
fi
 
cd ..
fi
 
 
# Configure everything
if [ "x$noconfig" == "xfalse" ]
then
mkdir -p ${build_dir} && cd ${build_dir} && \
../${unified_src}/configure --target=or32-elf \
--with-pkgversion="OpenRISC 32-bit toolchain (built `date +%Y%m%d`)" \
--with-bugurl=http://www.opencores.org/ \
--with-or1ksim=/opt/or1ksim-new \
--with-newlib \
--enable-fast-install=N/A --disable-libssp \
--enable-languages=c --prefix=${install_dir}
 
if [ $? != 0 ]
then
echo "configure failed."
exit 1
fi
 
cd ..
fi
 
# Make everything
cd ${build_dir}
 
make $make_load all-build all-binutils all-gas all-ld all-gcc \
all-target-libgcc all-target-libgloss all-target-newlib all-gdb
 
if [ $? != 0 ]
then
echo "make failed."
exit 1
fi
 
# Install everything
if [ "x$noinstall" == "xfalse" ]
then
make install-binutils install-gas install-ld install-gcc \
install-target-libgcc install-target-libgloss install-target-newlib \
install-gdb
 
if [ $? != 0 ];
then
echo "make install failed."
exit 1
fi
fi
gnu-src/bld.sh Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property

powered by: WebSVN 2.1.0

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