When I run configure, I get errors about subs-1.sed line 38: Unterminated 's' command. What's wrong?

You probably have old copies of /usr/local/bin/apr-config and /usr/local/bin/apu-config on your system. Remove them, make sure the apr/ and apr-util/ that you're building with are completely up-to-date, and try again.