File:  [ELWIX - Embedded LightWeight unIX -] / elwix / build_init.sh
Revision 1.4: download - view: text, annotated - select for diffs - revision graph
Mon Sep 15 19:06:42 2014 UTC (9 years, 9 months ago) by misho
Branches: MAIN
CVS tags: elwix2_6, elwix2_3, HEAD, ELWIX2_5, ELWIX2_2p0
elwix 2.2

    1: #!/bin/sh
    2: #
    3: # ELWIX build script for setup host cross compile process - *** START FIRST *** -
    4: #
    5: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
    6: #    by Michael Pounov <misho@elwix.org>
    7: #
    8: # $Id: build_init.sh,v 1.4 2014/09/15 19:06:42 misho Exp $
    9: #
   10: 
   11: if [ -n "$1" ]; then
   12: 	cd config
   13: 	ln -sf $1 rc.elwix
   14: 	cd -
   15: fi
   16: 
   17: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
   18: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
   19: 	echo
   20: 	echo "ELWIX project is not configured !?!"
   21: 	echo
   22: 	exit 1
   23: fi
   24: 
   25: if [ ! -d $BSDSRC ]; then
   26: 	echo
   27: 	echo "ELWIX project is not configured - missing BSD sources !?!"
   28: 	echo
   29: 	exit 1
   30: fi
   31: 
   32: if [ "${USER}" != "root" ]; then
   33: 	echo
   34: 	echo "ELWIX project is not configured - Init must build under root !?!"
   35: 	echo
   36: 	exit 1
   37: fi
   38: 
   39: clean_pkgsrc()
   40: {
   41: 	echo "+++ Clean ELWIX pkgsrc ..."
   42: #	MNTEXISTS=$(mount | awk -vpkgsrc="${PKGSRC_DIR}" -vdstmnt="${WORLD}/usr/pkgsrc" \
   43: #		'($1 == pkgsrc && $3 == dstmnt) { printf("YES"); }')
   44: #	if [ "${MNTEXISTS}" != "YES" ]; then
   45: #		umount ${WORLD}/usr/pkgsrc
   46: #	fi
   47: 
   48: 	rm -f /elwix ${WORLD}/usr/pkgsrc
   49: 	echo "+++ Erased pkgsrc helper dirs!"
   50: }
   51: 
   52: clean_init()
   53: {
   54: 	echo "+++ Clean ELWIX Projects ..."
   55: 	echo -n "Erase *ALL* builded ELWIX projects [NO/yes]? "
   56: 	read LINE
   57: 	if [ X"$LINE" = X"yes" ]; then
   58: 		clean_pkgsrc
   59: 
   60: 		chflags -Rf noschg,nosunlink ${TOPDIR}
   61: 		rm -rf $TOPDIR
   62: 		mkdir -p $TOPDIR
   63: 		echo "+++ Erased *ALL* builded ELWIX projects!"
   64: 	fi
   65: }
   66: 
   67: install_init()
   68: {
   69: 	echo "+++ Install ELWIX Project directories ..."
   70: 
   71: 	install -d $REL
   72: 	install -d $DEST
   73: 	install -d $OBJS
   74: 	install -d $ADIR
   75: 
   76: 	install -d $BSDOBJ
   77: 
   78: #	ln -sf $BSDSRC
   79: 
   80: 	echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${TOPDIR}/elwix.ver
   81: }
   82: 
   83: ### main()
   84: install -d ${TOPDIR}
   85: 
   86: V=$(CheckVer ${TOPDIR}/elwix.ver)
   87: if [ $? -ne 0 -o X"$V" != X"${VERSION}" ]; then
   88: 	echo " Not found valid version or different version from current - Start CLEAN *ALL*"
   89: 	rm -rf $TOPDIR
   90: 	mkdir -p $TOPDIR
   91: 	echo "+++ CLEAN *ALL* complete"
   92: else
   93: 	clean_init
   94: fi
   95: 
   96: install_init
   97: 
   98: echo "+++ Complete Init ELWIX"

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