Hello everyone,
I'm an electronics & microcontroller newbie but do have a decent coding background. Something that I am used to doing, is using defines for configuration values that only need to be set at compile-time. Imagine, for simplicity, that I have a "LED" class and I want to be able to override the default LED_PIN on a per-sketch basis -- you can imagine something like this in the relevant .h file:
#ifndef LED_PIN
#define LED_PIN 13
#endif
...and wanting to compile that with a -DLED_PIN=7 for situations that require it.
I don't like to reserve variables for a thing that does not change and is really only used once. (I'm old school and prefer small memory footprints.)
I searched through the Arduino IDE (v0022) code, but there seems to be no facility to actually pass some CFLAGS down to the command that compiles the library .cpp file.
Simplest solution seemed to hack Sketch.java to include a getCompilerFlags() routine and Compiler.java to call it, so it'll search for a "cflags.txt" file in the sketch's folder, read that file's contents, and pass that as-is appended to the compile commands. (A hacky 5m job -- but it works like a charm.)
Now, having just done this; I wonder if I just re-invented the wheel [I am known to do that].
Perhaps there are existing enhancements or patches available that already accomplish the same, in a more elegant manner?
Also, I am "happily unaware" of any unexpected consequences this change could have, although it does seem that every time a sketch compiles, the libraries are also re-compiled, so it seems safe. Or is there perhaps something that I really should know?

Thanks for your time!