diff options
author | Chris Johns <chrisj@rtems.org> | 2012-10-30 10:37:12 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2012-10-30 10:37:12 +1100 |
commit | bf13d27ab0b1d7df9c80099afb9a418857afd92f (patch) | |
tree | 766a54dcbddfc61289682854a03423ed450dcc68 /config | |
download | rtems-source-builder-bf13d27ab0b1d7df9c80099afb9a418857afd92f.tar.bz2 |
Initial import.
Diffstat (limited to 'config')
-rw-r--r-- | config/base.cfg | 34 | ||||
-rw-r--r-- | config/binutils-2-1.cfg | 86 | ||||
-rw-r--r-- | config/binutils-2.22-1.cfg | 18 | ||||
-rw-r--r-- | config/checks.cfg | 11 | ||||
-rw-r--r-- | config/gcc-4.6-1.cfg | 175 | ||||
-rw-r--r-- | config/gcc-4.6-newlib-1.20-1.cfg | 19 |
6 files changed, 343 insertions, 0 deletions
diff --git a/config/base.cfg b/config/base.cfg new file mode 100644 index 0000000..07e6b0e --- /dev/null +++ b/config/base.cfg @@ -0,0 +1,34 @@ +# +# Base set up for all configurations. +# + +# _prefix is set in the tool + +%define _exec_prefix %{_prefix} +%define _bindir %{_exec_prefix}/bin +%define _sbindir %{_exec_prefix}/sbin +%define _libexecdir %{_exec_prefix}/libexec +%define _datarootdir %{_prefix}/share +%define _datadir %{_datarootdir} +%define _sysconfdir %{_prefix}/etc +%define _sharedstatedir %{_prefix}/com +%define _localstatedir %{_prefix}/var +%define _includedir %{_prefix}/include +%define _libdir %{_exec_prefix}/%{_lib} +%define _mandir %{_datarootdir}/man +%define _infodir %{_datarootdir}/info +%define _localedir %{_datarootdir}/locale + +%ifos mingw mingw32 +%define _exeext .exe +%define debug_package %{nil} +%define _libdir %{_exec_prefix}/lib +%else +%define _exeext %{nil} +%endif + +%if "%{_build}" != "%{_host}" +%define _host_prefix %{_host}- +%else +%define _host_prefix %{nil} +%endif diff --git a/config/binutils-2-1.cfg b/config/binutils-2-1.cfg new file mode 100644 index 0000000..fdeae97 --- /dev/null +++ b/config/binutils-2-1.cfg @@ -0,0 +1,86 @@ +# +# Binutils 2.xx Version 1. +# +# This configuration file configure's, make's and install's binutils. +# + +%include %{_configdir}/checks.cfg + +Summary: Binutils v%{binutils_version} for target %{_target} on host %{_host} +Version: %{binutils_version} +Release: %{release} +URL: http://sources.redhat.com/binutils +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# Source +# +Source0: ftp://ftp.gnu.org/gnu/binutils/binutils-%{binutils_version}.tar.bz2 + +# +# Prepare the source code. +# +%prep +%setup -q -c -T -n %{name}-%{version} +%setup -q -D -T -n %{name}-%{version} -a0 +cd binutils-%{binutils_version} +%{?patch0:%patch0 -p1} +cd .. + +%build + export PATH="%{_bindir}:${PATH}" + mkdir -p build + cd build +%if "%{_build}" != "%{_host}" + CFLAGS_FOR_BUILD="-g -O2 -Wall" \ +%endif + CFLAGS="$TB_OPT_FLAGS" \ + ../binutils-%{binutils_version}/configure \ + --build=%{_build} --host=%{_host} \ + --target=%{_target} \ + --verbose --disable-nls \ + --without-included-gettext \ + --disable-win32-registry \ + --disable-werror \ + --prefix=%{_prefix} --bindir=%{_bindir} \ + --exec-prefix=%{_exec_prefix} \ + --includedir=%{_includedir} --libdir=%{_libdir} \ + --mandir=%{_mandir} --infodir=%{_infodir} + + %{__make} %{?_smp_mflags} all + cd .. + +%install + export PATH="%{_bindir}:${PATH}" + rm -rf $TB_BUILD_ROOT + + cd build + %{__make} DESTDIR=$TB_BUILD_ROOT install + + # Dropped in FSF-binutils-2.9.5, but Cygwin still ships it. + rm -rf $TB_BUILD_ROOT%{_infodir}/configure.info* + + rm -f $TB_BUILD_ROOT%{_infodir}/dir + touch $TB_BUILD_ROOT%{_infodir}/dir + + # binutils does not install share/locale, however it uses it + mkdir -p $TB_BUILD_ROOT%{_prefix}/share/locale + + # We don't ship host files + rm -f ${TB_BUILD_ROOT}%{_libdir}/libiberty* + + # manpages without corresponding tools + if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-dlltool%{_exeext}; then + rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-dlltool* + fi + if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-nlmconv%{_exeext}; then + rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-nlmconv* + fi + if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-windres%{_exeext}; then + rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windres* + fi + if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-windmc%{_exeext}; then + rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windmc* + fi + + cd .. diff --git a/config/binutils-2.22-1.cfg b/config/binutils-2.22-1.cfg new file mode 100644 index 0000000..c261a65 --- /dev/null +++ b/config/binutils-2.22-1.cfg @@ -0,0 +1,18 @@ +# +# Binutils 2.22. +# + +%include %{_configdir}/checks.cfg +%include %{_configdir}/base.cfg + +%define binutils_version 2.22 + +Name: %{_target}-binutils-%{binutils_version}-%{release} + +%description +Cross binutils for target %{_target}. + +# +# The binutils build instructions. We use 2.xx Release 1. +# +%include %{_configdir}/binutils-2-1.cfg diff --git a/config/checks.cfg b/config/checks.cfg new file mode 100644 index 0000000..9586f46 --- /dev/null +++ b/config/checks.cfg @@ -0,0 +1,11 @@ +# +# Standard checks. +# + +%if %{_target} == %{nil} +%error No 'target' defined +%endif + +%ifn %{defined release} +%error No 'release' defined +%endif diff --git a/config/gcc-4.6-1.cfg b/config/gcc-4.6-1.cfg new file mode 100644 index 0000000..a25c0f9 --- /dev/null +++ b/config/gcc-4.6-1.cfg @@ -0,0 +1,175 @@ +# +# GCC 4.6 Version 1. +# +# This configuration file configure's, make's and install's gcc. It uses +# newlib, MPFR, MPC, and GMP in a one-tree build configuration. +# + +%include %{_configdir}/checks.cfg + +%ifn %{defined gcc_version_message} +%error No GCC Version message defined. +%endif + +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: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_version}.tar.bz2 +%if %{enable_cxx} +Source1: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_pkgvers}/%{gcc_version}/gcc-g++-%{gcc_version}.tar.bz2 +%endif + +# +# Newlib +# +Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz + +# +# Packages GCC requires +# +Source20: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2 +Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz +Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2 + +# +# The GCC library directory +# +%global _gcclibdir %{_prefix}/lib + +# +# Prepare the source code. +# +%prep + %setup -q -c -T -n %{name}-%{version} + + # gcc core + %setup -q -T -D -n %{name}-%{version} -a0 + cd gcc-%{gcc_version} + %{?patch0:%patch0 -p1} + cd .. + + # g++ + %{?source1:%setup -q -T -D -n %{name}-%{version} -a1} + cd gcc-%{gcc_version} + %{?patch1:%patch1 -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} + + # MPFR + %setup -q -T -D -n %{name}-%{version} -a20 + cd mpfr-%{mpfr_version} + %{?patch20:%patch20 -p1} + cd .. + # Build MPFR one-tree style + ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_version}/mpfr + + # MPC + %setup -q -T -D -n %{name}-%{version} -a21 + cd mpc-%{mpc_version} + %{?patch21:%patch21 -p1} + cd .. + # Build MPC one-tree style + ln -s ../mpc-%{mpc_version} gcc-%{gcc_version}/mpc + + # GMP + %setup -q -T -D -n %{name}-%{version} -a22 + cd gmp-%{gmp_version} + %{?patch22:%patch22 -p1} + cd .. + # Build GMP one-tree style + ln -s ../gmp-%{gmp_version} gcc-%{gcc_version}/gmp + + 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 ${TB_OPT_FLAGS}" \ +%else + # gcc is not ready to be compiled with -std=gnu99 + CC=$(echo "%{__cc} ${TB_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 \ + --disable-lto \ + %{?with_threads:--enable-threads}%{!?with_threads:--disable-threads} \ + %{?with_plugin:--enable-plugin}%{!?with_plugin:--disable-plugin} \ + --enable-newlib-io-c99-formats \ + %{?with_iconv:--enable-newlib-iconv} \ + --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} %{?_smp_mflags} all + cd .. + +%install + export PATH="%{_bindir}:${PATH}" + rm -rf $TB_BUILD_ROOT + + cd build + %{__make} DESTDIR=$TB_BUILD_ROOT install + cd .. + + # libiberty doesn't honor --libdir, but always installs to a + # magically guessed _libdir + rm -f ${TB_BUILD_ROOT}%{_libdir}/libiberty.a + + # We use the version from binutils + rm -f $TB_BUILD_ROOT%{_bindir}/%{_target}-c++filt%{_exeext} + + # We don't ship info/dir + rm -f $TB_BUILD_ROOT%{_infodir}/dir + + # Don't want libffi's man-pages + rm -f $TB_BUILD_ROOT%{_mandir}/man3/*ffi* diff --git a/config/gcc-4.6-newlib-1.20-1.cfg b/config/gcc-4.6-newlib-1.20-1.cfg new file mode 100644 index 0000000..b76fee0 --- /dev/null +++ b/config/gcc-4.6-newlib-1.20-1.cfg @@ -0,0 +1,19 @@ +# +# GCC 2.6, Newlib 1.20 +# + +%include %{_configdir}/checks.cfg +%include %{_configdir}/base.cfg + +%define gcc_version 4.6.3 +%define newlib_version 1.20.0 +%define mpfr_version 3.0.1 +%define mpc_version 0.8.2 +%define gmp_version 5.0.1 + +Name: %{_target}-gcc-%{gcc_version}-newlib-%{newlib_version}-%{release} + +# +# The gcc/newlib build instructions. We use 4.6 Release 1. +# +%include %{_configdir}/gcc-4.6-1.cfg |