mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 13:13:08 +08:00
tools/mkconfig.c: Add definitions to distinguish between tristate 'y' and 'm' options.
This commit is contained in:
+9
-2
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user