diff options
Diffstat (limited to '')
-rw-r--r-- | rtems/config/rtems-nios2-gcc-4.1-newlib-1.19.0-1.cfg | 167 |
1 files changed, 167 insertions, 0 deletions
diff --git a/rtems/config/rtems-nios2-gcc-4.1-newlib-1.19.0-1.cfg b/rtems/config/rtems-nios2-gcc-4.1-newlib-1.19.0-1.cfg new file mode 100644 index 0000000..c2a35f3 --- /dev/null +++ b/rtems/config/rtems-nios2-gcc-4.1-newlib-1.19.0-1.cfg @@ -0,0 +1,167 @@ +# +# RTEMS NIOS2 GCC 4.1., Newlib 1.19.0 +# + +%include %{_configdir}/checks.cfg +%include %{_configdir}/base.cfg + +%define gcc_version 4.1 +%define newlib_version 1.19.0 +%define newlib_cfg normalc + +%define with_threads 1 +%define with_plugin 0 +%define enable_cxx 1 + +# +# The RTEMS 4.11 patches +# +Patch0: nios2-gcc-4.1-rtems-20110818.diff +Patch10: nios2-newlib-1.19.0-rtems-20110720.diff + +# +# Project custom message +# +%define gcc_version_message RTEMS %{rtems_version}-%{release},gcc-%{gcc_version}/newlib-%{newlib_version} + +Name: %{_target}-gcc-%{gcc_version}-newlib-%{newlib_version}-%{release} +Summary: GCC v%{gcc_version} and Newlib v%{newlib_version} for target %{_target} on host %{_host} +Version: %{gcc_version} +Release: %{release} +URL: http://gcc.gnu.org/ +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# Source +# +# +# GCC core and G++ +# +Source0: http://www.rtems.org/ftp/people/chrisj/nios/nios2-gcc-4.1.tar.bz2 + +# +# Newlib +# +Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz + +# +# The GCC library directory +# +%global _gcclibdir %{_prefix}/lib + +# +# Prepare the source code. +# +%prep + %setup -q -c -T -n %{name}-%{version} + + # gcc + %setup -q -T -D -n %{name}-%{version} -a0 + cd gcc-%{gcc_version} + %{?patch0:%patch0 -p1} + cd .. + + # newlib + %setup -q -T -D -n %{name}-%{version} -a10 + cd newlib-%{newlib_version} + %{?patch10:%patch10 -p1} + cd .. + # Link newlib into the gcc source tree + ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_version} + + echo "%{gcc_version_message}" > gcc-%{gcc_version}/gcc/DEV-PHASE + + # Fix timestamps + cd gcc-%{gcc_version} + contrib/gcc_update --touch + cd .. + +%build + export PATH="%{_bindir}:${PATH}" + mkdir -p build + cd build + languages="c" +%if %{enable_cxx} + languages="$languages,c++" +%endif +%if "%{_build}" != "%{_host}" + CFLAGS_FOR_BUILD="-g -O2 -Wall" \ + CC="%{_host}-gcc ${SB_OPT_FLAGS}" \ +%else + # gcc is not ready to be compiled with -std=gnu99 + CC=$(echo "%{__cc} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \ +%endif + ../gcc-%{gcc_version}/configure \ + --prefix=%{_prefix} \ + --bindir=%{_bindir} \ + --exec_prefix=%{_exec_prefix} \ + --includedir=%{_includedir} \ + --libdir=%{_gcclibdir} \ + --libexecdir=%{_libexecdir} \ + --mandir=%{_mandir} \ + --infodir=%{_infodir} \ + --datadir=%{_datadir} \ + --build=%_build --host=%_host \ + --target=%{_target} \ + --disable-libstdcxx-pch \ + --with-gnu-as --with-gnu-ld --verbose \ + --with-newlib \ + --with-system-zlib \ + --disable-nls --without-included-gettext \ + --disable-win32-registry \ + --enable-version-specific-runtime-libs \ + %{?with_lto:--enable-lto}%{!?with_lto:--disable-lto} \ + %{?with_threads:--enable-threads}%{!?with_threads:--disable-threads} \ + %{?with_plugin:--enable-plugin}%{!?with_plugin:--disable-plugin} \ + %{?enable_obsolete:--enable-obsolete} \ + --enable-languages="$languages" + +%if "%_host" != "%_build" + # Bug in gcc-3.2.1: + # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs + mkdir -p gcc/include + cp ../gcc-%{gcc_version}/gcc/gsyslimits.h gcc/include/syslimits.h +%endif + + %{__make} -w %{?_smp_mflags} N2GNU_BUILD_NEWLIB="%{newlib_cfg}" all + cd .. + +%install + export PATH="%{_bindir}:${PATH}" + rm -rf $SB_BUILD_ROOT + + cd build + + # + # Filter the doc stuff we do not want so it builds without error on + # hosts that do not have tex to pdf converters installed. + # + for m in $(find . -name Makefile) + do + mv $m $m.orig + echo "Doc filteirng $m.orig -> $m" + cat $m.orig | sed -e 's/ pdf / /g' \ + -e 's/ pdf$/ /g' \ + -e 's/ install-pdf / /g' \ + -e 's/ install-pdf$/ /g' \ + -e 's/ install-html / /g' \ + -e 's/ install-html$/ /g' \ + -e 's/ html / /g' \ + -e 's/ html$/ /g' > $m + done + + %{__make} -w DESTDIR=$SB_BUILD_ROOT N2GNU_BUILD_NEWLIB="%{newlib_cfg}" install + cd .. + + # libiberty doesn't honor --libdir, but always installs to a + # magically guessed _libdir + rm -f ${SB_BUILD_ROOT}%{_libdir}/libiberty.a + + # We use the version from binutils + rm -f $SB_BUILD_ROOT%{_bindir}/%{_target}-c++filt%{_exeext} + + # We don't ship info/dir + rm -f $SB_BUILD_ROOT%{_infodir}/dir + + # Don't want libffi's man-pages + rm -f $SB_BUILD_ROOT%{_mandir}/man3/*ffi* |