Magellan Linux

Contents of /smage/trunk/core/gcc/gcc-4.3.4-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id