1
%define cross_compile 0
2
%{?_with_crosscompile: %{expand: %%define cross_compile 1}}
4
# Define `coff' as 1 if you want to add i386-coff instead of i386-pe.
6
%{?_with_coff: %{expand: %%define coff 1}}
8
%{?_with_all: %{expand: %%define all_targets 1}}
10
Summary: A GNU collection of binary utilities.
15
Group: Development/Tools
16
URL: http://sources.redhat.com/binutils
17
Source: http://ftp.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.gz
18
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
19
Prereq: /sbin/install-info
22
Binutils is a collection of binary utilities, including ar (for creating,
23
modifying and extracting from archives), nm (for listing symbols from
24
object files), objcopy (for copying and translating object files),
25
objdump (for displaying information from object files), ranlib (for
26
generating an index for the contents of an archive), size (for listing
27
the section sizes of an object or archive file), strings (for listing
28
printable strings from files), strip (for discarding symbols), c++filt
29
(a filter for demangling encoded C++ symbols), addr2line (for converting
30
addresses to file and line), and nlmconv (for converting object code into
33
Install binutils if you need to perform any of these types of actions on
34
binary files. Most programmers will want to install binutils.
40
patch -p1 -b --suffix .isa < mips/binutils-mips-isa.patch
41
find -name "*.rej" | grep rej && exit 1
45
if [ -x /usr/bin/getconf ] ; then
46
NRPROC=$(/usr/bin/getconf _NPROCESSORS_ONLN)
47
if [ $NRPROC -eq 0 ] ; then
53
echo "MAKE=make -j $NRPROC" > makefile
54
echo "include Makefile" >> makefile
58
ADDITIONAL_TARGETS="--enable-targets=alpha-linux,arm-linux,cris-linux,hppa-linux,i386-linux,x86_64-linux,ia64-linux,m68k-linux,mips-linux,mips64-linux,mips64el-linux,mipsel-linux,ppc-linux,s390-linux,s390x-linux,sh-linux,sparc-linux,sparc64-linux,i386-linuxaout"
61
ADDITIONAL_TARGETS="--enable-targets=i386-linuxaout"
64
ADDITIONAL_TARGETS="--enable-targets=sparc64-linux"
69
ADDITIONAL_TARGETS="${ADDITIONAL_TARGETS},i386-coff"
71
ADDITIONAL_TARGETS="${ADDITIONAL_TARGETS},i386-pe"
76
# Binutils come with its own custom libtool
77
%define __libtoolize echo
82
RANLIB=%{__ranlib}; export RANLIB
83
%configure --enable-shared $ADDITIONAL_TARGETS
85
make headers -C bfd CFLAGS=-O
86
make tooldir=%{_prefix} all info CFLAGS_FOR_BUILD="-O -pipe"
89
make tooldir=%{_prefix} all info
93
rm -rf ${RPM_BUILD_ROOT}
94
mkdir -p ${RPM_BUILD_ROOT}%{_prefix}
95
# Works for both rpm 3.0 and 4.0.
96
make prefix=${RPM_BUILD_ROOT}%{_prefix} \
97
exec_prefix=$RPM_BUILD_ROOT%{_prefix} \
98
tooldir=$RPM_BUILD_ROOT%{_prefix} \
99
infodir=${RPM_BUILD_ROOT}%{_infodir} \
100
mandir=${RPM_BUILD_ROOT}%{_mandir} \
101
includedir=$RPM_BUILD_ROOT%{_prefix}/include \
102
libdir=$RPM_BUILD_ROOT%{_prefix}/lib \
103
bindir=$RPM_BUILD_ROOT%{_prefix}/bin \
105
#%makeinstall tooldir=${RPM_BUILD_ROOT}%{_prefix}
106
#make prefix=${RPM_BUILD_ROOT}%{_prefix} infodir=${RPM_BUILD_ROOT}%{_infodir} install-info
107
strip ${RPM_BUILD_ROOT}%{_prefix}/bin/*
108
gzip -q9f ${RPM_BUILD_ROOT}%{_infodir}/*.info*
110
#install -m 644 libiberty/libiberty.a ${RPM_BUILD_ROOT}%{_prefix}/lib
111
install -m 644 include/libiberty.h ${RPM_BUILD_ROOT}%{_prefix}/include
113
chmod +x ${RPM_BUILD_ROOT}%{_prefix}/lib/lib*.so*
115
# This one comes from egcs
116
rm -f ${RPM_BUILD_ROOT}%{_prefix}/bin/c++filt
119
rm -rf ${RPM_BUILD_ROOT}
123
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz
124
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz
125
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
126
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
127
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz
128
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/standards.info.gz
132
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz
133
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz
134
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
135
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
136
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz
137
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/standards.info.gz
140
%postun -p /sbin/ldconfig
143
%defattr(-,root,root)