From 5a52155065e90d67faf6a0313eccb33d09b43b84 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 3 May 2022 12:55:05 +0200 Subject: [PATCH] updated win helper scripts --- scripts/win-q7s-env-em.sh | 58 +++++++++++++++++++++++++++++++++++++++ scripts/win-q7s-env.sh | 10 ++++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 scripts/win-q7s-env-em.sh diff --git a/scripts/win-q7s-env-em.sh b/scripts/win-q7s-env-em.sh new file mode 100644 index 00000000..8c15f2c9 --- /dev/null +++ b/scripts/win-q7s-env-em.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# Run with: source win-q7s-env.sh [OPTIONS] +function help () { + echo "source win-q7s-env.sh [options] -t|--toolchain= -s|--sysroot=" +} + +TOOLCHAIN_PATH="/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin" +SYSROOT="/c/Users/${USER}/eive-software/eive-compile-rootfs" +export EIVE_Q7S_EM=1 + +for i in "$@"; do + case $i in + -t=*|--toolchain=*) + TOOLCHAIN_PATH="${i#*=}" + shift + ;; + -s=*|--sysroot=*) + SYSROOT="${i#*=}" + shift + ;; + -h|--help) + help + shift + ;; + -*|--*) + echo "Unknown option $i" + help + return + ;; + *) + ;; + esac +done + +if [ -d "$TOOLCHAIN_PATH" ]; then + export PATH=$PATH:"/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin" + export CROSS_COMPILE="arm-linux-gnueabihf" + echo "Set toolchain path to /c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin" +else + echo "Toolchain path $TOOLCHAIN_PATH does not exist" + return +fi + +if [ -d "$SYSROOT" ]; then + export ZYNQ_7020_SYSROOT=$SYSROOT + echo "Set sysroot path to $SYSROOT" +else + echo "Sysroot path $SYSROOT does not exist" + return +fi + +if [ -d "eive-obsw" ]; then + echo "Detected EIVE OBSW root directory at $(pwd)/eive-obsw. Setting to EIVE_OBSW_ROOT" + export EIVE_OBSW_ROOT="$(pwd)/eive-obsw" + echo "Adding $(pwd)/eive-obsw/cmake/scripts/q7s helper script path to PATH" + export PATH=$PATH:"$(pwd)/eive-obsw/cmake/scripts/q7s" + cd "eive-obsw" +fi diff --git a/scripts/win-q7s-env.sh b/scripts/win-q7s-env.sh index 77a3b91f..292b09c9 100644 --- a/scripts/win-q7s-env.sh +++ b/scripts/win-q7s-env.sh @@ -6,7 +6,7 @@ function help () { TOOLCHAIN_PATH="/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin" SYSROOT="/c/Users/${USER}/eive-software/eive-compile-rootfs" -EIVE_Q7S_EM=1 +# export EIVE_Q7S_EM=1 for i in "$@"; do case $i in @@ -48,3 +48,11 @@ else echo "Sysroot path $SYSROOT does not exist" return fi + +if [ -d "eive-obsw" ]; then + echo "Detected EIVE OBSW root directory at $(pwd)/eive-obsw. Setting to EIVE_OBSW_ROOT" + export EIVE_OBSW_ROOT="$(pwd)/eive-obsw" + echo "Adding $(pwd)/eive-obsw/cmake/scripts/q7s helper script path to PATH" + export PATH=$PATH:"$(pwd)/eive-obsw/cmake/scripts/q7s" + cd "eive-obsw" +fi