Magellan Linux

Annotation of /smage/branches/alx07x-stable/core/binutils/binutils-2.32-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 14933 - (hide annotations) (download)
Thu Aug 6 12:51:42 2020 UTC (3 years, 9 months ago) by niro
File size: 2348 byte(s)
-release branches/alx07x-stable
1 niro 14274 # $Id$
2    
3     PNAME="binutils"
4     PVER="2.32"
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-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     # fixes compilation, use 'ar' instead of '${CHOST}-ar'
76 niro 14382 # --enable-64-bit-bfd even on x86 required at least by grub
77 niro 14274 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     --enable-64-bit-bfd \
96     ${myopts} \
97     || die
98    
99     make configure-host || die
100     mmake tooldir=/usr all || die
101     }
102    
103     src_install()
104     {
105     cd ${SRCDIR}/build
106    
107     mmake DESTDIR=${BINDIR} tooldir=/usr install || die
108     minstallfile ../include/libiberty.h /usr/include || die
109    
110     # fix missing symlinks
111     local i
112     for i in ar nm ranlib
113     do
114     mlink ${i} /usr/bin/${CHOST}-${i} || die
115     done
116    
117     cd ${SRCDIR}
118     minstalldocs ChangeLog* COPYING* MAINTAINERS README* || die
119     }