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