[PATCH 7/7] rtems/bsp: Build packages for the beagle BSP.

chrisj at rtems.org chrisj at rtems.org
Mon Jul 22 00:10:09 UTC 2019


From: Chris Johns <chrisj at rtems.org>

Closes #3769
---
 rtems/config/5/bsps/beagleboneblack.bset   |  6 +-
 rtems/config/5/rtems-or1k.bset             |  1 -
 rtems/config/5/rtems-riscv.bset            |  1 -
 rtems/config/5/rtems-x86_64.bset           |  1 -
 rtems/config/rtems-bsp.cfg                 | 93 +++++++++++++++-------
 rtems/config/tools/rtems-kernel-5.cfg      |  4 +-
 rtems/config/tools/rtems-kernel-common.cfg | 16 ++--
 source-builder/config/libpng-1.cfg         |  2 -
 source-builder/config/libtiff-1.cfg        |  3 +-
 source-builder/config/lwip-1.cfg           |  2 +-
 source-builder/config/microwindows-1.cfg   |  5 +-
 source-builder/config/nxlib-1.cfg          |  3 +-
 source-builder/defaults.mc                 |  7 ++
 source-builder/sb/setbuilder.py            |  8 +-
 14 files changed, 95 insertions(+), 57 deletions(-)

diff --git a/rtems/config/5/bsps/beagleboneblack.bset b/rtems/config/5/bsps/beagleboneblack.bset
index 68b590a..3253398 100644
--- a/rtems/config/5/bsps/beagleboneblack.bset
+++ b/rtems/config/5/bsps/beagleboneblack.bset
@@ -9,11 +9,11 @@
 #  - Packages
 #
 
-%define rtems_target   arm-rtems5
-%define rtems_host     arm-rtems5
 %define with_rtems_bsp beagleboneblack
-
+%define rtems_target   arm-rtems5
+%define rtems_host     %{rtems_target}
 
 5/rtems-arm
 5/rtems-kernel
 5/rtems-libbsd
+5/rtems-packages
diff --git a/rtems/config/5/rtems-or1k.bset b/rtems/config/5/rtems-or1k.bset
index 0ab37d2..2533060 100644
--- a/rtems/config/5/rtems-or1k.bset
+++ b/rtems/config/5/rtems-or1k.bset
@@ -13,4 +13,3 @@ tools/rtems-gdb-8.2.1-1
 tools/rtems-binutils-2.32
 tools/rtems-gcc-9.1.0-newlib-5c2a3661c
 tools/rtems-tools-5-1
-tools/rtems-kernel-5
diff --git a/rtems/config/5/rtems-riscv.bset b/rtems/config/5/rtems-riscv.bset
index 6e9de99..bff4c44 100644
--- a/rtems/config/5/rtems-riscv.bset
+++ b/rtems/config/5/rtems-riscv.bset
@@ -14,5 +14,4 @@ tools/rtems-gdb-8.2.1-1
 tools/rtems-binutils-2.32
 tools/rtems-gcc-9.1.0-newlib-5c2a3661c
 tools/rtems-tools-5-1
-tools/rtems-kernel-5
 devel/sis-2-1.cfg
diff --git a/rtems/config/5/rtems-x86_64.bset b/rtems/config/5/rtems-x86_64.bset
index 6e3c27c..cda3bdd 100644
--- a/rtems/config/5/rtems-x86_64.bset
+++ b/rtems/config/5/rtems-x86_64.bset
@@ -11,4 +11,3 @@ tools/rtems-gdb-8.2.1-1
 tools/rtems-binutils-2.32
 tools/rtems-gcc-9.1.0-newlib-5c2a3661c
 tools/rtems-tools-5-1
-tools/rtems-kernel-5
diff --git a/rtems/config/rtems-bsp.cfg b/rtems/config/rtems-bsp.cfg
index bf1f42b..1af77f9 100644
--- a/rtems/config/rtems-bsp.cfg
+++ b/rtems/config/rtems-bsp.cfg
@@ -53,6 +53,7 @@
  %endif
  %define with_rtems_bsp sparc/erc32
 %endif
+%define rtems_bsp %{with_rtems_bsp}
 
 #
 # If no tools or RTEMS provided use the prefix. If staging use the staging
@@ -87,6 +88,29 @@
 #
 %{path prepend %{with_tools}/bin}
 
+#
+# Update the configure paths to be BSP specific.
+#
+%define rtems_bsp_prefix  %{_prefix}/%{_host}/%{rtems_bsp}
+%define _exec_prefix      %{rtems_bsp_prefix}
+%define _bindir           %{_exec_prefix}/bin
+%define _sbindir          %{_exec_prefix}/sbin
+%define _libexecdir       %{_exec_prefix}/libexec
+%define _datarootdir      %{_exec_prefix}/share
+%define _datadir          %{_datarootdir}
+%define _sysconfdir       %{_exec_prefix}/etc
+%define _sharedstatedir   %{_exec_prefix}/com
+%define _localstatedir    %{_exec_prefix}/var
+%define _includedir       %{_libdir}/include
+%define _lib              lib
+%define _libdir           %{_exec_prefix}/%{_lib}
+%define _libexecdir       %{_exec_prefix}/libexec
+%define _mandir           %{_datarootdir}/man
+%define _infodir          %{_datarootdir}/info
+%define _localedir        %{_datarootdir}/locale
+%define _localedir        %{_datadir}/locale
+%define _localstatedir    %{_exec_prefix}/var
+
 #
 # Set up how we manage pkgconfig. Set the prefix path to the RTEMS prefix,
 # enable support when crosscompiling, and filter specific optimisation and
@@ -99,16 +123,50 @@
 #
 # The RTEMS BSP Flags
 #
-%define rtems_bsp         %{with_rtems_bsp}
-%define rtems_bsp_ccflags %{pkgconfig ccflags %{_host}-%{rtems_bsp}}
-%define rtems_bsp_cflags  %{pkgconfig cflags  %{_host}-%{rtems_bsp}}
-%define rtems_bsp_ldflags %{pkgconfig ldflags %{_host}-%{rtems_bsp}}
-%define rtems_bsp_libs    %{pkgconfig libs    %{_host}-%{rtems_bsp}}
+%define rtems_bsp_includes -I%{_includedir}
+%define rtems_bsp_ccflags  %{pkgconfig ccflags %{_host}-%{rtems_bsp}}
+%define rtems_bsp_cflags   %{pkgconfig cflags  %{_host}-%{rtems_bsp}}
+%define rtems_bsp_ldflags  %{pkgconfig ldflags %{_host}-%{rtems_bsp}}
+%define rtems_bsp_libs     %{pkgconfig libs    %{_host}-%{rtems_bsp}}
 
 %if %{rtems_bsp_cflags} == %{nil} && %{rtems_bsp_error}
  %error No RTEMS BSP CFLAGS found; Please check the --with-rtems-bsp option.
 %endif
 
+#
+# C++ flags are the C flags.
+#
+%if %{rtems_bsp_ccflags} == %{nil}
+ %define rtems_bsp_ccflags %{rtems_bsp_cflags}
+%endif
+
+#
+# If there are no LDFLAGS create a path to RTEMS.
+#
+%if %{rtems_bsp_ldflags} == %{nil}
+ %define rtems_bsp_ldflags -L%{rtems_bsp_prefix}/lib
+%endif
+
+#
+# Support for RTEMS's Makefile.inc support.
+#
+%define rtems_bsp_makefile_inc %{rtems_bsp_prefix}
+%define rtems_bsp_rtems_root   %{_prefix}
+
+#
+# Filter the flags converting any prefix to the staging path if this is a
+# staging build.
+#
+%if %{install_mode} == staging
+ %define staging_filter sed -e 's|%{_prefix}|%{stagingroot}|g'
+ %define rtems_bsp_prefix     $(echo %{rtems_bsp_prefix}   | %{staging_filter})
+ %define rtems_bsp_includes   $(echo %{rtems_bsp_includes} | %{staging_filter})
+ %define rtems_bsp_ccflags    $(echo %{rtems_bsp_ccflags}  | %{staging_filter})
+ %define rtems_bsp_cflags     $(echo %{rtems_bsp_cflags}   | %{staging_filter})
+ %define rtems_bsp_ldflags    $(echo %{rtems_bsp_ldflags}  | %{staging_filter})
+ %define rtems_bsp_rtems_root %{stagingroot}
+%endif
+
 %if %{rtems_bsp_ccflags} == %{nil}
  %define rtems_bsp_ccflags %{rtems_bsp_cflags}
 %endif
@@ -146,35 +204,12 @@
  %define rtems_bsp_libs %{rtems_bsp_libs} -lrtemsdefaultconfig
 %endif
 
-#
-# Update the configure paths to be BSP specific.
-#
-%define rtems_bsp_prefix  %{_prefix}/%{_host}/%{rtems_bsp}
-%define _exec_prefix      %{rtems_bsp_prefix}
-%define _bindir           %{_exec_prefix}/bin
-%define _sbindir          %{_exec_prefix}/sbin
-%define _libexecdir       %{_exec_prefix}/libexec
-%define _datarootdir      %{_exec_prefix}/share
-%define _datadir          %{_datarootdir}
-%define _sysconfdir       %{_exec_prefix}/etc
-%define _sharedstatedir   %{_exec_prefix}/com
-%define _localstatedir    %{_exec_prefix}/var
-%define _includedir       %{_libdir}/include
-%define _lib              lib
-%define _libdir           %{_exec_prefix}/%{_lib}
-%define _libexecdir       %{_exec_prefix}/libexec
-%define _mandir           %{_datarootdir}/man
-%define _infodir          %{_datarootdir}/info
-%define _localedir        %{_datarootdir}/locale
-%define _localedir        %{_datadir}/locale
-%define _localstatedir    %{_exec_prefix}/var
-
 #
 # Map to names used for cross compiling.
 #
 %define host_cc       %{rtems_bsp_cc}
 %define host_cxx      %{rtems_bsp_cxx}
-%define host_includes -I%{_includedir}
+%define host_includes %{rtems_bsp_includes}
 %define host_cflags   %{rtems_bsp_cflags}
 %define host_cxxflags %{rtems_bsp_ccflags}
 %define host_ldflags  %{rtems_bsp_ldflags}
diff --git a/rtems/config/tools/rtems-kernel-5.cfg b/rtems/config/tools/rtems-kernel-5.cfg
index 7f23635..fe538b8 100644
--- a/rtems/config/tools/rtems-kernel-5.cfg
+++ b/rtems/config/tools/rtems-kernel-5.cfg
@@ -2,8 +2,8 @@
 # RTEMS 5
 #
 
-%define rtems_kernel_version c4d89deaa66f9878ea5499cae7210d5815afc4fe
-%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.bz2 fa4cbcfd9d10be737b91805f1fbaccb7289f3d300a2a7aafef1713d265dd97242d00aba5f1c63ead5a889cfb2148fd9d62c79dcb6f16e61f9fa1290067159b43
+%define rtems_kernel_version 270c5df5dbaf93c19e2f66a27f4bb73c7e625629
+%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.bz2 aed5a4ef1fd33a5097cffcde458f3b6848ccbc8cb181918dbbb7e27df6a75b3caa9e859d4106ce380ebcd26aab5f5afb85036b2c1f4f47eb482f55e0a2238674
 
 #
 # The RTEMS build instructions.
diff --git a/rtems/config/tools/rtems-kernel-common.cfg b/rtems/config/tools/rtems-kernel-common.cfg
index 5a79340..ed19333 100644
--- a/rtems/config/tools/rtems-kernel-common.cfg
+++ b/rtems/config/tools/rtems-kernel-common.cfg
@@ -182,15 +182,15 @@ URL: 	 https://www.rtems.org/
   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}"
+  %patch setup rtems_kernel -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
-  ./bootstrap -c
-  %{_sbdir}/sb-bootstrap --preinstall
-  %{_sbdir}/sb-bootstrap
-%endif
   cd ..
 
 %build
diff --git a/source-builder/config/libpng-1.cfg b/source-builder/config/libpng-1.cfg
index dac60fc..adf0286 100644
--- a/source-builder/config/libpng-1.cfg
+++ b/source-builder/config/libpng-1.cfg
@@ -17,8 +17,6 @@ URL:       http://www.libpng.org/
 #
 # libpng Source
 #
-#%source set libpng ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng%{libpng_src_dir_revision}/libpng-%{libpng_version}.tar.gz
-
 %source set libpng --rsb-file=libpng-%{libpng_version}.tar.xz http://prdownloads.sourceforge.net/libpng/libpng-%{libpng_version}.tar.xz?download
 
 #
diff --git a/source-builder/config/libtiff-1.cfg b/source-builder/config/libtiff-1.cfg
index c9da951..79b84aa 100644
--- a/source-builder/config/libtiff-1.cfg
+++ b/source-builder/config/libtiff-1.cfg
@@ -12,7 +12,7 @@ Name:      libtiff-v%{tiff_version}-%{_host}-%{release}
 Summary:   libtiff provides support for the Tag Image File Format (TIFF), a widely used format for storing image data.
 Version:   %{tiff_version}
 Release:   %{release}
-URL:     http://www.libtiff.org/
+URL:       http://www.libtiff.org/
 
 #
 # libtiff Source
@@ -55,7 +55,6 @@ URL:     http://www.libtiff.org/
     --with-docdir=%{_datarootdir}/doc \
     --disable-shared
 
-
   %{__make} %{?_smp_mflags} all
   cd ${build_top}
 
diff --git a/source-builder/config/lwip-1.cfg b/source-builder/config/lwip-1.cfg
index ef736c1..9c3fba8 100644
--- a/source-builder/config/lwip-1.cfg
+++ b/source-builder/config/lwip-1.cfg
@@ -40,9 +40,9 @@ URL: 	   http://git.savannah.gnu.org/cgit/lwip.git
   cd ${build_dir}
 
   %{host_build_flags}
+  %{rtems_makefile_inc}
 
   cd ${build_top}/lwip-%{lwip_version}
-  export RTEMS_MAKEFILE_PATH=%{_exec_prefix}
   %{__make} all
 
 #  cd ${build_top}
diff --git a/source-builder/config/microwindows-1.cfg b/source-builder/config/microwindows-1.cfg
index 6ec3f30..0aef8c1 100644
--- a/source-builder/config/microwindows-1.cfg
+++ b/source-builder/config/microwindows-1.cfg
@@ -43,9 +43,8 @@ URL:       http://www.microwindows.org/
   cd ${build_dir}/src
   cp -r ${build_top}/${source_dir_microwindows}/src/* .
 
-  #%{host_build_flags}
-
-  export RTEMS_MAKEFILE_PATH=%{rtems_bsp_prefix}
+  %{host_build_flags}
+  %{rtems_makefile_inc}
 
   %{__make} -f Makefile.rtems CONFIG=`pwd`/Configs/config.rtems -k all
 
diff --git a/source-builder/config/nxlib-1.cfg b/source-builder/config/nxlib-1.cfg
index 32cbb62..d177aa4 100644
--- a/source-builder/config/nxlib-1.cfg
+++ b/source-builder/config/nxlib-1.cfg
@@ -43,7 +43,8 @@ URL:     http://www.microwindows.org/
   cd ${build_dir}
   cp -r ${build_top}/${source_dir_nxlib}/* .
 
-  export RTEMS_MAKEFILE_PATH=%{_exec_prefix}
+  %{host_build_flags}
+  %{rtems_makefile_inc}
 
   make -f Makefile.rtems
 
diff --git a/source-builder/defaults.mc b/source-builder/defaults.mc
index ce5d2b0..13c34cb 100644
--- a/source-builder/defaults.mc
+++ b/source-builder/defaults.mc
@@ -410,3 +410,10 @@ win_1253,win_1254,win_1255,win_1256,win_1257,win_1258'''
 # prefix as part of the path as just a path.
 #
 waf_build_root_suffix:   none,  none, ' %(echo %{_prefix} | cut -c 1-2)'
+
+# Makefile.inc support for staging
+rtems_makefile_inc:      none,  none, '''
+export RTEMS_ROOT=%{rtems_bsp_rtems_root}
+export PROJECT_RELEASE=%{rtems_bsp_prefix}
+export RTEMS_MAKEFILE_PATH=%{rtems_bsp_prefix}
+'''
diff --git a/source-builder/sb/setbuilder.py b/source-builder/sb/setbuilder.py
index d0a119f..425318b 100644
--- a/source-builder/sb/setbuilder.py
+++ b/source-builder/sb/setbuilder.py
@@ -575,9 +575,11 @@ class buildset:
                 staging_size = path.get_size(stagingroot)
                 if not self.opts.no_clean() or self.opts.always_clean():
                     log.notice('clean staging: %s' % (self.bset))
-                    log.trace('cleanup: %s' % (stagingroot))
-                    self.rmdir(stagingroot)
-                log.notice('Staging Size: %s' % (build.humanize_number(staging_size)))
+                    log.trace('removing: %s' % (stagingroot))
+                    if not self.opts.dry_run():
+                        if path.exists(stagingroot):
+                            path.removeall(stagingroot)
+                log.notice('Staging Size: %s' % (build.humanize_number(staging_size, 'B')))
         except error.general as gerr:
             if not build_error:
                 log.stderr(str(gerr))
-- 
2.19.1




More information about the devel mailing list