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

Function check_appdir

tools/configure.c:989–1064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

987}
988
989static void check_appdir(void)
990{
991 char tmp[16];
992
993 /* Get and verify the full path to the application directory */
994
995 /* Was the appdir provided on the command line? */
996
997 debug("check_appdir: Command line appdir=%s\n",
998 g_appdir ? g_appdir : "<null>");
999
1000 if (!g_appdir)
1001 {
1002 /* If no application directory was provided on the command line and we
1003 * are switching between a windows native host and some other host then
1004 * ignore any path to the apps/ directory in the defconfig file. It
1005 * will most certainly not be in a usable form.
1006 */
1007
1008 if (g_winnative == g_oldnative)
1009 {
1010 /* No, was the path provided in the configuration? */
1011
1012 struct variable_s *var =
1013 find_variable("CONFIG_APPS_DIR", g_configvars);
1014
1015 if (var != NULL)
1016 {
1017 debug("check_appdir: Config file appdir=%s\n",
1018 var->val ? var->val : "<null>");
1019
1020 /* Yes.. does this directory exist? */
1021
1022 if (var->val && verify_appdir(var->val))
1023 {
1024 /* We are using the CONFIG_APPS_DIR setting already in the
1025 * defconfig file.
1026 */
1027
1028 g_needapppath = false;
1029 return;
1030 }
1031 }
1032 }
1033
1034 /* Now try some canned locations */
1035
1036 /* Try ../apps-xx.yy where xx.yy is the version string */
1037
1038 snprintf(tmp, 16, "..%capps-%s", g_delim, g_verstring);
1039 debug("check_appdir: Try appdir=%s\n", tmp);
1040 if (verify_appdir(tmp))
1041 {
1042 return;
1043 }
1044
1045 /* Try ../apps with no version */
1046

Callers 1

mainFunction · 0.85

Calls 6

verify_appdirFunction · 0.85
fprintfFunction · 0.85
exitFunction · 0.85
debugFunction · 0.70
find_variableFunction · 0.70
snprintfFunction · 0.50

Tested by

no test coverage detected