Annotation of /trunk/core/gcc/gcc-4.3.4-r4.smage2
Parent Directory
|
Revision Log
Revision 5620 -
(hide annotations)
(download)
Thu Jul 15 17:04:00 2010 UTC (13 years, 11 months ago) by niro
File size: 6067 byte(s)
Thu Jul 15 17:04:00 2010 UTC (13 years, 11 months ago) by niro
File size: 6067 byte(s)
-rev bump to 4.3.4-r4; libstdc++-dev not needed and added missing libstdc++-v3 dependency
1 | niro | 5620 | # $Id$ |
2 | |||
3 | PNAME="gcc" | ||
4 | PVER="4.3.4" | ||
5 | PBUILD="r4" | ||
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++ 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-libs/libstdc++-v3-3.3.3 | ||
73 | >= sys-apps/base-files-0.1" | ||
74 | PCATEGORIE="sys-libs" | ||
75 | } | ||
76 | |||
77 | src_prepare() | ||
78 | { | ||
79 | munpack ${SRCFILE} || die | ||
80 | cd ${SRCDIR} | ||
81 | |||
82 | # generic fixes | ||
83 | mpatch ${PNAME}-4.3.2-no-fixincludes.patch || die | ||
84 | |||
85 | # suppress installation of libiberty, as we will be | ||
86 | # using the one from binutils | ||
87 | sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || die | ||
88 | |||
89 | install -d ${SRCDIR}/build || die | ||
90 | cd ${SRCDIR}/build | ||
91 | } | ||
92 | |||
93 | src_compile() | ||
94 | { | ||
95 | cd ${SRCDIR}/build | ||
96 | |||
97 | local myconf | ||
98 | |||
99 | # you better off when not using distcc to compile | ||
100 | # your new compiler :) maybe not all are the same | ||
101 | export SMAGE_USE_DISTCC=false | ||
102 | |||
103 | # Straight from the GCC install doc: | ||
104 | # "GCC has code to correctly determine the correct value for target | ||
105 | # for nearly all native systems. Therefore, we highly recommend you | ||
106 | # not provide a configure target when configuring a native compiler." | ||
107 | if [[ ${CHOST} != ${CCHOST} ]] | ||
108 | then | ||
109 | myconf+=" --target=${CCHOST}" | ||
110 | fi | ||
111 | |||
112 | # gcc >= 4.3 has now configure flags for uri and version - yeah! | ||
113 | AR=ar \ | ||
114 | ../configure \ | ||
115 | --with-bugurl="http://bugs.magellan-linux.de/" \ | ||
116 | --with-pkgversion="Magellan-Linux" \ | ||
117 | --build=${CHOST} \ | ||
118 | --host=${CHOST} \ | ||
119 | --prefix=/usr \ | ||
120 | --mandir=/usr/share/man \ | ||
121 | --infodir=/usr/share/info \ | ||
122 | --libdir=/usr/$(mlibdir) \ | ||
123 | --libexecdir=/usr/$(mlibdir) \ | ||
124 | --enable-shared \ | ||
125 | --enable-threads=posix \ | ||
126 | --enable-__cxa_atexit \ | ||
127 | --enable-clocale=gnu \ | ||
128 | --disable-checking \ | ||
129 | --with-system-zlib \ | ||
130 | --enable-long-long \ | ||
131 | --enable-cstdio=stdio \ | ||
132 | --enable-languages=${MyLanguages} \ | ||
133 | --disable-libstdcxx-pch \ | ||
134 | ${myconf} \ | ||
135 | || die | ||
136 | |||
137 | # parallel builds seems to break sometimes on x86_64 | ||
138 | local myopts | ||
139 | [[ ${ARCH} = x86_64 ]] && myopts=-j1 | ||
140 | |||
141 | mmake ${myopts} bootstrap-lean || die | ||
142 | } | ||
143 | |||
144 | src_install() | ||
145 | { | ||
146 | cd ${SRCDIR}/build | ||
147 | minstalldir /$(mlibdir) || die | ||
148 | |||
149 | make DESTDIR=${BINDIR} install || die | ||
150 | |||
151 | # versionize all bins and symlink them | ||
152 | for bin in $(find ${BINDIR}/usr/bin -type f) | ||
153 | do | ||
154 | echo ${bin} | ||
155 | mv ${bin} ${bin}-${PVER} || die | ||
156 | ln -snf $(basename ${bin}-${PVER}) ${bin} || die | ||
157 | done | ||
158 | |||
159 | mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die | ||
160 | # this one is needed on multilib systems. | ||
161 | # rpcgen may not find the cpp compiler correctly if not in /lib/cpp | ||
162 | if [[ $(mlibdir) != lib ]] | ||
163 | then | ||
164 | minstalldir /lib || die | ||
165 | mlink ../usr/bin/cpp-${PVER} /lib/cpp || die | ||
166 | fi | ||
167 | mlink gcc-${PVER} /usr/bin/cc || die | ||
168 | |||
169 | # deletes libstdc++ && libgcc_s | ||
170 | rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die | ||
171 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] | ||
172 | then | ||
173 | rm ${BINDIR}/usr/lib/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die | ||
174 | fi | ||
175 | |||
176 | # fix all .la files | ||
177 | # the contain invalid libpathes and they are not needed | ||
178 | local la | ||
179 | for la in $(find ${BINDIR} -name \*.la) | ||
180 | do | ||
181 | fix_la_file ${la} || die ${la} | ||
182 | done | ||
183 | } | ||
184 | |||
185 | src_install_gcc() | ||
186 | { | ||
187 | cd ${SRCDIR}/build | ||
188 | minstalldir /$(mlibdir) || die | ||
189 | |||
190 | # install all targets | ||
191 | make DESTDIR=${BINDIR} install || die | ||
192 | |||
193 | # versionize all bins and symlink them | ||
194 | for bin in $(find ${BINDIR}/usr/bin -type f) | ||
195 | do | ||
196 | echo ${bin} | ||
197 | mv ${bin} ${bin}-${PVER} || die | ||
198 | ln -snf $(basename ${bin}-${PVER}) ${bin} || die | ||
199 | done | ||
200 | |||
201 | mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die | ||
202 | # this one is needed on multilib systems. | ||
203 | # rpcgen may not find the cpp compiler correctly if not in /lib/cpp | ||
204 | if [[ $(mlibdir) != lib ]] | ||
205 | then | ||
206 | minstalldir /lib || die | ||
207 | mlink ../usr/bin/cpp-${PVER} /lib/cpp || die | ||
208 | fi | ||
209 | mlink gcc-${PVER} /usr/bin/cc || die | ||
210 | |||
211 | # deletes libstdc++ && libgcc_s && libssp && libgomp | ||
212 | rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die | ||
213 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] | ||
214 | then | ||
215 | rm ${BINDIR}/usr/lib/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die | ||
216 | fi | ||
217 | |||
218 | # fix all .la files | ||
219 | # they may contain invalid libpathes which are not needed | ||
220 | local la | ||
221 | for la in $(find ${BINDIR} -name \*.la) | ||
222 | do | ||
223 | fix_la_file ${la} || die ${la} | ||
224 | done | ||
225 | } | ||
226 | |||
227 | src_install_libstdc++() | ||
228 | { | ||
229 | cd ${SRCDIR}/build | ||
230 | minstalldir /$(mlibdir) || die | ||
231 | |||
232 | local target | ||
233 | for target in libstdc++-v3 libgcc libssp libgomp | ||
234 | do | ||
235 | make DESTDIR=${BINDIR} install-target-${target} || die | ||
236 | done | ||
237 | |||
238 | # cleanup, only keep the libs, everything else get provided by the gcc-package | ||
239 | zapmost ${BINDIR}/usr/$(mlibdir) libgcc_s*.* libstdc++*.* libssp*.* libgomp*.* || die | ||
240 | # multilib as well | ||
241 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] | ||
242 | then | ||
243 | zapmost ${BINDIR}/usr/lib libgcc_s*.* libstdc++*.* libssp*.* libgomp*.* || die | ||
244 | fi | ||
245 | |||
246 | # clean up everything else | ||
247 | zapmost ${BINDIR} usr/$(mlibdir) $([[ $(mlibdir) != lib ]] && echo "usr/lib") || die | ||
248 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |