autogen.sh 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. (test -f $srcdir/configure.ac) || {
  7. echo -n "**Error**: Directory $srcdir does not look like the"
  8. echo " top-level package directory"
  9. exit 1
  10. }
  11. (autoconf --version) < /dev/null > /dev/null 2>&1 || {
  12. echo
  13. echo "**Error**: You must have autoconf installed."
  14. echo "Download the appropriate package for your distribution,"
  15. echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
  16. DIE=1
  17. }
  18. (grep "^LT_INIT" $srcdir/configure.ac >/dev/null) && {
  19. (libtool --version) < /dev/null > /dev/null 2>&1 || {
  20. echo
  21. echo "**Error**: You must have libtool installed."
  22. echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
  23. DIE=1
  24. }
  25. }
  26. (automake --version) < /dev/null > /dev/null 2>&1 || {
  27. echo
  28. echo "**Error**: You must have automake installed."
  29. echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
  30. DIE=1
  31. NO_AUTOMAKE=yes
  32. }
  33. # if no automake, don't bother testing for aclocal
  34. test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
  35. echo
  36. echo "**Error**: Missing aclocal. The version of automake"
  37. echo "installed doesn't appear recent enough."
  38. echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
  39. DIE=1
  40. }
  41. if test "$DIE" -eq 1; then
  42. exit 1
  43. fi
  44. if test -z "$*"; then
  45. echo "**Warning**: I am going to run configure with no arguments."
  46. echo "If you wish to pass any to it, please specify them on the"
  47. echo $0 " command line."
  48. echo
  49. fi
  50. case $CC in
  51. xlc )
  52. am_opt=--include-deps;;
  53. esac
  54. aclocalinclude="$ACLOCAL_FLAGS"
  55. if grep "^LT_INIT" configure.ac >/dev/null; then
  56. if test -z "$NO_LIBTOOLIZE" ; then
  57. echo "Running libtoolize..."
  58. libtoolize --force --copy
  59. fi
  60. fi
  61. echo "Running aclocal $aclocalinclude ..."
  62. aclocal $aclocalinclude
  63. if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
  64. echo "Running autoheader..."
  65. autoheader
  66. fi
  67. echo "Running automake --add-missing --gnu -Wno-portability $am_opt ..."
  68. automake --add-missing --gnu -Wno-portability $am_opt
  69. echo "Running autoconf ..."
  70. autoconf
  71. conf_flags="--enable-maintainer-mode"
  72. if test x$NOCONFIGURE = x; then
  73. echo "Running $srcdir/configure $conf_flags $@ ..."
  74. $srcdir/configure $conf_flags "$@" \
  75. && echo "Now type make to compile." || exit 1
  76. else
  77. echo "Skipping configure process."
  78. fi