diff --git a/tools/README.txt b/tools/README.txt index 7c5f951724e..10b6ce8dae3 100644 --- a/tools/README.txt +++ b/tools/README.txt @@ -576,12 +576,13 @@ testbuild.sh $ ./testbuild.sh -h - USAGE: ./testbuild.sh [-w|l] [-c|n] + USAGE: ./testbuild.sh [-w|l] [-c|n] [-s] USAGE: ./testbuild.sh -h where -w|l selects Windows (w) or Linux (l). Default: Linux -c|n selects Windows native (n) or Cygwin (c). Default Cygwin + -s Use C++ long size_t in new operator. Default unsigned long -h will show this help test and terminate selects the list of configurations to test. No default diff --git a/tools/testbuild.sh b/tools/testbuild.sh index a94cb63b2f7..369c7c788a9 100755 --- a/tools/testbuild.sh +++ b/tools/testbuild.sh @@ -36,18 +36,20 @@ WD=$PWD nuttx=$WD/../nuttx progname=$0 -host=l -wenv=c +host=linux +wenv=cygwin +sizet=uint unset testfile function showusage { echo "" - echo "USAGE: $progname [-w|l] [-c|n] " + echo "USAGE: $progname [-w|l] [-c|n] [-s] " echo "USAGE: $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++ long size_t in new operator. Default unsigned long" echo " -h will show this help test and terminate" echo " selects the list of configurations to test. No default" echo "" @@ -62,17 +64,20 @@ function showusage { while [ ! -z "$1" ]; do case $1 in -w ) - host=w + host=windows ;; -l ) - host=l + host=linux ;; -c ) - wenv=c + wenv=cygwin ;; -n ) wenv=n ;; + -s ) + sizet=long + ;; -h ) showusage ;; @@ -126,7 +131,7 @@ function configure { cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } - if [ "X$host" == "Xl" ]; then + if [ "X$host" == "Xlinux" ]; then echo " Select CONFIG_HOST_LINUX=y" kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_LINUX @@ -142,7 +147,7 @@ function configure { kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_WINDOWS kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX - if [ "X$wenv" == "Xc" ]; then + if [ "X$wenv" == "Xcygwin" ]; then echo " Select CONFIG_HOST_CYGWIN=y" kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_CYGWIN kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE @@ -159,6 +164,14 @@ function configure { kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_OSX kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_OTHER + if [ "X$sizet" == "Xlong" ]; then + echo " Select CONFIG_CXX_NEWLONG=y" + + kconfig-tweak --file $nuttx/.config --enable CONFIG_CXX_NEWLONG + else + echo " Disable CONFIG_CXX_NEWLONG" + kconfig-tweak --file $nuttx/.config --disable CONFIG_CXX_NEWLONG + fi setting=`grep TOOLCHAIN $nuttx/.config | grep =y` varname=`echo $setting | cut -d'=' -f1`