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