Annotation of elwix/addpkg_gmake2frm.sh, revision 1.2

1.2     ! misho       1: #!/bin/sh
        !             2: #
        !             3: # ELWIX test build script for cross compile 3th party software and 
        !             4: #      adds to second firmware image if its ok.
        !             5: #
        !             6: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
        !             7: #    by Michael Pounov <misho@elwix.org>
        !             8: #
        !             9: # $Id: addpkg_gmake2frm.sh,v 1.1.2.1 2017/10/08 09:54:58 misho Exp $
        !            10: #
        !            11: 
        !            12: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
        !            13: if [ ! -r ./config/rc.3thparty_helper ]; then
        !            14:        echo
        !            15:        echo "ELWIX project is not configured - Missing rc.3thparty_helper script"
        !            16:        echo
        !            17:        exit 1
        !            18: fi
        !            19: 
        !            20: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
        !            21:        echo
        !            22:        echo "ELWIX project is not configured !?!"
        !            23:        echo
        !            24:        exit 1
        !            25: fi
        !            26: V=${VERSION}
        !            27: [ -r ${CENV} ] && . ${CENV}
        !            28: unset INSTALL
        !            29: unset VERSION
        !            30: VERSION="$V"
        !            31: 
        !            32: if [ ! -d $BSDSRC ]; then
        !            33:        echo
        !            34:        echo "ELWIX project is not configured - missing BSD sources !?!"
        !            35:        echo
        !            36:        exit 1
        !            37: fi
        !            38: 
        !            39: if [ ! -d $DEST ]; then
        !            40:        echo
        !            41:        echo "ELWIX project is not configured - missing Dest directory !?!"
        !            42:        echo
        !            43:        exit 1
        !            44: fi
        !            45: 
        !            46: compile_3th()
        !            47: {
        !            48:        echo "+++ Compile ELWIX 3th party software ..."
        !            49: 
        !            50:        BUILD_SH="./config/rc.3thparty_helper"
        !            51: 
        !            52:        ENVS=""
        !            53:        NAME=${1}
        !            54:        shift
        !            55:        if [ -n "${1}" ]; then
        !            56:                ENVS="env $*"
        !            57:                echo "+ Adds to environment ${ENVS}"
        !            58:        fi
        !            59: 
        !            60:        echo "+ Using cross compiler script ${CGBUILD}"
        !            61:        ${ENVS} ${BUILD_SH} ${NAME} ${CGBUILD} ${PKG} ${TARGET_BUILD}
        !            62:        [ $? -ne 0 ] && exit 1
        !            63: 
        !            64:        echo "Done."
        !            65: }
        !            66: 
        !            67: 
        !            68: ### main()
        !            69: # ./build_3thpkg.sh <name> [make] [env varz ...]
        !            70: install -d ${PKG}
        !            71: install -d ${PKG}/bin
        !            72: install -d ${PKG}/etc
        !            73: install -d ${PKG}/include
        !            74: install -d ${PKG}/man
        !            75: install -d ${PKG}/lib
        !            76: install -d ${PKG}/libexec
        !            77: install -d ${PKG}/sbin
        !            78: 
        !            79: install -d ${ROMFS_USR2}
        !            80: install -d ${ROMFS_USR2}/bin
        !            81: install -d ${ROMFS_USR2}/etc
        !            82: install -d ${ROMFS_USR2}/lib
        !            83: install -d ${ROMFS_USR2}/libexec
        !            84: install -d ${ROMFS_USR2}/sbin
        !            85: 
        !            86: compile_3th $*

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>