Magellan Linux

Contents of /branches/R11-stable/core/binutils/binutils-2.23.2-r8.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 19255 - (show annotations) (download)
Tue Sep 3 14:43:12 2013 UTC (10 years, 7 months ago) by niro
File size: 2229 byte(s)
-release branches/R11-stable
1 # $Id$
2
3 PNAME="binutils"
4 PVER="2.23.2"
5 PBUILD="r8"
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
19 >= sys-libs/libstdc++-4.8"
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 # fix build with >= texinfo-5
64 sed -i -e 's/@colophon/@@colophon/' \
65 -e 's/doc@cygnus.com/doc@@cygnus.com/' \
66 bfd/doc/bfd.texinfo || die
67 }
68
69 src_compile()
70 {
71 cd ${SRCDIR}/build
72
73 local myopts
74 if [[ ${GOLD_ENABLED} = 1 ]]
75 then
76 myopts+=" --enable-gold"
77 myopts+=" --enable-ld=default"
78 fi
79
80 #--enable-64-bit-bfd \
81 # fixes compilation, use 'ar' instead of '${CHOST}-ar'
82 AR=ar \
83 ../configure \
84 --host=${CHOST} \
85 --target=${CCHOST} \
86 --prefix=/usr \
87 --mandir=/usr/share/man \
88 --infodir=/usr/share/info \
89 --libdir=/usr/$(mlibdir) \
90 --enable-shared \
91 --enable-plugins \
92 --enable-threads \
93 --disable-werror \
94 --with-pic \
95 ${myopts} \
96 || die
97
98 make configure-host || die
99 mmake tooldir=/usr all || die
100 }
101
102 src_install()
103 {
104 cd ${SRCDIR}/build
105
106 mmake DESTDIR=${BINDIR} tooldir=/usr install || die
107 minstallfile ../include/libiberty.h /usr/include || die
108
109 cd ${SRCDIR}
110 minstalldocs ChangeLog* COPYING* MAINTAINERS README* || die
111 }