-From 4e8aa3a9e1696e5e02ff0a3ae5a72f034ee60c2f Mon Sep 17 00:00:00 2001
+From 16230b7f51bff2bdf061fa80e9a49c807596bb92 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Wed, 25 May 2016 15:57:10 +0200
Subject: [PATCH] install the stack libraries to "lib" subdirectory
11 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/stack/proj/linux/liboplkcn-sim/CMakeLists.txt b/stack/proj/linux/liboplkcn-sim/CMakeLists.txt
-index 73b641d..b8b5c9d 100644
+index 2b3da16..ddb3e92 100644
--- a/stack/proj/linux/liboplkcn-sim/CMakeLists.txt
+++ b/stack/proj/linux/liboplkcn-sim/CMakeLists.txt
@@ -96,4 +96,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
-INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .)
+INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
diff --git a/stack/proj/linux/liboplkcn/CMakeLists.txt b/stack/proj/linux/liboplkcn/CMakeLists.txt
-index 323eafc..459124a 100644
+index 3be6c52..cf1b1dd 100644
--- a/stack/proj/linux/liboplkcn/CMakeLists.txt
+++ b/stack/proj/linux/liboplkcn/CMakeLists.txt
@@ -90,4 +90,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
-INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .)
+INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
diff --git a/stack/proj/linux/liboplkcnapp-kernelintf/CMakeLists.txt b/stack/proj/linux/liboplkcnapp-kernelintf/CMakeLists.txt
-index f8b1850..c16194a 100644
+index 904de6c..d8713a8 100644
--- a/stack/proj/linux/liboplkcnapp-kernelintf/CMakeLists.txt
+++ b/stack/proj/linux/liboplkcnapp-kernelintf/CMakeLists.txt
@@ -83,4 +83,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
-INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .)
+INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
diff --git a/stack/proj/linux/liboplkcnapp-userintf/CMakeLists.txt b/stack/proj/linux/liboplkcnapp-userintf/CMakeLists.txt
-index 0f07e63..0074616 100644
+index e2514cf..a4e2b75 100644
--- a/stack/proj/linux/liboplkcnapp-userintf/CMakeLists.txt
+++ b/stack/proj/linux/liboplkcnapp-userintf/CMakeLists.txt
@@ -83,4 +83,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
-INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .)
+INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
diff --git a/stack/proj/linux/liboplkcndrv-pcap/CMakeLists.txt b/stack/proj/linux/liboplkcndrv-pcap/CMakeLists.txt
-index d0dad78..ee0fdec 100644
+index 98f068c..bb20006 100644
--- a/stack/proj/linux/liboplkcndrv-pcap/CMakeLists.txt
+++ b/stack/proj/linux/liboplkcndrv-pcap/CMakeLists.txt
@@ -76,4 +76,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
-INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .)
+INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
diff --git a/stack/proj/linux/liboplkmndrv-pcap/CMakeLists.txt b/stack/proj/linux/liboplkmndrv-pcap/CMakeLists.txt
-index 7e1a820..82205c2 100644
+index 0c29087..1783134 100644
--- a/stack/proj/linux/liboplkmndrv-pcap/CMakeLists.txt
+++ b/stack/proj/linux/liboplkmndrv-pcap/CMakeLists.txt
@@ -79,4 +79,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
-INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .)
+INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
--
-2.8.1
+2.9.4
-From 8cb39257e12d6b82190aec8ab9ad89a9ee13af71 Mon Sep 17 00:00:00 2001
+From f7679a4083de3a9dba80cd719ad4904fbade349b Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Wed, 25 May 2016 15:57:29 +0200
Subject: [PATCH] cmake: install oplk headers files
1 file changed, 5 insertions(+)
diff --git a/stack/CMakeLists.txt b/stack/CMakeLists.txt
-index 3b11c54..4eadf44 100644
+index 69454f2..45f131d 100644
--- a/stack/CMakeLists.txt
+++ b/stack/CMakeLists.txt
-@@ -105,3 +105,8 @@ ELSEIF((CMAKE_SYSTEM_NAME STREQUAL "Generic") AND (CMAKE_SYSTEM_PROCESSOR STREQU
+@@ -110,3 +110,8 @@ ELSEIF((CMAKE_SYSTEM_NAME STREQUAL "Generic") AND (CMAKE_SYSTEM_PROCESSOR STREQU
ELSE()
MESSAGE(FATAL_ERROR "Unknown Platform and processor combination ${CMAKE_SYSTEM_NAME} and ${CMAKE_SYSTEM_PROCESSOR}!!")
ENDIF()
+################################################################################
+INSTALL(DIRECTORY ${STACK_INCLUDE_DIR}/oplk DESTINATION "include")
--
-2.8.1
+2.9.4
-From 7f81c74726aec4aef6bd93ee644200ab34375437 Mon Sep 17 00:00:00 2001
+From cd0945a323cecb638ce56f2e3d7fb4e8c004b98b Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Wed, 25 May 2016 15:59:20 +0200
Subject: [PATCH] Add top level CMakeLists.txt
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} optimized ${OPLKLIB})
ENDIF()
diff --git a/drivers/linux/drv_daemon_pcap/CMakeLists.txt b/drivers/linux/drv_daemon_pcap/CMakeLists.txt
-index 1ef9353..e720834 100644
+index 2b4a2c1..ecceb4c 100644
--- a/drivers/linux/drv_daemon_pcap/CMakeLists.txt
+++ b/drivers/linux/drv_daemon_pcap/CMakeLists.txt
-@@ -104,9 +104,15 @@ ENDIF()
+@@ -109,9 +109,15 @@ ENDIF()
SET(OPLKLIB_DIR ${OPLK_BASE_DIR}/stack/lib/${SYSTEM_NAME_DIR}/${SYSTEM_PROCESSOR_DIR})
SET(OPLKLIB_INCDIR ${OPLK_BASE_DIR}/stack/proj/${SYSTEM_NAME_DIR}/lib${LIB_NAME})
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -std=c99 -pthread -fno-strict-aliasing")
--
-2.8.1
+2.9.4
+++ /dev/null
-From d05273e65657d82e44fb7bd91a8fba0ba990ff2c Mon Sep 17 00:00:00 2001
-From: Romain Naour <romain.naour@gmail.com>
-Date: Sat, 27 May 2017 23:51:41 +0200
-Subject: [PATCH] [FIX] use contrib getopt() only on Windows
-
-Otherwise, contrib getopt will clash with the one from the libc when
-building statically.
-
-lib64/libc.a(getopt.os):(.data+0x8): multiple definition of `optind'
-CMakeFiles/demo_mn_console.dir/__/__/contrib/getopt/getopt.c.o:(.data+0x8): first defined here
-lib64/libc.a(getopt.os):(.data+0x4): multiple definition of `opterr'
-CMakeFiles/demo_mn_console.dir/__/__/contrib/getopt/getopt.c.o:(.data+0xc): first defined here
-/lib64/libc.a(getopt.os): In function `__GI_getopt':
-getopt.c:(.text+0x76e): multiple definition of `getopt'
-
-Signed-off-by: Romain Naour <romain.naour@gmail.com>
----
- apps/demo_cn_console/CMakeLists.txt | 2 +-
- apps/demo_cn_console/src/main.c | 6 ++++++
- apps/demo_mn_console/CMakeLists.txt | 2 +-
- apps/demo_mn_console/src/main.c | 6 ++++++
- 4 files changed, 14 insertions(+), 2 deletions(-)
-
-diff --git a/apps/demo_cn_console/CMakeLists.txt b/apps/demo_cn_console/CMakeLists.txt
-index a3a80bb..5733213 100644
---- a/apps/demo_cn_console/CMakeLists.txt
-+++ b/apps/demo_cn_console/CMakeLists.txt
-@@ -61,7 +61,6 @@ SET(DEMO_SOURCES
- ${COMMON_SOURCE_DIR}/eventlog/eventlog.c
- ${COMMON_SOURCE_DIR}/eventlog/eventlogstring.c
- ${CONTRIB_SOURCE_DIR}/console/printlog.c
-- ${CONTRIB_SOURCE_DIR}/getopt/getopt.c
- )
-
- INCLUDE_DIRECTORIES(
-@@ -114,6 +113,7 @@ ENDIF (CFG_KERNEL_STACK_DIRECTLINK)
- IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- include(linux.cmake)
- ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
-+ SET(DEMO_SOURCES ${DEMO_SOURCES} ${CONTRIB_SOURCE_DIR}/getopt/getopt.c)
- include (windows.cmake)
- ELSE()
- MESSAGE(FATAL_ERROR "System ${CMAKE_SYSTEM_NAME} is not supported!")
-diff --git a/apps/demo_cn_console/src/main.c b/apps/demo_cn_console/src/main.c
-index c630586..9406473 100644
---- a/apps/demo_cn_console/src/main.c
-+++ b/apps/demo_cn_console/src/main.c
-@@ -50,7 +50,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- #include <system/system.h>
- #include <obdcreate/obdcreate.h>
-+
-+#if (TARGET_SYSTEM == _WIN32_)
- #include <getopt/getopt.h>
-+#else
-+#include <unistd.h>
-+#endif
-+
- #include <console/console.h>
- #include <eventlog/eventlog.h>
-
-diff --git a/apps/demo_mn_console/CMakeLists.txt b/apps/demo_mn_console/CMakeLists.txt
-index 9c3378c..a81c4b3 100644
---- a/apps/demo_mn_console/CMakeLists.txt
-+++ b/apps/demo_mn_console/CMakeLists.txt
-@@ -67,7 +67,6 @@ SET(DEMO_SOURCES
- ${COMMON_SOURCE_DIR}/eventlog/eventlog.c
- ${COMMON_SOURCE_DIR}/eventlog/eventlogstring.c
- ${CONTRIB_SOURCE_DIR}/console/printlog.c
-- ${CONTRIB_SOURCE_DIR}/getopt/getopt.c
- )
-
- INCLUDE_DIRECTORIES(
-@@ -129,6 +128,7 @@ ENDIF()
- IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- include(linux.cmake)
- ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
-+ SET(DEMO_SOURCES ${DEMO_SOURCES} ${CONTRIB_SOURCE_DIR}/getopt/getopt.c)
- include (windows.cmake)
- ELSE()
- MESSAGE(FATAL_ERROR "System ${CMAKE_SYSTEM_NAME} is not supported!")
-diff --git a/apps/demo_mn_console/src/main.c b/apps/demo_mn_console/src/main.c
-index 12d9be0..194e446 100644
---- a/apps/demo_mn_console/src/main.c
-+++ b/apps/demo_mn_console/src/main.c
-@@ -50,7 +50,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- #include <system/system.h>
- #include <obdcreate/obdcreate.h>
-+
-+#if (TARGET_SYSTEM == _WIN32_)
- #include <getopt/getopt.h>
-+#else
-+#include <unistd.h>
-+#endif
-+
- #include <console/console.h>
- #include <eventlog/eventlog.h>
-
---
-2.9.4
-
--- /dev/null
+From e7e421526b17c179d5ac33a982b180ff5f7ef7a7 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Sat, 27 May 2017 23:51:41 +0200
+Subject: [PATCH] use contrib getopt() only on Windows
+
+Otherwise, contrib getopt will clash with the one from the libc when
+building statically.
+
+lib64/libc.a(getopt.os):(.data+0x8): multiple definition of `optind'
+CMakeFiles/demo_mn_console.dir/__/__/contrib/getopt/getopt.c.o:(.data+0x8): first defined here
+lib64/libc.a(getopt.os):(.data+0x4): multiple definition of `opterr'
+CMakeFiles/demo_mn_console.dir/__/__/contrib/getopt/getopt.c.o:(.data+0xc): first defined here
+/lib64/libc.a(getopt.os): In function `__GI_getopt':
+getopt.c:(.text+0x76e): multiple definition of `getopt'
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ apps/demo_cn_console/CMakeLists.txt | 2 +-
+ apps/demo_cn_console/src/main.c | 6 ++++++
+ apps/demo_mn_console/CMakeLists.txt | 2 +-
+ apps/demo_mn_console/src/main.c | 6 ++++++
+ 4 files changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/apps/demo_cn_console/CMakeLists.txt b/apps/demo_cn_console/CMakeLists.txt
+index 3bb8f25..800797a 100644
+--- a/apps/demo_cn_console/CMakeLists.txt
++++ b/apps/demo_cn_console/CMakeLists.txt
+@@ -61,7 +61,6 @@ SET(DEMO_SOURCES
+ ${COMMON_SOURCE_DIR}/eventlog/eventlog.c
+ ${COMMON_SOURCE_DIR}/eventlog/eventlogstring.c
+ ${CONTRIB_SOURCE_DIR}/console/printlog.c
+- ${CONTRIB_SOURCE_DIR}/getopt/getopt.c
+ )
+
+ INCLUDE_DIRECTORIES(
+@@ -114,6 +113,7 @@ ENDIF (CFG_KERNEL_STACK_DIRECTLINK)
+ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ include(linux.cmake)
+ ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
++ SET(DEMO_SOURCES ${DEMO_SOURCES} ${CONTRIB_SOURCE_DIR}/getopt/getopt.c)
+ include (windows.cmake)
+ ELSE()
+ MESSAGE(FATAL_ERROR "System ${CMAKE_SYSTEM_NAME} is not supported!")
+diff --git a/apps/demo_cn_console/src/main.c b/apps/demo_cn_console/src/main.c
+index d64536c..f790570 100644
+--- a/apps/demo_cn_console/src/main.c
++++ b/apps/demo_cn_console/src/main.c
+@@ -50,7 +50,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #include <system/system.h>
+ #include <obdcreate/obdcreate.h>
++
++#if (TARGET_SYSTEM == _WIN32_)
+ #include <getopt/getopt.h>
++#else
++#include <unistd.h>
++#endif
++
+ #include <console/console.h>
+ #include <eventlog/eventlog.h>
+
+diff --git a/apps/demo_mn_console/CMakeLists.txt b/apps/demo_mn_console/CMakeLists.txt
+index 6f9c5a1..2e74529 100644
+--- a/apps/demo_mn_console/CMakeLists.txt
++++ b/apps/demo_mn_console/CMakeLists.txt
+@@ -68,7 +68,6 @@ SET(DEMO_SOURCES
+ ${COMMON_SOURCE_DIR}/eventlog/eventlog.c
+ ${COMMON_SOURCE_DIR}/eventlog/eventlogstring.c
+ ${CONTRIB_SOURCE_DIR}/console/printlog.c
+- ${CONTRIB_SOURCE_DIR}/getopt/getopt.c
+ ${FIRMWARE_MANAGER_SOURCES}
+ )
+
+@@ -131,6 +130,7 @@ ENDIF()
+ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ include(linux.cmake)
+ ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
++ SET(DEMO_SOURCES ${DEMO_SOURCES} ${CONTRIB_SOURCE_DIR}/getopt/getopt.c)
+ include (windows.cmake)
+ ELSE()
+ MESSAGE(FATAL_ERROR "System ${CMAKE_SYSTEM_NAME} is not supported!")
+diff --git a/apps/demo_mn_console/src/main.c b/apps/demo_mn_console/src/main.c
+index cba747d..b766ed1 100644
+--- a/apps/demo_mn_console/src/main.c
++++ b/apps/demo_mn_console/src/main.c
+@@ -50,7 +50,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #include <system/system.h>
+ #include <obdcreate/obdcreate.h>
++
++#if (TARGET_SYSTEM == _WIN32_)
+ #include <getopt/getopt.h>
++#else
++#include <unistd.h>
++#endif
++
+ #include <console/console.h>
+ #include <eventlog/eventlog.h>
+ #include <firmwaremanager/firmwaremanager.h>
+--
+2.9.4
+
+++ /dev/null
-From 406e1759dc6a4c18f6a38c3d7571aacb177487c6 Mon Sep 17 00:00:00 2001
-From: Romain Naour <romain.naour@gmail.com>
-Date: Sun, 28 May 2017 00:25:11 +0200
-Subject: [PATCH] [FIX]: use pcap-config to fix static linking with libpcap
-
-When linking demo_mn_console statically with pcap, the CMake build
-system forget to link with other libraries linked with libpcap
-(-lnl-genl-3 -lnl-3 -ldbus-1 -pthread).
-
-[100%] Linking C executable demo_mn_console
-lib64/libpcap.a(pcap-linux.o): In function nl80211_init': pcap-linux.c:(.text+0x41e): undefined reference tonl_socket_alloc'
-
-To fix this, the build system could use pcap-config:
-pcap-config --libs --static
--L/path/to/sysroot/usr/lib -lpcap -L/path/to/sysroot/usr/lib/.libs
--lnl-genl-3 -lnl-3 -L/path/to/sysroot/usr/lib -ldbus-1 -pthread
-
-Fixes:
-http://autobuild.buildroot.net/results/f43/f437d09ac6c689c911e1885b95da33b692f2cb3c
-http://autobuild.buildroot.net/results/385/3859dc0f4de7e3284a96d5841f040f69f71842df
-https://github.com/OpenAutomationTechnologies/openPOWERLINK_V2/issues/187
-
-Signed-off-by: Romain Naour <romain.naour@gmail.com>
----
- apps/demo_cn_console/linux.cmake | 20 ++++++++++++++++++++
- apps/demo_mn_console/linux.cmake | 20 ++++++++++++++++++++
- apps/demo_mn_qt/linux.cmake | 22 +++++++++++++++++++++-
- drivers/linux/drv_daemon_pcap/CMakeLists.txt | 22 +++++++++++++++++++++-
- 4 files changed, 82 insertions(+), 2 deletions(-)
-
-diff --git a/apps/demo_cn_console/linux.cmake b/apps/demo_cn_console/linux.cmake
-index 1c6f51c..7752917 100644
---- a/apps/demo_cn_console/linux.cmake
-+++ b/apps/demo_cn_console/linux.cmake
-@@ -46,8 +46,28 @@ SET (DEMO_ARCH_SOURCES
- ################################################################################
- # Set architecture specific libraries
-
-+IF (NOT CFG_COMPILE_SHARED_LIBRARY)
-+ SET(PCAP_CONFIG_OPTS --static)
-+ENDIF()
-+
- IF (CFG_KERNEL_STACK_DIRECTLINK OR CFG_KERNEL_STACK_USERSPACE_DAEMON)
-+
-+find_program(PCAP_CONFIG NAMES pcap-config PATHS)
-+
-+if (PCAP_CONFIG)
-+ message (STATUS "Looking for pcap-config... ${PCAP_CONFIG}")
-+
-+ execute_process (COMMAND ${PCAP_CONFIG} --libs ${PCAP_CONFIG_OPTS}
-+ OUTPUT_VARIABLE PCAP_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-+ execute_process (COMMAND ${PCAP_CONFIG} --cflags ${PCAP_CONFIG_OPTS}
-+ OUTPUT_VARIABLE PCAP_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-+
-+ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} ${PCAP_LDFLAGS})
-+else (PCAP_CONFIG)
-+ message (STATUS "pcap-config not found, using defaults...")
- SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pcap)
-+endif (PCAP_CONFIG)
-+
- ENDIF (CFG_KERNEL_STACK_DIRECTLINK OR CFG_KERNEL_STACK_USERSPACE_DAEMON)
- SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pthread rt)
-
-diff --git a/apps/demo_mn_console/linux.cmake b/apps/demo_mn_console/linux.cmake
-index d24e4fc..5951dbf 100644
---- a/apps/demo_mn_console/linux.cmake
-+++ b/apps/demo_mn_console/linux.cmake
-@@ -46,8 +46,28 @@ SET (DEMO_ARCH_SOURCES
- ################################################################################
- # Set architecture specific libraries
-
-+IF (NOT CFG_COMPILE_SHARED_LIBRARY)
-+ SET(PCAP_CONFIG_OPTS --static)
-+ENDIF()
-+
- IF (CFG_KERNEL_STACK_DIRECTLINK OR CFG_KERNEL_STACK_USERSPACE_DAEMON)
-+
-+find_program(PCAP_CONFIG NAMES pcap-config PATHS)
-+
-+if (PCAP_CONFIG)
-+ message (STATUS "Looking for pcap-config... ${PCAP_CONFIG}")
-+
-+ execute_process (COMMAND ${PCAP_CONFIG} --libs ${PCAP_CONFIG_OPTS}
-+ OUTPUT_VARIABLE PCAP_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-+ execute_process (COMMAND ${PCAP_CONFIG} --cflags ${PCAP_CONFIG_OPTS}
-+ OUTPUT_VARIABLE PCAP_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-+
-+ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} ${PCAP_LDFLAGS})
-+else (PCAP_CONFIG)
-+ message (STATUS "pcap-config not found, using defaults...")
- SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pcap)
-+endif (PCAP_CONFIG)
-+
- ENDIF (CFG_KERNEL_STACK_DIRECTLINK OR CFG_KERNEL_STACK_USERSPACE_DAEMON)
- SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pthread rt)
-
-diff --git a/apps/demo_mn_qt/linux.cmake b/apps/demo_mn_qt/linux.cmake
-index 6ed75ee..c69dbd9 100644
---- a/apps/demo_mn_qt/linux.cmake
-+++ b/apps/demo_mn_qt/linux.cmake
-@@ -37,8 +37,28 @@
- ################################################################################
- # Set architecture specific libraries
-
-+IF (NOT CFG_COMPILE_SHARED_LIBRARY)
-+ SET(PCAP_CONFIG_OPTS --static)
-+ENDIF()
-+
- IF(CFG_KERNEL_STACK_DIRECTLINK OR CFG_KERNEL_STACK_USERSPACE_DAEMON)
-- SET(ARCH_LIBRARIES ${ARCH_LIBRARIES} pcap)
-+
-+find_program(PCAP_CONFIG NAMES pcap-config PATHS)
-+
-+if (PCAP_CONFIG)
-+ message (STATUS "Looking for pcap-config... ${PCAP_CONFIG}")
-+
-+ execute_process (COMMAND ${PCAP_CONFIG} --libs ${PCAP_CONFIG_OPTS}
-+ OUTPUT_VARIABLE PCAP_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-+ execute_process (COMMAND ${PCAP_CONFIG} --cflags ${PCAP_CONFIG_OPTS}
-+ OUTPUT_VARIABLE PCAP_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-+
-+ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} ${PCAP_LDFLAGS})
-+else (PCAP_CONFIG)
-+ message (STATUS "pcap-config not found, using defaults...")
-+ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pcap)
-+endif (PCAP_CONFIG)
-+
- ENDIF()
- SET(ARCH_LIBRARIES ${ARCH_LIBRARIES} pthread rt)
-
-diff --git a/drivers/linux/drv_daemon_pcap/CMakeLists.txt b/drivers/linux/drv_daemon_pcap/CMakeLists.txt
-index 2b4a2c1..98f693f 100644
---- a/drivers/linux/drv_daemon_pcap/CMakeLists.txt
-+++ b/drivers/linux/drv_daemon_pcap/CMakeLists.txt
-@@ -134,7 +134,27 @@ INCLUDE_DIRECTORIES(
- ${CONTRIB_SOURCE_DIR}
- )
-
--SET (ARCH_LIBRARIES pcap pthread rt)
-+IF (NOT CFG_COMPILE_SHARED_LIBRARY)
-+ SET(PCAP_CONFIG_OPTS --static)
-+ENDIF()
-+
-+find_program(PCAP_CONFIG NAMES pcap-config PATHS)
-+
-+if (PCAP_CONFIG)
-+ message (STATUS "Looking for pcap-config... ${PCAP_CONFIG}")
-+
-+ execute_process (COMMAND ${PCAP_CONFIG} --libs ${PCAP_CONFIG_OPTS}
-+ OUTPUT_VARIABLE PCAP_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-+ execute_process (COMMAND ${PCAP_CONFIG} --cflags ${PCAP_CONFIG_OPTS}
-+ OUTPUT_VARIABLE PCAP_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-+
-+ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} ${PCAP_LDFLAGS})
-+else (PCAP_CONFIG)
-+ message (STATUS "pcap-config not found, using defaults...")
-+ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pcap)
-+endif (PCAP_CONFIG)
-+
-+SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pthread rt)
-
- ADD_EXECUTABLE(${EXE_NAME} ${DRV_SOURCES})
- SET_PROPERTY(TARGET ${EXE_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
---
-2.9.4
-
--- /dev/null
+From 88c0af910edd156075acf04d8497f541ed377d4b Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Sun, 28 May 2017 00:25:11 +0200
+Subject: [PATCH] use pcap-config to fix static linking with libpcap
+
+When linking demo_mn_console statically with pcap, the CMake build
+system forget to link with other libraries linked with libpcap
+(-lnl-genl-3 -lnl-3 -ldbus-1 -pthread).
+
+[100%] Linking C executable demo_mn_console
+lib64/libpcap.a(pcap-linux.o): In function nl80211_init': pcap-linux.c:(.text+0x41e): undefined reference tonl_socket_alloc'
+
+To fix this, the build system could use pcap-config:
+pcap-config --libs --static
+-L/path/to/sysroot/usr/lib -lpcap -L/path/to/sysroot/usr/lib/.libs
+-lnl-genl-3 -lnl-3 -L/path/to/sysroot/usr/lib -ldbus-1 -pthread
+
+Fixes:
+http://autobuild.buildroot.net/results/f43/f437d09ac6c689c911e1885b95da33b692f2cb3c
+http://autobuild.buildroot.net/results/385/3859dc0f4de7e3284a96d5841f040f69f71842df
+https://github.com/OpenAutomationTechnologies/openPOWERLINK_V2/issues/187
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ apps/demo_cn_console/linux.cmake | 20 ++++++++++++++++++++
+ apps/demo_mn_console/linux.cmake | 20 ++++++++++++++++++++
+ apps/demo_mn_qt/linux.cmake | 22 +++++++++++++++++++++-
+ drivers/linux/drv_daemon_pcap/CMakeLists.txt | 22 +++++++++++++++++++++-
+ 4 files changed, 82 insertions(+), 2 deletions(-)
+
+diff --git a/apps/demo_cn_console/linux.cmake b/apps/demo_cn_console/linux.cmake
+index 1c6f51c..7752917 100644
+--- a/apps/demo_cn_console/linux.cmake
++++ b/apps/demo_cn_console/linux.cmake
+@@ -46,8 +46,28 @@ SET (DEMO_ARCH_SOURCES
+ ################################################################################
+ # Set architecture specific libraries
+
++IF (NOT CFG_COMPILE_SHARED_LIBRARY)
++ SET(PCAP_CONFIG_OPTS --static)
++ENDIF()
++
+ IF (CFG_KERNEL_STACK_DIRECTLINK OR CFG_KERNEL_STACK_USERSPACE_DAEMON)
++
++find_program(PCAP_CONFIG NAMES pcap-config PATHS)
++
++if (PCAP_CONFIG)
++ message (STATUS "Looking for pcap-config... ${PCAP_CONFIG}")
++
++ execute_process (COMMAND ${PCAP_CONFIG} --libs ${PCAP_CONFIG_OPTS}
++ OUTPUT_VARIABLE PCAP_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
++ execute_process (COMMAND ${PCAP_CONFIG} --cflags ${PCAP_CONFIG_OPTS}
++ OUTPUT_VARIABLE PCAP_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
++
++ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} ${PCAP_LDFLAGS})
++else (PCAP_CONFIG)
++ message (STATUS "pcap-config not found, using defaults...")
+ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pcap)
++endif (PCAP_CONFIG)
++
+ ENDIF (CFG_KERNEL_STACK_DIRECTLINK OR CFG_KERNEL_STACK_USERSPACE_DAEMON)
+ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pthread rt)
+
+diff --git a/apps/demo_mn_console/linux.cmake b/apps/demo_mn_console/linux.cmake
+index d24e4fc..5951dbf 100644
+--- a/apps/demo_mn_console/linux.cmake
++++ b/apps/demo_mn_console/linux.cmake
+@@ -46,8 +46,28 @@ SET (DEMO_ARCH_SOURCES
+ ################################################################################
+ # Set architecture specific libraries
+
++IF (NOT CFG_COMPILE_SHARED_LIBRARY)
++ SET(PCAP_CONFIG_OPTS --static)
++ENDIF()
++
+ IF (CFG_KERNEL_STACK_DIRECTLINK OR CFG_KERNEL_STACK_USERSPACE_DAEMON)
++
++find_program(PCAP_CONFIG NAMES pcap-config PATHS)
++
++if (PCAP_CONFIG)
++ message (STATUS "Looking for pcap-config... ${PCAP_CONFIG}")
++
++ execute_process (COMMAND ${PCAP_CONFIG} --libs ${PCAP_CONFIG_OPTS}
++ OUTPUT_VARIABLE PCAP_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
++ execute_process (COMMAND ${PCAP_CONFIG} --cflags ${PCAP_CONFIG_OPTS}
++ OUTPUT_VARIABLE PCAP_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
++
++ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} ${PCAP_LDFLAGS})
++else (PCAP_CONFIG)
++ message (STATUS "pcap-config not found, using defaults...")
+ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pcap)
++endif (PCAP_CONFIG)
++
+ ENDIF (CFG_KERNEL_STACK_DIRECTLINK OR CFG_KERNEL_STACK_USERSPACE_DAEMON)
+ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pthread rt)
+
+diff --git a/apps/demo_mn_qt/linux.cmake b/apps/demo_mn_qt/linux.cmake
+index 6ed75ee..c69dbd9 100644
+--- a/apps/demo_mn_qt/linux.cmake
++++ b/apps/demo_mn_qt/linux.cmake
+@@ -37,8 +37,28 @@
+ ################################################################################
+ # Set architecture specific libraries
+
++IF (NOT CFG_COMPILE_SHARED_LIBRARY)
++ SET(PCAP_CONFIG_OPTS --static)
++ENDIF()
++
+ IF(CFG_KERNEL_STACK_DIRECTLINK OR CFG_KERNEL_STACK_USERSPACE_DAEMON)
+- SET(ARCH_LIBRARIES ${ARCH_LIBRARIES} pcap)
++
++find_program(PCAP_CONFIG NAMES pcap-config PATHS)
++
++if (PCAP_CONFIG)
++ message (STATUS "Looking for pcap-config... ${PCAP_CONFIG}")
++
++ execute_process (COMMAND ${PCAP_CONFIG} --libs ${PCAP_CONFIG_OPTS}
++ OUTPUT_VARIABLE PCAP_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
++ execute_process (COMMAND ${PCAP_CONFIG} --cflags ${PCAP_CONFIG_OPTS}
++ OUTPUT_VARIABLE PCAP_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
++
++ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} ${PCAP_LDFLAGS})
++else (PCAP_CONFIG)
++ message (STATUS "pcap-config not found, using defaults...")
++ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pcap)
++endif (PCAP_CONFIG)
++
+ ENDIF()
+ SET(ARCH_LIBRARIES ${ARCH_LIBRARIES} pthread rt)
+
+diff --git a/drivers/linux/drv_daemon_pcap/CMakeLists.txt b/drivers/linux/drv_daemon_pcap/CMakeLists.txt
+index ecceb4c..b362a34 100644
+--- a/drivers/linux/drv_daemon_pcap/CMakeLists.txt
++++ b/drivers/linux/drv_daemon_pcap/CMakeLists.txt
+@@ -140,7 +140,27 @@ INCLUDE_DIRECTORIES(
+ ${CONTRIB_SOURCE_DIR}
+ )
+
+-SET (ARCH_LIBRARIES pcap pthread rt)
++IF (NOT CFG_COMPILE_SHARED_LIBRARY)
++ SET(PCAP_CONFIG_OPTS --static)
++ENDIF()
++
++find_program(PCAP_CONFIG NAMES pcap-config PATHS)
++
++if (PCAP_CONFIG)
++ message (STATUS "Looking for pcap-config... ${PCAP_CONFIG}")
++
++ execute_process (COMMAND ${PCAP_CONFIG} --libs ${PCAP_CONFIG_OPTS}
++ OUTPUT_VARIABLE PCAP_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
++ execute_process (COMMAND ${PCAP_CONFIG} --cflags ${PCAP_CONFIG_OPTS}
++ OUTPUT_VARIABLE PCAP_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
++
++ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} ${PCAP_LDFLAGS})
++else (PCAP_CONFIG)
++ message (STATUS "pcap-config not found, using defaults...")
++ SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pcap)
++endif (PCAP_CONFIG)
++
++SET (ARCH_LIBRARIES ${ARCH_LIBRARIES} pthread rt)
+
+ ADD_EXECUTABLE(${EXE_NAME} ${DRV_SOURCES})
+ SET_PROPERTY(TARGET ${EXE_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
+--
+2.9.4
+
-# From http://sourceforge.net/projects/openpowerlink/files/openPOWERLINK/V2.5.2/
-md5 aa74d7f80d1ef6debcd40f97cd2df3f5 openPOWERLINK_V2.5.2.tar.gz
-sha1 7c46f337324e88096531d2cb74e47750833e851b openPOWERLINK_V2.5.2.tar.gz
+# From http://sourceforge.net/projects/openpowerlink/files/openPOWERLINK/V2.6.0/
+md5 afe5c1ed2d329d5b3784eb6999ab9d17 openPOWERLINK_V2.6.0.tar.gz
+sha1 c8b317f118f69e416bc812e93a97e073d62a29d9 openPOWERLINK_V2.6.0.tar.gz
# sha256 locally computed
-sha256 4bc288be11ceebba2aa5c2a43a66489218f1e55bb75a07afc9e01e0e6233bcdc openPOWERLINK_V2.5.2.tar.gz
+sha256 a53dd279a5341fc350e4be94949d4642579c4c4eb27706f1b36d41136b400ff8 openPOWERLINK_V2.6.0.tar.gz
#
################################################################################
-OPENPOWERLINK_VERSION = V2.5.2
+OPENPOWERLINK_VERSION = V2.6.0
OPENPOWERLINK_SITE = http://downloads.sourceforge.net/project/openpowerlink/openPOWERLINK/$(OPENPOWERLINK_VERSION)
OPENPOWERLINK_SOURCE = openPOWERLINK_$(OPENPOWERLINK_VERSION).tar.gz
OPENPOWERLINK_LICENSE = BSD-2-Clause, GPL-2.0