mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
230 lines
5.1 KiB
INI
230 lines
5.1 KiB
INI
#
|
|
# RTEMS Kernel.
|
|
#
|
|
# This configuration file configure's, make's and install's RTEMS.
|
|
#
|
|
|
|
#
|
|
# If a dry-run and with download ignore errors and correct setting for tools
|
|
# and BSPs. Only after the source to download.
|
|
#
|
|
%if %{_dry_run} && %{defined with_download}
|
|
%log Kenrel configuration errors ignored
|
|
%define rtems_kernel_error 0
|
|
%else
|
|
%define rtems_kernel_error 1
|
|
%endif
|
|
|
|
%if %{rsb_released}
|
|
%define rtems_kernel_version %{rsb_version}
|
|
%endif
|
|
|
|
#
|
|
# The target. It could be set in rtems_target.
|
|
#
|
|
%if %{defined rtems_target}
|
|
%define _target %{rtems_target}
|
|
%endif
|
|
%if %{_target} == %{nil} && %{rtems_kernel_error}
|
|
%error No RTEMS target specified: --target=<arch>-rtems<ver>.
|
|
%endif
|
|
|
|
#
|
|
# The BSP.
|
|
#
|
|
%if !%{defined with_rtems_bsp} && %{rtems_kernel_error}
|
|
%error No RTEMS BSP specified: --with-rtems-bsp=bsp
|
|
%endif
|
|
%define rtems_bsp %{with_rtems_bsp}
|
|
|
|
#
|
|
# If no tools are provided use the prefix.
|
|
#
|
|
%ifn %{defined with_tools}
|
|
%define with_tools %{_prefix}
|
|
%endif
|
|
|
|
#
|
|
# Set the path to the tools.
|
|
#
|
|
%{path prepend %{with_tools}/bin}
|
|
|
|
#
|
|
# Define the package.
|
|
#
|
|
package: rtems-%{rtems_version}-%{_target}-%{rtems_bsp}-%{_host}-%{release}
|
|
|
|
#
|
|
# Package details.
|
|
#
|
|
Name: %{_target}-kernel-%{rtems_bsp}-%{release}
|
|
Summary: RTEMS v%{rtems_kernel_version} for target %{_target} BSP %{rtems_bsp}
|
|
Version: %{rtems_kernel_version}
|
|
Release: %{release}
|
|
URL: https://www.rtems.org/
|
|
|
|
%include %{_configdir}/checks.cfg
|
|
%include %{_configdir}/base.cfg
|
|
%include %{_configdir}/versions.cfg
|
|
|
|
#
|
|
# A magic internal path that would break if changes in the defaults.mc
|
|
# macro file are made.
|
|
#
|
|
%define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN}
|
|
|
|
#
|
|
# Check the version of autoconf. Check autoreconf as it is used.
|
|
#
|
|
%if %{__autoreconf_ver} <= 2.68
|
|
%if %{__autoreconf_bindir_ver} <= 2.68
|
|
%if %{__autoreconf_path_ver} <= 2.68
|
|
%error Autoconf (autoreconf) version 2.69 or higher is needed.
|
|
%endif
|
|
%endif
|
|
%endif
|
|
|
|
#
|
|
# If no tools provided use the prefix.
|
|
#
|
|
%ifn %{defined with_tools}
|
|
%define with_tools %{_prefix}
|
|
%endif
|
|
|
|
#
|
|
# Check options.
|
|
#
|
|
%if %{defined without_rtems_posix}
|
|
%define rtems_posix 0
|
|
%endif
|
|
|
|
%if %{defined with_rtems_legacy_network}
|
|
%define rtems_networking 1
|
|
%endif
|
|
|
|
%if %{defined with_rtems_cxx}
|
|
%define rtems_cxx 1
|
|
%endif
|
|
|
|
#
|
|
# Source
|
|
#
|
|
%if %{rsb_released}
|
|
%if ! %{defined rtems_kernel_compression}
|
|
%define rtems_kernel_compression xz
|
|
%endif
|
|
%define rtems_kernel_version %{rtems_version}
|
|
%define rtems_bootstrap 0
|
|
%else
|
|
#
|
|
# The code in git needs to be bootstrapped. Do each build because we have
|
|
# no way to change what changes may have happened in the code.
|
|
#
|
|
%define rtems_bootstrap 1
|
|
%endif
|
|
|
|
%if ! %{defined rtems_kernel_version}
|
|
%error No RTEMS kernel version defined
|
|
%endif
|
|
|
|
%source set rtems_kernel --rsb-file=rtems-kernel-%{rtems_kernel_version}.tar.bz2 https://git.rtems.org/rtems/snapshot/rtems-%{rtems_kernel_version}.tar.bz2
|
|
|
|
# If C++ defined for the tool set use it to control RTEMS's setting..
|
|
#
|
|
%if %{defined enable_cxx}
|
|
%define rtems_cxx %{enable_cxx}
|
|
%endif
|
|
|
|
#
|
|
# Default set up.
|
|
#
|
|
%ifn %{defined rtems_posix}
|
|
%define rtems_posix 1
|
|
%endif
|
|
%ifn %{defined rtems_networking}
|
|
%define rtems_networking 0
|
|
%endif
|
|
%ifn %{defined rtems_cxx}
|
|
%define rtems_cxx 0
|
|
%endif
|
|
%ifn %{defined rtems_tests}
|
|
%define rtems_tests samples
|
|
%endif
|
|
|
|
%if %{rtems_tests} == disable
|
|
%define rtems_tests_opt --disable-tests
|
|
%else
|
|
%define rtems_tests_opt --enable-tests=%{rtems_tests}
|
|
%endif
|
|
|
|
#
|
|
# Check the various --with/--without options we support.
|
|
#
|
|
# --target : The architecture
|
|
# --with-rtems-bsp : The BSP
|
|
# --with-tests : Supported, samples/yes/no
|
|
# --without-tests : Not supported
|
|
# --with-smp : Supported
|
|
# --without-smp : Not care
|
|
#
|
|
#
|
|
%if %{defined without_rtemsbsp}
|
|
%error Option --without-rtemsbsp is not supported.
|
|
%endif
|
|
%if %{defined without_rtems_tests}
|
|
%define with_rtems_tests no
|
|
%endif
|
|
|
|
#
|
|
# Prepare the source code.
|
|
#
|
|
%prep
|
|
source_dir_rtems="rtems-%{rtems_kernel_version}"
|
|
%source setup rtems_kernel -q -c -n %{name}-%{version}
|
|
cd ${source_dir_rtems}
|
|
%patch setup rtems -p1
|
|
%if %{rtems_bootstrap}
|
|
%if %{defined _internal_autotools_path}
|
|
export PATH="%{_internal_autotools_path}/bin:${PATH}"
|
|
%endif
|
|
./bootstrap -c
|
|
%{_sbdir}/sb-bootstrap --preinstall
|
|
%{_sbdir}/sb-bootstrap
|
|
%endif
|
|
cd ..
|
|
|
|
%build
|
|
# Build directory support.
|
|
if test "%{_build}" != "%{_host}" ; then
|
|
build_dir="build-cxc"
|
|
else
|
|
build_dir="build"
|
|
fi
|
|
mkdir -p ${build_dir}
|
|
cd ${build_dir}
|
|
|
|
../${source_dir_rtems}/configure \
|
|
--build=%{_build} --host=%{_host} \
|
|
--target=%{_target} \
|
|
--enable-rtemsbsp="%{rtems_bsp}" \
|
|
%{?rtems_posix:--enable-posix}%{!?rtems_posix:--disable-posix} \
|
|
%{?rtems_networking:--enable-networking}%{!?rtems_networking:--disable-networking} \
|
|
%{?rtems_cxx:--enable-cxx}%{!?rtems_cxx:--disable-cxx} \
|
|
%{?with_rtems_tests:--enable-tests=%{with_rtems_tests}} \
|
|
%{?with_rtems_smp:--enable-smp} \
|
|
--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
|
|
|
|
cd ..
|