Out-of-directory build patch by (Philipp Matthias Hahn <pmhahn titan.lahn de>)