]>
Commit | Line | Data |
---|---|---|
166a6c21 | 1 | ############################################################################### |
802ea3af MT |
2 | # IPFire.org - An Open Source Firewall Solution # |
3 | # Copyright (C) - IPFire Development Team <info@ipfire.org> # | |
166a6c21 MT |
4 | ############################################################################### |
5 | ||
802ea3af | 6 | name = binutils |
c10220b1 | 7 | version = 2.34 |
4c4a5d3c | 8 | release = 1 |
166a6c21 | 9 | |
802ea3af MT |
10 | maintainer = Michael Tremer <michael.tremer@ipfire.org> |
11 | groups = Development/Tools | |
12 | url = http://www.gnu.org/software/binutils/ | |
13 | license = GPLv2+ | |
14 | summary = The GNU Binutils are a collection of binary tools. | |
166a6c21 | 15 | |
802ea3af MT |
16 | description |
17 | The GNU Binary Utilities, or binutils, is a collection of programming | |
166a6c21 | 18 | tools for the manipulation of object code in various object file formats. |
802ea3af MT |
19 | end |
20 | ||
3e4070b5 MT |
21 | source_dl = https://ftp.gnu.org/gnu/binutils/ \ |
22 | https://sourceware.org/pub/binutils/releases/ | |
23 | sources = %{thisapp}.tar.xz | |
802ea3af MT |
24 | |
25 | build | |
26 | requires | |
27 | bison | |
28 | dejagnu | |
29 | flex | |
30 | gcc-c++ | |
e5e21531 | 31 | pakfire-builder >= 0.9.23-5 |
602900c1 | 32 | perl |
802ea3af MT |
33 | texinfo |
34 | zlib-devel | |
35 | end | |
36 | ||
37 | prepare_cmds | |
38 | mkdir -pv %{DIR_SRC}/binutils-build | |
39 | ||
602900c1 MT |
40 | # On aarch64 we might use 64KiB pages |
41 | sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*aarch64.c | |
42 | ||
802ea3af MT |
43 | # Suppress the installation of an outdated standards.info file as a newer |
44 | # one is installed later on in the Autoconf instructions: | |
45 | rm -fv etc/standards.info | |
46 | sed -e '/^INFO/s/standards.info //' -i etc/Makefile.in | |
47 | ||
602900c1 | 48 | perl -pi -e 's/i\[3-7\]86/i[34567]86/g' */conf* |
802ea3af | 49 | sed -i -e 's/%''{release}/%{release}/g' bfd/Makefile{.am,.in} |
602900c1 MT |
50 | sed -i -e '/^libopcodes_la_\(DEPENDENCIES\|LIBADD\)/s,$, ../bfd/libbfd.la,' opcodes/Makefile.{am,in} |
51 | ||
52 | # Build libbfd.so and libopcodes.so with -Bsymbolic-functions if possible. | |
53 | if gcc %{CFLAGS} -v --help 2>&1 | grep -q -- -Bsymbolic-functions; then | |
54 | sed -i -e 's/^libbfd_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' bfd/Makefile.{am,in} | |
55 | sed -i -e 's/^libopcodes_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' opcodes/Makefile.{am,in} | |
56 | fi | |
57 | touch */configure | |
802ea3af MT |
58 | end |
59 | ||
bb86d46e | 60 | configure_options += \ |
f71c9576 MT |
61 | --build=%{DISTRO_BUILDTARGET} \ |
62 | --host=%{DISTRO_BUILDTARGET} \ | |
bb86d46e MT |
63 | --target=%{DISTRO_BUILDTARGET} \ |
64 | --disable-werror \ | |
f71c9576 MT |
65 | --disable-static \ |
66 | --enable-64-bit-bfd \ | |
67 | --enable-plugins \ | |
3e4070b5 MT |
68 | --with-bugurl="http://bugzilla.ipfire.org/" \ |
69 | --enable-relro=yes \ | |
70 | --enable-lto | |
802ea3af MT |
71 | |
72 | build | |
68b0def9 MT |
73 | cd %{DIR_SRC}/binutils-build |
74 | ../%{thisapp}/configure \ | |
bb86d46e | 75 | %{configure_options} |
68b0def9 MT |
76 | |
77 | make tooldir=/usr %{PARALLELISMFLAGS} | |
802ea3af MT |
78 | end |
79 | ||
0c98d65a MT |
80 | test |
81 | cd %{DIR_SRC}/binutils-build | |
82 | make -k check </dev/null || : | |
83 | ||
84 | echo "==== RESULTS ====" | |
85 | cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum | |
86 | end | |
802ea3af MT |
87 | |
88 | install | |
0c98d65a MT |
89 | cd %{DIR_SRC}/binutils-build |
90 | make tooldir=/usr install DESTDIR=%{BUILDROOT} | |
802ea3af MT |
91 | |
92 | cp -fv %{DIR_APP}/include/libiberty.h %{BUILDROOT}/usr/include | |
d5518e81 MT |
93 | |
94 | # Prevent packages from linking against libbfd and libopcodes, | |
95 | # because they change too often. | |
bb86d46e | 96 | rm -rfv %{BUILDROOT}%{libdir}/lib{bfd,opcodes}.so |
0c98d65a MT |
97 | |
98 | # Remove Windows/Novell only man pages. | |
99 | rm -vf %{BUILDROOT}%{mandir}/man1/{dlltool,nlmconv,windres}* | |
802ea3af | 100 | end |
68b0def9 MT |
101 | |
102 | # Keep static version of libiberty. | |
103 | keep_libraries | |
bb86d46e | 104 | %{libdir}/libiberty.a |
68b0def9 | 105 | end |
802ea3af MT |
106 | end |
107 | ||
108 | packages | |
109 | package %{name} | |
e5e21531 MT |
110 | provides |
111 | bundled(libiberty) | |
112 | end | |
113 | end | |
974699b4 MT |
114 | |
115 | package %{name}-devel | |
116 | template DEVEL | |
f45434a7 | 117 | |
e5e21531 MT |
118 | requires |
119 | binutils = %{thisver} | |
120 | zlib-devel | |
121 | end | |
122 | ||
f45434a7 MT |
123 | # Don't package libbfd and libopcodes in the -devel package. |
124 | files | |
125 | /usr/include | |
56c5b2e4 | 126 | %{libdir}/*.a |
f45434a7 | 127 | end |
802ea3af | 128 | end |
1f9bc2f0 MT |
129 | |
130 | package %{name}-debuginfo | |
131 | template DEBUGINFO | |
132 | end | |
802ea3af | 133 | end |