configure.c: add custom board path build support too

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This commit is contained in:
liuhaitao 2020-11-30 20:47:57 +08:00 committed by Xiang Xiao
parent b044ec5a86
commit 2bbb1f28d5

View File

@ -365,12 +365,15 @@ static void parse_args(int argc, char **argv)
/* The required option should be the board directory name and the /* The required option should be the board directory name and the
* configuration directory name separated by ':', '/' or '\'. Any are * configuration directory name separated by ':', '/' or '\'. Any are
* acceptable in this context. * acceptable in this context. Or using the custom board relative or
* absolute path directly here.
*/ */
g_boarddir = argv[optind]; g_boarddir = argv[optind];
optind++; optind++;
if (!verify_optiondir(g_boarddir))
{
ptr = strchr(g_boarddir, ':'); ptr = strchr(g_boarddir, ':');
if (ptr == NULL) if (ptr == NULL)
{ {
@ -389,6 +392,13 @@ static void parse_args(int argc, char **argv)
*ptr++ = '\0'; *ptr++ = '\0';
g_configdir = ptr; g_configdir = ptr;
}
else
{
/* custom board case with relative or absolute path */
g_configpath = strdup(g_boarddir);
}
/* The left arguments will pass to make */ /* The left arguments will pass to make */
@ -798,6 +808,19 @@ static void enumerate_configs(void)
} }
static void check_configdir(void) static void check_configdir(void)
{
if (verify_optiondir(g_configpath))
{
/* Get the path to the custom board scripts directory */
snprintf(g_buffer, BUFFER_SIZE, "%s%c..%c..%cscripts",
g_configpath, g_delim, g_delim, g_delim);
if (verify_optiondir(g_buffer))
{
g_scriptspath = strdup(g_buffer);
}
}
else
{ {
/* Get the path to the top level configuration directory: boards/ */ /* Get the path to the top level configuration directory: boards/ */
@ -843,6 +866,7 @@ static void check_configdir(void)
g_scriptspath = strdup(g_buffer); g_scriptspath = strdup(g_buffer);
} }
} }
}
static void check_configured(void) static void check_configured(void)
{ {