Merge "kcargo.sh: honor SEL4_OUT_DIR from the environment"
diff --git a/kcargo.sh b/kcargo.sh
index 8664a72..b058374 100755
--- a/kcargo.sh
+++ b/kcargo.sh
@@ -24,7 +24,7 @@
 
 # HACK: sel4-config needs a path to the kernel build which could be
 #   in debug or release
-export SEL4_OUT_DIR="$ROOTDIR/out/kata/riscv32-unknown-elf/debug/kernel/"
+export SEL4_OUT_DIR=${SEL4_OUT_DIR:-"$ROOTDIR/out/kata/riscv32-unknown-elf/debug/kernel/"}
 if [[ ! -d "${SEL4_OUT_DIR}/gen_config" ]]; then
     echo "No kernel build found at ${SEL4_OUT_DIR}; build a kernel first"
     exit 2