Magellan Linux

Annotation of /smage/trunk/core/gcc/gcc-4.5.1-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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