2003-08-23 Ralf Corsepius <corsepiu@faw.uni-ulm.de>

* common/common.add.in: s/www.oarcorp.com/www.rtems.com/.
	Add %define __os_install_post %{nil} to prevent RH-9's rpm-brp-strip
	from running (Chokes on foreign object formats).
	* gcc3newlib/base-g77.add:
	Use %{gcc_version} instead of @gcc_version@.
	* gcc3newlib/gccnewlib.add:
	Use %{gcc_version} instead of @gcc_version@.
	Reflect gcc >= 3.3 shipping monolytic infos.
	* gcc3newlib/target-c++.add:
	Use %{gcc_version} instead of @gcc_version@.
	Don't pickup c++filt.
	* gcc3newlib/target-g77.add:
	Use %{gcc_version} instead of @gcc_version@.
	* gcc3newlib/target-gcc.add:
	Use %{gcc_version} instead of @gcc_version@.
	* gcc3newlib/target-gcj.add:
	Use %{gcc_version} instead of @gcc_version@.
	* gcc3newlib/target-gnat.add:
	Use %{gcc_version} instead of @gcc_version@.
	* gcc3newlib/target-objc.add:
	Use %{gcc_version} instead of @gcc_version@.
This commit is contained in:
Ralf Corsepius
2003-08-24 04:41:10 +00:00
parent 9789eefcd7
commit ae67478147
10 changed files with 148 additions and 111 deletions

View File

@@ -2,8 +2,10 @@
%define gcc_version @gcc_version@
%define newlib_version @newlib_version@
Name: @target_alias@-gcc-newlib
Summary: gcc and newlib C Library for @target_alias@.
%define gcc_target @target_alias@
Name: %{gcc_target}-gcc-newlib
Summary: gcc and newlib C Library for %{gcc_target}.
Group: rtems
Release: @Release@
License: gcc is GPL/LGPL ; newlib no has restrictions on run-time usage
@@ -13,15 +15,15 @@ Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com
Version: gcc%{gcc_version}newlib%{newlib_version}
# gcc 3.x and gcc 2.9
# Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.gz
Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.bz2
# Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-%{gcc_version}.tar.gz
Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-%{gcc_version}.tar.bz2
# gcc 2.95.x
# Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-%{gcc_version}.tar.bz2
Source1: ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_version}.tar.gz
@PATCH1@
@PATCH3@
BuildPreReq: texinfo >= 4.2
BuildPreReq: @target_alias@-binutils
BuildPreReq: %{gcc_target}-binutils
#
# The original sources are not included in the source RPM.
# If we included them, then the source RPMs for each target
@@ -65,38 +67,38 @@ NoSource: 1
%define build_gcj 0
%define build_gnat 0
%if "@target_alias@" == "arm-rtems"
%if "%{gcc_target}" == "arm-rtems"
%define build_gcj %_gcj
%endif
%if "@target_alias@" == "c4x-rtems"
%if "%{gcc_target}" == "c4x-rtems"
%define build_cxx 0
%endif
%if "@target_alias@" == "i386-rtems"
%if "%{gcc_target}" == "i386-rtems"
%define build_gnat %_gnat
%define build_gcj %_gcj
%endif
%if "@target_alias@" == "i960-rtems"
%if "%{gcc_target}" == "i960-rtems"
%define build_cxx 0
%endif
%if "@target_alias@" == "m68k-rtems"
%if "%{gcc_target}" == "m68k-rtems"
%define build_gcj %_gcj
%endif
%if "@target_alias@" == "mips-rtems"
%if "%{gcc_target}" == "mips-rtems"
%define build_gnat %_gnat
%define build_gcj %_gcj
%endif
%if "@target_alias@" == "powerpc-rtems"
%if "%{gcc_target}" == "powerpc-rtems"
%define build_gnat %_gnat
%define build_gcj %_gcj
%endif
%if "@target_alias@" == "sparc-rtems"
%if "%{gcc_target}" == "sparc-rtems"
%define build_gnat %_gnat
%define build_gcj %_gcj
%endif
@@ -133,7 +135,7 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
Or you can try the ftp options of rpm :-)
%prep
# untar the sources inside @target_alias@-gcc-newlib
# untar the sources inside %{gcc_target}-gcc-newlib
%setup -c -T -n %{name} -a0 -a1
@PATCH2@
@@ -177,7 +179,7 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
%endif
../gcc-%{gcc_version}/configure \
--build=%_build --host=%_host \
--target=@target_alias@ \
--target=%{gcc_target} \
--with-gnu-as --with-gnu-ld --with-newlib --verbose \
--with-system-zlib --disable-nls \
--enable-version-specific-runtime-libs \
@@ -212,11 +214,11 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
# but what we override below
GNATLIBCFLAGS="-g -O2"
# Let gnatlib building find newlib's headers
GNATLIBCFLAGS="$GNATLIBCFLAGS -isystem `pwd`/@target_alias@/newlib/targ-include"
GNATLIBCFLAGS="$GNATLIBCFLAGS -isystem `pwd`/%{gcc_target}/newlib/targ-include"
GNATLIBCFLAGS="$GNATLIBCFLAGS -isystem `pwd`/../newlib-%{newlib_version}/newlib/libc/include"
# Without this xgcc doesn't find the target's binutils.
GNATLIBCFLAGS="$GNATLIBCFLAGS -B%{_prefix}/@target_alias@/bin/"
%if "@target_alias@" == "mips-rtems"
GNATLIBCFLAGS="$GNATLIBCFLAGS -B%{_prefix}/%{gcc_target}/bin/"
%if "%{gcc_target}" == "mips-rtems"
GNATLIBCFLAGS="$GNATLIBCFLAGS -G0"
%endif
make -C gcc GNATLIBCFLAGS="${GNATLIBCFLAGS}" gnatlib
@@ -226,15 +228,15 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
%install
cd build
# Bug in gcc-2.95.1: It doesn't build this installation directory
# If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc
# If it doesn't find it, gcc doesn't install %{gcc_target}/bin/gcc
%if "%{gcc_version}" < "3.0"
../gcc-%{gcc_version}/mkinstalldirs \
$RPM_BUILD_ROOT%{_prefix}/@target_alias@/bin
$RPM_BUILD_ROOT%{_prefix}/%{gcc_target}/bin
%endif
make prefix=$RPM_BUILD_ROOT%{_prefix} \
bindir=$RPM_BUILD_ROOT%{_bindir} install
cd @target_alias@/newlib
cd %{gcc_target}/newlib
make prefix=$RPM_BUILD_ROOT%{_prefix} \
bindir=$RPM_BUILD_ROOT%{_bindir} install-info
# cd back to build/
@@ -243,9 +245,9 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
%if %build_gnat
# Install a copy of gcc as gnatgcc
# Enables us to mix different versions of gnat and gnatgcc
rm -f $RPM_BUILD_ROOT%{_bindir}/@target_alias@-gnatgcc%{_exeext}
ln $RPM_BUILD_ROOT%{_bindir}/@target_alias@-gcc%{_exeext} \
$RPM_BUILD_ROOT%{_bindir}/@target_alias@-gnatgcc%{_exeext}
rm -f $RPM_BUILD_ROOT%{_bindir}/%{gcc_target}-gnatgcc%{_exeext}
ln $RPM_BUILD_ROOT%{_bindir}/%{gcc_target}-gcc%{_exeext} \
$RPM_BUILD_ROOT%{_bindir}/%{gcc_target}-gnatgcc%{_exeext}
%endif
# Bug in gcc-3.x: It puts the build dirs into *.la files
@@ -259,25 +261,28 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
if test -f $RPM_BUILD_ROOT%{_prefix}/bin/cpp%{_exeext};
then
mv $RPM_BUILD_ROOT%{_prefix}/bin/cpp%{_exeext} \
$RPM_BUILD_ROOT%{_prefix}/bin/@target_alias@-cpp%{_exeext}
$RPM_BUILD_ROOT%{_prefix}/bin/%{gcc_target}-cpp%{_exeext}
fi
%endif
# gzip info files
gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info 2>/dev/null
%if "%{gcc_version}" < "3.3"
# gcc-3.3 ships monolytic *.infos
gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-? 2>/dev/null
gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-?? 2>/dev/null
%endif
rm -f dirs ;
echo "%defattr(-,root,root)" >> dirs
echo "%dir %{_prefix}/lib" >> dirs ;
echo "%dir %{_prefix}/lib/gcc-lib" >> dirs ;
echo "%dir %{_prefix}/lib/gcc-lib/@target_alias@" >> dirs ;
echo "%dir %{_prefix}/lib/gcc-lib/%{gcc_target}" >> dirs ;
# Collect multilib subdirectories
f=`gcc/xgcc -Bgcc/ --print-multi-lib | sed -e 's,;.*$,,'`
TGTDIR="%{_prefix}/lib/gcc-lib/@target_alias@/%{gcc_version}"
TGTDIR="%{_prefix}/lib/gcc-lib/%{gcc_target}/%{gcc_version}"
for i in $f; do
case $i in
\.) echo "%dir ${TGTDIR}" >> dirs
@@ -287,7 +292,7 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
esac
done
TGTDIR="%{_prefix}/@target_alias@/lib"
TGTDIR="%{_prefix}/%{gcc_target}/lib"
for i in $f; do
case $i in
\.) echo "%dir ${TGTDIR}" >> dirs
@@ -304,7 +309,7 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
cp dirs files.gcj
cp dirs files.g++
TGTDIR="%{_prefix}/lib/gcc-lib/@target_alias@/%{gcc_version}"
TGTDIR="%{_prefix}/lib/gcc-lib/%{gcc_target}/%{gcc_version}"
f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
for i in $f; do
case $i in
@@ -327,7 +332,7 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
esac
done
TGTDIR="%{_prefix}/@target_alias@/lib"
TGTDIR="%{_prefix}/%{gcc_target}/lib"
f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
for i in $f; do
case $i in