~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to binutils/binutils.spec.in

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%define cross_compile 0
 
2
%{?_with_crosscompile: %{expand: %%define cross_compile 1}}
 
3
 
 
4
# Define `coff' as 1 if you want to add i386-coff instead of i386-pe.
 
5
%define coff 0
 
6
%{?_with_coff: %{expand: %%define coff 1}}
 
7
%define all_targets 0
 
8
%{?_with_all: %{expand: %%define all_targets 1}}
 
9
 
 
10
Summary: A GNU collection of binary utilities.
 
11
Name: binutils
 
12
Version: @VERSION@
 
13
Release: 1
 
14
Copyright: GPL
 
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
 
20
 
 
21
%description
 
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
 
31
an NLM). 
 
32
 
 
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.
 
35
 
 
36
%prep
 
37
%setup -q
 
38
 
 
39
%ifarch mips mipsel
 
40
patch -p1 -b --suffix .isa < mips/binutils-mips-isa.patch
 
41
find -name "*.rej" | grep rej && exit 1
 
42
%endif
 
43
 
 
44
%build
 
45
if [ -x /usr/bin/getconf ] ; then
 
46
  NRPROC=$(/usr/bin/getconf _NPROCESSORS_ONLN)
 
47
   if [ $NRPROC -eq 0 ] ; then
 
48
    NRPROC=1
 
49
  fi
 
50
else
 
51
  NRPROC=1
 
52
fi
 
53
echo "MAKE=make -j $NRPROC" > makefile
 
54
echo "include Makefile" >> makefile
 
55
ADDITIONAL_TARGETS=""
 
56
%ifos linux
 
57
%if %{all_targets}
 
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"
 
59
%else
 
60
%ifarch %{ix86}
 
61
ADDITIONAL_TARGETS="--enable-targets=i386-linuxaout"
 
62
%endif
 
63
%ifarch sparc
 
64
ADDITIONAL_TARGETS="--enable-targets=sparc64-linux"
 
65
%endif
 
66
%endif
 
67
%ifarch %{ix86}
 
68
%if %{coff}
 
69
ADDITIONAL_TARGETS="${ADDITIONAL_TARGETS},i386-coff"
 
70
%else
 
71
ADDITIONAL_TARGETS="${ADDITIONAL_TARGETS},i386-pe"
 
72
%endif
 
73
%endif
 
74
%endif
 
75
 
 
76
# Binutils come with its own custom libtool
 
77
%define __libtoolize echo
 
78
AR=%{__ar}; export AR
 
79
CC=%{__cc}; export CC
 
80
LD=%{__ld}; export LD
 
81
NM=%{__nm}; export NM
 
82
RANLIB=%{__ranlib}; export RANLIB
 
83
%configure --enable-shared $ADDITIONAL_TARGETS
 
84
%if %{cross_compile}
 
85
make headers -C bfd CFLAGS=-O
 
86
make tooldir=%{_prefix} all info CFLAGS_FOR_BUILD="-O -pipe"
 
87
%else
 
88
make headers -C bfd
 
89
make tooldir=%{_prefix} all info
 
90
%endif
 
91
 
 
92
%install
 
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 \
 
104
     install install-info
 
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*
 
109
 
 
110
#install -m 644 libiberty/libiberty.a ${RPM_BUILD_ROOT}%{_prefix}/lib
 
111
install -m 644 include/libiberty.h ${RPM_BUILD_ROOT}%{_prefix}/include
 
112
 
 
113
chmod +x ${RPM_BUILD_ROOT}%{_prefix}/lib/lib*.so*
 
114
 
 
115
# This one comes from egcs
 
116
rm -f ${RPM_BUILD_ROOT}%{_prefix}/bin/c++filt
 
117
 
 
118
%clean
 
119
rm -rf ${RPM_BUILD_ROOT}
 
120
 
 
121
%post
 
122
/sbin/ldconfig
 
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
 
129
 
 
130
%preun
 
131
if [ $1 = 0 ] ;then
 
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
 
138
fi
 
139
 
 
140
%postun -p /sbin/ldconfig
 
141
 
 
142
%files
 
143
%defattr(-,root,root)
 
144
%doc README
 
145
%{_prefix}/bin/*
 
146
%{_mandir}/man1/*
 
147
%{_prefix}/include/*
 
148
%{_prefix}/lib/*
 
149
%{_infodir}/*info*