diff --git a/autogen.sh b/autogen.sh index 8c2d7fa2..751b4f55 100755 --- a/autogen.sh +++ b/autogen.sh @@ -14,12 +14,33 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +cd `dirname "$0"` + if [ "$LIBTOOLIZE" = "" ] && [ "`uname`" = "Darwin" ]; then LIBTOOLIZE=glibtoolize fi +ACLOCAL=${ACLOCAL:-aclocal} +AUTOCONF=${AUTOCONF:-autoconf} +AUTOMAKE=${AUTOMAKE:-automake} +LIBTOOLIZE=${LIBTOOLIZE:-libtoolize} + +automake_version=`"$AUTOMAKE" --version | head -n 1 | sed 's/[^.0-9]//g'` +automake_version_major=`echo "$automake_version" | cut -d. -f1` +automake_version_minor=`echo "$automake_version" | cut -d. -f2` + +UV_EXTRA_AUTOMAKE_FLAGS= +if test "$automake_version_major" -gt 1 || \ + test "$automake_version_major" -eq 1 && \ + test "$automake_version_minor" -gt 11; then + # serial-tests is available in v0.12 and newer. + UV_EXTRA_AUTOMAKE_FLAGS="$UV_EXTRA_AUTOMAKE_FLAGS serial-tests" +fi +echo "m4_define([UV_EXTRA_AUTOMAKE_FLAGS], [$UV_EXTRA_AUTOMAKE_FLAGS])" \ + > m4/libuv-extra-automake-flags.m4 + set -ex -${LIBTOOLIZE:-libtoolize} -${ACLOCAL:-aclocal -I m4} -${AUTOCONF:-autoconf} -${AUTOMAKE:-automake} --add-missing +"$LIBTOOLIZE" +"$ACLOCAL" -I m4 +"$AUTOCONF" +"$AUTOMAKE" --add-missing --copy diff --git a/configure.ac b/configure.ac index 6ec673e5..d9760a32 100644 --- a/configure.ac +++ b/configure.ac @@ -14,12 +14,9 @@ AC_PREREQ(2.57) AC_INIT([libuv], [0.11.5], [https://github.com/joyent/libuv/issues]) -# Use AM_PROG_AR as an ad-hoc version check to find out if it's safe -# to use the serial-tests directive. Both were added in automake v0.12. -AM_INIT_AUTOMAKE(m4_ifdef([AM_PROG_AR], - [-Wall -Werror foreign subdir-objects serial-tests], - [-Wall -Werror foreign subdir-objects])) AC_CONFIG_MACRO_DIR([m4]) +m4_include([m4/libuv-extra-automake-flags.m4]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects] UV_EXTRA_AUTOMAKE_FLAGS) AC_CANONICAL_HOST AC_ENABLE_SHARED AC_ENABLE_STATIC