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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sw/] [gcc-script.sh] - Diff between revs 200 and 202

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 200 Rev 202
#!/bin/bash
#!/bin/bash
################################################################################
################################################################################
##
##
## Filename:    gcc-script.sh
## Filename:    gcc-script.sh
##
##
## Project:     Zip CPU -- a small, lightweight, RISC CPU soft core
## Project:     Zip CPU -- a small, lightweight, RISC CPU soft core
##
##
## Purpose:     To handle all of the GCC configuration options properly.  This
## Purpose:     To handle all of the GCC configuration options properly.  This
##              both runs the GCC configure script, as well as initially running
##              both runs the GCC configure script, as well as initially running
##      make on the resulting configured directory.
##      make on the resulting configured directory.
##
##
##
##
## Creator:     Dan Gisselquist, Ph.D.
## Creator:     Dan Gisselquist, Ph.D.
##              Gisselquist Technology, LLC
##              Gisselquist Technology, LLC
##
##
################################################################################
################################################################################
##
##
## Copyright (C) 2016, Gisselquist Technology, LLC
## Copyright (C) 2016, Gisselquist Technology, LLC
##
##
## This program is free software (firmware): you can redistribute it and/or
## This program is free software (firmware): you can redistribute it and/or
## modify it under the terms of  the GNU General Public License as published
## 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
## by the Free Software Foundation, either version 3 of the License, or (at
## your option) any later version.
## your option) any later version.
##
##
## This program is distributed in the hope that it will be useful, but WITHOUT
## This program is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
## for more details.
## for more details.
##
##
## License:     GPL, v3, as defined and found on www.gnu.org,
## License:     GPL, v3, as defined and found on www.gnu.org,
##              http://www.gnu.org/licenses/gpl.html
##              http://www.gnu.org/licenses/gpl.html
##
##
##
##
################################################################################
################################################################################
##
##
##
##
if [[ ! -d gcc-5.3.0-zip ]]
VERSION=gcc-6.2.0
then
ZVERSION=gcc-6.2.0-zip
  tar -xjf ./gcc-5.3.0.tar.bz2 --transform s,gcc-5.3.0,gcc-5.3.0-zip,
# if [[ ! -d $ZVERSION ]]
  cd gcc-5.3.0-zip
# then
  patch -p1 <../gcc-5.3.0-specs-1.patch
  # tar -xjf ./$VERSION.tar.bz2 --transform s,$VERSION,$ZVERSION,
  rm gcc/config/rs6000/sysv4.h.orig
  # if [[ -e ../gcc-zippatch.path ]];
  patch -p1 <../gcc-zippatch.patch
  # then
  cd ..
    # cd gcc-6.2.0-zip
fi
    # patch -p1 <../gcc6-zippatch.patch
 
    # cd ..
uname -a | grep x86 > /dev/null
  # else
if [[ $? != 0 ]]; then
    # echo "No Patch file!"
  echo "This build script only works for x86_64 machines"
    # exit -1;
  echo "You will need to change the CLFS_HOST line if you wish to build"
  # fi
  echo "on any other type of host."
  # if [[ -d build-gcc ]]
  exit 1
  # then
fi
    # # Remove any incomplete build projects from ... possibly other versions
 
    # # This way we can reuse the build directory
 
    # rm -rf build-gcc/
 
  # fi
 
# fi
 
 
set +h
set +h
set -e
set -e
CLFS_HOST="x86_64-cross-linux-gnu"
CLFS_HOST=$MACHTYPE
# CLFS_HOST="arm-unknown-linux-gnueabihf" # For a Raspberry Pi ??
 
CLFS_TARGET="zip"
CLFS_TARGET="zip"
INSTALL_BASE=`pwd`/install
INSTALL_BASE=`pwd`/install
mkdir -p ${INSTALL_BASE}/cross-tools
mkdir -p ${INSTALL_BASE}/cross-tools
mkdir -p ${INSTALL_BASE}/tools/lib
mkdir -p ${INSTALL_BASE}/tools/lib
mkdir -p ${INSTALL_BASE}/usr/include
mkdir -p ${INSTALL_BASE}/usr/include
mkdir -p build-gcc
mkdir -p build-gcc
cd build-gcc
cd build-gcc
 
 
AR_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-ar
 
AS_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-as
AS_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-as
LD_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-ld
AR_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-ar
NM_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-nm
NM_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-nm
OBJCOPY_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-objcopy
LD_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-ld
OBJDUMP_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-objdump
 
READELF_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-readelf
 
STRIP_FOR_TARGET=${INSTALL_BASE}/cross-tools/bin/zip-strip
 
 
 
AS=as AR=ar ../gcc-5.3.0-zip/configure --with-gas      \
../$ZVERSION/configure --with-gas                       \
        --prefix=${INSTALL_BASE}/cross-tools           \
        --prefix=${INSTALL_BASE}/cross-tools           \
        --target=${CLFS_TARGET} --host=${CLFS_HOST}    \
        --target=${CLFS_TARGET}                         \
        --with-pkgversion=zip-gcc-`date +%y%m%d`       \
        --with-pkgversion=zip-gcc-`date +%y%m%d`       \
        --disable-shared --disable-multilib            \
        --disable-multilib                              \
        --disable-threads --disable-tls                \
        --disable-threads --disable-tls                \
        --disable-libada --disable-libsanitizer        \
 
        --disable-libssp --disable-libquadmath         \
 
        --disable-libgomp --disable-libvtv             \
 
        --enable-checking --disable-nls                \
        --enable-checking --disable-nls                \
        --disable-sjlj-exceptions                      \
        --without-fp --with-newlib
        --disable-decimal-float --disable-fixed-point  \
 
        --disable-lto --disable-canonical-system-headers
 
 
 
echo $PATH | grep ${INSTALL_BASE}/cross-tools/bin \
echo $PATH | grep ${INSTALL_BASE}/cross-tools/bin \
        || PATH=$PATH:${INSTALL_BASE}/cross-tools/bin
        || export PATH=$PATH:${INSTALL_BASE}/cross-tools/bin
make $* || true
 
cd gcc; make $* || true
 
cd ../; make $* all-libcc1 || true
 
cd libcc1; make $* || true
 
cd ../gcc; make $* || true
 
make $* install || true
 
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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