Contents of /trunk/core/gcc/gcc-4.3.3-r2.smage2
Parent Directory | Revision Log
Revision 1799 -
(show annotations)
(download)
Sat May 30 21:37:21 2009 UTC (15 years, 4 months ago) by niro
File size: 3902 byte(s)
Sat May 30 21:37:21 2009 UTC (15 years, 4 months ago) by niro
File size: 3902 byte(s)
-fixed a typo
1 | # $Id$ |
2 | |
3 | PNAME="gcc" |
4 | PVER="4.3.3" |
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.19 |
15 | >= virtual/glibc |
16 | >= dev-libs/gmp-4.2.4 |
17 | >= dev-libs/mpfr-2.3.2" |
18 | |
19 | SDEPEND=">= virtual/kernel-headers" |
20 | |
21 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
22 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
23 | |
24 | # languages to build into gcc |
25 | MyLanguages=c,c++ |
26 | |
27 | sminclude mtools libtool |
28 | |
29 | SRC_URI=( |
30 | gnu://${PNAME}/${PNAME}-${PVER}/${SRCFILE} |
31 | mirror://${PNAME}/${SRCFILE} |
32 | mirror://${PNAME}/${PNAME}-4.3.2-no-fixincludes.patch |
33 | ) |
34 | |
35 | UP2DATE="updatecmd \"http://ftp.gnu.org/gnu/${PNAME}/?C=M;O=A\" | sed -n 's/.*${PNAME}-\(.*\)\//\1/;$ p'" |
36 | |
37 | # gcc don't like strong CFLAGS |
38 | export CFLAGS="${CFLAGS//-O?} -O2" |
39 | export CXXFLAGS="${CFLAGS}" |
40 | |
41 | # check for crosscompile or export default CHOST |
42 | if [[ -z ${CCHOST} ]] |
43 | then |
44 | # no crosscompile defined |
45 | export CCHOST=${CHOST} |
46 | else |
47 | # use crosscompile host |
48 | export CCHOST=${CCHOST} |
49 | fi |
50 | |
51 | src_prepare() |
52 | { |
53 | munpack ${SRCFILE} || die |
54 | cd ${SRCDIR} |
55 | |
56 | # generic fixes |
57 | mpatch ${PNAME}-4.3.2-no-fixincludes.patch || die |
58 | |
59 | # suppress installation of libiberty, as we will be |
60 | # using the one from binutils |
61 | sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || die |
62 | |
63 | install -d ${SRCDIR}/build || die |
64 | cd ${SRCDIR}/build |
65 | } |
66 | |
67 | src_compile() |
68 | { |
69 | cd ${SRCDIR}/build |
70 | |
71 | local myconf |
72 | |
73 | # you better off when not using distcc to compile |
74 | # your new compiler :) maybe not all are the same |
75 | export SMAGE_USE_DISTCC=false |
76 | |
77 | # Straight from the GCC install doc: |
78 | # "GCC has code to correctly determine the correct value for target |
79 | # for nearly all native systems. Therefore, we highly recommend you |
80 | # not provide a configure target when configuring a native compiler." |
81 | if [[ ${CHOST} != ${CCHOST} ]] |
82 | then |
83 | myconf+=" --target=${CCHOST}" |
84 | fi |
85 | |
86 | # gcc >= 4.3 has now configure flags for uri and version - yeah! |
87 | AR=ar \ |
88 | ../configure \ |
89 | --with-bugurl="http://bugs.magellan-linux.de/" \ |
90 | --with-pkgversion="Magellan-Linux" \ |
91 | --build=${CHOST} \ |
92 | --host=${CHOST} \ |
93 | --prefix=/usr \ |
94 | --mandir=/usr/share/man \ |
95 | --infodir=/usr/share/info \ |
96 | --libdir=/usr/$(mlibdir) \ |
97 | --libexecdir=/usr/$(mlibdir) \ |
98 | --enable-shared \ |
99 | --enable-threads=posix \ |
100 | --enable-__cxa_atexit \ |
101 | --enable-clocale=gnu \ |
102 | --disable-checking \ |
103 | --with-system-zlib \ |
104 | --enable-long-long \ |
105 | --enable-cstdio=stdio \ |
106 | --enable-languages=${MyLanguages} \ |
107 | --disable-libstdcxx-pch \ |
108 | ${myconf} \ |
109 | || die |
110 | |
111 | # parallel builds seems to break sometimes on x86_64 |
112 | local myopts |
113 | [[ ${ARCH} = x86_64 ]] && myopts=-j1 |
114 | |
115 | mmake ${myopts} bootstrap-lean || die |
116 | } |
117 | |
118 | src_install() |
119 | { |
120 | cd ${SRCDIR}/build |
121 | minstalldir /$(mlibdir) || die |
122 | |
123 | make DESTDIR=${BINDIR} install || die |
124 | |
125 | # versionize all bins and symlink them |
126 | for bin in $(find ${BINDIR}/usr/bin -type f) |
127 | do |
128 | echo ${bin} |
129 | mv ${bin} ${bin}-${PVER} || die |
130 | ln -snf $(basename ${bin}-${PVER}) ${bin} || die |
131 | done |
132 | |
133 | mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die |
134 | # this one is needed on multilib systems. |
135 | # rpcgen may not find the cpp compiler correctly if not in /lib/cpp |
136 | if [[ $(mlibdir) != lib ]] |
137 | then |
138 | minstalldir /lib || die |
139 | mlink ../usr/bin/cpp-${PVER} /lib/cpp || die |
140 | fi |
141 | mlink gcc-${PVER} /usr/bin/cc || die |
142 | |
143 | # deletes libstdc++ && libgcc_s |
144 | rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*,libssp*.*} || die |
145 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] |
146 | then |
147 | rm ${BINDIR}/usr/lib/{libgcc_s*.*,libstdc++*.*,libssp*.*} || die |
148 | fi |
149 | |
150 | # fix all .la files |
151 | # the contain invalid libpathes and they are not needed |
152 | local la |
153 | for la in $(find ${BINDIR} -name \*.la) |
154 | do |
155 | fix_la_file ${la} || die ${la} |
156 | done |
157 | } |
158 | |
159 | postinstall() |
160 | { |
161 | echo |
162 | echo "Please remember that the flag -mcpu does not exist anymore." |
163 | echo "It has been replaced with '-mtune'. Please update your /etc/mage.rc." |
164 | echo |
165 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |