From 9d1e0dcc61af68410c3662c64553c8235385d4d1 Mon Sep 17 00:00:00 2001
From: zxstty <zhaojiaqi18@huawei.com>
Date: Thu, 9 Nov 2023 11:10:52 +0800
Subject: [PATCH] 0001

---
 build_scripts/build.sh | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/build_scripts/build.sh b/build_scripts/build.sh
index cd2ab20..51f2e5e 100755
--- a/build_scripts/build.sh
+++ b/build_scripts/build.sh
@@ -109,8 +109,27 @@ case $(uname -s) in
         exit $RET
 esac
 
+args=$@
+while test $# -gt 0
+do
+	case "$1" in --product-name)
+		shift
+		product_name=$1
+		;;
+	*)
+		shift
+		;;
+	esac
+done
+
 # set python3
-PYTHON3_DIR=${source_root_dir}/prebuilts/python/${HOST_DIR}/3.9.2/
+if [ "$product_name" == "openeuler" ]; then
+	PYTHON3_DIR=/usr
+	LLD_PATH=/usr/lib64/llvm15/bin
+else
+  PYTHON3_DIR=${source_root_dir}/prebuilts/python/${HOST_DIR}/3.9.2/
+	LLD_PATH=""
+fi
 PYTHON3=${PYTHON3_DIR}/bin/python3
 PYTHON=${PYTHON3_DIR}/bin/python
 if [[ ! -f "${PYTHON3}" ]]; then
@@ -122,11 +141,11 @@ else
   fi
 fi
 
-export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:$PATH
+export PATH=${source_root_dir}/prebuilts/build-tools/${HOST_DIR}/bin:${PYTHON3_DIR}/bin:${LLD_PATH}:$PATH
 
 ${PYTHON3} ${source_root_dir}/build/scripts/tools_checker.py
 
-${PYTHON3} ${source_root_dir}/build/scripts/entry.py --source-root-dir ${source_root_dir} $@
+${PYTHON3} ${source_root_dir}/build/scripts/entry.py --source-root-dir ${source_root_dir} $args
 
 if [[ "$?" -ne 0 ]]; then
     echo -e "\033[31m=====build ${product_name} error=====\033[0m"
-- 
2.33.0

