Magellan Linux

Contents of /branches/R11-stable/core/binutils/binutils-2.24-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21599 - (show annotations) (download)
Mon Jul 21 09:20:09 2014 UTC (9 years, 9 months ago) by niro
File size: 2088 byte(s)
-release branches/R11-stable
1 # $Id$
2
3 PNAME="binutils"
4 PVER="2.24"
5 PBUILD="r3"
6
7 PCAT="sys-dev"
8
9 DESCRIPTION="Tools necessary to build programs."
10 HOMEPAGE="http://www.kernel.org/pub/linux/devel/binutils/"
11
12 # enabled 1, or disabled 0
13 GOLD_ENABLED=1
14
15 if [[ ${GOLD_ENABLED} = 1 ]]
16 then
17 # ld.gold needs libstdc++ and libgcc
18 DEPEND=">= sys-libs/libgcc-4.8.3
19 >= sys-libs/libstdc++-4.8.3"
20 else
21 DEPEND=">= virtual/glibc"
22 fi
23 SDEPEND=">= virtual/kernel-headers"
24
25 SRCFILE="${PNAME}-${PVER}.tar.gz"
26 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
27
28 sminclude mtools
29
30 SRC_URI=(
31 http://www.kernel.org/pub/linux/devel/${PNAME}/${SRCFILE}
32 gnu://${PNAME}/${SRCFILE}
33 mirror://${PNAME}/${SRCFILE}
34 mirror://${PNAME}/${PNAME}-2.16.91.0.5-multilib.patch
35 )
36
37 # unstable
38 #UP2DATE="updatecmd ${HOMEPAGE} | sed -n 's/.*release.binutils-\(.*\).*/\1/;$ p'"
39 # stable only
40 UP2DATE="updatecmd 'http://ftp.gnu.org/gnu/${PNAME}/?C=M;O=A' | lasttarball gz"
41
42 # binutils don't like strong CFLAGS
43 export CFLAGS="${CFLAGS//-O?} -O2"
44 export CXXFLAGS="${CFLAGS}"
45
46 if [[ -z ${CCHOST} ]]
47 then
48 # no crosscompile defined
49 export CCHOST=${CHOST}
50 else
51 # use crosscompile host
52 export CCHOST=${CCHOST}
53 fi
54
55 src_prepare()
56 {
57 munpack ${SRCFILE} || die
58 install -d ${SRCDIR}/build || die
59
60 cd ${SRCDIR}
61 mpatch ${PNAME}-2.16.91.0.5-multilib.patch || die
62 }
63
64 src_compile()
65 {
66 cd ${SRCDIR}/build
67
68 local myopts
69 if [[ ${GOLD_ENABLED} = 1 ]]
70 then
71 myopts+=" --enable-gold"
72 myopts+=" --enable-ld=default"
73 fi
74
75 #--enable-64-bit-bfd \
76 # fixes compilation, use 'ar' instead of '${CHOST}-ar'
77 AR=ar \
78 ../configure \
79 --host=${CHOST} \
80 --target=${CCHOST} \
81 --prefix=/usr \
82 --mandir=/usr/share/man \
83 --infodir=/usr/share/info \
84 --libdir=/usr/$(mlibdir) \
85 --enable-shared \
86 --enable-plugins \
87 --enable-threads \
88 --disable-werror \
89 --with-pic \
90 ${myopts} \
91 || die
92
93 make configure-host || die
94 mmake tooldir=/usr all || die
95 }
96
97 src_install()
98 {
99 cd ${SRCDIR}/build
100
101 mmake DESTDIR=${BINDIR} tooldir=/usr install || die
102 minstallfile ../include/libiberty.h /usr/include || die
103
104 cd ${SRCDIR}
105 minstalldocs ChangeLog* COPYING* MAINTAINERS README* || die
106 }