bootstrap.sh 981 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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, envitonment variables tell which one to use.
  12. uname -s | grep -q BSD
  13. if [ $? = 0 ] ; then # BSD case
  14. case `uname -sr` in
  15. 'FreeBSD 4'*) # FreeBSD 4.x has a different naming
  16. MY_AC_VER=259
  17. MY_AM_VER=19
  18. ;;
  19. *)
  20. MY_AC_VER=-2.61
  21. MY_AM_VER=-1.9
  22. ;;
  23. esac
  24. else # linux case
  25. MY_AC_VER=
  26. MY_AM_VER=
  27. AUTOCONF_VERSION=2.60
  28. AUTOMAKE_VERSION=1.9
  29. export AUTOCONF_VERSION
  30. export AUTOMAKE_VERSION
  31. fi
  32. check_for_app autoconf${MY_AC_VER}
  33. check_for_app autoheader${MY_AC_VER}
  34. check_for_app automake${MY_AM_VER}
  35. check_for_app aclocal${MY_AM_VER}
  36. echo "Generating the configure script ..."
  37. aclocal${MY_AM_VER} -I autoconf
  38. autoconf${MY_AC_VER}
  39. autoheader${MY_AC_VER}
  40. automake${MY_AM_VER} --add-missing --copy 2>/dev/null
  41. exit 0