backport changes in configure