Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id