Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 13 - (show annotations) (download)
Sat Jan 2 20:58:24 2010 UTC (14 years, 4 months ago) by niro
File size: 5325 byte(s)
auto added: ver bump to 4.3.4-r2
1 # $Id$
2
3 PNAME="gcc"
4 PVER="4.3.4"
5 PBUILD="r2"
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 SDEPEND=">= virtual/kernel-headers
20 >= sys-dev/binutils-2.20
21 >= virtual/glibc
22 >= dev-libs/gmp-4.2.4
23 >= dev-libs/mpfr-2.3.2"
24
25 SPLIT_PACKAGES="gcc libstdc++"
26
27 SRCFILE="${PNAME}-${PVER}.tar.bz2"
28 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
29
30 # languages to build into gcc
31 MyLanguages=c,c++
32
33 sminclude mtools cleanutils libtool
34
35 SRC_URI=(
36 gnu://${PNAME}/${PNAME}-${PVER}/${SRCFILE}
37 mirror://${PNAME}/${SRCFILE}
38 mirror://${PNAME}/${PNAME}-4.3.2-no-fixincludes.patch
39 )
40
41 UP2DATE="updatecmd \"http://ftp.gnu.org/gnu/${PNAME}/?C=M;O=A\" | sed -n 's/.*${PNAME}-\(.*\)\//\1/;$ p'"
42
43 # gcc don't like strong CFLAGS
44 export CFLAGS="${CFLAGS//-O?} -O2"
45 export CXXFLAGS="${CFLAGS}"
46
47 # check for crosscompile or export default CHOST
48 if [[ -z ${CCHOST} ]]
49 then
50 # no crosscompile defined
51 export CCHOST=${CHOST}
52 else
53 # use crosscompile host
54 export CCHOST=${CCHOST}
55 fi
56
57 split_info_gcc()
58 {
59 DESCRIPTION="Modern C/C++ compiler written by the GNU people."
60 DEPEND="== sys-libs/libstdc++-${PVER}
61 >= sys-dev/binutils-2.20
62 >= virtual/glibc
63 >= dev-libs/gmp-4.2.4
64 >= dev-libs/mpfr-2.3.2"
65
66 postinstall()
67 {
68 echo
69 echo "Please remember that the flag -mcpu does not exist anymore."
70 echo "It has been replaced with '-mtune'. Please update your /etc/mage.rc."
71 echo
72 }
73 }
74
75 split_info_libstdc++()
76 {
77 DESCRIPTION="Standard GNU C and C++ libraries."
78
79 # needed to prevent compat issues with gcc-3.4.x and gcc-4.0.x
80 DEPEND=">= sys-libs/libstdc++-v3-3.3.3
81 >= sys-apps/base-files-0.1"
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*.* libstdc++*.* libssp*.* || die
206 # multilib as well
207 if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]]
208 then
209 zapmost ${BINDIR}/usr/lib libgcc_s*.* libstdc++*.* libssp*.* || die
210 fi
211
212 # clean up everything else
213 zapmost ${BINDIR} usr/$(mlibdir) $([[ $(mlibdir) != lib ]] && echo "usr/lib") || die
214
215 # fix all .la files
216 # they may contain invalid libpathes which are not needed
217 local la
218 for la in $(find ${BINDIR} -name \*.la)
219 do
220 fix_la_file ${la} || die ${la}
221 done
222 }

Properties

Name Value
svn:keywords Id