Actually, making it a compile-time (and ONLY compile-time!) option isn't too hard... it's extracting all the tendrils of the code that's the tricky part. If you can get two identical code bases, one with overland, and one without, you can just have diff generate the #ifdef version for you.
test.c
#include <stdio.h>
int main()
{
printf("Hello %s!\n", "one"
;
printf("Hello %s!\n", "two"
;
}
test2.c
#include <stdio.h>
int main()
{
printf("Hello %s!\n", "one"
;
printf("Hello %s!\n", "uhhmmmm"
;
printf("Hello %s!\n", "three!"
;
}
diff -barP -D EXTRA test.c test2.c >test_both.c
#include <stdio.h>
int main()
{
printf("Hello %s!\n", "one"
;
#ifndef EXTRA
printf("Hello %s!\n", "two"
;
#else /* EXTRA */
printf("Hello %s!\n", "uhhmmmm"
;
printf("Hello %s!\n", "three!"
;
#endif /* EXTRA */
}
So, the code on the right-hand side gets included if EXTRA is defined, else the left-hand code wins.
AFAIK, you'd have to generate the diffs using a loop, since I don't think it will do recursive in this mode.
If you have things checked into CVS, you can have cvs generate a diff between versions/branches as well.