tizen 2.3.1 release
[external/qemu.git] / roms / ipxe / src / config / 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 FILE_LICENCE ( GPL2_OR_LATER );
9
10 #include <config/general.h>
11 #include <config/console.h>
12 #include <config/sideband.h>
13
14 /** @file
15  *
16  * Configuration options
17  *
18  * This file contains macros that pull various objects into the link
19  * based on definitions in configuration header files. Ideally it
20  * should be the only place in iPXE where one might need to use #ifdef
21  * for compile-time options.
22  *
23  * In the fairly common case where an object should only be considered
24  * for inclusion if the subsystem it depends on is present, its
25  * configuration macros should be placed in a file named
26  * <tt>config_<i>subsystem</i>.c</tt>, where @e subsystem is the
27  * object basename of the main source file for that subsystem. The
28  * build system will pull in that file if @c subsystem.c is included
29  * in the final iPXE executable built.
30  */
31
32 /*
33  * Build ID string calculations
34  *
35  */
36 #undef XSTR
37 #undef STR
38 #define XSTR(s) STR(s)
39 #define STR(s) #s
40
41 #ifdef BUILD_SERIAL
42 #include "config/.buildserial.h"
43 #define BUILD_SERIAL_STR " #" XSTR(BUILD_SERIAL_NUM)
44 #else
45 #define BUILD_SERIAL_STR ""
46 #endif
47
48 #ifdef BUILD_ID
49 #define BUILD_ID_STR " " BUILD_ID
50 #else
51 #define BUILD_ID_STR ""
52 #endif
53
54 #if defined(BUILD_ID) || defined(BUILD_SERIAL)
55 #define BUILD_STRING " [build" BUILD_ID_STR BUILD_SERIAL_STR "]"
56 #else
57 #define BUILD_STRING ""
58 #endif
59
60 /*
61  * Drag in all requested console types
62  *
63  */
64
65 #ifdef CONSOLE_PCBIOS
66 REQUIRE_OBJECT ( bios_console );
67 #endif
68 #ifdef CONSOLE_SERIAL
69 REQUIRE_OBJECT ( serial_console );
70 #endif
71 #ifdef CONSOLE_DIRECT_VGA
72 REQUIRE_OBJECT ( video_subr );
73 #endif
74 #ifdef CONSOLE_PC_KBD
75 REQUIRE_OBJECT ( pc_kbd );
76 #endif
77 #ifdef CONSOLE_SYSLOG
78 REQUIRE_OBJECT ( syslog );
79 #endif
80 #ifdef CONSOLE_SYSLOGS
81 REQUIRE_OBJECT ( syslogs );
82 #endif
83 #ifdef CONSOLE_EFI
84 REQUIRE_OBJECT ( efi_console );
85 #endif
86 #ifdef CONSOLE_LINUX
87 REQUIRE_OBJECT ( linux_console );
88 #endif
89 #ifdef CONSOLE_VMWARE
90 REQUIRE_OBJECT ( vmconsole );
91 #endif
92 #ifdef CONSOLE_DEBUGCON
93 REQUIRE_OBJECT ( debugcon );
94 #endif
95
96 /*
97  * Drag in all requested network protocols
98  *
99  */
100 #ifdef NET_PROTO_IPV4
101 REQUIRE_OBJECT ( ipv4 );
102 #endif
103
104 /*
105  * Drag in all requested PXE support
106  *
107  */
108 #ifdef PXE_MENU
109 REQUIRE_OBJECT ( pxemenu );
110 #endif
111 #ifdef PXE_STACK
112 REQUIRE_OBJECT ( pxe_call );
113 #endif
114
115 /*
116  * Drag in all requested download protocols
117  *
118  */
119 #ifdef DOWNLOAD_PROTO_TFTP
120 REQUIRE_OBJECT ( tftp );
121 #endif
122 #ifdef DOWNLOAD_PROTO_HTTP
123 REQUIRE_OBJECT ( http );
124 #endif
125 #ifdef DOWNLOAD_PROTO_HTTPS
126 REQUIRE_OBJECT ( https );
127 #endif
128 #ifdef DOWNLOAD_PROTO_FTP
129 REQUIRE_OBJECT ( ftp );
130 #endif
131 #ifdef DOWNLOAD_PROTO_SLAM
132 REQUIRE_OBJECT ( slam );
133 #endif
134
135 /*
136  * Drag in all requested SAN boot protocols
137  *
138  */
139 #ifdef SANBOOT_PROTO_ISCSI
140 REQUIRE_OBJECT ( iscsi );
141 #endif
142
143 /*
144  * Drag in all requested resolvers
145  *
146  */
147 #ifdef DNS_RESOLVER
148 REQUIRE_OBJECT ( dns );
149 #endif
150
151 /*
152  * Drag in all requested image formats
153  *
154  */
155 #ifdef IMAGE_NBI
156 REQUIRE_OBJECT ( nbi );
157 #endif
158 #ifdef IMAGE_ELF
159 REQUIRE_OBJECT ( elfboot );
160 #endif
161 #ifdef IMAGE_MULTIBOOT
162 REQUIRE_OBJECT ( multiboot );
163 #endif
164 #ifdef IMAGE_PXE
165 REQUIRE_OBJECT ( pxe_image );
166 #endif
167 #ifdef IMAGE_SCRIPT
168 REQUIRE_OBJECT ( script );
169 #endif
170 #ifdef IMAGE_BZIMAGE
171 REQUIRE_OBJECT ( bzimage );
172 #endif
173 #ifdef IMAGE_ELTORITO
174 REQUIRE_OBJECT ( eltorito );
175 #endif
176 #ifdef IMAGE_COMBOOT
177 REQUIRE_OBJECT ( comboot );
178 REQUIRE_OBJECT ( com32 );
179 REQUIRE_OBJECT ( comboot_call );
180 REQUIRE_OBJECT ( com32_call );
181 REQUIRE_OBJECT ( com32_wrapper );
182 REQUIRE_OBJECT ( comboot_resolv );
183 #endif
184 #ifdef IMAGE_EFI
185 REQUIRE_OBJECT ( efi_image );
186 #endif
187 #ifdef IMAGE_SDI
188 REQUIRE_OBJECT ( sdi );
189 #endif
190
191 /*
192  * Drag in all requested commands
193  *
194  */
195 #ifdef AUTOBOOT_CMD
196 REQUIRE_OBJECT ( autoboot_cmd );
197 #endif
198 #ifdef NVO_CMD
199 REQUIRE_OBJECT ( nvo_cmd );
200 #endif
201 #ifdef CONFIG_CMD
202 REQUIRE_OBJECT ( config_cmd );
203 #endif
204 #ifdef IFMGMT_CMD
205 REQUIRE_OBJECT ( ifmgmt_cmd );
206 #endif
207 /* IWMGMT_CMD is brought in by net80211.c if requested */
208 #ifdef ROUTE_CMD
209 REQUIRE_OBJECT ( route_cmd );
210 #endif
211 #ifdef IMAGE_CMD
212 REQUIRE_OBJECT ( image_cmd );
213 #endif
214 #ifdef IMAGE_TRUST_CMD
215 REQUIRE_OBJECT ( image_trust_cmd );
216 #endif
217 #ifdef DHCP_CMD
218 REQUIRE_OBJECT ( dhcp_cmd );
219 #endif
220 #ifdef SANBOOT_CMD
221 REQUIRE_OBJECT ( sanboot_cmd );
222 #endif
223 #ifdef MENU_CMD
224 REQUIRE_OBJECT ( menu_cmd );
225 #endif
226 #ifdef LOGIN_CMD
227 REQUIRE_OBJECT ( login_cmd );
228 #endif
229 #ifdef TIME_CMD
230 REQUIRE_OBJECT ( time_cmd );
231 #endif
232 #ifdef DIGEST_CMD
233 REQUIRE_OBJECT ( digest_cmd );
234 #endif
235 #ifdef PXE_CMD
236 REQUIRE_OBJECT ( pxe_cmd );
237 #endif
238 #ifdef LOTEST_CMD
239 REQUIRE_OBJECT ( lotest_cmd );
240 #endif
241 #ifdef VLAN_CMD
242 REQUIRE_OBJECT ( vlan_cmd );
243 #endif
244 #ifdef REBOOT_CMD
245 REQUIRE_OBJECT ( reboot_cmd );
246 #endif
247 #ifdef CPUID_CMD
248 REQUIRE_OBJECT ( cpuid_cmd );
249 #endif
250 #ifdef SYNC_CMD
251 REQUIRE_OBJECT ( sync_cmd );
252 #endif
253 #ifdef NSLOOKUP_CMD
254 REQUIRE_OBJECT ( nslookup_cmd );
255 #endif
256
257 /*
258  * Drag in miscellaneous objects
259  *
260  */
261 #ifdef NULL_TRAP
262 REQUIRE_OBJECT ( nulltrap );
263 #endif
264 #ifdef GDBSERIAL
265 REQUIRE_OBJECT ( gdbidt );
266 REQUIRE_OBJECT ( gdbserial );
267 REQUIRE_OBJECT ( gdbstub_cmd );
268 #endif
269 #ifdef GDBUDP
270 REQUIRE_OBJECT ( gdbidt );
271 REQUIRE_OBJECT ( gdbudp );
272 REQUIRE_OBJECT ( gdbstub_cmd );
273 #endif
274
275 /*
276  * Drag in objects that are always required, but not dragged in via
277  * symbol dependencies.
278  *
279  */
280 REQUIRE_OBJECT ( device );
281 REQUIRE_OBJECT ( embedded );
282
283 /* linux drivers aren't picked up by the parserom utility so drag them in here */
284 #ifdef DRIVERS_LINUX
285 REQUIRE_OBJECT ( tap );
286 #endif
287
288 /*
289  * Drag in relevant sideband entry points
290  */
291 #ifdef CONFIG_BOFM
292 #ifdef BOFM_EFI
293 REQUIRE_OBJECT ( efi_bofm );
294 #endif /* BOFM_EFI */
295 #endif /* CONFIG_BOFM */
296 #ifdef VMWARE_SETTINGS
297 REQUIRE_OBJECT ( guestinfo );
298 #endif /* VMWARE_SETTINGS */
299
300 /*
301  * Drag in selected keyboard map
302  */
303 #define REQUIRE_KEYMAP_OBJECT( _map ) REQUIRE_OBJECT ( keymap_ ## _map )
304 #define REQUIRE_KEYMAP( _map ) REQUIRE_KEYMAP_OBJECT ( _map )
305 REQUIRE_KEYMAP ( KEYBOARD_MAP );