zte's code,first commit
Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/ap/build/env_check.sh b/ap/build/env_check.sh
new file mode 100755
index 0000000..03bb09d
--- /dev/null
+++ b/ap/build/env_check.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+CMD_SET="gawk gcc bison flex pkg-config"
+PACKAGE_SET=("gawk" "build-essential" "bison" "flex" "pkg-config")
+RET_VALUE=0
+
+function checkCmd()
+{
+ cmd=$1
+ i=$2
+ which $cmd > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ echo "check command $cmd ok"
+ else
+ echo "[ERROR]check command $cmd fail, Maybe run [ sudo apt-get install ${PACKAGE_SET[i]} ] to install"
+ return 1
+ fi
+}
+
+i=0
+for item in $CMD_SET;do
+ checkCmd $item $i
+ if [ $? -ne 0 ]; then
+ RET_VALUE=1
+ fi
+ let "i=i+1"
+done
+
+exit $RET_VALUE
+