LingYun open library local/cross compile shell scripts
guowenxue
yesterday 1ee652137c90cec0c3ff4ea34194cdf7d98202e6
update table to space for all the build shell scripts
16 files modified
157 ■■■■■ changed files
busybox/build.sh 3 ●●●● patch | view | raw | blame | history
cjson/build.sh 3 ●●●● patch | view | raw | blame | history
libevdev/build.sh 13 ●●●●● patch | view | raw | blame | history
libevent/build.sh 3 ●●●● patch | view | raw | blame | history
libgpiod/build.sh 1 ●●●● patch | view | raw | blame | history
libxml2/build.sh 3 ●●●● patch | view | raw | blame | history
lrzsz/build.sh 7 ●●●●● patch | view | raw | blame | history
lvgl/build.sh 19 ●●●●● patch | view | raw | blame | history
mosquitto/build.sh 24 ●●●● patch | view | raw | blame | history
opencv/build.sh 4 ●●●● patch | view | raw | blame | history
openssl/build.sh 1 ●●●● patch | view | raw | blame | history
pppd/build.sh 16 ●●●● patch | view | raw | blame | history
qt/build.sh 46 ●●●● patch | view | raw | blame | history
sqlite/build.sh 1 ●●●● patch | view | raw | blame | history
stunnel/build.sh 12 ●●●●● patch | view | raw | blame | history
valgrind/build.sh 1 ●●●● patch | view | raw | blame | history
busybox/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
@@ -162,7 +163,7 @@
    make -j ${JOBS} CROSS_COMPILE=$CROSS_COMPILE
    check_result "ERROR: compile ${LIB_NAME} failure"
    cp busybox $PREFIX_PATH/bin
    install -m 755 -D busybox $PREFIX_PATH/bin/busybox
}
function do_clean()
cjson/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
@@ -162,7 +163,7 @@
    make && make PREFIX=$PREFIX_PATH install
    check_result "ERROR: compile ${LIB_NAME} failure"
    cp libcjson.a $PREFIX_PATH/lib
    install -D libcjson.a $PREFIX_PATH/lib/libcjson.a
}
function do_clean()
libevdev/build.sh
@@ -30,6 +30,9 @@
# download taballs path
TARBALL_PATH=$PRJ_PATH/tarballs
# check installed or not file
INST_FILE=$PREFIX_PATH/lib/libevdev.so
# shell script will exit once get command error
set -e
@@ -64,6 +67,11 @@
function do_fetch()
{
    if [ -e ${INST_FILE} ] ; then
        pr_warn "$LIB_NAME compiled already, exit..."
        exit;
    fi
    if [ -d $LIB_NAME ] ; then
        pr_warn "$LIB_NAME source code fetched already"
        return 0;
@@ -119,11 +127,6 @@
    exit;
fi
if [ -e $PREFIX_PATH/lib/libevdev.so ] ; then
    pr_warn "$LIB_NAME compiled already, exit..."
    exit;
fi
do_fetch
do_export
libevent/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
@@ -161,7 +162,7 @@
        --enable-thread-support --enable-openssl --enable-function-sections
    check_result "ERROR: configure ${LIB_NAME} failure"
    make && make install
    make -j ${JOBS} && make install
    check_result "ERROR: compile ${LIB_NAME} failure"
}
libgpiod/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
libxml2/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
@@ -161,7 +162,7 @@
        --without-python --without-zlib --without-lzma
    check_result "ERROR: configure ${LIB_NAME} failure"
    make && make install
    make -j ${JOBS} && make install
    check_result "ERROR: compile ${LIB_NAME} failure"
}
lrzsz/build.sh
@@ -160,11 +160,12 @@
    ./configure --prefix=${PREFIX_PATH} ${CONFIG_CROSS}
    check_result "ERROR: configure ${LIB_NAME} failure"
    make
    make -j ${JOBS}
    check_result "ERROR: compile ${LIB_NAME} failure"
    cp src/lsz ${BIN_PATH}/sz
    cp src/lrz ${BIN_PATH}/rz
    mkdir -p $BIN_PATH
    install -m 755 -D src/lsz ${BIN_PATH}/sz
    install -m 755 -D src/lrz ${BIN_PATH}/rz
}
function do_clean()
lvgl/build.sh
@@ -30,6 +30,9 @@
# download taballs path
TARBALL_PATH=$PRJ_PATH/tarballs
# check installed or not file
INST_FILE=$PREFIX_PATH/bin/lvglsim
# shell script will exit once get command error
set -e
@@ -66,6 +69,11 @@
function do_fetch()
{
    if [ -e ${INST_FILE} ] ; then
        pr_warn "$LIB_NAME compiled already, exit..."
        exit;
    fi
    if [ -d $LIB_NAME/lvgl ] ; then
        pr_warn "$LIB_NAME source code fetched already"
        return 0;
@@ -115,7 +123,7 @@
    if [ ! -f "$BUILD_DIR/CMakeCache.txt" ]; then
        pr_info "configuring cmake..."
        cmake -B "$BUILD_DIR" -S . -DCMAKE_TOOLCHAIN_FILE=./user_cross_compile_setup.cmake
        cmake -B "$BUILD_DIR" -S . -DCMAKE_TOOLCHAIN_FILE=./user_cross_compile_setup.cmake -DCMAKE_INSTALL_PREFIX=${PREFIX_PATH}
    else
        pr_warn "cmake already configured"
    fi
@@ -123,6 +131,9 @@
    pr_info "building..."
    cmake --build "$BUILD_DIR" -j$(nproc)
    cmake --install build
    install -m 755 -D build/bin/lvglsim $PREFIX_PATH/bin/lvglsim
    cd "$PRJ_PATH" || exit 1
}
@@ -147,11 +158,6 @@
    exit;
fi
if [ -e $LIB_NAME/build/bin/lvglsim  ] ; then
    pr_warn "$LIB_NAME compiled already, exit..."
    exit;
fi
do_depends
do_fetch
@@ -161,3 +167,4 @@
do_patch
do_build
mosquitto/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
@@ -161,14 +162,27 @@
    export LDFLAGS="-L${PREFIX_PATH}/lib -lcrypto -lssl -ldl -lpthread"
    export DESTDIR=${PREFIX_PATH}
    make WITH_UUID=no WITH_STATIC_LIBRARIES=yes
    make -j ${JOBS} WITH_UUID=no WITH_STATIC_LIBRARIES=yes
    check_result "ERROR: compile ${LIB_NAME} failure"
    make DESTDIR=${PREFIX_PATH} prefix=/ install
    make -j ${JOBS} DESTDIR=${PREFIX_PATH} prefix=/ install
    check_result "ERROR: compile ${LIB_NAME} failure"
    install -m 755 src/mosquitto $BIN_PATH
    install -m 644 lib/libmosquitto.a $LIB_PATH
    install -m 755 -D src/mosquitto $BIN_PATH/mosquitto
    install -m 644 -D lib/libmosquitto.a $LIB_PATH/libmosquitto.a
}
function do_depend()
{
    cd $TOP_PATH/openssl || exit 1
    pr_info "build depend openssl..."
    ./build.sh
    cd $TOP_PATH/cjson || exit 1
    pr_info "build depend cjson..."
    ./build.sh
    cd $PRJ_PATH || exit 1
}
function do_clean()
@@ -182,6 +196,8 @@
    exit;
fi
do_depend
do_fetch
do_build
opencv/build.sh
@@ -30,7 +30,7 @@
INC_PATH=$PREFIX_PATH/include
# check installed or not file
INST_FILE=$PREFIX_PATH/lib/opencv
INST_FILE=$PREFIX_PATH/lib/libopencv_core.so
# shell script will exit once get command error
set -e
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
@@ -192,6 +193,5 @@
do_fetch
do_build
openssl/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
pppd/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
@@ -172,8 +173,17 @@
    check_result "ERROR: compile ${LIB_NAME} failure"
    pr_info "${LIB_NAME} installed to '${BIN_PATH}'"
    install -m 755 pppd/pppd ${BIN_PATH}
    install -m 755 chat/chat ${BIN_PATH}
    install -m 755 pppd/pppd -D ${BIN_PATH}/pppd
    install -m 755 chat/chat -D ${BIN_PATH}/chat
}
function do_depend()
{
    cd $TOP_PATH/openssl || exit 1
    pr_info "build depend openssl..."
    ./build.sh
    cd $PRJ_PATH || exit 1
}
function do_clean()
@@ -187,6 +197,8 @@
    exit;
fi
do_depend
do_fetch
do_build
qt/build.sh
@@ -2,7 +2,11 @@
#+--------------------------------------------------------------------------------------------
#|   WARNNING:  QT >= 5.7 need crosstool g++ support C++11 support
#|              QT configure need host g++ support C++11, so need config g++ on ubuntu host:
#|              sudo update-alternatives --config g++
#|
#| guowenxue@ubuntu22:~$ sudo apt install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
#| guowenxue@ubuntu22:~$ sudo update-alternatives --config g++
#| guowenxue@ubuntu22:~$ arm-linux-gnueabihf-g++ -v
#| gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.3)
#+--------------------------------------------------------------------------------------------
# library name and version
@@ -11,14 +15,11 @@
SRC_NAME=qt-everywhere-src-5.15.10
PACK_SUFIX=tar.xz
# LingYun source code FTP server
LY_FTP=http://master.weike-iot.com:8021/src/qt
# library download URL address
LIB_URL=$LY_FTP
LIB_URL=http://master.weike-iot.com:8021/src/qt
# Cross compiler for cross compile on Linux server
CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf-
# QT should use this cross compiler
CROSS_TOOLS=arm-linux-gnueabihf-
# compile jobs
JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l`
@@ -36,7 +37,7 @@
INC_PATH=$PREFIX_PATH/include
# check installed or not file
INST_FILE=$PREFIX_PATH/lib/libQt5Core.so
INST_FILE=$PREFIX_PATH/lib/libqlinuxfb.so
# shell script will exit once get command error
set -e
@@ -63,6 +64,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
@@ -116,18 +118,18 @@
        return ;
    fi
    pr_warn "cross(${CROSS_COMPILE}) compile $LIB_NAME"
    pr_warn "cross(${CROSS_TOOLS}) compile $LIB_NAME"
    # export cross toolchain
    export CC=${CROSS_COMPILE}gcc
    export CXX=${CROSS_COMPILE}g++
    export AS=${CROSS_COMPILE}as
    export AR=${CROSS_COMPILE}ar
    export LD=${CROSS_COMPILE}ld
    export NM=${CROSS_COMPILE}nm
    export RANLIB=${CROSS_COMPILE}ranlib
    export OBJDUMP=${CROSS_COMPILE}objdump
    export STRIP=${CROSS_COMPILE}strip
    export CC=${CROSS_TOOLS}gcc
    export CXX=${CROSS_TOOLS}g++
    export AS=${CROSS_TOOLS}as
    export AR=${CROSS_TOOLS}ar
    export LD=${CROSS_TOOLS}ld
    export NM=${CROSS_TOOLS}nm
    export RANLIB=${CROSS_TOOLS}ranlib
    export OBJDUMP=${CROSS_TOOLS}objdump
    export STRIP=${CROSS_TOOLS}strip
    # export cross configure
    export CONFIG_CROSS=" --build=i686-pc-linux --host=arm-linux "
@@ -164,14 +166,14 @@
    QMAKE_FILE=qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf
    set +e
    grep "`basename ${CROSS_COMPILE}`" ${QMAKE_FILE} > /dev/null 2>&1
    grep "`basename ${CROSS_TOOLS}`" ${QMAKE_FILE} > /dev/null 2>&1
    if [ $? != 0 ] ; then
        sed -i "s|arm-linux-gnueabi-|`basename $CROSS_COMPILE`|" ${QMAKE_FILE}
        sed -i "s|arm-linux-gnueabi-|`basename $CROSS_TOOLS`|" ${QMAKE_FILE}
    fi
    set -e
    QT_INST_PATH=$PREFIX_PATH
    export CROSS_SYSROOT=`${CROSS_COMPILE}gcc -print-sysroot`
    export CROSS_SYSROOT=`${CROSS_TOOLS}gcc -print-sysroot`
    ./configure -opensource -confirm-license -release -shared -strip \
        -extprefix ${QT_INST_PATH} -prefix ${QT_INST_PATH} -sysroot ${CROSS_SYSROOT} -pkg-config \
@@ -189,7 +191,7 @@
    make -j${JOBS} && make install
    check_result "ERROR: compile ${LIB_NAME} failure"
    cp ./qtbase/plugins/platforms/libqlinuxfb.so  ${QT_INST_PATH}/lib
    install -D ./qtbase/plugins/platforms/libqlinuxfb.so  ${QT_INST_PATH}/lib/libqlinuxfb.so
    #cp -af ${LIB_PATH}/lib/libts*so* ${QT_INST_PATH}/lib
}
sqlite/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
stunnel/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{
@@ -166,6 +167,15 @@
    check_result "ERROR: compile ${LIB_NAME} failure"
}
function do_depend()
{
    cd $TOP_PATH/openssl || exit 1
    pr_info "build depend openssl..."
    ./build.sh
    cd $PRJ_PATH || exit 1
}
function do_clean()
{
    rm -rf *${LIB_NAME}*
@@ -177,6 +187,8 @@
    exit;
fi
do_depend
do_fetch
do_build
valgrind/build.sh
@@ -57,6 +57,7 @@
        pr_error $1
    fi
}
# decompress a packet to destination path
function do_unpack()
{