Skip to content
Snippets Groups Projects
Commit cde0c0df authored by Dmitry Rozhkov's avatar Dmitry Rozhkov
Browse files

fcl: don't set RPATH for libfcl.so


By default FCL sets RPATH explicitly and that triggers an QA
issue:

    WARNING: fcl-0.3.2-r0 do_package_qa: QA Issue: fcl: /work/i586-oe-linux/fcl/0.3.2-r0/packages-split/fcl/usr/lib/libfcl.so contains probably-redundant RPATH /usr/lib [useless-rpaths]

The patch switches off setting RPATH explicitly.

Signed-off-by: default avatarDmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
parent 9909e480
No related branches found
No related tags found
No related merge requests found
From 627968a012ab9518fcbc26da52f0f395c583b772 Mon Sep 17 00:00:00 2001
From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Date: Tue, 7 Feb 2017 10:04:55 +0200
Subject: [PATCH] Add configure option NO_DEFAULT_RPATH
The currently used compiler settings explicitly set RPATH to
installed binaries which is not desired behaviour in some
circumstances, e.g. OpenEmbedded's QA checks report an issue
about redundant RPATH set to the standard '/usr/lib' directory.
This patch adds the configure option NO_DEFAULT_RPATH which is
ON by default in order to preserve the current behaviour, but
when set to OFF make CMake use its default RPATH settings, that is
set RPATH for the binaries in the build tree, but clear them out
for installed binaries.
Upstream-Status: Accepted [https://github.com/flexible-collision-library/fcl/pull/203]
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
---
CMakeModules/CompilerSettings.cmake | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/CMakeModules/CompilerSettings.cmake b/CMakeModules/CompilerSettings.cmake
index c1c4ae5..3d9f805 100644
--- a/CMakeModules/CompilerSettings.cmake
+++ b/CMakeModules/CompilerSettings.cmake
@@ -40,11 +40,19 @@ if((CMAKE_COMPILER_IS_GNUCXX OR IS_ICPC) AND NOT MINGW)
add_definitions(-fPIC)
endif((CMAKE_COMPILER_IS_GNUCXX OR IS_ICPC) AND NOT MINGW)
+# By default CMake sets RPATH for binaries in the build tree, but clears
+# it when installing. Switch this option off if the default behaviour is
+# desired.
+option(NO_DEFAULT_RPATH "Set RPATH for installed binaries" ON)
+
# Set rpath http://www.paraview.org/Wiki/CMake_RPATH_handling
-set(CMAKE_SKIP_BUILD_RPATH FALSE)
-set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+if(NO_DEFAULT_RPATH)
+ message(STATUS "Set RPATH explicitly to '${CMAKE_INSTALL_PREFIX}/lib'")
+ set(CMAKE_SKIP_BUILD_RPATH FALSE)
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+endif(NO_DEFAULT_RPATH)
# no prefix needed for python modules
set(CMAKE_SHARED_MODULE_PREFIX "")
--
2.7.4
......@@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=5823baab4b8de52197d0fb775e8fd4b7"
# Octomap dependency not included as it is optional.
DEPENDS = "boost libccd"
SRC_URI = "https://github.com/flexible-collision-library/fcl/archive/${PV}.tar.gz"
SRC_URI = "https://github.com/flexible-collision-library/fcl/archive/${PV}.tar.gz \
file://0001-Add-configure-option-NO_DEFAULT_RPATH.patch \
"
SRC_URI[md5sum] = "b12246df3f4e1d0768ce1e46a52900ff"
SRC_URI[sha256sum] = "cf914f85b32cf8b63879907726df64e50da33f00d538759d789fe10fc5fbc95b"
......@@ -16,7 +18,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://LICENSE;subdir=fcl-${PV}"
EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=Release"
EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=Release -DNO_DEFAULT_RPATH=OFF"
FILES_${PN} += "${libdir}/libfcl.so"
# Need to override this, otherwise libfcl.so is included in dev packageW.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment