#!/bin/sh
#
# ELWIX test build script for cross compiling 3th party software
#
# (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
# by Michael Pounov <misho@elwix.org>
#
# $Id: build_3thpkg.sh,v 1.1.2.1 2017/06/14 14:56:24 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 !?!"
echo
exit 1
fi
V=${VERSION}
[ -r ${CENV} ] && . ${CENV}
unset INSTALL
unset VERSION
VERSION="$V"
if [ ! -d $BSDSRC ]; then
echo
echo "ELWIX project is not configured - missing BSD sources !?!"
echo
exit 1
fi
if [ ! -d $DEST ]; then
echo
echo "ELWIX project is not configured - missing Dest directory !?!"
echo
exit 1
fi
compile_3th()
{
echo "+++ Compile ELWIX 3th party software ..."
BUILD_SH="./config/rc.3thparty_helper"
echo all=$*
NAME=${1}
shift
if [ -z "${1}" ]; then
CBS=${CBUILD}
fi
shift
ENVS=""
if [ -n "${1}" ]; then
ENVS="env $*"
fi
echo cbs=$CBS
${ENVS} ${BUILD_SH} ${NAME} ${CBS} ${PKG} ${TARGET_BUILD}
[ $? -ne 0 ] && exit 1
echo "Done."
}
### main()
# ./build_3thpkg.sh <name> [make] [env varz ...]
install -d ${PKG}
install -d ${PKG}/bin
install -d ${PKG}/etc
install -d ${PKG}/include
install -d ${PKG}/man
install -d ${PKG}/lib
install -d ${PKG}/libexec
install -d ${PKG}/sbin
install -d ${ROMFS_USR2}
install -d ${ROMFS_USR2}/bin
install -d ${ROMFS_USR2}/etc
install -d ${ROMFS_USR2}/lib
install -d ${ROMFS_USR2}/libexec
install -d ${ROMFS_USR2}/sbin
compile_3th $*
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>