Possible to regenerate headers outside of srcdir

A patch I tried to send to old mailing list last year, don't think it made it there by some reason. Anyway, new attempt to get my minor build patch reviewed.

BR, 
Robert