Michael Ellerman | 77bd111 | 2011-12-19 17:19:30 +1100 | [diff] [blame] | 1 | |
| 2 | #if defined(QEMU_OPTIONS_GENERATE_ENUM) |
| 3 | |
| 4 | #define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ |
| 5 | opt_enum, |
| 6 | #define DEFHEADING(text) |
Michael Ellerman | a3adb7a | 2011-12-19 17:19:31 +1100 | [diff] [blame] | 7 | #define ARCHHEADING(text, arch_mask) |
Michael Ellerman | 77bd111 | 2011-12-19 17:19:30 +1100 | [diff] [blame] | 8 | |
| 9 | #elif defined(QEMU_OPTIONS_GENERATE_HELP) |
| 10 | |
Michael Ellerman | a3adb7a | 2011-12-19 17:19:31 +1100 | [diff] [blame] | 11 | #define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ |
| 12 | if ((arch_mask) & arch_type) \ |
| 13 | fputs(opt_help, stdout); |
| 14 | |
| 15 | #define ARCHHEADING(text, arch_mask) \ |
| 16 | if ((arch_mask) & arch_type) \ |
| 17 | puts(stringify(text)); |
| 18 | |
| 19 | #define DEFHEADING(text) ARCHHEADING(text, QEMU_ARCH_ALL) |
Michael Ellerman | 77bd111 | 2011-12-19 17:19:30 +1100 | [diff] [blame] | 20 | |
| 21 | #elif defined(QEMU_OPTIONS_GENERATE_OPTIONS) |
| 22 | |
| 23 | #define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ |
| 24 | { option, opt_arg, opt_enum, arch_mask }, |
| 25 | #define DEFHEADING(text) |
Michael Ellerman | a3adb7a | 2011-12-19 17:19:31 +1100 | [diff] [blame] | 26 | #define ARCHHEADING(text, arch_mask) |
Michael Ellerman | 77bd111 | 2011-12-19 17:19:30 +1100 | [diff] [blame] | 27 | |
| 28 | #else |
| 29 | #error "qemu-options-wrapper.h included with no option defined" |
| 30 | #endif |
| 31 | |
| 32 | #include "qemu-options.def" |
| 33 | |
| 34 | #undef DEF |
| 35 | #undef DEFHEADING |
Michael Ellerman | a3adb7a | 2011-12-19 17:19:31 +1100 | [diff] [blame] | 36 | #undef ARCHHEADING |
Michael Ellerman | 77bd111 | 2011-12-19 17:19:30 +1100 | [diff] [blame] | 37 | #undef GEN_DOCS |
| 38 | |
| 39 | #undef QEMU_OPTIONS_GENERATE_ENUM |
| 40 | #undef QEMU_OPTIONS_GENERATE_HELP |
| 41 | #undef QEMU_OPTIONS_GENERATE_OPTIONS |