Newer
Older
minerva / Ports / boost / patches / 0001-Add-platform-support-for-Minerva.patch
@minerva minerva on 13 Jul 5 KB Initial commit
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner <gunnar@beutner.name>
Date: Sun, 23 Oct 2022 10:04:53 +0200
Subject: [PATCH] Add platform support for Minerva

---
 .../config/detail/select_platform_config.hpp  |  5 ++++
 .../boost/config/platform/minerva.hpp        | 26 +++++++++++++++++++
 tools/build/src/tools/features/os-feature.jam |  4 +--
 tools/build/src/tools/gcc.jam                 |  4 ++-
 tools/build/src/tools/python.jam              |  1 +
 5 files changed, 37 insertions(+), 3 deletions(-)
 create mode 100644 libs/config/include/boost/config/platform/minerva.hpp

diff --git a/libs/config/include/boost/config/detail/select_platform_config.hpp b/libs/config/include/boost/config/detail/select_platform_config.hpp
index dbff74aaf74ea59eaf204f463bf2b37df9c432a5..3b664107303df336bab8010caad42ddaed24550e 100644
--- a/libs/config/include/boost/config/detail/select_platform_config.hpp
+++ b/libs/config/include/boost/config/detail/select_platform_config.hpp
@@ -93,6 +93,10 @@
 // Web assembly:
 #  define BOOST_PLATFORM_CONFIG "boost/config/platform/wasm.hpp"
 
+#elif defined (__minerva__)
+// Minerva:
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/minerva.hpp"
+
 #else
 
 #  if defined(unix) \
@@ -139,6 +143,7 @@
 #  include "boost/config/platform/symbian.hpp" 
 #  include "boost/config/platform/cray.hpp" 
 #  include "boost/config/platform/vms.hpp" 
+#  include "boost/config/platform/minerva.hpp"
 #  include <boost/config/detail/posix_features.hpp>
 
 
diff --git a/libs/config/include/boost/config/platform/minerva.hpp b/libs/config/include/boost/config/platform/minerva.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..89d09ca6b01626691ed2c45184bd8d322973df49
--- /dev/null
+++ b/libs/config/include/boost/config/platform/minerva.hpp
@@ -0,0 +1,26 @@
+//  (C) Copyright 2022 Gunnar Beutner
+//  Use, modification and distribution are subject to the
+//  Boost Software License, Version 1.0. (See accompanying file
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//  See http://www.boost.org for most recent version.
+
+//  Minerva specific config options:
+
+#define BOOST_PLATFORM "Minerva"
+
+#define BOOST_HAS_UNISTD_H
+#define BOOST_HAS_STDINT_H
+
+#ifndef BOOST_DISABLE_THREADS
+#  define BOOST_HAS_THREADS
+#endif
+
+//
+// thread API's not auto detected:
+//
+#define BOOST_HAS_SCHED_YIELD
+#define BOOST_HAS_GETTIMEOFDAY
+
+// boilerplate code:
+#include <boost/config/detail/posix_features.hpp>
diff --git a/tools/build/src/tools/features/os-feature.jam b/tools/build/src/tools/features/os-feature.jam
index ced1fc1ff803383138e755efebef95983b85e0bd..5e0fc3998b86313a873a0549c95394e7723a9713 100644
--- a/tools/build/src/tools/features/os-feature.jam
+++ b/tools/build/src/tools/features/os-feature.jam
@@ -10,7 +10,7 @@ import os ;
 .os-names =
     aix android appletv bsd cygwin darwin freebsd haiku hpux iphone linux
     netbsd openbsd osf qnx qnxnto sgi solaris unix unixware windows vms vxworks
-    freertos
+    freertos minerva
 
     # Not actually an OS -- used for targeting bare metal where object
     # format is ELF.  This catches both -elf and -eabi gcc targets as well
@@ -79,7 +79,7 @@ feature.set-default host-os : [ default-host-os ] ;
 *Allowed values:* `aix`, `android`, `appletv`, `bsd`, `cygwin`, `darwin`,
 `freebsd`, `haiku`, `hpux`, `iphone`, `linux`, `netbsd`, `openbsd`, `osf`,
 `qnx`, `qnxnto`, `sgi`, `solaris`, `unix`, `unixware`, `windows`, `vms`,
-`vxworks`, `freertos`.
+`vxworks`, `freertos`, `minerva`.
 +
 Specifies the operating system for which the code is to be generated. The
 compiler you used should be the compiler for that operating system. This option
diff --git a/tools/build/src/tools/gcc.jam b/tools/build/src/tools/gcc.jam
index 834f5e1bf6ddb080127a9e17e566571a39b8fef3..9e18425d018866a0590e5205258ba4b2b099f6ec 100644
--- a/tools/build/src/tools/gcc.jam
+++ b/tools/build/src/tools/gcc.jam
@@ -203,6 +203,7 @@ rule init ( version ? : command * : options * : requirement * )
             case *mingw*  : target-os ?= windows ;
             case *cygwin* : target-os ?= cygwin ;
             case *linux*  : target-os ?= linux ;
+            case *minerva*  : target-os ?= minerva ;
             # TODO: finish this list.
         }
     }
@@ -391,6 +392,7 @@ local rule compile-link-flags ( * )
     threading-flags <target-os>cygwin/<threadapi>pthread : -pthread ;
     threading-flags <target-os>solaris  : -pthreads : rt ;
     threading-flags <target-os>qnx : -pthread ;
+    threading-flags <target-os>minerva ;
 
     local bsd = [ MATCH ^(.*bsd)$ : $(all-os) ] ;
     threading-flags <target-os>$(bsd) : -pthread ;
@@ -398,7 +400,7 @@ local rule compile-link-flags ( * )
     # iOS doesn't need pthread flag according to the https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/pthread.3.html
     # The default system libraries include pthread functions.  No additional libraries or CFLAGS are necessary to use this API.
     local no-threading = android beos haiku sgi darwin vxworks iphone appletv ;
-    local threading-generic-os = [ set.difference $(all-os) : $(no-threading) $(bsd) windows cygwin solaris qnx ] ;
+    local threading-generic-os = [ set.difference $(all-os) : $(no-threading) $(bsd) windows cygwin solaris qnx minerva ] ;
     threading-flags <target-os>$(threading-generic-os) : -pthread : rt ;
 }
 
diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam
index 0dfc750a220b82ad47d67d3f28bf5bdaf2fb2455..b0f6c2c6c29d03c1f86ff650158a4b04b1e0822c 100644
--- a/tools/build/src/tools/python.jam
+++ b/tools/build/src/tools/python.jam
@@ -654,6 +654,7 @@ local rule system-library-dependencies ( target-os )
         case darwin : return ;
         case windows : return ;
         case haiku : return ;
+        case minerva : return ;
 
         case hpux : return  <library>rt ;
         case *bsd : return  <library>pthread <toolset>gcc:<library>util ;