xiaoxiang781216 commented on a change in pull request #131: Improve config
URL: https://github.com/apache/incubator-nuttx/pull/131#discussion_r370457778
 
 

 ##########
 File path: tools/testbuild.sh
 ##########
 @@ -163,83 +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
-
-  if [ "X$sizet" == "Xlong" ]; then
 
 Review comment:
   But it isn't consistent from your explanation:
   1.If size_t definition is provided by toolchain(either tool self or c 
library) and NuttX use that definition directly, it is impossible that what 
compiler want is different from NuttX provided.
   2.Only when size_t is provided by NuttX, it is possible that compiler 
internal prototype is different from NuttX provided. CONFIG_CXX_NEWLONG can 
help resolve this mismatch here.
   The defintion actually come form nuttx/include/sys/types.h:
   /* size_t is used for sizes of memory objects.
    * ssize_t is used for a count of bytes or an error indication.
    *
    * See also definitions of SIZE_MAX et al in limits.h.
    *
    * REVISIT: size_t belongs in stddef.h
    */
   
   #ifdef CONFIG_SMALL_MEMORY
   
   typedef uint16_t     size_t;
   typedef int16_t      ssize_t;
   typedef uint16_t     rsize_t;
   
   #else /* CONFIG_SMALL_MEMORY */
   /* As a general rule, the size of size_t should be the same as the size of
    * uintptr_t: 32-bits on a machine with 32-bit addressing but 64-bits on a
    * machine with 64-bit addressing.
    */
   
   typedef uintptr_t    size_t;
   typedef intptr_t     ssize_t;
   typedef uintptr_t    rsize_t;
   
   #endif /* CONFIG_SMALL_MEMORY */
   
   Since the code generated by toolchain call many internal functions which is 
replaced/provided by NuttX(new is just one case). Is it better to  use the 
basic typedef from toolchain directly? This approach could resolve all 
potential conflict but without any manual configuration.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to