2013-02-15 22:49:59 +08:00
|
|
|
#
|
|
|
|
# Copyright (c) 2013 Stefan Herbrechtsmeier, Bielefeld University
|
2019-03-19 03:03:41 +08:00
|
|
|
# Copyright (c) 2019 LG Electronics, Inc.
|
|
|
|
#
|
2013-02-15 22:49:59 +08:00
|
|
|
|
2019-04-23 07:07:16 +08:00
|
|
|
inherit catkin_ros_prefix
|
|
|
|
# ROS_PYTHON_VERSION is set in generated-ros-distro.inc, ie, it will never be unset here.
|
|
|
|
inherit cmake ${@'distutils3-base' if d.getVar('ROS_PYTHON_VERSION', True) == '3' else 'distutils-base'} faulty-solibs
|
2013-02-15 22:49:59 +08:00
|
|
|
|
2017-06-02 16:23:48 +08:00
|
|
|
# Prepend build dependency on "catkin-runtime" and "catkin-native"
|
|
|
|
# if the package is not "catkin" or "catkin-runtime"
|
|
|
|
DEPENDS =+ "${@'' if d.getVar('BPN', True) in ('catkin', 'catkin-runtime') else 'catkin-runtime catkin-native'}"
|
|
|
|
|
|
|
|
# Prepend run dependency on "catkin-runtime" for base packages
|
|
|
|
# if the package is not "catkin" or "catkin-runtime"
|
|
|
|
RDEPENDS_${PN} =+ "${@'' if d.getVar('BPN', True) in ('catkin', 'catkin-runtime') else 'catkin-runtime'}"
|
|
|
|
|
|
|
|
# Prepend run dependency on "catkin" for dev packages
|
|
|
|
# if the package is not "catkin" or "catkin-runtime"
|
|
|
|
RDEPENDS_${PN}-dev =+ "${@'' if d.getVar('BPN', True) in ('catkin', 'catkin-runtime') else 'catkin'}"
|
2013-02-15 22:49:59 +08:00
|
|
|
|
|
|
|
EXTRA_OECMAKE_CATKIN = "\
|
2014-08-15 03:29:02 +08:00
|
|
|
-DCMAKE_PREFIX_PATH='${STAGING_DIR_HOST}${ros_prefix};${STAGING_DIR_HOST}${prefix};${STAGING_DIR_NATIVE}${ros_prefix};${STAGING_DIR_NATIVE}${prefix}' \
|
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH='${ros_prefix}' \
|
2017-06-02 16:23:48 +08:00
|
|
|
-DCATKIN_DEVEL_PREFIX='${WORKDIR}/devel' \
|
2013-02-15 22:49:59 +08:00
|
|
|
"
|
|
|
|
|
|
|
|
EXTRA_OECMAKE_CATKIN_class-native = "\
|
2017-06-02 18:12:33 +08:00
|
|
|
-DCMAKE_PREFIX_PATH='${STAGING_DIR_NATIVE}${ros_prefix}' \
|
2014-08-15 03:29:02 +08:00
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH='${ros_prefix}' \
|
2013-02-15 22:49:59 +08:00
|
|
|
-DRT_LIBRARY=${libdir_native} \
|
2017-06-02 16:23:48 +08:00
|
|
|
-DCATKIN_DEVEL_PREFIX='${WORKDIR}/devel' \
|
2013-02-15 22:49:59 +08:00
|
|
|
"
|
|
|
|
|
|
|
|
EXTRA_OECMAKE_prepend = "\
|
|
|
|
${EXTRA_OECMAKE_CATKIN} \
|
|
|
|
-DCATKIN_BUILD_BINARY_PACKAGE=ON \
|
|
|
|
-DSETUPTOOLS_DEB_LAYOUT=OFF \
|
2013-07-03 13:50:57 +08:00
|
|
|
-DCATKIN_ENABLE_TESTING=0 \
|
2013-02-15 22:49:59 +08:00
|
|
|
"
|
|
|
|
|
2013-02-28 17:23:19 +08:00
|
|
|
OECMAKE_SOURCEPATH = "${S}"
|
|
|
|
OECMAKE_BUILDPATH = "${S}/build"
|
|
|
|
|
catkin.bbclass: adapt to binutils 2.29
After updating to binutils 2.29 builds fail with
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot-native/usr/bin/i586-oe-linux/../../libexec/i586-oe-linux/gcc/i586-oe-linux/7.2.0/ld: warning: libclass_loader.so, needed by /home/rojkov/work/ros/build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so, not found (try using -rpath or -rpath-link)
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot-native/usr/bin/i586-oe-linux/../../libexec/i586-oe-linux/gcc/i586-oe-linux/7.2.0/ld: warning: libroslib.so, needed by /home/rojkov/work/ros/build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so, not found (try using -rpath or -rpath-link)
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::ClassLoader::isLibraryLoaded()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::loadLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::MultiLibraryClassLoader(bool)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `ros::package::getPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::systemLibrarySuffix[abi:cxx11]()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::class_loader_private::AbstractMetaObjectBase::isOwnedBy(class_loader::ClassLoader const*)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::class_loader_private::getFactoryMapForBaseClass(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::getAllAvailableClassLoaders()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::ClassLoader::hasUnmanagedInstanceBeenCreated()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::ClassLoader::unloadLibraryInternal(bool)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::unloadLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::class_loader_private::getPluginBaseToFactoryMapMapMutex()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::getRegisteredLibraries[abi:cxx11]()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `ros::package::getPlugins(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, bool)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::~MultiLibraryClassLoader()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::ClassLoader::loadLibrary()'
because of wrong value of -Wl,-rpath provided to the cross-linker.
This patch makes use of -Wl,-rpath-link option added unconditionally to all
catkin-based builds to aleviate the problem.
NB: The proper fix though should either replace -Wl,-rpath with
-Wl,-rpath-link where it's needed or use correct path to target
libs in -Wl,-rpath.
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-08-28 22:11:08 +08:00
|
|
|
# Having a command like `find_package(catkin COMPONENTS roscpp)` in a package's CMakeLists.txt
|
|
|
|
# leads to adding "-Wl,-rpath=${RECIPE_SYSROOT}${ros_libdir}" option to the cross-linker.
|
|
|
|
# However starting from binutils 2.29 the cross-linker prepends this path with the value
|
|
|
|
# of --sysroot option thus producing wrong effective path (see https://sourceware.org/ml/binutils/2017-03/msg00161.html)
|
|
|
|
# These options help to aleviate the problem.
|
|
|
|
OECMAKE_C_LINK_FLAGS += "-Wl,-rpath-link=${RECIPE_SYSROOT}${ros_libdir}"
|
|
|
|
OECMAKE_CXX_LINK_FLAGS += "-Wl,-rpath-link=${RECIPE_SYSROOT}${ros_libdir}"
|
|
|
|
|
2013-02-15 22:49:59 +08:00
|
|
|
export BUILD_SYS
|
|
|
|
export HOST_SYS
|
|
|
|
|
2013-04-04 16:45:46 +08:00
|
|
|
SYSROOT_PREPROCESS_FUNCS += "catkin_sysroot_preprocess"
|
|
|
|
catkin_sysroot_preprocess () {
|
2014-08-15 03:29:02 +08:00
|
|
|
sysroot_stage_dir ${D}${ros_sysconfdir} ${SYSROOT_DESTDIR}${ros_sysconfdir}
|
2013-04-04 16:45:46 +08:00
|
|
|
}
|