rtems/kernel: Move the --with-rtems logic in the common file.

This commit is contained in:
Chris Johns 2016-03-18 10:49:55 +11:00
parent 8bde727065
commit a102424f67

View File

@ -4,8 +4,15 @@
# This configuration file configure's, make's and install's RTEMS.
#
%include %{_configdir}/checks.cfg
%if %{rsb_released}
%define rtems_kernel_version %{rsb_version}
%else
%define rtems_kernel_version %{rtems_version}
%endif
#
# Package details.
#
Name: %{_target}-kernel-%{rtems_kernel_version}-%{release}
Summary: RTEMS v%{rtems_kernel_version} for target %{_target} on host %{_host}
Version: %{rtems_kernel_version}
@ -14,16 +21,51 @@ URL: http://www.rtems.org/
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
# Build if the RSB is released or optionally enable/disable building the RTEMS
# kernel via the command line.
#
%if %{rsb_released}
%if %{rsb_released} || %{defined with_rtems}
%define rtems_kernel_build 1
%else
%define rtems_kernel_build 0
%endif
%if %{defined without_rtems}
%define rtems_kernel_build 0
%endif
%if %{rtems_kernel_build}
%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
#
# Source
#
%if %{rsb_released}
%if ! %{defined rtems_kernel_compression}
%define rtems_kernel_compression xz
%endif
%source set rtems %{rtems_release_url}/%{rtems_kernel_version}/rtems-%{rtems_kernel_version}.tar.%{rtems_kernel_compression}
%define rtems_bootstrap 0
%define without_release_url
%else
%else
%if ! %{defined rtems_kernel_version}
%define rtems_kernel_version HEAD
%endif
@ -42,72 +84,72 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
%define rtems_bootstrap 1
%endif
#
# If C++ defined for the tool set use it to control RTEMS's setting..
#
%if %{defined enable_cxx}
#
# If C++ defined for the tool set use it to control RTEMS's setting..
#
%if %{defined enable_cxx}
%define rtems_cxx %{enable_cxx}
%endif
%endif
#
# Default set up.
#
%ifn %{defined rtems_posix}
#
# Default set up.
#
%ifn %{defined rtems_posix}
%define rtems_posix 1
%endif
%ifn %{defined rtems_networking}
%endif
%ifn %{defined rtems_networking}
%define rtems_networking 1
%endif
%ifn %{defined rtems_cxx}
%endif
%ifn %{defined rtems_cxx}
%define rtems_cxx 1
%endif
%ifn %{defined rtems_tests}
%endif
%ifn %{defined rtems_tests}
%define rtems_tests samples
%endif
%endif
%if %{rtems_tests} == disable
%if %{rtems_tests} == disable
%define rtems_tests_opt --disable-tests
%else
%else
%define rtems_tests_opt --enable-tests=%{rtems_tests}
%endif
%endif
#
# Check the various --with/--without options we support.
#
# --with-rtemsbsp : Supported, list of BSPs
# --without-rtemsbsp: Not supported
# --with-tests : Supported, samples/yes/no
# --without-tests : Not supported
# --with-smp : Supported
# --without-smp : Not care
#
#
%if %{defined without_rtemsbsp}
#
# Check the various --with/--without options we support.
#
# --with-rtemsbsp : Supported, list of BSPs
# --without-rtemsbsp: Not supported
# --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}
%endif
%if %{defined without_rtems_tests}
%define with_rtems_tests no
%endif
%endif
#
# Prepare the source code.
#
%prep
#
# Prepare the source code.
#
%prep
source_dir_rtems="rtems-%{rtems_kernel_version}"
%source setup rtems -q -c -n %{name}-%{version}
cd ${source_dir_rtems}
%patch setup rtems -p1
%if %{rtems_bootstrap}
%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
%endif
cd ..
%build
%build
# Build directory support.
if test "%{_build}" != "%{_host}" ; then
build_dir="build-cxc"
@ -134,7 +176,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
%{__make} %{?_smp_mflags} all
cd ..
%install
%install
%{__rmdir} $SB_BUILD_ROOT
cd ${build_dir}
@ -142,4 +184,4 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
cd ..
%testing
%endif