summaryrefslogtreecommitdiffstats
path: root/src/include/compiler.h
diff options
context:
space:
mode:
authorJoshua Oreman2009-08-07 03:52:06 +0200
committerMarty Connor2009-11-21 02:30:58 +0100
commit9a0bd0711f9e5d0a555fa35de8eb07cb29dc83a9 (patch)
tree11c38538abb48a5b9aef36c3782e11982d41e859 /src/include/compiler.h
parent[linker] Expand and correct symbol requirement macros (diff)
downloadipxe-9a0bd0711f9e5d0a555fa35de8eb07cb29dc83a9.tar.gz
ipxe-9a0bd0711f9e5d0a555fa35de8eb07cb29dc83a9.tar.xz
ipxe-9a0bd0711f9e5d0a555fa35de8eb07cb29dc83a9.zip
[linker] Add mechanism for subsystem-dependent configuration options
It is often the case that some module of gPXE is only relevant if the subsystem it depends on is already being included. For instance, commands to manage wireless interfaces are quite useless if no compiled-in driver has pulled in the wireless networking stack. There may be a user-modifiable configuration options for these dependent modules, but even if enabled, they should not be included when they would be useless. Solve this by allowing the creation of config_subsystem.c, for configuration directives like those in the global config.c that should only be considered when subsystem.c is included in the final gPXE build. For consistency, move core/config.c to the config/ directory, where the other config_subsystem.c files will eventually reside. Signed-off-by: Marty Connor <mdc@etherboot.org>
Diffstat (limited to 'src/include/compiler.h')
-rw-r--r--src/include/compiler.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/compiler.h b/src/include/compiler.h
index 5ba7f441..f481f38a 100644
--- a/src/include/compiler.h
+++ b/src/include/compiler.h
@@ -159,10 +159,15 @@
#define PREFIX_OBJECT( _prefix ) _C2 ( _prefix, OBJECT )
#define OBJECT_SYMBOL PREFIX_OBJECT ( obj_ )
+#define REQUEST_EXPANDED( _sym ) REQUEST_SYMBOL ( _sym )
+#define CONFIG_SYMBOL PREFIX_OBJECT ( obj_config_ )
/** Always provide the symbol for the current object (defined by -DOBJECT) */
PROVIDE_SYMBOL ( OBJECT_SYMBOL );
+/** Pull in an object-specific configuration file if available */
+REQUEST_EXPANDED ( CONFIG_SYMBOL );
+
/** Explicitly require another object */
#define REQUIRE_OBJECT( _obj ) REQUIRE_SYMBOL ( obj_ ## _obj )