Contents of /smage/trunk/core/binutils/binutils-2.23.1-r1.smage2
Parent Directory | Revision Log
Revision 4476 -
(show annotations)
(download)
Wed Mar 13 10:23:04 2013 UTC (11 years, 6 months ago) by niro
File size: 2035 byte(s)
Wed Mar 13 10:23:04 2013 UTC (11 years, 6 months ago) by niro
File size: 2035 byte(s)
auto added: ver bump to 2.23.1-r1
1 | # $Id$ |
2 | |
3 | PNAME="binutils" |
4 | PVER="2.23.1" |
5 | PBUILD="r1" |
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.7 |
19 | >= sys-libs/libstdc++-4.7" |
20 | else |
21 | DEPEND="" |
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 | fi |
73 | |
74 | # fixes compilation, use 'ar' instead of '${CHOST}-ar' |
75 | AR=ar \ |
76 | ../configure \ |
77 | --host=${CHOST} \ |
78 | --target=${CCHOST} \ |
79 | --prefix=/usr \ |
80 | --mandir=/usr/share/man \ |
81 | --infodir=/usr/share/info \ |
82 | --libdir=/usr/$(mlibdir) \ |
83 | --enable-shared \ |
84 | --enable-plugins \ |
85 | --enable-threads \ |
86 | --enable-64-bit-bfd \ |
87 | --disable-werror \ |
88 | --with-pic \ |
89 | ${myopts} \ |
90 | || die |
91 | |
92 | make configure-host || die |
93 | mmake tooldir=/usr all || die |
94 | } |
95 | |
96 | src_install() |
97 | { |
98 | cd ${SRCDIR}/build |
99 | |
100 | mmake DESTDIR=${BINDIR} tooldir=/usr install || die |
101 | minstallfile ../include/libiberty.h /usr/include || die |
102 | |
103 | cd ${SRCDIR} |
104 | minstalldocs ChangeLog* COPYING* MAINTAINERS README* || die |
105 | } |