One could imagine a version control system incorporated in the code at
an absolute address to accomplish this ? Then a script or other code could
read that area for version/config info.
I'm not sure if we are talking about the same. I want to know if a component can detect the presence of another component.
Simple check for the presence of the components API #define (look into their api.h):
okay, simple solution, but in this case you've to know the name of the component.
I might be confused here but the #if defined is a Linker command so
the module start command gets incorporated into the code, started,
but no other module is "aware" of it other than its impact (having been
started, like a clock) HW wise on another module.
I still think that product to product variations have to be taken care of with
a descriptor table of some sort, known part to part, or an incredibly complex
binary code parser that pulls apart the code base seeking out module
"footprints" from a rule based on how they were created.