mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00

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.
106 lines
3.3 KiB
INI
106 lines
3.3 KiB
INI
#
|
|
# Binutils 2.xx Version 1.
|
|
#
|
|
# This configuration file configure's, make's and install's binutils.
|
|
#
|
|
|
|
%include %{_configdir}/checks.cfg
|
|
|
|
Name: %{_target}-binutils-%{binutils_version}-%{release}
|
|
Summary: Binutils v%{binutils_version} for target %{_target} on host %{_host}
|
|
Version: %{binutils_version}
|
|
Release: %{release}
|
|
URL: http://sources.redhat.com/binutils
|
|
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|
|
|
#
|
|
# Supports Candian Cross (Cxc).
|
|
#
|
|
%define allow_cxc
|
|
|
|
#
|
|
# Source
|
|
#
|
|
%ifn %{defined Source0}
|
|
Source0: ftp://ftp.gnu.org/gnu/binutils/binutils-%{binutils_version}.tar.bz2
|
|
VersionControl0: cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils
|
|
%endif
|
|
|
|
#
|
|
# Prepare the source code.
|
|
#
|
|
%prep
|
|
%setup -q -c -n %{name}-%{version}
|
|
cd binutils-%{binutils_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 ..
|
|
|
|
%build
|
|
%{?host_force_32bit:HOST_FORCE_32BIT="-m32"}
|
|
if test "%{_build}" != "%{_host}" ; then
|
|
build_dir="build-cxc"
|
|
else
|
|
build_dir="build"
|
|
fi
|
|
mkdir -p ${build_dir}
|
|
cd ${build_dir}
|
|
CFLAGS="$SB_OPT_FLAGS" \
|
|
../binutils-%{binutils_version}/configure \
|
|
--build=%{_build} --host=%{_host} \
|
|
--target=%{_target} \
|
|
--verbose --disable-nls \
|
|
%{?with_deterministic_archives:--enable-deterministic-archives} \
|
|
--without-included-gettext \
|
|
--disable-win32-registry \
|
|
--disable-werror \
|
|
--prefix=%{_prefix} --bindir=%{_bindir} \
|
|
--exec-prefix=%{_exec_prefix} \
|
|
--includedir=%{_includedir} --libdir=%{_libdir} \
|
|
--mandir=%{_mandir} --infodir=%{_infodir}
|
|
|
|
%{__make} %{?_smp_mflags} all
|
|
cd ..
|
|
|
|
%install
|
|
%{__rmdir} $SB_BUILD_ROOT
|
|
|
|
cd ${build_dir}
|
|
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
|
|
|
# Dropped in FSF-binutils-2.9.5, but Cygwin still ships it.
|
|
%{__rmdir} $SB_BUILD_ROOT%{_infodir}/configure.info*
|
|
|
|
%{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir
|
|
touch $SB_BUILD_ROOT%{_infodir}/dir
|
|
|
|
# binutils does not install share/locale, however it uses it
|
|
mkdir -p $SB_BUILD_ROOT%{_prefix}/share/locale
|
|
|
|
# We don't ship host files
|
|
%{__rmfile} ${SB_BUILD_ROOT}%{_libdir}/libiberty*
|
|
|
|
# manpages without corresponding tools
|
|
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-dlltool%{_exeext}; then
|
|
%{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-dlltool*
|
|
fi
|
|
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-nlmconv%{_exeext}; then
|
|
%{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-nlmconv*
|
|
fi
|
|
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-windres%{_exeext}; then
|
|
%{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windres*
|
|
fi
|
|
if test ! -f ${SB_BUILD_ROOT}%{_bindir}/%{_target}-windmc%{_exeext}; then
|
|
%{__rmfile} ${SB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windmc*
|
|
fi
|
|
|
|
cd ..
|