## The Emacs bzr repository does not include the configure script
## (and associated helpers). The first time you fetch Emacs from bzr,
## run this script to generate the necessary files.
## The Emacs bzr repository does not include the configure script
## (and associated helpers). The first time you fetch Emacs from bzr,
## run this script to generate the necessary files.
-## FIXME how to determine this from the sources?
-automake_min=1.11
+## This will need improving if more options are ever added to the
+## AM_INIT_AUTOMAKE call.
+automake_min=`sed -n 's/^ *AM_INIT_AUTOMAKE(\([0-9\.]*\)).*/\1/p' configure.ac`
## Return 1 if program is missing.
## Return 2 if program is present but too old.
## Return 3 for unexpected error (eg failed to parse version).
## Return 1 if program is missing.
## Return 2 if program is present but too old.
## Return 3 for unexpected error (eg failed to parse version).
## Let autoreconf figure out what, if anything, needs doing.
autoreconf -i -I m4 || exit $?
## Let autoreconf figure out what, if anything, needs doing.
autoreconf -i -I m4 || exit $?