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