diff --git a/Tools/export.sh b/Tools/export.sh
index a9b9e7facd..81cf497ea8 100755
--- a/Tools/export.sh
+++ b/Tools/export.sh
@@ -18,7 +18,12 @@
 #
 
 if [ -z "$SMING_HOME" ]; then
-    export SMING_HOME=$(readlink -m $BASH_SOURCE/../../Sming)
+    if [ $(basename $SHELL) = "zsh" ]; then
+        _SOURCE=${(%):-%N}
+    else
+        _SOURCE=$BASH_SOURCE
+    fi
+    export SMING_HOME=$(readlink -m $_SOURCE/../../Sming)
 fi
 
 # Common