2002-08-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>

* gcc3newlib/gccnewlib.add: Re-add i386-rtems Ada.
	Add %_gnat and --define 'gnat [0|1]' support.
	Enable gnat for gcc-3.2/Disable for gcc-3.1.
	Add hacks to build gnatlib.
	Re-activate commented out fragments for old gcc versions.
	Add @target_alias@-gnatgcc.
This commit is contained in:
Ralf Corsepius
2002-08-19 06:28:42 +00:00
parent 3549ab087c
commit fa42a76b9f
2 changed files with 63 additions and 14 deletions

View File

@@ -1,3 +1,12 @@
2002-08-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* gcc3newlib/gccnewlib.add: Re-add i386-rtems Ada.
Add %_gnat and --define 'gnat [0|1]' support.
Enable gnat for gcc-3.2/Disable for gcc-3.1.
Add hacks to build gnatlib.
Re-activate commented out fragments for old gcc versions.
Add @target_alias@-gnatgcc.
2002-08-15 Joel Sherrill <joel@OARcorp.com> 2002-08-15 Joel Sherrill <joel@OARcorp.com>
* setup.def: New gcc 3.1 RPMs (-7). * setup.def: New gcc 3.1 RPMs (-7).

View File

@@ -43,6 +43,17 @@ Buildroot: %{_tmppath}/%{name}
NoSource: 0 NoSource: 0
NoSource: 1 NoSource: 1
# Use rpm -ba --define 'gnat [0|1]' xxx.spec to override building gnat for
# those targets wanting to support ada.
%if "@gcc_version@" >= "3.2"
# default to building gnat
%define _gnat %{?gnat:%gnat}%{!?gnat:1}
%else
# default to not building gnat
%define _gnat %{?gnat:%gnat}%{!?gnat:0}
%endif
%define build_cxx 1 %define build_cxx 1
%define build_g77 0 %define build_g77 0
%define build_objc 0 %define build_objc 0
@@ -53,16 +64,20 @@ NoSource: 1
%define build_cxx 0 %define build_cxx 0
%endif %endif
%if "@target_alias@" == "i386-rtems"
%define build_gnat %_gnat
%endif
%if "@target_alias@" == "i960-rtems" %if "@target_alias@" == "i960-rtems"
%define build_cxx 0 %define build_cxx 0
%endif %endif
%if "@target_alias@" == "powerpc-rtems" %if "@target_alias@" == "powerpc-rtems"
%define build_gnat 1 %define build_gnat %_gnat
%endif %endif
%if "@target_alias@" == "sparc-rtems" %if "@target_alias@" == "sparc-rtems"
%define build_gnat 1 %define build_gnat %_gnat
%endif %endif
%description %description
@@ -133,21 +148,36 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
%endif %endif
make all make all
%if %build_gnat %if %build_gnat
# This gnat configuration is crap :(
# This is what is documented, but it doesn't work for me (RC) # This is what is documented, but it doesn't work for me (RC)
# make gnatlib_and_tools # make gnatlib_and_tools
make -C gcc cross-gnattools make -C gcc cross-gnattools
make -C gcc ada.all.cross make -C gcc ada.all.cross
make -C gcc gnatlib
# This should work, but doesn't.
# make -C gcc gnatlib
# This is what gcc/ada/Makefile.in contains by default,
# 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`/../newlib-@newlib_version@/newlib/libc/include"
# Without this xgcc doesn't find the target's binutils.
GNATLIBCFLAGS="$GNATLIBCFLAGS -B%{_prefix}/@target_alias@/bin/"
make -C gcc GNATLIBCFLAGS="${GNATLIBCFLAGS}" gnatlib
%endif %endif
make info make info
%install %install
cd build cd build
# # Bug in gcc-2.95.1: It doesn't build this installation directory # 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 @target_alias@/bin/gcc
# ../gcc-@gcc_version@/mkinstalldirs \ %if "@gcc_version@" < "3.0"
# $RPM_BUILD_ROOT%{_prefix}/@target_alias@/bin ../gcc-@gcc_version@/mkinstalldirs \
# $RPM_BUILD_ROOT%{_prefix}/@target_alias@/bin
%endif
make prefix=$RPM_BUILD_ROOT%{_prefix} \ make prefix=$RPM_BUILD_ROOT%{_prefix} \
bindir=$RPM_BUILD_ROOT%{_bindir} install bindir=$RPM_BUILD_ROOT%{_bindir} install
@@ -157,19 +187,29 @@ This is gcc's and newlib C Library's sources with patches for RTEMS.
# cd back to build/ # cd back to build/
cd ../.. cd ../..
# Bug in gcc-3.0.x: It puts the build dirs into *.la files %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@exe_ext@
ln $RPM_BUILD_ROOT%{_bindir}/@target_alias@-gcc@exe_ext@ \
$RPM_BUILD_ROOT%{_bindir}/@target_alias@-gnatgcc@exe_ext@
%endif
# Bug in gcc-3.x: It puts the build dirs into *.la files
files=`find ${RPM_BUILD_ROOT}%{_prefix}/@target_alias@/lib -name '*.la'` files=`find ${RPM_BUILD_ROOT}%{_prefix}/@target_alias@/lib -name '*.la'`
test -n "$files" && for i in $files; do test -n "$files" && for i in $files; do
rm -f $i rm -f $i
done done
%if "@gcc_version@" < "3.0"
# Bug in gcc-2.95.x: It bogusly tries to share cpp for all targets. # Bug in gcc-2.95.x: It bogusly tries to share cpp for all targets.
# Rename it to target_alias-cpp # Rename it to target_alias-cpp
# if test -f $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@; if test -f $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@;
# then then
# mv $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@ \ mv $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@ \
# $RPM_BUILD_ROOT%{_prefix}/bin/@target_alias@-cpp@exe_ext@ $RPM_BUILD_ROOT%{_prefix}/bin/@target_alias@-cpp@exe_ext@
# fi fi
%endif
# gzip info files # gzip info files
gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info 2>/dev/null gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info 2>/dev/null