You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.8KB

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