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 
13 /** @file
14  *
15  * Configuration options
16  *
17  * This file contains macros that pull various objects into the link
18  * based on definitions in configuration header files. Ideally it
19  * should be the only place in gPXE where one might need to use #ifdef
20  * for compile-time options.
21  *
22  * In the fairly common case where an object should only be considered
23  * for inclusion if the subsystem it depends on is present, its
24  * configuration macros should be placed in a file named
25  * <tt>config_<i>subsystem</i>.c</tt>, where @e subsystem is the
26  * object basename of the main source file for that subsystem. The
27  * build system will pull in that file if @c subsystem.c is included
28  * in the final gPXE executable built.
29  */
30 
31 /*
32  * Build ID string calculations
33  *
34  */
35 #undef XSTR
36 #undef STR
37 #define XSTR(s) STR(s)
38 #define STR(s) #s
39 
40 #ifdef BUILD_SERIAL
41 #include "config/.buildserial.h"
42 #define BUILD_SERIAL_STR " #" XSTR(BUILD_SERIAL_NUM)
43 #else
44 #define BUILD_SERIAL_STR ""
45 #endif
46 
47 #ifdef BUILD_ID
48 #define BUILD_ID_STR " " BUILD_ID
49 #else
50 #define BUILD_ID_STR ""
51 #endif
52 
53 #if defined(BUILD_ID) || defined(BUILD_SERIAL)
54 #define BUILD_STRING " [build" BUILD_ID_STR BUILD_SERIAL_STR "]"
55 #else
56 #define BUILD_STRING ""
57 #endif
58 
59 /*
60  * Drag in all requested console types
61  *
62  */
63 
64 #ifdef CONSOLE_PCBIOS
65 REQUIRE_OBJECT ( bios_console );
66 #endif
67 #ifdef CONSOLE_SERIAL
68 REQUIRE_OBJECT ( serial_console );
69 #endif
70 #ifdef CONSOLE_DIRECT_VGA
71 REQUIRE_OBJECT ( video_subr );
72 #endif
73 #ifdef CONSOLE_BTEXT
74 REQUIRE_OBJECT ( btext );
75 #endif
76 #ifdef CONSOLE_PC_KBD
77 REQUIRE_OBJECT ( pc_kbd );
78 #endif
79 #ifdef CONSOLE_SYSLOG
80 REQUIRE_OBJECT ( syslog );
81 #endif
82 #ifdef CONSOLE_EFI
83 REQUIRE_OBJECT ( efi_console );
84 #endif
85 
86 /*
87  * Drag in all requested network protocols
88  *
89  */
90 #ifdef NET_PROTO_IPV4
91 REQUIRE_OBJECT ( ipv4 );
92 #endif
93 
94 /*
95  * Drag in all requested PXE support
96  *
97  */
98 #ifdef PXE_MENU
99 REQUIRE_OBJECT ( pxemenu );
100 #endif
101 #ifdef PXE_STACK
102 REQUIRE_OBJECT ( pxe_call );
103 #endif
104 
105 /*
106  * Drag in all requested download protocols
107  *
108  */
109 #ifdef DOWNLOAD_PROTO_TFTP
110 REQUIRE_OBJECT ( tftp );
111 #endif
112 #ifdef DOWNLOAD_PROTO_HTTP
113 REQUIRE_OBJECT ( http );
114 #endif
115 #ifdef DOWNLOAD_PROTO_HTTPS
116 REQUIRE_OBJECT ( https );
117 #endif
118 #ifdef DOWNLOAD_PROTO_FTP
119 REQUIRE_OBJECT ( ftp );
120 #endif
121 #ifdef DOWNLOAD_PROTO_TFTM
122 REQUIRE_OBJECT ( tftm );
123 #endif
124 #ifdef DOWNLOAD_PROTO_SLAM
125 REQUIRE_OBJECT ( slam );
126 #endif
127 
128 /*
129  * Drag in all requested SAN boot protocols
130  *
131  */
132 #ifdef SANBOOT_PROTO_ISCSI
133 REQUIRE_OBJECT ( iscsiboot );
134 #endif
135 #ifdef SANBOOT_PROTO_AOE
136 REQUIRE_OBJECT ( aoeboot );
137 #endif
138 #ifdef SANBOOT_PROTO_IB_SRP
139 REQUIRE_OBJECT ( ib_srpboot );
140 #endif
141 
142 /*
143  * Drag in all requested resolvers
144  *
145  */
146 #ifdef DNS_RESOLVER
147 REQUIRE_OBJECT ( dns );
148 #endif
149 
150 /*
151  * Drag in all requested image formats
152  *
153  */
154 #ifdef IMAGE_NBI
155 REQUIRE_OBJECT ( nbi );
156 #endif
157 #ifdef IMAGE_ELF
158 REQUIRE_OBJECT ( elfboot );
159 #endif
160 #ifdef IMAGE_FREEBSD
161 REQUIRE_OBJECT ( freebsd );
162 #endif
163 #ifdef IMAGE_MULTIBOOT
164 REQUIRE_OBJECT ( multiboot );
165 #endif
166 #ifdef IMAGE_AOUT
167 REQUIRE_OBJECT ( aout );
168 #endif
169 #ifdef IMAGE_WINCE
170 REQUIRE_OBJECT ( wince );
171 #endif
172 #ifdef IMAGE_PXE
173 REQUIRE_OBJECT ( pxe_image );
174 #endif
175 #ifdef IMAGE_SCRIPT
176 REQUIRE_OBJECT ( script );
177 #endif
178 #ifdef IMAGE_BZIMAGE
179 REQUIRE_OBJECT ( bzimage );
180 #endif
181 #ifdef IMAGE_ELTORITO
182 REQUIRE_OBJECT ( eltorito );
183 #endif
184 #ifdef IMAGE_COMBOOT
185 REQUIRE_OBJECT ( comboot );
186 REQUIRE_OBJECT ( com32 );
187 REQUIRE_OBJECT ( comboot_call );
188 REQUIRE_OBJECT ( com32_call );
189 REQUIRE_OBJECT ( com32_wrapper );
190 REQUIRE_OBJECT ( comboot_resolv );
191 #endif
192 #ifdef IMAGE_EFI
193 REQUIRE_OBJECT ( efi_image );
194 #endif
195 
196 /*
197  * Drag in all requested commands
198  *
199  */
200 #ifdef AUTOBOOT_CMD
201 REQUIRE_OBJECT ( autoboot_cmd );
202 #endif
203 #ifdef NVO_CMD
204 REQUIRE_OBJECT ( nvo_cmd );
205 #endif
206 #ifdef CONFIG_CMD
207 REQUIRE_OBJECT ( config_cmd );
208 #endif
209 #ifdef IFMGMT_CMD
210 REQUIRE_OBJECT ( ifmgmt_cmd );
211 #endif
212 /* IWMGMT_CMD is brought in by net80211.c if requested */
213 #ifdef ROUTE_CMD
214 REQUIRE_OBJECT ( route_cmd );
215 #endif
216 #ifdef IMAGE_CMD
217 REQUIRE_OBJECT ( image_cmd );
218 #endif
219 #ifdef DHCP_CMD
220 REQUIRE_OBJECT ( dhcp_cmd );
221 #endif
222 #ifdef SANBOOT_CMD
223 REQUIRE_OBJECT ( sanboot_cmd );
224 #endif
225 #ifdef LOGIN_CMD
226 REQUIRE_OBJECT ( login_cmd );
227 #endif
228 #ifdef TIME_CMD
229 REQUIRE_OBJECT ( time_cmd );
230 #endif
231 #ifdef DIGEST_CMD
232 REQUIRE_OBJECT ( digest_cmd );
233 #endif
234 #ifdef PXE_CMD
235 REQUIRE_OBJECT ( pxe_cmd );
236 #endif
237 
238 /*
239  * Drag in miscellaneous objects
240  *
241  */
242 #ifdef NULL_TRAP
243 REQUIRE_OBJECT ( nulltrap );
244 #endif
245 #ifdef GDBSERIAL
246 REQUIRE_OBJECT ( gdbidt );
247 REQUIRE_OBJECT ( gdbserial );
248 REQUIRE_OBJECT ( gdbstub_cmd );
249 #endif
250 #ifdef GDBUDP
251 REQUIRE_OBJECT ( gdbidt );
252 REQUIRE_OBJECT ( gdbudp );
253 REQUIRE_OBJECT ( gdbstub_cmd );
254 #endif
255 
256 /*
257  * Drag in objects that are always required, but not dragged in via
258  * symbol dependencies.
259  *
260  */
261 REQUIRE_OBJECT ( device );
262 REQUIRE_OBJECT ( embedded );
263