From 436deea97def54db3a1050073fbf345351cdb814 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Tue, 22 Jan 2019 15:10:30 +0100 Subject: sdkenv.sh: bugfix for multiple toolchains in staging_dir Signed-off-by: Toni Uhlig --- sdkenv.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sdkenv.sh') diff --git a/sdkenv.sh b/sdkenv.sh index 8550e527fe..1138d4ab18 100755 --- a/sdkenv.sh +++ b/sdkenv.sh @@ -13,7 +13,14 @@ echo "* CPU TYPE..: ${CPU_TYPE}" TARGET_BOARD="$(cat ${OWRT}/.config | sed -n 's/^CONFIG_TARGET_BOARD="\(.*\)"$/\1/p')" echo "* TARGET....: ${TARGET_BOARD}" -TOOLCHAIN_DIR="$(realpath ${OWRT}/staging_dir/toolchain-${ARCH}_${CPU_TYPE}*)" +GCC_VER="$(cat ${OWRT}/.config | sed -n 's/CONFIG_GCC_VERSION="\(.*\)"$/\1/p')" +echo "* GCC Ver...: ${GCC_VER}" + +LIBC="$(cat ${OWRT}/.config | sed -n 's/CONFIG_LIBC="\(.*\)"$/\1/p')" +echo "* libc......: ${LIBC}" + +# example: toolchain-arm_cortex-a9+vfpv3_gcc-7.4.0_musl_eabi +TOOLCHAIN_DIR="$(realpath ${OWRT}/staging_dir/toolchain-${ARCH}_${CPU_TYPE}_gcc-${GCC_VER}_${LIBC}_*)" echo "* Toolchain.: ${TOOLCHAIN_DIR}" export PATH="${TOOLCHAIN_DIR}/bin:${PATH}" @@ -25,7 +32,7 @@ export CXX="${HOST}-g++" export CFLAGS="-I${TARGET_DIR}/usr/include" export CXXFLAGS="${CFLAGS}" TARGET_DIR_ROOT="$(realpath ${TARGET_DIR}/root-${TARGET_BOARD})" -echo "* Target dir: ${TARGET_DIR_ROOT}" +echo "* Root......: ${TARGET_DIR_ROOT}" export LDFLAGS="-L${TARGET_DIR}/usr/lib -L${TARGET_DIR_ROOT}/usr/lib" export PKG_CONFIG_PATH="${TARGET_DIR}/usr/lib/pkgconfig" export PKG_CONFIG_LIBDIR="${TARGET_DIR}/usr/lib/pkgconfig" -- cgit v1.2.3