Contents of /trunk/core/gcc/gcc-4.3.4-r3.smage2
Parent Directory | Revision Log
Revision 5601 -
(show annotations)
(download)
Wed Jul 7 12:24:10 2010 UTC (14 years, 2 months ago) by niro
File size: 7234 byte(s)
Wed Jul 7 12:24:10 2010 UTC (14 years, 2 months ago) by niro
File size: 7234 byte(s)
-rev bump to 4.3.4-r3; split_packages and added libgomp to libstdc++ libraries
1 | # $Id$ |
2 | |
3 | PNAME="gcc" |
4 | PVER="4.3.4" |
5 | PBUILD="r3" |
6 | |
7 | PCATEGORIE="sys-dev" |
8 | STATE="unstable" |
9 | |
10 | HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" |
11 | |
12 | SDEPEND="== sys-libs/libstdc++-${PVER} |
13 | >= sys-dev/binutils-2.20 |
14 | >= virtual/glibc |
15 | >= dev-libs/gmp-4.2.4 |
16 | >= dev-libs/mpfr-2.3.2 |
17 | >= virtual/kernel-headers" |
18 | |
19 | SPLIT_PACKAGES="libstdc++ libstdc++-dev gcc" |
20 | |
21 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
22 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
23 | |
24 | # languages to build into gcc |
25 | MyLanguages=c,c++ |
26 | |
27 | sminclude mtools cleanutils libtool |
28 | |
29 | SRC_URI=( |
30 | gnu://${PNAME}/${PNAME}-${PVER}/${SRCFILE} |
31 | mirror://${PNAME}/${SRCFILE} |
32 | mirror://${PNAME}/${PNAME}-4.3.2-no-fixincludes.patch |
33 | ) |
34 | |
35 | UP2DATE="updatecmd \"http://ftp.gnu.org/gnu/${PNAME}/?C=M;O=A\" | sed -n 's/.*${PNAME}-\(.*\)\//\1/;$ p'" |
36 | |
37 | # gcc don't like strong CFLAGS |
38 | export CFLAGS="${CFLAGS//-O?} -O2" |
39 | export CXXFLAGS="${CFLAGS}" |
40 | |
41 | # check for crosscompile or export default CHOST |
42 | if [[ -z ${CCHOST} ]] |
43 | then |
44 | # no crosscompile defined |
45 | export CCHOST=${CHOST} |
46 | else |
47 | # use crosscompile host |
48 | export CCHOST=${CCHOST} |
49 | fi |
50 | |
51 | split_info_gcc() |
52 | { |
53 | DESCRIPTION="Modern C/C++ compiler written by the GNU people." |
54 | DEPEND="== sys-libs/libstdc++-${PVER} |
55 | >= sys-dev/binutils-2.20 |
56 | >= virtual/glibc |
57 | >= dev-libs/gmp-4.2.4 |
58 | >= dev-libs/mpfr-2.3.2" |
59 | |
60 | postinstall() |
61 | { |
62 | echo |
63 | echo "Please remember that the flag -mcpu does not exist anymore." |
64 | echo "It has been replaced with '-mtune'. Please update your /etc/mage.rc." |
65 | echo |
66 | } |
67 | } |
68 | |
69 | split_info_libstdc++() |
70 | { |
71 | DESCRIPTION="Standard GNU C and C++ libraries." |
72 | DEPEND=">= sys-apps/base-files-0.1" |
73 | PCATEGORIE="sys-libs" |
74 | } |
75 | |
76 | split_info_libstdc++-dev() |
77 | { |
78 | DESCRIPTION="Standard GNU C and C++ libraries - DEV." |
79 | DEPEND="== sys-libs/libstdc++-${PVER}" |
80 | PCATEGORIE="sys-libs" |
81 | } |
82 | |
83 | src_prepare() |
84 | { |
85 | munpack ${SRCFILE} || die |
86 | cd ${SRCDIR} |
87 | |
88 | # generic fixes |
89 | mpatch ${PNAME}-4.3.2-no-fixincludes.patch || die |
90 | |
91 | # suppress installation of libiberty, as we will be |
92 | # using the one from binutils |
93 | sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || die |
94 | |
95 | install -d ${SRCDIR}/build || die |
96 | cd ${SRCDIR}/build |
97 | } |
98 | |
99 | src_compile() |
100 | { |
101 | cd ${SRCDIR}/build |
102 | |
103 | local myconf |
104 | |
105 | # you better off when not using distcc to compile |
106 | # your new compiler :) maybe not all are the same |
107 | export SMAGE_USE_DISTCC=false |
108 | |
109 | # Straight from the GCC install doc: |
110 | # "GCC has code to correctly determine the correct value for target |
111 | # for nearly all native systems. Therefore, we highly recommend you |
112 | # not provide a configure target when configuring a native compiler." |
113 | if [[ ${CHOST} != ${CCHOST} ]] |
114 | then |
115 | myconf+=" --target=${CCHOST}" |
116 | fi |
117 | |
118 | # gcc >= 4.3 has now configure flags for uri and version - yeah! |
119 | AR=ar \ |
120 | ../configure \ |
121 | --with-bugurl="http://bugs.magellan-linux.de/" \ |
122 | --with-pkgversion="Magellan-Linux" \ |
123 | --build=${CHOST} \ |
124 | --host=${CHOST} \ |
125 | --prefix=/usr \ |
126 | --mandir=/usr/share/man \ |
127 | --infodir=/usr/share/info \ |
128 | --libdir=/usr/$(mlibdir) \ |
129 | --libexecdir=/usr/$(mlibdir) \ |
130 | --enable-shared \ |
131 | --enable-threads=posix \ |
132 | --enable-__cxa_atexit \ |
133 | --enable-clocale=gnu \ |
134 | --disable-checking \ |
135 | --with-system-zlib \ |
136 | --enable-long-long \ |
137 | --enable-cstdio=stdio \ |
138 | --enable-languages=${MyLanguages} \ |
139 | --disable-libstdcxx-pch \ |
140 | ${myconf} \ |
141 | || die |
142 | |
143 | # parallel builds seems to break sometimes on x86_64 |
144 | local myopts |
145 | [[ ${ARCH} = x86_64 ]] && myopts=-j1 |
146 | |
147 | mmake ${myopts} bootstrap-lean || die |
148 | } |
149 | |
150 | src_install() |
151 | { |
152 | cd ${SRCDIR}/build |
153 | minstalldir /$(mlibdir) || die |
154 | |
155 | make DESTDIR=${BINDIR} install || die |
156 | |
157 | # versionize all bins and symlink them |
158 | for bin in $(find ${BINDIR}/usr/bin -type f) |
159 | do |
160 | echo ${bin} |
161 | mv ${bin} ${bin}-${PVER} || die |
162 | ln -snf $(basename ${bin}-${PVER}) ${bin} || die |
163 | done |
164 | |
165 | mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die |
166 | # this one is needed on multilib systems. |
167 | # rpcgen may not find the cpp compiler correctly if not in /lib/cpp |
168 | if [[ $(mlibdir) != lib ]] |
169 | then |
170 | minstalldir /lib || die |
171 | mlink ../usr/bin/cpp-${PVER} /lib/cpp || die |
172 | fi |
173 | mlink gcc-${PVER} /usr/bin/cc || die |
174 | |
175 | # deletes libstdc++ && libgcc_s |
176 | rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die |
177 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] |
178 | then |
179 | rm ${BINDIR}/usr/lib/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die |
180 | fi |
181 | |
182 | # fix all .la files |
183 | # the contain invalid libpathes and they are not needed |
184 | local la |
185 | for la in $(find ${BINDIR} -name \*.la) |
186 | do |
187 | fix_la_file ${la} || die ${la} |
188 | done |
189 | } |
190 | |
191 | src_install_gcc() |
192 | { |
193 | cd ${SRCDIR}/build |
194 | minstalldir /$(mlibdir) || die |
195 | |
196 | # install all targets |
197 | make DESTDIR=${BINDIR} install || die |
198 | |
199 | # versionize all bins and symlink them |
200 | for bin in $(find ${BINDIR}/usr/bin -type f) |
201 | do |
202 | echo ${bin} |
203 | mv ${bin} ${bin}-${PVER} || die |
204 | ln -snf $(basename ${bin}-${PVER}) ${bin} || die |
205 | done |
206 | |
207 | mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die |
208 | # this one is needed on multilib systems. |
209 | # rpcgen may not find the cpp compiler correctly if not in /lib/cpp |
210 | if [[ $(mlibdir) != lib ]] |
211 | then |
212 | minstalldir /lib || die |
213 | mlink ../usr/bin/cpp-${PVER} /lib/cpp || die |
214 | fi |
215 | mlink gcc-${PVER} /usr/bin/cc || die |
216 | |
217 | # deletes libstdc++ && libgcc_s && libssp && libgomp |
218 | rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die |
219 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] |
220 | then |
221 | rm ${BINDIR}/usr/lib/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die |
222 | fi |
223 | |
224 | # fix all .la files |
225 | # they may contain invalid libpathes which are not needed |
226 | local la |
227 | for la in $(find ${BINDIR} -name \*.la) |
228 | do |
229 | fix_la_file ${la} || die ${la} |
230 | done |
231 | } |
232 | |
233 | src_install_libstdc++() |
234 | { |
235 | cd ${SRCDIR}/build |
236 | minstalldir /$(mlibdir) || die |
237 | |
238 | local target |
239 | for target in libstdc++-v3 libgcc libssp libgomp |
240 | do |
241 | make DESTDIR=${BINDIR} install-target-${target} || die |
242 | done |
243 | |
244 | # cleanup, only keep the libs, everything else get provided by the gcc-package |
245 | zapmost ${BINDIR}/usr/$(mlibdir) libgcc_s.so libgcc_s.so.* libstdc++.so libstdc++.so.* libssp.so libssp.so.* libgomp.so libgomp.so.* || die |
246 | # multilib as well |
247 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] |
248 | then |
249 | zapmost ${BINDIR}/usr/lib libgcc_s.so libgcc_s.so.* libstdc++.so libstdc++.so.* libssp.so libssp.so.* libgomp.so libgomp.so.* || die |
250 | fi |
251 | |
252 | # clean up everything else |
253 | zapmost ${BINDIR} usr/$(mlibdir) $([[ $(mlibdir) != lib ]] && echo "usr/lib") || die |
254 | } |
255 | |
256 | src_install_libstdc++-dev() |
257 | { |
258 | cd ${SRCDIR}/build |
259 | minstalldir /$(mlibdir) || die |
260 | |
261 | local target |
262 | for target in libstdc++-v3 libgcc libssp libgomp |
263 | do |
264 | make DESTDIR=${BINDIR} install-target-${target} || die |
265 | done |
266 | |
267 | # cleanup, only keep the libs, everything else get provided by the gcc-package |
268 | zapmost ${BINDIR}/usr/$(mlibdir) libgcc_s.a libgcc_s.la libstdc++.a libstdc++.la libssp.a libssp.la libgomp.a libgomp.la || die |
269 | # multilib as well |
270 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] |
271 | then |
272 | zapmost ${BINDIR}/usr/lib libgcc_s.a libgcc_s.la libstdc++.a libstdc++.la libssp.a libssp.la libgomp.a libgomp.la || die |
273 | fi |
274 | |
275 | # clean up everything else |
276 | zapmost ${BINDIR} usr/$(mlibdir) $([[ $(mlibdir) != lib ]] && echo "usr/lib") || die |
277 | |
278 | # fix all .la files |
279 | # they may contain invalid libpathes which are not needed |
280 | local la |
281 | for la in $(find ${BINDIR} -name \*.la) |
282 | do |
283 | fix_la_file ${la} || die ${la} |
284 | done |
285 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |