lucasssvaz commented on code in PR #9400:
URL: https://github.com/apache/nuttx/pull/9400#discussion_r1212417720


##########
tools/configure.c:
##########
@@ -1590,6 +1590,48 @@ static void refresh(void)
     }
 }
 
+static void generate_info()
+{
+  /* Append the configuration information to the .info file */
+
+  FILE *stream;
+  char *tmp_boarddir;
+
+  snprintf(g_buffer, BUFFER_SIZE, "%s%c%s", g_topdir, g_delim, ".info");
+  stream = fopen(g_buffer, "w");
+  if (!stream)
+    {
+      fprintf(stderr,
+              "ERROR: Failed to open %s for write mode: %s\n",
+              g_buffer, strerror(errno));
+      exit(EXIT_FAILURE);
+    }
+
+  tmp_boarddir = double_appdir_backslashes(g_boarddir);
+  if (NULL == tmp_boarddir)
+    {
+      fprintf(stderr,
+              "ERROR: Failed to double boarddir backslashes\n");
+      exit(EXIT_FAILURE);
+    }
+
+  fprintf(stream, "CONFIG_BASE_DEFCONFIG=\"%s\"\n", tmp_boarddir);

Review Comment:
   @patacongo I tried to create the config as you suggested but the value is 
always the default. If I make it a named config, it works as expected. Any idea 
why ?
   ```
   config BASE_DEFCONFIG
       string
       default ""
   ```
   Generates:
   ```
   #
   # Build Configuration
   #
   CONFIG_APPS_DIR="../apps"
   CONFIG_BASE_DEFCONFIG=""
   CONFIG_BUILD_FLAT=y
   # CONFIG_BUILD_2PASS is not set
   ```
   
   But,
   ```
   config BASE_DEFCONFIG
       string "Base defconfig"
       default ""
   ```
   Generates
   ```
   #
   # Build Configuration
   #
   CONFIG_APPS_DIR="../apps"
   CONFIG_BASE_DEFCONFIG="esp32-devkitc:nsh"
   CONFIG_BUILD_FLAT=y
   # CONFIG_BUILD_2PASS is not set
   ```
   
   Both doing the following in the configure script
   ```
   posboardconfig=`echo "${boardconfig}" | sed -e 's/\\\\/\\//g'`
   echo "CONFIG_BASE_DEFCONFIG=\"$posboardconfig\"" >> "${dest_config}"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to