diff options
-rw-r--r-- | MAINTAINERS | 1 | ||||
-rw-r--r-- | conf/checksums.ini | 8 | ||||
-rw-r--r-- | packages/forte/forte-0.3.5/forte-0.3.5_socket_reuse.patch | 20 | ||||
-rw-r--r-- | packages/forte/forte-0.3.5/forte-0.3.5_stdlib_inc_fix.patch | 22 | ||||
-rw-r--r-- | packages/forte/forte-0.3.5/forte-0.3.5_timer.patch | 48 | ||||
-rw-r--r-- | packages/forte/forte-0.3/forte-0.3-patch_20081008.diff | 109 | ||||
-rw-r--r-- | packages/forte/forte.inc | 15 | ||||
-rw-r--r-- | packages/forte/forte_0.3.5.bb | 10 | ||||
-rw-r--r-- | packages/forte/forte_0.3.bb | 10 |
9 files changed, 243 insertions, 0 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 2a0cd1e6e4..211e40c992 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -246,6 +246,7 @@ Recipes: directfb, php Person: Steffen Sledz Mail: sledz@dresearch.de Machines: oxnas +Recipes: forte Person: Stelios Koroneos Mail: skoroneos@digital-opsis.com diff --git a/conf/checksums.ini b/conf/checksums.ini index ebd6a6e8f5..d578009978 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -258,6 +258,10 @@ sha256=1f8504c7f08d2d59c71a70915fc834a285b99587444ee33e23ee3f135c071da0 md5=a8cf945d09c6458cb27228218e9a2f45 sha256=8416e162d6fc921f14a61c8905e9f9a28dc25e67e1c71b75574360a13f0c28c7 +[http://downloads.sourceforge.net/fordiac/FORTE-0.3.5.zip] +md5=d207d3b389ee9f2702df095681459f99 +sha256=2b87b331e931db2db07408c1b07bdb557227e0c16f8fe37f72e40b08fca0a09c + [http://downloads.sourceforge.net/fnorb/Fnorb-1.3.tar.gz] md5=7de1500c7ef6592a603890b45e23261b sha256=d4380ab7fa8b8a9f564592b4e07c96117abd2d3f677b8a73c824cf4f904aa294 @@ -5986,6 +5990,10 @@ sha256=3feaaab499b3f9c7e9b8bdc725dd40fde65b2fbb73794845d7f682746470f594 md5=89b65e010acaa3c5d370e1cc0ea9fce9 sha256=77fb4d23dfa8c12d69ccfda71f482af9804132fab800610970cd5fe9944a3016 +[http://kent.dl.sourceforge.net/sourceforge/fordiac/forte-0.3.zip] +md5=2d01a3d3b9b16bf646e6bb89cb9b0faf +sha256=c3a61174f6a69252983a9b26ea87005bcab6a72b0bd34ea693e3de89e70eaea6 + [ftp://ftp.debian.org/debian/pool/main/f/fortune-mod/fortune-mod_1.99.1-2.diff.gz] md5=5f059f7c997adbc0a260f27947605be1 sha256=d68c7c8ff6fe94341a3a73d22ab976da42921e3bec9bed628a428518c2c5f67a diff --git a/packages/forte/forte-0.3.5/forte-0.3.5_socket_reuse.patch b/packages/forte/forte-0.3.5/forte-0.3.5_socket_reuse.patch new file mode 100644 index 0000000000..a3dcd10917 --- /dev/null +++ b/packages/forte/forte-0.3.5/forte-0.3.5_socket_reuse.patch @@ -0,0 +1,20 @@ +diff -Naur FORTE-0.3.5.orig/src/arch/pc/pcsochan.cpp FORTE-0.3.5/src/arch/pc/pcsochan.cpp +--- FORTE-0.3.5.orig/src/arch/pc/pcsochan.cpp 2009-01-13 16:17:18.000000000 +0000 ++++ FORTE-0.3.5/src/arch/pc/pcsochan.cpp 2009-02-16 10:08:53.000000000 +0000 +@@ -128,6 +128,16 @@ + }
+ // switch between client/server:
+ if (pa_stConnectionInformation.m_enServiceType == e_Server) {
++ unsigned int opt = 1;
++
++ if (setsockopt(sock_id, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) != 0)
++ {
++ char acError[80] = { "TCP-Socket setsockopt() failed: " };
++ strcat(acError, strerror(errno));
++ DEVLOG_ERROR(cg_nID_CSocketHandler, 0x10, acError);
++ return -1;
++ }
++
+ sock_addr.sin_addr.s_addr = htonl(INADDR_ANY);
+ if (bind(sock_id, (struct sockaddr *)&sock_addr, sizeof(struct sockaddr)) != 0) {
+ DEVLOG_ERROR_2(cg_nID_CSocketHandler, 0x02, "TCP-Socket bind() failed: %s", strerror(errno) );
diff --git a/packages/forte/forte-0.3.5/forte-0.3.5_stdlib_inc_fix.patch b/packages/forte/forte-0.3.5/forte-0.3.5_stdlib_inc_fix.patch new file mode 100644 index 0000000000..3ebd47325a --- /dev/null +++ b/packages/forte/forte-0.3.5/forte-0.3.5_stdlib_inc_fix.patch @@ -0,0 +1,22 @@ +diff -Naur FORTE-0.3.5.orig/src/core/datatypes/forte_lreal.cpp FORTE-0.3.5/src/core/datatypes/forte_lreal.cpp +--- FORTE-0.3.5.orig/src/core/datatypes/forte_lreal.cpp 2008-12-11 16:05:26.000000000 +0000 ++++ FORTE-0.3.5/src/core/datatypes/forte_lreal.cpp 2009-02-16 11:01:44.000000000 +0000 +@@ -8,6 +8,7 @@ + * Contributors:
+ * <date>: <author>, <author email> - changes
+ *******************************************************************************/
++#include <stdlib.h>
+ #include <math.h>
+ #include "forte_lreal.h"
+
+diff -Naur FORTE-0.3.5.orig/src/core/datatypes/forte_real.cpp FORTE-0.3.5/src/core/datatypes/forte_real.cpp +--- FORTE-0.3.5.orig/src/core/datatypes/forte_real.cpp 2008-12-11 16:05:40.000000000 +0000 ++++ FORTE-0.3.5/src/core/datatypes/forte_real.cpp 2009-02-16 11:12:16.000000000 +0000 +@@ -8,6 +8,7 @@ + * Contributors:
+ * <date>: <author>, <author email> - changes
+ *******************************************************************************/
++#include <stdlib.h>
+ #include <math.h>
+ #include "forte_real.h"
+
diff --git a/packages/forte/forte-0.3.5/forte-0.3.5_timer.patch b/packages/forte/forte-0.3.5/forte-0.3.5_timer.patch new file mode 100644 index 0000000000..2064cda581 --- /dev/null +++ b/packages/forte/forte-0.3.5/forte-0.3.5_timer.patch @@ -0,0 +1,48 @@ +diff -Naur FORTE-0.3.5.orig/src/arch/pc/pctimeha.cpp FORTE-0.3.5/src/arch/pc/pctimeha.cpp +--- FORTE-0.3.5.orig/src/arch/pc/pctimeha.cpp 2009-01-13 16:17:18.000000000 +0000 ++++ FORTE-0.3.5/src/arch/pc/pctimeha.cpp 2009-02-16 10:16:37.000000000 +0000 +@@ -11,6 +11,7 @@ + #include "pctimeha.h"
+ #include "../../core/devexec.h"
+ #include <time.h>
++#include <sys/time.h>
+
+ const TINT32 CPCTimerHandler::csm_nTicksPerSecond = 1000;
+
+@@ -28,14 +29,34 @@ + disableHandler();
+ }
+
++static inline unsigned long long GetTicks(struct timeval* stTmVal, TINT32 ticksPerSecond)
++{
++ unsigned long long ret = stTmVal->tv_sec * 1000LL;// sec -> ms
++ ret += stTmVal->tv_usec/1000;// + us -> ms
++ ret /= 1000/ticksPerSecond; // ms -> ticks
++ return ret;
++}
++
+ bool CPCTimerHandler::run(){
+ struct timespec stReq;
++ struct timeval stTmNow;
++ unsigned long long tickStart;
++ unsigned long long tickNow;
++ unsigned long long tickCalled = 0;
+ stReq.tv_sec = 0;
+- stReq.tv_nsec = 1000000 / (csm_nTicksPerSecond / 1000);
++ stReq.tv_nsec = 1000000000 / (csm_nTicksPerSecond);
++
++ gettimeofday(&stTmNow, NULL);
++ tickNow = tickStart = GetTicks(&stTmNow, csm_nTicksPerSecond);
+
+ while(m_bAlive){
+- nanosleep(&stReq, NULL);
++ if( (tickNow-tickStart) <= (tickCalled+1) ) {
++ nanosleep(&stReq, NULL);
++ }
+ nextTick();
++ ++tickCalled;
++ gettimeofday(&stTmNow, NULL);
++ tickNow = GetTicks(&stTmNow, csm_nTicksPerSecond);
+ }
+ return true;
+ }
diff --git a/packages/forte/forte-0.3/forte-0.3-patch_20081008.diff b/packages/forte/forte-0.3/forte-0.3-patch_20081008.diff new file mode 100644 index 0000000000..8478e5f531 --- /dev/null +++ b/packages/forte/forte-0.3/forte-0.3-patch_20081008.diff @@ -0,0 +1,109 @@ +diff -Naur forte-0.3.orig/src/arch/netos/txsocha.cpp forte-0.3/src/arch/netos/txsocha.cpp +--- forte-0.3.orig/src/arch/netos/txsocha.cpp 2008-07-10 07:33:44.000000000 +0000 ++++ forte-0.3/src/arch/netos/txsocha.cpp 2008-09-24 13:29:32.000000000 +0000 +@@ -167,7 +167,7 @@ + strcpy(ip, pa_stConnectionInformation.m_pcConnectionID);
+ sock_addr.sin_family = AF_INET;
+ sock_addr.sin_port = htons(atoi(splitString(ip)));
+- memset(&(sock_addr.sin_zero), '\0', 8);
++ memset(&(sock_addr.sin_zero), '\0', sizeof(sock_addr.sin_zero));
+ fprintf(stderr,"CTXSocketHandler:: Opening TCP-Connection at IP: %s\n",pa_stConnectionInformation.m_pcConnectionID);
+
+ if ((sock_id = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
+diff -Naur forte-0.3.orig/src/arch/pc/pcsochan.cpp forte-0.3/src/arch/pc/pcsochan.cpp +--- forte-0.3.orig/src/arch/pc/pcsochan.cpp 2008-07-10 07:33:44.000000000 +0000 ++++ forte-0.3/src/arch/pc/pcsochan.cpp 2008-09-30 10:23:36.000000000 +0000 +@@ -116,9 +116,9 @@ + strcpy(ip, pa_stConnectionInformation.m_pcConnectionID);
+ sock_addr.sin_family = AF_INET;
+ sock_addr.sin_port = htons(atoi(splitString(ip)));
+- memset(&(sock_addr.sin_zero), '\0', 8);
++ memset(&(sock_addr.sin_zero), '\0', sizeof(sock_addr.sin_zero));
+
+- char acInfo[64] = { "CPCSocketHandler:: Opening TCP-Connection at IP: " };
++ char acInfo[128] = { "CPCSocketHandler:: Opening TCP-Connection at IP: " };
+ strcat(acInfo, pa_stConnectionInformation.m_pcConnectionID);
+ DEVLOG_INFO(cg_nID_CSocketHandler, 0x10, acInfo);
+
+@@ -130,6 +130,16 @@ + }
+ // switch between client/server:
+ if (pa_stConnectionInformation.m_enServiceType == e_Server) {
++ unsigned int opt = 1;
++
++ if (setsockopt(sock_id, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) != 0)
++ {
++ char acError[80] = { "TCP-Socket setsockopt() failed: " };
++ strcat(acError, strerror(errno));
++ DEVLOG_ERROR(cg_nID_CSocketHandler, 0x10, acError);
++ return -1;
++ }
++
+ sock_addr.sin_addr.s_addr = htonl(INADDR_ANY);
+ if (bind(sock_id, (struct sockaddr *)&sock_addr, sizeof(struct sockaddr))
+ != 0) {
+@@ -191,8 +201,15 @@ + int CPCSocketHandler::receiveDataOnTCP(SSocketHandlerListEntry &pa_stData) {
+ DEVLOG_INFO(cg_nID_CSocketHandler, 0x10, "CPCSocketHandler:: Entering ReceiveDataOnTCP\n");
+
++ int sock_id;
++
++ if (pa_stData.m_bAcceptedConnection)
++ sock_id = pa_stData.m_nAcceptID;
++ else
++ sock_id = pa_stData.m_nSocketID;
++
+ receveagain: pa_stData.m_stConnectionInformation.m_pstRecvBuffer->m_nFilledSize
+- =recv(pa_stData.m_nAcceptID, pa_stData.m_stConnectionInformation.m_pstRecvBuffer->m_pcData, pa_stData.m_stConnectionInformation.m_pstRecvBuffer->m_nMaxSize, 0);
++ =recv(sock_id, pa_stData.m_stConnectionInformation.m_pstRecvBuffer->m_pcData, pa_stData.m_stConnectionInformation.m_pstRecvBuffer->m_nMaxSize, 0);
+
+ if (pa_stData.m_stConnectionInformation.m_pstRecvBuffer->m_nFilledSize == -1) {
+ if (errno == EINTR) {
+diff -Naur forte-0.3.orig/src/arch/pc/pctimeha.cpp forte-0.3/src/arch/pc/pctimeha.cpp +--- forte-0.3.orig/src/arch/pc/pctimeha.cpp 2008-04-22 13:31:52.000000000 +0000 ++++ forte-0.3/src/arch/pc/pctimeha.cpp 2008-10-08 12:27:09.000000000 +0000 +@@ -11,6 +11,7 @@ + #include "pctimeha.h"
+ #include "../../core/devexec.h"
+ #include <time.h>
++#include <sys/time.h>
+
+ const TINT32 CPCTimerHandler::csm_nTicksPerSecond = 1000;
+
+@@ -28,14 +29,34 @@ + disableHandler();
+ }
+
++static inline unsigned long long GetTicks(struct timeval* stTmVal, TINT32 ticksPerSecond)
++{
++ unsigned long long ret = stTmVal->tv_sec * 1000LL;// sec -> ms
++ ret += stTmVal->tv_usec/1000;// + us -> ms
++ ret /= 1000/ticksPerSecond; // ms -> ticks
++ return ret;
++}
++
+ bool CPCTimerHandler::run(){
+ struct timespec stReq;
++ struct timeval stTmNow;
++ unsigned long long tickStart;
++ unsigned long long tickNow;
++ unsigned long long tickCalled = 0;
+ stReq.tv_sec = 0;
+- stReq.tv_nsec = 1000000 / (csm_nTicksPerSecond / 1000);
++ stReq.tv_nsec = 1000000000 / (csm_nTicksPerSecond);
++
++ gettimeofday(&stTmNow, NULL);
++ tickNow = tickStart = GetTicks(&stTmNow, csm_nTicksPerSecond);
+
+ while(m_bAlive){
+- nanosleep(&stReq, NULL);
++ if( (tickNow-tickStart) <= (tickCalled+1) ) {
++ nanosleep(&stReq, NULL);
++ }
+ nextTick();
++ ++tickCalled;
++ gettimeofday(&stTmNow, NULL);
++ tickNow = GetTicks(&stTmNow, csm_nTicksPerSecond);
+ }
+ return true;
+ }
diff --git a/packages/forte/forte.inc b/packages/forte/forte.inc new file mode 100644 index 0000000000..fa97055729 --- /dev/null +++ b/packages/forte/forte.inc @@ -0,0 +1,15 @@ +DESCRIPTION = "4DIAC-RTE (FORTE) is a small portable implementation of an IEC 61499 runtime environment" +HOMEPAGE = "http://www.fordiac.org/8.0.html" +SECTION = "console/network" +DEPENDS = "" +RDEPENDS = "" +LICENSE = "EPL" + +inherit autotools + +EXTRA_OEMAKE = 'LIBS+="-lpthread" CXXFLAGS+="-O0 -g" CPPFLAGS+="-DLOGDEBUG -I${S}/src/core -I${S}/src/core/datatypes -I${S}/src/fblib/events -I${S}/src/fblib/ita -I${S}/src/fblib/math -I${S}/src/fblib/net"' + +do_configure_prepend() { + chmod +x ${S}/configure + ln -s -f ${S}/src/arch/pc ${S}/src/arch/active_arch +} diff --git a/packages/forte/forte_0.3.5.bb b/packages/forte/forte_0.3.5.bb new file mode 100644 index 0000000000..7aeeb8e42e --- /dev/null +++ b/packages/forte/forte_0.3.5.bb @@ -0,0 +1,10 @@ +require forte.inc + +PR = "r0" + +SRC_URI = "http://downloads.sourceforge.net/fordiac/FORTE-0.3.5.zip \ + file://forte-0.3.5_socket_reuse.patch;patch=1 \ + file://forte-0.3.5_timer.patch;patch=1 \ + file://forte-0.3.5_stdlib_inc_fix.patch;patch=1" + +S="${WORKDIR}/FORTE-${PV}" diff --git a/packages/forte/forte_0.3.bb b/packages/forte/forte_0.3.bb new file mode 100644 index 0000000000..c434fb39b8 --- /dev/null +++ b/packages/forte/forte_0.3.bb @@ -0,0 +1,10 @@ +require forte.inc + +PR = "r0" + +DEFAULT_PREFERENCE_oxnas = "1" + +SRC_URI = "http://kent.dl.sourceforge.net/sourceforge/fordiac/forte-0.3.zip \ + file://forte-0.3-patch_20081008.diff;patch=1" + +S="${WORKDIR}/forte-${PV}" |