scripts: kconfig: kconfigfunctions: use relative ZEPHYR_BASE path
Use a path relative to the script itself to determine the ZEPHYR_BASE path
instead of relying on the environment variable.
This allows for modules to use the Zephyr kconfiglib without having
ZEPHYR_BASE set in the environment.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py
index 16b0d37..fac2d42 100644
--- a/scripts/kconfig/kconfigfunctions.py
+++ b/scripts/kconfig/kconfigfunctions.py
@@ -6,8 +6,9 @@
import os
import pickle
import sys
+from pathlib import Path
-ZEPHYR_BASE = os.environ["ZEPHYR_BASE"]
+ZEPHYR_BASE = str(Path(__file__).resolve().parents[2])
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts", "dts",
"python-devicetree", "src"))