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 | Summary: Binutils v%{binutils_version} for target %{_target} on host %{_host} |
---|
10 | Version: %{binutils_version} |
---|
11 | Release: %{release} |
---|
12 | URL: http://sources.redhat.com/binutils |
---|
13 | BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) |
---|
14 | |
---|
15 | # |
---|
16 | # Source |
---|
17 | # |
---|
18 | Source0: ftp://ftp.gnu.org/gnu/binutils/binutils-%{binutils_version}.tar.bz2 |
---|
19 | |
---|
20 | # |
---|
21 | # Prepare the source code. |
---|
22 | # |
---|
23 | %prep |
---|
24 | %setup -q -c -T -n %{name}-%{version} |
---|
25 | %setup -q -D -T -n %{name}-%{version} -a0 |
---|
26 | cd binutils-%{binutils_version} |
---|
27 | %{?patch0:%patch0 -p1} |
---|
28 | cd .. |
---|
29 | |
---|
30 | %build |
---|
31 | export PATH="%{_bindir}:${PATH}" |
---|
32 | mkdir -p build |
---|
33 | cd build |
---|
34 | %if "%{_build}" != "%{_host}" |
---|
35 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
36 | %endif |
---|
37 | CFLAGS="$TB_OPT_FLAGS" \ |
---|
38 | ../binutils-%{binutils_version}/configure \ |
---|
39 | --build=%{_build} --host=%{_host} \ |
---|
40 | --target=%{_target} \ |
---|
41 | --verbose --disable-nls \ |
---|
42 | --without-included-gettext \ |
---|
43 | --disable-win32-registry \ |
---|
44 | --disable-werror \ |
---|
45 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
46 | --exec-prefix=%{_exec_prefix} \ |
---|
47 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
48 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
49 | |
---|
50 | %{__make} %{?_smp_mflags} all |
---|
51 | cd .. |
---|
52 | |
---|
53 | %install |
---|
54 | export PATH="%{_bindir}:${PATH}" |
---|
55 | rm -rf $TB_BUILD_ROOT |
---|
56 | |
---|
57 | cd build |
---|
58 | %{__make} DESTDIR=$TB_BUILD_ROOT install |
---|
59 | |
---|
60 | # Dropped in FSF-binutils-2.9.5, but Cygwin still ships it. |
---|
61 | rm -rf $TB_BUILD_ROOT%{_infodir}/configure.info* |
---|
62 | |
---|
63 | rm -f $TB_BUILD_ROOT%{_infodir}/dir |
---|
64 | touch $TB_BUILD_ROOT%{_infodir}/dir |
---|
65 | |
---|
66 | # binutils does not install share/locale, however it uses it |
---|
67 | mkdir -p $TB_BUILD_ROOT%{_prefix}/share/locale |
---|
68 | |
---|
69 | # We don't ship host files |
---|
70 | rm -f ${TB_BUILD_ROOT}%{_libdir}/libiberty* |
---|
71 | |
---|
72 | # manpages without corresponding tools |
---|
73 | if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-dlltool%{_exeext}; then |
---|
74 | rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-dlltool* |
---|
75 | fi |
---|
76 | if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-nlmconv%{_exeext}; then |
---|
77 | rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-nlmconv* |
---|
78 | fi |
---|
79 | if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-windres%{_exeext}; then |
---|
80 | rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windres* |
---|
81 | fi |
---|
82 | if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-windmc%{_exeext}; then |
---|
83 | rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windmc* |
---|
84 | fi |
---|
85 | |
---|
86 | cd .. |
---|