Magellan Linux

Contents of /branches/magellan-next/core/binutils/binutils-2.22-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9751 - (show annotations) (download)
Tue Jan 10 15:45:17 2012 UTC (12 years, 3 months ago) by niro
File size: 1919 byte(s)
-fixed typos in dependencies
1 # $Id$
2
3 PNAME="binutils"
4 PVER="2.22"
5 PBUILD="r1"
6
7 PCATEGORIE="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.6
19 >= sys-libs/libstdc++-4.6"
20 else
21 DEPEND=""
22 fi
23 SDEPEND=">= virtual/kernel-headers"
24
25 SRCFILE="${PNAME}-${PVER}.tar.bz2"
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 UP2DATE="updatecmd ${HOMEPAGE} | sed -n 's/.*release.binutils-\(.*\).*/\1/;$ p'"
38
39 # binutils don't like strong CFLAGS
40 export CFLAGS="${CFLAGS//-O?} -O2"
41 export CXXFLAGS="${CFLAGS}"
42
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 install -d ${SRCDIR}/build || die
56
57 cd ${SRCDIR}
58 mpatch ${PNAME}-2.16.91.0.5-multilib.patch || die
59 }
60
61 src_compile()
62 {
63 cd ${SRCDIR}/build
64
65 local myopts
66 if [[ ${GOLD_ENABLED} = 1 ]]
67 then
68 myopts="--enable-gold"
69 fi
70
71 # fixes compilation, use 'ar' instead of '${CHOST}-ar'
72 AR=ar \
73 ../configure \
74 --host=${CHOST} \
75 --target=${CCHOST} \
76 --prefix=/usr \
77 --mandir=/usr/share/man \
78 --infodir=/usr/share/info \
79 --libdir=/usr/$(mlibdir) \
80 --enable-shared \
81 --enable-plugins \
82 --enable-threads \
83 --enable-64-bit-bfd \
84 --disable-werror \
85 ${myopts} \
86 || die
87
88 make configure-host || die
89 mmake tooldir=/usr all || die
90 }
91
92 src_install()
93 {
94 cd ${SRCDIR}/build
95
96 mmake DESTDIR=${BINDIR} tooldir=/usr install || die
97 minstallfile ../include/libiberty.h /usr/include || die
98
99 cd ${SRCDIR}
100 minstalldocs ChangeLog* COPYING* MAINTAINERS README* || die
101 }