Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id