From 7b3fc03f65d277297e1b76d50b941bd56178b79b Mon Sep 17 00:00:00 2001 From: jeditekunum Date: Thu, 9 Nov 2017 17:11:59 -0600 Subject: [PATCH] tools/configure.sh: This commit adds a -m option for macOS. For anyone not aware, Apple renamed OSX to macOS recently; thus the 'm' instead of 'o'. This does not change the other uses of *_OSX to macOS. --- tools/configure.sh | 68 ++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/tools/configure.sh b/tools/configure.sh index d4067199252..e4a6c5f29c1 100755 --- a/tools/configure.sh +++ b/tools/configure.sh @@ -36,14 +36,16 @@ WD=`test -d ${0%/*} && cd ${0%/*}; pwd` TOPDIR="${WD}/.." USAGE=" -USAGE: ${0} [-d] [-l|c|u|n] [-a ] / +USAGE: ${0} [-d] [-l|m|c|u|n] [-a ] / Where: - -l selects the Linux (l) host environment. The [-c|u|n] options - select one of the Windows environments. Default: Use host setup - in the defconfig file - [-c|u|n] selects the Windows host and a Windows environment: Cygwin (c), - Ubuntu under Windows 10 (u), or Windows native (n). Default Cygwin + -l selects the Linux (l) host environment. + -m selects the macOS (m) host environment. + -c selects the Windows host and Cygwin (c) environment. + -u selects the Windows host and Ubuntu under Windows 10 (u) environment. + -n selects the Windows host and Windows native (n) environment. + Default: Use host setup in the defconfig file + Default Windows: Cygwin is the name of the board in the configs directory is the name of the board configuration sub-directory is the path to the apps/ directory, relative to the nuttx @@ -86,6 +88,9 @@ while [ ! -z "$1" ]; do -l ) host=linux ;; + -m ) + host=macos + ;; -n ) host=windows wenv=native @@ -279,31 +284,40 @@ if [ ! -z "$host" ]; then 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" - echo "CONFIG_HOST_LINUX=y" >> "${dest_config}" - echo "CONFIG_SIM_X8664_SYSTEMV=y" >> "${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}" + ;; - else - echo " Select CONFIG_HOST_WINDOWS=y" - echo "CONFIG_HOST_WINDOWS=y" >> "${dest_config}" - echo "CONFIG_SIM_X8664_MICROSOFT=y" >> "${dest_config}" + "macos") + echo " Select CONFIG_HOST_OSX=y" + echo "CONFIG_HOST_OSX=y" >> "${dest_config}" + ;; - if [ "X$wenv" == "Xcygwin" ]; then - echo " Select CONFIG_WINDOWS_CYGWIN=y" - echo "CONFIG_WINDOWS_CYGWIN=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}" - else - if [ "X$wenv" == "Xubuntu" ]; then - echo " Select CONFIG_WINDOWS_UBUNTU=y" - echo "CONFIG_WINDOWS_UBUNTU=y" >> "${dest_config}" + case "$wenv" in + "cygwin") + echo " Select CONFIG_WINDOWS_CYGWIN=y" + echo "CONFIG_WINDOWS_CYGWIN=y" >> "${dest_config}" + ;; - else - echo " Select CONFIG_WINDOWS_NATIVE=y" - echo "CONFIG_WINDOWS_NATIVE=y" >> "${dest_config}" - fi - fi - fi + "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