Fwd: [PATCH] Add SOEM support

Nicolas Tsiogkas lou.nick at gmail.com
Thu Jul 12 13:05:18 UTC 2018


From: Nikolaos Tsiogkas <niko at intermodalics.eu>

Adds support for EtherCAT SOEM to RTEMS 5. Requires rtems-libbsd.
---
 rtems/config/net/soem-master.cfg | 23 ++++++++++++++
 rtems/config/net/soem.bset       | 15 +++++++++
 source-builder/config/soem.cfg   | 69
++++++++++++++++++++++++++++++++++++++++
 3 files changed, 107 insertions(+)
 create mode 100644 rtems/config/net/soem-master.cfg
 create mode 100644 rtems/config/net/soem.bset
 create mode 100644 source-builder/config/soem.cfg

diff --git a/rtems/config/net/soem-master.cfg
b/rtems/config/net/soem-master.cfg
new file mode 100644
index 0000000..251311f
--- /dev/null
+++ b/rtems/config/net/soem-master.cfg
@@ -0,0 +1,23 @@
+#
+# SOEM
+#
+
+%if %{release} == %{nil}
+ %define release 1
+%endif
+
+%include %{_configdir}/rtems-bsp.cfg
+
+#
+# SOEM Version
+#
+
+#
+# Patch for RTEMS support.
+#
+
+#
+# SOEM Build configuration
+#
+
+%include %{_configdir}/soem.cfg
diff --git a/rtems/config/net/soem.bset b/rtems/config/net/soem.bset
new file mode 100644
index 0000000..aa947d2
--- /dev/null
+++ b/rtems/config/net/soem.bset
@@ -0,0 +1,15 @@
+#
+# Build set for EtherCAT SOEM
+#
+
+%define release 1
+
+#
+# The RTEMS Package defines
+#
+%include rtems-package.bset
+
+#
+# Build SOEM.
+#
+net/soem-master
diff --git a/source-builder/config/soem.cfg b/source-builder/config/soem.cfg
new file mode 100644
index 0000000..8d347a8
--- /dev/null
+++ b/source-builder/config/soem.cfg
@@ -0,0 +1,69 @@
+#
+# SOEM Version 1.
+#
+# This configuration file configures, makes and installs SOEM.
+#
+
+%if %{release} == %{nil}
+ %define release 1
+%endif
+
+Name:      soem-%{_host}-%{release}
+Summary:   SOEM is a Simple Open EtherCAT Master implementation.
+Version:   Master
+Release:   %{release}
+URL:      https://openethercatsociety.github.io/
+BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
+
+#
+# SOEM
+#
+%source set soem git://
github.com/OpenEtherCATsociety/SOEM.git?branch=master
+
+#
+# Prepare the source code.
+#
+%prep
+  build_top=$(pwd)
+
+  source_dir_soem="soem"
+  %source setup soem -q -n soem
+
+  cd ${build_top}
+
+%build
+  build_top=$(pwd)
+
+  %{build_directory}
+
+  mkdir -p ${build_dir}
+  cd ${build_dir}
+
+  %{host_build_flags}
+
+  cmake \
+    -DRTEMS_TOOLS_PATH=%{with_tools} \
+    -DCMAKE_INSTALL_PREFIX=%{_libdir} \
+    -DCMAKE_SYSTEM_NAME=rtems \
+    -DHOST=%{_host} \
+    -DRTEMS_BSP=%{rtems_bsp} \
+    -DINCLUDE_DIR=%{_includedir} \
+    -DLIB_DIR=%{_libdir} \
+    -DHOST_C_FLAGS=%{host_cflags} \
+    -DHOST_CXX_FLAGS=%{host_cxxflags} \
+    -DHOST_LIBS=%{host_libs} \
+    ../${source_dir_soem}
+
+  # SOEM does not build on sync.rtems.org with jobs
+  %{__make} %{?_smp_mflags} all
+
+  cd ${build_top}
+
+%install
+  build_top=$(pwd)
+
+  %{__rmdir} $SB_BUILD_ROOT
+
+  cd ${build_dir}
+  %{__make} DESTDIR=$SB_BUILD_ROOT install
+  cd ${build_top}
-- 
2.7.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20180712/772c7493/attachment.html>


More information about the devel mailing list