[rtems-release commit] release/kernel: Add waf build system support.

Chris Johns chrisj at rtems.org
Thu Nov 17 04:07:39 UTC 2022


Module:    rtems-release
Branch:    master
Commit:    93f05fb3a8dd2a2b2683bc4b1c1210d7bb2e81c6
Changeset: http://git.rtems.org/rtems-release/commit/?id=93f05fb3a8dd2a2b2683bc4b1c1210d7bb2e81c6

Author:    Chris Johns <chrisj at rtems.org>
Date:      Thu Nov 10 14:05:18 2022 +1100

release/kernel: Add waf build system support.

---

 rtems-release-4.10-conf |   1 +
 rtems-release-4.11-conf |   1 +
 rtems-release-5-conf    |  35 +++++++++++++++
 rtems-release-defaults  |   1 +
 rtems-release-kernel    | 110 ++++++++++++++++++++++++++++++------------------
 5 files changed, 107 insertions(+), 41 deletions(-)

diff --git a/rtems-release-4.10-conf b/rtems-release-4.10-conf
index 98a569f..1e29f78 100755
--- a/rtems-release-4.10-conf
+++ b/rtems-release-4.10-conf
@@ -32,6 +32,7 @@
 #
 # The script is the defaults for 4.10.
 #
+rtems_waf=no
 rtems_libbsd=no
 rtems_docs=no
 rtems_release_notes=no
diff --git a/rtems-release-4.11-conf b/rtems-release-4.11-conf
index a6e7efc..9fe957a 100755
--- a/rtems-release-4.11-conf
+++ b/rtems-release-4.11-conf
@@ -32,3 +32,4 @@
 #
 # The script is the overridded configuration for 4.11.
 #
+rtems_waf=no
diff --git a/rtems-release-5-conf b/rtems-release-5-conf
new file mode 100755
index 0000000..c42ad55
--- /dev/null
+++ b/rtems-release-5-conf
@@ -0,0 +1,35 @@
+#! /bin/sh
+#
+# RTEMS Tools Project (http://www.rtems.org/)
+# Copyright 2022 Chris Johns (chrisj at rtems.org)
+# All rights reserved.
+#
+# This file is part of the RTEMS Tools package in 'rtems-tools'.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# The script is the overridded configuration for 5.
+#
+rtems_waf=no
diff --git a/rtems-release-defaults b/rtems-release-defaults
index a975607..b453504 100755
--- a/rtems-release-defaults
+++ b/rtems-release-defaults
@@ -69,6 +69,7 @@ comp_tar=J
 #
 # Defaults.
 #
+rtems_waf=yes
 rtems_examples=yes
 rtems_libbsd=yes
 rtems_docs=yes
diff --git a/rtems-release-kernel b/rtems-release-kernel
index 188fc39..176fc55 100755
--- a/rtems-release-kernel
+++ b/rtems-release-kernel
@@ -62,26 +62,28 @@ echo "] RTEMS Release RTEMS Kernel, v${release}"
 echo "] Package: ${package}"
 echo "] Release: ${release}"
 
-#
-# Unpack the released RSB.
-#
-rsb=rtems-source-builder-${release}
-echo "tar ${comp_tar}xf ../${rsb}.tar.${comp_ext}"
-tar ${comp_tar}xf ../${rsb}.tar.${comp_ext}
-
-#
-# Build autoconf and automake.
-#
-cd ${rsb}/rtems
-../source-builder/sb-set-builder --without-release-url \
-				 --prefix=${top}/at ${version}/rtems-autotools
-cd ../..
-
-#
-# Set the path to the autotools.
-#
-export XPATH=$PATH
-export PATH=${top}/at/bin:$PATH
+if [ ${rtems_waf} = no ]; then
+ #
+ # Unpack the released RSB.
+ #
+ rsb=rtems-source-builder-${release}
+ echo "tar ${comp_tar}xf ../${rsb}.tar.${comp_ext}"
+ tar ${comp_tar}xf ../${rsb}.tar.${comp_ext}
+
+ #
+ # Build autoconf and automake.
+ #
+ cd ${rsb}/rtems
+ ../source-builder/sb-set-builder --without-release-url \
+ 				 --prefix=${top}/at ${version}/rtems-autotools
+ cd ../..
+
+ #
+ # Set the path to the autotools.
+ #
+ export XPATH=$PATH
+ export PATH=${top}/at/bin:$PATH
+fi
 
 #
 # Massage the version.revision string into major.minor.revision
@@ -95,31 +97,55 @@ fi
 release_ver_rel_minor="${release_ver_rel}.0"
 
 #
-# Bootstrap RTEMS, collect the BSPs, and update the README.
+# Handle the different build system
 #
 cd ${prefix}
- echo "] Set the version in the build system.."
- for f in $(find . -name version.m4)
- do
-  echo "] Generating ${f}"
-  cat <<EOF > ${f}
+ if [ ${rtems_waf} = yes ]; then
+  #
+  # Waf build system. Update RTEMS version and collect the BSPs
+  #
+  echo "] RTEMS Build System: waf"
+  f="spec/build/cpukit/optvermaj.yml"
+  echo "] Update ${f}"
+  sed -i "s/- get-string-command-line:.*/- get-string-command-line: '${version}'/" ${f}
+  f="spec/build/cpukit/optvermin.yml"
+  echo "] Update ${f}"
+  minor=$(echo ${revision} | sed 's/-.*//')
+  sed -i "s/- set-value:.*/- set-value: '${minor}'/" ${f}
+  f="spec/build/cpukit/optverrev.yml"
+  echo "] Update ${f}"
+  sed -i "s/- set-value:.*/- set-value: '0'/" ${f}
+ else
+  #
+  # Autoconf build system. Bootstrap RTEMS
+  #
+  echo "] RTEMS Build System: autoconf"
+  echo "] Set the version in the build system.."
+  for f in $(find . -name version.m4)
+  do
+   echo "] Generating ${f}"
+   cat <<EOF > ${f}
 dnl Autogenerated for RTEMS release: ${release} (${release_ver_rel_minor})
 AC_DEFUN([RTEMS_VERSIONING],
 m4_define([_RTEMS_VERSION],[${release_ver_rel_minor}]))
 dnl RTEMS API Version
 m4_define([_RTEMS_API],[${version}])
 EOF
- done
- echo "] Bootstrapping RTEMS"
-  ./bootstrap -c
- if [ ${version} -lt 5 ]; then
-  ./bootstrap -p
-  ${top}/${rsb}/source-builder/sb-bootstrap
- else
-  ./rtems-bootstrap
+  done
+  echo "] Bootstrapping RTEMS"
+   ./bootstrap -c
+  if [ ${version} -lt 5 ]; then
+   ./bootstrap -p
+   ${top}/${rsb}/source-builder/sb-bootstrap
+  else
+   ./rtems-bootstrap
+  fi
+  echo "] Cleaning autom4te.cache"
+  rm -rf $(find . -name autom4te.cache)
  fi
- echo "] Cleaning autom4te.cache"
- rm -rf $(find . -name autom4te.cache)
+ #
+ # Collect the BSPs, update the README.
+ #
  echo "] Generate ARCH-BSP.txt"
  ./rtems-bsps -m > ${toptop}/ARCH-BSP.md
  echo "] Generate README"
@@ -131,12 +157,14 @@ EOF
  rm -r README.tmp
  cd ..
 
-#
-# Clean up.
-#
-rm -rf ${rsb} ${at}
+if [ ${rtems_autoconf} = yes ]; then
+ #
+ # Clean up.
+ #
+ rm -rf ${rsb} ${at}
 
-echo "] Bootstrap complete."
+ echo "] Bootstrap complete."
+fi
 
 #
 # Only build doxygen output if present on the system.



More information about the vc mailing list