mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
remove the dup kconfig tweak in configure.sh, testbuild.sh and sethost.sh
Change-Id: I2027b6be55609d8828ff39b568d1f8ddcf333e9a Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
+45
-39
@@ -33,19 +33,21 @@
|
||||
#
|
||||
|
||||
progname=$0
|
||||
debug=n
|
||||
host=linux
|
||||
wenv=cygwin
|
||||
unset configfile
|
||||
|
||||
function showusage {
|
||||
echo ""
|
||||
echo "USAGE: $progname [-w|l|m] [-c|u|g|n] [-32|64] [<config>]"
|
||||
echo "USAGE: $progname -d [-l|m|c|u|g|n] [<config>]"
|
||||
echo " $progname -h"
|
||||
echo ""
|
||||
echo "Where:"
|
||||
echo " -w|l|m selects Windows (w), Linux (l), or macOS (m). Default: Linux"
|
||||
echo " -c|u|g|n selects Windows environment option: Cygwin (c), Ubuntu under"
|
||||
echo " Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n). Default Cygwin"
|
||||
echo " -d enables script debug output"
|
||||
echo " -l|m|c|u|g|n selects Linux (l), macOS (m), Cygwin (c),"
|
||||
echo " Ubuntu under Windows 10 (u), MSYS/MSYS2 (g)"
|
||||
echo " or Windows native (n). Default Linux"
|
||||
echo " -h will show this help test and terminate"
|
||||
echo " <config> selects configuration file. Default: .config"
|
||||
exit 1
|
||||
@@ -55,8 +57,8 @@ function showusage {
|
||||
|
||||
while [ ! -z "$1" ]; do
|
||||
case $1 in
|
||||
-w )
|
||||
host=windows
|
||||
-d )
|
||||
debug=y
|
||||
;;
|
||||
-l )
|
||||
host=linux
|
||||
@@ -173,75 +175,79 @@ if [ "X$host" == "Xlinux" -o "X$host" == "Xmacos" ]; then
|
||||
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_MACOS
|
||||
echo "CONFIG_HOST_LINUX=y" >> $nuttx/.config
|
||||
sed -i -e "/CONFIG_HOST_MACOS/d" $nuttx/.config
|
||||
else
|
||||
echo " Select CONFIG_HOST_MACOS=y"
|
||||
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
|
||||
kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_MACOS
|
||||
sed -i -e "/CONFIG_HOST_LINUX/d" $nuttx/.config
|
||||
echo "CONFIG_HOST_MACOS=y" >> $nuttx/.config
|
||||
fi
|
||||
|
||||
# Disable all Windows options
|
||||
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_WINDOWS
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_MICROSOFT
|
||||
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_SYSTEMV
|
||||
sed -i -e "/CONFIG_HOST_WINDOWS/d" $nuttx/.config
|
||||
sed -i -e "/CONFIG_SIM_X8664_MICROSOFT/d" $nuttx/.config
|
||||
echo "CONFIG_SIM_X8664_SYSTEMV=y" >> $nuttx/.config
|
||||
|
||||
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_UBUNTU
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
|
||||
sed -i -e "/CONFIG_WINDOWS_NATIVE/d" $nuttx/.config
|
||||
sed -i -e "/CONFIG_WINDOWS_CYGWIN/d" $nuttx/.config
|
||||
sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" $nuttx/.config
|
||||
sed -i -e "/CONFIG_WINDOWS_MSYS/d" $nuttx/.config
|
||||
sed -i -e "/CONFIG_WINDOWS_OTHER/d" $nuttx/.config
|
||||
else
|
||||
echo " Select CONFIG_HOST_WINDOWS=y"
|
||||
|
||||
# Enable Windows
|
||||
|
||||
kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_WINDOWS
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
|
||||
echo "CONFIG_HOST_WINDOWS=y" >> $nuttx/.config
|
||||
sed -i -e "/CONFIG_HOST_LINUX/d" $nuttx/.config
|
||||
sed -i -e "/CONFIG_HOST_MACOS/d" $nuttx/.config
|
||||
|
||||
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_MICROSOFT
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_SYSTEMV
|
||||
echo "CONFIG_SIM_X8664_MICROSOFT=y" >> $nuttx/.config
|
||||
sed -i -e "/CONFIG_SIM_X8664_SYSTEMV/d" $nuttx/.config
|
||||
|
||||
# Enable Windows environment
|
||||
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
|
||||
sed -i -e "/CONFIG_WINDOWS_OTHER/d" $nuttx/.config
|
||||
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_MSYS
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
|
||||
echo "CONFIG_WINDOWS_CYGWIN=y" >> $nuttx/.config
|
||||
sed -i -e "/CONFIG_WINDOWS_MSYS/d" $nuttx/.config
|
||||
sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" $nuttx/.config
|
||||
sed -i -e "/CONFIG_WINDOWS_NATIVE/d" $nuttx/.config
|
||||
else
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
|
||||
sed -i -e "/CONFIG_WINDOWS_CYGWIN/d" $nuttx/.config
|
||||
if [ "X$wenv" == "Xmsys" ]; then
|
||||
echo " Select CONFIG_WINDOWS_MSYS=y"
|
||||
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_MSYS
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
|
||||
echo "CONFIG_WINDOWS_MSYS=y" >> $nuttx/.config
|
||||
sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" $nuttx/.config
|
||||
sed -i -e "/CONFIG_WINDOWS_NATIVE/d" $nuttx/.config
|
||||
else
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
|
||||
sed -i -e "/CONFIG_WINDOWS_MSYS/d" $nuttx/.config
|
||||
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
|
||||
echo "CONFIG_WINDOWS_UBUNTU=y" >> $nuttx/.config
|
||||
sed -i -e "/CONFIG_WINDOWS_NATIVE/d" $nuttx/.config
|
||||
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
|
||||
sed -i -e "/CONFIG_WINDOWS_UBUNTU/d" $nuttx/.config
|
||||
echo "CONFIG_WINDOWS_NATIVE=y" $nuttx/.config
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_OTHER
|
||||
sed -i -e "/CONFIG_HOST_OTHER/d" $nuttx/.config
|
||||
|
||||
echo " Refreshing..."
|
||||
cd $nuttx || { echo "ERROR: failed to cd to $nuttx"; exit 1; }
|
||||
make clean_context 1>/dev/null 2>&1
|
||||
make olddefconfig 1>/dev/null 2>&1
|
||||
if [ "X${debug}" = "Xy" ]; then
|
||||
make olddefconfig V=1
|
||||
else
|
||||
make olddefconfig 1>/dev/null 2>&1
|
||||
fi
|
||||
|
||||
# Move config file to correct location and restore any previous .config
|
||||
# and Make.defs files
|
||||
|
||||
Reference in New Issue
Block a user