File:  [ELWIX - Embedded LightWeight unIX -] / elwix / build_3thparty.sh
Revision 1.4.2.2: download - view: text, annotated - select for diffs - revision graph
Tue Jan 7 09:26:42 2014 UTC (10 years, 5 months ago) by misho
Branches: elwix2_2
Diff to: branchpoint 1.4: preferred, unified
remove istgt

    1: #!/bin/sh
    2: #
    3: # ELWIX build script for cross compiling 3th party software
    4: #
    5: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
    6: #    by Michael Pounov <misho@elwix.org>
    7: #
    8: # $Id: build_3thparty.sh,v 1.4.2.2 2014/01/07 09:26:42 misho Exp $
    9: #
   10: 
   11: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
   12: if [ -r ./config/rc.3thparty_helper ]; then
   13: 	. ./config/rc.3thparty_helper
   14: else
   15: 	echo
   16: 	echo "ELWIX project is not configured - Missing rc.3thparty_helper script"
   17: 	echo
   18: 	exit 1
   19: fi
   20: 
   21: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
   22: 	echo
   23: 	echo "ELWIX project is not configured !?!"
   24: 	echo
   25: 	exit 1
   26: fi
   27: V=${VERSION}
   28: [ -r ${CENV} ] && . ${CENV}
   29: unset INSTALL
   30: unset VERSION
   31: VERSION="$V"
   32: 
   33: if [ ! -d $BSDSRC ]; then
   34: 	echo
   35: 	echo "ELWIX project is not configured - missing BSD sources !?!"
   36: 	echo
   37: 	exit 1
   38: fi
   39: 
   40: if [ ! -d $DEST ]; then
   41: 	echo
   42: 	echo "ELWIX project is not configured - missing Dest directory !?!"
   43: 	echo
   44: 	exit 1
   45: fi
   46: 
   47: clean_3th()
   48: {
   49: 	echo "+++ Clean ELWIX 3th party ..."
   50: 
   51: 	rm -rf ${PKG} ${ROMFS_USR2}
   52: 
   53: 	install -d ${PKG}
   54: 	install -d ${PKG}/bin
   55: 	install -d ${PKG}/etc
   56: 	install -d ${PKG}/include
   57: 	install -d ${PKG}/man
   58: 	install -d ${PKG}/lib
   59: 	install -d ${PKG}/libexec
   60: 	install -d ${PKG}/sbin
   61: 
   62: 	install -d ${ROMFS_USR2}
   63: 	install -d ${ROMFS_USR2}/bin
   64: 	install -d ${ROMFS_USR2}/etc
   65: 	install -d ${ROMFS_USR2}/lib
   66: 	install -d ${ROMFS_USR2}/libexec
   67: 	install -d ${ROMFS_USR2}/sbin
   68: }
   69: 
   70: compile_3th()
   71: {
   72: 	echo "+++ Compile ELWIX 3th party ..."
   73: 
   74: 	BUILD_SH="./config/rc.3thparty_helper"
   75: 
   76: 	cd $CROSS_3TH
   77: 	${BUILD_SH} expat ${CBUILD} ${PKG} ${TARGET_BUILD}
   78: 	[ $? -ne 0 ] && exit 1
   79: 	./build.sh libevent ${CBUILD} ${PKG} ${TARGET_BUILD}
   80: 	[ $? -ne 0 ] && exit 1
   81: 	./build.sh libiconv ${CGBUILD} ${PKG} ${TARGET_BUILD}
   82: 	[ $? -ne 0 ] && exit 1
   83: 	./build.sh pcre ${CBUILD} ${PKG} ${TARGET_BUILD}
   84: 	[ $? -ne 0 ] && exit 1
   85: 	./build.sh mini_sendmail ${CBUILD} ${PKG} ${TARGET_BUILD}
   86: 	[ $? -ne 0 ] && exit 1
   87: 	./build.sh choparp ${CBUILD} ${PKG} ${TARGET_BUILD}
   88: 	[ $? -ne 0 ] && exit 1
   89: 	./build.sh scan_ffs ${CBUILD} ${PKG} ${TARGET_BUILD}
   90: 	[ $? -ne 0 ] && exit 1
   91: #	./build.sh istgt ${CBUILD} ${PKG} ${TARGET_BUILD}
   92: #	[ $? -ne 0 ] && exit 1
   93: 	./build.sh rsync ${CBUILD} ${PKG} ${TARGET_BUILD}
   94: 	[ $? -ne 0 ] && exit 1
   95: 	./build.sh ttcp ${CBUILD} ${PKG} ${TARGET_BUILD}
   96: 	[ $? -ne 0 ] && exit 1
   97: 	./build.sh mpd ${CBUILD} ${PKG} ${TARGET_BUILD}
   98: 	[ $? -ne 0 ] && exit 1
   99: 	./build.sh mrouted ${CGBUILD} ${PKG} ${TARGET_BUILD}
  100: 	[ $? -ne 0 ] && exit 1
  101: 	./build.sh igmpproxy ${CBUILD} ${PKG} ${TARGET_BUILD}
  102: 	[ $? -ne 0 ] && exit 1
  103: 	./build.sh sudo ${CBUILD} ${PKG} ${TARGET_BUILD}
  104: 	[ $? -ne 0 ] && exit 1
  105: 	./build.sh bmon ${CGBUILD} ${PKG} ${TARGET_BUILD}
  106: 	[ $? -ne 0 ] && exit 1
  107: 	./build.sh mtr ${CBUILD} ${PKG} ${TARGET_BUILD}
  108: 	[ $? -ne 0 ] && exit 1
  109: 	./build.sh ipguard ${CBUILD} ${PKG} ${TARGET_BUILD}
  110: 	[ $? -ne 0 ] && exit 1
  111: 	./build.sh smartmontools ${CBUILD} ${PKG} ${TARGET_BUILD}
  112: 	[ $? -ne 0 ] && exit 1
  113: 	./build.sh quagga ${CBUILD} ${PKG} ${TARGET_BUILD}
  114: 	[ $? -ne 0 ] && exit 1
  115: 	./build.sh iftop ${CBUILD} ${PKG} ${TARGET_BUILD}
  116: 	[ $? -ne 0 ] && exit 1
  117: 	./build.sh arping ${CBUILD} ${PKG} ${TARGET_BUILD}
  118: 	[ $? -ne 0 ] && exit 1
  119: 	./build.sh hping2 ${CGBUILD} ${PKG} ${TARGET_BUILD}
  120: 	[ $? -ne 0 ] && exit 1
  121: 	./build.sh trafshow ${CBUILD} ${PKG} ${TARGET_BUILD}
  122: 	[ $? -ne 0 ] && exit 1
  123: 	./build.sh ipsec-tools ${CBUILD} ${PKG} ${TARGET_BUILD}
  124: 	[ $? -ne 0 ] && exit 1
  125: #	./build.sh dhcp ${CBUILD} ${PKG} ${TARGET_BUILD}
  126: #	[ $? -ne 0 ] && exit 1
  127: #	./build.sh dhcping ${CBUILD} ${PKG} ${TARGET_BUILD}
  128: #	[ $? -ne 0 ] && exit 1
  129: 	./build.sh dnsmasq ${CBUILD} ${PKG} ${TARGET_BUILD}
  130: 	[ $? -ne 0 ] && exit 1
  131: 	./build.sh miniupnpd ${CBUILD} ${PKG} ${TARGET_BUILD}
  132: 	[ $? -ne 0 ] && exit 1
  133: 	./build.sh miniupnpc ${CGBUILD} ${PKG} ${TARGET_BUILD}
  134: 	[ $? -ne 0 ] && exit 1
  135: 	./build.sh ntp ${CBUILD} ${PKG} ${TARGET_BUILD}
  136: 	[ $? -ne 0 ] && exit 1
  137: 	./build.sh spawn-fcgi ${CBUILD} ${PKG} ${TARGET_BUILD}
  138: 	[ $? -ne 0 ] && exit 1
  139: 	./build.sh lighttpd ${CBUILD} ${PKG} ${TARGET_BUILD}
  140: 	[ $? -ne 0 ] && exit 1
  141: 	./build.sh libxml2 ${CBUILD} ${PKG} ${TARGET_BUILD}
  142: 	[ $? -ne 0 ] && exit 1
  143: 	./build.sh php ${CBUILD} ${PKG} ${TARGET_BUILD}
  144: 	[ $? -ne 0 ] && exit 1
  145: 	cd -
  146: }
  147: 
  148: install_3th()
  149: {
  150: 	LIBS="${ROMFS_USR2}/lib"
  151: 	LIBEXEC="${ROMFS_USR2}/libexec"
  152: 	BIN="${ROMFS_USR2}/bin"
  153: 	SBIN="${ROMFS_USR2}/sbin"
  154: 	ETC="${ROMFS_USR2}/etc"
  155: 
  156: 	echo "+++ Install ELWIX RomFS secondary firmware ..."
  157: 
  158: 	StripFiles \*.so\* ${PKG}/lib
  159: 	InstallFiles \*.so\* ${PKG}/lib $LIBS
  160: 	StripFiles \* ${PKG}/libexec
  161: 	InstallFiles \* ${PKG}/libexec $LIBEXEC
  162: 	StripFiles \* ${PKG}/bin
  163: 	InstallFiles \* ${PKG}/bin $BIN
  164: 	StripFiles \* ${PKG}/sbin
  165: 	InstallFiles \* ${PKG}/sbin $SBIN
  166: 
  167: 	InstallFiles \* ${PKG}/etc $ETC
  168: 
  169: 	chown -R root:wheel $SBIN $BIN $LIBDATA $LIBEXEC $LIBS
  170: }
  171: 
  172: build_3th()
  173: {
  174: 	echo "+++ Build ELWIX Firmware secondary image ..."
  175: 
  176: 	cd ${ROMFS_USR2}
  177: 	pax -w -z -v -f${REL}/${ROMFS_IMG2} .
  178: 	cd -
  179: 
  180: # Stop using uzip fs
  181: #	makefs -ominfree=0,bsize=8192,fsize=1024,optimization=space -s${ROMFS_SIZE2} \
  182: #		${REL}/${ROMFS_IMG2} ${ROMFS_USR2}
  183: 
  184: #	MDDEV=$(mdconfig -a -t vnode -f ${REL}/${ROMFS_IMG2});
  185: #	tunefs -L elwixFirmware2 /dev/$MDDEV;
  186: #	mdconfig -d -u $MDDEV;
  187: 
  188: #	mkuzip -s 8192 -o ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2};
  189: #	mv ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2}
  190: }
  191: 
  192: ### main()
  193: if ! SnitVer ${PKG}/elwix.ver; then
  194: 	clean_3th
  195: 	compile_3th
  196: 
  197: 	install_3th
  198: 	build_3th
  199: 
  200: 	echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${PKG}/elwix.ver
  201: else
  202: 	echo "Skipped ELWIX 3th party build ..."
  203: fi
  204: 
  205: echo "+++ Complete build ELWIX 3th party"

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