aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Romain Naour <romain.naour@openwide.fr>2014-12-10 22:24:56 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-12-10 23:21:58 +0100
commitb39a4bd486f9ddbb0b909abab238d6c32f4b5a0b (patch)
tree0e218ab3e2e87549f78d025439f7f426195a1c58
parent6554801512fda72f21bd807e474a2ad9b9f989af (diff)
downloadbuildroot-b39a4bd486f9ddbb0b909abab238d6c32f4b5a0b.tar.gz
buildroot-b39a4bd486f9ddbb0b909abab238d6c32f4b5a0b.tar.bz2
package/openpowerlink: enable dynamic build
Also remove the install hook, all static libraries are removed from TARGET_DIR/usr/lib by target-finalize target Signed-off-by: Romain Naour <romain.naour@openwide.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/openpowerlink/0002-fix-user-space-stack-enable-shared-build.patch54
-rw-r--r--package/openpowerlink/openpowerlink.mk10
2 files changed, 55 insertions, 9 deletions
diff --git a/package/openpowerlink/0002-fix-user-space-stack-enable-shared-build.patch b/package/openpowerlink/0002-fix-user-space-stack-enable-shared-build.patch
new file mode 100644
index 0000000000..2345594891
--- /dev/null
+++ b/package/openpowerlink/0002-fix-user-space-stack-enable-shared-build.patch
@@ -0,0 +1,54 @@
+From 9c11eef037dc1137ab7a4656e45afde7d1a615c4 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Sat, 22 Nov 2014 16:38:01 +0100
+Subject: [PATCH 2/2] [FIX]: user space stack: enable dynamic build
+
+The build fail if BUILD_SHARED_LIBS is set to ON.
+
+Depending on BUILD_SHARED_LIBS, link with STATIC or SHARED.
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ Examples/X86/Generic/powerlink_user_lib/CMakeLists.txt | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/Examples/X86/Generic/powerlink_user_lib/CMakeLists.txt b/Examples/X86/Generic/powerlink_user_lib/CMakeLists.txt
+index 40b7756..27360f2 100644
+--- a/Examples/X86/Generic/powerlink_user_lib/CMakeLists.txt
++++ b/Examples/X86/Generic/powerlink_user_lib/CMakeLists.txt
+@@ -93,7 +93,13 @@ ENDIF(CFG_STORE_RESTORE)
+ #
+ # Set type of library
+ #
+-IF (WIN32)
++IF (UNIX)
++ IF (BUILD_SHARED_LIBS)
++ SET(LIB_TYPE "SHARED")
++ ELSE (BUILD_SHARED_LIBS)
++ SET(LIB_TYPE "STATIC")
++ ENDIF(BUILD_SHARED_LIBS)
++ELSEIF (WIN32)
+ IF(CFG_X86_WINDOWS_DLL)
+ SET(LIB_TYPE "SHARED")
+ ELSE(CFG_X86_WINDOWS_DLL)
+@@ -313,7 +319,7 @@ ENDIF ()
+ # Define library source code
+ #
+ IF (UNIX)
+- ADD_LIBRARY(powerlink ${LIB_SOURCES} ${LIB_SOURCES_KERNEL} ${LIB_SOURCES_USER} ${LIB_HEADERS} ${LIB_HEADERS_KERNEL} ${LIB_HEADERS_USER} ${LIB_OBJDICT})
++ ADD_LIBRARY(powerlink ${LIB_TYPE} ${LIB_SOURCES} ${LIB_SOURCES_KERNEL} ${LIB_SOURCES_USER} ${LIB_HEADERS} ${LIB_HEADERS_KERNEL} ${LIB_HEADERS_USER} ${LIB_OBJDICT})
+
+ SET_PROPERTY(TARGET powerlink
+ PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL})
+@@ -330,7 +336,7 @@ ENDIF ()
+ # Installation
+ #
+ IF (UNIX)
+- INSTALL(TARGETS powerlink ARCHIVE DESTINATION lib)
++ INSTALL(TARGETS powerlink ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT library)
+ ELSEIF (WIN32)
+ IF (CFG_X86_WINDOWS_DLL)
+ INSTALL(TARGETS openPOWERLINK RUNTIME DESTINATION bin)
+--
+1.9.3
+
diff --git a/package/openpowerlink/openpowerlink.mk b/package/openpowerlink/openpowerlink.mk
index 37cc90e54a..31c533eb7a 100644
--- a/package/openpowerlink/openpowerlink.mk
+++ b/package/openpowerlink/openpowerlink.mk
@@ -11,20 +11,12 @@ OPENPOWERLINK_LICENSE = BSD-2c, GPLv2
OPENPOWERLINK_LICENSE_FILES = license.txt
OPENPOWERLINK_INSTALL_STAGING = YES
-# There is no shared lib in openpowerlink,
-# so force static lib to build libpowerlink.a
-OPENPOWERLINK_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF
-
-OPENPOWERLINK_CONF_OPTS += -DCFG_DEBUG_LVL=$(call qstrip,$(BR2_PACKAGE_OPENPOWERLINK_DEBUG_LEVEL))
+OPENPOWERLINK_CONF_OPTS = -DCFG_DEBUG_LVL=$(call qstrip,$(BR2_PACKAGE_OPENPOWERLINK_DEBUG_LEVEL))
ifeq ($(BR2_PACKAGE_OPENPOWERLINK_LIBPCAP),y)
# use the user space stack (libpcap)
OPENPOWERLINK_CONF_OPTS += -DCFG_KERNEL_STACK=OFF
OPENPOWERLINK_DEPENDENCIES = libpcap
-define OPENPOWERLINK_REMOVE_LIB
- rm $(TARGET_DIR)/usr/lib/libpowerlink.a
-endef
-OPENPOWERLINK_POST_INSTALL_TARGET_HOOKS += OPENPOWERLINK_REMOVE_LIB
else
# use the kernel stack
OPENPOWERLINK_CONF_OPTS += -DCFG_KERNEL_STACK=ON \