autogen.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!/bin/sh
  2. # Run this to generate all the initial makefiles, etc.
  3. srcdir=`dirname $0`
  4. test -z "$srcdir" && srcdir=.
  5. DIE=0
  6. ACLOCAL_FLAGS="-I m4"
  7. if [ "$1" = "--distclean" ];
  8. then
  9. make distclean
  10. rm configure config.guess config.sub depcomp install-sh missing
  11. rm aclocal.m4 compile ltmain.sh m4/libtool.m4 m4/ltoptions.m4
  12. rm m4/ltsugar.m4 m4/lt~obsolete.m4 m4/ltversion.m4
  13. echo done cleaning!
  14. exit 0
  15. fi
  16. (test -f $srcdir/configure.ac) || {
  17. echo -n "**Error**: Directory $srcdir does not look like the"
  18. echo " top-level package directory"
  19. exit 1
  20. }
  21. (autoconf --version) < /dev/null > /dev/null 2>&1 || {
  22. echo
  23. echo "**Error**: You must have autoconf installed."
  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. (grep "^LT_INIT" $srcdir/configure.ac >/dev/null) && {
  29. (libtoolize --version) < /dev/null > /dev/null 2>&1 || {
  30. echo
  31. echo "**Error**: You must have libtool installed."
  32. echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
  33. DIE=1
  34. }
  35. }
  36. (automake --version) < /dev/null > /dev/null 2>&1 || {
  37. echo
  38. echo "**Error**: You must have automake installed."
  39. echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
  40. DIE=1
  41. NO_AUTOMAKE=yes
  42. }
  43. # if no automake, don't bother testing for aclocal
  44. test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
  45. echo
  46. echo "**Error**: Missing aclocal. The version of automake"
  47. echo "installed doesn't appear recent enough."
  48. echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
  49. DIE=1
  50. }
  51. if test "$DIE" -eq 1; then
  52. exit 1
  53. fi
  54. if test -z "$*"; then
  55. echo "**Warning**: I am going to run configure with no arguments."
  56. echo "If you wish to pass any to it, please specify them on the"
  57. echo $0 " command line."
  58. echo
  59. fi
  60. case $CC in
  61. xlc )
  62. am_opt=--include-deps;;
  63. esac
  64. aclocalinclude="$ACLOCAL_FLAGS"
  65. if grep "^LT_INIT" configure.ac >/dev/null; then
  66. if test -z "$NO_LIBTOOLIZE" ; then
  67. echo "Running libtoolize..."
  68. libtoolize --force --copy
  69. fi
  70. fi
  71. echo "Running aclocal $aclocalinclude ..."
  72. aclocal $aclocalinclude
  73. if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
  74. echo "Running autoheader..."
  75. autoheader
  76. fi
  77. echo "Running automake --add-missing -copy --gnu -Wno-portability $am_opt ..."
  78. automake --add-missing --copy --gnu -Wno-portability $am_opt
  79. echo "Running autoconf ..."
  80. autoconf
  81. conf_flags="--enable-maintainer-mode"
  82. if test x$NOCONFIGURE = x; then
  83. echo "Running $srcdir/configure $conf_flags $@ ..."
  84. $srcdir/configure $conf_flags "$@" \
  85. && echo "Now type make to compile." || exit 1
  86. else
  87. echo "Skipping configure process."
  88. fi