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