Annotation of elwix/build_tools.sh, revision 1.1.2.6

1.1.2.1   misho       1: #!/bin/sh
                      2: #
                      3: # ELWIX build script for cross
                      4: #
                      5: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
                      6: #    by Michael Pounov <misho@elwix.org>
                      7: #
1.1.2.6 ! misho       8: # $Id: build_tools.sh,v 1.1.2.5 2012/03/20 15:47:51 misho Exp $
1.1.2.1   misho       9: #
                     10: 
                     11: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
                     12: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
                     13:        echo
                     14:        echo "ELWIX project is not configured !?!"
                     15:        echo
                     16:        exit 1
                     17: fi
1.1.2.5   misho      18: V=${VERSION}
1.1.2.4   misho      19: [ -r ${CENV} ] && . ${CENV}
1.1.2.5   misho      20: unset INSTALL
                     21: unset VERSION
                     22: VERSION="$V"
1.1.2.1   misho      23: 
                     24: if [ ! -d $BSDSRC ]; then
                     25:        echo
                     26:        echo "ELWIX project is not configured - missing BSD sources !?!"
                     27:        echo
                     28:        exit 1
                     29: fi
                     30: 
                     31: if [ ! -d $DEST ]; then
                     32:        echo
                     33:        echo "ELWIX project is not configured - missing Dest directory !?!"
                     34:        echo
                     35:        exit 1
                     36: fi
                     37: 
                     38: clean_tools()
                     39: {
                     40:        echo "+++ Clean ELWIX FreeBSD tools ..."
                     41: 
                     42:        rm -rf ${WORLD}/usr/local
                     43:        install -d ${WORLD}/usr/local
                     44:        install -d ${WORLD}/usr/local/bin
                     45:        install -d ${WORLD}/usr/local/include
                     46:        install -d ${WORLD}/usr/local/lib
                     47:        install -d ${WORLD}/usr/local/libdata
                     48:        install -d ${WORLD}/usr/local/sbin
                     49: 
                     50: }
                     51: 
1.1.2.4   misho      52: clean_bootstrap()
                     53: {
                     54:        echo "+++ Clean ELWIX pkgsrc bootstrap tools ..."
                     55: 
                     56:        rm -rf ${WORLD}/usr/pkgsrc/bootstrap/work
                     57:        rm -f /elwix ${WORLD}/usr/pkgsrc
                     58:        rm -rf ${WORLD}/elwix
                     59:        install -d ${WORLD}/elwix
                     60:        ln -sf ${WORLD}/elwix /elwix
                     61:        ln -sf ${PKGSRC} ${WORLD}/usr/pkgsrc
                     62: 
                     63:        install -d ${PKGDIR}
                     64:        install -d ${PKGDIR}/db
                     65: }
                     66: 
                     67: compile_bootstrap()
                     68: {
                     69:        echo "+++ Compile ELWIX pkgsrc bootstrap tools ..."
                     70:        if [ ! -d ${WORLD}/usr/pkgsrc/bootstrap/work ]; then
                     71:                cd ${WORLD}/usr/pkgsrc/bootstrap
                     72:                ./bootstrap --prefix /elwix/pkg --pkgdbdir /elwix/pkg/db
                     73:                cd -
                     74:        else
                     75:                echo " Skip bootstrap pkgsrc - already inited pkgsrc"
                     76:        fi
                     77: 
                     78:        echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${WORLD}/elwix/elwix.ver
                     79: }
                     80: 
1.1.2.1   misho      81: compile_fbsdtools()
                     82: {
                     83:        echo "+++ Compile ELWIX FreeBSD tools ..."
                     84: 
                     85:        cd $CROSS_FT_ATH
                     86:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                     87:                clean DESTDIR=${WORLD}
                     88:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                     89:                DESTDIR=${WORLD}
                     90:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                     91:                install DESTDIR=${WORLD}
                     92:        cd -
                     93: 
                     94:        cd $CROSS_FT_IPW
                     95:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                     96:                clean DESTDIR=${WORLD}
                     97:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                     98:                DESTDIR=${WORLD}
                     99:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    100:                install DESTDIR=${WORLD}/usr/local/bin
                    101:        cd -
                    102: 
                    103:        cd $CROSS_FT_IWI
                    104:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    105:                clean DESTDIR=${WORLD}
                    106:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    107:                DESTDIR=${WORLD}
                    108:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    109:                install DESTDIR=${WORLD}/usr/local/bin
                    110:        cd -
                    111: 
                    112:        cd $CROSS_FT_MWL
                    113:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    114:                clean DESTDIR=${WORLD}
                    115:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    116:                DESTDIR=${WORLD}
                    117:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    118:                install DESTDIR=${WORLD}
                    119:        cd -
                    120: 
                    121:        cd $CROSS_FT_NET80211
                    122:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    123:                clean DESTDIR=${WORLD}
                    124:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    125:                DESTDIR=${WORLD}
                    126:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    127:                install DESTDIR=${WORLD}
                    128:        cd -
                    129: 
                    130:        cd $CROSS_FT_VIMAGE
                    131:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    132:                clean DESTDIR=${WORLD}
                    133:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    134:                DESTDIR=${WORLD}
                    135:        env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    136:                install DESTDIR=${WORLD}
                    137:        cd -
                    138: 
                    139: #      cd $CROSS_FT_WTAP
                    140: #      env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    141: #              clean DESTDIR=${WORLD}
                    142: #      env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    143: #              DESTDIR=${WORLD}
                    144: #      env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
                    145: #              install DESTDIR=${WORLD}
                    146: #      cd -
                    147: }
                    148: 
                    149: compile_tools()
                    150: {
                    151:        echo "+++ Compile ELWIX Cross ..."
1.1.2.2   misho     152: 
1.1.2.1   misho     153:        cd $CROSS_AXL
                    154:        ${AXL_CFG}
                    155:        ${CBUILD} clean
                    156:        ${CBUILD}
                    157:        ${CBUILD} install
                    158:        cd -
                    159: 
                    160:        cd $CROSS_AITIO
                    161:        ${AITIO_CFG}
                    162:        ${CBUILD} clean
                    163:        ${CBUILD}
                    164:        ${CBUILD} install
                    165:        cd -
                    166: 
                    167:        cd $CROSS_AITCRC
                    168:        ${AITCRC_CFG}
                    169:        ${CBUILD} clean
                    170:        ${CBUILD}
                    171:        ${CBUILD} install
                    172:        cd -
                    173: 
                    174:        cd $CROSS_AITCFG
                    175:        ${AITCFG_CFG}
                    176:        ${CBUILD} clean
                    177:        ${CBUILD}
                    178:        ${CBUILD} install
                    179:        cd -
                    180: 
                    181:        cd $CROSS_AITSESS
                    182:        ${AITSESS_CFG}
                    183:        ${CBUILD} clean
                    184:        ${CBUILD}
                    185:        ${CBUILD} install
                    186:        cd -
                    187: 
                    188:        cd $CROSS_AITRPC
                    189:        ${AITRPC_CFG}
                    190:        ${CBUILD} clean
                    191:        ${CBUILD}
                    192:        ${CBUILD} install
                    193:        cd -
                    194: 
                    195:        cd $CROSS_AITSCHED
                    196:        ${AITSCHED_CFG}
                    197:        ${CBUILD} clean
                    198:        ${CBUILD}
                    199:        ${CBUILD} install
                    200:        cd -
                    201: 
1.1.2.3   misho     202:        cd $CROSS_AITWWW
                    203:        ${AITWWW_CFG}
                    204:        ${CBUILD} clean
                    205:        ${CBUILD}
                    206:        ${CBUILD} install
                    207:        cd -
                    208: 
1.1.2.1   misho     209:        cd $CROSS_AITPELCO
                    210:        ${AITPELCO_CFG}
                    211:        ${CBUILD} clean
                    212:        ${CBUILD}
                    213:        ${CBUILD} install
                    214:        cd -
                    215: 
                    216:        cd $CROSS_AITPWD
                    217:        ${AITPWD_CFG}
                    218:        ${CBUILD} clean
                    219:        ${CBUILD}
                    220:        ${CBUILD} install
                    221:        cd -
                    222: 
                    223:        cd $CROSS_AITSYNC
                    224:        ${AITSYNC_CFG}
                    225:        ${CBUILD} clean
                    226:        ${CBUILD}
                    227:        ${CBUILD} install
                    228:        cd -
                    229: 
                    230:        cd $CROSS_AITCLI
                    231:        ${AITCLI_CFG}
                    232:        ${CBUILD} clean
                    233:        ${CBUILD}
                    234:        ${CBUILD} install
                    235:        cd -
                    236: 
                    237:        cd $CROSS_AITMQTT
                    238:        ${AITMQTT_CFG}
                    239:        ${CBUILD} clean
                    240:        ${CBUILD}
                    241:        ${CBUILD} install
                    242:        cd -
                    243: 
                    244:        cd $CROSS_EMBEDTOOLS
                    245:        ${EMBEDTOOLS_CFG}
                    246:        ${CBUILD} clean
                    247:        ${CBUILD}
                    248:        ${CBUILD} install
                    249:        cd -
                    250: 
                    251:        cd $CROSS_ANSH
                    252:        ${ANSH_CFG}
                    253:        ${CBUILD} clean
                    254:        ${CBUILD}
                    255:        ${CBUILD} install
                    256:        cd -
                    257: 
                    258:        echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${WORLD}/usr/local/elwix.ver
                    259: }
                    260: 
                    261: ### main()
1.1.2.5   misho     262: if ! SnitVer ${WORLD}/elwix/elwix.ver; then
1.1.2.4   misho     263:        clean_bootstrap
                    264:        compile_bootstrap
                    265: else
                    266:        echo "Skipped ELWIX bootstrap pkgsrc tools build ..."
                    267: fi
                    268: 
1.1.2.5   misho     269: if ! SnitVer ${WORLD}/usr/local/elwix.ver; then
1.1.2.1   misho     270:        clean_tools
                    271:        compile_fbsdtools
                    272:        compile_tools
                    273: else
                    274:        echo "Skipped ELWIX tools build ..."
                    275: fi
                    276: 
                    277: echo "+++ Complete build ELWIX tools"

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