Use `build.with? 'static'` and put the if after the `--enable-static` below.