test "${exec_prefix}" != NONE &&
exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`]
-SUBDIR_MAKEFILES="lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile"
+dnl Obviously there is duplication here wrt $SUBDIR_MAKEFILES.
+dnl You _can_ use that variable here, so long as any directory using
+dnl automake (ie lib/) is explicitly listed and not "hidden" in a variable
+dnl (else you get "no `Makefile.am' found for any configure output").
+dnl This will work, but you get a config.status that is not quite right
+dnl (see http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00028.html).
+dnl That doesn't have any obvious consequences for Emacs, but on the whole
+dnl it seems better to just live with the duplication.
+SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile"
+
+AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \
+ doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
+ doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile \
+ leim/Makefile])
dnl test/ is not present in release tarfiles.
opt_makefile=test/automated/Makefile
-test -f $srcdir/${opt_makefile}.in && \
+if test -f $srcdir/${opt_makefile}.in; then
SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile"
+ dnl Again, it's best not to use a variable. Though you can add
+ dnl ", [], [opt_makefile='$opt_makefile']" and it should work.
+ AC_CONFIG_FILES([test/automated/Makefile])
+fi
-SUBDIR_MAKEFILES_IN=`echo " lib/Makefile ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'`
+SUBDIR_MAKEFILES_IN=`echo " ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'`
AC_SUBST(SUBDIR_MAKEFILES_IN)
-dnl Any directory using automake (ie lib/) has to be explicitly listed,
-dnl else automake fails with "no `Makefile.am' found for any configure output".
-AC_CONFIG_FILES([Makefile lib/Makefile ${SUBDIR_MAKEFILES}])
dnl Make the necessary directories, if they don't exist.
AC_CONFIG_COMMANDS([mkdirs], [