tools/tesbuild.sh will now build NxWM configurations

This commit is contained in:
Gregory Nutt 2016-06-05 12:14:18 -06:00
parent 37dd4e52a1
commit f36e342f38

View File

@ -34,22 +34,27 @@
WD=$PWD
nuttx=$WD/../nuttx
UNLINK=./unlink.sh
progname=$0
host=linux
wenv=cygwin
sizet=uint
APPSDIR=../apps
NXWDIR=../NxWidgets
unset testfile
function showusage {
echo ""
echo "USAGE: $progname [-w|l] [-c|n] [-s] <testlist-file>"
echo "USAGE: $progname [-w|l] [-c|n] [-s] [-a <appsdir>] [-n <nxdir>] <testlist-file>"
echo " $progname -h"
echo ""
echo "Where:"
echo " -w|l selects Windows (w) or Linux (l). Default: Linux"
echo " -c|n selects Windows native (n) or Cygwin (c). Default Cygwin"
echo " -s Use C++ unsigned long size_t in new operator. Default unsigned int"
echo " -a <appdirs> provides the relative path to the apps/ directory. Default ../apps"
echo " -n <nxdir> provides the relative path to the NxWidgets/ directory. Default ../NxWidgets"
echo " -h will show this help test and terminate"
echo " <testlist-file> selects the list of configurations to test. No default"
echo ""
@ -78,6 +83,14 @@ while [ ! -z "$1" ]; do
-s )
sizet=long
;;
-a )
shift
APPSDIR="$1"
;;
-n )
shift
NXWDIR="$1"
;;
-h )
showusage
;;
@ -122,6 +135,15 @@ function distclean {
fi
}
# Check if build is NxWM and clean
function nxcheck {
unset nxconfig
if [ -d $NXWDIR ]; then
nxconfig=`grep CONFIG_NXWM=y $nuttx/.config`
fi
}
# Configure for the next build
function configure {
@ -196,6 +218,33 @@ function configure {
make olddefconfig 1>/dev/null 2>&1
}
# Build the NxWidgets libraries
function nxbuild {
if [ -e $APPSDIR/internal ]; then
$UNLINK $APPSDIR/internal
fi
if [ ! -z "$nxconfig" ]; then
echo " Building NxWidgets..."
echo "------------------------------------------------------------------------------------"
cd $nuttx/$NXTOOLS || { echo "Failed to CD to $NXTOOLS"; exit 1; }
./install.sh $nuttx/$APPSDIR nxwm 1>/dev/null
cd $nuttx || { echo "Failed to CD to $nuttx"; exit 1; }
make -i context 1>/dev/null
cd $nuttx/$NXWIDGETSDIR || { echo "Failed to CD to $NXWIDGETSDIR"; exit 1; }
make -i TOPDIR=$nuttx clean 1>/dev/null
make -i TOPDIR=$nuttx 1>/dev/null
cd $nuttx/$NXWMDIR || { echo "Failed to CD to $NXWMDIR"; exit 1; }
make -i TOPDIR=$nuttx clean 1>/dev/null
make -i TOPDIR=$nuttx 1>/dev/null
fi
}
# Perform the next build
function build {
@ -209,14 +258,27 @@ function build {
function dotest {
echo "------------------------------------------------------------------------------------"
nxcheck
distclean
configure
nxbuild
build
}
# Perform the build test for each entry in the test list file
export APPSDIR=../apps
if [ ! -d $APPSDIR ]; then
export "ERROR: No directory found at $APPSDIR"
exit 1
fi
export APPSDIR
if [ -d $NXWDIR ]; then
NXWIDGETSDIR=$NXWDIR/libnxwidgets
NXWMDIR=$NXWDIR/nxwm
NXTOOLS=$NXWDIR/tools
fi
# Shouldn't have to do this