URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/or1k
- from Rev 1775 to Rev 1776
- ↔ Reverse comparison
Rev 1775 → Rev 1776
/trunk/toolchain_script/MOF_ORSOC_TCHN_v5a_or32-elf.sh
652,7 → 652,7
|
cd $BUILD_TOP |
cd b-gcc |
$BUILD_TOP/$GCC_VER/configure --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --with-local-prefix=$INSTALL_DIR/$TARGET/or32-uclinux --with-gnu-as --with-gnu-ld --disable-libssp --enable-languages=c |
$BUILD_TOP/$GCC_VER/configure --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --with-local-prefix=$INSTALL_DIR/$TARGET/$TARGET --with-gnu-as --with-gnu-ld --disable-libssp --enable-languages=c |
make all install |
|
## Make sure that built ok ## |
/trunk/toolchain_script/MOF_ORSOC_TCHN_v5b_or32-elf.sh
68,6 → 68,8
# - Changed the link in the error output to the new OpenCores forum. |
# 210409 - Changed linux kernel and uClibc patch versions to latest |
# - Changed output to all be piped to appropriate files, makes things neater |
# 260409 - Added Cygwin exports section |
# - Hopefully now runs on Cygwin with new patch for uClibc |
|
# TODO: OS X build things - need an "elf.h" from some Linux machine's |
# /usr/local/include dir and put in Mac's /usr/local/include dir - |
156,7 → 158,7
BINUTILS_PATCH="$BINUTILS_VER.or32_fixed_patch-v2.0.bz2" |
GCC_PATCH=$GCC_VER.or32patch.bz2 |
LINUX_PATCH="linux_2.6.24_or32_unified_v2.2.bz2" ## New version, changed rgd_dot_config in root, changed or1ksim config file name and contents## |
UCLIBC_PATCH="uClibc-0.9.29-or32-patch-1.0.bz2" |
UCLIBC_PATCH="uClibc-0.9.29-or32-patch-1.1.bz2" |
GDB_PATCH="or32-gdb-6.8-patch-2.4.bz2" |
|
## MD5sum file ## |
212,6 → 214,17
|
|
|
## Check if we've been given the debug mode flag ## |
## We won't clear away all the directories if run with the -d or -D options ## |
DBG_BUILD=0 |
while getopts d OPT; do |
case "$OPT" in |
d) |
DBG_BUILD=1 |
;; |
esac |
done |
|
##Welcome message |
echo |
echo "The OpenRISC toolchain install script - Provided by ORSoC & MeansOfFreedom.net" |
331,77 → 344,111
|
#################################################################################################### |
## Now check which sources have already been downloaded, if any ## |
DO_DOWNLOADS="y" ## Default is to do downloads |
|
## Check if download directory exists, if not create it ## |
if [ -d $DOWNLOAD_DIR ] |
if [ $DBG_BUILD -eq 1 ] |
then |
cd $DOWNLOAD_DIR |
else |
mkdir $DOWNLOAD_DIR |
cd $DOWNLOAD_DIR |
## Ask if we should do downloads ## |
echo "Do downloads?" |
echo "[y/N]:" |
read DO_DOWNLOADS |
## $YN will be zero length string if user just pressed enter ## |
if [ -z $DO_DOWNLOADS ] |
then |
DO_DOWNLOADS="n" |
else |
DO_DOWNLOADS=$(echo $YN | tr [:upper:] [:lower:]) |
fi |
|
fi |
|
if [ $DO_DOWNLOADS = "y" ] |
then |
## Check if download directory exists, if not create it ## |
if [ -d $DOWNLOAD_DIR ] |
then |
cd $DOWNLOAD_DIR |
else |
mkdir $DOWNLOAD_DIR |
cd $DOWNLOAD_DIR |
fi |
|
## We'll need the md5sum file ## |
## This is a file stored on the ORSoC FTP server, containing checksums of all the files we need ## |
rm -f $MD5SUM_FILE |
wget ftp://$ORSOC_FTP_USER:$ORSOC_FTP_PASSWD@$ORSOC_FTP_HOST/$ORSOC_FTP_DIR/$MD5SUM_FILE |
rm -f $MD5SUM_FILE |
wget ftp://$ORSOC_FTP_USER:$ORSOC_FTP_PASSWD@$ORSOC_FTP_HOST/$ORSOC_FTP_DIR/$MD5SUM_FILE |
## Make sure we got that OK ## |
check_exit_code |
|
check_exit_code |
|
## We have lists of what to get from each FTP let's create a loop for each ## |
|
|
## ORSoC FTP server downloads ## |
for CURRENT_FILE in $ORSOC_FTP_FILE_LIST |
do |
for CURRENT_FILE in $ORSOC_FTP_FILE_LIST |
do |
# Check if we've already got the file |
if [ -e $CURRENT_FILE ] |
then |
echo "File $CURRENT_FILE exists locally." |
echo "Verifying MD5 checksum:" |
if [ -e $CURRENT_FILE ] |
then |
echo "File $CURRENT_FILE exists locally." |
echo "Verifying MD5 checksum:" |
## Verify it's right by checking the MD5 checksum ## |
## First we get the line for $CURRENT_FILE out of the $MD5SUM_FILE, then feed it to "md5sum -c" |
## which checks it and sets the return code, $? to 0 if OK, 1 if problem ## |
cat $MD5SUM_FILE | grep $CURRENT_FILE | md5sum -c |
if [ $? -ne 0 ] |
then |
cat $MD5SUM_FILE | grep $CURRENT_FILE | md5sum -c |
if [ $? -ne 0 ] |
then |
#MD5sum of $CURRENT_FILE differs from expected value - we'll download it again |
echo "MD5 checksum of $CURRENT_FILE differs from expected value. Re-downloading." |
rm -f $CURRENT_FILE |
echo "MD5 checksum of $CURRENT_FILE differs from expected value. Re-downloading." |
rm -f $CURRENT_FILE |
wget ftp://$ORSOC_FTP_USER:$ORSOC_FTP_PASSWD@$ORSOC_FTP_HOST/$ORSOC_FTP_DIR/$CURRENT_FILE |
check_exit_code |
fi |
else |
# File doesn't exist locally - we'll download it |
echo "Downloading $CURRENT_FILE" |
wget ftp://$ORSOC_FTP_USER:$ORSOC_FTP_PASSWD@$ORSOC_FTP_HOST/$ORSOC_FTP_DIR/$CURRENT_FILE |
check_exit_code |
fi |
else |
# File doesn't exist locally - we'll download it |
echo "Downloading $CURRENT_FILE" |
wget ftp://$ORSOC_FTP_USER:$ORSOC_FTP_PASSWD@$ORSOC_FTP_HOST/$ORSOC_FTP_DIR/$CURRENT_FILE |
check_exit_code |
fi |
echo |
done |
|
echo |
done |
|
## GNU FTP server downloads ## |
for CURRENT_FILE in $GNU_FTP_FILE_LIST |
do |
for CURRENT_FILE in $GNU_FTP_FILE_LIST |
do |
## Check if we've already got the file ## |
if [ -e $CURRENT_FILE ] |
then |
echo "File $CURRENT_FILE exists locally." |
echo "Verifying MD5 checksum:" |
if [ -e $CURRENT_FILE ] |
then |
echo "File $CURRENT_FILE exists locally." |
echo "Verifying MD5 checksum:" |
## Verify it's right by checking the MD5 checksum ## |
## First we get the line for $CURRENT_FILE out of the $MD5SUM_FILE, then feed it to "md5sum -c" |
## which checks it and sets the return code, $? to 0 if OK, 1 if problem ## |
cat $MD5SUM_FILE | grep $CURRENT_FILE | md5sum -c |
if [ $? -ne 0 ] |
then |
cat $MD5SUM_FILE | grep $CURRENT_FILE | md5sum -c |
if [ $? -ne 0 ] |
then |
## MD5sum of present one is incorrect - we'll download it again ## |
echo "MD5 checksum of $CURRENT_FILE differs from expected value. Re-downloading." |
rm -f $CURRENT_FILE |
echo "MD5 checksum of $CURRENT_FILE differs from expected value. Re-downloading." |
rm -f $CURRENT_FILE |
## Depending on the file, we need a specific path ## |
## gcc's path on ftp ## |
if [ $CURRENT_FILE = $ZBALL2 ]; then |
GNU_FTP_DIR=$GNU_FTP_GCC_DIR |
fi |
## gdb's path on ftp ## |
if [ $CURRENT_FILE = $ZBALL8 ]; then |
GNU_FTP_DIR=$GNU_FTP_GDB_DIR |
fi |
wget ftp://$GNU_FTP_USER:$GNU_FTP_USER@$GNU_FTP_HOST/$GNU_FTP_DIR/$CURRENT_FILE |
check_exit_code |
fi |
else |
# File doesn't exist - we'll download it |
echo "Downloading $CURRENT_FILE" |
## Depending on the file, we need a specific path ## |
## gcc's path on ftp ## |
if [ $CURRENT_FILE = $ZBALL2 ]; then |
GNU_FTP_DIR=$GNU_FTP_GCC_DIR |
fi |
## gdb's path on ftp ## |
## gdb's path on ftp ## |
if [ $CURRENT_FILE = $ZBALL8 ]; then |
GNU_FTP_DIR=$GNU_FTP_GDB_DIR |
fi |
408,73 → 455,54
wget ftp://$GNU_FTP_USER:$GNU_FTP_USER@$GNU_FTP_HOST/$GNU_FTP_DIR/$CURRENT_FILE |
check_exit_code |
fi |
else |
# File doesn't exist - we'll download it |
echo "Downloading $CURRENT_FILE" |
## Depending on the file, we need a specific path ## |
## gcc's path on ftp ## |
if [ $CURRENT_FILE = $ZBALL2 ]; then |
GNU_FTP_DIR=$GNU_FTP_GCC_DIR |
fi |
## gdb's path on ftp ## |
if [ $CURRENT_FILE = $ZBALL8 ]; then |
GNU_FTP_DIR=$GNU_FTP_GDB_DIR |
fi |
wget ftp://$GNU_FTP_USER:$GNU_FTP_USER@$GNU_FTP_HOST/$GNU_FTP_DIR/$CURRENT_FILE |
check_exit_code |
fi |
echo |
done |
|
echo |
done |
|
## Kernel.org FTP server downloads ## |
CURRENT_FILE=$KERNEL_FTP_FILE_LIST |
CURRENT_FILE=$KERNEL_FTP_FILE_LIST |
## Usually just a single file from the kernel.org ftp site ## |
if [ -e $CURRENT_FILE ] |
if [ -e $CURRENT_FILE ] |
then |
echo "File $CURRENT_FILE exists locally." |
echo "Verifying MD5 checksum:" |
echo "File $CURRENT_FILE exists locally." |
echo "Verifying MD5 checksum:" |
## Verify it's right by checking the MD5 checksum ## |
## First we get the line for $CURRENT_FILE out of the $MD5SUM_FILE, then feed it to "md5sum -c" |
## which checks it and sets the return code, $? to 0 if OK, 1 if problem ## |
cat $MD5SUM_FILE | grep $CURRENT_FILE | md5sum -c |
if [ $? -ne 0 ] |
then |
cat $MD5SUM_FILE | grep $CURRENT_FILE | md5sum -c |
if [ $? -ne 0 ] |
then |
#MD5sum of present one is incorrect - we'll download it again |
echo "MD5 checksum of $CURRENT_FILE differs from expected value. Re-downloading." |
rm -f $CURRENT_FILE |
wget ftp://$KERNEL_FTP_USER:$KERNEL_FTP_USER@$KERNEL_FTP_HOST/$KERNEL_FTP_DIR/$CURRENT_FILE |
check_exit_code |
fi |
else |
echo "MD5 checksum of $CURRENT_FILE differs from expected value. Re-downloading." |
rm -f $CURRENT_FILE |
wget ftp://$KERNEL_FTP_USER:$KERNEL_FTP_USER@$KERNEL_FTP_HOST/$KERNEL_FTP_DIR/$CURRENT_FILE |
check_exit_code |
fi |
else |
## Download it ## |
echo "Downloading $CURRENT_FILE" |
wget ftp://$KERNEL_FTP_USER:$KERNEL_FTP_PASSWD@$KERNEL_FTP_HOST/$KERNEL_FTP_DIR/$CURRENT_FILE |
echo "Downloading $CURRENT_FILE" |
wget ftp://$KERNEL_FTP_USER:$KERNEL_FTP_PASSWD@$KERNEL_FTP_HOST/$KERNEL_FTP_DIR/$CURRENT_FILE |
check_exit_code |
fi |
fi |
|
echo |
|
fi # if [ $DO_DOWNLOADS = "y" ] |
|
#################################################################################################### |
|
cd $START_DIR |
## Cygwin exports ## |
ON_CYGWIN=`set | grep -i mach|grep -i -c cygwin` |
if [ $ON_CYGWIN -ge 1 ] |
then |
echo |
echo "Cygwin host exports:" |
echo "export HOST_LOADLIBES=\"-lcurses -lintl\" " |
echo |
export HOST_LOADLIBES="-lcurses -lintl" |
fi |
|
#if [ 0 eq 1 ] ## DEBUG skipping thing ## |
#then |
##Stuff you want to skip in here |
#else ## DEBUG else |
#cd $BUILD_TOP |
#export PATH=$BUILD_TOP/tools/or32-uclinux/bin:$PATH |
#fi ## DEBUG skipping end |
#################################################################################################### |
|
## A couple of command line options to help if this thing breaks ## |
## We won't clear away all the directories if run with the -d or -D options ## |
DBG_BUILD=0 |
while getopts d OPT; do |
case "$OPT" in |
d) |
DBG_BUILD=1 |
;; |
esac |
done |
cd $START_DIR |
|
## if not debug building, let's remove all the old stuff ## |
|
663,9 → 691,9
|
# configure GCC |
echo |
echo "Configuring $GCC_VER: --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --with-local-prefix=$INSTALL_DIR/$TARGET/or32-uclinux --with-gnu-as --with-gnu-ld --disable-libssp --enable-languages=c" |
echo "Configuring $GCC_VER: --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --with-local-prefix=$INSTALL_DIR/$TARGET/$TARGET --with-gnu-as --with-gnu-ld --disable-libssp --enable-languages=c" |
echo "Logging output to $GCC_VER-configure.log" |
$BUILD_TOP/$GCC_VER/configure --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --with-local-prefix=$INSTALL_DIR/$TARGET/or32-uclinux --with-gnu-as --with-gnu-ld --disable-libssp --enable-languages=c > $GCC_VER-configure.log 2>&1 |
$BUILD_TOP/$GCC_VER/configure --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --with-local-prefix=$INSTALL_DIR/$TARGET/$TARGET --with-gnu-as --with-gnu-ld --disable-libssp --enable-languages=c > $GCC_VER-configure.log 2>&1 |
|
echo |
echo "Making and installing $GCC_VER" |
763,8 → 791,9
|
echo |
echo "Making uClibc oldconfig" |
make oldconfig > $UCLIB_VER-make-oldconfig.log 2>&1 |
|
HOST_LOADLIBES="-lcurses -lintl" HOSTCC=`which gcc` make oldconfig > $UCLIB_VER-make-oldconfig.log 2>&1 |
|
## Make sure that built ok ## |
check_exit_code |
|
995,25 → 1024,30
|
bunzip2 $RAMDISK_FILE.bz2 |
|
RT=`whoami` |
if [ $RT = "root" ];then |
mkdir rd_mount |
chmod 777 rd_mount |
mount -t ext2 -o loop $RAMDISK_FILE rd_mount |
cp -f -dR $BUILD_TOP/busy_out.1.7.5/* $BUILD_TOP/rd_mount |
umount rd_mount |
cp -f $RAMDISK_FILE $LINUX_VER/$LINUX_RAMDISK_FILE |
else |
echo |
echo "User is not root. Unable to mount Linux ramdisk." |
echo "Note that this program built BusyBox but did not" |
echo "install it on the ramdisk. Defaults are used." |
cp -f $RAMDISK_FILE $LINUX_VER/$LINUX_RAMDISK_FILE |
fi |
## We can only play with the ext2 image if we're not on Cygwin ## |
if [ -z $ON_CYGWIN ] |
then |
|
RT=`whoami` |
if [ $RT = "root" ];then |
mkdir rd_mount |
chmod 777 rd_mount |
mount -t ext2 -o loop $RAMDISK_FILE rd_mount |
cp -f -dR $BUILD_TOP/busy_out.1.7.5/* $BUILD_TOP/rd_mount |
umount rd_mount |
cp -f $RAMDISK_FILE $LINUX_VER/$LINUX_RAMDISK_FILE |
else |
echo |
echo "User is not root. Unable to mount Linux ramdisk." |
echo "Note that this program built BusyBox but did not" |
echo "install it on the ramdisk. Defaults are used." |
cp -f $RAMDISK_FILE $LINUX_VER/$LINUX_RAMDISK_FILE |
fi |
|
fi ## if [ -z $ON_CYGWIN ] |
|
cd $BUILD_TOP |
fi |
##########################finish Building Busybox######################## |
|
########################## Finish BusyBox build ################ |
|
1059,7 → 1093,6
fi |
##########################Finished Final Linux kernel build################ |
|
## default build option is yes ## |
BUILD_THIS="y" |
|
if [ $DBG_BUILD -eq 1 ] |
1084,8 → 1117,6
fi |
|
|
#echo "Start Building Simulator?" |
#read Q |
##########################Simulator build######################### |
if [ $BUILD_THIS = "y" ] |
then |