Annotation of elwix/build_init.sh, revision 1.2.4.1
1.1 misho 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: #
1.2.4.1 ! misho 8: # $Id: build_init.sh,v 1.2 2011/10/18 09:02:05 misho Exp $
1.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
18:
19: if [ ! -d $BSDSRC ]; then
20: echo
21: echo "ELWIX project is not configured - missing BSD sources !?!"
22: echo
23: exit 1
24: fi
25:
26: if [ "${USER}" != "root" ]; then
27: echo
28: echo "ELWIX project is not configured - Init must build under root !?!"
29: echo
30: exit 1
31: fi
32:
1.2.4.1 ! misho 33: clean_pkgsrc()
! 34: {
! 35: echo "+++ Clean ELWIX pkgsrc ..."
! 36: # MNTEXISTS=$(mount | awk -vpkgsrc="${PKGSRC_DIR}" -vdstmnt="${WORLD}/usr/pkgsrc" \
! 37: # '($1 == pkgsrc && $3 == dstmnt) { printf("YES"); }')
! 38: # if [ "${MNTEXISTS}" != "YES" ]; then
! 39: # umount ${WORLD}/usr/pkgsrc
! 40: # fi
! 41:
! 42: rm -f /elwix ${WORLD}/usr/pkgsrc
! 43: echo "+++ Erased pkgsrc helper dirs!"
! 44: }
! 45:
1.1 misho 46: clean_init()
47: {
48: echo "+++ Clean ELWIX Projects ..."
49: echo -n "Erase *ALL* builded ELWIX projects [NO/yes]? "
50: read LINE
51: if [ X"$LINE" = X"yes" ]; then
1.2.4.1 ! misho 52: clean_pkgsrc
! 53:
1.1 misho 54: chflags -Rf noschg ${TOPDIR}
55: rm -rf $TOPDIR
56: mkdir -p $TOPDIR
57: echo "+++ Erased *ALL* builded ELWIX projects!"
58: fi
59: }
60:
61: install_init()
62: {
63: echo "+++ Install ELWIX Project directories ..."
64:
65: install -d $REL
66: install -d $DEST
67: install -d $OBJS
68: install -d $ADIR
69:
70: install -d $BSDOBJ
71:
1.2 misho 72: # ln -sf $BSDSRC
73:
1.1 misho 74: echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${TOPDIR}/elwix.ver
75: }
76:
77: ### main()
78: install -d ${TOPDIR}
79:
80: V=$(CheckVer ${TOPDIR}/elwix.ver)
81: if [ $? -ne 0 -o X"$V" != X"${VERSION}" ]; then
82: echo " Not found valid version or different version from current - Start CLEAN *ALL*"
83: rm -rf $TOPDIR
84: mkdir -p $TOPDIR
85: echo "+++ CLEAN *ALL* complete"
86: else
87: clean_init
88: fi
89:
90: install_init
91:
92: echo "+++ Complete Init ELWIX"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>