This begs the obvious question: when another utility (in this case Teensy) has a need to modify standard libraries like Wire.h, what is the accepted protocol? I would imagine a comment at every change, or at least in the header? Or?? As more Arduino variations are introduced how is this to be dealt with as sanely as possible?
Hi Bruce. I must confess, the Teensyduino installer makes a tremendous number of changes. I probably should add more comments where things are altered. I actually put a lot of effort into making sure the changes don't alter the way the IDE handles every official Arduino board. But comments inside libraries are a much lower priority.
On 1.0.X, there's really no sane way to patch the libraries. The only reason this hasn't become a terrible nightmare is because most other 3rd party boards that require substantial changes, like Maple and Chipkit, tend to fork the entire IDE rather than distributing a package to install into the original. When I started Teensy over 4 years ago, I didn't like the idea of forking (it seems like not collaborating to me), so I created that installer. Forking would have been much easier.
The Arduino Team has been working on these issues for the new 1.5.X version. Some of the original 1.5.X "platform" code was contributed by Rick Anderson and/or Mark Sproul, actually a couple years ago as I recall. Christian (of the Arduino Team) has been working quite a bit recently on even more improvements, to allow 3rd party boards to work better.
https://github.com/arduino/Arduino/pull/1263I must also confess, so far I have not used the 1.5.X version much. I've studied the code only briefly, so everything I say here may not be fully accurate. 1.5.X is also still a work-in-progress, and to be honest as long as users aren't demanding I support 1.5.x, I'm waiting for it to settle a bit (see the comments in that discussion) before I add Teensy support for it.
However, I do know 1.5.X has provisions for 3rd party boards (or "packages" and "platforms") to provide their own copies of modified libraries. It also has a platform.txt file which allows 3rd party boards to customize the build process. Third party boards can also install their own compiler toolchain. It's designed, at least in theory, to allow a 3rd party board to customize almost everything.
So really, the new 1.5.X version's "platform" features are the answer to your question. Later this year, I imagine 1.5.X will replace 1.0.X as the main version of Arduino everyone uses. I absolutely do intend to support it, using to the fullest extent possible whatever 3rd party installation methods Christian and the rest of the Arduino Team define.