Please have a look at the gcj-4.1 source package, how java is now built. The same thing could be done with D.