[rtems-source-builder commit] rtems/kernel: Move the --with-rtems logic in the common file.

Chris Johns chrisj at rtems.org
Fri Mar 18 02:37:37 UTC 2016


Module:    rtems-source-builder
Branch:    4.11
Commit:    bc61e340c48083a64857ba77e4e64025ac69b3fe
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=bc61e340c48083a64857ba77e4e64025ac69b3fe

Author:    Chris Johns <chrisj at rtems.org>
Date:      Fri Mar 18 10:49:55 2016 +1100

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

---

 rtems/config/tools/rtems-kernel-4-1.cfg | 266 ++++++++++++++++++--------------
 1 file changed, 154 insertions(+), 112 deletions(-)

diff --git a/rtems/config/tools/rtems-kernel-4-1.cfg b/rtems/config/tools/rtems-kernel-4-1.cfg
index c7bb643..33e8020 100644
--- a/rtems/config/tools/rtems-kernel-4-1.cfg
+++ b/rtems/config/tools/rtems-kernel-4-1.cfg
@@ -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,26 +21,61 @@ 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 ! %{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
+%if %{rsb_released} || %{defined with_rtems}
+ %define rtems_kernel_build 1
 %else
- %if ! %{defined rtems_kernel_version}
-  %define rtems_kernel_version HEAD
+ %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
- %if %{defined rtems_kernel_git_commit_hash}
-  %define rtems_kernel_git_checkout ?checkout=%{defined rtems_kernel_git_commit_hash}
+
+ #
+ # 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
-  %define rtems_kernel_git_checkout %{nil}
- %endif
+  %if ! %{defined rtems_kernel_version}
+   %define rtems_kernel_version HEAD
+  %endif
+  %if %{defined rtems_kernel_git_commit_hash}
+   %define rtems_kernel_git_checkout ?checkout=%{defined rtems_kernel_git_commit_hash}
+  %else
+   %define rtems_kernel_git_checkout %{nil}
+  %endif
 
- %source set rtems git://git.rtems.org/rtems.git?reset=hard?branch=%{rtems_kernel_version}?pull%{rtems_kernel_git_checkout}
+  %source set rtems git://git.rtems.org/rtems.git?reset=hard?branch=%{rtems_kernel_version}?pull%{rtems_kernel_git_checkout}
 
   #
   # The code in git needs to be bootstrapped. Do each build because we have
@@ -42,104 +84,104 @@ 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}
- %define rtems_cxx %{enable_cxx}
-%endif
+ #
+ # 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 1
-%endif
-%ifn %{defined rtems_cxx}
- %define rtems_cxx 1
-%endif
-%ifn %{defined rtems_tests}
- %define rtems_tests samples
-%endif
+ #
+ # Default set up.
+ #
+ %ifn %{defined rtems_posix}
+  %define rtems_posix 1
+ %endif
+ %ifn %{defined rtems_networking}
+  %define rtems_networking 1
+ %endif
+ %ifn %{defined rtems_cxx}
+  %define rtems_cxx 1
+ %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
+ %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.
-#
-# --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}
- %define with_rtems_tests no
-%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}
+  %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 -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} \
+     %{?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_rtemsbsp:--enable-rtemsbsp="%{with_rtemsbsp}"} \
+     %{?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 ..
 
-#
-# 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 %{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} \
-    %{?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_rtemsbsp:--enable-rtemsbsp="%{with_rtemsbsp}"} \
-    %{?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 ..
-
-%testing



More information about the vc mailing list