2
0

autogen.sh 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #!/usr/bin/env bash
  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 "$LIBTOOLIZE" ]; then
  29. LIBTOOLIZE=`which glibtoolize 2>/dev/null`
  30. if [ ! -x "$LIBTOOLIZE" ]; then
  31. LIBTOOLIZE=`which libtoolize`
  32. fi
  33. fi
  34. (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
  35. ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
  36. echo
  37. echo "**Error**: You must have \`libtoolize' installed to compile Mono."
  38. echo "Get ftp://ftp.gnu.org/gnu/libtool/libtool-1.2.tar.gz"
  39. echo "(or a newer version if it is available)"
  40. DIE=1
  41. }
  42. }
  43. grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && {
  44. grep "sed.*POTFILES" $srcdir/configure.ac >/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.ac >/dev/null; then
  84. if test -z "$NO_LIBTOOLIZE" ; then
  85. echo "Running libtoolize..."
  86. $LIBTOOLIZE --force --copy
  87. fi
  88. fi
  89. #
  90. # Plug in the extension module
  91. #
  92. has_ext_mod=false
  93. ext_mod_args=''
  94. for PARAM; do
  95. if [[ $PARAM =~ "--enable-extension-module" ]] ; then
  96. has_ext_mod=true
  97. if [[ $PARAM =~ "=" ]] ; then
  98. ext_mod_args=`echo $PARAM | cut -d= -f2`
  99. fi
  100. fi
  101. done
  102. if test x$has_ext_mod = xtrue; then
  103. pushd ../mono-extensions/scripts
  104. sh ./prepare-repo.sh $ext_mod_args || exit 1
  105. popd
  106. else
  107. cat mono/mini/Makefile.am.in > mono/mini/Makefile.am
  108. fi
  109. echo "Running aclocal -I m4 -I . $ACLOCAL_FLAGS ..."
  110. aclocal -Wnone -I m4 -I . $ACLOCAL_FLAGS || {
  111. echo
  112. echo "**Error**: aclocal failed. This may mean that you have not"
  113. echo "installed all of the packages you need, or you may need to"
  114. echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
  115. echo "for the prefix where you installed the packages whose"
  116. echo "macros were not found"
  117. exit 1
  118. }
  119. if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
  120. echo "Running autoheader..."
  121. autoheader || { echo "**Error**: autoheader failed."; exit 1; }
  122. fi
  123. echo "Running automake --gnu $am_opt ..."
  124. automake --add-missing --gnu -Wno-portability -Wno-obsolete $am_opt ||
  125. { echo "**Error**: automake failed."; exit 1; }
  126. echo "Running autoconf ..."
  127. autoconf || { echo "**Error**: autoconf failed."; exit 1; }
  128. if test -d $srcdir/libgc; then
  129. echo Running libgc/autogen.sh ...
  130. (cd $srcdir/libgc ; NOCONFIGURE=1 ./autogen.sh "$@")
  131. echo Done running libgc/autogen.sh ...
  132. fi
  133. if test -d $srcdir/eglib; then
  134. echo Running eglib/autogen.sh ...
  135. (cd $srcdir/eglib ; NOCONFIGURE=1 ./autogen.sh "$@")
  136. echo Done running eglib/autogen.sh ...
  137. fi
  138. if test x$MONO_EXTRA_CONFIGURE_FLAGS != x; then
  139. echo "MONO_EXTRA_CONFIGURE_FLAGS is $MONO_EXTRA_CONFIGURE_FLAGS"
  140. fi
  141. conf_flags="$MONO_EXTRA_CONFIGURE_FLAGS --enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
  142. if test x$NOCONFIGURE = x; then
  143. echo Running $srcdir/configure $conf_flags "$@" ...
  144. $srcdir/configure $conf_flags "$@" \
  145. && echo Now type \`make\' to compile $PKG_NAME || exit 1
  146. else
  147. echo Skipping configure process.
  148. fi