MCPcopy Create free account
hub / github.com/apache/nuttx / check_configuration

Function check_configuration

tools/configure.c:1066–1151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1064}
1065
1066static void check_configuration(void)
1067{
1068 struct variable_s *var;
1069
1070 /* Check if this is a Windows native configuration */
1071
1072 var = find_variable("CONFIG_WINDOWS_NATIVE", g_configvars);
1073 if (var && var->val && strcmp("y", var->val) == 0)
1074 {
1075 debug("check_configuration: Windows native configuration\n");
1076 g_oldnative = true;
1077 }
1078
1079 /* If we are going to some host other than windows native or to a windows
1080 * native host, then don't ignore what is in the defconfig file.
1081 */
1082
1083 if (g_host == HOST_NOCHANGE)
1084 {
1085 /* Use whatever we found in the configuration file */
1086
1087 g_winnative = g_oldnative;
1088 }
1089 else if (g_host == HOST_WINDOWS && g_windows == WINDOWS_NATIVE)
1090 {
1091 /* The new configuration is windows native */
1092
1093 g_winnative = true;
1094 }
1095
1096 /* All configurations must provide a defconfig and Make.defs file */
1097
1098 snprintf(g_buffer, BUFFER_SIZE, "%s%cdefconfig", g_configpath, g_delim);
1099 debug("check_configuration: Checking %s\n", g_buffer);
1100 if (!verify_file(g_buffer))
1101 {
1102 fprintf(stderr, "ERROR: No configuration in %s\n", g_configpath);
1103 fprintf(stderr, " No defconfig file found.\n");
1104 fprintf(stderr, "Run tools/configure -L"
1105 " to list available configurations.\n");
1106 exit(EXIT_FAILURE);
1107 }
1108
1109 g_srcdefconfig = strdup(g_buffer);
1110
1111 /* Try the Make.defs file */
1112
1113 snprintf(g_buffer, BUFFER_SIZE, "%s%cMake.defs", g_configpath, g_delim);
1114 debug("check_configuration: Checking %s\n", g_buffer);
1115 if (!verify_file(g_buffer))
1116 {
1117 /* An alternative location is the scripts/ directory */
1118
1119 if (g_scriptspath != NULL)
1120 {
1121 snprintf(g_buffer, BUFFER_SIZE, "%s%cMake.defs",
1122 g_scriptspath, g_delim);
1123 debug("check_configuration: Checking %s\n", g_buffer);

Callers 1

mainFunction · 0.85

Calls 8

verify_fileFunction · 0.85
fprintfFunction · 0.85
exitFunction · 0.85
strdupFunction · 0.85
find_variableFunction · 0.70
debugFunction · 0.70
strcmpFunction · 0.50
snprintfFunction · 0.50

Tested by

no test coverage detected