11cb0ef41Sopenharmony_ci#!/bin/sh 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ci# Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl> 41cb0ef41Sopenharmony_ci# 51cb0ef41Sopenharmony_ci# Permission to use, copy, modify, and/or distribute this software for any 61cb0ef41Sopenharmony_ci# purpose with or without fee is hereby granted, provided that the above 71cb0ef41Sopenharmony_ci# copyright notice and this permission notice appear in all copies. 81cb0ef41Sopenharmony_ci# 91cb0ef41Sopenharmony_ci# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 101cb0ef41Sopenharmony_ci# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 111cb0ef41Sopenharmony_ci# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 121cb0ef41Sopenharmony_ci# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 131cb0ef41Sopenharmony_ci# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 141cb0ef41Sopenharmony_ci# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 151cb0ef41Sopenharmony_ci# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ciset -eu 181cb0ef41Sopenharmony_cicd `dirname "$0"` 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ciif [ "${1:-dev}" == "release" ]; then 211cb0ef41Sopenharmony_ci export LIBUV_RELEASE=true 221cb0ef41Sopenharmony_cielse 231cb0ef41Sopenharmony_ci export LIBUV_RELEASE=false 241cb0ef41Sopenharmony_cifi 251cb0ef41Sopenharmony_ci 261cb0ef41Sopenharmony_ciif [ "${LIBTOOLIZE:-}" = "" ] && [ "`uname`" = "Darwin" ]; then 271cb0ef41Sopenharmony_ci LIBTOOLIZE=glibtoolize 281cb0ef41Sopenharmony_cifi 291cb0ef41Sopenharmony_ci 301cb0ef41Sopenharmony_ciACLOCAL=${ACLOCAL:-aclocal} 311cb0ef41Sopenharmony_ciAUTOCONF=${AUTOCONF:-autoconf} 321cb0ef41Sopenharmony_ciAUTOMAKE=${AUTOMAKE:-automake} 331cb0ef41Sopenharmony_ciLIBTOOLIZE=${LIBTOOLIZE:-libtoolize} 341cb0ef41Sopenharmony_ci 351cb0ef41Sopenharmony_ciaclocal_version=`"$ACLOCAL" --version | head -n 1 | sed 's/[^.0-9]//g'` 361cb0ef41Sopenharmony_ciautoconf_version=`"$AUTOCONF" --version | head -n 1 | sed 's/[^.0-9]//g'` 371cb0ef41Sopenharmony_ciautomake_version=`"$AUTOMAKE" --version | head -n 1 | sed 's/[^.0-9]//g'` 381cb0ef41Sopenharmony_ciautomake_version_major=`echo "$automake_version" | cut -d. -f1` 391cb0ef41Sopenharmony_ciautomake_version_minor=`echo "$automake_version" | cut -d. -f2` 401cb0ef41Sopenharmony_cilibtoolize_version=`"$LIBTOOLIZE" --version | head -n 1 | sed 's/[^.0-9]//g'` 411cb0ef41Sopenharmony_ci 421cb0ef41Sopenharmony_ciif [ $aclocal_version != $automake_version ]; then 431cb0ef41Sopenharmony_ci echo "FATAL: aclocal version appears not to be from the same as automake" 441cb0ef41Sopenharmony_ci exit 1 451cb0ef41Sopenharmony_cifi 461cb0ef41Sopenharmony_ci 471cb0ef41Sopenharmony_ciUV_EXTRA_AUTOMAKE_FLAGS= 481cb0ef41Sopenharmony_ciif test "$automake_version_major" -gt 1 || \ 491cb0ef41Sopenharmony_ci test "$automake_version_major" -eq 1 && \ 501cb0ef41Sopenharmony_ci test "$automake_version_minor" -gt 11; then 511cb0ef41Sopenharmony_ci # serial-tests is available in v1.12 and newer. 521cb0ef41Sopenharmony_ci UV_EXTRA_AUTOMAKE_FLAGS="$UV_EXTRA_AUTOMAKE_FLAGS serial-tests" 531cb0ef41Sopenharmony_cifi 541cb0ef41Sopenharmony_ciecho "m4_define([UV_EXTRA_AUTOMAKE_FLAGS], [$UV_EXTRA_AUTOMAKE_FLAGS])" \ 551cb0ef41Sopenharmony_ci > m4/libuv-extra-automake-flags.m4 561cb0ef41Sopenharmony_ci 571cb0ef41Sopenharmony_ci(set -x 581cb0ef41Sopenharmony_ci"$LIBTOOLIZE" --copy --force 591cb0ef41Sopenharmony_ci"$ACLOCAL" -I m4 601cb0ef41Sopenharmony_ci) 611cb0ef41Sopenharmony_ciif $LIBUV_RELEASE; then 621cb0ef41Sopenharmony_ci "$AUTOCONF" -o /dev/null m4/libuv-check-versions.m4 631cb0ef41Sopenharmony_ci echo " 641cb0ef41Sopenharmony_ciAC_PREREQ($autoconf_version) 651cb0ef41Sopenharmony_ciAC_INIT([libuv-release-check], [0.0]) 661cb0ef41Sopenharmony_ciAM_INIT_AUTOMAKE([$automake_version]) 671cb0ef41Sopenharmony_ciLT_PREREQ($libtoolize_version) 681cb0ef41Sopenharmony_ciAC_OUTPUT 691cb0ef41Sopenharmony_ci" > m4/libuv-check-versions.m4 701cb0ef41Sopenharmony_cifi 711cb0ef41Sopenharmony_ci( 721cb0ef41Sopenharmony_ciset -x 731cb0ef41Sopenharmony_ci"$AUTOCONF" 741cb0ef41Sopenharmony_ci"$AUTOMAKE" --add-missing --copy 751cb0ef41Sopenharmony_ci) 76