1 | # |
---|
2 | # Binutils 2.xx Version 1. |
---|
3 | # |
---|
4 | # This configuration file configure's, make's and install's binutils. |
---|
5 | # |
---|
6 | |
---|
7 | %include %{_configdir}/checks.cfg |
---|
8 | |
---|
9 | # |
---|
10 | # Select Snapshot Macro Maps |
---|
11 | # |
---|
12 | %select binutils-snapshot |
---|
13 | |
---|
14 | # |
---|
15 | # The description. |
---|
16 | # |
---|
17 | Name: %{_target}-binutils-%{binutils_version}-%{_host}-%{release} |
---|
18 | Summary: Binutils v%{binutils_version} for target %{_target} on host %{_host} |
---|
19 | Version: %{binutils_version} |
---|
20 | Release: %{release} |
---|
21 | URL: http://sources.redhat.com/binutils |
---|
22 | |
---|
23 | # |
---|
24 | # Supports Candian Cross (Cxc). |
---|
25 | # |
---|
26 | %define allow_cxc |
---|
27 | |
---|
28 | # |
---|
29 | # Default gold and LTO to disable. |
---|
30 | # |
---|
31 | %ifn %{defined with_gold} |
---|
32 | %define with_gold 0 |
---|
33 | %endif |
---|
34 | %ifn %{defined with_lto} |
---|
35 | %define with_lto 0 |
---|
36 | %endif |
---|
37 | |
---|
38 | # |
---|
39 | # Source |
---|
40 | # |
---|
41 | %source set binutils https://ftp.gnu.org/gnu/binutils/binutils-%{binutils_version}.tar.bz2 |
---|
42 | |
---|
43 | # |
---|
44 | # Prepare the source code. |
---|
45 | # |
---|
46 | %prep |
---|
47 | build_top=$(pwd) |
---|
48 | |
---|
49 | binutils_source=%{?binutils_external:%{binutils_expand_name}}%{!?binutils_external:"binutils-%{binutils_version}"} |
---|
50 | |
---|
51 | source_dir_binutils=${binutils_source} |
---|
52 | %source setup binutils -q -n ${binutils_source} |
---|
53 | %patch setup binutils -p1 |
---|
54 | |
---|
55 | cd ${build_top} |
---|
56 | |
---|
57 | %build |
---|
58 | build_top=$(pwd) |
---|
59 | |
---|
60 | %{build_directory} |
---|
61 | |
---|
62 | mkdir -p ${build_dir} |
---|
63 | cd ${build_dir} |
---|
64 | |
---|
65 | %{host_build_flags} |
---|
66 | |
---|
67 | ../${source_dir_binutils}/configure \ |
---|
68 | --build=%{_build} --host=%{_host} \ |
---|
69 | --target=%{_target} \ |
---|
70 | --verbose --disable-nls \ |
---|
71 | --disable-gdb --disable-libdecnumber --disable-readline --disable-sim \ |
---|
72 | %{?with_deterministic_archives:--enable-deterministic-archives} \ |
---|
73 | %{?with_64_bit_bfd:--enable-64-bit-bfd} \ |
---|
74 | %{?with_gold:--enable-gold=yes} \ |
---|
75 | %{?with_lto:--enable-lto --enable-plugins}%{!?with_lto:--disable-lto} \ |
---|
76 | --without-included-gettext \ |
---|
77 | --disable-win32-registry \ |
---|
78 | --disable-werror \ |
---|
79 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
80 | --exec-prefix=%{_exec_prefix} \ |
---|
81 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
82 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
83 | |
---|
84 | %{__make} %{?_smp_mflags} all |
---|
85 | |
---|
86 | cd ${build_top} |
---|
87 | |
---|
88 | %install |
---|
89 | cd ${build_top} |
---|
90 | |
---|
91 | %{__rmdir} $SB_BUILD_ROOT |
---|
92 | |
---|
93 | cd ${build_dir} |
---|
94 | %{__make} DESTDIR=$SB_BUILD_ROOT install |
---|
95 | |
---|
96 | # Dropped in FSF-binutils-2.9.5, but Cygwin still ships it. |
---|
97 | %{__rmdir} $SB_BUILD_ROOT%{_infodir}/configure.info* |
---|
98 | |
---|
99 | %{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir |
---|
100 | touch $SB_BUILD_ROOT%{_infodir}/dir |
---|
101 | |
---|
102 | # binutils does not install share/locale, however it uses it |
---|
103 | mkdir -p $SB_BUILD_ROOT%{_prefix}/share/locale |
---|
104 | |
---|
105 | # We don't ship host files |
---|
106 | %{__rmfile} ${SB_BUILD_ROOT}%{_libdir}/libiberty* |
---|
107 | |
---|
108 | # manpages without corresponding tools |
---|
109 | if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-dlltool%{_exeext}; then |
---|
110 | %{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-dlltool* |
---|
111 | fi |
---|
112 | if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-nlmconv%{_exeext}; then |
---|
113 | %{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-nlmconv* |
---|
114 | fi |
---|
115 | if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-windres%{_exeext}; then |
---|
116 | %{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windres* |
---|
117 | fi |
---|
118 | if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-windmc%{_exeext}; then |
---|
119 | %{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windmc* |
---|
120 | fi |
---|
121 | |
---|
122 | cd ${build_top} |
---|