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