autogen.sh 4.0 KB

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