source: rtems/contrib/crossrpms/cygwin/i686/i686-pc-cygwin-binutils.spec @ 5e5eb773

4.104.115
Last change on this file since 5e5eb773 was 5e5eb773, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/04/10 at 15:35:53

Update to binutils-2.19.51-1

  • Property mode set to 100644
File size: 4.6 KB
Line 
1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
6
7%ifos cygwin cygwin32 mingw mingw32
8%define _exeext .exe
9%define debug_package           %{nil}
10%define _libdir                 %{_exec_prefix}/lib
11%else
12%define _exeext %{nil}
13%endif
14
15%ifos cygwin cygwin32
16%define optflags -O3 -pipe -march=i486 -funroll-loops
17%endif
18
19%ifos mingw mingw32
20%if %{defined _mingw32_cflags}
21%define optflags %{_mingw32_cflags}
22%else
23%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
24%endif
25%endif
26
27%if "%{_build}" != "%{_host}"
28%define _host_rpmprefix %{_host}-
29%else
30%define _host_rpmprefix %{nil}
31%endif
32
33%define binutils_pkgvers 2.19.51-1
34%define binutils_version 2.19.51-1
35%define binutils_rpmvers %{expand:%(echo "2.19.51-1" | tr - _ )}
36
37Name:           i686-pc-cygwin-binutils
38Summary:        Binutils for target i686-pc-cygwin
39Group:          Development/Tools
40Version:        %{binutils_rpmvers}
41Release:        0.20100204.0%{?dist}
42License:        GPL/LGPL
43URL:            http://sources.redhat.com/binutils
44BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
45
46BuildRequires:  %{_host_rpmprefix}gcc
47
48%if "%{binutils_version}" >= "2.18"
49# Bug in bfd: Doesn't build without texinfo installed
50BuildRequires:  texinfo >= 4.2
51%else
52%if "i686-pc-cygwin" == "i686-pc-cygwin"
53BuildRequires:  texinfo >= 4.2
54%endif
55%endif
56BuildRequires:  flex
57BuildRequires:  bison
58
59Source0:        ftp://cygwin.com/pub/cygwin/release/binutils/binutils-%{binutils_pkgvers}-src.tar.bz2
60%{?_without_sources:NoSource:   0}
61%if "%{binutils_version}" == "2.17.50"
62Patch0: binutils-2.17.50-cygwin-%{binutils_pkgvers}.diff
63%endif
64
65%description
66Cross binutils for target i686-pc-cygwin
67%prep
68%setup -q -c -T -n %{name}-%{version}
69
70%setup -q -D -T -n %{name}-%{version} -a0
71cd binutils-%{binutils_pkgvers}
72%{?PATCH0:%patch0 -p1}
73cd ..
74
75%build
76  mkdir -p build
77  cd build
78%if "%{_build}" != "%{_host}"
79  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
80%endif
81  CFLAGS="$RPM_OPT_FLAGS" \
82  ../binutils-%{binutils_pkgvers}/configure \
83    --build=%_build --host=%_host \
84    --target=i686-pc-cygwin \
85    --verbose --disable-nls \
86    --without-included-gettext \
87    --disable-win32-registry \
88    --disable-werror \
89    --with-sysroot=%{_prefix}/i686-pc-cygwin/sys-root \
90    --prefix=%{_prefix} --bindir=%{_bindir} \
91    --exec-prefix=%{_exec_prefix} \
92    --includedir=%{_includedir} --libdir=%{_libdir} \
93    --mandir=%{_mandir} --infodir=%{_infodir}
94
95  make %{?_smp_mflags} all
96  cd ..
97
98%install
99  rm -rf $RPM_BUILD_ROOT
100
101  cd build
102  make DESTDIR=$RPM_BUILD_ROOT install
103
104
105# Conflict with a native binutils' infos
106  rm -rf $RPM_BUILD_ROOT%{_infodir}
107
108# We don't ship host files
109  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
110
111# manpages without corresponding tools
112  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i686-pc-cygwin-dlltool%{_exeext}; then
113    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i686-pc-cygwin-dlltool*
114  fi
115  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i686-pc-cygwin-nlmconv%{_exeext}; then
116    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i686-pc-cygwin-nlmconv*
117  fi
118  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i686-pc-cygwin-windres%{_exeext}; then
119    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i686-pc-cygwin-windres*
120  fi
121  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i686-pc-cygwin-windmc%{_exeext}; then
122    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i686-pc-cygwin-windmc*
123  fi
124
125  cd ..
126
127# Extract %%__os_install_post into os_install_post~
128cat << \EOF > os_install_post~
129%__os_install_post
130EOF
131
132# Generate customized brp-*scripts
133cat os_install_post~ | while read a x y; do
134case $a in
135# Prevent brp-strip* from trying to handle foreign binaries
136*/brp-strip*)
137  b=$(basename $a)
138  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
139  chmod a+x $b
140  ;;
141esac
142done
143
144sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
145< os_install_post~ > os_install_post
146%define __os_install_post . ./os_install_post
147
148%clean
149  rm -rf $RPM_BUILD_ROOT
150
151# ==============================================================
152# i686-pc-cygwin-binutils
153# ==============================================================
154# %package -n i686-pc-cygwin-binutils
155# Summary:      rtems binutils for i686-pc-cygwin
156# Group: Development/Tools
157# %if %build_infos
158# Requires: binutils-common
159# %endif
160
161%description -n i686-pc-cygwin-binutils
162GNU binutils targetting i686-pc-cygwin.
163
164%files -n i686-pc-cygwin-binutils
165%defattr(-,root,root)
166
167%{_mandir}/man1/i686-pc-cygwin-*.1*
168
169%{_bindir}/i686-pc-cygwin-*
170
171%dir %{_exec_prefix}/i686-pc-cygwin
172%dir %{_exec_prefix}/i686-pc-cygwin/bin
173%{_exec_prefix}/i686-pc-cygwin/bin/*
174
175%dir %{_exec_prefix}/i686-pc-cygwin/lib
176%{_exec_prefix}/i686-pc-cygwin/lib/ldscripts
177
Note: See TracBrowser for help on using the repository browser.