Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 243866
Collapse All | Expand All

(-)tigcc-0.96_beta8.ebuild (-43 / +52 lines)
Lines 1-8 Link Here
1
# Copyright 1999-2012 Gentoo Foundation
1
# Copyright 1999-2014 Gentoo Foundation
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: $
4
4
5
inherit eutils
5
EAPI=5
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 36-48 Link Here
36
	app-arch/unzip
38
	app-arch/unzip
37
	>=sys-devel/bison-1.875"
39
	>=sys-devel/bison-1.875"
38
40
39
S=${WORKDIR}
41
S="${WORKDIR}"
40
41
src_unpack() {
42
	unpack ${A}
43
42
43
src_prepare() {
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
	rm -f .brik
Lines 60-66 Link Here
60
	rm -f -r ld
60
	rm -f -r ld
61
	rm -f -r texinfo
61
	rm -f -r texinfo
62
62
63
	cd "${WORKDIR}"/gcc-4.1-${GCC_SNAPSHOT}
63
	cd "${WORKDIR}/gcc-4.1-${GCC_SNAPSHOT}" || die
64
	epatch "${S}"/sources/gcc/gcc-4.1-tigcc-patch.diff
64
	epatch "${S}"/sources/gcc/gcc-4.1-tigcc-patch.diff
65
65
66
	rm -f .brik
66
	rm -f .brik
Lines 84-103 Link Here
84
	mkdir "${WORKDIR}"/build/gcc
84
	mkdir "${WORKDIR}"/build/gcc
85
85
86
	# Workaround for non-existing directories
86
	# Workaround for non-existing directories
87
	sed -ie '/SUBDIRS =/d' "${WORKDIR}"/binutils-${BASE_BINUTILS}/gas/Makefile.in
87
	sed -ie '/SUBDIRS =/d' "${WORKDIR}/binutils-${BASE_BINUTILS}/gas/Makefile.in" || die
88
89
	# Respect toolchain, bug #243866
90
	tc-export AR CC RANLIB
91
92
	epatch_user
88
}
93
}
89
94
95
# Buildsystem is very fragile, configuring and compiling
96
# can not be split
97
src_configure() { :; }
98
90
src_compile() {
99
src_compile() {
91
	# build binutils
100
	# build binutils
92
	cd "${WORKDIR}"/build/binutils
101
	cd "${WORKDIR}/build/binutils" || die
93
	CFLAGS="${CFLAGS}" "${WORKDIR}"/binutils-${BASE_BINUTILS}/configure \
102
	CFLAGS="${CFLAGS}" "${WORKDIR}"/binutils-${BASE_BINUTILS}/configure \
94
		--disable-serial-configure --target=m68k-coff --disable-shared \
103
		--disable-serial-configure --target=m68k-coff --disable-shared \
95
		--enable-static --disable-multilib --disable-nls \
104
		--enable-static --disable-multilib --disable-nls \
96
		|| die
105
		|| die
97
	emake || die "gas"
106
	emake
98
107
99
	# build gcc
108
	# configure gcc
100
	cd "${WORKDIR}"/build/gcc
109
	cd "${WORKDIR}/build/gcc" || die
101
	CFLAGS="${CFLAGS}" "${WORKDIR}"/gcc-4.1-${GCC_SNAPSHOT}/configure --target=m68k-coff \
110
	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 \
111
				--with-gnu-as --with-as="${WORKDIR}"/build/binutils/gas/as-new --with-gnu-ld \
103
				--disable-nls --disable-multilib --disable-shared --enable-static \
112
				--disable-nls --disable-multilib --disable-shared --enable-static \
Lines 107-137 Link Here
107
116
108
	# GCC compilations _is intended_ to fail on a certain point,
117
	# GCC compilations _is intended_ to fail on a certain point,
109
	# don't worry about that.
118
	# don't worry about that.
110
	emake -j1
119
	nonfatal emake -j1
111
120
112
	# Check if gcc has been built, die otherwise
121
	# Check if gcc has been built, die otherwise
113
	( [ -e "${WORKDIR}"/build/gcc/gcc/xgcc ] && [ -e "${WORKDIR}"/build/gcc/gcc/cc1  ] ) || die "gcc"
122
	( [ -e "${WORKDIR}"/build/gcc/gcc/xgcc ] && [ -e "${WORKDIR}"/build/gcc/gcc/cc1  ] ) || die "gcc"
114
123
115
	# build a68k assembler
124
	# build a68k assembler
116
	cd "${S}"/sources/a68k
125
	cd "${S}"/sources/a68k || die
117
	emake -e || die "a68k"
126
	emake -e
118
127
119
	# build ld-tigcc linker
128
	# build ld-tigcc linker
120
	cd "${S}"/sources/ld-tigcc
129
	cd "${S}"/sources/ld-tigcc || die
121
	emake -e || die "ld-tigcc"
130
	emake -e
122
131
123
	# build tigcc front-end
132
	# build tigcc front-end
124
	cd "${S}"/sources/tigcc/src
133
	cd "${S}"/sources/tigcc/src || die
125
	emake -e || die "tigcc"
134
	emake -e
126
135
127
	# build tprbuilder (TIGCC project builder)
136
	# build tprbuilder (TIGCC project builder)
128
	cd "${S}"/sources/tprbuilder/src
137
	cd "${S}"/sources/tprbuilder/src || die
129
	emake -e || die "tprbuilder"
138
	emake -e
130
139
131
	# build patcher (object file patcher)
140
	# build patcher (object file patcher)
132
	cd "${S}"/sources/patcher/src
141
	cd "${S}"/sources/patcher/src || die
133
	emake -e || die "patcher"
142
	emake -e
134
135
}
143
}
136
144
137
src_install() {
145
src_install() {
Lines 145-179 Link Here
145
			"${S}"/tigcclib/doc/converter/tigccdoc \
153
			"${S}"/tigcclib/doc/converter/tigccdoc \
146
		> "${S}"/tigcclib/doc/converter/tigccdoc.new
154
		> "${S}"/tigcclib/doc/converter/tigccdoc.new
147
155
148
		cd "${S}"/tigcclib/doc/converter
156
		cd "${S}"/tigcclib/doc/converter || die
149
		newbin tigccdoc.new tigccdoc
157
		newbin tigccdoc.new tigccdoc
150
		cd "${S}"/tigcclib/doc
158
		cd "${S}"/tigcclib/doc || die
151
		dohtml -r html/*
159
		dohtml -r html/*
152
		cp html/qt-assistant.adp "${D}"/usr/share/doc/${PF}/html
160
		insinto /usr/share/doc/${PF}/html
161
		doins html/qt-assistant.adp
153
162
154
		cd "${S}"/sources/a68k
163
		cd "${S}"/sources/a68k || die
155
	fi
164
	fi
156
165
157
	dodir /usr/share/doc/${PF}
166
	dodir /usr/share/doc/${PF}
158
	cd "${S}"
167
	cd "${S}" || die
159
	dodoc AUTHORS BUGS CHANGELOG DIRECTORIES HOWTO \
168
	dodoc AUTHORS BUGS CHANGELOG DIRECTORIES HOWTO \
160
		INSTALL README README.linux README.osX
169
		INSTALL README README.linux README.osX
161
170
162
	cd "${S}"/sources/tigcc
171
	cd "${S}"/sources/tigcc || die
163
	docinto tigcc
172
	docinto tigcc
164
	dodoc AUTHORS ChangeLog README
173
	dodoc AUTHORS ChangeLog README
165
174
166
	cd "${S}"/sources/tprbuilder
175
	cd "${S}"/sources/tprbuilder || die
167
	docinto tprbuilder
176
	docinto tprbuilder
168
	dodoc AUTHORS ChangeLog README
177
	dodoc AUTHORS ChangeLog README
169
178
170
	cd "${S}"/sources/patcher
179
	cd "${S}"/sources/patcher || die
171
	docinto patcher
180
	docinto patcher
172
	dodoc AUTHORS ChangeLog README
181
	dodoc AUTHORS ChangeLog README
173
182
174
	exeinto /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}
183
	exeinto /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}
175
	# install gcc
184
	# install gcc
176
	cd "${WORKDIR}"/build/gcc
185
	cd "${WORKDIR}"/build/gcc || die
177
	doexe gcc/cc1
186
	doexe gcc/cc1
178
	newexe gcc/xgcc gcc
187
	newexe gcc/xgcc gcc
179
	dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/gcc \
188
	dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/gcc \
Lines 182-211 Link Here
182
	# install gas
191
	# install gas
183
	# exeinto /usr/ti-linux-gnu/bin <-- a symlink will be
192
	# exeinto /usr/ti-linux-gnu/bin <-- a symlink will be
184
	# created so that gas resides in /usr/ti-linux-gnu/bin too
193
	# created so that gas resides in /usr/ti-linux-gnu/bin too
185
	cd "${WORKDIR}"/build/binutils
194
	cd "${WORKDIR}"/build/binutils || die
186
	newexe gas/as-new as
195
	newexe gas/as-new as
187
196
188
	# install a68k
197
	# install a68k
189
	cd "${S}"/sources/a68k
198
	cd "${S}"/sources/a68k || die
190
	newexe A68k a68k
199
	newexe A68k a68k
191
200
192
	# install ld-tigcc
201
	# install ld-tigcc
193
	cd "${S}"/sources/ld-tigcc
202
	cd "${S}"/sources/ld-tigcc || die
194
	doexe ld-tigcc
203
	doexe ld-tigcc
195
	doexe ar-tigcc
204
	doexe ar-tigcc
196
205
197
	# install tigcc
206
	# install tigcc
198
	cd "${S}"/sources/tigcc/src
207
	cd "${S}"/sources/tigcc/src || die
199
	doexe tigcc
208
	doexe tigcc
200
	dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/tigcc \
209
	dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/tigcc \
201
		/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/ti-linux-gnu-tigcc
210
		/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/ti-linux-gnu-tigcc
202
211
203
	# install tprbuilder
212
	# install tprbuilder
204
	cd "${S}"/sources/tprbuilder/src
213
	cd "${S}"/sources/tprbuilder/src || die
205
	doexe tprbuilder
214
	doexe tprbuilder
206
215
207
	# install patcher
216
	# install patcher
208
	cd "${S}"/sources/patcher/src
217
	cd "${S}"/sources/patcher/src || die
209
	doexe patcher
218
	doexe patcher
210
219
211
	# install header files
220
	# install header files
Lines 215-223 Link Here
215
224
216
	insinto /usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER}
225
	insinto /usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER}
217
	# install library
226
	# install library
218
	cd "${S}"/tigcclib
227
	cd "${S}"/tigcclib || die
219
	doins lib/*
228
	doins lib/*
220
	cd "${WORKDIR}"
229
	cd "${WORKDIR}" || die
221
	doins flashos.a
230
	doins flashos.a
222
	doins fargo.a
231
	doins fargo.a
223
232

Return to bug 243866