Annotation of /smage/trunk/core/binutils/binutils-2.32-r4.smage2
Parent Directory | Revision Log
Revision 13760 -
(hide annotations)
(download)
Tue Oct 29 12:26:17 2019 UTC (4 years, 7 months ago) by niro
File size: 2349 byte(s)
Tue Oct 29 12:26:17 2019 UTC (4 years, 7 months ago) by niro
File size: 2349 byte(s)
-linux-libc-headers-4.19.81, binutils-2.33.1, glibc-2.27, gcc-9.2.0 toolchain - stage1
1 | niro | 13745 | # $Id$ |
2 | |||
3 | PNAME="binutils" | ||
4 | PVER="2.32" | ||
5 | PBUILD="r4" | ||
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-9.1.0 | ||
22 | >= sys-libs/libstdc++-9.1.0" | ||
23 | fi | ||
24 | SDEPEND=">= virtual/kernel-headers" | ||
25 | |||
26 | SRCFILE="${PNAME}-${PVER}.tar.gz" | ||
27 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
28 | |||
29 | niro | 13760 | msetfeature "static !ccache !distcc" |
30 | niro | 13745 | sminclude mtools |
31 | |||
32 | SRC_URI=( | ||
33 | http://www.kernel.org/pub/linux/devel/${PNAME}/${SRCFILE} | ||
34 | gnu://${PNAME}/${SRCFILE} | ||
35 | mirror://${PNAME}/${SRCFILE} | ||
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 | } | ||
61 | |||
62 | src_compile() | ||
63 | { | ||
64 | cd ${SRCDIR}/build | ||
65 | |||
66 | local myopts | ||
67 | if [[ ${GOLD_ENABLED} = 1 ]] | ||
68 | then | ||
69 | myopts+=" --enable-gold" | ||
70 | myopts+=" --enable-ld=default" | ||
71 | fi | ||
72 | |||
73 | # fortify_source not supported | ||
74 | export CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} | ||
75 | |||
76 | #--enable-64-bit-bfd \ | ||
77 | # fixes compilation, use 'ar' instead of '${CHOST}-ar' | ||
78 | AR=ar \ | ||
79 | ../configure \ | ||
80 | --host=${CHOST} \ | ||
81 | --target=${CCHOST} \ | ||
82 | --prefix=/usr \ | ||
83 | --mandir=/usr/share/man \ | ||
84 | --infodir=/usr/share/info \ | ||
85 | --libdir=/usr/$(mlibdir) \ | ||
86 | --with-bugurl="http://bugs.magellan-linux.de/" \ | ||
87 | --enable-shared \ | ||
88 | --enable-plugins \ | ||
89 | --enable-threads \ | ||
90 | --enable-deterministic-archives \ | ||
91 | --enable-lto \ | ||
92 | --enable-relro \ | ||
93 | --disable-werror \ | ||
94 | --disable-gdb \ | ||
95 | --with-pic \ | ||
96 | niro | 13760 | --enable-system-zlib \ |
97 | niro | 13745 | ${myopts} \ |
98 | || die | ||
99 | |||
100 | make configure-host || die | ||
101 | mmake tooldir=/usr all || die | ||
102 | } | ||
103 | |||
104 | src_install() | ||
105 | { | ||
106 | cd ${SRCDIR}/build | ||
107 | |||
108 | mmake DESTDIR=${BINDIR} tooldir=/usr install || die | ||
109 | minstallfile ../include/libiberty.h /usr/include || die | ||
110 | |||
111 | # fix missing symlinks | ||
112 | local i | ||
113 | for i in ar nm ranlib | ||
114 | do | ||
115 | mlink ${i} /usr/bin/${CHOST}-${i} || die | ||
116 | done | ||
117 | |||
118 | cd ${SRCDIR} | ||
119 | minstalldocs ChangeLog* COPYING* MAINTAINERS README* || die | ||
120 | } |