This logic should eventually be in dbuild configuration files, right? /cc @jsuereth.