From 6c7c7361ce4c81beb961c83280cf2a77b1b6810b Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Mon, 05 Aug 2019 19:26:51 +0800
Subject: [PATCH] Add tslib, iconv build shell script for QT, and add curl build shell script

---
 3rdparty/iconv/build.sh    |   92 ++++++++++++++++++
 3rdparty/curl/build.sh     |   98 +++++++++++++++++++
 3rdparty/qt/tslib/build.sh |   90 ++++++++++++++++++
 3 files changed, 280 insertions(+), 0 deletions(-)

diff --git a/3rdparty/curl/build.sh b/3rdparty/curl/build.sh
new file mode 100755
index 0000000..dea2328
--- /dev/null
+++ b/3rdparty/curl/build.sh
@@ -0,0 +1,98 @@
+#!/bin/bash
+
+#+--------------------------------------------------------------------------------------------
+#|Description:  This shell script used download and compile curl for ARM
+#|     Author:  GuoWenxue <guowenxue@gmail.com>
+#|  ChangeLog:
+#|           1, Initialize 1.0.0 on 2011.04.12
+#+--------------------------------------------------------------------------------------------
+
+PREFIX_PATH=`pwd`/../install/
+
+LYFTP_SRC=ftp://master.iot-yun.club/src/
+
+if [ -z $CROSSTOOL ] ; then
+   CROSSTOOL=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi-
+fi
+
+function msg_banner()
+{
+    echo ""
+    echo "+-----------------------------------------------------------------------"
+    echo "|  $1 "
+    echo "+-----------------------------------------------------------------------"
+    echo ""
+}
+
+function check_result()
+{
+    if [ $? != 0 ] ; then
+       echo ""
+       echo "+-----------------------------------------------------------------------"
+       echo "|  $1 "
+       echo "+-----------------------------------------------------------------------"
+       echo ""
+       exit ;
+    fi
+}
+
+function export_cross()
+{
+    # export cross toolchain
+    export CC=${CROSSTOOL}gcc
+    export AS=${CROSSTOOL}as
+    export AR=${CROSSTOOL}ar
+    export LD=${CROSSTOOL}ld
+    export NM=${CROSSTOOL}nm
+    export RANLIB=${CROSSTOOL}ranlib
+    export OBJDUMP=${CROSSTOOL}objdump
+    export STRIP=${CROSSTOOL}strip
+
+    # export cross configure 
+    export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux "
+
+    # Clear LDFLAGS and CFLAGS
+    export LDFLAGS=
+    export CFLAGS=
+}
+
+
+function compile_curl()
+{
+    SRC_NAME=curl-7.65.3
+    PACK_SUFIX=tar.gz
+
+    if [ -f ${PREFIX_PATH}/bin/curl ] ; then
+        return 0;
+    fi
+
+    msg_banner "Start donwload $SRC_NAME "
+    if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then
+        #wget https://github.com/curl/curl/releases/download/curl-7_65_3/${SRC_NAME}.${PACK_SUFIX}
+        wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX}
+        check_result "ERROR: download ${SRC_NAME} failure"
+    fi
+
+    tar -xzf ${SRC_NAME}.${PACK_SUFIX}
+    cd ${SRC_NAME}
+
+    msg_banner "Start cross compile $SRC_NAME "
+
+    ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static
+
+    check_result "ERROR: configure ${SRC_NAME} failure"
+
+    make && make install
+    check_result "ERROR: compile ${SRC_NAME} failure"
+
+
+    ${STRIP} ${PREFIX_PATH}/bin/curl
+
+    cd -
+}
+
+export_cross
+
+compile_curl
+
+
diff --git a/3rdparty/iconv/build.sh b/3rdparty/iconv/build.sh
new file mode 100755
index 0000000..99fc8e4
--- /dev/null
+++ b/3rdparty/iconv/build.sh
@@ -0,0 +1,92 @@
+#!/bin/bash
+
+#+--------------------------------------------------------------------------------------------
+#|Description:  This shell script used download and compile libiconv for ARM
+#|     Author:  GuoWenxue <guowenxue@gmail.com>
+#|  ChangeLog:
+#|           1, Initialize 1.0.0 on 2011.04.12
+#+--------------------------------------------------------------------------------------------
+
+PROJ_PATH=`pwd`/../
+INST_PATH=${PROJ_PATH}/install
+
+CROSSTOOL=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi-
+
+LYFTP_SRC=ftp://master.iot-yun.club/src/
+
+function msg_banner()
+{
+    echo ""
+    echo "+-----------------------------------------------------------------------"
+    echo "|  $1 "
+    echo "+-----------------------------------------------------------------------"
+    echo ""
+}
+
+function check_result()
+{
+    if [ $? != 0 ] ; then
+       echo ""
+       echo "+-----------------------------------------------------------------------"
+       echo "|  $1 "
+       echo "+-----------------------------------------------------------------------"
+       echo ""
+       exit ;
+    fi
+}
+
+function export_cross()
+{
+    # export cross toolchain
+    export CC=${CROSSTOOL}gcc
+    export AS=${CROSSTOOL}as
+    export AR=${CROSSTOOL}ar
+    export LD=${CROSSTOOL}ld
+    export NM=${CROSSTOOL}nm
+    export RANLIB=${CROSSTOOL}ranlib
+    export OBJDUMP=${CROSSTOOL}objdump
+    export STRIP=${CROSSTOOL}strip
+
+    # export cross configure 
+    export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux "
+
+    # Clear LDFLAGS and CFLAGS
+    export LDFLAGS=
+    export CFLAGS=
+}
+
+
+function compile_libiconv()
+{
+    SRC_NAME=libiconv-1.15
+    PACK_SUFIX=tar.gz
+
+    if [ -f ${INST_PATH}/lib/libiconv.so ] ; then
+        msg_banner "Already cross compile $SRC_NAME "
+        return 0;
+    fi
+
+    msg_banner "Start cross compile $SRC_NAME "
+
+    if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then
+        #wget https://ftp.gnu.org/gnu/libiconv/${SRC_NAME}.${PACK_SUFIX}
+        wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX}
+        check_result "ERROR: download ${SRC_NAME} failure"
+    fi
+
+    tar -xzf ${SRC_NAME}.${PACK_SUFIX} 
+    cd ${SRC_NAME}
+
+    ./configure --prefix=${INST_PATH} ${CONFIG_CROSS}
+    make && make install
+
+    cd -
+}
+
+
+export_cross
+
+compile_libiconv
+
+
+
diff --git a/3rdparty/qt/tslib/build.sh b/3rdparty/qt/tslib/build.sh
new file mode 100755
index 0000000..4e8fd58
--- /dev/null
+++ b/3rdparty/qt/tslib/build.sh
@@ -0,0 +1,90 @@
+#!/bin/bash
+
+#+--------------------------------------------------------------------------------------------
+#|Description:  This shell script used download and compile QT5 for ARM
+#|     Author:  GuoWenxue <guowenxue@gmail.com>
+#|  ChangeLog:
+#|           1, Initialize 1.0.0 on 2011.04.12
+#+--------------------------------------------------------------------------------------------
+
+PROJ_PATH=`pwd`/..
+INST_PATH=${PROJ_PATH}/../install
+
+CROSSTOOL=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi-
+LYFTP_SRC=ftp://master.iot-yun.club/src/
+
+function msg_banner()
+{
+    echo ""
+    echo "+-----------------------------------------------------------------------"
+    echo "|  $1 "
+    echo "+-----------------------------------------------------------------------"
+    echo ""
+}
+
+function check_result()
+{
+    if [ $? != 0 ] ; then
+       echo ""
+       echo "+-----------------------------------------------------------------------"
+       echo "|  $1 "
+       echo "+-----------------------------------------------------------------------"
+       echo ""
+       exit ;
+    fi
+}
+
+function export_cross()
+{
+    # export cross toolchain
+    export CC=${CROSSTOOL}gcc
+    export AS=${CROSSTOOL}as
+    export AR=${CROSSTOOL}ar
+    export LD=${CROSSTOOL}ld
+    export NM=${CROSSTOOL}nm
+    export RANLIB=${CROSSTOOL}ranlib
+    export OBJDUMP=${CROSSTOOL}objdump
+    export STRIP=${CROSSTOOL}strip
+
+    # export cross configure 
+    export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux "
+
+    # Clear LDFLAGS and CFLAGS
+    export LDFLAGS=
+    export CFLAGS=
+}
+
+function compile_tslib()
+{
+    SRC_NAME=tslib-1.16
+    PACK_SUFIX=tar.bz2
+
+
+    if [ -f ${INST_PATH}/lib/libts.so ] ; then
+        msg_banner "Already cross compile $SRC_NAME "
+        return 0;
+    fi
+
+    msg_banner "Start cross compile $SRC_NAME "
+
+    if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then
+        #wget https://gitlab.com/tslib/tslib/uploads/021755cde4aba79478464459c8a2122c/${SRC_NAME}.${PACK_SUFIX}
+        wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX}
+        check_result "ERROR: download ${SRC_NAME} failure"
+    fi
+
+    tar -xjf ${SRC_NAME}.${PACK_SUFIX} 
+    cd ${SRC_NAME}
+
+    ./configure --prefix=${INST_PATH} ${CONFIG_CROSS}
+    make && make install
+
+    cd -
+}
+
+
+export_cross
+
+compile_tslib
+
+

--
Gitblit v1.9.1