From bf3ffddf2f29e3eef4b0f5c2c7b3a872fb53ff6c Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 16 Sep 2019 07:38:29 -0600 Subject: [PATCH] tools/configure.*: Add -s option to skip .config/Make.defs existence check. --- tools/configure.c | 16 +++++++++++++++- tools/configure.sh | 9 +++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/tools/configure.c b/tools/configure.c index c4d9ed06b8..dec3032b38 100644 --- a/tools/configure.c +++ b/tools/configure.c @@ -118,6 +118,7 @@ static char g_delim = '/'; /* Delimiter to use when forming pat static bool g_winpaths = false; /* False: POSIX style paths */ #endif static bool g_debug = false; /* Enable debug output */ +static bool g_skip = false; /* Skip .config/Make.defs existence check */ static const char *g_appdir = NULL; /* Relative path to the application directory */ static const char *g_archdir = NULL; /* Name of architecture subdirectory */ @@ -270,6 +271,8 @@ static void show_usage(const char *progname, int exitcode) fprintf(stderr, " instead of Windows style paths like C:\\Program Files are used. POSIX\n"); fprintf(stderr, " style paths are used by default.\n"); #endif + fprintf(stderr, " -s:\n"); + fprintf(stderr, " Skip the .config/Make.defs existence check\n"); fprintf(stderr, " [-l|m|c|u|g|n]\n"); fprintf(stderr, " Selects the host environment.\n"); fprintf(stderr, " -l Selects the Linux (l) host environment.\n"); @@ -360,7 +363,7 @@ static void parse_args(int argc, char **argv) g_debug = false; - while ((ch = getopt(argc, argv, "a:bcdfghlmnu")) > 0) + while ((ch = getopt(argc, argv, "a:bcdfghlmnsu")) > 0) { switch (ch) { @@ -408,6 +411,10 @@ static void parse_args(int argc, char **argv) g_windows = WINDOWS_NATIVE; break; + case 's' : + g_skip = true; + break; + case 'u' : g_host = HOST_WINDOWS; g_windows = WINDOWS_UBUNTU; @@ -824,6 +831,13 @@ static void check_configdir(void) static void check_configured(void) { + /* Skip to check .config/Make.defs? */ + + if (g_skip) + { + return; + } + /* If we are already configured then there will be a .config and a Make.defs * file in the top-level directory. */ diff --git a/tools/configure.sh b/tools/configure.sh index e90d85b968..5da045f3dd 100755 --- a/tools/configure.sh +++ b/tools/configure.sh @@ -37,9 +37,10 @@ WD=`test -d ${0%/*} && cd ${0%/*}; pwd` TOPDIR="${WD}/.." USAGE=" -USAGE: ${0} [-d] [-l|m|c|u|g|n] [-a ] [:] +USAGE: ${0} [-d] [-s] [-l|m|c|u|g|n] [-a ] : Where: + -s Skip the .config/Make.defs existence check -l selects the Linux (l) host environment. -m selects the macOS (m) host environment. -c selects the Windows host and Cygwin (c) environment. @@ -69,6 +70,7 @@ unset boardconfig unset appdir unset host unset wenv +skip=0 while [ ! -z "$1" ]; do case "$1" in @@ -101,6 +103,9 @@ while [ ! -z "$1" ]; do host=windows wenv=native ;; + -s ) + skip=1 + ;; -u ) host=windows wenv=ubuntu @@ -201,7 +206,7 @@ if [ ! -r "${src_config}" ]; then exit 5 fi -if [ -r ${dest_config} ]; then +if [ ${skip} != 1 ] && [ -r ${dest_config} ]; then echo "Already configured!" echo "Do 'make distclean' and try again." exit 6