Fix BUILD_SERIAL.
[people/lynusvaz/gpxe.git] / src / core / config.c
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License as
4  * published by the Free Software Foundation; either version 2, or (at
5  * your option) any later version.
6  */
7
8 #include "etherboot.h"
9 #include "dev.h"
10 #include "console.h"
11
12 #include "config/general.h"
13
14 /*
15  * Build ID string calculations
16  *
17  */
18 #undef XSTR
19 #undef STR
20 #define XSTR(s) STR(s)
21 #define STR(s) #s
22
23 #ifdef BUILD_SERIAL
24 #include "config/.buildserial.h"
25 #define BUILD_SERIAL_STR "#" XSTR(BUILD_SERIAL_NUM)
26 #else
27 #define BUILD_SERIAL_STR ""
28 #endif
29
30 #ifdef BUILD_ID
31 #define BUILD_ID_STR BUILD_ID
32 #else
33 #define BUILD_ID_STR ""
34 #endif
35
36 #if defined(BUILD_ID) && defined(BUILD_SERIAL)
37 #define BUILD_SPACER " "
38 #else
39 #define BUILD_SPACER ""
40 #endif
41
42 #if defined(BUILD_ID) || defined(BUILD_SERIAL)
43 #define BUILD_STRING " [build " BUILD_ID_STR BUILD_SPACER BUILD_SERIAL_STR "]"
44 #else
45 #define BUILD_STRING ""
46 #endif
47
48 /*
49  * Print out configuration
50  *
51  */
52 void print_config ( void ) {
53         printf( "Etherboot " VERSION BUILD_STRING
54                 " (GPL) http://etherboot.org\n"
55                 "Drivers: " );
56         print_drivers();
57         printf( "  Images: " 
58 #ifdef  TAGGED_IMAGE
59                 "NBI "
60 #endif
61 #ifdef  ELF64_IMAGE
62                 "ELF64 "
63 #endif
64 #ifdef  ELF_IMAGE
65                 "ELF "
66 #endif
67 #ifdef  COFF_IMAGE
68                 "COFF "
69 #endif
70 #ifdef  IMAGE_FREEBSD
71                 "FreeBSD "
72 #endif
73 #ifdef  IMAGE_MULTIBOOT
74                 "Multiboot "
75 #endif
76 #ifdef  AOUT_IMAGE
77                 "a.out "
78 #endif
79 #ifdef  WINCE_IMAGE
80                 "WINCE "
81 #endif
82 #ifdef  PXE_IMAGE
83                 "PXE "
84 #endif
85 #ifdef PXE_EXPORT /* All possible exports */
86                 "  Exports: "
87 #ifdef PXE_EXPORT
88                 "PXE "
89 #endif
90 #endif /* All possible exports */
91                 "  "
92                 );
93 #if     (BOOTP_SERVER != 67) || (BOOTP_CLIENT != 68)
94         printf( "[DHCP ports %d and %d] ",
95                 BOOTP_SERVER, BOOTP_CLIENT);
96 #endif
97         putchar('\n');
98         printf( "Protocols: "
99 #ifdef RARP_NOT_BOOTP
100                 "RARP "
101 #else
102 # ifndef NO_DHCP_SUPPORT
103                 "DHCP "
104 # else
105                 "BOOTP "
106 # endif
107 #endif
108 #ifdef DOWNLOAD_PROTO_TFTP
109                 "TFTP "
110 #endif
111 #ifdef  DOWNLOAD_PROTO_NFS
112                 "NFS "
113 #endif
114 #ifdef  DOWNLOAD_PROTO_SLAM
115                 "SLAM "
116 #endif
117 #ifdef  DOWNLOAD_PROTO_TFTM
118                 "TFTM "
119 #endif
120 #ifdef  DOWNLOAD_PROTO_HTTP
121                 "HTTP "
122 #endif
123 #ifdef  PROTO_LACP
124                 "LACP "
125 #endif
126 #ifdef DNS_RESOLVER
127                 "DNS "
128 #endif
129                 "\n");
130 #ifdef KEEP_IT_REAL
131         printf( "Keeping It Real [EXPERIMENTAL]\n" );
132 #endif
133 }
134
135 /*
136  * Drag in all requested console types
137  *
138  * CONSOLE_DUAL sets both CONSOLE_FIRMWARE and CONSOLE_SERIAL for
139  * legacy compatibility.
140  *
141  */
142
143 #ifdef  CONSOLE_DUAL
144 #undef  CONSOLE_FIRMWARE
145 #define CONSOLE_FIRMWARE        1
146 #undef  CONSOLE_SERIAL
147 #define CONSOLE_SERIAL          1
148 #endif
149
150 #ifdef CONSOLE_FIRMWARE
151 REQUIRE_OBJECT ( bios_console );
152 #endif
153
154 #ifdef CONSOLE_SERIAL
155 REQUIRE_OBJECT ( serial );
156 #endif
157
158 #ifdef CONSOLE_DIRECT_VGA
159 REQUIRE_OBJECT ( video_subr );
160 #endif
161
162 #ifdef CONSOLE_BTEXT
163 REQUIRE_OBJECT ( btext );
164 #endif
165
166 #ifdef CONSOLE_PC_KBD
167 REQUIRE_OBJECT ( pc_kbd );
168 #endif
169
170 /*
171  * Drag in relocate.o if required
172  *
173  */
174
175 #ifdef RELOCATE
176 REQUIRE_OBJECT ( relocate );
177 #endif