build: changed order of configure environment for subpackages