/[gentoo-x86]/dev-embedded/tigcc/tigcc-0.96_beta8.ebuild
Gentoo

Contents of /dev-embedded/tigcc/tigcc-0.96_beta8.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Apr 30 02:54:59 2012 UTC (2 years, 7 months ago) by vapier
Branch: MAIN
Changes since 1.2: +64 -67 lines
Version bump #412487 by Pacho Ramos.

(Portage version: 2.2.0_alpha100/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-embedded/tigcc/tigcc-0.96_beta7.ebuild,v 1.8 2012/02/06 03:10:58 vapier Exp $
4
5 inherit eutils
6
7 BASE_BINUTILS="2.16.1"
8 GCC_VER="4.1.2"
9 GCC_SNAPSHOT="20060728"
10 BIN_VER=${BASE_BINUTILS:0:4}
11
12 DESCRIPTION="Cross compiler for Texas Instruments TI-89, TI-92(+) and V200 calculators"
13 HOMEPAGE="http://tigcc.ticalc.org/"
14
15 #original source can be found at:
16 #SRC_URI="http://tigcc.ticalc.org/linux/tigcc_src.tar.bz2"
17 #but in fact this file changes as soon as there comes a new beta
18
19 #when it hits portage of course it should be mirrored on a gentoo mirror:
20 #SRC_URI="mirror://gentoo/${PF}.tar.bz2"
21
22 SRC_URI="mirror://gentoo/${P}.tar.bz2
23 ftp://gcc.gnu.org/pub/gcc/snapshots/4.1-${GCC_SNAPSHOT}/gcc-4.1-${GCC_SNAPSHOT}.tar.bz2
24 mirror://kernel/linux/devel/binutils/binutils-${BASE_BINUTILS}.tar.bz2
25 http://members.chello.at/gerhard.kofler/kevin/ti89prog/libfargo.zip
26 http://members.chello.at/gerhard.kofler/kevin/ti89prog/flashosa.zip"
27
28 LICENSE="GPL-2"
29 SLOT="0"
30 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
31 IUSE="doc"
32 RESTRICT="strip"
33
34 RDEPEND=">=sys-devel/binutils-2.14.90.0.6-r1"
35 DEPEND="${RDEPEND}
36 app-arch/unzip
37 >=sys-devel/bison-1.875"
38
39 S=${WORKDIR}
40
41 src_unpack() {
42 unpack ${A}
43
44 # start by patching and cleaning out binutils and gcc directories.
45 cd "${WORKDIR}"/binutils-${BASE_BINUTILS}
46 epatch "${S}"/sources/gcc/gas-${BIN_VER}-tigcc-*.diff
47
48 rm -f .brik
49 rm -f md5.sum
50 rm -f -r INSTALL
51 rm -f -r maintainer-scripts
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
63 cd "${WORKDIR}"/gcc-4.1-${GCC_SNAPSHOT}
64 epatch "${S}"/sources/gcc/gcc-4.1-tigcc-patch.diff
65
66 rm -f .brik
67 rm -f md5.sum
68 rm -f -r INSTALL
69 rm -f -r fixincludes
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
82 # create build directories for binutils and gcc
83 mkdir -p "${WORKDIR}"/build/binutils
84 mkdir "${WORKDIR}"/build/gcc
85
86 # Workaround for non-existing directories
87 sed -ie '/SUBDIRS =/d' "${WORKDIR}"/binutils-${BASE_BINUTILS}/gas/Makefile.in
88 }
89
90 src_compile() {
91 # build binutils
92 cd "${WORKDIR}"/build/binutils
93 CFLAGS="${CFLAGS}" "${WORKDIR}"/binutils-${BASE_BINUTILS}/configure \
94 --disable-serial-configure --target=m68k-coff --disable-shared \
95 --enable-static --disable-multilib --disable-nls \
96 || die
97 emake || die "gas"
98
99 # build gcc
100 cd "${WORKDIR}"/build/gcc
101 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 \
103 --disable-nls --disable-multilib --disable-shared --enable-static \
104 --disable-threads --enable-languages=c --disable-win32-registry \
105 --disable-checking --disable-werror --disable-pch --disable-mudflap \
106 || die
107
108 # GCC compilations _is intended_ to fail on a certain point,
109 # don't worry about that.
110 emake -j1
111
112 # Check if gcc has been built, die otherwise
113 ( [ -e "${WORKDIR}"/build/gcc/gcc/xgcc ] && [ -e "${WORKDIR}"/build/gcc/gcc/cc1 ] ) || die "gcc"
114
115 # build a68k assembler
116 cd "${S}"/sources/a68k
117 emake -e || die "a68k"
118
119 # build ld-tigcc linker
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 }
136
137 src_install() {
138 # install documentation
139 dodir /usr/bin
140
141 if use doc ; then
142 # patch the script that launches the documentation
143 # browser to point to the correct location
144 sed "s:\${TIGCC}/doc:/usr/share/doc/${P}:g" \
145 "${S}"/tigcclib/doc/converter/tigccdoc \
146 > "${S}"/tigcclib/doc/converter/tigccdoc.new
147
148 cd "${S}"/tigcclib/doc/converter
149 newbin tigccdoc.new tigccdoc
150 cd "${S}"/tigcclib/doc
151 dohtml -r html/*
152 cp html/qt-assistant.adp "${D}"/usr/share/doc/${PF}/html
153
154 cd "${S}"/sources/a68k
155 fi
156
157 dodir /usr/share/doc/${PF}
158 cd "${S}"
159 dodoc AUTHORS BUGS CHANGELOG DIRECTORIES HOWTO \
160 INSTALL README README.linux README.osX
161
162 cd "${S}"/sources/tigcc
163 docinto tigcc
164 dodoc AUTHORS ChangeLog README
165
166 cd "${S}"/sources/tprbuilder
167 docinto tprbuilder
168 dodoc AUTHORS ChangeLog README
169
170 cd "${S}"/sources/patcher
171 docinto patcher
172 dodoc AUTHORS ChangeLog README
173
174 exeinto /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}
175 # install gcc
176 cd "${WORKDIR}"/build/gcc
177 doexe gcc/cc1
178 newexe gcc/xgcc gcc
179 dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/gcc \
180 /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/ti-linux-gnu-gcc
181
182 # install gas
183 # exeinto /usr/ti-linux-gnu/bin <-- a symlink will be
184 # created so that gas resides in /usr/ti-linux-gnu/bin too
185 cd "${WORKDIR}"/build/binutils
186 newexe gas/as-new as
187
188 # install a68k
189 cd "${S}"/sources/a68k
190 newexe A68k a68k
191
192 # install ld-tigcc
193 cd "${S}"/sources/ld-tigcc
194 doexe ld-tigcc
195 doexe ar-tigcc
196
197 # install tigcc
198 cd "${S}"/sources/tigcc/src
199 doexe tigcc
200 dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/tigcc \
201 /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/ti-linux-gnu-tigcc
202
203 # install tprbuilder
204 cd "${S}"/sources/tprbuilder/src
205 doexe tprbuilder
206
207 # install patcher
208 cd "${S}"/sources/patcher/src
209 doexe patcher
210
211 # install header files
212 dodir /usr/include/tigcc
213 cp -R "${S}"/tigcclib/include/* "${D}"/usr/include/tigcc
214 dosym /usr/include/tigcc/asm/os.h /usr/include/tigcc/asm/OS.h
215
216 insinto /usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER}
217 # install library
218 cd "${S}"/tigcclib
219 doins lib/*
220 cd "${WORKDIR}"
221 doins flashos.a
222 doins fargo.a
223
224 dodir /usr/share/tigcc
225 # copy example programs
226 # cp -r "${S}"/examples ${D}/usr/share/tigcc
227
228 # create TIGCC env variable
229 # TIGCC="/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}"
230 # CC="tigcc"
231 cat <<-EOF > 99tigcc
232 TIGCC="/usr/ti-linux-gnu"
233 PATH="/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}:/usr/ti-linux-gnu/bin"
234 ROOTPATH="/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}:/usr/ti-linux-gnu/bin"
235 LDPATH="/usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER}"
236 EOF
237 doenvd 99tigcc
238
239 # a cross-compiling gcc with hard-coded names has been built.
240 # therefore, we must place some symlinks.
241 dosym /usr/include/tigcc /usr/ti-linux-gnu/include
242 dosym /usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER} /usr/ti-linux-gnu/lib
243 dosym /usr/share/doc/${PF} /usr/ti-linux-gnu/doc
244 dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER} /usr/ti-linux-gnu/bin
245 }

  ViewVC Help
Powered by ViewVC 1.1.20