Use the %D% feature of Autoconf 1.14. Move testsuite rules to tests/Makefile.am.
src/Makefile.am: Use %D%.

swig/Makefile.common.am: Ditto.

Makefile.in: Regenerate.