##################################################################
# Toolchain info.
##################################################################
+
+# This variable is needed to set to 'yes' in conjuction with
+# PREFERRED_VERSION for libtool when choosing libtool >= 2.4
+# by default this is unset and should be so for libtools < 2.4
+
+LIBTOOL_HAS_SYSROOT ?= "no"
+
PATH_prepend = "${STAGING_BINDIR_CROSS}:${STAGING_DIR_NATIVE}${sbindir_native}:${STAGING_BINDIR_NATIVE}:${STAGING_DIR_NATIVE}${base_sbindir_native}:${STAGING_DIR_NATIVE}/${base_bindir_native}:"
export PATH
-Wl,-rpath,${STAGING_LIBDIR_NATIVE} -Wl,-O1"
export LDFLAGS = "${TARGET_LDFLAGS}"
-export TARGET_LDFLAGS = "-L${STAGING_DIR_TARGET}${libdir} \
- -Wl,-rpath-link,${STAGING_DIR_TARGET}${libdir} \
- -Wl,-O1 \
- ${TARGET_LINK_HASH_STYLE}"
+export TARGET_LDFLAGS = '${@["-L${STAGING_DIR_TARGET}${libdir} -Wl,-rpath-link,${STAGING_DIR_TARGET}${libdir} -Wl,-O1 ${TARGET_LINK_HASH_STYLE}", "-Wl,-O1 ${TARGET_LINK_HASH_STYLE}"][bb.data.getVar('LIBTOOL_HAS_SYSROOT', d, 1) == "yes"]}'
+
export SDK_LDFLAGS = "-L${STAGING_DIR_SDK}${libdir} \
-Wl,-rpath-link,${STAGING_DIR_SDK}${libdir} \
-Wl,-O1"