You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/01/20 14:04:28 UTC

[incubator-nuttx] branch pr131 updated (a762c06 -> e59f242)

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a change to branch pr131
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from a762c06  Fix typos and some incorrect comments
     new bb6c70b  Fix the comment header style in tools folder
     new d0b34de  Fix the minor issue found in configure.sh, sethost.sh and testbuild.sh
     new f316c15  Remove the size related option from sehost.sh and testbuild.sh
     new e59f242  remove the dup kconfig tweak in configure.sh, testbuild.sh and sethost.sh

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tools/Config.mk       |   2 +-
 tools/Makefile.export |   2 +-
 tools/Makefile.host   |   2 +-
 tools/README.txt      |  26 +++++------
 tools/checkpatch.sh   |   1 +
 tools/configure.c     |  18 ++++----
 tools/configure.sh    | 120 +++++++++-----------------------------------------
 tools/flash_writer.py |   3 +-
 tools/mkconfigvars.sh |   2 +-
 tools/mkctags.sh      |   2 +-
 tools/noteinfo.c      |  35 +++++++++++++++
 tools/ocdconsole.py   |   1 +
 tools/refresh.sh      |   2 +-
 tools/sethost.sh      | 105 +++++++++++++++++++------------------------
 tools/testbuild.sh    | 113 +++++------------------------------------------
 tools/uncrustify.cfg  |   1 +
 tools/version.sh      |   2 +-
 tools/zipme.sh        |   2 +-
 18 files changed, 145 insertions(+), 294 deletions(-)


[incubator-nuttx] 02/04: Fix the minor issue found in configure.sh, sethost.sh and testbuild.sh

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch pr131
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit d0b34dec9709ef34bced21cd4cacb6ee81e11a45
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Jan 20 01:22:36 2020 +0800

    Fix the minor issue found in configure.sh, sethost.sh and testbuild.sh
    
    1.The unused variable
    2.The duplicated setting
    3.The typo error
    
    Change-Id: I8c129cce78d3e88856f1edcbc2c702c433daa61f
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 tools/configure.c  | 18 ++++++++----------
 tools/configure.sh |  7 ++++---
 tools/sethost.sh   |  7 -------
 tools/testbuild.sh |  6 ++----
 4 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/tools/configure.c b/tools/configure.c
index d4101b0..b37f4cd 100644
--- a/tools/configure.c
+++ b/tools/configure.c
@@ -174,11 +174,13 @@ static const char *g_optfiles[] =
 
 static void show_usage(const char *progname, int exitcode)
 {
-  fprintf(stderr, "\nUSAGE: %s  [-d] [-b] [-f] [-l|m|c|u|g|n] [-a <app-dir>] <board-name>:<config-name>\n", progname);
+  fprintf(stderr, "\nUSAGE: %s  [-d] [-s] [-b] [-f] [-l|m|c|u|g|n] [-a <app-dir>] <board-name>:<config-name>\n", progname);
   fprintf(stderr, "\nUSAGE: %s  [-h]\n", progname);
   fprintf(stderr, "\nWhere:\n");
   fprintf(stderr, "  -d:\n");
   fprintf(stderr, "    Enables debug output\n");
+  fprintf(stderr, "  -s:\n");
+  fprintf(stderr, "    Skip the .config/Make.defs existence check\n");
   fprintf(stderr, "  -b:\n");
 #ifdef CONFIG_WINDOWS_NATIVE
   fprintf(stderr, "    Informs the tool that it should use Windows style paths like C:\\Program Files\n");
@@ -197,13 +199,10 @@ static void show_usage(const char *progname, int exitcode)
   fprintf(stderr, "    instead of Windows style paths like C:\\Program Files are used.  POSIX\n");
   fprintf(stderr, "    style paths are used by default.\n");
 #endif
-  fprintf(stderr, "  -s:\n");
-  fprintf(stderr, "    Skip the .config/Make.defs existence check\n");
   fprintf(stderr, "  [-l|m|c|u|g|n]\n");
   fprintf(stderr, "    Selects the host environment.\n");
   fprintf(stderr, "    -l Selects the Linux (l) host environment.\n");
   fprintf(stderr, "    -m Selects the macOS (m) host environment.\n");
-  fprintf(stderr, "  [-c|u|g|n] selects the Windows host and a Windows host environment:\n");
   fprintf(stderr, "    -c Selects the Windows host and Cygwin (c) environment.\n");
   fprintf(stderr, "    -u Selects the Windows host and Ubuntu under Windows 10 (u) environment.\n");
   fprintf(stderr, "    -g Selects the Windows host and the MinGW/MSYS environment.\n");
@@ -325,7 +324,7 @@ static void parse_args(int argc, char **argv)
 
   if (optind >= argc)
     {
-      fprintf(stderr, "ERROR: Missing <board-name>%c<config-name>\n", g_delim);
+      fprintf(stderr, "ERROR: Missing <board-name>:<config-name>\n");
       show_usage(argv[0], EXIT_FAILURE);
     }
 
@@ -899,7 +898,7 @@ static void check_appdir(void)
 
       /* Try ../apps-xx.yy where xx.yy is the version string */
 
-      snprintf(tmp, 16, ".%capps-%s", g_delim, g_verstring);
+      snprintf(tmp, 16, "..%capps-%s", g_delim, g_verstring);
       debug("check_appdir: Try appdir=%s\n", tmp);
       if (verify_appdir(tmp))
         {
@@ -1151,7 +1150,7 @@ static void copy_optional(void)
         {
           char *optsrc = strdup(g_buffer);
 
-          snprintf(g_buffer, BUFFER_SIZE, "%s%c.config", g_topdir, g_delim);
+          snprintf(g_buffer, BUFFER_SIZE, "%s%c%s", g_topdir, g_delim, g_optfiles[i]);
 
           debug("copy_optional: Copying from %s to %s\n", optsrc, g_buffer);
           copy_file(optsrc, g_buffer, 0644);
@@ -1232,7 +1231,7 @@ static void set_host(const char *destconfig)
 
       case HOST_MACOS:
         {
-          printf("  Select the Linux host\n");
+          printf("  Select the macOS host\n");
 
           disable_feature(destconfig, "CONFIG_HOST_LINUX");
           disable_feature(destconfig, "CONFIG_HOST_WINDOWS");
@@ -1255,7 +1254,6 @@ static void set_host(const char *destconfig)
           disable_feature(destconfig, "CONFIG_HOST_LINUX");
           disable_feature(destconfig, "CONFIG_HOST_MACOS");
 
-          disable_feature(destconfig, "CONFIG_WINDOWS_MSYS");
           disable_feature(destconfig, "CONFIG_WINDOWS_OTHER");
 
           enable_feature(destconfig, "CONFIG_SIM_X8664_MICROSOFT");
@@ -1272,7 +1270,7 @@ static void set_host(const char *destconfig)
                 break;
 
               case WINDOWS_MSYS:
-                printf("  Select Ubuntu for Windows 10 host\n");
+                printf("  Select Windows/MSYS host\n");
                 disable_feature(destconfig, "CONFIG_WINDOWS_CYGWIN");
                 enable_feature(destconfig, "CONFIG_WINDOWS_MSYS");
                 disable_feature(destconfig, "CONFIG_WINDOWS_UBUNTU");
diff --git a/tools/configure.sh b/tools/configure.sh
index 1194b76..943c2d0 100755
--- a/tools/configure.sh
+++ b/tools/configure.sh
@@ -40,7 +40,8 @@ USAGE="
 USAGE: ${0} [-d] [-s] [-l|m|c|u|g|n] [-a <app-dir>] <board-name>:<config-name>
 
 Where:
-  -s Skip the .config/Make.defs existence check
+  -d enables script debug output
+  -s skip the .config/Make.defs existence check
   -l selects the Linux (l) host environment.
   -m selects the macOS (m) host environment.
   -c selects the Windows host and Cygwin (c) environment.
@@ -49,10 +50,10 @@ Where:
   -n selects the Windows host and Windows native (n) environment.
   Default: Use host setup in the defconfig file
   Default Windows: Cygwin
+  -a <app-dir> is the path to the apps/ directory, relative to the nuttx
+     directory
   <board-name> is the name of the board in the boards directory
   configs/<config-name> is the name of the board configuration sub-directory
-  <app-dir> is the path to the apps/ directory, relative to the nuttx
-     directory
 
 "
 
diff --git a/tools/sethost.sh b/tools/sethost.sh
index a9187c9..8ee5580 100755
--- a/tools/sethost.sh
+++ b/tools/sethost.sh
@@ -32,8 +32,6 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-WD=$PWD
-
 progname=$0
 host=linux
 wenv=cygwin
@@ -203,10 +201,6 @@ if [ "X$host" == "Xlinux" -o "X$host" == "Xmacos" ]; then
   kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
   kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
   kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
-
-  kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_SYSTEMV
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_MICROSOFT
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
 else
   echo "  Select CONFIG_HOST_WINDOWS=y"
 
@@ -256,7 +250,6 @@ else
   fi
 fi
 
-kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
 kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_OTHER
 
 echo "  Refreshing..."
diff --git a/tools/testbuild.sh b/tools/testbuild.sh
index 803494b..9ffa7ed 100755
--- a/tools/testbuild.sh
+++ b/tools/testbuild.sh
@@ -34,8 +34,6 @@
 
 WD=$PWD
 nuttx=$WD/../nuttx
-TOOLSDIR=$nuttx/tools
-UNLINK=$TOOLSDIR/unlink.sh
 
 progname=$0
 host=linux
@@ -49,7 +47,7 @@ unset JOPTION
 
 function showusage {
   echo ""
-  echo "USAGE: $progname [-w|l] [-c|u|n] [-s] [-d] [-x] [-j <ncpus>] [-a <apps-dir>] [-t <nuttx-dir><testlist-file>"
+  echo "USAGE: $progname [-w|l] [-c|u|n] [-s] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] <testlist-file>"
   echo "       $progname -h"
   echo ""
   echo "Where:"
@@ -263,7 +261,7 @@ function dotest {
 # Perform the build test for each entry in the test list file
 
 if [ ! -d $APPSDIR ]; then
-  export "ERROR: No directory found at $APPSDIR"
+  echo "ERROR: No directory found at $APPSDIR"
   exit 1
 fi
 


[incubator-nuttx] 01/04: Fix the comment header style in tools folder

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch pr131
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit bb6c70bdcc8517ef03e18e0704b3dcc1367b03c7
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Jan 20 01:03:11 2020 +0800

    Fix the comment header style in tools folder
    
    Change-Id: I189a0e8b86f3af682111668ccdad64a52b48dcb4
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 tools/Config.mk       |  2 +-
 tools/Makefile.export |  2 +-
 tools/Makefile.host   |  2 +-
 tools/checkpatch.sh   |  1 +
 tools/flash_writer.py |  3 ++-
 tools/mkconfigvars.sh |  2 +-
 tools/mkctags.sh      |  2 +-
 tools/noteinfo.c      | 35 +++++++++++++++++++++++++++++++++++
 tools/ocdconsole.py   |  1 +
 tools/refresh.sh      |  2 +-
 tools/testbuild.sh    |  2 +-
 tools/uncrustify.cfg  |  1 +
 tools/version.sh      |  2 +-
 tools/zipme.sh        |  2 +-
 14 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/tools/Config.mk b/tools/Config.mk
index be66d8b..2a45f5b 100644
--- a/tools/Config.mk
+++ b/tools/Config.mk
@@ -1,5 +1,5 @@
 ############################################################################
-# Config.mk
+# tools/Config.mk
 # Global build rules and macros.
 #
 #   Copyright (C) 2011, 2013-2014, 2018-2019 Gregory Nutt. All rights
diff --git a/tools/Makefile.export b/tools/Makefile.export
index 56f30c6..25db226 100644
--- a/tools/Makefile.export
+++ b/tools/Makefile.export
@@ -1,5 +1,5 @@
 ############################################################################
-# Makefile.export
+# tools/Makefile.export
 #
 #   Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gn...@nuttx.org>
diff --git a/tools/Makefile.host b/tools/Makefile.host
index 87560ad..07ebe9e 100644
--- a/tools/Makefile.host
+++ b/tools/Makefile.host
@@ -1,5 +1,5 @@
 ############################################################################
-# Makefile.host
+# tools/Makefile.host
 #
 #   Copyright (C) 2007, 2008, 2011-2012, 2015, 2017-2018 Gregory Nutt. All
 #     rights reserved.
diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh
index e65f15b..574b9d7 100755
--- a/tools/checkpatch.sh
+++ b/tools/checkpatch.sh
@@ -1,4 +1,5 @@
 #!/usr/bin/env bash
+# tools/checkpatch.sh
 #
 # Copyright (C) 2019 Xiaomi
 #
diff --git a/tools/flash_writer.py b/tools/flash_writer.py
index 840f10c..b279915 100755
--- a/tools/flash_writer.py
+++ b/tools/flash_writer.py
@@ -1,4 +1,5 @@
-#! /usr/bin/env python3
+#!/usr/bin/env python3
+# tools/flash_writer.py
 
 # Copyright (C) 2018 Sony Semiconductor Solutions Corp.
 #
diff --git a/tools/mkconfigvars.sh b/tools/mkconfigvars.sh
index 4a5077a..c01a2e4 100755
--- a/tools/mkconfigvars.sh
+++ b/tools/mkconfigvars.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# mkconfivars.sh
+# tools/mkconfivars.sh
 #
 #   Copyright (C) 2013 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gn...@nuttx.org>
diff --git a/tools/mkctags.sh b/tools/mkctags.sh
index 36bc6f9..55b0b1c 100755
--- a/tools/mkctags.sh
+++ b/tools/mkctags.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# mkctags.sh
+# tools/mkctags.sh
 #
 #   Copyright (C) 2013 Ken pettit All rights reserved.
 #   Author: Ken pettit <pe...@gmail.com>
diff --git a/tools/noteinfo.c b/tools/noteinfo.c
index 3cdc843..4bac4f0 100644
--- a/tools/noteinfo.c
+++ b/tools/noteinfo.c
@@ -1,3 +1,38 @@
+/****************************************************************************
+ * tools/noteinfo.c
+ *
+ *   Copyright (C) 2020 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN  ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
 #include <stdio.h>
 #include <stdlib.h>
 
diff --git a/tools/ocdconsole.py b/tools/ocdconsole.py
index c9ec08e..a2ad072 100755
--- a/tools/ocdconsole.py
+++ b/tools/ocdconsole.py
@@ -1,4 +1,5 @@
 #!/usr/bin/env python3
+# tools/ocdconsole.py
 #
 #   Copyright (C) 2019 Dave Marples. All rights reserved.
 #   Author: Dave Marples <da...@marples.net>
diff --git a/tools/refresh.sh b/tools/refresh.sh
index 914a52e..6f1f495 100755
--- a/tools/refresh.sh
+++ b/tools/refresh.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# refresh.sh
+# tools/refresh.sh
 #
 #   Copyright (C) 2014, 2016-2017, 2019 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gn...@nuttx.org>
diff --git a/tools/testbuild.sh b/tools/testbuild.sh
index ca4695d..803494b 100755
--- a/tools/testbuild.sh
+++ b/tools/testbuild.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# testbuild.sh
+# tools/testbuild.sh
 #
 #   Copyright (C) 2016-2019 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gn...@nuttx.org>
diff --git a/tools/uncrustify.cfg b/tools/uncrustify.cfg
index b6eebc4..b3f9ff7 100644
--- a/tools/uncrustify.cfg
+++ b/tools/uncrustify.cfg
@@ -1,3 +1,4 @@
+# tools/uncrustify.cfg
 #
 # uncrustify config file for NuttX
 #
diff --git a/tools/version.sh b/tools/version.sh
index 8e3f57b..31e8412 100755
--- a/tools/version.sh
+++ b/tools/version.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# version.sh
+# tools/version.sh
 #
 #   Copyright (C) 2011, 2019 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gn...@nuttx.org>
diff --git a/tools/zipme.sh b/tools/zipme.sh
index f84387e..2a0ff1f 100755
--- a/tools/zipme.sh
+++ b/tools/zipme.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# zipme.sh
+# tools/zipme.sh
 #
 #   Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gn...@nuttx.org>


[incubator-nuttx] 03/04: Remove the size related option from sehost.sh and testbuild.sh

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch pr131
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit f316c157691bfc87e7640d62645a7ca050688682
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Jan 20 01:08:49 2020 +0800

    Remove the size related option from sehost.sh and testbuild.sh
    
    to aglin with configure.sh
    
    Change-Id: I42f2621dff72b22ee6c51bd44cc4a1c3d81d128e
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 tools/README.txt   |  6 ++----
 tools/sethost.sh   | 14 --------------
 tools/testbuild.sh | 16 +---------------
 3 files changed, 3 insertions(+), 33 deletions(-)

diff --git a/tools/README.txt b/tools/README.txt
index cf357fb..d37a0fb 100644
--- a/tools/README.txt
+++ b/tools/README.txt
@@ -893,14 +893,13 @@ sethost.sh
 
     $ ./sethost.sh -h
 
-    USAGE: ./sethost.sh [-w|l|m] [-c|u|g|n] [-32|64] [<config>]
+    USAGE: ./sethost.sh [-w|l|m] [-c|u|g|n] [<config>]
            ./sethost.sh -h
 
     Where:
       -w|l|m selects Windows (w), Linux (l), or macOS (m).  Default: Linux
       -c|u|g|n selects Windows environment option:  Cygwin (c), Ubuntu under
          Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n).  Default Cygwin
-      -32|64 selects 32- or 64-bit host.  Default 64
       -h will show this help test and terminate
       <config> selects configuration file.  Default: .config
 
@@ -936,14 +935,13 @@ testbuild.sh
 
     $ ./testbuild.sh -h
 
-    USAGE: ./testbuild.sh [-w|l] [-c|u|n] [-s] [-a <appsdir>] [-n <nxdir>] <testlist-file>
+    USAGE: ./testbuild.sh [-w|l] [-c|u|n] [-a <appsdir>] [-n <nxdir>] <testlist-file>
            ./testbuild.sh -h
 
     Where:
       -w|l selects Windows (w) or Linux (l).  Default: Linux
       -c|u|n selects Windows environment option:  Cygwin (c), Ubuntu under
          Windows 10 (u), or Windows native (n).  Default Cygwin
-      -s Use C++ unsigned long size_t in new operator. Default unsigned int
       -a <appsdir> provides the relative path to the apps/ directory.  Default ../apps
       -n <nxdir> provides the relative path to the NxWidgets/ directory.  Default ../NxWidgets
       -d enables script debug output
diff --git a/tools/sethost.sh b/tools/sethost.sh
index 8ee5580..981224f 100755
--- a/tools/sethost.sh
+++ b/tools/sethost.sh
@@ -35,7 +35,6 @@
 progname=$0
 host=linux
 wenv=cygwin
-hsize=64
 unset configfile
 
 function showusage {
@@ -47,7 +46,6 @@ function showusage {
   echo "  -w|l|m selects Windows (w), Linux (l), or macOS (m).  Default: Linux"
   echo "  -c|u|g|n selects Windows environment option:  Cygwin (c), Ubuntu under"
   echo "     Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n).  Default Cygwin"
-  echo "  -32|64 selects 32- or 64-bit host.  Default 64"
   echo "  -h will show this help test and terminate"
   echo "  <config> selects configuration file.  Default: .config"
   exit 1
@@ -82,12 +80,6 @@ while [ ! -z "$1" ]; do
     host=windows
     wenv=native
     ;;
-  -32 )
-    hsize=32
-    ;;
-  -64 )
-    hsize=32
-    ;;
   -h )
     showusage
     ;;
@@ -242,12 +234,6 @@ else
       fi
     fi
   fi
-
-  if [ "X$hsize" == "X32" ]; then
-    kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_M32
-  else
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
-  fi
 fi
 
 kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_OTHER
diff --git a/tools/testbuild.sh b/tools/testbuild.sh
index 9ffa7ed..71798c0 100755
--- a/tools/testbuild.sh
+++ b/tools/testbuild.sh
@@ -38,7 +38,6 @@ nuttx=$WD/../nuttx
 progname=$0
 host=linux
 wenv=cygwin
-sizet=uint
 APPSDIR=../apps
 MAKE_FLAGS=-i
 MAKE=make
@@ -47,14 +46,13 @@ unset JOPTION
 
 function showusage {
   echo ""
-  echo "USAGE: $progname [-w|l] [-c|u|n] [-s] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] <testlist-file>"
+  echo "USAGE: $progname [-w|l] [-c|u|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] <testlist-file>"
   echo "       $progname -h"
   echo ""
   echo "Where:"
   echo "  -w|l selects Windows (w) or Linux (l).  Default: Linux"
   echo "  -c|u|n selects Windows environment option:  Cygwin (c), Ubuntu under"
   echo "     Windows 10 (u), or Windows native (n).  Default Cygwin"
-  echo "  -s Use C++ unsigned long size_t in new operator. Default unsigned int"
   echo "  -d enables script debug output"
   echo "  -x exit on build failures"
   echo "  -j <ncpus> passed on to make.  Default:  No -j make option."
@@ -94,10 +92,6 @@ while [ ! -z "$1" ]; do
     host=windows
     wenv=native
     ;;
-  -s )
-    host=windows
-    sizet=long
-    ;;
   -x )
     MAKE_FLAGS='--silent --no-print-directory'
     set -e
@@ -215,14 +209,6 @@ function configure {
   kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
   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
-
   if [ "X$toolchain" != "X" ]; then
     setting=`grep TOOLCHAIN $nuttx/.config | grep -v CONFIG_ARCH_TOOLCHAIN_GNU=y | grep =y`
     varname=`echo $setting | cut -d'=' -f1`


[incubator-nuttx] 04/04: remove the dup kconfig tweak in configure.sh, testbuild.sh and sethost.sh

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch pr131
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit e59f242f88dd7eb44fdd1b959d4e3d822236ea36
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Jan 20 01:29:34 2020 +0800

    remove the dup kconfig tweak in configure.sh, testbuild.sh and sethost.sh
    
    Change-Id: I2027b6be55609d8828ff39b568d1f8ddcf333e9a
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 tools/README.txt   |  24 ++++++------
 tools/configure.sh | 113 ++++++++---------------------------------------------
 tools/sethost.sh   |  84 +++++++++++++++++++++------------------
 tools/testbuild.sh |  93 +++++--------------------------------------
 4 files changed, 83 insertions(+), 231 deletions(-)

diff --git a/tools/README.txt b/tools/README.txt
index d37a0fb..e9932b4 100644
--- a/tools/README.txt
+++ b/tools/README.txt
@@ -887,19 +887,19 @@ sethost.sh
 
   Or, if you are on a Windows/Cygwin 64-bit platform:
 
-    $ tools/sethost.sh -w
+    $ tools/sethost.sh -c
 
   Other options are available:
 
     $ ./sethost.sh -h
 
-    USAGE: ./sethost.sh [-w|l|m] [-c|u|g|n] [<config>]
+    USAGE: ./sethost.sh [-l|m|c|u|g|n] [<config>]
            ./sethost.sh -h
 
     Where:
-      -w|l|m selects Windows (w), Linux (l), or macOS (m).  Default: Linux
-      -c|u|g|n selects Windows environment option:  Cygwin (c), Ubuntu under
-         Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n).  Default Cygwin
+      -l|m|c|u|g|n selects Linux (l), macOS (m), Cygwin (c),
+         Ubuntu under Windows 10 (u), MSYS/MSYS2 (g)
+         or Windows native (n).  Default Linux
       -h will show this help test and terminate
       <config> selects configuration file.  Default: .config
 
@@ -935,15 +935,15 @@ testbuild.sh
 
     $ ./testbuild.sh -h
 
-    USAGE: ./testbuild.sh [-w|l] [-c|u|n] [-a <appsdir>] [-n <nxdir>] <testlist-file>
+    USAGE: ./testbuild.sh [-l|m|c|u|g|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] <testlist-file>
            ./testbuild.sh -h
 
     Where:
-      -w|l selects Windows (w) or Linux (l).  Default: Linux
-      -c|u|n selects Windows environment option:  Cygwin (c), Ubuntu under
-         Windows 10 (u), or Windows native (n).  Default Cygwin
+      -l|m|c|u|g|n selects Linux (l), macOS (m), Cygwin (c),
+         Ubuntu under Windows 10 (u), or Windows native (n).  Default Linux
       -a <appsdir> provides the relative path to the apps/ directory.  Default ../apps
-      -n <nxdir> provides the relative path to the NxWidgets/ directory.  Default ../NxWidgets
+      -t <topdir> provides the absolute path to top nuttx/ directory.  Default $PWD/../nuttx
+      -j <ncpus> passed on to make.  Default:  No -j make option
       -d enables script debug output
       -x exit on build failures
       -h will show this help test and terminate
@@ -954,8 +954,8 @@ testbuild.sh
 
   These script needs two pieces of information.
 
-    a. A description of the platform that you are testing on.  This
-       description is provided by the optional -w, -l, -c, and -n options.
+    a. A description of the platform that you are testing on.  This description
+       is provided by the optional -l, -m, -c, -u, -g and -n options.
     b. A list of configurations to build.  That list is provided by a test
        list file.  The final, non-optional parameter, <testlist-file>,
        provides the path to that file.
diff --git a/tools/configure.sh b/tools/configure.sh
index 943c2d0..a90517d 100755
--- a/tools/configure.sh
+++ b/tools/configure.sh
@@ -68,10 +68,10 @@ OPTFILES="\
 # Parse command arguments
 
 unset boardconfig
+unset winnative
 unset appdir
 unset host
-unset wenv
-debug=n
+unset debug
 skip=0
 
 while [ ! -z "$1" ]; do
@@ -80,39 +80,25 @@ while [ ! -z "$1" ]; do
     shift
     appdir=$1
     ;;
-  -c )
-    host=windows
-    wenv=cygwin
+  -c | -g | -l | -m | -u )
+    winnative=n
+    host+=" $1"
+    ;;
+  -n )
+    winnative=y
+    host+=" $1"
     ;;
   -d )
-    debug=y
+    debug=-d
     set -x
     ;;
-  -g )
-    host=windows
-    wenv=msys
-    ;;
   -h )
     echo "$USAGE"
     exit 0
     ;;
-  -l )
-    host=linux
-    ;;
-  -m )
-    host=macos
-    ;;
-  -n )
-    host=windows
-    wenv=native
-    ;;
   -s )
     skip=1
     ;;
-  -u )
-    host=windows
-    wenv=ubuntu
-    ;;
   *)
     if [ ! -z "${boardconfig}" ]; then
       echo ""
@@ -204,14 +190,11 @@ fi
 # native host, then don't even check what is in the defconfig file.
 
 oldnative=`grep CONFIG_WINDOWS_NATIVE= ${src_config} | cut -d'=' -f2`
-if [ "X$host" != "Xwindows" -o "X$wenv" != "Xnative" ]; then
-  unset winnative
-else
-  if [ "X$host" == "Xwindows" -a "X$wenv" == "Xnative" ]; then
-    winnative=y
-  else
-    winnative=$oldnative
-  fi
+if [ -z "${oldnative}" ]; then
+  oldnative=n
+fi
+if [ -z "${winnative}" ]; then
+  winnative=$oldnative
 fi
 
 # If no application directory was provided on the command line and we are
@@ -296,73 +279,9 @@ if [ "X${defappdir}" = "Xy" ]; then
   fi
 fi
 
-if [ ! -z "$host" ]; then
-  sed -i -e "/CONFIG_HOST_LINUX/d" ${dest_config}
-  sed -i -e "/CONFIG_HOST_WINDOWS/d" ${dest_config}
-  sed -i -e "/CONFIG_HOST_MACOS/d" ${dest_config}
-  sed -i -e "/CONFIG_HOST_OTHER/d" ${dest_config}
-  sed -i -e "/CONFIG_WINDOWS_NATIVE/d" ${dest_config}
-  sed -i -e "/CONFIG_WINDOWS_CYGWIN/d" ${dest_config}
-  sed -i -e "/CONFIG_WINDOWS_MSYS/d" ${dest_config}
-  sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" ${dest_config}
-  sed -i -e "/CONFIG_WINDOWS_OTHER/d" ${dest_config}
-  sed -i -e "/CONFIG_SIM_X8664_MICROSOFT/d" ${dest_config}
-  sed -i -e "/CONFIG_SIM_X8664_SYSTEMV/d" ${dest_config}
-
-  case "$host" in
-  "linux")
-    echo "  Select CONFIG_HOST_LINUX=y"
-    echo "CONFIG_HOST_LINUX=y" >> "${dest_config}"
-    echo "CONFIG_SIM_X8664_SYSTEMV=y" >> "${dest_config}"
-    ;;
-
-  "macos")
-    echo "  Select CONFIG_HOST_MACOS=y"
-    echo "CONFIG_HOST_MACOS=y" >> "${dest_config}"
-    ;;
-
-  "windows")
-    echo "  Select CONFIG_HOST_WINDOWS=y"
-    echo "CONFIG_HOST_WINDOWS=y" >> "${dest_config}"
-    echo "CONFIG_SIM_X8664_MICROSOFT=y" >> "${dest_config}"
-
-    case "$wenv" in
-    "cygwin")
-      echo "  Select CONFIG_WINDOWS_CYGWIN=y"
-      echo "CONFIG_WINDOWS_CYGWIN=y" >> "${dest_config}"
-      ;;
-
-    "msys")
-      echo "  Select CONFIG_WINDOWS_MSYS=y"
-      echo "CONFIG_WINDOWS_MSYS=y" >> "${dest_config}"
-      ;;
-
-    "ubuntu")
-      echo "  Select CONFIG_WINDOWS_UBUNTU=y"
-      echo "CONFIG_WINDOWS_UBUNTU=y" >> "${dest_config}"
-      ;;
-
-    *)
-      echo "  Select CONFIG_WINDOWS_NATIVE=y"
-      echo "CONFIG_WINDOWS_NATIVE=y" >> "${dest_config}"
-      ;;
-    esac
-  esac
-fi
-
 # The saved defconfig files are all in compressed format and must be
 # reconstitued before they can be used.
 
-echo "  Refreshing..."
 cd ${TOPDIR} || { echo "Failed to cd to ${TOPDIR}"; exit 10; }
 
-MAKE_BIN=make
-if [ ! -z `which gmake 2>/dev/null` ]; then
-  MAKE_BIN=gmake
-fi
-
-if [ "X${debug}" = "Xy" ]; then
-  ${MAKE_BIN} olddefconfig V=1
-else
-  ${MAKE_BIN} olddefconfig 1>/dev/null
-fi
+./tools/sethost.sh $debug $host
diff --git a/tools/sethost.sh b/tools/sethost.sh
index 981224f..2cd63ff 100755
--- a/tools/sethost.sh
+++ b/tools/sethost.sh
@@ -33,19 +33,21 @@
 #
 
 progname=$0
+debug=n
 host=linux
 wenv=cygwin
 unset configfile
 
 function showusage {
   echo ""
-  echo "USAGE: $progname [-w|l|m] [-c|u|g|n] [-32|64] [<config>]"
+  echo "USAGE: $progname -d [-l|m|c|u|g|n] [<config>]"
   echo "       $progname -h"
   echo ""
   echo "Where:"
-  echo "  -w|l|m selects Windows (w), Linux (l), or macOS (m).  Default: Linux"
-  echo "  -c|u|g|n selects Windows environment option:  Cygwin (c), Ubuntu under"
-  echo "     Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n).  Default Cygwin"
+  echo "  -d enables script debug output"
+  echo "  -l|m|c|u|g|n selects Linux (l), macOS (m), Cygwin (c),"
+  echo "     Ubuntu under Windows 10 (u), MSYS/MSYS2 (g)"
+  echo "     or Windows native (n). Default Linux"
   echo "  -h will show this help test and terminate"
   echo "  <config> selects configuration file.  Default: .config"
   exit 1
@@ -55,8 +57,8 @@ function showusage {
 
 while [ ! -z "$1" ]; do
   case $1 in
-  -w )
-    host=windows
+  -d )
+    debug=y
     ;;
   -l )
     host=linux
@@ -173,75 +175,79 @@ if [ "X$host" == "Xlinux" -o "X$host" == "Xmacos" ]; then
   if [ "X$host" == "Xlinux" ]; then
     echo "  Select CONFIG_HOST_LINUX=y"
 
-    kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_LINUX
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
+    echo "CONFIG_HOST_LINUX=y" >> $nuttx/.config
+    sed -i -e "/CONFIG_HOST_MACOS/d" $nuttx/.config
   else
     echo "  Select CONFIG_HOST_MACOS=y"
 
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
-    kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_MACOS
+    sed -i -e "/CONFIG_HOST_LINUX/d" $nuttx/.config
+    echo "CONFIG_HOST_MACOS=y" >> $nuttx/.config
   fi
 
   # Disable all Windows options
 
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_WINDOWS
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_MICROSOFT
-  kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_SYSTEMV
+  sed -i -e "/CONFIG_HOST_WINDOWS/d" $nuttx/.config
+  sed -i -e "/CONFIG_SIM_X8664_MICROSOFT/d" $nuttx/.config
+  echo "CONFIG_SIM_X8664_SYSTEMV=y" >> $nuttx/.config
 
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
+  sed -i -e "/CONFIG_WINDOWS_NATIVE/d" $nuttx/.config
+  sed -i -e "/CONFIG_WINDOWS_CYGWIN/d" $nuttx/.config
+  sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" $nuttx/.config
+  sed -i -e "/CONFIG_WINDOWS_MSYS/d" $nuttx/.config
+  sed -i -e "/CONFIG_WINDOWS_OTHER/d" $nuttx/.config
 else
   echo "  Select CONFIG_HOST_WINDOWS=y"
 
   # Enable Windows
 
-  kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_WINDOWS
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
+  echo "CONFIG_HOST_WINDOWS=y" >> $nuttx/.config
+  sed -i -e "/CONFIG_HOST_LINUX/d" $nuttx/.config
+  sed -i -e "/CONFIG_HOST_MACOS/d" $nuttx/.config
 
-  kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_MICROSOFT
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_SYSTEMV
+  echo "CONFIG_SIM_X8664_MICROSOFT=y" >> $nuttx/.config
+  sed -i -e "/CONFIG_SIM_X8664_SYSTEMV/d" $nuttx/.config
 
   # Enable Windows environment
 
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
+  sed -i -e "/CONFIG_WINDOWS_OTHER/d" $nuttx/.config
   if [ "X$wenv" == "Xcygwin" ]; then
     echo "  Select CONFIG_WINDOWS_CYGWIN=y"
-    kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_CYGWIN
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
+    echo "CONFIG_WINDOWS_CYGWIN=y" >> $nuttx/.config
+    sed -i -e "/CONFIG_WINDOWS_MSYS/d" $nuttx/.config
+    sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" $nuttx/.config
+    sed -i -e "/CONFIG_WINDOWS_NATIVE/d" $nuttx/.config
   else
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
+    sed -i -e "/CONFIG_WINDOWS_CYGWIN/d" $nuttx/.config
     if [ "X$wenv" == "Xmsys" ]; then
       echo "  Select CONFIG_WINDOWS_MSYS=y"
-      kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_MSYS
-      kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
-      kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
+      echo "CONFIG_WINDOWS_MSYS=y" >> $nuttx/.config
+      sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" $nuttx/.config
+      sed -i -e "/CONFIG_WINDOWS_NATIVE/d" $nuttx/.config
     else
-      kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
+      sed -i -e "/CONFIG_WINDOWS_MSYS/d" $nuttx/.config
       if [ "X$wenv" == "Xubuntu" ]; then
         echo "  Select CONFIG_WINDOWS_UBUNTU=y"
-        kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_UBUNTU
-        kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
+        echo "CONFIG_WINDOWS_UBUNTU=y" >> $nuttx/.config
+        sed -i -e "/CONFIG_WINDOWS_NATIVE/d" $nuttx/.config
       else
         echo "  Select CONFIG_WINDOWS_NATIVE=y"
-        kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
-        kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_NATIVE
+        sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" $nuttx/.config
+        echo "CONFIG_WINDOWS_NATIVE=y" $nuttx/.config
       fi
     fi
   fi
 fi
 
-kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_OTHER
+sed -i -e "/CONFIG_HOST_OTHER/d" $nuttx/.config
 
 echo "  Refreshing..."
 cd $nuttx || { echo "ERROR: failed to cd to $nuttx"; exit 1; }
 make clean_context 1>/dev/null 2>&1
-make olddefconfig 1>/dev/null 2>&1
+if [ "X${debug}" = "Xy" ]; then
+  make olddefconfig V=1
+else
+  make olddefconfig 1>/dev/null 2>&1
+fi
 
 # Move config file to correct location and restore any previous .config
 # and Make.defs files
diff --git a/tools/testbuild.sh b/tools/testbuild.sh
index 71798c0..167ec5f 100755
--- a/tools/testbuild.sh
+++ b/tools/testbuild.sh
@@ -36,23 +36,21 @@ WD=$PWD
 nuttx=$WD/../nuttx
 
 progname=$0
-host=linux
-wenv=cygwin
 APPSDIR=../apps
 MAKE_FLAGS=-i
 MAKE=make
 unset testfile
+unset HOPTION
 unset JOPTION
 
 function showusage {
   echo ""
-  echo "USAGE: $progname [-w|l] [-c|u|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] <testlist-file>"
+  echo "USAGE: $progname [-l|m|c|u|g|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] <testlist-file>"
   echo "       $progname -h"
   echo ""
   echo "Where:"
-  echo "  -w|l selects Windows (w) or Linux (l).  Default: Linux"
-  echo "  -c|u|n selects Windows environment option:  Cygwin (c), Ubuntu under"
-  echo "     Windows 10 (u), or Windows native (n).  Default Cygwin"
+  echo "  -l|m|c|u|g|n selects Linux (l), macOS (m), Cygwin (c),"
+  echo "     Ubuntu under Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n).  Default Linux"
   echo "  -d enables script debug output"
   echo "  -x exit on build failures"
   echo "  -j <ncpus> passed on to make.  Default:  No -j make option."
@@ -71,27 +69,12 @@ function showusage {
 
 while [ ! -z "$1" ]; do
   case $1 in
-  -w )
-    host=windows
-    ;;
-  -l )
-    host=linux
-    ;;
-  -c )
-    host=windows
-    wenv=cygwin
+  -l | -m | -c | -u | -g | -n )
+    HOPTION+=" $1"
     ;;
   -d )
     set -x
     ;;
-  -u )
-    host=windows
-    wenv=ubuntu
-    ;;
-  -n )
-    host=windows
-    wenv=native
-    ;;
   -x )
     MAKE_FLAGS='--silent --no-print-directory'
     set -e
@@ -155,75 +138,19 @@ function distclean {
 function configure {
   cd $nuttx/tools || { echo "ERROR: failed to CD to $nuttx/tools"; exit 1; }
   echo "  Configuring..."
-  ./configure.sh $config
-
-  cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
-
-  if [ "X$host" == "Xlinux" ]; then
-    echo "  Select CONFIG_HOST_LINUX=y"
-
-    kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_LINUX
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_WINDOWS
-
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_TOOLCHAIN_WINDOWS
-
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
-
-    kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_SYSTEMV
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_MICROSOFT
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
-  else
-    echo "  Select CONFIG_HOST_WINDOWS=y"
-    kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_WINDOWS
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
-
-    if [ "X$wenv" == "Xcygwin" ]; then
-      echo "  Select CONFIG_WINDOWS_CYGWIN=y"
-      kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_CYGWIN
-      kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
-      kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
-    else
-      kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
-      if [ "X$wenv" == "Xubuntu" ]; then
-        echo "  Select CONFIG_WINDOWS_UBUNTU=y"
-        kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_UBUNTU
-        kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
-      else
-        echo "  Select CONFIG_WINDOWS_NATIVE=y"
-        kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
-        kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_NATIVE
-      fi
-    fi
-
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
-
-    kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_MICROSOFT
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_SYSTEMV
-    kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
-  fi
-
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
-  kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_OTHER
+  ./configure.sh ${HOPTION} $config
 
   if [ "X$toolchain" != "X" ]; then
-    setting=`grep TOOLCHAIN $nuttx/.config | grep -v CONFIG_ARCH_TOOLCHAIN_GNU=y | grep =y`
+    setting=`grep _TOOLCHAIN_ $nuttx/.config | grep -v CONFIG_ARCH_TOOLCHAIN_*=y | grep =y`
     varname=`echo $setting | cut -d'=' -f1`
     if [ ! -z "$varname" ]; then
       echo "  Disabling $varname"
-      kconfig-tweak --file $nuttx/.config --disable $varname
+      sed -i -e "/$varname/d" $nuttx/.config
     fi
 
     echo "  Enabling $toolchain"
-    kconfig-tweak --file $nuttx/.config --enable $toolchain
+    echo "$toolchain=y" >> $nuttx/.config
   fi
-
-  echo "  Refreshing..."
-  cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
-  ${MAKE} ${MAKE_FLAGS} olddefconfig 1>/dev/null 2>&1
 }
 
 # Perform the next build