1 1.1 christos #!/bin/sh 2 1.1 christos 3 1.1 christos # Copyright (c) 2013, Ben Noordhuis <info (at] bnoordhuis.nl> 4 1.1 christos # 5 1.1 christos # Permission to use, copy, modify, and/or distribute this software for any 6 1.1 christos # purpose with or without fee is hereby granted, provided that the above 7 1.1 christos # copyright notice and this permission notice appear in all copies. 8 1.1 christos # 9 1.1 christos # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 1.1 christos # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 1.1 christos # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 1.1 christos # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 1.1 christos # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 1.1 christos # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 1.1 christos # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 1.1 christos 17 1.1.1.2 christos set -eu 18 1.1 christos cd `dirname "$0"` 19 1.1 christos 20 1.1.1.2 christos if [ "${1:-dev}" == "release" ]; then 21 1.1.1.2 christos export LIBUV_RELEASE=true 22 1.1.1.2 christos else 23 1.1.1.2 christos export LIBUV_RELEASE=false 24 1.1.1.2 christos fi 25 1.1.1.2 christos 26 1.1.1.2 christos if [ "${LIBTOOLIZE:-}" = "" ] && [ "`uname`" = "Darwin" ]; then 27 1.1 christos LIBTOOLIZE=glibtoolize 28 1.1 christos fi 29 1.1 christos 30 1.1 christos ACLOCAL=${ACLOCAL:-aclocal} 31 1.1 christos AUTOCONF=${AUTOCONF:-autoconf} 32 1.1 christos AUTOMAKE=${AUTOMAKE:-automake} 33 1.1 christos LIBTOOLIZE=${LIBTOOLIZE:-libtoolize} 34 1.1 christos 35 1.1.1.2 christos aclocal_version=`"$ACLOCAL" --version | head -n 1 | sed 's/[^.0-9]//g'` 36 1.1.1.2 christos autoconf_version=`"$AUTOCONF" --version | head -n 1 | sed 's/[^.0-9]//g'` 37 1.1 christos automake_version=`"$AUTOMAKE" --version | head -n 1 | sed 's/[^.0-9]//g'` 38 1.1 christos automake_version_major=`echo "$automake_version" | cut -d. -f1` 39 1.1 christos automake_version_minor=`echo "$automake_version" | cut -d. -f2` 40 1.1.1.2 christos libtoolize_version=`"$LIBTOOLIZE" --version | head -n 1 | sed 's/[^.0-9]//g'` 41 1.1.1.2 christos 42 1.1.1.2 christos if [ $aclocal_version != $automake_version ]; then 43 1.1.1.2 christos echo "FATAL: aclocal version appears not to be from the same as automake" 44 1.1.1.2 christos exit 1 45 1.1.1.2 christos fi 46 1.1 christos 47 1.1 christos UV_EXTRA_AUTOMAKE_FLAGS= 48 1.1 christos if test "$automake_version_major" -gt 1 || \ 49 1.1 christos test "$automake_version_major" -eq 1 && \ 50 1.1 christos test "$automake_version_minor" -gt 11; then 51 1.1 christos # serial-tests is available in v1.12 and newer. 52 1.1 christos UV_EXTRA_AUTOMAKE_FLAGS="$UV_EXTRA_AUTOMAKE_FLAGS serial-tests" 53 1.1 christos fi 54 1.1 christos echo "m4_define([UV_EXTRA_AUTOMAKE_FLAGS], [$UV_EXTRA_AUTOMAKE_FLAGS])" \ 55 1.1 christos > m4/libuv-extra-automake-flags.m4 56 1.1 christos 57 1.1.1.2 christos (set -x 58 1.1.1.2 christos "$LIBTOOLIZE" --copy --force 59 1.1 christos "$ACLOCAL" -I m4 60 1.1.1.2 christos ) 61 1.1.1.2 christos if $LIBUV_RELEASE; then 62 1.1.1.2 christos "$AUTOCONF" -o /dev/null m4/libuv-check-versions.m4 63 1.1.1.2 christos echo " 64 1.1.1.2 christos AC_PREREQ($autoconf_version) 65 1.1.1.2 christos AC_INIT([libuv-release-check], [0.0]) 66 1.1.1.2 christos AM_INIT_AUTOMAKE([$automake_version]) 67 1.1.1.2 christos LT_PREREQ($libtoolize_version) 68 1.1.1.2 christos AC_OUTPUT 69 1.1.1.2 christos " > m4/libuv-check-versions.m4 70 1.1.1.2 christos fi 71 1.1.1.2 christos ( 72 1.1.1.2 christos set -x 73 1.1 christos "$AUTOCONF" 74 1.1 christos "$AUTOMAKE" --add-missing --copy 75 1.1.1.2 christos ) 76