mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Add Canadian Cross support.
Add support to build MinGW tools using Cygwin. This is a Canadian cross build. Do not expand the directives when parsing a configuration file. Hold in the package object the text as read from the configuration file. Still parse the logic but leave the macros. This allows a configuration to be varied when the build happens. The Canadian cross uses this to build a build compiler used to build a Cxc runtime. Add Cxc support to the build module. In the defaults add rm and rmfile macros, add Cxc paths and pre-build script code. In the setbuilder check for a Cxc build and if so and the package allow Cxc build the build host version then the host target version. Add cygiwn support to the defaults processing and to the Windows module.
This commit is contained in:
parent
0d9b101247
commit
4f26bdb2f0
@ -8,6 +8,9 @@
|
|||||||
%define binutils_version 2.20.1
|
%define binutils_version 2.20.1
|
||||||
|
|
||||||
Patch0: %{rtems_binutils_patches}/binutils-2.20.1-rtems4.10-20100826.diff
|
Patch0: %{rtems_binutils_patches}/binutils-2.20.1-rtems4.10-20100826.diff
|
||||||
|
%ifos win32 mingw ming32 cygwin
|
||||||
|
Patch1: %{rtems_binutils_patches}/cygwin/binutils-2.20.1-cygwin-w64-20130324.diff
|
||||||
|
%endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# RTEMS Build Set patches.
|
# RTEMS Build Set patches.
|
||||||
|
@ -15,14 +15,6 @@
|
|||||||
%define with_plugin 0
|
%define with_plugin 0
|
||||||
%define with_iconv 0
|
%define with_iconv 0
|
||||||
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%ifn %{defined enable_obsolete}
|
|
||||||
%define enable_obsolete 0
|
|
||||||
%endif
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# The RTEMS 4.9 patches
|
# The RTEMS 4.9 patches
|
||||||
#
|
#
|
||||||
|
@ -2,6 +2,14 @@
|
|||||||
# GCC 4.4.7, Newlib 1.18.0
|
# GCC 4.4.7, Newlib 1.18.0
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# M32C C++ does not work.
|
||||||
|
# gcc-4.4.7/libstdc++-v3/src/mt_allocator.cc:76: error: cast from 'void*' to 'size_t' loses precision
|
||||||
|
#
|
||||||
|
%if %{_target} == m32c-rtems4.10
|
||||||
|
%define enable_cxx 0
|
||||||
|
%endif
|
||||||
|
|
||||||
%include %{_configdir}/checks.cfg
|
%include %{_configdir}/checks.cfg
|
||||||
%include %{_configdir}/base.cfg
|
%include %{_configdir}/base.cfg
|
||||||
|
|
||||||
@ -15,18 +23,6 @@
|
|||||||
%define with_plugin 0
|
%define with_plugin 0
|
||||||
%define with_iconv 1
|
%define with_iconv 1
|
||||||
|
|
||||||
#
|
|
||||||
# M32C C++ does not work.
|
|
||||||
# gcc-4.4.7/libstdc++-v3/src/mt_allocator.cc:76: error: cast from 'void*' to 'size_t' loses precision
|
|
||||||
#
|
|
||||||
%if %{_target} == m32c-rtems4.10
|
|
||||||
%define enable_cxx 0
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# The RTEMS 4.10 patches
|
# The RTEMS 4.10 patches
|
||||||
#
|
#
|
||||||
|
@ -15,14 +15,6 @@
|
|||||||
%define with_plugin 0
|
%define with_plugin 0
|
||||||
%define with_iconv 1
|
%define with_iconv 1
|
||||||
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%ifn %{defined enable_obsolete}
|
|
||||||
%define enable_obsolete 0
|
|
||||||
%endif
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Libiberty strsignal fix
|
# Libiberty strsignal fix
|
||||||
#
|
#
|
||||||
|
@ -2,19 +2,6 @@
|
|||||||
# GCC 4.6.3, Newlib 1.20.0
|
# GCC 4.6.3, Newlib 1.20.0
|
||||||
#
|
#
|
||||||
|
|
||||||
%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.5
|
|
||||||
|
|
||||||
%define with_threads 1
|
|
||||||
%define with_plugin 0
|
|
||||||
%define with_iconv 1
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# AVR C++ does not work.
|
# AVR C++ does not work.
|
||||||
# configure: error: unable to detect exception model
|
# configure: error: unable to detect exception model
|
||||||
@ -31,9 +18,18 @@
|
|||||||
%define enable_cxx 0
|
%define enable_cxx 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifn %{defined enable_cxx}
|
%include %{_configdir}/checks.cfg
|
||||||
%define enable_cxx 1
|
%include %{_configdir}/base.cfg
|
||||||
%endif
|
|
||||||
|
%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.5
|
||||||
|
|
||||||
|
%define with_threads 1
|
||||||
|
%define with_plugin 0
|
||||||
|
%define with_iconv 1
|
||||||
|
|
||||||
#
|
#
|
||||||
# The RTEMS 4.11 patches
|
# The RTEMS 4.11 patches
|
||||||
|
@ -2,19 +2,6 @@
|
|||||||
# GCC 4.7.2., Newlib 1.20.0
|
# GCC 4.7.2., Newlib 1.20.0
|
||||||
#
|
#
|
||||||
|
|
||||||
%include %{_configdir}/checks.cfg
|
|
||||||
%include %{_configdir}/base.cfg
|
|
||||||
|
|
||||||
%define gcc_version 4.7.2
|
|
||||||
%define newlib_version 1.20.0
|
|
||||||
%define mpfr_version 3.0.1
|
|
||||||
%define mpc_version 0.8.2
|
|
||||||
%define gmp_version 5.0.5
|
|
||||||
|
|
||||||
%define with_threads 1
|
|
||||||
%define with_plugin 0
|
|
||||||
%define with_iconv 1
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# AVR C++ does not work.
|
# AVR C++ does not work.
|
||||||
# configure: error: unable to detect exception model
|
# configure: error: unable to detect exception model
|
||||||
@ -31,10 +18,6 @@
|
|||||||
%define enable_cxx 0
|
%define enable_cxx 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# If arm-rtems4.11 add --enable-obsolete.
|
# If arm-rtems4.11 add --enable-obsolete.
|
||||||
#
|
#
|
||||||
@ -44,6 +27,19 @@
|
|||||||
%define enable_obsolete 0
|
%define enable_obsolete 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%include %{_configdir}/checks.cfg
|
||||||
|
%include %{_configdir}/base.cfg
|
||||||
|
|
||||||
|
%define gcc_version 4.7.2
|
||||||
|
%define newlib_version 1.20.0
|
||||||
|
%define mpfr_version 3.0.1
|
||||||
|
%define mpc_version 0.8.2
|
||||||
|
%define gmp_version 5.0.5
|
||||||
|
|
||||||
|
%define with_threads 1
|
||||||
|
%define with_plugin 0
|
||||||
|
%define with_iconv 1
|
||||||
|
|
||||||
#
|
#
|
||||||
# The RTEMS 4.11 patches
|
# The RTEMS 4.11 patches
|
||||||
#
|
#
|
||||||
|
@ -16,14 +16,6 @@
|
|||||||
%define with_plugin 0
|
%define with_plugin 0
|
||||||
%define with_iconv 1
|
%define with_iconv 1
|
||||||
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%ifn %{defined enable_obsolete}
|
|
||||||
%define enable_obsolete 0
|
|
||||||
%endif
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# The RTEMS 4.11 patches
|
# The RTEMS 4.11 patches
|
||||||
#
|
#
|
||||||
|
@ -15,10 +15,6 @@
|
|||||||
%define with_plugin 0
|
%define with_plugin 0
|
||||||
%define with_iconv 1
|
%define with_iconv 1
|
||||||
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# The RTEMS 4.11 patches
|
# The RTEMS 4.11 patches
|
||||||
#
|
#
|
||||||
|
@ -45,9 +45,11 @@ cd ..
|
|||||||
ac_prefix=%{_prefix}
|
ac_prefix=%{_prefix}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%if "%{_build}" != "%{_host}"
|
if test "%{_build}" != "%{_host}" ; then
|
||||||
CFLAGS_FOR_BUILD="-g -O2 -Wall" \
|
CFLAGS_FOR_BUILD="-g -O2 -Wall"
|
||||||
%endif
|
fi
|
||||||
|
export CFLAGS CFLAGS_FOR_BUILD CC
|
||||||
|
|
||||||
CFLAGS="$SB_OPT_FLAGS" \
|
CFLAGS="$SB_OPT_FLAGS" \
|
||||||
./configure \
|
./configure \
|
||||||
--build=%{_build} --host=%{_host} \
|
--build=%{_build} --host=%{_host} \
|
||||||
@ -57,6 +59,8 @@ cd ..
|
|||||||
|
|
||||||
%{__make} %{?_smp_mflags} all
|
%{__make} %{?_smp_mflags} all
|
||||||
|
|
||||||
|
unset CFLAGS_FOR_BUILD
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Autoconf 2.22.
|
# Autoconf 2.69.
|
||||||
#
|
#
|
||||||
|
|
||||||
%if %{release} == %{nil}
|
%if %{release} == %{nil}
|
||||||
|
@ -45,9 +45,11 @@ cd ..
|
|||||||
am_prefix=%{_prefix}
|
am_prefix=%{_prefix}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%if "%{_build}" != "%{_host}"
|
if test "%{_build}" != "%{_host}" ; then
|
||||||
CFLAGS_FOR_BUILD="-g -O2 -Wall" \
|
CFLAGS_FOR_BUILD="-g -O2 -Wall"
|
||||||
%endif
|
fi
|
||||||
|
export CFLAGS CFLAGS_FOR_BUILD CC
|
||||||
|
|
||||||
CFLAGS="$SB_OPT_FLAGS" \
|
CFLAGS="$SB_OPT_FLAGS" \
|
||||||
./configure \
|
./configure \
|
||||||
--build=%{_build} --host=%{_host} \
|
--build=%{_build} --host=%{_host} \
|
||||||
@ -56,6 +58,8 @@ cd ..
|
|||||||
|
|
||||||
%{__make} %{?_smp_mflags} all
|
%{__make} %{?_smp_mflags} all
|
||||||
|
|
||||||
|
unset CFLAGS_FOR_BUILD
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
@ -13,6 +13,11 @@ Release: %{release}
|
|||||||
URL: http://sources.redhat.com/binutils
|
URL: http://sources.redhat.com/binutils
|
||||||
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Supports Candian Cross (Cxc).
|
||||||
|
#
|
||||||
|
%define allow_cxc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Source
|
# Source
|
||||||
#
|
#
|
||||||
@ -40,13 +45,14 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export PATH="%{_bindir}:${PATH}"
|
|
||||||
mkdir -p build
|
|
||||||
cd build
|
|
||||||
%{?host_force_32bit:HOST_FORCE_32BIT="-m32"}
|
%{?host_force_32bit:HOST_FORCE_32BIT="-m32"}
|
||||||
%if "%{_build}" != "%{_host}"
|
if test "%{_build}" != "%{_host}" ; then
|
||||||
CFLAGS_FOR_BUILD="-g -O2 -Wall ${HOST_FORCE_32BIT}" \
|
build_dir="build-cxc"
|
||||||
%endif
|
else
|
||||||
|
build_dir="build"
|
||||||
|
fi
|
||||||
|
mkdir -p ${build_dir}
|
||||||
|
cd ${build_dir}
|
||||||
CFLAGS="$SB_OPT_FLAGS" \
|
CFLAGS="$SB_OPT_FLAGS" \
|
||||||
../binutils-%{binutils_version}/configure \
|
../binutils-%{binutils_version}/configure \
|
||||||
--build=%{_build} --host=%{_host} \
|
--build=%{_build} --host=%{_host} \
|
||||||
@ -65,36 +71,35 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%install
|
%install
|
||||||
export PATH="%{_bindir}:${PATH}"
|
%{__rmdir} $SB_BUILD_ROOT
|
||||||
rm -rf $SB_BUILD_ROOT
|
|
||||||
|
|
||||||
cd build
|
cd ${build_dir}
|
||||||
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
||||||
|
|
||||||
# Dropped in FSF-binutils-2.9.5, but Cygwin still ships it.
|
# Dropped in FSF-binutils-2.9.5, but Cygwin still ships it.
|
||||||
rm -rf $SB_BUILD_ROOT%{_infodir}/configure.info*
|
%{__rmdir} $SB_BUILD_ROOT%{_infodir}/configure.info*
|
||||||
|
|
||||||
rm -f $SB_BUILD_ROOT%{_infodir}/dir
|
%{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir
|
||||||
touch $SB_BUILD_ROOT%{_infodir}/dir
|
touch $SB_BUILD_ROOT%{_infodir}/dir
|
||||||
|
|
||||||
# binutils does not install share/locale, however it uses it
|
# binutils does not install share/locale, however it uses it
|
||||||
mkdir -p $SB_BUILD_ROOT%{_prefix}/share/locale
|
mkdir -p $SB_BUILD_ROOT%{_prefix}/share/locale
|
||||||
|
|
||||||
# We don't ship host files
|
# We don't ship host files
|
||||||
rm -f ${SB_BUILD_ROOT}%{_libdir}/libiberty*
|
%{__rmfile} ${SB_BUILD_ROOT}%{_libdir}/libiberty*
|
||||||
|
|
||||||
# manpages without corresponding tools
|
# manpages without corresponding tools
|
||||||
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-dlltool%{_exeext}; then
|
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-dlltool%{_exeext}; then
|
||||||
rm -f ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-dlltool*
|
%{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-dlltool*
|
||||||
fi
|
fi
|
||||||
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-nlmconv%{_exeext}; then
|
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-nlmconv%{_exeext}; then
|
||||||
rm -f ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-nlmconv*
|
%{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-nlmconv*
|
||||||
fi
|
fi
|
||||||
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-windres%{_exeext}; then
|
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-windres%{_exeext}; then
|
||||||
rm -f ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windres*
|
%{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windres*
|
||||||
fi
|
fi
|
||||||
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-windmc%{_exeext}; then
|
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-windmc%{_exeext}; then
|
||||||
rm -f ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windmc*
|
%{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windmc*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -9,3 +9,18 @@
|
|||||||
%ifn %{defined release}
|
%ifn %{defined release}
|
||||||
%error No 'release' defined
|
%error No 'release' defined
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# Default to C++ on.
|
||||||
|
#
|
||||||
|
%ifn %{defined enable_cxx}
|
||||||
|
%define enable_cxx 1
|
||||||
|
%endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# Hack to get around the ARM EABBI mess.
|
||||||
|
#
|
||||||
|
%ifn %{defined enable_obsolete}
|
||||||
|
%define enable_obsolete 0
|
||||||
|
%endif
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ cd dtc-v%{dtc_version}
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export PATH="%{_bindir}:${PATH}"
|
|
||||||
cd dtc-v%{dtc_version}
|
cd dtc-v%{dtc_version}
|
||||||
|
|
||||||
%{__make} PREFIX=%{_prefix}
|
%{__make} PREFIX=%{_prefix}
|
||||||
@ -45,7 +44,6 @@ cd ..
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%install
|
%install
|
||||||
export PATH="%{_bindir}:${PATH}"
|
|
||||||
rm -rf $SB_BUILD_ROOT
|
rm -rf $SB_BUILD_ROOT
|
||||||
|
|
||||||
cd dtc-v%{dtc_version}
|
cd dtc-v%{dtc_version}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# DTC (Device Tree Compiler) 1.3.0
|
# DTC (Device Tree Compiler) 1.2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
%if %{release} == %{nil}
|
%if %{release} == %{nil}
|
||||||
|
@ -30,12 +30,13 @@ cd expat-%{expat_version}
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export PATH="%{_bindir}:${PATH}"
|
|
||||||
cd expat-%{expat_version}
|
cd expat-%{expat_version}
|
||||||
|
|
||||||
%if "%{_build}" != "%{_host}"
|
if test "%{_build}" != "%{_host}" ; then
|
||||||
CFLAGS_FOR_BUILD="-g -O2 -Wall" \
|
CFLAGS_FOR_BUILD="-g -O2 -Wall"
|
||||||
%endif
|
fi
|
||||||
|
export CFLAGS_FOR_BUILD
|
||||||
|
|
||||||
CFLAGS="$SB_OPT_FLAGS" \
|
CFLAGS="$SB_OPT_FLAGS" \
|
||||||
./configure \
|
./configure \
|
||||||
--build=%{_build} --host=%{_host} \
|
--build=%{_build} --host=%{_host} \
|
||||||
@ -47,10 +48,11 @@ cd ..
|
|||||||
|
|
||||||
%{__make} %{?_smp_mflags} all
|
%{__make} %{?_smp_mflags} all
|
||||||
|
|
||||||
|
unset CFLAGS_FOR_BUILD
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%install
|
%install
|
||||||
export PATH="%{_bindir}:${PATH}"
|
|
||||||
rm -rf $SB_BUILD_ROOT
|
rm -rf $SB_BUILD_ROOT
|
||||||
|
|
||||||
cd expat-%{expat_version}
|
cd expat-%{expat_version}
|
||||||
|
@ -5,27 +5,6 @@
|
|||||||
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Default to C++ on.
|
|
||||||
#
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%include %{_configdir}/checks.cfg
|
|
||||||
|
|
||||||
%ifn %{defined gcc_version_message}
|
|
||||||
%error No GCC Version message defined.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
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}.
|
|
||||||
GCC uses MPFR v%{mpfr_version}, MPC v%{mpc_version}, and GMP v%{gmp_version}.
|
|
||||||
Version: %{gcc_version}
|
|
||||||
Release: %{release}
|
|
||||||
URL: http://gcc.gnu.org/
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Source
|
# Source
|
||||||
#
|
#
|
||||||
@ -51,150 +30,6 @@ Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
|
|||||||
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
|
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
|
||||||
|
|
||||||
#
|
#
|
||||||
# The GCC library directory
|
# GCC Common build script.
|
||||||
#
|
#
|
||||||
%global _gcclibdir %{_prefix}/lib
|
%include %{_configdir}/gcc-common-1.cfg
|
||||||
|
|
||||||
#
|
|
||||||
# Prepare the source code.
|
|
||||||
#
|
|
||||||
%prep
|
|
||||||
# gcc and optional the g++ core if separate packages
|
|
||||||
%setup -q -c -n %{name}-%{version}
|
|
||||||
%{?source1:%setup -q -D -T -n %{name}-%{version} -a1}
|
|
||||||
cd gcc-%{gcc_version}
|
|
||||||
%{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
|
|
||||||
%{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
|
|
||||||
%{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
|
|
||||||
%{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
|
|
||||||
%{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
|
|
||||||
%{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
|
|
||||||
%{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
|
|
||||||
%{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
|
|
||||||
%{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
|
|
||||||
%{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# newlib
|
|
||||||
%setup -q -D -T -n %{name}-%{version} -a10
|
|
||||||
cd newlib-%{newlib_version}
|
|
||||||
%{?patch10:%patch10 %{?patch10_opts:%{patch10_opts}}%{!?patch10_opts:-p1}}
|
|
||||||
%{?patch11:%patch11 %{?patch11_opts:%{patch11_opts}}%{!?patch11_opts:-p1}}
|
|
||||||
%{?patch12:%patch12 %{?patch12_opts:%{patch12_opts}}%{!?patch12_opts:-p1}}
|
|
||||||
%{?patch13:%patch13 %{?patch13_opts:%{patch13_opts}}%{!?patch13_opts:-p1}}
|
|
||||||
%{?patch14:%patch14 %{?patch14_opts:%{patch14_opts}}%{!?patch14_opts:-p1}}
|
|
||||||
%{?patch15:%patch15 %{?patch15_opts:%{patch15_opts}}%{!?patch15_opts:-p1}}
|
|
||||||
%{?patch16:%patch16 %{?patch16_opts:%{patch16_opts}}%{!?patch16_opts:-p1}}
|
|
||||||
%{?patch17:%patch17 %{?patch17_opts:%{patch17_opts}}%{!?patch17_opts:-p1}}
|
|
||||||
%{?patch18:%patch18 %{?patch18_opts:%{patch18_opts}}%{!?patch18_opts:-p1}}
|
|
||||||
%{?patch19:%patch19 %{?patch19_opts:%{patch19_opts}}%{!?patch19_opts:-p1}}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# Link newlib into the gcc source tree
|
|
||||||
ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_version}
|
|
||||||
|
|
||||||
# MPFR
|
|
||||||
%setup -q -D -T -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 -D -T -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 -D -T -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 ${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-newlib-io-c99-formats \
|
|
||||||
%{?with_iconv:--enable-newlib-iconv} \
|
|
||||||
%if %{enable_obsolete}
|
|
||||||
--enable-obsolete \
|
|
||||||
%endif
|
|
||||||
--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 $SB_BUILD_ROOT
|
|
||||||
|
|
||||||
cd build
|
|
||||||
%{__make} DESTDIR=$SB_BUILD_ROOT 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*
|
|
||||||
|
@ -1,30 +1,10 @@
|
|||||||
#
|
#
|
||||||
# GCC 4.6 Version 1.
|
# GCC 4.4.x Version 1.
|
||||||
#
|
#
|
||||||
# This configuration file configure's, make's and install's gcc. It uses
|
# This configuration file configure's, make's and install's gcc. It uses
|
||||||
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Default to C++ on.
|
|
||||||
#
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%include %{_configdir}/checks.cfg
|
|
||||||
|
|
||||||
%ifn %{defined gcc_version_message}
|
|
||||||
%error No GCC Version message defined.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
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
|
# Source
|
||||||
#
|
#
|
||||||
@ -52,133 +32,6 @@ Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
|
|||||||
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
|
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
|
||||||
|
|
||||||
#
|
#
|
||||||
# The GCC library directory
|
# GCC Common build script.
|
||||||
#
|
#
|
||||||
%global _gcclibdir %{_prefix}/lib
|
%include %{_configdir}/gcc-common-1.cfg
|
||||||
|
|
||||||
#
|
|
||||||
# Prepare the source code.
|
|
||||||
#
|
|
||||||
%prep
|
|
||||||
# gcc core
|
|
||||||
%setup -q -c -n %{name}-%{version}
|
|
||||||
cd gcc-%{gcc_version}
|
|
||||||
%{?patch0:%patch0 -p1}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# g++
|
|
||||||
%{?source1:%setup -q -D -T -n %{name}-%{version} -a1}
|
|
||||||
cd gcc-%{gcc_version}
|
|
||||||
%{?patch1:%patch1 -p1}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# newlib
|
|
||||||
%setup -q -D -T -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 -D -T -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 -D -T -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 -D -T -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 ${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 \
|
|
||||||
--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 $SB_BUILD_ROOT
|
|
||||||
|
|
||||||
cd build
|
|
||||||
%{__make} DESTDIR=$SB_BUILD_ROOT 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*
|
|
||||||
|
@ -5,27 +5,6 @@
|
|||||||
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Default to C++ on.
|
|
||||||
#
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%include %{_configdir}/checks.cfg
|
|
||||||
|
|
||||||
%ifn %{defined gcc_version_message}
|
|
||||||
%error No GCC Version message defined.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
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}.
|
|
||||||
GCC uses MPFR v%{mpfr_version}, MPC v%{mpc_version}, and GMP v%{gmp_version}.
|
|
||||||
Version: %{gcc_version}
|
|
||||||
Release: %{release}
|
|
||||||
URL: http://gcc.gnu.org/
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Source
|
# Source
|
||||||
#
|
#
|
||||||
@ -49,150 +28,6 @@ Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
|
|||||||
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
|
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
|
||||||
|
|
||||||
#
|
#
|
||||||
# The GCC library directory
|
# GCC Common build script.
|
||||||
#
|
#
|
||||||
%global _gcclibdir %{_prefix}/lib
|
%include %{_configdir}/gcc-common-1.cfg
|
||||||
|
|
||||||
#
|
|
||||||
# Prepare the source code.
|
|
||||||
#
|
|
||||||
%prep
|
|
||||||
# gcc and optional the g++ core if separate packages
|
|
||||||
%setup -q -c -n %{name}-%{version}
|
|
||||||
%{?source1:%setup -q -D -T -n %{name}-%{version} -a1}
|
|
||||||
cd gcc-%{gcc_version}
|
|
||||||
%{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
|
|
||||||
%{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
|
|
||||||
%{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
|
|
||||||
%{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
|
|
||||||
%{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
|
|
||||||
%{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
|
|
||||||
%{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
|
|
||||||
%{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
|
|
||||||
%{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
|
|
||||||
%{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# newlib
|
|
||||||
%setup -q -D -T -n %{name}-%{version} -a10
|
|
||||||
cd newlib-%{newlib_version}
|
|
||||||
%{?patch10:%patch10 %{?patch10_opts:%{patch10_opts}}%{!?patch10_opts:-p1}}
|
|
||||||
%{?patch11:%patch11 %{?patch11_opts:%{patch11_opts}}%{!?patch11_opts:-p1}}
|
|
||||||
%{?patch12:%patch12 %{?patch12_opts:%{patch12_opts}}%{!?patch12_opts:-p1}}
|
|
||||||
%{?patch13:%patch13 %{?patch13_opts:%{patch13_opts}}%{!?patch13_opts:-p1}}
|
|
||||||
%{?patch14:%patch14 %{?patch14_opts:%{patch14_opts}}%{!?patch14_opts:-p1}}
|
|
||||||
%{?patch15:%patch15 %{?patch15_opts:%{patch15_opts}}%{!?patch15_opts:-p1}}
|
|
||||||
%{?patch16:%patch16 %{?patch16_opts:%{patch16_opts}}%{!?patch16_opts:-p1}}
|
|
||||||
%{?patch17:%patch17 %{?patch17_opts:%{patch17_opts}}%{!?patch17_opts:-p1}}
|
|
||||||
%{?patch18:%patch18 %{?patch18_opts:%{patch18_opts}}%{!?patch18_opts:-p1}}
|
|
||||||
%{?patch19:%patch19 %{?patch19_opts:%{patch19_opts}}%{!?patch19_opts:-p1}}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# Link newlib into the gcc source tree
|
|
||||||
ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_version}
|
|
||||||
|
|
||||||
# MPFR
|
|
||||||
%setup -q -D -T -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 -D -T -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 -D -T -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 ${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-newlib-io-c99-formats \
|
|
||||||
%{?with_iconv:--enable-newlib-iconv} \
|
|
||||||
%if %{enable_obsolete}
|
|
||||||
--enable-obsolete \
|
|
||||||
%endif
|
|
||||||
--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 $SB_BUILD_ROOT
|
|
||||||
|
|
||||||
cd build
|
|
||||||
%{__make} DESTDIR=$SB_BUILD_ROOT 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*
|
|
||||||
|
@ -5,26 +5,6 @@
|
|||||||
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Default to C++ on.
|
|
||||||
#
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%include %{_configdir}/checks.cfg
|
|
||||||
|
|
||||||
%ifn %{defined gcc_version_message}
|
|
||||||
%error No GCC Version message defined.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
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
|
# Source
|
||||||
#
|
#
|
||||||
@ -52,133 +32,6 @@ Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
|
|||||||
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
|
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
|
||||||
|
|
||||||
#
|
#
|
||||||
# The GCC library directory
|
# GCC Common build script.
|
||||||
#
|
#
|
||||||
%global _gcclibdir %{_prefix}/lib
|
%include %{_configdir}/gcc-common-1.cfg
|
||||||
|
|
||||||
#
|
|
||||||
# Prepare the source code.
|
|
||||||
#
|
|
||||||
%prep
|
|
||||||
# gcc core
|
|
||||||
%setup -q -c -n %{name}-%{version} -a0
|
|
||||||
cd gcc-%{gcc_version}
|
|
||||||
%{?patch0:%patch0 -p1}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# g++
|
|
||||||
%{?source1:%setup -q -D -n %{name}-%{version} -a1}
|
|
||||||
cd gcc-%{gcc_version}
|
|
||||||
%{?patch1:%patch1 -p1}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# newlib
|
|
||||||
%setup -q -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 -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 -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 -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 ${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 \
|
|
||||||
--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 $SB_BUILD_ROOT
|
|
||||||
|
|
||||||
cd build
|
|
||||||
%{__make} DESTDIR=$SB_BUILD_ROOT 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*
|
|
||||||
|
@ -5,27 +5,6 @@
|
|||||||
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Default to C++ on.
|
|
||||||
#
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%include %{_configdir}/checks.cfg
|
|
||||||
|
|
||||||
%ifn %{defined gcc_version_message}
|
|
||||||
%error No GCC Version message defined.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
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}.
|
|
||||||
GCC uses MPFR v%{mpfr_version}, MPC v%{mpc_version}, and GMP v%{gmp_version}.
|
|
||||||
Version: %{gcc_version}
|
|
||||||
Release: %{release}
|
|
||||||
URL: http://gcc.gnu.org/
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Source
|
# Source
|
||||||
#
|
#
|
||||||
@ -51,150 +30,6 @@ Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
|
|||||||
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
|
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
|
||||||
|
|
||||||
#
|
#
|
||||||
# The GCC library directory
|
# GCC Common build script.
|
||||||
#
|
#
|
||||||
%global _gcclibdir %{_prefix}/lib
|
%include %{_configdir}/gcc-common-1.cfg
|
||||||
|
|
||||||
#
|
|
||||||
# Prepare the source code.
|
|
||||||
#
|
|
||||||
%prep
|
|
||||||
# gcc and optional the g++ core if separate packages
|
|
||||||
%setup -q -c -n %{name}-%{version}
|
|
||||||
%{?source1:%setup -q -D -T -n %{name}-%{version} -a1}
|
|
||||||
cd gcc-%{gcc_version}
|
|
||||||
%{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
|
|
||||||
%{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
|
|
||||||
%{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
|
|
||||||
%{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
|
|
||||||
%{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
|
|
||||||
%{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
|
|
||||||
%{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
|
|
||||||
%{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
|
|
||||||
%{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
|
|
||||||
%{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# newlib
|
|
||||||
%setup -q -D -T -n %{name}-%{version} -a10
|
|
||||||
cd newlib-%{newlib_version}
|
|
||||||
%{?patch10:%patch10 %{?patch10_opts:%{patch10_opts}}%{!?patch10_opts:-p1}}
|
|
||||||
%{?patch11:%patch11 %{?patch11_opts:%{patch11_opts}}%{!?patch11_opts:-p1}}
|
|
||||||
%{?patch12:%patch12 %{?patch12_opts:%{patch12_opts}}%{!?patch12_opts:-p1}}
|
|
||||||
%{?patch13:%patch13 %{?patch13_opts:%{patch13_opts}}%{!?patch13_opts:-p1}}
|
|
||||||
%{?patch14:%patch14 %{?patch14_opts:%{patch14_opts}}%{!?patch14_opts:-p1}}
|
|
||||||
%{?patch15:%patch15 %{?patch15_opts:%{patch15_opts}}%{!?patch15_opts:-p1}}
|
|
||||||
%{?patch16:%patch16 %{?patch16_opts:%{patch16_opts}}%{!?patch16_opts:-p1}}
|
|
||||||
%{?patch17:%patch17 %{?patch17_opts:%{patch17_opts}}%{!?patch17_opts:-p1}}
|
|
||||||
%{?patch18:%patch18 %{?patch18_opts:%{patch18_opts}}%{!?patch18_opts:-p1}}
|
|
||||||
%{?patch19:%patch19 %{?patch19_opts:%{patch19_opts}}%{!?patch19_opts:-p1}}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# Link newlib into the gcc source tree
|
|
||||||
ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_version}
|
|
||||||
|
|
||||||
# MPFR
|
|
||||||
%setup -q -D -T -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 -D -T -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 -D -T -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 ${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-newlib-io-c99-formats \
|
|
||||||
%{?with_iconv:--enable-newlib-iconv} \
|
|
||||||
%if %{enable_obsolete}
|
|
||||||
--enable-obsolete \
|
|
||||||
%endif
|
|
||||||
--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 $SB_BUILD_ROOT
|
|
||||||
|
|
||||||
cd build
|
|
||||||
%{__make} DESTDIR=$SB_BUILD_ROOT 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*
|
|
||||||
|
@ -1,30 +1,10 @@
|
|||||||
#
|
#
|
||||||
# GCC 4.7 Version 1.
|
# GCC 4.8 Version 1.
|
||||||
#
|
#
|
||||||
# This configuration file configure's, make's and install's gcc. It uses
|
# This configuration file configure's, make's and install's gcc. It uses
|
||||||
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Default to C++ on.
|
|
||||||
#
|
|
||||||
%ifn %{defined enable_cxx}
|
|
||||||
%define enable_cxx 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%include %{_configdir}/checks.cfg
|
|
||||||
|
|
||||||
%ifn %{defined gcc_version_message}
|
|
||||||
%error No GCC Version message defined.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
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
|
# Source
|
||||||
#
|
#
|
||||||
@ -58,153 +38,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# The GCC library directory
|
# GCC Common build script.
|
||||||
#
|
#
|
||||||
%global _gcclibdir %{_prefix}/lib
|
%include %{_configdir}/gcc-common.cfg
|
||||||
|
|
||||||
#
|
|
||||||
# Prepare the source code.
|
|
||||||
#
|
|
||||||
%prep
|
|
||||||
# gcc and optional the g++ core if separate packages
|
|
||||||
%setup -q -c -n %{name}-%{version}
|
|
||||||
%{?source1:%setup -q -D -T -n %{name}-%{version} -a1}
|
|
||||||
cd gcc-%{gcc_version}
|
|
||||||
%{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
|
|
||||||
%{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
|
|
||||||
%{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
|
|
||||||
%{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
|
|
||||||
%{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
|
|
||||||
%{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
|
|
||||||
%{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
|
|
||||||
%{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
|
|
||||||
%{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
|
|
||||||
%{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# newlib
|
|
||||||
%setup -q -D -T -n %{name}-%{version} -a10
|
|
||||||
cd newlib-%{newlib_version}
|
|
||||||
%{?patch10:%patch10 %{?patch10_opts:%{patch10_opts}}%{!?patch10_opts:-p1}}
|
|
||||||
%{?patch11:%patch11 %{?patch11_opts:%{patch11_opts}}%{!?patch11_opts:-p1}}
|
|
||||||
%{?patch12:%patch12 %{?patch12_opts:%{patch12_opts}}%{!?patch12_opts:-p1}}
|
|
||||||
%{?patch13:%patch13 %{?patch13_opts:%{patch13_opts}}%{!?patch13_opts:-p1}}
|
|
||||||
%{?patch14:%patch14 %{?patch14_opts:%{patch14_opts}}%{!?patch14_opts:-p1}}
|
|
||||||
%{?patch15:%patch15 %{?patch15_opts:%{patch15_opts}}%{!?patch15_opts:-p1}}
|
|
||||||
%{?patch16:%patch16 %{?patch16_opts:%{patch16_opts}}%{!?patch16_opts:-p1}}
|
|
||||||
%{?patch17:%patch17 %{?patch17_opts:%{patch17_opts}}%{!?patch17_opts:-p1}}
|
|
||||||
%{?patch18:%patch18 %{?patch18_opts:%{patch18_opts}}%{!?patch18_opts:-p1}}
|
|
||||||
%{?patch19:%patch19 %{?patch19_opts:%{patch19_opts}}%{!?patch19_opts:-p1}}
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# Link newlib into the gcc source tree
|
|
||||||
ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_version}
|
|
||||||
|
|
||||||
# MPFR
|
|
||||||
%setup -q -D -T -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 -D -T -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 -D -T -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" \
|
|
||||||
CXXFLAGS_FOR_BUILD="-g -O2 -Wall" \
|
|
||||||
CC="%{_host}-gcc ${SB_OPT_FLAGS}" \
|
|
||||||
CXX="%{_host}-g++ ${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 ,,') \
|
|
||||||
CXX=$(echo "%{__cxx} ${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-newlib-io-c99-formats \
|
|
||||||
%{?with_iconv:--enable-newlib-iconv} \
|
|
||||||
%if %{enable_obsolete}
|
|
||||||
--enable-obsolete \
|
|
||||||
%endif
|
|
||||||
--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 $SB_BUILD_ROOT
|
|
||||||
|
|
||||||
cd build
|
|
||||||
%{__make} DESTDIR=$SB_BUILD_ROOT 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*
|
|
||||||
|
166
source-builder/config/gcc-common-1.cfg
Normal file
166
source-builder/config/gcc-common-1.cfg
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
#
|
||||||
|
# GCC Common Support.
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Supports Candian Cross (Cxc).
|
||||||
|
#
|
||||||
|
%define allow_cxc
|
||||||
|
|
||||||
|
#
|
||||||
|
# The GCC library directory
|
||||||
|
#
|
||||||
|
%global _gcclibdir %{_prefix}/lib
|
||||||
|
|
||||||
|
#
|
||||||
|
# Prepare the source code.
|
||||||
|
#
|
||||||
|
%prep
|
||||||
|
# gcc core
|
||||||
|
%setup -q -c -n %{name}-%{version}
|
||||||
|
cd gcc-%{gcc_version}
|
||||||
|
%{?patch0:%patch0 -p1}
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# g++
|
||||||
|
%{?source1:%setup -q -D -T -n %{name}-%{version} -a1}
|
||||||
|
cd gcc-%{gcc_version}
|
||||||
|
%{?patch1:%patch1 -p1}
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# newlib
|
||||||
|
%setup -q -D -T -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 -D -T -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 -D -T -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 -D -T -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
|
||||||
|
if test "%{_build}" != "%{_host}" ; then
|
||||||
|
build_dir="build-cxc"
|
||||||
|
else
|
||||||
|
build_dir="build"
|
||||||
|
fi
|
||||||
|
mkdir -p ${build_dir}
|
||||||
|
cd ${build_dir}
|
||||||
|
languages="c"
|
||||||
|
%if %{enable_cxx}
|
||||||
|
languages="$languages,c++"
|
||||||
|
%endif
|
||||||
|
if test "%{_build}" != "%{_host}" ; then
|
||||||
|
CFLAGS_FOR_BUILD="-g -O2 -Wall"
|
||||||
|
CC="%{_host}-gcc ${SB_OPT_FLAGS}"
|
||||||
|
CXXFLAGS_FOR_BUILD="-g -O2 -Wall"
|
||||||
|
CXX="%{_host}-g++ ${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 ,,')
|
||||||
|
CXX=$(echo "%{__cxx} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,')
|
||||||
|
fi
|
||||||
|
export CFLAGS CFLAGS_FOR_BUILD CC CXXFLAGS_FOR_BUILD CXX
|
||||||
|
../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 \
|
||||||
|
--enable-newlib-io-c99-formats \
|
||||||
|
%{?with_iconv:--enable-newlib-iconv} \
|
||||||
|
%{?with_threads:--enable-threads}%{!?with_threads:--disable-threads} \
|
||||||
|
%{?with_plugin:--enable-plugin}%{!?with_plugin:--disable-plugin} \
|
||||||
|
%{?enable_obsolete:--enable-obsolete} \
|
||||||
|
--enable-languages="$languages"
|
||||||
|
|
||||||
|
unset CFLAGS CFLAGS_FOR_BUILD CC CXXFLAGS_FOR_BUILD CXX
|
||||||
|
|
||||||
|
if test "%_host" != "%_build" ; then
|
||||||
|
# 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
|
||||||
|
fi
|
||||||
|
|
||||||
|
%{__make} %{?_smp_mflags} all
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
%install
|
||||||
|
%{__rmdir} $SB_BUILD_ROOT
|
||||||
|
|
||||||
|
cd ${build_dir}
|
||||||
|
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# libiberty doesn't honor --libdir, but always installs to a
|
||||||
|
# magically guessed _libdir
|
||||||
|
%{__rmfile} ${SB_BUILD_ROOT}%{_libdir}/libiberty.a
|
||||||
|
|
||||||
|
# We use the version from binutils
|
||||||
|
%{__rmfile} $SB_BUILD_ROOT%{_bindir}/%{_target}-c++filt%{_exeext}
|
||||||
|
|
||||||
|
# We don't ship info/dir
|
||||||
|
%{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir
|
||||||
|
|
||||||
|
# Don't want libffi's man-pages
|
||||||
|
%{__rmfile} $SB_BUILD_ROOT%{_mandir}/man3/*ffi*
|
@ -21,6 +21,14 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|||||||
VersionControl0 git clone git://sourceware.org/git/gdb.git
|
VersionControl0 git clone git://sourceware.org/git/gdb.git
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# Disable Python on Cxc builds for now.
|
||||||
|
#
|
||||||
|
%if "%{_build}" != "%{_host}"
|
||||||
|
%define without_python
|
||||||
|
%endif
|
||||||
|
|
||||||
|
#
|
||||||
#
|
#
|
||||||
# Prepare the source code.
|
# Prepare the source code.
|
||||||
#
|
#
|
||||||
@ -40,12 +48,16 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export PATH="%{_bindir}:${PATH}"
|
if test "%{_build}" != "%{_host}" ; then
|
||||||
mkdir -p build
|
build_dir="build-cxc"
|
||||||
cd build
|
else
|
||||||
%if "%{_build}" != "%{_host}"
|
build_dir="build"
|
||||||
CFLAGS_FOR_BUILD="-g -O2 -Wall" \
|
fi
|
||||||
%endif
|
mkdir -p ${build_dir}
|
||||||
|
cd ${build_dir}
|
||||||
|
if test "%{_build}" != "%{_host}" ; then
|
||||||
|
CFLAGS_FOR_BUILD="-g -O2 -Wall"
|
||||||
|
fi
|
||||||
CFLAGS="$SB_OPT_FLAGS" \
|
CFLAGS="$SB_OPT_FLAGS" \
|
||||||
../gdb-%{gdb_version}/configure \
|
../gdb-%{gdb_version}/configure \
|
||||||
--build=%{_build} --host=%{_host} \
|
--build=%{_build} --host=%{_host} \
|
||||||
@ -66,16 +78,15 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%install
|
%install
|
||||||
export PATH="%{_bindir}:${PATH}"
|
%{__rmdir} $SB_BUILD_ROOT
|
||||||
rm -rf $SB_BUILD_ROOT
|
|
||||||
|
|
||||||
cd build
|
cd ${build_dir}
|
||||||
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
||||||
|
|
||||||
# Dropped in FSF-binutils-2.9.5, but Cygwin still ships it.
|
# Dropped in FSF-binutils-2.9.5, but Cygwin still ships it.
|
||||||
rm -rf $SB_BUILD_ROOT%{_infodir}/configure.info*
|
%{__rmdir} $SB_BUILD_ROOT%{_infodir}/configure.info*
|
||||||
|
|
||||||
rm -f $SB_BUILD_ROOT%{_infodir}/dir
|
%{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir
|
||||||
touch $SB_BUILD_ROOT%{_infodir}/dir
|
touch $SB_BUILD_ROOT%{_infodir}/dir
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -279,6 +279,13 @@ class build:
|
|||||||
patch['script'] += ' | %{__patch} ' + ' '.join(args[1:])
|
patch['script'] += ' | %{__patch} ' + ' '.join(args[1:])
|
||||||
self.script.append(self.config.expand(patch['script']))
|
self.script.append(self.config.expand(patch['script']))
|
||||||
|
|
||||||
|
def canadian_cross(self):
|
||||||
|
_host = self.config.expand('%{_host}')
|
||||||
|
_build = self.config.expand('%{_build}')
|
||||||
|
_target = self.config.expand('%{_target}')
|
||||||
|
return self.config.defined('%{allow_cxc}') and \
|
||||||
|
_host != _build and _host != _target
|
||||||
|
|
||||||
def setup(self, package, args):
|
def setup(self, package, args):
|
||||||
self._output('prep: %s: %s' % (package.name(), ' '.join(args)))
|
self._output('prep: %s: %s' % (package.name(), ' '.join(args)))
|
||||||
opts, args = getopt.getopt(args[1:], 'qDcTn:b:a:')
|
opts, args = getopt.getopt(args[1:], 'qDcTn:b:a:')
|
||||||
@ -367,6 +374,11 @@ class build:
|
|||||||
self.script.append(' '.join(args))
|
self.script.append(' '.join(args))
|
||||||
|
|
||||||
def build(self, package):
|
def build(self, package):
|
||||||
|
self.script.append('echo "==> clean %{buildroot}: ${SB_BUILD_ROOT}"')
|
||||||
|
self.script.append('%s ${SB_BUILD_ROOT}' %
|
||||||
|
(self.config.expand('%{__rmdir}')))
|
||||||
|
self.script.append('%s ${SB_BUILD_ROOT}' %
|
||||||
|
(self.config.expand('%{__mkdir_p}')))
|
||||||
self.script.append('echo "==> %build:"')
|
self.script.append('echo "==> %build:"')
|
||||||
_build = package.build()
|
_build = package.build()
|
||||||
for l in _build:
|
for l in _build:
|
||||||
@ -389,7 +401,7 @@ class build:
|
|||||||
inpath = path.join('%{buildroot}', prefixbase)
|
inpath = path.join('%{buildroot}', prefixbase)
|
||||||
tardir = path.abspath(self.config.expand('%{_tardir}'))
|
tardir = path.abspath(self.config.expand('%{_tardir}'))
|
||||||
self.script.append(self.config.expand('if test -d %s; then' % (inpath)))
|
self.script.append(self.config.expand('if test -d %s; then' % (inpath)))
|
||||||
self.script.append(' mkdir -p %s' % tardir)
|
self.script.append(self.config.expand(' %%{__mkdir_p} %s' % tardir))
|
||||||
self.script.append(self.config.expand(' cd ' + inpath))
|
self.script.append(self.config.expand(' cd ' + inpath))
|
||||||
tar = path.join(tardir, package.long_name() + '.tar.bz2')
|
tar = path.join(tardir, package.long_name() + '.tar.bz2')
|
||||||
cmd = self.config.expand(' %{__tar} -cf - . ' + '| %{__bzip2} > ' + tar)
|
cmd = self.config.expand(' %{__tar} -cf - . ' + '| %{__bzip2} > ' + tar)
|
||||||
@ -405,10 +417,23 @@ class build:
|
|||||||
args = l.split()
|
args = l.split()
|
||||||
self.script.append(' '.join(args))
|
self.script.append(' '.join(args))
|
||||||
|
|
||||||
|
def build_package(self, package):
|
||||||
|
if self.canadian_cross():
|
||||||
|
self.script.append('echo "==> Candian-cross build/target:"')
|
||||||
|
self.script.append('SB_CXC="yes"')
|
||||||
|
else:
|
||||||
|
self.script.append('SB_CXC="no"')
|
||||||
|
self.build(package)
|
||||||
|
self.install(package)
|
||||||
|
self.files(package)
|
||||||
|
if not self.opts.no_clean():
|
||||||
|
self.clean(package)
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
if not self.opts.no_clean():
|
if not self.opts.no_clean():
|
||||||
buildroot = self.config.abspath('buildroot')
|
buildroot = self.config.abspath('buildroot')
|
||||||
builddir = self.config.abspath('_builddir')
|
builddir = self.config.abspath('_builddir')
|
||||||
|
buildcxcdir = self.config.abspath('_buildcxcdir')
|
||||||
tmproot = self.config.abspath('_tmproot')
|
tmproot = self.config.abspath('_tmproot')
|
||||||
if self.opts.trace():
|
if self.opts.trace():
|
||||||
_notice(self.opts, 'cleanup: %s' % (buildroot))
|
_notice(self.opts, 'cleanup: %s' % (buildroot))
|
||||||
@ -416,6 +441,10 @@ class build:
|
|||||||
if self.opts.trace():
|
if self.opts.trace():
|
||||||
_notice(self.opts, 'cleanup: %s' % (builddir))
|
_notice(self.opts, 'cleanup: %s' % (builddir))
|
||||||
self.rmdir(builddir)
|
self.rmdir(builddir)
|
||||||
|
if self.canadian_cross():
|
||||||
|
if self.opts.trace():
|
||||||
|
_notice(self.opts, 'cleanup: %s' % (buildcxcdir))
|
||||||
|
self.rmdir(buildcxcdir)
|
||||||
if self.opts.trace():
|
if self.opts.trace():
|
||||||
_notice(self.opts, 'cleanup: %s' % (tmproot))
|
_notice(self.opts, 'cleanup: %s' % (tmproot))
|
||||||
self.rmdir(tmproot)
|
self.rmdir(tmproot)
|
||||||
@ -427,22 +456,24 @@ class build:
|
|||||||
def make(self):
|
def make(self):
|
||||||
package = self.main_package()
|
package = self.main_package()
|
||||||
name = package.name()
|
name = package.name()
|
||||||
|
if self.canadian_cross():
|
||||||
|
_notice(self.opts, 'package: (Cxc) %s' % (name))
|
||||||
|
else:
|
||||||
_notice(self.opts, 'package: %s' % (name))
|
_notice(self.opts, 'package: %s' % (name))
|
||||||
self.script.reset()
|
self.script.reset()
|
||||||
self.script.append(self.config.expand('%{___build_template}'))
|
self.script.append(self.config.expand('%{___build_template}'))
|
||||||
self.script.append('echo "=> ' + name + ':"')
|
self.script.append('echo "=> ' + name + ':"')
|
||||||
self.prep(package)
|
self.prep(package)
|
||||||
self.build(package)
|
self.build_package(package)
|
||||||
self.install(package)
|
|
||||||
self.files(package)
|
|
||||||
if not self.opts.no_clean():
|
|
||||||
self.clean(package)
|
|
||||||
if not self.opts.dry_run():
|
if not self.opts.dry_run():
|
||||||
self.builddir()
|
self.builddir()
|
||||||
sn = path.join(self.config.expand('%{_builddir}'), 'doit')
|
sn = path.join(self.config.expand('%{_builddir}'), 'doit')
|
||||||
self._output('write script: ' + sn)
|
self._output('write script: ' + sn)
|
||||||
self.script.write(sn)
|
self.script.write(sn)
|
||||||
_notice(self.opts, 'building: ' + name)
|
if self.canadian_cross():
|
||||||
|
_notice(self.opts, 'building: (Cxc) %s' % (name))
|
||||||
|
else:
|
||||||
|
_notice(self.opts, 'building: %s' % (name))
|
||||||
self.run(sn)
|
self.run(sn)
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -490,7 +521,8 @@ def run(args):
|
|||||||
_notice(opts, 'RTEMS Source Builder, Package Builder v%s' % (version))
|
_notice(opts, 'RTEMS Source Builder, Package Builder v%s' % (version))
|
||||||
if not check.host_setup(opts, _defaults):
|
if not check.host_setup(opts, _defaults):
|
||||||
if not opts.force():
|
if not opts.force():
|
||||||
raise error.general('host build environment is not set up correctly (use --force to proceed)')
|
raise error.general('host build environment is not set up' +
|
||||||
|
' correctly (use --force to proceed)')
|
||||||
_notice(opts, 'warning: forcing build with known host setup problems')
|
_notice(opts, 'warning: forcing build with known host setup problems')
|
||||||
if opts.get_arg('--list-configs'):
|
if opts.get_arg('--list-configs'):
|
||||||
configs = get_configs(opts, _defaults)
|
configs = get_configs(opts, _defaults)
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
# other software modules.
|
# other software modules.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import copy
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
@ -54,9 +55,10 @@ def _check_bool(value):
|
|||||||
|
|
||||||
class package:
|
class package:
|
||||||
|
|
||||||
def __init__(self, name, arch):
|
def __init__(self, name, arch, config):
|
||||||
self._name = name
|
self._name = name
|
||||||
self._arch = arch
|
self._arch = arch
|
||||||
|
self.config = config
|
||||||
self.directives = {}
|
self.directives = {}
|
||||||
self.infos = {}
|
self.infos = {}
|
||||||
|
|
||||||
@ -91,12 +93,15 @@ class package:
|
|||||||
self.infos[info] = []
|
self.infos[info] = []
|
||||||
self.infos[info].append(data)
|
self.infos[info].append(data)
|
||||||
|
|
||||||
def get_info(self, info):
|
def get_info(self, info, expand = True):
|
||||||
if info in self.infos:
|
if info in self.infos:
|
||||||
|
if expand:
|
||||||
|
return self.config.expand(self.infos[info])
|
||||||
|
else:
|
||||||
return self.infos[info]
|
return self.infos[info]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def extract_info(self, label):
|
def extract_info(self, label, expand = True):
|
||||||
infos = {}
|
infos = {}
|
||||||
for i in self.infos:
|
for i in self.infos:
|
||||||
il = i.lower()
|
il = i.lower()
|
||||||
@ -105,18 +110,24 @@ class package:
|
|||||||
il = label + '0'
|
il = label + '0'
|
||||||
elif not il[len(label):].isdigit():
|
elif not il[len(label):].isdigit():
|
||||||
continue
|
continue
|
||||||
infos[il] = self.infos[i]
|
infos[il] = self.config.expand(self.infos[i])
|
||||||
return infos
|
return infos
|
||||||
|
|
||||||
def find_info(self, label):
|
def find_info(self, label, expand = True):
|
||||||
for i in self.infos:
|
for i in self.infos:
|
||||||
if i.lower() == label:
|
if i.lower() == label:
|
||||||
|
if expand:
|
||||||
|
return self.config.expand(self.infos[i])
|
||||||
|
else:
|
||||||
return self.infos[i]
|
return self.infos[i]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def find_directive(self, label):
|
def find_directive(self, label, expand = True):
|
||||||
for d in self.directives:
|
for d in self.directives:
|
||||||
if d.lower() == label:
|
if d.lower() == label:
|
||||||
|
if expand:
|
||||||
|
return self.config.expand(self.directives[d])
|
||||||
|
else:
|
||||||
return self.directives[d]
|
return self.directives[d]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -261,6 +272,8 @@ class file:
|
|||||||
'''Split the string (s) up by macros. Only split on the
|
'''Split the string (s) up by macros. Only split on the
|
||||||
outter level. Nested levels will need to split with futher calls.'''
|
outter level. Nested levels will need to split with futher calls.'''
|
||||||
trace_me = False
|
trace_me = False
|
||||||
|
if trace_me:
|
||||||
|
print '------------------------------------------------------'
|
||||||
macros = []
|
macros = []
|
||||||
nesting = []
|
nesting = []
|
||||||
has_braces = False
|
has_braces = False
|
||||||
@ -316,6 +329,8 @@ class file:
|
|||||||
c += 1
|
c += 1
|
||||||
if trace_me:
|
if trace_me:
|
||||||
print 'ms:', macros
|
print 'ms:', macros
|
||||||
|
if trace_me:
|
||||||
|
print '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
|
||||||
return macros
|
return macros
|
||||||
|
|
||||||
def _shell(self, line):
|
def _shell(self, line):
|
||||||
@ -331,8 +346,12 @@ class file:
|
|||||||
return line
|
return line
|
||||||
|
|
||||||
def _expand(self, s):
|
def _expand(self, s):
|
||||||
|
expand_count = 0
|
||||||
expanded = True
|
expanded = True
|
||||||
while expanded:
|
while expanded:
|
||||||
|
expand_count += 1
|
||||||
|
if expand_count > 500:
|
||||||
|
raise error.general('macro expand looping: %s' % (s))
|
||||||
expanded = False
|
expanded = False
|
||||||
ms = self._macro_split(s)
|
ms = self._macro_split(s)
|
||||||
for m in ms:
|
for m in ms:
|
||||||
@ -580,20 +599,20 @@ class file:
|
|||||||
isos = False
|
isos = False
|
||||||
if isvalid:
|
if isvalid:
|
||||||
os = self.define('_os')
|
os = self.define('_os')
|
||||||
if ls[0].find(os) >= 0 or ls[1].find(os) >= 0:
|
for l in ls:
|
||||||
|
if l in os:
|
||||||
isos = True
|
isos = True
|
||||||
else:
|
break
|
||||||
isos = False
|
|
||||||
return self._ifs(config, ls, '%ifos', isos, isvalid)
|
return self._ifs(config, ls, '%ifos', isos, isvalid)
|
||||||
|
|
||||||
def _ifarch(self, config, positive, ls, isvalid):
|
def _ifarch(self, config, positive, ls, isvalid):
|
||||||
isarch = False
|
isarch = False
|
||||||
if isvalid:
|
if isvalid:
|
||||||
arch = self.define('_arch')
|
arch = self.define('_arch')
|
||||||
if ls[0].find(arch) >= 0 or ls[1].find(arch) >= 0:
|
for l in ls:
|
||||||
|
if l in arch:
|
||||||
isarch = True
|
isarch = True
|
||||||
else:
|
break
|
||||||
isarch = False
|
|
||||||
if not positive:
|
if not positive:
|
||||||
isarch = not isarch
|
isarch = not isarch
|
||||||
return self._ifs(config, ls, '%ifarch', isarch, isvalid)
|
return self._ifs(config, ls, '%ifarch', isarch, isvalid)
|
||||||
@ -621,12 +640,14 @@ class file:
|
|||||||
continue
|
continue
|
||||||
if self.opts.trace():
|
if self.opts.trace():
|
||||||
print '%03d: %d %s' % (self.lc, isvalid, l)
|
print '%03d: %d %s' % (self.lc, isvalid, l)
|
||||||
|
lo = l
|
||||||
if isvalid:
|
if isvalid:
|
||||||
l = self._expand(l)
|
l = self._expand(l)
|
||||||
if len(l) == 0:
|
if len(l) == 0:
|
||||||
continue
|
continue
|
||||||
if l[0] == '%':
|
if l[0] == '%':
|
||||||
ls = self.wss.split(l, 2)
|
ls = self.wss.split(l, 2)
|
||||||
|
los = self.wss.split(lo, 2)
|
||||||
if ls[0] == '%package':
|
if ls[0] == '%package':
|
||||||
if isvalid:
|
if isvalid:
|
||||||
if ls[1] == '-n':
|
if ls[1] == '-n':
|
||||||
@ -668,11 +689,11 @@ class file:
|
|||||||
return ('data', d)
|
return ('data', d)
|
||||||
elif ls[0] == '%endif':
|
elif ls[0] == '%endif':
|
||||||
if roc:
|
if roc:
|
||||||
return ('control', '%endif')
|
return ('control', '%endif', '%endif')
|
||||||
self._warning("unexpected '" + ls[0] + "'")
|
self._warning("unexpected '" + ls[0] + "'")
|
||||||
elif ls[0] == '%else':
|
elif ls[0] == '%else':
|
||||||
if roc:
|
if roc:
|
||||||
return ('control', '%else')
|
return ('control', '%else', '%else')
|
||||||
self._warning("unexpected '" + ls[0] + "'")
|
self._warning("unexpected '" + ls[0] + "'")
|
||||||
elif ls[0].startswith('%defattr'):
|
elif ls[0].startswith('%defattr'):
|
||||||
return ('data', [l])
|
return ('data', [l])
|
||||||
@ -697,10 +718,10 @@ class file:
|
|||||||
if ls[0].strip() == d:
|
if ls[0].strip() == d:
|
||||||
return ('directive', ls[0].strip(), ls[1:])
|
return ('directive', ls[0].strip(), ls[1:])
|
||||||
self._warning("unknown directive: '" + ls[0] + "'")
|
self._warning("unknown directive: '" + ls[0] + "'")
|
||||||
return ('data', [l])
|
return ('data', [lo])
|
||||||
else:
|
else:
|
||||||
return ('data', [l])
|
return ('data', [lo])
|
||||||
return ('control', '%end')
|
return ('control', '%end', '%end')
|
||||||
|
|
||||||
def _set_package(self, _package):
|
def _set_package(self, _package):
|
||||||
if self.package == 'main' and \
|
if self.package == 'main' and \
|
||||||
@ -734,12 +755,13 @@ class file:
|
|||||||
self.in_error = False
|
self.in_error = False
|
||||||
self.lc = 0
|
self.lc = 0
|
||||||
self.name = name
|
self.name = name
|
||||||
self.defines = self.default_defines
|
self.defines = copy.deepcopy(self.default_defines)
|
||||||
self.conditionals = {}
|
self.conditionals = {}
|
||||||
self._packages = {}
|
self._packages = {}
|
||||||
self.package = 'main'
|
self.package = 'main'
|
||||||
self._packages[self.package] = package(self.package,
|
self._packages[self.package] = package(self.package,
|
||||||
self.define('%{_arch}'))
|
self.define('%{_arch}'),
|
||||||
|
self)
|
||||||
|
|
||||||
self.load_depth += 1
|
self.load_depth += 1
|
||||||
|
|
||||||
@ -832,13 +854,15 @@ class file:
|
|||||||
data = new_data
|
data = new_data
|
||||||
elif r[0] == 'data':
|
elif r[0] == 'data':
|
||||||
for l in r[1]:
|
for l in r[1]:
|
||||||
l = self._expand(l)
|
|
||||||
if l.startswith('%error'):
|
if l.startswith('%error'):
|
||||||
|
l = self._expand(l)
|
||||||
raise error.general('config error: %s' % (l[7:]))
|
raise error.general('config error: %s' % (l[7:]))
|
||||||
elif l.startswith('%warning'):
|
elif l.startswith('%warning'):
|
||||||
|
l = self._expand(l)
|
||||||
print >> sys.stderr, 'warning: %s' % (l[9:])
|
print >> sys.stderr, 'warning: %s' % (l[9:])
|
||||||
self._warning(l[9:])
|
self._warning(l[9:])
|
||||||
if not dir:
|
if not dir:
|
||||||
|
l = self._expand(l)
|
||||||
ls = self.tags.split(l, 1)
|
ls = self.tags.split(l, 1)
|
||||||
if self.opts.trace():
|
if self.opts.trace():
|
||||||
print '_tag: ', l, ls
|
print '_tag: ', l, ls
|
||||||
@ -873,6 +897,9 @@ class file:
|
|||||||
|
|
||||||
self.load_depth -= 1
|
self.load_depth -= 1
|
||||||
|
|
||||||
|
def defined(self, name):
|
||||||
|
return name.lower() in self.defines
|
||||||
|
|
||||||
def define(self, name):
|
def define(self, name):
|
||||||
if name.lower() in self.defines:
|
if name.lower() in self.defines:
|
||||||
d = self.defines[name.lower()]
|
d = self.defines[name.lower()]
|
||||||
@ -888,8 +915,18 @@ class file:
|
|||||||
self.defines[name.lower()] = value
|
self.defines[name.lower()] = value
|
||||||
|
|
||||||
def expand(self, line):
|
def expand(self, line):
|
||||||
|
if type(line) == list:
|
||||||
|
el = []
|
||||||
|
for l in line:
|
||||||
|
el += [self._expand(l)]
|
||||||
|
return el
|
||||||
return self._expand(line)
|
return self._expand(line)
|
||||||
|
|
||||||
|
def default(self, name):
|
||||||
|
if name.lower() in self.defines:
|
||||||
|
return self.defines[name.lower()]
|
||||||
|
raise error.general('macro "%s" not found' % (name))
|
||||||
|
|
||||||
def directive(self, _package, name):
|
def directive(self, _package, name):
|
||||||
if _package not in self._packages:
|
if _package not in self._packages:
|
||||||
raise error.general('package "' + _package + '" not found')
|
raise error.general('package "' + _package + '" not found')
|
||||||
|
@ -58,7 +58,6 @@ defaults = {
|
|||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
'_host_platform': ('none', 'none', '%{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}'),
|
'_host_platform': ('none', 'none', '%{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}'),
|
||||||
'_build': ('none', 'none', '%{_host}'),
|
|
||||||
'_arch': ('none', 'none', '%{_host_arch}'),
|
'_arch': ('none', 'none', '%{_host_arch}'),
|
||||||
'_sbdir': ('none', 'none', ''),
|
'_sbdir': ('none', 'none', ''),
|
||||||
'_topdir': ('dir', 'required', path.shell(os.getcwd())),
|
'_topdir': ('dir', 'required', path.shell(os.getcwd())),
|
||||||
@ -67,10 +66,13 @@ defaults = {
|
|||||||
'_sourcedir': ('dir', 'optional', '%{_topdir}/sources'),
|
'_sourcedir': ('dir', 'optional', '%{_topdir}/sources'),
|
||||||
'_patchdir': ('dir', 'optional', '%{_topdir}/patches:%{_sbdir}/patches'),
|
'_patchdir': ('dir', 'optional', '%{_topdir}/patches:%{_sbdir}/patches'),
|
||||||
'_builddir': ('dir', 'optional', '%{_topdir}/build/%{name}-%{version}-%{release}'),
|
'_builddir': ('dir', 'optional', '%{_topdir}/build/%{name}-%{version}-%{release}'),
|
||||||
|
'_buildcxcdir': ('dir', 'optional', '%{_topdir}/build/%{name}-%{version}-%{release}-cxc'),
|
||||||
'_docdir': ('dir', 'none', '%{_defaultdocdir}'),
|
'_docdir': ('dir', 'none', '%{_defaultdocdir}'),
|
||||||
'_tmppath': ('dir', 'none', '%{_topdir}/build/tmp'),
|
'_tmppath': ('dir', 'none', '%{_topdir}/build/tmp'),
|
||||||
'_tmproot': ('dir', 'none', '%{_tmppath}/source-build-%(%{__id_u} -n)/%{_bset}'),
|
'_tmproot': ('dir', 'none', '%{_tmppath}/source-build-%(%{__id_u} -n)/%{_bset}'),
|
||||||
'buildroot:': ('dir', 'none', '%{_tmppath}/%{name}-root-%(%{__id_u} -n)'),
|
'_tmpcxcroot': ('dir', 'none', '%{_tmppath}/source-build-%(%{__id_u} -n)-cxc/%{_bset}'),
|
||||||
|
'buildroot': ('dir', 'none', '%{_tmppath}/%{name}-root-%(%{__id_u} -n)'),
|
||||||
|
'buildcxcroot': ('dir', 'none', '%{_tmppath}/%{name}-root-%(%{__id_u} -n)-cxc'),
|
||||||
'_datadir': ('dir', 'none', '%{_prefix}/share'),
|
'_datadir': ('dir', 'none', '%{_prefix}/share'),
|
||||||
'_defaultdocdir': ('dir', 'none', '%{_prefix}/share/doc'),
|
'_defaultdocdir': ('dir', 'none', '%{_prefix}/share/doc'),
|
||||||
'_exeext': ('none', 'none', ''),
|
'_exeext': ('none', 'none', ''),
|
||||||
@ -144,11 +146,14 @@ defaults = {
|
|||||||
'__perl': ('exe', 'optional', 'perl'),
|
'__perl': ('exe', 'optional', 'perl'),
|
||||||
'__ranlib': ('exe', 'required', 'ranlib'),
|
'__ranlib': ('exe', 'required', 'ranlib'),
|
||||||
'__rm': ('exe', 'required', '/bin/rm'),
|
'__rm': ('exe', 'required', '/bin/rm'),
|
||||||
|
'__rmfile': ('exe', 'none', '%{__rm} -f'),
|
||||||
|
'__rmdir': ('exe', 'none', '%{__rm} -rf'),
|
||||||
'__sed': ('exe', 'required', '/usr/bin/sed'),
|
'__sed': ('exe', 'required', '/usr/bin/sed'),
|
||||||
'__setup_post': ('exe', 'none', '%{__chmod} -R a+rX,g-w,o-w .'),
|
'__setup_post': ('exe', 'none', '%{__chmod} -R a+rX,g-w,o-w .'),
|
||||||
'__sh': ('exe', 'required', '/bin/sh'),
|
'__sh': ('exe', 'required', '/bin/sh'),
|
||||||
'__tar': ('exe', 'required', '/usr/bin/tar'),
|
'__tar': ('exe', 'required', '/usr/bin/tar'),
|
||||||
'__tar_extract': ('exe', 'none', '%{__tar} -xvvf'),
|
'__tar_extract': ('exe', 'none', '%{__tar} -xvvf'),
|
||||||
|
'__touch': ('exe', 'required', '/usr/bin/touch'),
|
||||||
'__unzip': ('exe', 'required', '/usr/bin/unzip'),
|
'__unzip': ('exe', 'required', '/usr/bin/unzip'),
|
||||||
'__xz': ('exe', 'required', '/usr/bin/xz'),
|
'__xz': ('exe', 'required', '/usr/bin/xz'),
|
||||||
|
|
||||||
@ -160,9 +165,11 @@ defaults = {
|
|||||||
# Prebuild set up script.
|
# Prebuild set up script.
|
||||||
'___build_pre': ('none', 'none', '''# ___build_pre in as set up in defaults.py
|
'___build_pre': ('none', 'none', '''# ___build_pre in as set up in defaults.py
|
||||||
# Directories
|
# Directories
|
||||||
|
%{?_prefix:SB_PREFIX="%{_prefix}"}
|
||||||
|
%{?_prefix:SB_PREFIX_CLEAN=$(echo "%{_prefix}" | %{__sed} -e \'s/^\///\')}
|
||||||
SB_SOURCE_DIR="%{_sourcedir}"
|
SB_SOURCE_DIR="%{_sourcedir}"
|
||||||
SB_BUILD_DIR="%{_builddir}"
|
SB_BUILD_DIR="%{_builddir}"
|
||||||
SB_OPT_FLAGS="%{?_tmproot:-I%{_tmproot}/%{_prefix}/include -L%{_tmproot}/%{_prefix}/lib} %{optflags}"
|
SB_OPT_FLAGS="%{?_tmproot:-I%{_tmproot}/${SB_PREFIX_CLEAN}/include -L%{_tmproot}/${SB_PREFIX_CLEAN}/lib} %{optflags}"
|
||||||
SB_ARCH="%{_arch}"
|
SB_ARCH="%{_arch}"
|
||||||
SB_OS="%{_os}"
|
SB_OS="%{_os}"
|
||||||
export SB_SOURCE_DIR SB_BUILD_DIR SB_OPT_FLAGS SB_ARCH SB_OS
|
export SB_SOURCE_DIR SB_BUILD_DIR SB_OPT_FLAGS SB_ARCH SB_OS
|
||||||
@ -173,15 +180,38 @@ export SB_DOC_DIR
|
|||||||
SB_PACKAGE_NAME="%{name}"
|
SB_PACKAGE_NAME="%{name}"
|
||||||
SB_PACKAGE_VERSION="%{version}"
|
SB_PACKAGE_VERSION="%{version}"
|
||||||
SB_PACKAGE_RELEASE="%{release}"
|
SB_PACKAGE_RELEASE="%{release}"
|
||||||
export SBPACKAGE_NAME SB_PACKAGE_VERSION SB_PACKAGE_RELEASE
|
export SB_PACKAGE_NAME SB_PACKAGE_VERSION SB_PACKAGE_RELEASE
|
||||||
# Build root directory
|
# Build directories
|
||||||
|
export SB_PREFIX
|
||||||
|
%{?_builddir:SB_BUILD_DIR="%{_builddir}"}
|
||||||
%{?buildroot:SB_BUILD_ROOT="%{buildroot}"}
|
%{?buildroot:SB_BUILD_ROOT="%{buildroot}"}
|
||||||
export SB_BUILD_ROOT
|
%{?buildroot:%{?_prefix:SB_BUILD_ROOT_BINDIR="%{buildroot}/${SB_PREFIX_CLEAN}/bin"}}
|
||||||
|
export SB_BUILD_ROOT SB_BUILD_DIR SB_BUILD_ROOT_BINDIR
|
||||||
|
%{?_buildcxcdir:SB_BUILD_CXC_DIR="%{_buildcxcdir}"}
|
||||||
|
%{?buildcxcroot:SB_BUILD_CXC_ROOT="%{buildcxcroot}"}
|
||||||
|
%{?buildcxcroot:%{?_prefix:SB_BUILD_CXC_ROOT_BINDIR="%{buildcxcroot}/${SB_PREFIX_CLEAN}/bin"}}
|
||||||
|
export SB_BUILD_CXC_ROOT SB_BUILD_CXC_DIR SB_BUILD_CXC_ROOT_BINDIR
|
||||||
|
%{?_tmproot:SB_TMPROOT="%{_tmproot}"}
|
||||||
|
%{?_tmproot:%{?_prefix:SB_TMPPREFIX="%{_tmproot}/${SB_PREFIX_CLEAN}"}}
|
||||||
|
%{?_tmproot:%{?_prefix:SB_TMPBINDIR="%{_tmproot}/${SB_PREFIX_CLEAN}/bin"}}
|
||||||
|
export SB_TMPROOT SB_TMPPREFIX SB_TMPBINDIR
|
||||||
|
%{?_tmpcxcroot:SB_TMPCXCROOT="%{_tmproot}"}
|
||||||
|
%{?_tmpcxcroot:%{?_prefix:SB_TMPCXCPREFIX="%{_tmpcxcroot}/${SB_PREFIX_CLEAN}"}}
|
||||||
|
%{?_tmpcxcroot:%{?_prefix:SB_TMPCXCBINDIR="%{_tmpcxcroot}/${SB_PREFIX_CLEAN}/bin"}}
|
||||||
|
export SB_TMPCXCROOT SB_TMPCXCPREFIX SB_TMPCXCBINDIR
|
||||||
# The compiler flags
|
# The compiler flags
|
||||||
%{?_targetcflags:CFLAGS_FOR_TARGET="%{_targetcflags}"}
|
%{?_targetcflags:CFLAGS_FOR_TARGET="%{_targetcflags}"}
|
||||||
%{?_targetcxxflags:CXXFLAGS_FOR_TARGET="%{_targetcxxflags}"}
|
%{?_targetcxxflags:CXXFLAGS_FOR_TARGET="%{_targetcxxflags}"}
|
||||||
export CFLAGS_FOR_TARGET
|
export CFLAGS_FOR_TARGET
|
||||||
export CXXFLAGS_FOR_TARGET
|
export CXXFLAGS_FOR_TARGET
|
||||||
|
# Set up the path. Put the CXC path first.
|
||||||
|
if test -n "${SB_TMPBINDIR}" ; then
|
||||||
|
PATH="${SB_TMPBINDIR}:$PATH"
|
||||||
|
fi
|
||||||
|
if test -n "${SB_TMPCXCBINDIR}" ; then
|
||||||
|
PATH="${SB_TMPCXCBINDIR}:$PATH"
|
||||||
|
fi
|
||||||
|
export PATH
|
||||||
# Default environment set up.
|
# Default environment set up.
|
||||||
LANG=C
|
LANG=C
|
||||||
export LANG
|
export LANG
|
||||||
@ -449,7 +479,8 @@ class command_line:
|
|||||||
s = s.replace(m, _defaults[name][2])
|
s = s.replace(m, _defaults[name][2])
|
||||||
expanded = True
|
expanded = True
|
||||||
else:
|
else:
|
||||||
raise error.general('cannot process default macro: ' + m)
|
raise error.general('cannot expand default macro: %s in "%s"' %
|
||||||
|
(m, s))
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def command(self):
|
def command(self):
|
||||||
@ -555,10 +586,13 @@ def load(args, optargs = None):
|
|||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
import windows
|
import windows
|
||||||
overrides = windows.load()
|
overrides = windows.load()
|
||||||
else:
|
elif os.name == 'posix':
|
||||||
uname = os.uname()
|
uname = os.uname()
|
||||||
try:
|
try:
|
||||||
if uname[0] == 'Darwin':
|
if uname[0].startswith('CYGWIN_NT'):
|
||||||
|
import windows
|
||||||
|
overrides = windows.load()
|
||||||
|
elif uname[0] == 'Darwin':
|
||||||
import darwin
|
import darwin
|
||||||
overrides = darwin.load()
|
overrides = darwin.load()
|
||||||
elif uname[0] == 'FreeBSD':
|
elif uname[0] == 'FreeBSD':
|
||||||
@ -569,6 +603,8 @@ def load(args, optargs = None):
|
|||||||
overrides = linux.load()
|
overrides = linux.load()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
else:
|
||||||
|
raise error.general('unsupported host type; please add')
|
||||||
if overrides is None:
|
if overrides is None:
|
||||||
raise error.general('no hosts defaults found; please add')
|
raise error.general('no hosts defaults found; please add')
|
||||||
for k in overrides:
|
for k in overrides:
|
||||||
|
@ -102,14 +102,20 @@ class execute:
|
|||||||
def _readthread(fh, out, prefix = ''):
|
def _readthread(fh, out, prefix = ''):
|
||||||
"""Read from a file handle and write to the output handler
|
"""Read from a file handle and write to the output handler
|
||||||
until the file closes."""
|
until the file closes."""
|
||||||
|
count = 0
|
||||||
while True:
|
while True:
|
||||||
line = fh.readline()
|
line = fh.readline()
|
||||||
|
count += 1
|
||||||
if len(line) == 0:
|
if len(line) == 0:
|
||||||
break
|
break
|
||||||
if out:
|
if out:
|
||||||
out(prefix + line)
|
out(prefix + line)
|
||||||
else:
|
else:
|
||||||
log.output(prefix + line)
|
log.output(prefix + line)
|
||||||
|
if count > 10:
|
||||||
|
log.flush()
|
||||||
|
count = 0
|
||||||
|
|
||||||
def _timerthread(proc, timer):
|
def _timerthread(proc, timer):
|
||||||
"""Timer thread calls the timer handler if one
|
"""Timer thread calls the timer handler if one
|
||||||
is present once a second. The user provides a handler
|
is present once a second. The user provides a handler
|
||||||
|
@ -122,48 +122,58 @@ class buildset:
|
|||||||
r.make(_config, outname)
|
r.make(_config, outname)
|
||||||
del r
|
del r
|
||||||
|
|
||||||
def first_package(self, _build):
|
def root_copy(self, src, dst):
|
||||||
tmproot = path.abspath(_build.config.expand('%{_tmproot}'))
|
|
||||||
_build.rmdir(tmproot)
|
|
||||||
_build.mkdir(tmproot)
|
|
||||||
prefix = _build.config.expand('%{_prefix}')
|
|
||||||
if prefix[0] == os.sep:
|
|
||||||
prefix = prefix[1:]
|
|
||||||
tmpprefix = path.join(tmproot, prefix)
|
|
||||||
tmpbindir = path.join(tmpprefix, 'bin')
|
|
||||||
# exporting to the environment
|
|
||||||
os.environ['SB_TMPPREFIX'] = tmpprefix
|
|
||||||
os.environ['SB_TMPBINDIR'] = tmpbindir
|
|
||||||
os.environ['SB_ORIG_PATH'] = os.environ['PATH']
|
|
||||||
os.environ['PATH'] = path.host(tmpbindir) + os.pathsep + os.environ['PATH']
|
|
||||||
self._output('path: ' + os.environ['PATH'])
|
|
||||||
# shell format
|
|
||||||
return tmproot
|
|
||||||
|
|
||||||
def every_package(self, _build, tmproot):
|
|
||||||
src = _build.config.abspath('%{buildroot}')
|
|
||||||
dst = tmproot
|
|
||||||
if self.opts.get_arg('--bset-tar-file'):
|
|
||||||
what = '%s -> %s' % \
|
what = '%s -> %s' % \
|
||||||
(os.path.relpath(path.host(src)), os.path.relpath(path.host(dst)))
|
(os.path.relpath(path.host(src)), os.path.relpath(path.host(dst)))
|
||||||
if self.opts.trace():
|
if self.opts.trace():
|
||||||
_notice(self.opts, 'collecting: %s' % (what))
|
_notice(self.opts, 'collecting: %s' % (what))
|
||||||
if not self.opts.dry_run():
|
if not self.opts.dry_run():
|
||||||
self.copy(src, dst)
|
self.copy(src, dst)
|
||||||
if not self.opts.get_arg('--no-install'):
|
|
||||||
dst = _build.config.expand('%{_prefix}')
|
def install(self, name, buildroot, prefix):
|
||||||
src = path.join(src, dst)
|
dst = prefix
|
||||||
_notice(self.opts, 'installing: %s -> %s' % (_build.name(), path.host(dst)))
|
src = path.join(buildroot, prefix)
|
||||||
|
_notice(self.opts, 'installing: %s -> %s' % (name, path.host(dst)))
|
||||||
if not self.opts.dry_run():
|
if not self.opts.dry_run():
|
||||||
self.copy(src, dst)
|
self.copy(src, dst)
|
||||||
|
|
||||||
def last_package(self, _build, tmproot):
|
def canadian_cross(self, _build):
|
||||||
if self.opts.get_arg('--bset-tar-file'):
|
defaults_to_save = ['%{_prefix}',
|
||||||
|
'%{_tmproot}',
|
||||||
|
'%{buildroot}',
|
||||||
|
'%{_builddir}',
|
||||||
|
'%{_host}']
|
||||||
|
defaults_to_copy = [('%{_host}', '%{_build}'),
|
||||||
|
('%{_tmproot}', '%{_tmpcxcroot}'),
|
||||||
|
('%{buildroot}', '%{buildcxcroot}'),
|
||||||
|
('%{_builddir}', '%{_buildcxcdir}')]
|
||||||
|
orig_defaults = {}
|
||||||
|
for d in defaults_to_save:
|
||||||
|
orig_defaults[d] = _build.config.default(d)
|
||||||
|
for d in defaults_to_copy:
|
||||||
|
_build.config.set_define(d[0], _build.config.default(d[1]))
|
||||||
|
_build.make()
|
||||||
|
for d in defaults_to_save:
|
||||||
|
_build.config.set_define(d, orig_defaults[d])
|
||||||
|
self.root_copy(_build.config.expand('%{buildcxcroot}'),
|
||||||
|
_build.config.expand('%{_tmpcxcroot}'))
|
||||||
|
|
||||||
|
def build_package(self, _config, _build):
|
||||||
|
if _build.canadian_cross():
|
||||||
|
self.canadian_cross(_build)
|
||||||
|
_build.make()
|
||||||
|
self.report(_config, _build)
|
||||||
|
self.root_copy(_build.config.expand('%{buildroot}'),
|
||||||
|
_build.config.expand('%{_tmproot}'))
|
||||||
|
|
||||||
|
def bset_tar(self, _build):
|
||||||
tardir = _build.config.expand('%{_tardir}')
|
tardir = _build.config.expand('%{_tardir}')
|
||||||
|
if self.opts.get_arg('--bset-tar-file'):
|
||||||
path.mkdir(tardir)
|
path.mkdir(tardir)
|
||||||
tar = path.join(tardir, _build.config.expand('%s.tar.bz2' % (self.bset_pkg)))
|
tar = path.join(tardir, _build.config.expand('%s.tar.bz2' % (self.bset_pkg)))
|
||||||
_notice(self.opts, 'tarball: %s' % (os.path.relpath(path.host(tar))))
|
_notice(self.opts, 'tarball: %s' % (os.path.relpath(path.host(tar))))
|
||||||
if not self.opts.dry_run():
|
if not self.opts.dry_run():
|
||||||
|
tmproot = _build.config.expand('%{_tmproot}')
|
||||||
cmd = _build.config.expand("'cd " + tmproot + \
|
cmd = _build.config.expand("'cd " + tmproot + \
|
||||||
" && %{__tar} -cf - . | %{__bzip2} > " + tar + "'")
|
" && %{__tar} -cf - . | %{__bzip2} > " + tar + "'")
|
||||||
_build.run(cmd, shell_opts = '-c', cwd = tmproot)
|
_build.run(cmd, shell_opts = '-c', cwd = tmproot)
|
||||||
@ -291,14 +301,10 @@ class buildset:
|
|||||||
self.opts.get_arg('--pkg-tar-files'),
|
self.opts.get_arg('--pkg-tar-files'),
|
||||||
_defaults = _defaults,
|
_defaults = _defaults,
|
||||||
opts = _opts)
|
opts = _opts)
|
||||||
if s == 0:
|
|
||||||
tmproot = self.first_package(b)
|
|
||||||
if deps is None:
|
if deps is None:
|
||||||
b.make()
|
self.build_package(configs[s], b)
|
||||||
self.report(configs[s], b)
|
|
||||||
self.every_package(b, tmproot)
|
|
||||||
if s == len(configs) - 1:
|
if s == len(configs) - 1:
|
||||||
self.last_package(b, tmproot)
|
self.bset_tar(b)
|
||||||
else:
|
else:
|
||||||
deps += b.config.includes()
|
deps += b.config.includes()
|
||||||
builds += [b]
|
builds += [b]
|
||||||
@ -309,7 +315,13 @@ class buildset:
|
|||||||
print gerr
|
print gerr
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
if deps is None and (not self.opts.no_clean() or self.opts.get_arg('--keep-going')):
|
if deps is None and not self.opts.get_arg('--no-install'):
|
||||||
|
for b in builds:
|
||||||
|
self.install(b.name(),
|
||||||
|
b.config.expand('%{buildroot}'),
|
||||||
|
b.config.expand('%{_prefix}'))
|
||||||
|
if deps is None and \
|
||||||
|
(not self.opts.no_clean() or self.opts.get_arg('--keep-going')):
|
||||||
for b in builds:
|
for b in builds:
|
||||||
_notice(self.opts, 'cleaning: %s' % (b.name()))
|
_notice(self.opts, 'cleaning: %s' % (b.name()))
|
||||||
b.cleanup()
|
b.cleanup()
|
||||||
|
@ -21,13 +21,42 @@
|
|||||||
# Windows specific support and overrides.
|
# Windows specific support and overrides.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import error
|
||||||
import pprint
|
import pprint
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import execute
|
import execute
|
||||||
|
|
||||||
def load():
|
def load():
|
||||||
|
# Default to the native Windows Python.
|
||||||
uname = 'win32'
|
uname = 'win32'
|
||||||
|
system = 'mingw32'
|
||||||
|
if os.environ.has_key('HOSTTYPE'):
|
||||||
|
hosttype = os.environ['HOSTTYPE']
|
||||||
|
else:
|
||||||
|
hosttype = 'i686'
|
||||||
|
host_triple = hosttype + '-pc-' + system
|
||||||
|
build_triple = hosttype + '-pc-' + system
|
||||||
|
|
||||||
|
# See if this is actually Cygwin Python
|
||||||
|
if os.name == 'posix':
|
||||||
|
try:
|
||||||
|
uname = os.uname()
|
||||||
|
hosttype = uname[4]
|
||||||
|
uname = uname[0]
|
||||||
|
if uname.startswith('CYGWIN'):
|
||||||
|
if uname.endswith('WOW64'):
|
||||||
|
uname = 'cygwin'
|
||||||
|
build_triple = hosttype + '-pc-' + uname
|
||||||
|
hosttype = 'x86_64'
|
||||||
|
host_triple = hosttype + '-w64-' + system
|
||||||
|
else:
|
||||||
|
raise error.general('invalid uname for Windows')
|
||||||
|
else:
|
||||||
|
raise error.general('invalid POSIX python')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
if os.environ.has_key('NUMBER_OF_PROCESSORS'):
|
if os.environ.has_key('NUMBER_OF_PROCESSORS'):
|
||||||
ncpus = int(os.environ['NUMBER_OF_PROCESSORS'])
|
ncpus = int(os.environ['NUMBER_OF_PROCESSORS'])
|
||||||
else:
|
else:
|
||||||
@ -36,14 +65,11 @@ def load():
|
|||||||
smp_mflags = '-j' + str(ncpus)
|
smp_mflags = '-j' + str(ncpus)
|
||||||
else:
|
else:
|
||||||
smp_mflags = ''
|
smp_mflags = ''
|
||||||
if os.environ.has_key('HOSTTYPE'):
|
|
||||||
hosttype = os.environ['HOSTTYPE']
|
|
||||||
else:
|
|
||||||
hosttype = 'i686'
|
|
||||||
system = 'mingw32'
|
|
||||||
defines = {
|
defines = {
|
||||||
'_os': ('none', 'none', 'win32'),
|
'_os': ('none', 'none', 'win32'),
|
||||||
'_host': ('triplet', 'required', hosttype + '-pc-' + system),
|
'_build': ('triplet', 'required', build_triple),
|
||||||
|
'_host': ('triplet', 'required', host_triple),
|
||||||
'_host_vendor': ('none', 'none', 'microsoft'),
|
'_host_vendor': ('none', 'none', 'microsoft'),
|
||||||
'_host_os': ('none', 'none', 'win32'),
|
'_host_os': ('none', 'none', 'win32'),
|
||||||
'_host_cpu': ('none', 'none', hosttype),
|
'_host_cpu': ('none', 'none', hosttype),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user