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