SAMA5D4 Xplained Ultra Board BSP
guowenxue
2019-08-05 2c01607fdda70734dd04e0db3cd3ecb8d741b4c7
Add libconfig libevent stunnel zlib build shell script
1 files modified
3 files added
303 ■■■■■ changed files
3rdparty/libconfig/build.sh 95 ●●●●● patch | view | raw | blame | history
3rdparty/libevent/build.sh 95 ●●●●● patch | view | raw | blame | history
3rdparty/stunnel/build.sh 112 ●●●●● patch | view | raw | blame | history
3rdparty/zlib/build.sh 1 ●●●● patch | view | raw | blame | history
3rdparty/libconfig/build.sh
New file
@@ -0,0 +1,95 @@
#!/bin/bash
#+--------------------------------------------------------------------------------------------
#|Description:  This shell script used download and compile libconfig 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 CXX=${CROSSTOOL}g++
    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_libconfig()
{
    SRC_NAME=libconfig-1.7.2
    PACK_SUFIX=tar.gz
    if [ -f ${PREFIX_PATH}/lib/libconfig.so ] ; then
        return 0;
    fi
    msg_banner "Start cross compile $SRC_NAME "
    if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then
        #wget http://hyperrealm.github.io/libconfig/dist/${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}
    export "CFLAGS+=-undefHAVE_USELOCALE"
    ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS}
    check_result "ERROR: configure ${SRC_NAME} failure"
    make && make install
    check_result "ERROR: compile ${SRC_NAME} failure"
    cd -
}
export_cross
compile_libconfig
3rdparty/libevent/build.sh
New file
@@ -0,0 +1,95 @@
#!/bin/bash
#+--------------------------------------------------------------------------------------------
#|Description:  This shell script used download and compile libevent 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 CXX=${CROSSTOOL}g++
    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_libevent()
{
    SRC_NAME=libevent-2.1.11-stable
    PACK_SUFIX=tar.gz
    if [ -f ${PREFIX_PATH}/lib/libevent.so ] ; then
        return 0;
    fi
    msg_banner "Start cross compile $SRC_NAME "
    if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then
        #wget https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/${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=${PREFIX_PATH} ${CONFIG_CROSS}  --enable-thread-support --enable-openssl --enable-function-sections
    check_result "ERROR: configure ${SRC_NAME} failure"
    make  && make install
    check_result "ERROR: compile ${SRC_NAME} failure"
    cd -
}
export_cross
compile_libevent
3rdparty/stunnel/build.sh
New file
@@ -0,0 +1,112 @@
#!/bin/bash
#+--------------------------------------------------------------------------------------------
#|Description:  This shell script used download and compile stunnel for ARM
#|     Author:  GuoWenxue <guowenxue@gmail.com>
#|  ChangeLog:
#|           1, Initialize 1.0.0 on 2018.08.16
#+--------------------------------------------------------------------------------------------
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 CXX=${CROSSTOOL}g++
    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_stunnel()
{
    SRC_NAME=stunnel-5.55
    PACK_SUFIX=tar.gz
    if [ -f ${PREFIX_PATH}/bin/stunnel ] ; then
        return 0;
    fi
    msg_banner "Start cross compile $SRC_NAME "
    if [ ! -f ${SRC_NAME}.${PACK_SUFIX} ] ; then
        wget http://www.usenix.org.uk/mirrors/stunnel/${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}
    # fix can't load library 'libssp.so.0' bug
    sed -i -e "s/fstack-protector/pthread/g" configure
    ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS} --enable-static --disable-shared --disable-largefile --disable-ipv6 \
       --disable-systemd --disable-libwrap --with-ssl=${PREFIX_PATH}  CFLAGS="-DHAVE_GETNAMEINFO -UHAVE_DAEMON "
    check_result "ERROR: configure ${SRC_NAME} failure"
    sed -i -e "s|^LDFLAGS =.*|LDFLAGS =-static|g" src/Makefile
    sed -i -e "s|^#define HAVE_DAEMON.*|#undef HAVE_DAEMON|g" src/config.h
    make
    check_result "ERROR: compile ${SRC_NAME} failure"
    ${STRIP} src/stunnel
    cp src/stunnel ${PREFIX_PATH}/bin
    cd -
}
if [ ! -f ${PREFIX_PATH}/lib/libcrypto.so ] ; then
    cd ../openssl
    ./build.sh
    cd -
fi
export_cross
compile_stunnel
3rdparty/zlib/build.sh
@@ -7,7 +7,6 @@
#|           1, Initialize 1.0.0 on 2011.04.12
#+--------------------------------------------------------------------------------------------
PRJ_PATH=`pwd`
PREFIX_PATH=`pwd`/../install/
LYFTP_SRC=ftp://master.iot-yun.club/src/