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.20.1 |
---|
34 | %define binutils_version 2.20.1 |
---|
35 | %define binutils_rpmvers %{expand:%(echo "2.20.1" | tr - _ )} |
---|
36 | |
---|
37 | Name: i586-pc-freebsd8.1-binutils |
---|
38 | Summary: Binutils for target i586-pc-freebsd8.1 |
---|
39 | Group: Development/Tools |
---|
40 | Version: %{binutils_rpmvers} |
---|
41 | Release: 0.20100727.0%{?dist} |
---|
42 | License: GPL/LGPL |
---|
43 | URL: http://sources.redhat.com/binutils |
---|
44 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
45 | |
---|
46 | BuildRequires: %{_host_rpmprefix}gcc |
---|
47 | |
---|
48 | %if "%{binutils_version}" >= "2.18" |
---|
49 | # Bug in bfd: Doesn't build without texinfo installed |
---|
50 | BuildRequires: texinfo >= 4.2 |
---|
51 | %else |
---|
52 | %endif |
---|
53 | BuildRequires: flex |
---|
54 | BuildRequires: bison |
---|
55 | |
---|
56 | Source0: http://ftp.gnu.org/gnu/binutils/binutils-%{binutils_pkgvers}.tar.bz2 |
---|
57 | |
---|
58 | %description |
---|
59 | Cross binutils for target i586-pc-freebsd8.1 |
---|
60 | %prep |
---|
61 | %setup -q -c -T -n %{name}-%{version} |
---|
62 | |
---|
63 | %setup -q -D -T -n %{name}-%{version} -a0 |
---|
64 | cd binutils-%{binutils_pkgvers} |
---|
65 | %{?PATCH0:%patch0 -p1} |
---|
66 | cd .. |
---|
67 | |
---|
68 | %build |
---|
69 | mkdir -p build |
---|
70 | cd build |
---|
71 | %if "%{_build}" != "%{_host}" |
---|
72 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
73 | %endif |
---|
74 | CFLAGS="$RPM_OPT_FLAGS" \ |
---|
75 | ../binutils-%{binutils_pkgvers}/configure \ |
---|
76 | --build=%_build --host=%_host \ |
---|
77 | --target=i586-pc-freebsd8.1 \ |
---|
78 | --verbose --disable-nls \ |
---|
79 | --without-included-gettext \ |
---|
80 | --disable-win32-registry \ |
---|
81 | --disable-werror \ |
---|
82 | --with-sysroot=%{_prefix}/i586-pc-freebsd8.1/sys-root \ |
---|
83 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
84 | --exec-prefix=%{_exec_prefix} \ |
---|
85 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
86 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
87 | |
---|
88 | make %{?_smp_mflags} all |
---|
89 | cd .. |
---|
90 | |
---|
91 | %install |
---|
92 | rm -rf $RPM_BUILD_ROOT |
---|
93 | |
---|
94 | cd build |
---|
95 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
96 | |
---|
97 | |
---|
98 | # Conflict with a native binutils' infos |
---|
99 | rm -rf $RPM_BUILD_ROOT%{_infodir} |
---|
100 | |
---|
101 | # We don't ship host files |
---|
102 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty* |
---|
103 | |
---|
104 | # manpages without corresponding tools |
---|
105 | if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i586-pc-freebsd8.1-dlltool%{_exeext}; then |
---|
106 | rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i586-pc-freebsd8.1-dlltool* |
---|
107 | fi |
---|
108 | if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i586-pc-freebsd8.1-nlmconv%{_exeext}; then |
---|
109 | rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i586-pc-freebsd8.1-nlmconv* |
---|
110 | fi |
---|
111 | if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i586-pc-freebsd8.1-windres%{_exeext}; then |
---|
112 | rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i586-pc-freebsd8.1-windres* |
---|
113 | fi |
---|
114 | if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i586-pc-freebsd8.1-windmc%{_exeext}; then |
---|
115 | rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i586-pc-freebsd8.1-windmc* |
---|
116 | fi |
---|
117 | |
---|
118 | cd .. |
---|
119 | |
---|
120 | # Extract %%__os_install_post into os_install_post~ |
---|
121 | cat << \EOF > os_install_post~ |
---|
122 | %__os_install_post |
---|
123 | EOF |
---|
124 | |
---|
125 | # Generate customized brp-*scripts |
---|
126 | cat os_install_post~ | while read a x y; do |
---|
127 | case $a in |
---|
128 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
129 | */brp-strip*) |
---|
130 | b=$(basename $a) |
---|
131 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
132 | chmod a+x $b |
---|
133 | ;; |
---|
134 | esac |
---|
135 | done |
---|
136 | |
---|
137 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
138 | < os_install_post~ > os_install_post |
---|
139 | %define __os_install_post . ./os_install_post |
---|
140 | |
---|
141 | %clean |
---|
142 | rm -rf $RPM_BUILD_ROOT |
---|
143 | |
---|
144 | # ============================================================== |
---|
145 | # i586-pc-freebsd8.1-binutils |
---|
146 | # ============================================================== |
---|
147 | # %package -n i586-pc-freebsd8.1-binutils |
---|
148 | # Summary: rtems binutils for i586-pc-freebsd8.1 |
---|
149 | # Group: Development/Tools |
---|
150 | # %if %build_infos |
---|
151 | # Requires: binutils-common |
---|
152 | # %endif |
---|
153 | |
---|
154 | %description -n i586-pc-freebsd8.1-binutils |
---|
155 | GNU binutils targetting i586-pc-freebsd8.1. |
---|
156 | |
---|
157 | %files -n i586-pc-freebsd8.1-binutils |
---|
158 | %defattr(-,root,root) |
---|
159 | |
---|
160 | %{_mandir}/man1/i586-pc-freebsd8.1-*.1* |
---|
161 | |
---|
162 | %{_bindir}/i586-pc-freebsd8.1-* |
---|
163 | |
---|
164 | %dir %{_exec_prefix}/i586-pc-freebsd8.1 |
---|
165 | %dir %{_exec_prefix}/i586-pc-freebsd8.1/bin |
---|
166 | %{_exec_prefix}/i586-pc-freebsd8.1/bin/* |
---|
167 | |
---|
168 | %dir %{_exec_prefix}/i586-pc-freebsd8.1/lib |
---|
169 | %{_exec_prefix}/i586-pc-freebsd8.1/lib/ldscripts |
---|
170 | |
---|