build script: resubmit rewrite, adding new options