bootstrap.sh 964 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. check_for_app() {
  3. $1 --version 2>&1 >/dev/null
  4. if [ $? != 0 ]
  5. then
  6. echo "Please install $1 and run bootstrap.sh again!"
  7. exit 1
  8. fi
  9. }
  10. # On FreeBSD and OpenBSD, multiple autoconf/automake versions have different names.
  11. # On Linux, environment variables tell which one to use.
  12. case `uname -sr` in
  13. 'FreeBSD 4'*) # FreeBSD 4.x has a different naming
  14. MY_AC_VER=259
  15. MY_AM_VER=19
  16. ;;
  17. *'BSD'*)
  18. MY_AC_VER=-2.62
  19. MY_AM_VER=-1.9
  20. ;;
  21. *'SunOS '*)
  22. MY_AC_VER=
  23. MY_AM_VER=-1.9
  24. ;;
  25. *)
  26. MY_AC_VER=
  27. MY_AM_VER=
  28. AUTOCONF_VERSION=2.60
  29. AUTOMAKE_VERSION=1.9
  30. export AUTOCONF_VERSION
  31. export AUTOMAKE_VERSION
  32. ;;
  33. esac
  34. check_for_app autoconf${MY_AC_VER}
  35. check_for_app autoheader${MY_AC_VER}
  36. check_for_app automake${MY_AM_VER}
  37. check_for_app aclocal${MY_AM_VER}
  38. echo "Generating the configure script ..."
  39. aclocal${MY_AM_VER} -I autoconf
  40. autoconf${MY_AC_VER}
  41. autoheader${MY_AC_VER}
  42. automake${MY_AM_VER} --add-missing --copy 2>/dev/null
  43. exit 0