Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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