Magellan Linux

Contents of /smage/trunk/core/binutils/binutils-2.25.1-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8219 - (show annotations) (download)
Mon Jan 11 12:10:24 2016 UTC (8 years, 3 months ago) by niro
File size: 2348 byte(s)
-linux-libc-headers-4.1.15, binutils-2.25.1, glibc-2.22, gcc-5.3.0 toolchain - stage1
1 # $Id$
2
3 PNAME="binutils"
4 PVER="2.25.1"
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 DEPEND=">= virtual/glibc
16 >= sys-libs/zlib-1.2.8"
17 if [[ ${GOLD_ENABLED} = 1 ]]
18 then
19 # ld.gold needs libstdc++ and libgcc
20 DEPEND="${DEPEND}
21 >= sys-libs/libgcc-5.3.0
22 >= sys-libs/libstdc++-5.3.0"
23 fi
24 SDEPEND=">= virtual/kernel-headers"
25
26 SRCFILE="${PNAME}-${PVER}.tar.gz"
27 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
28
29 sminclude mtools
30
31 SRC_URI=(
32 http://www.kernel.org/pub/linux/devel/${PNAME}/${SRCFILE}
33 gnu://${PNAME}/${SRCFILE}
34 mirror://${PNAME}/${SRCFILE}
35 mirror://${PNAME}/${PNAME}-2.25-qt-gold.patch
36 )
37
38 # unstable
39 #UP2DATE="updatecmd ${HOMEPAGE} | sed -n 's/.*release.binutils-\(.*\).*/\1/;$ p'"
40 # stable only
41 UP2DATE="updatecmd_gnu ${PNAME} gz"
42
43 # binutils don't like strong CFLAGS
44 export CFLAGS="${CFLAGS//-O?} -O2"
45 export CXXFLAGS="${CFLAGS}"
46
47 if [[ -z ${CCHOST} ]]
48 then
49 # no crosscompile defined
50 export CCHOST=${CHOST}
51 else
52 # use crosscompile host
53 export CCHOST=${CCHOST}
54 fi
55
56 src_prepare()
57 {
58 munpack ${SRCFILE} || die
59 install -d ${SRCDIR}/build || die
60 cd ${SRCDIR}
61
62 # fix libQtGui chrashes when linked with gold
63 # see: https://sourceware.org/bugzilla/show_bug.cgi?id=16992
64 mpatch ${PNAME}-2.25-qt-gold.patch || die
65 }
66
67 src_compile()
68 {
69 cd ${SRCDIR}/build
70
71 local myopts
72 if [[ ${GOLD_ENABLED} = 1 ]]
73 then
74 myopts+=" --enable-gold"
75 myopts+=" --enable-ld=default"
76 fi
77
78 #--enable-64-bit-bfd \
79 # fixes compilation, use 'ar' instead of '${CHOST}-ar'
80 AR=ar \
81 ../configure \
82 --host=${CHOST} \
83 --target=${CCHOST} \
84 --prefix=/usr \
85 --mandir=/usr/share/man \
86 --infodir=/usr/share/info \
87 --libdir=/usr/$(mlibdir) \
88 --with-bugurl="http://bugs.magellan-linux.de/" \
89 --enable-shared \
90 --enable-plugins \
91 --enable-threads \
92 --disable-werror \
93 --disable-gdb \
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 # fix missing symlinks
110 local i
111 for i in ar nm ranlib
112 do
113 mlink ${i} /usr/bin/${CHOST}-${i} || die
114 done
115
116 cd ${SRCDIR}
117 minstalldocs ChangeLog* COPYING* MAINTAINERS README* || die
118 }