source: rtems/scripts/binutils/binutils.add @ f74912ae

4.104.114.84.95
Last change on this file since f74912ae was f74912ae, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/06/05 at 08:38:05

2005-07-06 Ralf Corsepius <ralf.corsepius@…>

  • binutils/binutils.add: Take out -D_FORTIFY_SOURCE from CFLAGS to prevent fortify from rendering ar unusable.
  • Property mode set to 100644
File size: 3.1 KB
Line 
1
2%define binutils_version     @binutils_version@
3%define binutils_target      @target_alias@
4
5Name:         %{rpmprefix}%{binutils_target}-binutils
6Summary:      binutils for target %{binutils_target}
7Group:        %{rpmgroup}
8Release:      @Release@
9License:      GPL/LGPL
10
11Packager:       ralf.corsepius@rtems.org and joel@OARcorp.com
12BuildRequires:  /sbin/install-info
13BuildRequires:  texinfo >= 4.2
14BuildRequires:  flex
15
16Version:        %{binutils_version}
17Source0:        ftp://ftp.gnu.org/pub/gnu/binutils/binutils-%{binutils_version}@binutils_suffix@
18@PATCH1@
19
20#
21# The original sources are not included in the source RPM.
22# If we included them, then the source RPMs for each target
23# would duplicate MBs of source unnecessarily.  This is
24# a duplication of over 30 MBs of source for each of
25# the more than 10 targets it is possible to build.
26#
27# You can get them yourself from the Internet and copy them to
28# your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR).
29# Or you can try the ftp options of rpm :-)
30#
31%{?!_with_sources:NoSource:      0}
32
33# %description
34#
35# RTEMS is an open source operating system for embedded systems.
36#
37# This is binutils sources with patches for RTEMS.
38
39%prep
40%setup -c -T -n %{name}-%{version} -a0
41
42cd binutils-%{version}
43%{?PATCH0:%patch0 -p1}
44cd ..
45
46  mkdir -p build
47
48%build
49  cd build
50%if "%{binutils_version}" <= "2.16.1"
51# ar leaks memory - Disable fortify to prevent it from killing ar
52  OPT_FLAGS=$(echo "$RPM_OPT_FLAGS" | sed -e 's/\-Wp,\-D_FORTIFY_SOURCE=[^ ]*//')
53%else
54  OPT_FLAGS="$RPM_OPT_FLAGS"
55%endif
56  CFLAGS="$OPT_FLAGS" \
57  ../binutils-%{binutils_version}/configure \
58    --build=%_build --host=%_host \
59    --target=%{binutils_target} \
60    --verbose --disable-nls \
61    --prefix=%{_prefix} --bindir=%{_bindir} \
62    --includedir=%{_includedir} --libdir=%{_libdir} \
63    --mandir=%{_mandir} --infodir=%{_infodir} \
64
65  make all
66  make info
67
68
69%install
70  rm -rf $RPM_BUILD_ROOT
71
72  cd build
73  make prefix=$RPM_BUILD_ROOT%{_prefix} \
74    bindir=$RPM_BUILD_ROOT%{_bindir} \
75    includedir=$RPM_BUILD_ROOT%{_includedir} \
76    libdir=$RPM_BUILD_ROOT%{_libdir} \
77    infodir=$RPM_BUILD_ROOT%{_infodir} \
78    mandir=$RPM_BUILD_ROOT%{_mandir} \
79    install
80  make prefix=$RPM_BUILD_ROOT%{_prefix} \
81    bindir=$RPM_BUILD_ROOT%{_bindir} \
82    includedir=$RPM_BUILD_ROOT%{_includedir} \
83    libdir=$RPM_BUILD_ROOT%{_libdir} \
84    infodir=$RPM_BUILD_ROOT%{_infodir} \
85    mandir=$RPM_BUILD_ROOT%{_mandir} \
86    install-info
87
88# A bug in binutils: binutils does not install share/locale
89# however it uses it
90  mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/locale
91
92%if "%{binutils_version}" < "2.9.5"
93  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure.info*
94%endif
95
96  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
97  touch $RPM_BUILD_ROOT%{_infodir}/dir
98
99# gzip info files
100  ls $RPM_BUILD_ROOT%{_infodir}/*.info \
101    $RPM_BUILD_ROOT%{_infodir}/*.info-? \
102    $RPM_BUILD_ROOT%{_infodir}/*.info-?? 2>/dev/null \
103  | while read a; do \
104    gzip -9qf $a 2>/dev/null; \
105  done
106
107# gzip man pages
108  gzip -9qf $RPM_BUILD_ROOT%{_mandir}/man?/*.? 2>/dev/null
109
110# We don't ship host files
111  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
Note: See TracBrowser for help on using the repository browser.