Magellan Linux

Contents of /smage/trunk/core/gcc/gcc-4.5.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1064 - (show annotations) (download)
Tue Jan 25 17:20:22 2011 UTC (13 years, 3 months ago) by niro
File size: 6847 byte(s)
auto added: ver bump to 4.5.2-r1
1 # $Id: gcc-4.3.4-r4.smage2 5620 2010-07-15 17:04:00Z niro $
2
3 PNAME="gcc"
4 PVER="4.5.2"
5 PBUILD="r1"
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.21
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 SPLIT_PACKAGES="libstdc++ libstdc++-dev gcc"
23
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
31
32 SRC_URI=(
33 gnu://${PNAME}/${PNAME}-${PVER}/${SRCFILE}
34 mirror://${PNAME}/${SRCFILE}
35 mirror://${PNAME}/${PNAME}-4.5.1-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++-dev-${PVER}
58 >= sys-dev/binutils-2.21
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 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 src_prepare()
82 {
83 munpack ${SRCFILE} || die
84 cd ${SRCDIR}
85
86 # generic fixes
87 mpatch ${PNAME}-4.5.1-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 --enable-gnu-unique-object \
139 --enable-lto \
140 --enable-plugin \
141 --enable-gold \
142 --with-plugin-ld=ld.gold \
143 ${myconf} \
144 || die
145
146 # parallel builds seems to break sometimes on x86_64
147 local myopts
148 [[ ${ARCH} = x86_64 ]] && myopts=-j1
149
150 mmake ${myopts} bootstrap-lean || die
151 }
152
153 src_install_gcc()
154 {
155 cd ${SRCDIR}/build
156 minstalldir /$(mlibdir) || die
157
158 # install all targets
159 make DESTDIR=${BINDIR} install || die
160
161 # versionize all bins and symlink them
162 for bin in $(find ${BINDIR}/usr/bin -type f)
163 do
164 echo ${bin}
165 mv ${bin} ${bin}-${PVER} || die
166 ln -snf $(basename ${bin}-${PVER}) ${bin} || die
167 done
168
169 mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die
170 # this one is needed on multilib systems.
171 # rpcgen may not find the cpp compiler correctly if not in /lib/cpp
172 if [[ $(mlibdir) != lib ]]
173 then
174 minstalldir /lib || die
175 mlink ../usr/bin/cpp-${PVER} /lib/cpp || die
176 fi
177 mlink gcc-${PVER} /usr/bin/cc || die
178
179 # deletes libstdc++ && libgcc_s && libssp && libgomp
180 rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die
181 if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]]
182 then
183 rm ${BINDIR}/usr/lib/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die
184 fi
185
186 # fix all .la files
187 # they may contain invalid libpathes which are not needed
188 local la
189 for la in $(find ${BINDIR} -name \*.la)
190 do
191 fix_la_file ${la} || die ${la}
192 done
193 }
194
195 src_install_libstdc++()
196 {
197 cd ${SRCDIR}/build
198 minstalldir /$(mlibdir) || die
199
200 local target
201 for target in libstdc++-v3 libgcc libssp libgomp
202 do
203 make DESTDIR=${BINDIR} install-target-${target} || die
204 done
205
206 # move gdb scripts to a proper location and to pretty-print ldconfig
207 minstalldir /usr/share/gdb/autoload/usr/$(mlibdir) || die
208 mv ${BINDIR}/usr/$(mlibdir)/libstdc++*gdb.py* ${BINDIR}/usr/share/gdb/autoload/usr/$(mlibdir)/ || die
209 # multilib as well
210 if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]]
211 then
212 minstalldir /usr/share/gdb/autoload/usr/lib || die
213 mv ${BINDIR}/usr/lib/libstdc++*gdb.py* ${BINDIR}/usr/share/gdb/autoload/usr/lib/ || die
214 fi
215
216 # cleanup, only keep the libs, everything else get provided by the gcc-package
217 zapmost ${BINDIR}/usr/$(mlibdir) libgcc_s.so libgcc_s.so.* libstdc++.so libstdc++.so.* libssp.so libssp.so.* libgomp.so libgomp.so.* || die
218 # multilib as well
219 if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]]
220 then
221 zapmost ${BINDIR}/usr/lib libgcc_s.so libgcc_s.so.* libstdc++.so libstdc++.so.* libssp.so libssp.so.* libgomp.so libgomp.so.* || die
222 fi
223
224 # clean up everything else
225 zapmost ${BINDIR} usr/$(mlibdir) $([[ $(mlibdir) != lib ]] && echo "usr/lib") || die
226 }
227
228 src_install_libstdc++-dev()
229 {
230 cd ${SRCDIR}/build
231 minstalldir /$(mlibdir) || die
232
233 local target
234 for target in libstdc++-v3 libgcc libssp
235 do
236 make DESTDIR=${BINDIR} install-target-${target} || die
237 done
238
239 # cleanup, only keep the libs, everything else get provided by the gcc-package
240 zapmost ${BINDIR}/usr/$(mlibdir) libgcc_s.a libgcc_s.la libstdc++.a libstdc++.la libssp.a libssp.la libgomp.a libgomp.la || die
241 # multilib as well
242 if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]]
243 then
244 zapmost ${BINDIR}/usr/lib libgcc_s.a libgcc_s.la libstdc++.a libstdc++.la libssp.a libssp.la libgomp.a libgomp.la || die
245 fi
246
247 # clean up everything else
248 zapmost ${BINDIR} usr/$(mlibdir) $([[ $(mlibdir) != lib ]] && echo "usr/lib") || die
249
250 # fix all .la files
251 # they may contain invalid libpathes which are not needed
252 local la
253 for la in $(find ${BINDIR} -name \*.la)
254 do
255 fix_la_file ${la} || die ${la}
256 done
257 }
258