tools/configure.*: Add -s option to skip .config/Make.defs existence check.

This commit is contained in:
Xiang Xiao 2019-09-16 07:38:29 -06:00 committed by Gregory Nutt
parent 66a55c91e7
commit bf3ffddf2f
2 changed files with 22 additions and 3 deletions

View File

@ -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.
*/

View File

@ -37,9 +37,10 @@ WD=`test -d ${0%/*} && cd ${0%/*}; pwd`
TOPDIR="${WD}/.."
USAGE="
USAGE: ${0} [-d] [-l|m|c|u|g|n] [-a <app-dir>] <board-name>[:<config-name>]
USAGE: ${0} [-d] [-s] [-l|m|c|u|g|n] [-a <app-dir>] <board-name>:<config-name>
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