From 5e9d03d507aad324a803eb8795e0eed6fb671761 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Mon, 10 Jul 2023 15:24:52 +0800
Subject: [PATCH] Merge branch 'master' of http://master.iot-yun.club:8088/r/raspberrypi

---
 3rdparty/x86/build.sh |   77 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 77 insertions(+), 0 deletions(-)

diff --git a/3rdparty/x86/build.sh b/3rdparty/x86/build.sh
new file mode 100755
index 0000000..b65b4b5
--- /dev/null
+++ b/3rdparty/x86/build.sh
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+CROSSTOOL=arm-linux-gnueabihf-
+
+# display in red
+function pr_error() {
+    echo ""
+    echo -e "\033[40;31m --E-- $1 \033[0m"
+    echo ""
+}
+
+# display in yellow
+function pr_warn() {
+    echo ""
+    echo -e "\033[40;33m --W-- $1 \033[0m"
+    echo ""
+}
+
+# display in green
+function pr_info() {
+    echo -e "\033[40;32m --I-- $1 \033[0m"
+}
+
+function check_depend()
+{
+    ARCH=`uname -m`
+    echo ${ARCH} | grep "x86" > /dev/null
+    if [ $? != 0 ] ; then
+       pr_error  "This folder must compile on X86 server ";
+       exit 1;
+    fi
+
+
+    ${CROSSTOOL}g++ -v > /dev/null 2>&1
+    if [ $? != 0 ] ; then
+        pr_error "Crosstool not installed, please install it by follow command:"
+        pr_info  "sudo apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf"
+        exit 1;
+    fi
+}
+
+function do_compile
+{
+    for dir in `ls`
+    do
+        if [ -f $dir/build*.sh ] ; then
+            cd $dir
+               bash ./build*.sh
+            cd -
+        fi
+    done
+}
+
+function do_clean
+{
+    for dir in `ls`
+    do
+        if [ -f $dir/build*.sh ] ; then
+            cd $dir
+            bash ./build*.sh clean
+            cd -
+        fi
+    done
+
+    rm -rf install
+}
+
+if [[ $# == 1 ]] && [[ $1 == "clean" ]] ; then
+    do_clean
+    exit;
+fi
+
+check_depend
+
+do_compile
+
+

--
Gitblit v1.9.1