Line 66... |
Line 66... |
# the preceeding "function" as this isn't valid in sh, and the new way
|
# the preceeding "function" as this isn't valid in sh, and the new way
|
# appears to be valid in bash.
|
# appears to be valid in bash.
|
# - Changed the link in the error output to the new OpenCores forum.
|
# - Changed the link in the error output to the new OpenCores forum.
|
# 210409 - Changed linux kernel and uClibc patch versions to latest
|
# 210409 - Changed linux kernel and uClibc patch versions to latest
|
# - Changed output to all be piped to appropriate files, makes things neater
|
# - 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
|
# 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 -
|
# /usr/local/include dir and put in Mac's /usr/local/include dir -
|
# this solves issue with Linux compilation
|
# this solves issue with Linux compilation
|
# TODO: OS X build things - add HOST_LOADLIBES="lintl" to make line of uClibc
|
# TODO: OS X build things - add HOST_LOADLIBES="lintl" to make line of uClibc
|
Line 154... |
Line 156... |
|
|
## Patches ##
|
## Patches ##
|
BINUTILS_PATCH="$BINUTILS_VER.or32_fixed_patch-v2.0.bz2"
|
BINUTILS_PATCH="$BINUTILS_VER.or32_fixed_patch-v2.0.bz2"
|
GCC_PATCH=$GCC_VER.or32patch.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##
|
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"
|
GDB_PATCH="or32-gdb-6.8-patch-2.4.bz2"
|
|
|
## MD5sum file ##
|
## MD5sum file ##
|
MD5SUM_FILE=md5sums
|
MD5SUM_FILE=md5sums
|
|
|
Line 210... |
Line 212... |
|
|
KERNEL_FTP_FILE_LIST=$ZBALL4
|
KERNEL_FTP_FILE_LIST=$ZBALL4
|
|
|
|
|
|
|
|
## 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
|
##Welcome message
|
echo
|
echo
|
echo "The OpenRISC toolchain install script - Provided by ORSoC & MeansOfFreedom.net"
|
echo "The OpenRISC toolchain install script - Provided by ORSoC & MeansOfFreedom.net"
|
echo "Version $SCRIPT_VERSION"
|
echo "Version $SCRIPT_VERSION"
|
echo
|
echo
|
Line 329... |
Line 342... |
|
|
mkdir $INSTALL_DIR
|
mkdir $INSTALL_DIR
|
|
|
####################################################################################################
|
####################################################################################################
|
## Now check which sources have already been downloaded, if any ##
|
## Now check which sources have already been downloaded, if any ##
|
|
DO_DOWNLOADS="y" ## Default is to do downloads
|
|
|
|
if [ $DBG_BUILD -eq 1 ]
|
|
then
|
|
## 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 ##
|
## Check if download directory exists, if not create it ##
|
if [ -d $DOWNLOAD_DIR ]
|
if [ -d $DOWNLOAD_DIR ]
|
then
|
then
|
cd $DOWNLOAD_DIR
|
cd $DOWNLOAD_DIR
|
else
|
else
|
Line 449... |
Line 481... |
## Download it ##
|
## Download it ##
|
echo "Downloading $CURRENT_FILE"
|
echo "Downloading $CURRENT_FILE"
|
wget ftp://$KERNEL_FTP_USER:$KERNEL_FTP_PASSWD@$KERNEL_FTP_HOST/$KERNEL_FTP_DIR/$CURRENT_FILE
|
wget ftp://$KERNEL_FTP_USER:$KERNEL_FTP_PASSWD@$KERNEL_FTP_HOST/$KERNEL_FTP_DIR/$CURRENT_FILE
|
check_exit_code
|
check_exit_code
|
fi
|
fi
|
|
|
echo
|
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 ##
|
cd $START_DIR
|
## 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
|
|
|
|
## if not debug building, let's remove all the old stuff ##
|
## if not debug building, let's remove all the old stuff ##
|
|
|
if [ $DBG_BUILD -eq 0 ]
|
if [ $DBG_BUILD -eq 0 ]
|
then
|
then
|
Line 661... |
Line 689... |
cd $BUILD_TOP
|
cd $BUILD_TOP
|
cd b-gcc
|
cd b-gcc
|
|
|
# configure GCC
|
# configure GCC
|
echo
|
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"
|
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
|
echo "Making and installing $GCC_VER"
|
echo "Making and installing $GCC_VER"
|
echo "Logging output to $GCC_VER-make.log"
|
echo "Logging output to $GCC_VER-make.log"
|
make all install > $GCC_VER-make.log 2>&1
|
make all install > $GCC_VER-make.log 2>&1
|
Line 761... |
Line 789... |
sed "s/or32\-uclinux/\or32\-$TARGET_SECOND_PART/" $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32 > $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32.newtarget
|
sed "s/or32\-uclinux/\or32\-$TARGET_SECOND_PART/" $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32 > $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32.newtarget
|
mv $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32.newtarget $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32
|
mv $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32.newtarget $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32
|
|
|
echo
|
echo
|
echo "Making uClibc oldconfig"
|
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 ##
|
## Make sure that built ok ##
|
check_exit_code
|
check_exit_code
|
|
|
ln -s extra/Configs/Config.or32 Config
|
ln -s extra/Configs/Config.or32 Config
|
Line 993... |
Line 1022... |
|
|
cp $DOWNLOAD_DIR/$ZBALL7 . ## Ramdisk file ##
|
cp $DOWNLOAD_DIR/$ZBALL7 . ## Ramdisk file ##
|
|
|
bunzip2 $RAMDISK_FILE.bz2
|
bunzip2 $RAMDISK_FILE.bz2
|
|
|
|
## We can only play with the ext2 image if we're not on Cygwin ##
|
|
if [ -z $ON_CYGWIN ]
|
|
then
|
|
|
RT=`whoami`
|
RT=`whoami`
|
if [ $RT = "root" ];then
|
if [ $RT = "root" ];then
|
mkdir rd_mount
|
mkdir rd_mount
|
chmod 777 rd_mount
|
chmod 777 rd_mount
|
mount -t ext2 -o loop $RAMDISK_FILE rd_mount
|
mount -t ext2 -o loop $RAMDISK_FILE rd_mount
|
Line 1009... |
Line 1042... |
echo "Note that this program built BusyBox but did not"
|
echo "Note that this program built BusyBox but did not"
|
echo "install it on the ramdisk. Defaults are used."
|
echo "install it on the ramdisk. Defaults are used."
|
cp -f $RAMDISK_FILE $LINUX_VER/$LINUX_RAMDISK_FILE
|
cp -f $RAMDISK_FILE $LINUX_VER/$LINUX_RAMDISK_FILE
|
fi
|
fi
|
|
|
|
fi ## if [ -z $ON_CYGWIN ]
|
|
|
cd $BUILD_TOP
|
cd $BUILD_TOP
|
fi
|
fi
|
##########################finish Building Busybox########################
|
|
|
|
########################## Finish BusyBox build ################
|
########################## Finish BusyBox build ################
|
|
|
## default build option is yes ##
|
## default build option is yes ##
|
BUILD_THIS="y"
|
BUILD_THIS="y"
|
Line 1057... |
Line 1091... |
|
|
cd $BUILD_TOP
|
cd $BUILD_TOP
|
fi
|
fi
|
##########################Finished Final Linux kernel build################
|
##########################Finished Final Linux kernel build################
|
|
|
## default build option is yes ##
|
|
BUILD_THIS="y"
|
BUILD_THIS="y"
|
|
|
if [ $DBG_BUILD -eq 1 ]
|
if [ $DBG_BUILD -eq 1 ]
|
then
|
then
|
## Ask if we should rebuild or1ksim##
|
## Ask if we should rebuild or1ksim##
|
Line 1082... |
Line 1115... |
rm -rf $BUILD_TOP/$SIM_VER
|
rm -rf $BUILD_TOP/$SIM_VER
|
fi
|
fi
|
fi
|
fi
|
|
|
|
|
#echo "Start Building Simulator?"
|
|
#read Q
|
|
##########################Simulator build#########################
|
##########################Simulator build#########################
|
if [ $BUILD_THIS = "y" ]
|
if [ $BUILD_THIS = "y" ]
|
then
|
then
|
|
|
echo
|
echo
|