Magellan Linux

Contents of /trunk/core/gcc/gcc-4.3.4-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id