From 4b3af7a41115b9b59e8a9f67291df9fa458a4b68 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 5 Feb 2002 21:08:15 +0000 Subject: 2002-01-29 Ralf Corsepius * mkbinutilspec.in, mkgccnewlibspec.in, gccnewlib/base-chill.add, gccnewlib/base-g77.add, gccnewlib/base-gcc.add, gccnewlib/base-gcj.add, gccnewlib/gccnewlib.add, gccnewlib/target-chill.add, gccnewlib/target-g77.add, gccnewlib/target-gcc.add, gccnewlib/target-gcj.add, gccnewlib/target-objc.add: Added more support for Canadian Cross building. --- scripts/gccnewlib/gccnewlib.add | 45 ++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'scripts/gccnewlib/gccnewlib.add') diff --git a/scripts/gccnewlib/gccnewlib.add b/scripts/gccnewlib/gccnewlib.add index 9ff6197109..495325be38 100644 --- a/scripts/gccnewlib/gccnewlib.add +++ b/scripts/gccnewlib/gccnewlib.add @@ -6,6 +6,8 @@ # please send bugfixes or comments to joel@OARcorp.com # +%define _prefix @prefix@ + Vendor: OAR Corporation Distribution: Linux Name: @target_alias@-gcc-newlib @@ -22,10 +24,10 @@ Version: gcc@gcc_version@newlib@newlib_version@ # 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-everything-@gcc_version@.tar.gz -Source1: ftp://sourceware.cygnus.com/pub/newlib/newlib-@newlib_version@.tar.gz +Source1: ftp://sources.redhat.com/pub/newlib/newlib-@newlib_version@.tar.gz Patch0: gcc-@gcc_version@-rtems-@gcc_patch_version@.diff Patch1: newlib-@newlib_version@-rtems-@newlib_patch_version@.diff -Buildroot: /tmp/@target_alias@-gcc-newlib +Buildroot: %{_tmppath}/%{name} # # The original sources are not included in the source RPM. @@ -58,7 +60,7 @@ This is gcc's and newlib C Library's sources with patches for RTEMS. %prep # untar the sources inside @target_alias@-gcc-newlib -%setup -c -n @target_alias@-gcc-newlib -a 0 -a 1 +%setup -c -n %{name} -a 0 -a 1 %patch0 -p0 %patch1 -p0 @@ -70,9 +72,14 @@ This is gcc's and newlib C Library's sources with patches for RTEMS. %build cd build - ../gcc-@gcc_version@/configure --target=@target_alias@ \ +# HACK: This should be %{target} != %{build}, but SuSE's rpm screws it. +%if "%{target_os}" != "%{build_os}" + CONFIGURE_ARGS="--build=%{_build} --host=%{_target}" +%endif + + ../gcc-@gcc_version@/configure $CONFIGURE_ARGS --target=@target_alias@ \ --with-gnu-as --with-gnu-ld --with-newlib --verbose \ - --enable-threads --prefix=/opt/rtems @GCCLANGS@ + --enable-threads --prefix=%{_prefix} @GCCLANGS@ make all make info @@ -82,35 +89,35 @@ This is gcc's and newlib C Library's sources with patches for RTEMS. # 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 ../gcc-@gcc_version@/mkinstalldirs \ - $RPM_BUILD_ROOT/opt/rtems/@target_alias@/bin + $RPM_BUILD_ROOT%{_prefix}/@target_alias@/bin - make prefix=$RPM_BUILD_ROOT/opt/rtems install + make prefix=$RPM_BUILD_ROOT%{_prefix} install cd @target_alias@/newlib - make prefix=$RPM_BUILD_ROOT/opt/rtems install-info + make prefix=$RPM_BUILD_ROOT%{_prefix} install-info # cd back to build/ cd ../.. # Bug in gcc-2.95.x: It bogusly tries to share cpp for all targets. # Rename it to target_alias-cpp - if test -f $RPM_BUILD_ROOT/opt/rtems/bin/cpp@exe_ext@; + if test -f $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@; then - mv $RPM_BUILD_ROOT/opt/rtems/bin/cpp@exe_ext@ \ - $RPM_BUILD_ROOT/opt/rtems/bin/@target_alias@-cpp@exe_ext@ + mv $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@ \ + $RPM_BUILD_ROOT%{_prefix}/bin/@target_alias@-cpp@exe_ext@ fi # gzip info files - gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info 2>/dev/null - gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-? 2>/dev/null - gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-?? 2>/dev/null + gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info 2>/dev/null + gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-? 2>/dev/null + gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-?? 2>/dev/null rm -f dirs ; - echo "%dir /opt/rtems/lib" >> dirs ; - echo "%dir /opt/rtems/lib/gcc-lib" >> dirs ; - echo "%dir /opt/rtems/lib/gcc-lib/@target_alias@" >> dirs ; + echo "%dir %{_prefix}/lib" >> dirs ; + echo "%dir %{_prefix}/lib/gcc-lib" >> dirs ; + echo "%dir %{_prefix}/lib/gcc-lib/@target_alias@" >> dirs ; # Collect multilib subdirectories - TGTDIR="/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@" + TGTDIR="%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@" f=`gcc/xgcc --print-multi-lib | sed -e 's,;.*$,,'` for i in $f; do case $i in @@ -144,6 +151,6 @@ This is gcc's and newlib C Library's sources with patches for RTEMS. %clean # let rpm --clean remove BuildRoot iif using the default BuildRoot - test "$RPM_BUILD_ROOT" = "/tmp/@target_alias@-gcc-newlib" && \ + test "$RPM_BUILD_ROOT" = "%{_tmppath}/%{name}" && \ rm -rf $RPM_BUILD_ROOT -- cgit v1.2.3