Lines 2-8
Link Here
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/dev-embedded/tigcc/tigcc-0.96_beta8.ebuild,v 1.3 2012/04/30 02:54:59 vapier Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/dev-embedded/tigcc/tigcc-0.96_beta8.ebuild,v 1.3 2012/04/30 02:54:59 vapier Exp $ |
4 |
|
4 |
|
5 |
inherit eutils |
5 |
EAPI=4 |
|
|
6 |
|
7 |
inherit eutils toolchain-funcs |
6 |
|
8 |
|
7 |
BASE_BINUTILS="2.16.1" |
9 |
BASE_BINUTILS="2.16.1" |
8 |
GCC_VER="4.1.2" |
10 |
GCC_VER="4.1.2" |
Lines 38-103
Link Here
|
38 |
|
40 |
|
39 |
S=${WORKDIR} |
41 |
S=${WORKDIR} |
40 |
|
42 |
|
41 |
src_unpack() { |
43 |
src_prepare() { |
42 |
unpack ${A} |
|
|
43 |
|
44 |
# start by patching and cleaning out binutils and gcc directories. |
44 |
# start by patching and cleaning out binutils and gcc directories. |
45 |
cd "${WORKDIR}"/binutils-${BASE_BINUTILS} |
45 |
cd "${WORKDIR}"/binutils-${BASE_BINUTILS} || die |
46 |
epatch "${S}"/sources/gcc/gas-${BIN_VER}-tigcc-*.diff |
46 |
epatch "${S}"/sources/gcc/gas-${BIN_VER}-tigcc-*.diff |
47 |
|
47 |
|
48 |
rm -f .brik |
48 |
for i in .brik md5.sum INSTALL maintainer-scripts binutils cpu etc gas/doc gas/po gprof include/nlm include/regs ld texinfo |
49 |
rm -f md5.sum |
49 |
do |
50 |
rm -f -r INSTALL |
50 |
rm -fr "${i}" |
51 |
rm -f -r maintainer-scripts |
51 |
done |
52 |
rm -f -r binutils |
|
|
53 |
rm -f -r cpu |
54 |
rm -f -r etc |
55 |
rm -f -r gas/doc |
56 |
rm -f -r gas/po |
57 |
rm -f -r gprof |
58 |
rm -f -r include/nlm |
59 |
rm -f -r include/regs |
60 |
rm -f -r ld |
61 |
rm -f -r texinfo |
62 |
|
52 |
|
63 |
cd "${WORKDIR}"/gcc-4.1-${GCC_SNAPSHOT} |
53 |
cd "${WORKDIR}"/gcc-4.1-${GCC_SNAPSHOT} || die |
64 |
epatch "${S}"/sources/gcc/gcc-4.1-tigcc-patch.diff |
54 |
epatch "${S}"/sources/gcc/gcc-4.1-tigcc-patch.diff |
65 |
|
55 |
|
66 |
rm -f .brik |
56 |
for i in .brik md5.sum INSTALL fixincludes gcc/ginclude gcc/po gcc/doc gcc/treelang libcpp/po maintainer-scripts etc gprof include/nlm include/regs texinfo |
67 |
rm -f md5.sum |
57 |
do |
68 |
rm -f -r INSTALL |
58 |
rm -fr "${i}" |
69 |
rm -f -r fixincludes |
59 |
done |
70 |
rm -f -r gcc/ginclude |
|
|
71 |
rm -f -r gcc/po |
72 |
rm -f -r gcc/doc |
73 |
rm -f -r gcc/treelang |
74 |
rm -f -r libcpp/po |
75 |
rm -f -r maintainer-scripts |
76 |
rm -f -r etc |
77 |
rm -f -r gprof |
78 |
rm -f -r include/nlm |
79 |
rm -f -r include/regs |
80 |
rm -f -r texinfo |
81 |
|
60 |
|
82 |
# create build directories for binutils and gcc |
61 |
# create build directories for binutils and gcc |
83 |
mkdir -p "${WORKDIR}"/build/binutils |
62 |
mkdir -p "${WORKDIR}"/build/binutils || die |
84 |
mkdir "${WORKDIR}"/build/gcc |
63 |
mkdir "${WORKDIR}"/build/gcc || die |
85 |
|
64 |
|
86 |
# Workaround for non-existing directories |
65 |
# Workaround for non-existing directories |
87 |
sed -ie '/SUBDIRS =/d' "${WORKDIR}"/binutils-${BASE_BINUTILS}/gas/Makefile.in |
66 |
sed -ie '/SUBDIRS =/d' "${WORKDIR}"/binutils-${BASE_BINUTILS}/gas/Makefile.in || die |
|
|
67 |
tc-export CC AR RANLIB |
88 |
} |
68 |
} |
89 |
|
69 |
|
90 |
src_compile() { |
70 |
src_compile() { |
91 |
# build binutils |
71 |
# build binutils |
92 |
cd "${WORKDIR}"/build/binutils |
72 |
cd "${WORKDIR}"/build/binutils || die |
93 |
CFLAGS="${CFLAGS}" "${WORKDIR}"/binutils-${BASE_BINUTILS}/configure \ |
73 |
CFLAGS="${CFLAGS}" "${WORKDIR}"/binutils-${BASE_BINUTILS}/configure \ |
94 |
--disable-serial-configure --target=m68k-coff --disable-shared \ |
74 |
--disable-serial-configure --target=m68k-coff --disable-shared \ |
95 |
--enable-static --disable-multilib --disable-nls \ |
75 |
--enable-static --disable-multilib --disable-nls \ |
96 |
|| die |
76 |
|| die |
97 |
emake || die "gas" |
77 |
emake |
98 |
|
78 |
|
99 |
# build gcc |
79 |
# build gcc |
100 |
cd "${WORKDIR}"/build/gcc |
80 |
cd "${WORKDIR}"/build/gcc || die |
101 |
CFLAGS="${CFLAGS}" "${WORKDIR}"/gcc-4.1-${GCC_SNAPSHOT}/configure --target=m68k-coff \ |
81 |
CFLAGS="${CFLAGS}" "${WORKDIR}"/gcc-4.1-${GCC_SNAPSHOT}/configure --target=m68k-coff \ |
102 |
--with-gnu-as --with-as="${WORKDIR}"/build/binutils/gas/as-new --with-gnu-ld \ |
82 |
--with-gnu-as --with-as="${WORKDIR}"/build/binutils/gas/as-new --with-gnu-ld \ |
103 |
--disable-nls --disable-multilib --disable-shared --enable-static \ |
83 |
--disable-nls --disable-multilib --disable-shared --enable-static \ |
Lines 107-137
Link Here
|
107 |
|
87 |
|
108 |
# GCC compilations _is intended_ to fail on a certain point, |
88 |
# GCC compilations _is intended_ to fail on a certain point, |
109 |
# don't worry about that. |
89 |
# don't worry about that. |
110 |
emake -j1 |
90 |
nonfatal emake -j1 |
111 |
|
91 |
|
112 |
# Check if gcc has been built, die otherwise |
92 |
# Check if gcc has been built, die otherwise |
113 |
( [ -e "${WORKDIR}"/build/gcc/gcc/xgcc ] && [ -e "${WORKDIR}"/build/gcc/gcc/cc1 ] ) || die "gcc" |
93 |
( [ -e "${WORKDIR}"/build/gcc/gcc/xgcc ] && [ -e "${WORKDIR}"/build/gcc/gcc/cc1 ] ) || die "gcc" |
114 |
|
94 |
|
115 |
# build a68k assembler |
95 |
for i in a68k ld-tigcc tigcc/src tprbuilder/src patcher/src |
116 |
cd "${S}"/sources/a68k |
96 |
do |
117 |
emake -e || die "a68k" |
97 |
cd "${S}"/sources/${i} || die |
118 |
|
98 |
emake -e |
119 |
# build ld-tigcc linker |
99 |
done |
120 |
cd "${S}"/sources/ld-tigcc |
|
|
121 |
emake -e || die "ld-tigcc" |
122 |
|
123 |
# build tigcc front-end |
124 |
cd "${S}"/sources/tigcc/src |
125 |
emake -e || die "tigcc" |
126 |
|
127 |
# build tprbuilder (TIGCC project builder) |
128 |
cd "${S}"/sources/tprbuilder/src |
129 |
emake -e || die "tprbuilder" |
130 |
|
131 |
# build patcher (object file patcher) |
132 |
cd "${S}"/sources/patcher/src |
133 |
emake -e || die "patcher" |
134 |
|
135 |
} |
100 |
} |
136 |
|
101 |
|
137 |
src_install() { |
102 |
src_install() { |
Lines 145-155
Link Here
|
145 |
"${S}"/tigcclib/doc/converter/tigccdoc \ |
110 |
"${S}"/tigcclib/doc/converter/tigccdoc \ |
146 |
> "${S}"/tigcclib/doc/converter/tigccdoc.new |
111 |
> "${S}"/tigcclib/doc/converter/tigccdoc.new |
147 |
|
112 |
|
148 |
cd "${S}"/tigcclib/doc/converter |
113 |
cd "${S}"/tigcclib/doc/converter || die |
149 |
newbin tigccdoc.new tigccdoc |
114 |
newbin tigccdoc.new tigccdoc |
150 |
cd "${S}"/tigcclib/doc |
115 |
cd "${S}"/tigcclib/doc || die |
151 |
dohtml -r html/* |
116 |
dohtml -r html/* |
152 |
cp html/qt-assistant.adp "${D}"/usr/share/doc/${PF}/html |
117 |
cp html/qt-assistant.adp "${D}"/usr/share/doc/${PF}/html || die |
153 |
|
118 |
|
154 |
cd "${S}"/sources/a68k |
119 |
cd "${S}"/sources/a68k |
155 |
fi |
120 |
fi |
Lines 158-179
Link Here
|
158 |
cd "${S}" |
123 |
cd "${S}" |
159 |
dodoc AUTHORS BUGS CHANGELOG DIRECTORIES HOWTO \ |
124 |
dodoc AUTHORS BUGS CHANGELOG DIRECTORIES HOWTO \ |
160 |
INSTALL README README.linux README.osX |
125 |
INSTALL README README.linux README.osX |
161 |
|
126 |
for i in tigcc tprbuilder patcher |
162 |
cd "${S}"/sources/tigcc |
127 |
do |
163 |
docinto tigcc |
128 |
cd "${S}"/sources/${i} |
164 |
dodoc AUTHORS ChangeLog README |
129 |
docinto ${i} |
165 |
|
130 |
dodoc AUTHORS ChangeLog README |
166 |
cd "${S}"/sources/tprbuilder |
131 |
done |
167 |
docinto tprbuilder |
|
|
168 |
dodoc AUTHORS ChangeLog README |
169 |
|
170 |
cd "${S}"/sources/patcher |
171 |
docinto patcher |
172 |
dodoc AUTHORS ChangeLog README |
173 |
|
132 |
|
174 |
exeinto /usr/ti-linux-gnu/tigcc-bin/${GCC_VER} |
133 |
exeinto /usr/ti-linux-gnu/tigcc-bin/${GCC_VER} |
175 |
# install gcc |
134 |
# install gcc |
176 |
cd "${WORKDIR}"/build/gcc |
135 |
cd "${WORKDIR}"/build/gcc || die |
177 |
doexe gcc/cc1 |
136 |
doexe gcc/cc1 |
178 |
newexe gcc/xgcc gcc |
137 |
newexe gcc/xgcc gcc |
179 |
dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/gcc \ |
138 |
dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/gcc \ |
Lines 182-223
Link Here
|
182 |
# install gas |
141 |
# install gas |
183 |
# exeinto /usr/ti-linux-gnu/bin <-- a symlink will be |
142 |
# exeinto /usr/ti-linux-gnu/bin <-- a symlink will be |
184 |
# created so that gas resides in /usr/ti-linux-gnu/bin too |
143 |
# created so that gas resides in /usr/ti-linux-gnu/bin too |
185 |
cd "${WORKDIR}"/build/binutils |
144 |
cd "${WORKDIR}"/build/binutils || die |
186 |
newexe gas/as-new as |
145 |
newexe gas/as-new as |
187 |
|
146 |
|
188 |
# install a68k |
147 |
# install a68k |
189 |
cd "${S}"/sources/a68k |
148 |
cd "${S}"/sources/a68k || die |
190 |
newexe A68k a68k |
149 |
newexe A68k a68k |
191 |
|
150 |
|
192 |
# install ld-tigcc |
151 |
# install ld-tigcc |
193 |
cd "${S}"/sources/ld-tigcc |
152 |
cd "${S}"/sources/ld-tigcc || die |
194 |
doexe ld-tigcc |
153 |
doexe ld-tigcc |
195 |
doexe ar-tigcc |
154 |
doexe ar-tigcc |
196 |
|
155 |
|
197 |
# install tigcc |
156 |
# install tigcc |
198 |
cd "${S}"/sources/tigcc/src |
157 |
cd "${S}"/sources/tigcc/src || die |
199 |
doexe tigcc |
158 |
doexe tigcc |
200 |
dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/tigcc \ |
159 |
dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/tigcc \ |
201 |
/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/ti-linux-gnu-tigcc |
160 |
/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/ti-linux-gnu-tigcc |
202 |
|
161 |
|
203 |
# install tprbuilder |
162 |
# install tprbuilder |
204 |
cd "${S}"/sources/tprbuilder/src |
163 |
cd "${S}"/sources/tprbuilder/src || die |
205 |
doexe tprbuilder |
164 |
doexe tprbuilder |
206 |
|
165 |
|
207 |
# install patcher |
166 |
# install patcher |
208 |
cd "${S}"/sources/patcher/src |
167 |
cd "${S}"/sources/patcher/src || die |
209 |
doexe patcher |
168 |
doexe patcher |
210 |
|
169 |
|
211 |
# install header files |
170 |
# install header files |
212 |
dodir /usr/include/tigcc |
171 |
dodir /usr/include/tigcc |
213 |
cp -R "${S}"/tigcclib/include/* "${D}"/usr/include/tigcc |
172 |
cp -R "${S}"/tigcclib/include/* "${D}"/usr/include/tigcc || die |
214 |
dosym /usr/include/tigcc/asm/os.h /usr/include/tigcc/asm/OS.h |
173 |
dosym /usr/include/tigcc/asm/os.h /usr/include/tigcc/asm/OS.h |
215 |
|
174 |
|
216 |
insinto /usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER} |
175 |
insinto /usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER} |
217 |
# install library |
176 |
# install library |
218 |
cd "${S}"/tigcclib |
177 |
cd "${S}"/tigcclib || die |
219 |
doins lib/* |
178 |
doins lib/* |
220 |
cd "${WORKDIR}" |
179 |
cd "${WORKDIR}" || die |
221 |
doins flashos.a |
180 |
doins flashos.a |
222 |
doins fargo.a |
181 |
doins fargo.a |
223 |
|
182 |
|