autogen.sh 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #!/bin/sh
  2. # Run this to generate all the initial makefiles, etc.
  3. # Ripped off from GNOME macros version
  4. DIE=0
  5. srcdir=`dirname $0`
  6. test -z "$srcdir" && srcdir=.
  7. if [ -n "$MONO_PATH" ]; then
  8. ACLOCAL_FLAGS="-I $MONO_PATH/share/aclocal $ACLOCAL_FLAGS"
  9. PATH="$MONO_PATH/bin:$PATH"
  10. export PATH
  11. fi
  12. (autoconf --version) < /dev/null > /dev/null 2>&1 || {
  13. echo
  14. echo "**Error**: You must have \`autoconf' installed to compile Mono."
  15. echo "Download the appropriate package for your distribution,"
  16. echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
  17. DIE=1
  18. }
  19. (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
  20. (libtool --version) < /dev/null > /dev/null 2>&1 || {
  21. echo
  22. echo "**Error**: You must have \`libtool' installed to compile Mono."
  23. echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
  24. echo "(or a newer version if it is available)"
  25. DIE=1
  26. }
  27. }
  28. grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
  29. grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
  30. (gettext --version) < /dev/null > /dev/null 2>&1 || {
  31. echo
  32. echo "**Error**: You must have \`gettext' installed to compile Mono."
  33. echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
  34. echo "(or a newer version if it is available)"
  35. DIE=1
  36. }
  37. }
  38. (automake --version) < /dev/null > /dev/null 2>&1 || {
  39. echo
  40. echo "**Error**: You must have \`automake' installed to compile Mono."
  41. echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
  42. echo "(or a newer version if it is available)"
  43. DIE=1
  44. NO_AUTOMAKE=yes
  45. }
  46. # if no automake, don't bother testing for aclocal
  47. test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
  48. echo
  49. echo "**Error**: Missing \`aclocal'. The version of \`automake'"
  50. echo "installed doesn't appear recent enough."
  51. echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
  52. echo "(or a newer version if it is available)"
  53. DIE=1
  54. }
  55. if test "$DIE" -eq 1; then
  56. exit 1
  57. fi
  58. if test -z "$*"; then
  59. echo "**Warning**: I am going to run \`configure' with no arguments."
  60. echo "If you wish to pass any to it, please specify them on the"
  61. echo \`$0\'" command line."
  62. echo
  63. fi
  64. case $CC in
  65. xlc )
  66. am_opt=--include-deps;;
  67. esac
  68. if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
  69. if test -z "$NO_LIBTOOLIZE" ; then
  70. echo "Running libtoolize..."
  71. libtoolize --force --copy
  72. fi
  73. fi
  74. echo "Running aclocal $aclocalinclude ..."
  75. aclocal $aclocalinclude || {
  76. echo
  77. echo "**Error**: aclocal failed. This may mean that you have not"
  78. echo "installed all of the packages you need, or you may need to"
  79. echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
  80. echo "for the prefix where you installed the packages whose"
  81. echo "macros were not found"
  82. exit 1
  83. }
  84. if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
  85. echo "Running autoheader..."
  86. autoheader || { echo "**Error**: autoheader failed."; exit 1; }
  87. fi
  88. echo "Running automake --gnu $am_opt ..."
  89. automake --add-missing --gnu $am_opt ||
  90. { echo "**Error**: automake failed."; exit 1; }
  91. echo "Running autoconf ..."
  92. autoconf || { echo "**Error**: autoconf failed."; exit 1; }
  93. conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
  94. if test x$NOCONFIGURE = x; then
  95. echo Running $srcdir/configure $conf_flags "$@" ...
  96. $srcdir/configure $conf_flags "$@" \
  97. && echo Now type \`make\' to compile $PKG_NAME || exit 1
  98. else
  99. echo Skipping configure process.
  100. fi