This commit is contained in:
Ralf Corsepius
2011-03-20 17:11:53 +00:00
parent 3cf3d4675d
commit c3a42e179a
24 changed files with 2596 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
Makefile
Makefile.in
+4
View File
@@ -0,0 +1,4 @@
# $Id$
SUBDIRS = i386 x86_64
+30
View File
@@ -0,0 +1,30 @@
EXTRA_DIST += binutils-sources.add
BINUTILS_OPTS =
BINUTILS_SUBPACKAGES = $(top_srcdir)/common/common.add
BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/binutils.add
BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/prep.add
BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/build.add
BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/install.add
BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/rpm-install.add
BINUTILS_SUBPACKAGES += $(top_srcdir)/common/clean.add
BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/target-binutils.add
BINUTILS_SUBPACKAGES += $(top_srcdir)/binutils/base-binutils.add
$(TARGET)-binutils.spec.in: $(BINUTILS_SUBPACKAGES) Makefile.am $(srcdir)/binutils-sources.add $(srcdir)/../binutils.am
cat $(BINUTILS_SUBPACKAGES) | sed \
-e "/[@]SOURCES[@]/r $(srcdir)/binutils-sources.add" \
-e "/[@]SOURCES[@]/d" \
-e "s/[@]BINUTILS_VERS[@]/$(BINUTILS_VERS)/g" \
-e "s/[@]BINUTILS_PKGVERS[@]/$(BINUTILS_PKGVERS)/g" \
-e "s/[@]BINUTILS_RPMREL[@]/$(BINUTILS_RPMREL)%{?dist}/g" \
| $(MKSPEC0) > $(TARGET)-binutils.spec.in
CLEANFILES += $(TARGET)-binutils.spec.in
@rpmprefix@$(TARGET)-binutils.spec: $(TARGET)-binutils.spec.in
$(MKSPEC) $(TARGET)-binutils.spec.in | $(SPECSTRIP) $(BINUTILS_OPTS) > $@
CLEANFILES += @rpmprefix@$(TARGET)-binutils.spec
noinst_DATA += @rpmprefix@$(TARGET)-binutils.spec
EXTRA_DIST += $(BINUTILS_SUBPACKAGES)
+40
View File
@@ -0,0 +1,40 @@
EXTRA_DIST += $(srcdir)/../gcc-prep.add
EXTRA_DIST += $(srcdir)/gcc-sources.add
GCC_OPTS =
GCC_SUBPACKAGES = $(top_srcdir)/common/common.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/gccnewlib.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/prep.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/build.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/install.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/rpm-install.add
GCC_SUBPACKAGES += $(top_srcdir)/common/clean.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/target-gcc.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/base-gcc.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/target-c++.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/target-gfortran.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/base-gfortran.add
GCC_SUBPACKAGES += $(top_srcdir)/gcc/target-objc.add
$(TARGET)-gcc.spec.in: $(GCC_SUBPACKAGES) Makefile.am $(srcdir)/gcc-sources.add $(srcdir)/../gcc-prep.add $(srcdir)/../gcc.am
cat $(GCC_SUBPACKAGES) | sed \
-e "/[@]SOURCES[@]/r $(srcdir)/gcc-sources.add" \
-e "/[@]SOURCES[@]/d" \
-e "/[@]PREP[@]/r $(srcdir)/../gcc-prep.add" \
-e "/[@]PREP[@]/d" \
-e "s/[@]GCC_VERS[@]/$(GCC_VERS)/g" \
-e "s/[@]GCC_PKGVERS[@]/$(GCC_PKGVERS)/g" \
-e "s/[@]GCC_RPMREL[@]/$(GCC_RPMREL)%{?dist}/g" \
-e "/[@]tool_target[@]-newlib/d" \
-e "/[@]tool_target[@]-w32api-sys-root/d" \
-e "/--with-newlib/d" \
| $(MKSPEC0) > $(TARGET)-gcc.spec.in
CLEANFILES += $(TARGET)-gcc.spec.in
@rpmprefix@$(TARGET)-gcc.spec: $(TARGET)-gcc.spec.in
$(MKSPEC) $(TARGET)-gcc.spec.in | $(SPECSTRIP) $(GCC_OPTS) > $@
CLEANFILES += @rpmprefix@$(TARGET)-gcc.spec
noinst_DATA += @rpmprefix@$(TARGET)-gcc.spec
EXTRA_DIST += $(GCC_SUBPACKAGES)
@@ -0,0 +1,4 @@
Makefile
Makefile.in
rtems*.spec
*.spec.in
@@ -0,0 +1,23 @@
# $Id$
TARGET = i386-pc-netbsdelf5.1
include $(top_srcdir)/mkspec.am
NETBSD_VERS = 5.1
NETBSD_RPMREL = 0.20110320.0
EXTRA_DIST += libs.add
EXTRA_DIST += target-libs.add
include ../libs.am
BINUTILS_VERS = 2.21
BINUTILS_PKGVERS = $(BINUTILS_VERS)
BINUTILS_RPMREL = 0.20110320.0
include ../binutils.am
BINUTILS_OPTS +=
GCC_VERS = 4.5.0
GCC_PKGVERS = $(GCC_VERS)
GCC_RPMREL = 0.20110320.0
include ../gcc.am
GCC_OPTS += --languages=c,cxx,fortran,objc
@@ -0,0 +1,2 @@
Source0: http://ftp.gnu.org/gnu/binutils/binutils-%{binutils_pkgvers}.tar.bz2
@PATCH0@
@@ -0,0 +1,35 @@
Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_pkgvers}.tar.bz2
%if "%{gcc_version}" == "4.5.0"
Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gcc-core-4.5.0-rtems4.11-20100609.diff
%endif
%{?_without_sources:NoSource: 0}
%if %build_cxx
Source1: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_pkgvers}.tar.bz2
@PATCH1@
%{?_without_sources:NoSource: 1}
%endif
%if %build_fortran
Source2: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-fortran-%{gcc_pkgvers}.tar.bz2
@PATCH2@
%{?_without_sources:NoSource: 2}
%endif
%if %build_gcj
Source3: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-java-%{gcc_pkgvers}.tar.bz2
@PATCH3@
%{?_without_sources:NoSource: 3}
%endif
%if %build_gnat
Source4: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-ada-%{gcc_pkgvers}.tar.bz2
@PATCH4@
%{?_without_sources:NoSource: 4}
%endif
%if %build_objc
Source5: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-objc-%{gcc_pkgvers}.tar.bz2
@PATCH5@
%{?_without_sources:NoSource: 5}
%endif
@@ -0,0 +1,170 @@
#
# Please send bugfixes or comments to
# http://www.rtems.org/bugzilla
#
%ifos cygwin cygwin32 mingw mingw32
%define _exeext .exe
%define debug_package %{nil}
%define _libdir %{_exec_prefix}/lib
%else
%define _exeext %{nil}
%endif
%ifos cygwin cygwin32
%define optflags -O3 -pipe -march=i486 -funroll-loops
%endif
%ifos mingw mingw32
%if %{defined _mingw32_cflags}
%define optflags %{_mingw32_cflags}
%else
%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
%endif
%endif
%if "%{_build}" != "%{_host}"
%define _host_rpmprefix %{_host}-
%else
%define _host_rpmprefix %{nil}
%endif
%define binutils_pkgvers 2.21
%define binutils_version 2.21
%define binutils_rpmvers %{expand:%(echo "2.21" | tr - _ )}
Name: i386-pc-netbsdelf5.1-binutils
Summary: Binutils for target i386-pc-netbsdelf5.1
Group: Development/Tools
Version: %{binutils_rpmvers}
Release: 0.20110320.0%{?dist}
License: GPL/LGPL
URL: http://sources.redhat.com/binutils
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{_host_rpmprefix}gcc
%if "%{binutils_version}" >= "2.18"
# Bug in bfd: Doesn't build without texinfo installed
BuildRequires: texinfo >= 4.2
%else
%endif
BuildRequires: flex
BuildRequires: bison
Source0: http://ftp.gnu.org/gnu/binutils/binutils-%{binutils_pkgvers}.tar.bz2
%description
Cross binutils for target i386-pc-netbsdelf5.1
%prep
%setup -q -c -T -n %{name}-%{version}
%setup -q -D -T -n %{name}-%{version} -a0
cd binutils-%{binutils_pkgvers}
%{?PATCH0:%patch0 -p1}
cd ..
%build
mkdir -p build
cd build
%if "%{_build}" != "%{_host}"
CFLAGS_FOR_BUILD="-g -O2 -Wall" \
%endif
CFLAGS="$RPM_OPT_FLAGS" \
../binutils-%{binutils_pkgvers}/configure \
--build=%_build --host=%_host \
--target=i386-pc-netbsdelf5.1 \
--verbose --disable-nls \
--without-included-gettext \
--disable-win32-registry \
--disable-werror \
--with-sysroot=%{_prefix}/i386-pc-netbsdelf5.1/sys-root \
--prefix=%{_prefix} --bindir=%{_bindir} \
--exec-prefix=%{_exec_prefix} \
--includedir=%{_includedir} --libdir=%{_libdir} \
--mandir=%{_mandir} --infodir=%{_infodir}
make %{?_smp_mflags} all
cd ..
%install
rm -rf $RPM_BUILD_ROOT
cd build
make DESTDIR=$RPM_BUILD_ROOT install
# Conflict with a native binutils' infos
rm -rf $RPM_BUILD_ROOT%{_infodir}
# We don't ship host files
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
# manpages without corresponding tools
if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i386-pc-netbsdelf5.1-dlltool%{_exeext}; then
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i386-pc-netbsdelf5.1-dlltool*
fi
if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i386-pc-netbsdelf5.1-nlmconv%{_exeext}; then
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i386-pc-netbsdelf5.1-nlmconv*
fi
if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i386-pc-netbsdelf5.1-windres%{_exeext}; then
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i386-pc-netbsdelf5.1-windres*
fi
if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i386-pc-netbsdelf5.1-windmc%{_exeext}; then
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i386-pc-netbsdelf5.1-windmc*
fi
cd ..
# Extract %%__os_install_post into os_install_post~
cat << \EOF > os_install_post~
%__os_install_post
EOF
# Generate customized brp-*scripts
cat os_install_post~ | while read a x y; do
case $a in
# Prevent brp-strip* from trying to handle foreign binaries
*/brp-strip*)
b=$(basename $a)
sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
chmod a+x $b
;;
esac
done
sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
< os_install_post~ > os_install_post
%define __os_install_post . ./os_install_post
%clean
rm -rf $RPM_BUILD_ROOT
# ==============================================================
# i386-pc-netbsdelf5.1-binutils
# ==============================================================
# %package -n i386-pc-netbsdelf5.1-binutils
# Summary: rtems binutils for i386-pc-netbsdelf5.1
# Group: Development/Tools
# %if %build_infos
# Requires: binutils-common
# %endif
%description -n i386-pc-netbsdelf5.1-binutils
GNU binutils targetting i386-pc-netbsdelf5.1.
%files -n i386-pc-netbsdelf5.1-binutils
%defattr(-,root,root)
%{_mandir}/man1/i386-pc-netbsdelf5.1-*.1*
%{_bindir}/i386-pc-netbsdelf5.1-*
%dir %{_exec_prefix}/i386-pc-netbsdelf5.1
%dir %{_exec_prefix}/i386-pc-netbsdelf5.1/bin
%{_exec_prefix}/i386-pc-netbsdelf5.1/bin/*
%dir %{_exec_prefix}/i386-pc-netbsdelf5.1/lib
%{_exec_prefix}/i386-pc-netbsdelf5.1/lib/ldscripts
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,163 @@
#
# Please send bugfixes or comments to
# http://www.rtems.org/bugzilla
#
%ifos cygwin cygwin32 mingw mingw32
%define _exeext .exe
%define debug_package %{nil}
%define _libdir %{_exec_prefix}/lib
%else
%define _exeext %{nil}
%endif
%ifos cygwin cygwin32
%define optflags -O3 -pipe -march=i486 -funroll-loops
%endif
%ifos mingw mingw32
%if %{defined _mingw32_cflags}
%define optflags %{_mingw32_cflags}
%else
%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
%endif
%endif
%if "%{_build}" != "%{_host}"
%define _host_rpmprefix %{_host}-
%else
%define _host_rpmprefix %{nil}
%endif
%define netbsd_version 5.1
%define netbsd_rpmvers %{expand:%(echo 5.1 | tr - _)}
%define _use_internal_dependency_generator 0
%define __debug_install_post %{nil}
Name: i386-pc-netbsdelf5.1
Release: 0.20110320.0%{?dist}
License: NetBSD
Group: Development/Tools
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Version: %netbsd_rpmvers
Summary: i386-pc-netbsdelf5.1 Libraries
Source0: ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/i386/binary/sets/base.tgz
Source1: ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/i386/binary/sets/comp.tgz
%description
i386-pc-netbsdelf5.1 libraries.
%prep
%setup -q -c -T -n %{name}-%{version} -a 0 -a 1
%build
# Setup sys-root (Usable for gcc >= 3.4)
mkdir -p i386-pc-netbsdelf5.1/sys-root
%{__tar} cf - lib usr/lib usr/include | ( cd i386-pc-netbsdelf5.1/sys-root ; %{__tar} xf -)
pushd i386-pc-netbsdelf5.1/sys-root/usr/lib > /dev/null
# missing files
rm -f lib*_p.*
# not needed
rm -rf aout compat
# Fix up symlinks
find -type l -exec ls -l {} \; | \
while read a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aA ; do \
case $aA in
/lib* ) # link
rm $a8;
b=`basename $aA`
ln -s ../../lib/$b $a8
;;
esac
done
popd > /dev/null
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_prefix}
cp -a i386-pc-netbsdelf5.1 $RPM_BUILD_ROOT%{_prefix}
# Extract %%__os_install_post into os_install_post~
cat << \EOF > os_install_post~
%__os_install_post
EOF
# Generate customized brp-*scripts
cat os_install_post~ | while read a x y; do
case $a in
# Prevent brp-strip* from trying to handle foreign binaries
*/brp-strip*)
b=$(basename $a)
sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
chmod a+x $b
;;
esac
done
sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
< os_install_post~ > os_install_post
%define __os_install_post . ./os_install_post
cat << EOF > %{_builddir}/%{name}-%{netbsd_rpmvers}/find-provides
#!/bin/sh
grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i386-pc-netbsdelf5.1/(lib|include|sys-root)' \
%{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/'} | %__find_provides
EOF
chmod +x %{_builddir}/%{name}-%{netbsd_rpmvers}/find-provides
%define __find_provides %{_builddir}/%{name}-%{netbsd_rpmvers}/find-provides
cat << EOF > %{_builddir}/%{name}-%{netbsd_rpmvers}/find-requires
#!/bin/sh
grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i386-pc-netbsdelf5.1/(lib|include|sys-root)' \
%{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.1/'} | %__find_requires
EOF
chmod +x %{_builddir}/%{name}-%{netbsd_rpmvers}/find-requires
%define __find_requires %{_builddir}/%{name}-%{netbsd_rpmvers}/find-requires
%ifnarch noarch
# Extract %%__debug_install_post into debug_install_post~
cat << \EOF > debug_install_post~
%__debug_install_post
EOF
# Generate customized debug_install_post script
cat debug_install_post~ | while read a x y; do
case $a in
# Prevent find-debuginfo.sh* from trying to handle foreign binaries
*/find-debuginfo.sh)
b=$(basename $a)
sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
chmod a+x $b
;;
esac
done
sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
< debug_install_post~ > debug_install_post
%define __debug_install_post . ./debug_install_post
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%package sys-root
Group: Development/Tools
Summary: i386-pc-netbsdelf5.1 target files for gcc >= 3.4
%description sys-root
i386-pc-netbsdelf5.1 target files for gcc >= 3.4
%files sys-root
%defattr(-,root,root,-)
%dir %{_prefix}/i386-pc-netbsdelf5.1
%{_prefix}/i386-pc-netbsdelf5.1/sys-root
+55
View File
@@ -0,0 +1,55 @@
%define netbsd_version @NETBSD_VERS@
%define netbsd_rpmvers %{expand:%(echo @NETBSD_VERS@ | tr - _)}
%define _use_internal_dependency_generator 0
%define __debug_install_post %{nil}
Name: @rpmprefix@@tool_target@
Release: @NETBSD_RPMREL@
License: NetBSD
Group: Development/Tools
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Version: %netbsd_rpmvers
Summary: @tool_target@ Libraries
Source0: ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/i386/binary/sets/base.tgz
Source1: ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/i386/binary/sets/comp.tgz
%description
@tool_target@ libraries.
%prep
%setup -q -c -T -n %{name}-%{version} -a 0 -a 1
%build
# Setup sys-root (Usable for gcc >= 3.4)
mkdir -p @tool_target@/sys-root
%{__tar} cf - lib usr/lib usr/include | ( cd @tool_target@/sys-root ; %{__tar} xf -)
pushd @tool_target@/sys-root/usr/lib > /dev/null
# missing files
rm -f lib*_p.*
# not needed
rm -rf aout compat
# Fix up symlinks
find -type l -exec ls -l {} \; | \
while read a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aA ; do \
case $aA in
/lib* ) # link
rm $a8;
b=`basename $aA`
ln -s ../../lib/$b $a8
;;
esac
done
popd > /dev/null
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_prefix}
cp -a @tool_target@ $RPM_BUILD_ROOT%{_prefix}
@@ -0,0 +1,11 @@
%package sys-root
Group: Development/Tools
Summary: @tool_target@ target files for gcc >= 3.4
%description sys-root
@tool_target@ target files for gcc >= 3.4
%files sys-root
%defattr(-,root,root,-)
%dir %{_prefix}/@tool_target@
%{_prefix}/@tool_target@/sys-root
+18
View File
@@ -0,0 +1,18 @@
LIBS_SUBPACKAGES = $(top_srcdir)/common/common.add
LIBS_SUBPACKAGES += $(srcdir)/libs.add
LIBS_SUBPACKAGES += $(top_srcdir)/gcc/rpm-install.add
LIBS_SUBPACKAGES += $(top_srcdir)/common/clean.add
LIBS_SUBPACKAGES += $(srcdir)/target-libs.add
$(TARGET)-libs.spec.in: $(LIBS_SUBPACKAGES) Makefile.am
cat $(LIBS_SUBPACKAGES) | sed \
-e "s/[@]NETBSD_VERS[@]/$(NETBSD_VERS)/g" \
-e "s/[@]NETBSD_RPMREL[@]/$(NETBSD_RPMREL)%{?dist}/g" \
-e "s,%{gcc_rpmvers},%{netbsd_rpmvers},g" \
> $(TARGET)-libs.spec.in
CLEANFILES += $(TARGET)-libs.spec.in
@rpmprefix@$(TARGET)-libs.spec: $(TARGET)-libs.spec.in $(srcdir)/../libs.am
$(MKSPEC) $(TARGET)-libs.spec.in | $(SPECSTRIP) > $@
CLEANFILES += @rpmprefix@$(TARGET)-libs.spec
noinst_DATA += @rpmprefix@$(TARGET)-libs.spec
@@ -0,0 +1,4 @@
Makefile
Makefile.in
rtems*.spec
*.spec.in
@@ -0,0 +1,23 @@
# $Id$
TARGET = amd64-pc-netbsdelf5.1
include $(top_srcdir)/mkspec.am
NETBSD_VERS = 5.1
NETBSD_RPMREL = 0.20110320.0
EXTRA_DIST += libs.add
EXTRA_DIST += target-libs.add
include ../libs.am
BINUTILS_VERS = 2.21
BINUTILS_PKGVERS = $(BINUTILS_VERS)
BINUTILS_RPMREL = 0.20110320.0
include ../binutils.am
BINUTILS_OPTS +=
GCC_VERS = 4.5.0
GCC_PKGVERS = $(GCC_VERS)
GCC_RPMREL = 0.20110320.0
include ../gcc.am
GCC_OPTS += --languages=c,cxx,fortran,objc
@@ -0,0 +1,170 @@
#
# Please send bugfixes or comments to
# http://www.rtems.org/bugzilla
#
%ifos cygwin cygwin32 mingw mingw32
%define _exeext .exe
%define debug_package %{nil}
%define _libdir %{_exec_prefix}/lib
%else
%define _exeext %{nil}
%endif
%ifos cygwin cygwin32
%define optflags -O3 -pipe -march=i486 -funroll-loops
%endif
%ifos mingw mingw32
%if %{defined _mingw32_cflags}
%define optflags %{_mingw32_cflags}
%else
%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
%endif
%endif
%if "%{_build}" != "%{_host}"
%define _host_rpmprefix %{_host}-
%else
%define _host_rpmprefix %{nil}
%endif
%define binutils_pkgvers 2.21
%define binutils_version 2.21
%define binutils_rpmvers %{expand:%(echo "2.21" | tr - _ )}
Name: amd64-pc-netbsdelf5.1-binutils
Summary: Binutils for target amd64-pc-netbsdelf5.1
Group: Development/Tools
Version: %{binutils_rpmvers}
Release: 0.20110320.0%{?dist}
License: GPL/LGPL
URL: http://sources.redhat.com/binutils
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{_host_rpmprefix}gcc
%if "%{binutils_version}" >= "2.18"
# Bug in bfd: Doesn't build without texinfo installed
BuildRequires: texinfo >= 4.2
%else
%endif
BuildRequires: flex
BuildRequires: bison
Source0: http://ftp.gnu.org/gnu/binutils/binutils-%{binutils_pkgvers}.tar.bz2
%description
Cross binutils for target amd64-pc-netbsdelf5.1
%prep
%setup -q -c -T -n %{name}-%{version}
%setup -q -D -T -n %{name}-%{version} -a0
cd binutils-%{binutils_pkgvers}
%{?PATCH0:%patch0 -p1}
cd ..
%build
mkdir -p build
cd build
%if "%{_build}" != "%{_host}"
CFLAGS_FOR_BUILD="-g -O2 -Wall" \
%endif
CFLAGS="$RPM_OPT_FLAGS" \
../binutils-%{binutils_pkgvers}/configure \
--build=%_build --host=%_host \
--target=amd64-pc-netbsdelf5.1 \
--verbose --disable-nls \
--without-included-gettext \
--disable-win32-registry \
--disable-werror \
--with-sysroot=%{_prefix}/amd64-pc-netbsdelf5.1/sys-root \
--prefix=%{_prefix} --bindir=%{_bindir} \
--exec-prefix=%{_exec_prefix} \
--includedir=%{_includedir} --libdir=%{_libdir} \
--mandir=%{_mandir} --infodir=%{_infodir}
make %{?_smp_mflags} all
cd ..
%install
rm -rf $RPM_BUILD_ROOT
cd build
make DESTDIR=$RPM_BUILD_ROOT install
# Conflict with a native binutils' infos
rm -rf $RPM_BUILD_ROOT%{_infodir}
# We don't ship host files
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
# manpages without corresponding tools
if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/amd64-pc-netbsdelf5.1-dlltool%{_exeext}; then
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/amd64-pc-netbsdelf5.1-dlltool*
fi
if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/amd64-pc-netbsdelf5.1-nlmconv%{_exeext}; then
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/amd64-pc-netbsdelf5.1-nlmconv*
fi
if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/amd64-pc-netbsdelf5.1-windres%{_exeext}; then
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/amd64-pc-netbsdelf5.1-windres*
fi
if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/amd64-pc-netbsdelf5.1-windmc%{_exeext}; then
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/amd64-pc-netbsdelf5.1-windmc*
fi
cd ..
# Extract %%__os_install_post into os_install_post~
cat << \EOF > os_install_post~
%__os_install_post
EOF
# Generate customized brp-*scripts
cat os_install_post~ | while read a x y; do
case $a in
# Prevent brp-strip* from trying to handle foreign binaries
*/brp-strip*)
b=$(basename $a)
sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
chmod a+x $b
;;
esac
done
sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
< os_install_post~ > os_install_post
%define __os_install_post . ./os_install_post
%clean
rm -rf $RPM_BUILD_ROOT
# ==============================================================
# amd64-pc-netbsdelf5.1-binutils
# ==============================================================
# %package -n amd64-pc-netbsdelf5.1-binutils
# Summary: rtems binutils for amd64-pc-netbsdelf5.1
# Group: Development/Tools
# %if %build_infos
# Requires: binutils-common
# %endif
%description -n amd64-pc-netbsdelf5.1-binutils
GNU binutils targetting amd64-pc-netbsdelf5.1.
%files -n amd64-pc-netbsdelf5.1-binutils
%defattr(-,root,root)
%{_mandir}/man1/amd64-pc-netbsdelf5.1-*.1*
%{_bindir}/amd64-pc-netbsdelf5.1-*
%dir %{_exec_prefix}/amd64-pc-netbsdelf5.1
%dir %{_exec_prefix}/amd64-pc-netbsdelf5.1/bin
%{_exec_prefix}/amd64-pc-netbsdelf5.1/bin/*
%dir %{_exec_prefix}/amd64-pc-netbsdelf5.1/lib
%{_exec_prefix}/amd64-pc-netbsdelf5.1/lib/ldscripts
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,163 @@
#
# Please send bugfixes or comments to
# http://www.rtems.org/bugzilla
#
%ifos cygwin cygwin32 mingw mingw32
%define _exeext .exe
%define debug_package %{nil}
%define _libdir %{_exec_prefix}/lib
%else
%define _exeext %{nil}
%endif
%ifos cygwin cygwin32
%define optflags -O3 -pipe -march=i486 -funroll-loops
%endif
%ifos mingw mingw32
%if %{defined _mingw32_cflags}
%define optflags %{_mingw32_cflags}
%else
%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
%endif
%endif
%if "%{_build}" != "%{_host}"
%define _host_rpmprefix %{_host}-
%else
%define _host_rpmprefix %{nil}
%endif
%define netbsd_version 5.1
%define netbsd_rpmvers %{expand:%(echo 5.1 | tr - _)}
%define _use_internal_dependency_generator 0
%define __debug_install_post %{nil}
Name: amd64-pc-netbsdelf5.1
Release: 0.20110320.0%{?dist}
License: NetBSD
Group: Development/Tools
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Version: %netbsd_rpmvers
Summary: amd64-pc-netbsdelf5.1 Libraries
Source0: ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/amd64/binary/sets/base.tgz
Source1: ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/amd64/binary/sets/comp.tgz
%description
amd64-pc-netbsdelf5.1 libraries.
%prep
%setup -q -c -T -n %{name}-%{version} -a 0 -a 1
%build
# Setup sys-root (Usable for gcc >= 3.4)
mkdir -p amd64-pc-netbsdelf5.1/sys-root
%{__tar} cf - lib usr/lib usr/include | ( cd amd64-pc-netbsdelf5.1/sys-root ; %{__tar} xf -)
pushd amd64-pc-netbsdelf5.1/sys-root/usr/lib > /dev/null
# missing files
rm -f lib*_p.*
# not needed
rm -rf aout compat
# Fix up symlinks
find -type l -exec ls -l {} \; | \
while read a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aA ; do \
case $aA in
/lib* ) # link
rm $a8;
b=`basename $aA`
ln -s ../../lib/$b $a8
;;
esac
done
popd > /dev/null
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_prefix}
cp -a amd64-pc-netbsdelf5.1 $RPM_BUILD_ROOT%{_prefix}
# Extract %%__os_install_post into os_install_post~
cat << \EOF > os_install_post~
%__os_install_post
EOF
# Generate customized brp-*scripts
cat os_install_post~ | while read a x y; do
case $a in
# Prevent brp-strip* from trying to handle foreign binaries
*/brp-strip*)
b=$(basename $a)
sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
chmod a+x $b
;;
esac
done
sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
< os_install_post~ > os_install_post
%define __os_install_post . ./os_install_post
cat << EOF > %{_builddir}/%{name}-%{netbsd_rpmvers}/find-provides
#!/bin/sh
grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/amd64-pc-netbsdelf5.1/(lib|include|sys-root)' \
%{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/amd64-pc-netbsdelf5.1/'} | %__find_provides
EOF
chmod +x %{_builddir}/%{name}-%{netbsd_rpmvers}/find-provides
%define __find_provides %{_builddir}/%{name}-%{netbsd_rpmvers}/find-provides
cat << EOF > %{_builddir}/%{name}-%{netbsd_rpmvers}/find-requires
#!/bin/sh
grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/amd64-pc-netbsdelf5.1/(lib|include|sys-root)' \
%{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/amd64-pc-netbsdelf5.1/'} | %__find_requires
EOF
chmod +x %{_builddir}/%{name}-%{netbsd_rpmvers}/find-requires
%define __find_requires %{_builddir}/%{name}-%{netbsd_rpmvers}/find-requires
%ifnarch noarch
# Extract %%__debug_install_post into debug_install_post~
cat << \EOF > debug_install_post~
%__debug_install_post
EOF
# Generate customized debug_install_post script
cat debug_install_post~ | while read a x y; do
case $a in
# Prevent find-debuginfo.sh* from trying to handle foreign binaries
*/find-debuginfo.sh)
b=$(basename $a)
sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
chmod a+x $b
;;
esac
done
sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
< debug_install_post~ > debug_install_post
%define __debug_install_post . ./debug_install_post
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%package sys-root
Group: Development/Tools
Summary: amd64-pc-netbsdelf5.1 target files for gcc >= 3.4
%description sys-root
amd64-pc-netbsdelf5.1 target files for gcc >= 3.4
%files sys-root
%defattr(-,root,root,-)
%dir %{_prefix}/amd64-pc-netbsdelf5.1
%{_prefix}/amd64-pc-netbsdelf5.1/sys-root
@@ -0,0 +1,2 @@
Source0: http://ftp.gnu.org/gnu/binutils/binutils-%{binutils_pkgvers}.tar.bz2
@PATCH0@
@@ -0,0 +1,35 @@
Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_pkgvers}.tar.bz2
%if "%{gcc_version}" == "4.5.0"
Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gcc-core-4.5.0-rtems4.11-20100609.diff
%endif
%{?_without_sources:NoSource: 0}
%if %build_cxx
Source1: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_pkgvers}.tar.bz2
@PATCH1@
%{?_without_sources:NoSource: 1}
%endif
%if %build_fortran
Source2: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-fortran-%{gcc_pkgvers}.tar.bz2
@PATCH2@
%{?_without_sources:NoSource: 2}
%endif
%if %build_gcj
Source3: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-java-%{gcc_pkgvers}.tar.bz2
@PATCH3@
%{?_without_sources:NoSource: 3}
%endif
%if %build_gnat
Source4: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-ada-%{gcc_pkgvers}.tar.bz2
@PATCH4@
%{?_without_sources:NoSource: 4}
%endif
%if %build_objc
Source5: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-objc-%{gcc_pkgvers}.tar.bz2
@PATCH5@
%{?_without_sources:NoSource: 5}
%endif
@@ -0,0 +1,55 @@
%define netbsd_version @NETBSD_VERS@
%define netbsd_rpmvers %{expand:%(echo @NETBSD_VERS@ | tr - _)}
%define _use_internal_dependency_generator 0
%define __debug_install_post %{nil}
Name: @rpmprefix@@tool_target@
Release: @NETBSD_RPMREL@
License: NetBSD
Group: Development/Tools
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Version: %netbsd_rpmvers
Summary: @tool_target@ Libraries
Source0: ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/amd64/binary/sets/base.tgz
Source1: ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/amd64/binary/sets/comp.tgz
%description
@tool_target@ libraries.
%prep
%setup -q -c -T -n %{name}-%{version} -a 0 -a 1
%build
# Setup sys-root (Usable for gcc >= 3.4)
mkdir -p @tool_target@/sys-root
%{__tar} cf - lib usr/lib usr/include | ( cd @tool_target@/sys-root ; %{__tar} xf -)
pushd @tool_target@/sys-root/usr/lib > /dev/null
# missing files
rm -f lib*_p.*
# not needed
rm -rf aout compat
# Fix up symlinks
find -type l -exec ls -l {} \; | \
while read a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aA ; do \
case $aA in
/lib* ) # link
rm $a8;
b=`basename $aA`
ln -s ../../lib/$b $a8
;;
esac
done
popd > /dev/null
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_prefix}
cp -a @tool_target@ $RPM_BUILD_ROOT%{_prefix}
@@ -0,0 +1,11 @@
%package sys-root
Group: Development/Tools
Summary: @tool_target@ target files for gcc >= 3.4
%description sys-root
@tool_target@ target files for gcc >= 3.4
%files sys-root
%defattr(-,root,root,-)
%dir %{_prefix}/@tool_target@
%{_prefix}/@tool_target@/sys-root