Work around build failure due to automake 1.14 bug.

Automake generates invalid Makefiles when patsubst is used in
Makefile.am. To work around this problem configure injects the
patsubsts to the Makefile now.

https://bugs.debian.org/713353
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=14561
--- configure.ac.orig	2010-10-01 07:42:37.000000000 -0500
+++ configure.ac	2018-08-11 08:21:27.000000000 -0500
@@ -127,6 +127,7 @@
 AC_SUBST(BUILD_ENGINES)
 AC_SUBST(BUILD_THEMES)
 AC_SUBST(BUILD_SCHEMAS)
+AC_SUBST([auto_find_tests], ['$(patsubst %,exported_%,$(BUILD_ENGINES)) torture_buildin $(patsubst %,torture_%,$(TORTURE_TEST_ENGINES))'])
 
 if test $animation = "yes"; then
 	AC_DEFINE_UNQUOTED(HAVE_ANIMATION, 1, [Defines whether to compile with animation support])
--- test/Makefile.am.orig	2010-09-19 10:18:21.000000000 -0500
+++ test/Makefile.am	2018-08-11 08:21:27.000000000 -0500
@@ -64,9 +64,7 @@
 # Exported Symbols Test - Tests all engines unconditionally
 #############################################################
 # Prefix with exported_
-EXPORTED_SYMBOLS_TESTS = $(patsubst %,exported_%,$(BUILD_ENGINES))
 
-TESTS += $(EXPORTED_SYMBOLS_TESTS)
 
 
 #############################################################
@@ -85,10 +83,9 @@
 # Filter engines that are not build from the set of engines
 TORTURE_TEST_ENGINES = $(filter $(SUPPORTED_TORTURE_TEST_ENGINES),$(BUILD_ENGINES))
 # Prefix with torture_
-TORTURE_TEST_TESTS = torture_buildin $(patsubst %,torture_%,$(TORTURE_TEST_ENGINES))
 
 # Add TORTURE_TEST_ENGINES to list of tests
-TESTS += $(TORTURE_TEST_TESTS)
+TESTS += @auto_find_tests@
 
 # Possible other tests:
 #  - An extensive theme switch tests that loads/unloads the engine
