Magellan Linux

Contents of /smage/branches/alx-0_6_0/core/gcc/gcc-4.5.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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