You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/12/01 07:59:35 UTC

[incubator-nuttx] branch master updated (6427187 -> 2bbb1f2)

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

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


    from 6427187  mm/circbuf: fix the problem of dividing by zero.
     new b044ec5  configure.sh: support custom board build with absolute path
     new 2bbb1f2  configure.c: add custom board path build support too

The 2 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/configure.c  | 114 ++++++++++++++++++++++++++++++++---------------------
 tools/configure.sh |  17 ++++----
 2 files changed, 79 insertions(+), 52 deletions(-)


[incubator-nuttx] 02/02: configure.c: add custom board path build support too

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

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

commit 2bbb1f28d52746b5b6f0411069b40af2e29f04f5
Author: liuhaitao <li...@xiaomi.com>
AuthorDate: Mon Nov 30 20:47:57 2020 +0800

    configure.c: add custom board path build support too
    
    Signed-off-by: liuhaitao <li...@xiaomi.com>
---
 tools/configure.c | 114 +++++++++++++++++++++++++++++++++---------------------
 1 file changed, 69 insertions(+), 45 deletions(-)

diff --git a/tools/configure.c b/tools/configure.c
index 2270c8a..fd65b0a 100644
--- a/tools/configure.c
+++ b/tools/configure.c
@@ -365,30 +365,40 @@ static void parse_args(int argc, char **argv)
 
   /* The required option should be the board directory name and the
    * configuration directory name separated by ':', '/' or '\'.  Any are
-   * acceptable in this context.
+   * acceptable in this context. Or using the custom board relative or
+   * absolute path directly here.
    */
 
   g_boarddir = argv[optind];
   optind++;
 
-  ptr = strchr(g_boarddir, ':');
-  if (ptr == NULL)
+  if (!verify_optiondir(g_boarddir))
     {
-      ptr = strchr(g_boarddir, '/');
-      if (!ptr)
+      ptr = strchr(g_boarddir, ':');
+      if (ptr == NULL)
         {
-          ptr = strchr(g_boarddir, '\\');
+          ptr = strchr(g_boarddir, '/');
+          if (!ptr)
+            {
+              ptr = strchr(g_boarddir, '\\');
+            }
         }
-    }
 
-  if (ptr == NULL)
-    {
-      fprintf(stderr, "ERROR: Invalid <board-name>:<config-name>\n");
-      show_usage(argv[0], EXIT_FAILURE);
+      if (ptr == NULL)
+        {
+          fprintf(stderr, "ERROR: Invalid <board-name>:<config-name>\n");
+          show_usage(argv[0], EXIT_FAILURE);
+        }
+
+      *ptr++ = '\0';
+      g_configdir = ptr;
     }
+  else
+    {
+      /* custom board case with relative or absolute path */
 
-  *ptr++ = '\0';
-  g_configdir = ptr;
+      g_configpath = strdup(g_boarddir);
+    }
 
   /* The left arguments will pass to make */
 
@@ -799,48 +809,62 @@ static void enumerate_configs(void)
 
 static void check_configdir(void)
 {
-  /* Get the path to the top level configuration directory: boards/ */
+  if (verify_optiondir(g_configpath))
+    {
+      /* Get the path to the custom board scripts directory */
 
-  snprintf(g_buffer, BUFFER_SIZE, "%s%cboards", g_topdir, g_delim);
-  debug("check_configdir: Checking configtop=%s\n", g_buffer);
+      snprintf(g_buffer, BUFFER_SIZE, "%s%c..%c..%cscripts",
+               g_configpath, g_delim, g_delim, g_delim);
+      if (verify_optiondir(g_buffer))
+        {
+          g_scriptspath = strdup(g_buffer);
+        }
+    }
+  else
+    {
+      /* Get the path to the top level configuration directory: boards/ */
 
-  verify_directory(g_buffer);
-  g_configtop = strdup(g_buffer);
+      snprintf(g_buffer, BUFFER_SIZE, "%s%cboards", g_topdir, g_delim);
+      debug("check_configdir: Checking configtop=%s\n", g_buffer);
 
-  /* Get and verify the path to the selected configuration:
-   * boards/<archdir>/<chipdir>/<boarddir>/configs/<configdir>
-   */
+      verify_directory(g_buffer);
+      g_configtop = strdup(g_buffer);
 
-  find_archname();
+      /* Get and verify the path to the selected configuration:
+       * boards/<archdir>/<chipdir>/<boarddir>/configs/<configdir>
+       */
 
-  snprintf(g_buffer, BUFFER_SIZE, "%s%cboards%c%s%c%s%c%s%cconfigs%c%s",
-           g_topdir, g_delim, g_delim, g_archdir, g_delim, g_chipdir,
-           g_delim, g_boarddir, g_delim, g_delim, g_configdir);
-  debug("check_configdir: Checking configpath=%s\n", g_buffer);
+      find_archname();
 
-  if (!verify_optiondir(g_buffer))
-    {
-      fprintf(stderr, "ERROR: No configuration at %s\n", g_buffer);
-      fprintf(stderr, "Run tools/configure -L"
-                      " to list available configurations.\n");
-      exit(EXIT_FAILURE);
-    }
+      snprintf(g_buffer, BUFFER_SIZE, "%s%cboards%c%s%c%s%c%s%cconfigs%c%s",
+               g_topdir, g_delim, g_delim, g_archdir, g_delim, g_chipdir,
+               g_delim, g_boarddir, g_delim, g_delim, g_configdir);
+      debug("check_configdir: Checking configpath=%s\n", g_buffer);
 
-  g_configpath = strdup(g_buffer);
+      if (!verify_optiondir(g_buffer))
+        {
+          fprintf(stderr, "ERROR: No configuration at %s\n", g_buffer);
+          fprintf(stderr, "Run tools/configure -L"
+                          " to list available configurations.\n");
+          exit(EXIT_FAILURE);
+        }
 
-  /* Get and verify the path to the scripts directory:
-   * boards/<archdir>/<chipdir>/<boarddir>/scripts
-   */
+      g_configpath = strdup(g_buffer);
 
-  snprintf(g_buffer, BUFFER_SIZE, "%s%cboards%c%s%c%s%c%s%cscripts",
-           g_topdir, g_delim, g_delim, g_archdir, g_delim,
-           g_chipdir, g_delim, g_boarddir, g_delim);
-  debug("check_configdir: Checking scriptspath=%s\n", g_buffer);
+      /* Get and verify the path to the scripts directory:
+       * boards/<archdir>/<chipdir>/<boarddir>/scripts
+       */
 
-  g_scriptspath = NULL;
-  if (verify_optiondir(g_buffer))
-    {
-      g_scriptspath = strdup(g_buffer);
+      snprintf(g_buffer, BUFFER_SIZE, "%s%cboards%c%s%c%s%c%s%cscripts",
+               g_topdir, g_delim, g_delim, g_archdir, g_delim,
+               g_chipdir, g_delim, g_boarddir, g_delim);
+      debug("check_configdir: Checking scriptspath=%s\n", g_buffer);
+
+      g_scriptspath = NULL;
+      if (verify_optiondir(g_buffer))
+        {
+          g_scriptspath = strdup(g_buffer);
+        }
     }
 }
 


[incubator-nuttx] 01/02: configure.sh: support custom board build with absolute path

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

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

commit b044ec5a864118fa6b71156bb452a03b1b9da47a
Author: liuhaitao <li...@xiaomi.com>
AuthorDate: Mon Nov 23 17:17:18 2020 +0800

    configure.sh: support custom board build with absolute path
    
    Also add custom board build with absolute path support in addtion
    to relative path.
    
    Change-Id: I01bcb0b79db9e245484540c714036c64234b3656
    Signed-off-by: liuhaitao <li...@xiaomi.com>
---
 tools/configure.sh | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/tools/configure.sh b/tools/configure.sh
index 5365b28..a9c2710 100755
--- a/tools/configure.sh
+++ b/tools/configure.sh
@@ -148,11 +148,14 @@ if [ ! -d ${configpath} ]; then
 
   configpath=${TOPDIR}/${boardconfig}
   if [ ! -d ${configpath} ]; then
-    echo "Directory for ${boardconfig} does not exist."
-    echo ""
-    echo "Run tools/configure.sh -L to list available configurations."
-    echo "$USAGE"
-    exit 3
+    configpath=${boardconfig}
+    if [ ! -d ${configpath} ]; then
+      echo "Directory for ${boardconfig} does not exist."
+      echo ""
+      echo "Run tools/configure.sh -L to list available configurations."
+      echo "$USAGE"
+      exit 3
+    fi
   fi
 fi
 
@@ -163,9 +166,9 @@ if [ ! -r ${src_makedefs} ]; then
   src_makedefs=${TOPDIR}/boards/*/*/${boarddir}/scripts/Make.defs
 
   if [ ! -r ${src_makedefs} ]; then
-    src_makedefs=${TOPDIR}/${boardconfig}/Make.defs
+    src_makedefs=${configpath}/Make.defs
     if [ ! -r ${src_makedefs} ]; then
-      src_makedefs=${TOPDIR}/${boardconfig}/../../scripts/Make.defs
+      src_makedefs=${configpath}/../../scripts/Make.defs
 
       if [ ! -r ${src_makedefs} ]; then
         echo "File Make.defs could not be found"