--- elwix/build_3thparty.sh 2013/08/05 13:10:16 1.3 +++ elwix/build_3thparty.sh 2021/07/16 18:35:50 1.8 @@ -5,10 +5,17 @@ # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # -# $Id: build_3thparty.sh,v 1.3 2013/08/05 13:10:16 misho Exp $ +# $Id: build_3thparty.sh,v 1.8 2021/07/16 18:35:50 misho Exp $ # [ -r ./config/rc.elwix ] && . ./config/rc.elwix +if [ ! -r ./config/rc.3thparty_helper ]; then + echo + echo "ELWIX project is not configured - Missing rc.3thparty_helper script" + echo + exit 1 +fi + if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then echo echo "ELWIX project is not configured !?!" @@ -37,7 +44,7 @@ fi clean_3th() { - echo "+++ Clean ELWIX 3th party ..." + echo "+++ Clean ELWIX 3th party ... ${PKG}, ${ROMFS_USR2}" rm -rf ${PKG} ${ROMFS_USR2} @@ -62,72 +69,15 @@ compile_3th() { echo "+++ Compile ELWIX 3th party ..." - cd $CROSS_3TH - ./build.sh expat ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh libevent ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh libiconv ${CGBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh pcre ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh mini_sendmail ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh choparp ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh scan_ffs ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh istgt ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh rsync ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh ttcp ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh mpd ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh mrouted ${CGBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh igmpproxy ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh sudo ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh bmon ${CGBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh mtr ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh ipguard ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh smartmontools ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh quagga ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh iftop ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh arping ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh hping2 ${CGBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh trafshow ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh ipsec-tools ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh dhcp ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh dhcping ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 -# ./build.sh dnsmasq ${CBUILD} ${PKG} ${TARGET_BUILD} -# [ $? -ne 0 ] && exit 1 - ./build.sh miniupnpd ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh miniupnpc ${CGBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh ntp ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh libxml2 ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - ./build.sh php ${CBUILD} ${PKG} ${TARGET_BUILD} - [ $? -ne 0 ] && exit 1 - cd - + BUILD_SH="./config/rc.3thparty_helper" + + for i in ${CROSS_3THPARTY}; do + MK=$(eval echo "\$${i}_MAKE") + env CFLAGS="-I${PKG}/include" LDFLAGS="-L${PKG}/lib" ${BUILD_SH} \ + $i $MK ${PKG} ${TARGET_BUILD} || Die "ERROR:: with $i packet!" + done + + echo } install_3th() @@ -138,10 +88,11 @@ install_3th() SBIN="${ROMFS_USR2}/sbin" ETC="${ROMFS_USR2}/etc" - echo "+++ Install ELWIX RomFS secondary firmware ..." + echo "+++ Install ELWIX RomFS secondary firmware ... ${ROMFS_USR2}" StripFiles \*.so\* ${PKG}/lib InstallFiles \*.so\* ${PKG}/lib $LIBS + InstallLinks \*.so\* ${PKG}/lib $LIBS StripFiles \* ${PKG}/libexec InstallFiles \* ${PKG}/libexec $LIBEXEC StripFiles \* ${PKG}/bin @@ -156,7 +107,7 @@ install_3th() build_3th() { - echo "+++ Build ELWIX Firmware secondary image ..." + echo "+++ Build ELWIX Firmware secondary image ... ${ROMFS_USR2} --> ${REL}/${ROMFS_IMG2}" cd ${ROMFS_USR2} pax -w -z -v -f${REL}/${ROMFS_IMG2} . @@ -172,15 +123,21 @@ build_3th() # mkuzip -s 8192 -o ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2}; # mv ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2} + + echo "+++ Complited ELWIX Firmware secondary image ... ${REL}/${ROMFS_IMG2}" } ### main() +if [ -n "${1}" ]; then + rm ${PKG}/elwix.ver +fi + if ! SnitVer ${PKG}/elwix.ver; then - clean_3th - compile_3th + clean_3th || exit 1 + compile_3th || exit 1 - install_3th - build_3th + install_3th || exit 1 + build_3th || exit 1 echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${PKG}/elwix.ver else