bootstrap.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. OpenBSD*)
  18. export AUTOCONF_VERSION=2.63
  19. export AUTOMAKE_VERSION=1.9
  20. ;;
  21. *'BSD'*)
  22. MY_AC_VER=-2.62
  23. MY_AM_VER=-1.9
  24. ;;
  25. *'SunOS '*)
  26. MY_AC_VER=
  27. MY_AM_VER=-1.9
  28. ;;
  29. *)
  30. MY_AC_VER=
  31. MY_AM_VER=
  32. AUTOCONF_VERSION=2.60
  33. AUTOMAKE_VERSION=1.9
  34. export AUTOCONF_VERSION
  35. export AUTOMAKE_VERSION
  36. ;;
  37. esac
  38. check_for_app autoconf${MY_AC_VER}
  39. check_for_app autoheader${MY_AC_VER}
  40. check_for_app automake${MY_AM_VER}
  41. check_for_app aclocal${MY_AM_VER}
  42. echo "Generating the configure script ..."
  43. aclocal${MY_AM_VER} -I autoconf
  44. autoconf${MY_AC_VER}
  45. autoheader${MY_AC_VER}
  46. automake${MY_AM_VER} --add-missing --copy 2>/dev/null
  47. exit 0