Magellan Linux

Annotation of /smage/trunk/core/gcc/gcc-4.6.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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