tools/mkconfig.c: Add definitions to distinguish between tristate 'y' and 'm' options.

This commit is contained in:
Gregory Nutt
2019-01-05 08:44:17 -06:00
parent 11881f8fc6
commit d1979ace8f
2 changed files with 13 additions and 2 deletions
+9 -2
View File
@@ -343,8 +343,8 @@ void generate_definitions(FILE *stream)
printf("#undef %s\n", varname);
}
/* Simply define the configuration variable if it has the special
* value "y"
/* Simply define the configuration variable to '1' if it has the
* special value "y"
*/
else if (strcmp(varval, "y") == 0)
@@ -352,6 +352,13 @@ void generate_definitions(FILE *stream)
printf("#define %s 1\n", varname);
}
/* Or to '2' if it has the special value "m" */
else if (strcmp(varval, "m") == 0)
{
printf("#define %s 2\n", varname);
}
/* Otherwise, use the value as provided */
else
+4
View File
@@ -98,6 +98,10 @@ int main(int argc, char **argv, char **envp)
printf("/* config.h -- Autogenerated! Do not edit. */\n\n");
printf("#ifndef __INCLUDE_NUTTX_CONFIG_H\n");
printf("#define __INCLUDE_NUTTX_CONFIG_H\n\n");
printf("/* General Definitions ***********************************/\n");
printf("/* Used to represent the values of tristate options */\n\n");
printf("#define CONFIG_y 1\n");
printf("#define CONFIG_m 2\n\n");
printf("/* Architecture-specific options *************************/\n\n");
generate_definitions(stream);