Contents of /smage/branches/alx07x-unstable/core/binutils/binutils-2.32-r2.smage2
Parent Directory | Revision Log
Revision 13056 -
(show annotations)
(download)
Wed Jun 19 13:37:44 2019 UTC (5 years, 3 months ago) by niro
Original Path: smage/trunk/core/binutils/binutils-2.32-r2.smage2
File size: 2287 byte(s)
Wed Jun 19 13:37:44 2019 UTC (5 years, 3 months ago) by niro
Original Path: smage/trunk/core/binutils/binutils-2.32-r2.smage2
File size: 2287 byte(s)
-linux-libc-headers-4.9.182, binutils-2.32, glibc-2.27, gcc-8.3.0 toolchain - stage2
1 | # $Id$ |
2 | |
3 | PNAME="binutils" |
4 | PVER="2.32" |
5 | PBUILD="r2" |
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-8.3.0 |
22 | >= sys-libs/libstdc++-8.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 | ) |
36 | |
37 | # unstable |
38 | #UP2DATE="updatecmd ${HOMEPAGE} | sed -n 's/.*release.binutils-\(.*\).*/\1/;$ p'" |
39 | # stable only |
40 | UP2DATE="updatecmd_gnu ${PNAME} 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 | |
61 | src_compile() |
62 | { |
63 | cd ${SRCDIR}/build |
64 | |
65 | local myopts |
66 | if [[ ${GOLD_ENABLED} = 1 ]] |
67 | then |
68 | myopts+=" --enable-gold" |
69 | myopts+=" --enable-ld=default" |
70 | fi |
71 | |
72 | # fortify_source not supported |
73 | export CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} |
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 | --with-bugurl="http://bugs.magellan-linux.de/" \ |
86 | --enable-shared \ |
87 | --enable-plugins \ |
88 | --enable-threads \ |
89 | --enable-deterministic-archives \ |
90 | --enable-lto \ |
91 | --enable-relro \ |
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 | } |