source: rtems/contrib/crossrpms/rtems4.10/sh/rtems-4.10-sh-rtems4.10-binutils.spec @ 04e8c69

4.104.11
Last change on this file since 04e8c69 was 04e8c69, checked in by Ralf Corsepius <ralf.corsepius@…>, on Sep 11, 2008 at 12:00:46 PM

Upgrade to binutils-2.18.90.

  • Property mode set to 100644
File size: 7.3 KB
Line 
1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
6%define _prefix                 /opt/rtems-4.10
7%define _infodir                %{_prefix}/info
8%define _mandir                 %{_prefix}/man
9
10%ifos cygwin cygwin32 mingw mingw32
11%define _exeext .exe
12%else
13%define _exeext %{nil}
14%endif
15
16%ifos cygwin cygwin32
17%define optflags -O3 -pipe -march=i486 -funroll-loops
18%define _libdir                 %{_exec_prefix}/lib
19%define debug_package           %{nil}
20%endif
21
22%if "%{_build}" != "%{_host}"
23%define _host_rpmprefix rtems-4.10-%{_host}-
24%else
25%define _host_rpmprefix %{nil}
26%endif
27
28%define binutils_pkgvers 2.18.90
29%define binutils_version 2.18.90
30%define binutils_rpmvers %{expand:%(echo "2.18.90" | tr - _ )}
31
32Name:           rtems-4.10-sh-rtems4.10-binutils
33Summary:        Binutils for target sh-rtems4.10
34Group:          Development/Tools
35Version:        %{binutils_rpmvers}
36Release:        1%{?dist}
37License:        GPL/LGPL
38URL:            http://sources.redhat.com/binutils
39BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
40
41BuildRequires:  %{_host_rpmprefix}gcc
42
43%if "%{binutils_version}" >= "2.18"
44# Bug in bfd: Doesn't build without texinfo installed
45BuildRequires:  texinfo >= 4.2
46%else
47# Required for building the infos
48BuildRequires:  /sbin/install-info
49BuildRequires:  texinfo >= 4.2
50%endif
51BuildRequires:  flex
52BuildRequires:  bison
53
54Requires:       rtems-4.10-binutils-common
55
56Source0:        ftp://sourceware.redhat.com/pub/binutils/snapshots/binutils-2.18.90.tar.bz2
57
58%description
59Cross binutils for target sh-rtems4.10
60%prep
61%setup -q -c -T -n %{name}-%{version}
62
63%setup -q -D -T -n %{name}-%{version} -a0
64cd binutils-%{binutils_pkgvers}
65%{?PATCH0:%patch0 -p1}
66cd ..
67
68%build
69  export PATH="%{_bindir}:${PATH}"
70%if "sh-rtems4.10" == "i686-pc-cygwin"
71# The cygwin sources are leaking memory
72  RPM_OPT_FLAGS="$(echo "$RPM_OPT_FLAGS"|sed -e 's; -Wp,-D_FORTIFY_SOURCE=2;;')"
73%endif
74  mkdir -p build
75  cd build
76%if "%{_build}" != "%{_host}"
77  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
78%endif
79  CFLAGS="$RPM_OPT_FLAGS" \
80  ../binutils-%{binutils_pkgvers}/configure \
81    --build=%_build --host=%_host \
82    --target=sh-rtems4.10 \
83    --verbose --disable-nls \
84    --without-included-gettext \
85    --disable-win32-registry \
86    --disable-werror \
87    --prefix=%{_prefix} --bindir=%{_bindir} \
88    --exec-prefix=%{_exec_prefix} \
89    --includedir=%{_includedir} --libdir=%{_libdir} \
90    --mandir=%{_mandir} --infodir=%{_infodir}
91
92  make %{?_smp_mflags} all
93  make info
94  cd ..
95
96%install
97  export PATH="%{_bindir}:${PATH}"
98  rm -rf $RPM_BUILD_ROOT
99
100  cd build
101  make DESTDIR=$RPM_BUILD_ROOT install
102
103  make prefix=$RPM_BUILD_ROOT%{_prefix} \
104    bindir=$RPM_BUILD_ROOT%{_bindir} \
105    includedir=$RPM_BUILD_ROOT%{_includedir} \
106    libdir=$RPM_BUILD_ROOT%{_libdir} \
107    infodir=$RPM_BUILD_ROOT%{_infodir} \
108    mandir=$RPM_BUILD_ROOT%{_mandir} \
109    exec_prefix=$RPM_BUILD_ROOT%{_exec_prefix} \
110    install-info
111
112# Dropped in FSF-binutils-2.9.5, but Cygwin still ships it.
113  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure.info*
114
115  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
116  touch $RPM_BUILD_ROOT%{_infodir}/dir
117
118# binutils does not install share/locale, however it uses it
119  mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/locale
120
121# We don't ship host files
122  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
123
124# manpages without corresponding tools
125  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/sh-rtems4.10-dlltool%{_exeext}; then
126    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/sh-rtems4.10-dlltool*
127  fi
128  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/sh-rtems4.10-nlmconv%{_exeext}; then
129    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/sh-rtems4.10-nlmconv*
130  fi
131  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/sh-rtems4.10-windres%{_exeext}; then
132    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/sh-rtems4.10-windres*
133  fi
134  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/sh-rtems4.10-windmc%{_exeext}; then
135    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/sh-rtems4.10-windmc*
136  fi
137
138  cd ..
139
140# Extract %%__os_install_post into os_install_post~
141cat << \EOF > os_install_post~
142%__os_install_post
143EOF
144
145# Generate customized brp-*scripts
146cat os_install_post~ | while read a x y; do
147case $a in
148# Prevent brp-strip* from trying to handle foreign binaries
149*/brp-strip*)
150  b=$(basename $a)
151  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
152  chmod a+x $b
153  ;;
154# Fix up brp-compress to handle %%_prefix != /usr
155*/brp-compress*)
156  b=$(basename $a)
157  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
158  chmod a+x $b
159  ;;
160esac
161done
162
163sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
164  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
165< os_install_post~ > os_install_post
166%define __os_install_post . ./os_install_post
167
168%clean
169  rm -rf $RPM_BUILD_ROOT
170
171# ==============================================================
172# sh-rtems4.10-binutils
173# ==============================================================
174# %package -n rtems-4.10-sh-rtems4.10-binutils
175# Summary:      rtems binutils for sh-rtems4.10
176# Group: Development/Tools
177# %if %build_infos
178# Requires: rtems-4.10-binutils-common
179# %endif
180
181%description -n rtems-4.10-sh-rtems4.10-binutils
182GNU binutils targetting sh-rtems4.10.
183
184%files -n rtems-4.10-sh-rtems4.10-binutils
185%defattr(-,root,root)
186%dir %{_mandir}
187%dir %{_mandir}/man1
188%{_mandir}/man1/sh-rtems4.10-*.1*
189
190%dir %{_bindir}
191%{_bindir}/sh-rtems4.10-*
192
193%dir %{_exec_prefix}/sh-rtems4.10
194%dir %{_exec_prefix}/sh-rtems4.10/bin
195%{_exec_prefix}/sh-rtems4.10/bin/*
196
197%dir %{_exec_prefix}/sh-rtems4.10/lib
198%{_exec_prefix}/sh-rtems4.10/lib/ldscripts
199# ==============================================================
200# rtems-4.10-binutils-common
201# ==============================================================
202%package -n rtems-4.10-binutils-common
203Summary:      Base package for RTEMS binutils
204Group: Development/Tools
205Requires(post):         /sbin/install-info
206Requires(preun):        /sbin/install-info
207
208%description -n rtems-4.10-binutils-common
209
210RTEMS is an open source operating system for embedded systems.
211
212This is the base for binutils regardless of target CPU.
213
214%post -n rtems-4.10-binutils-common
215  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz || :
216  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz || :
217  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz || :
218  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz || :
219  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/standards.info.gz || :
220%if "%{binutils_version}" > "2.17"
221  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz || :
222%endif
223
224%preun -n rtems-4.10-binutils-common
225if [ $1 -eq 0 ]; then
226  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz || :
227  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz || :
228  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz || :
229  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz || :
230  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/standards.info.gz || :
231%if "%{binutils_version}" > "2.17"
232  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz || :
233%endif
234fi
235
236%files -n rtems-4.10-binutils-common
237%defattr(-,root,root)
238%dir %{_infodir}
239%ghost %{_infodir}/dir
240%{_infodir}/as.info*
241%{_infodir}/bfd.info*
242%{_infodir}/binutils.info*
243%{_infodir}/ld.info*
244%{_infodir}/standards.info*
245%if "%{binutils_version}" > "2.17"
246%{_infodir}/gprof.info*
247%endif
248
249%dir %{_prefix}/share
250%dir %{_prefix}/share/locale
251
Note: See TracBrowser for help on using the repository browser.