autogen.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. # Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
  3. #
  4. # Permission to use, copy, modify, and/or distribute this software for any
  5. # purpose with or without fee is hereby granted, provided that the above
  6. # copyright notice and this permission notice appear in all copies.
  7. #
  8. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. cd `dirname "$0"`
  16. if [ "$LIBTOOLIZE" = "" ] && [ "`uname`" = "Darwin" ]; then
  17. LIBTOOLIZE=glibtoolize
  18. fi
  19. ACLOCAL=${ACLOCAL:-aclocal}
  20. AUTOCONF=${AUTOCONF:-autoconf}
  21. AUTOMAKE=${AUTOMAKE:-automake}
  22. LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
  23. automake_version=`"$AUTOMAKE" --version | head -n 1 | sed 's/[^.0-9]//g'`
  24. automake_version_major=`echo "$automake_version" | cut -d. -f1`
  25. automake_version_minor=`echo "$automake_version" | cut -d. -f2`
  26. UV_EXTRA_AUTOMAKE_FLAGS=
  27. if test "$automake_version_major" -gt 1 || \
  28. test "$automake_version_major" -eq 1 && \
  29. test "$automake_version_minor" -gt 11; then
  30. # serial-tests is available in v0.12 and newer.
  31. UV_EXTRA_AUTOMAKE_FLAGS="$UV_EXTRA_AUTOMAKE_FLAGS serial-tests"
  32. fi
  33. echo "m4_define([UV_EXTRA_AUTOMAKE_FLAGS], [$UV_EXTRA_AUTOMAKE_FLAGS])" \
  34. > m4/libuv-extra-automake-flags.m4
  35. set -ex
  36. "$LIBTOOLIZE"
  37. "$ACLOCAL" -I m4
  38. "$AUTOCONF"
  39. "$AUTOMAKE" --add-missing --copy