diff options
author | Michael Brown | 2005-04-18 14:43:18 +0200 |
---|---|---|
committer | Michael Brown | 2005-04-18 14:43:18 +0200 |
commit | cf79681b80f2fe4c1d70f02f3ee1bf07a902698f (patch) | |
tree | 9b9016729db119e4261490f175715de405bb24a3 /src/core/config.c | |
parent | Move RELOCATE into config.h (diff) | |
download | ipxe-cf79681b80f2fe4c1d70f02f3ee1bf07a902698f.tar.gz ipxe-cf79681b80f2fe4c1d70f02f3ee1bf07a902698f.tar.xz ipxe-cf79681b80f2fe4c1d70f02f3ee1bf07a902698f.zip |
Fix BUILD_SERIAL.
Change from using #if to #ifdef, since #if can't cope with string
constants.
Diffstat (limited to 'src/core/config.c')
-rw-r--r-- | src/core/config.c | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/src/core/config.c b/src/core/config.c index ebf9d256..62ad62af 100644 --- a/src/core/config.c +++ b/src/core/config.c @@ -11,21 +11,46 @@ #include "config/general.h" +/* + * Build ID string calculations + * + */ +#undef XSTR +#undef STR +#define XSTR(s) STR(s) +#define STR(s) #s + #ifdef BUILD_SERIAL -#include ".buildserial.h" -#define xstr(s) str(s) -#define str(s) #s +#include "config/.buildserial.h" +#define BUILD_SERIAL_STR "#" XSTR(BUILD_SERIAL_NUM) +#else +#define BUILD_SERIAL_STR "" #endif -void print_config ( void ) { - printf( "Etherboot " VERSION -#ifdef BUILD_SERIAL - " [build " #ifdef BUILD_ID - BUILD_ID " " +#define BUILD_ID_STR BUILD_ID +#else +#define BUILD_ID_STR "" #endif - "#" xstr(BUILD_SERIAL_NUM) "]" -#endif /* BUILD_SERIAL */ + +#if defined(BUILD_ID) && defined(BUILD_SERIAL) +#define BUILD_SPACER " " +#else +#define BUILD_SPACER "" +#endif + +#if defined(BUILD_ID) || defined(BUILD_SERIAL) +#define BUILD_STRING " [build " BUILD_ID_STR BUILD_SPACER BUILD_SERIAL_STR "]" +#else +#define BUILD_STRING "" +#endif + +/* + * Print out configuration + * + */ +void print_config ( void ) { + printf( "Etherboot " VERSION BUILD_STRING " (GPL) http://etherboot.org\n" "Drivers: " ); print_drivers(); @@ -115,30 +140,30 @@ void print_config ( void ) { * */ -#if CONSOLE_DUAL +#ifdef CONSOLE_DUAL #undef CONSOLE_FIRMWARE #define CONSOLE_FIRMWARE 1 #undef CONSOLE_SERIAL #define CONSOLE_SERIAL 1 #endif -#if CONSOLE_FIRMWARE +#ifdef CONSOLE_FIRMWARE REQUIRE_OBJECT ( bios_console ); #endif -#if CONSOLE_SERIAL +#ifdef CONSOLE_SERIAL REQUIRE_OBJECT ( serial ); #endif -#if CONSOLE_DIRECT_VGA +#ifdef CONSOLE_DIRECT_VGA REQUIRE_OBJECT ( video_subr ); #endif -#if CONSOLE_BTEXT +#ifdef CONSOLE_BTEXT REQUIRE_OBJECT ( btext ); #endif -#if CONSOLE_PC_KBD +#ifdef CONSOLE_PC_KBD REQUIRE_OBJECT ( pc_kbd ); #endif @@ -147,6 +172,6 @@ REQUIRE_OBJECT ( pc_kbd ); * */ -#if RELOCATE +#ifdef RELOCATE REQUIRE_OBJECT ( relocate ); #endif |