diff --git a/configs/z80sim/README.txt b/configs/z80sim/README.txt index 53d94f4b7df..28d871a8030 100644 --- a/configs/z80sim/README.txt +++ b/configs/z80sim/README.txt @@ -12,7 +12,7 @@ Contents o Configuring NuttX o Reconfiguring NuttX - o Reconfiguring for Linux, OSX, or Cygwin + o Reconfiguring for Windows Native, Cygwin, or OSX o SDCC o Building the SDCC toolchain @@ -36,10 +36,10 @@ Configuring NuttX "Reconfiguring" section below for information about changing this configuration. - 2. The default setup for this configuration uses a windows native build. - See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" - which will give you the steps you would need to do to convert this - configuration to build in other, Unix-like environments. + 2. The default setup for this configuration builds under Linux. + See the section entitled "Reconfiguring for Windows Native, Cygwin, + or OSX" which will give you the steps you would need to do to convert + this configuration to build in other environments. 3. This configuration was last verified sucessfully prior to the the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run @@ -66,9 +66,9 @@ Configuring NuttX configuration. 2. The default setup for this configuration uses a windows native build. - See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" - which will give you the steps you would need to do to convert this - configuration to build in other, Unix-like environments. + See the section entitled "Reconfiguring for Windows Native, Cygwin, + or OSX" which will give you the steps you would need to do to convert + this configuration to build in other environments. 3. This configuration was last verified sucessfully prior to the the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run @@ -97,9 +97,9 @@ Configuring NuttX configuration. 2. The default setup for this configuration uses a windows native build. - See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" - which will give you the steps you would need to do to convert this - configuration to build in other, Unix-like environments. + See the section entitled "Reconfiguring for Windows Native, Cygwin, + or OSX" which will give you the steps you would need to do to convert + this configuration to build in other environments. 3. This configuration was last verified sucessfully prior to the the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run @@ -117,26 +117,25 @@ tool. To change this configuration using that tool, you should: b. Execute 'make menuconfig' in nuttx/ in order to start the reconfiguration process. -Reconfiguring for Linux, OSX, or Cygwin -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Reconfiguring for Windows Native, Cygwin, or OSX +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -All of the z80 configurations in this this directory are set up to build in a -Windows CMD.exe shell. This configuration requires the MinGW host compiler -and severl GNUWin32 tools (see discussion in the top-level NuttX/README.txt -file). +All of the z80 configurations in this this directory are set up to build +under Linux. That configuration can be converted to run natively in a +Windows CMD.exe shell. That configuration requires the MinGW host compiler +and several GNUWin32 tools (see discussion in the top-level NuttX/README.txt +file) and the following changes to the configuation file: -These configurations can be converted to run under Linux (or Cygwin or OSX), -by modifying the configuration file as follows: + -CONFIG_HOST_LINUX=y + +CONFIG_HOST_WINDOWS=y + +CONFIG_WINDOWS_NATIVE=y - -CONFIG_HOST_WINDOWS=y - -CONFIG_WINDOWS_NATIVE=y - +CONFIG_HOST_LINUX=y + -CONFIG_Z80_TOOLCHAIN_SDCCL=y + +CONFIG_Z80_TOOLCHAIN_SDCCW=y - -CONFIG_Z80_TOOLCHAIN_SDCCW=y - +CONFIG_Z80_TOOLCHAIN_SDCCL=y - -You may need to first manually change the CONFIG_APPS_DIR="..\apps" definition -in the .config file because the backslash may upset some Unix-based tools. +You may need to first manually change the CONFIG_APPS_DIR="../apps" +definition in the .config file because the forward slash may upset some +Windows-based tools. This configuration will require a recent version of SDCC (ca. 3.2.1) for Linux or custom built for Cygwin (see below). diff --git a/configs/z80sim/ostest/defconfig b/configs/z80sim/ostest/defconfig index 471c0400ca8..2743a966d41 100644 --- a/configs/z80sim/ostest/defconfig +++ b/configs/z80sim/ostest/defconfig @@ -13,7 +13,6 @@ CONFIG_DISABLE_PTHREAD=y CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=4 CONFIG_EXAMPLES_OSTEST_STACKSIZE=1024 CONFIG_EXAMPLES_OSTEST=y -CONFIG_HOST_WINDOWS=y CONFIG_MAX_TASKS=8 CONFIG_MAX_WDOGPARMS=2 CONFIG_NFILE_DESCRIPTORS=0 @@ -37,4 +36,3 @@ CONFIG_UART_TXBUFSIZE=64 CONFIG_USER_ENTRYPOINT="ostest_main" CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_WDOG_INTRESERVE=0 -CONFIG_WINDOWS_NATIVE=y diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 6e7430a6cce..76a9d1f3c91 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -282,7 +282,7 @@ /* SDCC-specific definitions ************************************************/ -#elif defined(__SDCC__) || defined(SDCC) +#elif defined(SDCC) || defined(__SDCC) /* No I-space access qualifiers */ diff --git a/include/sys/types.h b/include/sys/types.h index ed82645e7d0..d548ad62b2b 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -64,11 +64,11 @@ /* NULL is usually defined in stddef.h (which includes this file) */ #ifndef NULL - /* SDCC is sensitive to NULL pointer type conversions, and C++ defines - * NULL as zero - */ + /* SDCC is sensitive to NULL pointer type conversions, and C++ defines + * NULL as zero + */ -# if defined(SDCC) || defined(__cplusplus) +# if defined(SDCC) || defined(__SDCC) || defined(__cplusplus) # define NULL (0) # else # define NULL ((void*)0) diff --git a/tools/configure.sh b/tools/configure.sh index 429548f5ef5..2f09cb73789 100755 --- a/tools/configure.sh +++ b/tools/configure.sh @@ -266,45 +266,40 @@ if [ "X${defappdir}" = "Xy" ]; then 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_OSX/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} + sed -i -e "/CONFIG_SIM_M32/d" ${dest_config} if [ "$host" == "linux" ]; then echo " Select CONFIG_HOST_LINUX=y" - - sed -i -e "/CONFIG_HOST_WINDOWS/d" ${dest_config} - sed -i -e "/CONFIG_SIM_X8664_MICROSOFT/d" ${dest_config} - sed -i -e "/CONFIG_SIM_M32/d" ${dest_config} echo "CONFIG_HOST_LINUX=y" >> "${dest_config}" echo "CONFIG_SIM_X8664_SYSTEMV=y" >> "${dest_config}" -else + else echo " Select CONFIG_HOST_WINDOWS=y" - - sed -i -e "/CONFIG_HOST_LINUX/d" ${dest_config} - sed -i -e "/CONFIG_WINDOWS_MSYS/d" ${dest_config} - sed -i -e "/CONFIG_WINDOWS_OTHER/d" ${dest_config} - sed -i -e "/CONFIG_SIM_X8664_SYSTEMV/d" ${dest_config} echo "CONFIG_HOST_WINDOWS=y" >> "${dest_config}" echo "CONFIG_SIM_X8664_MICROSOFT=y" >> "${dest_config}" if [ "X$wenv" == "Xcygwin" ]; then echo " Select CONFIG_WINDOWS_CYGWIN=y" - - sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" ${dest_config} - sed -i -e "/CONFIG_WINDOWS_NATIVE/d" ${dest_config} echo "CONFIG_WINDOWS_CYGWIN=y" >> "${dest_config}" + else - sed -i -e "/CONFIG_WINDOWS_CYGWIN/d" ${dest_config} if [ "X$wenv" == "Xubuntu" ]; then echo " Select CONFIG_WINDOWS_UBUNTU=y" - - sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" ${dest_config} echo "CONFIG_WINDOWS_UBUNTU=y" >> "${dest_config}" + else echo " Select CONFIG_WINDOWS_NATIVE=y" - - sed -i -e "/CONFIG_WINDOWS_NATIVE/d" ${dest_config} echo "CONFIG_WINDOWS_NATIVE=y" >> "${dest_config}" fi fi