This is, of course, the neater and much more obvious way to do it.
[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_STRING " [build" BUILD_ID_STR BUILD_SERIAL_STR "]"
38 #else
39 #define BUILD_STRING ""
40 #endif
41
42 /*
43  * Print out configuration
44  *
45  */
46 void print_config ( void ) {
47         printf( "Etherboot " VERSION BUILD_STRING
48                 " (GPL) http://etherboot.org\n"
49                 "Drivers: " );
50         print_drivers();
51         printf( "  Images: " 
52 #ifdef  TAGGED_IMAGE
53                 "NBI "
54 #endif
55 #ifdef  ELF64_IMAGE
56                 "ELF64 "
57 #endif
58 #ifdef  ELF_IMAGE
59                 "ELF "
60 #endif
61 #ifdef  COFF_IMAGE
62                 "COFF "
63 #endif
64 #ifdef  IMAGE_FREEBSD
65                 "FreeBSD "
66 #endif
67 #ifdef  IMAGE_MULTIBOOT
68                 "Multiboot "
69 #endif
70 #ifdef  AOUT_IMAGE
71                 "a.out "
72 #endif
73 #ifdef  WINCE_IMAGE
74                 "WINCE "
75 #endif
76 #ifdef  PXE_IMAGE
77                 "PXE "
78 #endif
79 #ifdef PXE_EXPORT /* All possible exports */
80                 "  Exports: "
81 #ifdef PXE_EXPORT
82                 "PXE "
83 #endif
84 #endif /* All possible exports */
85                 "  "
86                 );
87 #if     (BOOTP_SERVER != 67) || (BOOTP_CLIENT != 68)
88         printf( "[DHCP ports %d and %d] ",
89                 BOOTP_SERVER, BOOTP_CLIENT);
90 #endif
91         putchar('\n');
92         printf( "Protocols: "
93 #ifdef RARP_NOT_BOOTP
94                 "RARP "
95 #else
96 # ifndef NO_DHCP_SUPPORT
97                 "DHCP "
98 # else
99                 "BOOTP "
100 # endif
101 #endif
102 #ifdef DOWNLOAD_PROTO_TFTP
103                 "TFTP "
104 #endif
105 #ifdef  DOWNLOAD_PROTO_NFS
106                 "NFS "
107 #endif
108 #ifdef  DOWNLOAD_PROTO_SLAM
109                 "SLAM "
110 #endif
111 #ifdef  DOWNLOAD_PROTO_TFTM
112                 "TFTM "
113 #endif
114 #ifdef  DOWNLOAD_PROTO_HTTP
115                 "HTTP "
116 #endif
117 #ifdef  PROTO_LACP
118                 "LACP "
119 #endif
120 #ifdef DNS_RESOLVER
121                 "DNS "
122 #endif
123                 "\n");
124 #ifdef KEEP_IT_REAL
125         printf( "Keeping It Real [EXPERIMENTAL]\n" );
126 #endif
127 }
128
129 /*
130  * Drag in all requested console types
131  *
132  * CONSOLE_DUAL sets both CONSOLE_FIRMWARE and CONSOLE_SERIAL for
133  * legacy compatibility.
134  *
135  */
136
137 #ifdef  CONSOLE_DUAL
138 #undef  CONSOLE_FIRMWARE
139 #define CONSOLE_FIRMWARE        1
140 #undef  CONSOLE_SERIAL
141 #define CONSOLE_SERIAL          1
142 #endif
143
144 #ifdef CONSOLE_FIRMWARE
145 REQUIRE_OBJECT ( bios_console );
146 #endif
147
148 #ifdef CONSOLE_SERIAL
149 REQUIRE_OBJECT ( serial );
150 #endif
151
152 #ifdef CONSOLE_DIRECT_VGA
153 REQUIRE_OBJECT ( video_subr );
154 #endif
155
156 #ifdef CONSOLE_BTEXT
157 REQUIRE_OBJECT ( btext );
158 #endif
159
160 #ifdef CONSOLE_PC_KBD
161 REQUIRE_OBJECT ( pc_kbd );
162 #endif
163
164 /*
165  * Drag in relocate.o if required
166  *
167  */
168
169 #ifdef RELOCATE
170 REQUIRE_OBJECT ( relocate );
171 #endif