kumquat-buildroot/package/openpowerlink/0001-install-the-stack-libraries-to-lib-subdirectory.patch
Romain Naour b1063a0136 package/openpowerlink: bump to v2.2.2
From [1]:
With version 2.0, the source code has been cleanly split into
an application-oriented user library and a time-critical stack
driver. The latter may be moved to a dedicated communication
processor or into a kernel module to deliver enhanced
performance while still keeping the API in user space.

This new version break the API used in the v1.x but
this is a complete rewrite of the Powerlink EPSG DS 301
implementation. The v1.x is deprecated anyway.

The new build system has been split in several CMake projects
which makes it difficult to package with the Buildroot CMake
infra. So add a top level CMakeLists.txt to build each
openpowerlink component without having to package each of them
in a separate Buildroot packages. Also we need to fix the
build system to support the top level CMake build.

[1] http://sourceforge.net/projects/openpowerlink/

Signed-off-by: Romain Naour <romain.naour@gmail.com>

[Thomas:
 - rename patches to not contain the [FIX] part in their title.
 - rewrap Config.in help text
 - rename "openPOWERLINK stack type" to "stack type"
 - rename ""openpowerlink demos" to "demos"]

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-02-07 19:04:02 +01:00

134 lines
7.5 KiB
Diff

From ebc5aeff65aeda610d9e23ecf4b26b79f9305a0e Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@openwide.fr>
Date: Fri, 1 May 2015 12:19:34 +0200
Subject: [PATCH] install the stack libraries to "lib" subdirectory
Using '.' to install the stack libraries is not correct since
it will install them to /usr/.
ls /usr/liboplkmnapp-kernelintf.so
Fix this by using 'lib' instead of '.'
The problem with the openpowerlink build system is that it expect
the stack directory to be a "local staging" directory which
contains headers and libraries. So the libraries build by the
stack project are installed in stack/lib by default.
This is wrong to do that because it becomes difficult to package
openpowerlink for normal Linux systems.
Buildroot like others build system expect from a packaged software
to install libraries and headers build/provided in a staging
directory.
It seems that CMAKE_INSTALL_PREFIX is misused by the default value
"${CMAKE_CURRENT_SOURCE_DIR}/lib/${SYSTEM_NAME_DIR}/${SYSTEM_PROCESSOR_DIR}"
since it already contains the lib directory and therefore the
entire build system is messed up.
It seems that the openpowerlink's build system doesn't allow/support
CMAKE_INSTALL_PREFIX to be set externally
(which is the standard approach).
The issue has been reported [1] upstream and a build system
refactoring is needed to fix this properly.
[1] http://sourceforge.net/p/openpowerlink/discussion/newbie/thread/3f13af65/#8f80/a50a/4649/f07c
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
stack/proj/linux/liboplkcn/CMakeLists.txt | 2 +-
stack/proj/linux/liboplkcnapp-kernelintf/CMakeLists.txt | 2 +-
stack/proj/linux/liboplkcnapp-userintf/CMakeLists.txt | 2 +-
stack/proj/linux/liboplkcndrv-pcap/CMakeLists.txt | 2 +-
stack/proj/linux/liboplkmn/CMakeLists.txt | 2 +-
stack/proj/linux/liboplkmnapp-kernelintf/CMakeLists.txt | 2 +-
stack/proj/linux/liboplkmnapp-userintf/CMakeLists.txt | 2 +-
stack/proj/linux/liboplkmndrv-pcap/CMakeLists.txt | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/stack/proj/linux/liboplkcn/CMakeLists.txt b/stack/proj/linux/liboplkcn/CMakeLists.txt
index b7c73e6..23e3112 100644
--- a/stack/proj/linux/liboplkcn/CMakeLists.txt
+++ b/stack/proj/linux/liboplkcn/CMakeLists.txt
@@ -88,4 +88,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
TARGET_LINK_LIBRARIES(${LIB_NAME} ${ARCH_LIBRARIES})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY DEBUG_POSTFIX "_d")
-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 6c3bec6..a6f9271 100644
--- a/stack/proj/linux/liboplkcnapp-kernelintf/CMakeLists.txt
+++ b/stack/proj/linux/liboplkcnapp-kernelintf/CMakeLists.txt
@@ -81,4 +81,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
TARGET_LINK_LIBRARIES(${LIB_NAME} ${ARCH_LIBRARIES})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY DEBUG_POSTFIX "_d")
-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 fdf6fd4..6df8bb7 100644
--- a/stack/proj/linux/liboplkcnapp-userintf/CMakeLists.txt
+++ b/stack/proj/linux/liboplkcnapp-userintf/CMakeLists.txt
@@ -81,4 +81,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
TARGET_LINK_LIBRARIES(${LIB_NAME} ${ARCH_LIBRARIES})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY DEBUG_POSTFIX "_d")
-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 440f02c..6ffcbe9 100644
--- a/stack/proj/linux/liboplkcndrv-pcap/CMakeLists.txt
+++ b/stack/proj/linux/liboplkcndrv-pcap/CMakeLists.txt
@@ -77,4 +77,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
TARGET_LINK_LIBRARIES(${LIB_NAME} ${ARCH_LIBRARIES})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY DEBUG_POSTFIX "_d")
-INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .)
+INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
diff --git a/stack/proj/linux/liboplkmn/CMakeLists.txt b/stack/proj/linux/liboplkmn/CMakeLists.txt
index 8f97144..e29f795 100644
--- a/stack/proj/linux/liboplkmn/CMakeLists.txt
+++ b/stack/proj/linux/liboplkmn/CMakeLists.txt
@@ -92,4 +92,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
TARGET_LINK_LIBRARIES(${LIB_NAME} ${ARCH_LIBRARIES})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY DEBUG_POSTFIX "_d")
-INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .)
+INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
diff --git a/stack/proj/linux/liboplkmnapp-kernelintf/CMakeLists.txt b/stack/proj/linux/liboplkmnapp-kernelintf/CMakeLists.txt
index df74265..2ba1cd1 100644
--- a/stack/proj/linux/liboplkmnapp-kernelintf/CMakeLists.txt
+++ b/stack/proj/linux/liboplkmnapp-kernelintf/CMakeLists.txt
@@ -85,4 +85,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
TARGET_LINK_LIBRARIES(${LIB_NAME} ${ARCH_LIBRARIES})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY DEBUG_POSTFIX "_d")
-INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .)
+INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
diff --git a/stack/proj/linux/liboplkmnapp-userintf/CMakeLists.txt b/stack/proj/linux/liboplkmnapp-userintf/CMakeLists.txt
index 98835c7..12b3dc6 100644
--- a/stack/proj/linux/liboplkmnapp-userintf/CMakeLists.txt
+++ b/stack/proj/linux/liboplkmnapp-userintf/CMakeLists.txt
@@ -85,4 +85,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
TARGET_LINK_LIBRARIES(${LIB_NAME} ${ARCH_LIBRARIES})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY DEBUG_POSTFIX "_d")
-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 b4dd41b..cf875ca 100644
--- a/stack/proj/linux/liboplkmndrv-pcap/CMakeLists.txt
+++ b/stack/proj/linux/liboplkmndrv-pcap/CMakeLists.txt
@@ -80,4 +80,4 @@ ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})
TARGET_LINK_LIBRARIES(${LIB_NAME} ${ARCH_LIBRARIES})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY DEBUG_POSTFIX "_d")
-INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .)
+INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
--
2.4.3