forked from ZipCPU/zipcpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gas-script.sh
83 lines (79 loc) · 2.1 KB
/
gas-script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
################################################################################
##
## Filename: gas-script.sh
## {{{
## Project: Zip CPU -- a small, lightweight, RISC CPU soft core
##
## Purpose: To configure binutils to properly build the binutils portion of
## the ZipCPU toolchain.
##
## Creator: Dan Gisselquist, Ph.D.
## Gisselquist Technology, LLC
##
################################################################################
## }}}
## Copyright (C) 2016-2021, Gisselquist Technology, LLC
## {{{
## 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
## 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 MERCHANTIBILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
## for more details.
##
## License: GPL, v3, as defined and found on www.gnu.org,
## http://www.gnu.org/licenses/gpl.html
##
##
################################################################################
##
## }}}
VERSION=binutils-2.27
## Patch the original version
## {{{
if [[ ! -d $VERSION-zip/ ]]
then
tar -xjf ./$VERSION.tar.bz2 --transform s,$VERSION,$VERSION-zip,
if [[ -e gas-zippatch.patch ]]
then
cd $VERSION-zip
patch -p1 <../gas-zippatch.patch
cd ..
else
echo "ZipCPU binutils patch not found"
fi
fi
## }}}
## Set up a install directory
## {{{
set +h
set -e
CLFS_HOST=$MACHTYPE
CLFS_TARGET="zip"
if [[ -z "$INSTALLD" ]]
then
INSTALLD=`pwd`/install
fi
INSTALL_BASE=${INSTALLD}
mkdir -p ${INSTALL_BASE}/cross-tools
## }}}
## Setup a build directory
## {{{
mkdir -p build-gas
echo ../$VERSION-zip/configure
cd build-gas
## }}}
## Configure binutils
## {{{
AR=ar AS=as \
../$VERSION-zip/configure --with-gas \
--prefix=${INSTALL_BASE}/cross-tools \
--target=${CLFS_TARGET} \
--disable-nls --disable-multilib \
--enable-plugins --enable-threads \
--disable-werror
## }}}