autogen.sh 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/bin/sh
  2. # Run this to set up the build system: configure, makefiles, etc.
  3. # (based on the version in enlightenment's cvs)
  4. package="libogg"
  5. olddir=`pwd`
  6. srcdir=`dirname $0`
  7. test -z "$srcdir" && srcdir=.
  8. cd "$srcdir"
  9. DIE=0
  10. echo "checking for autoconf... "
  11. (autoconf --version) < /dev/null > /dev/null 2>&1 || {
  12. echo
  13. echo "You must have autoconf installed to compile $package."
  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. VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
  19. VERSIONMKINT="sed -e s/[^0-9]//"
  20. # do we need automake?
  21. if test -r Makefile.am; then
  22. AM_NEEDED=`fgrep AUTOMAKE_OPTIONS Makefile.am | $VERSIONGREP`
  23. if test -z $AM_NEEDED; then
  24. echo -n "checking for automake... "
  25. AUTOMAKE=automake
  26. ACLOCAL=aclocal
  27. if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
  28. echo "no"
  29. AUTOMAKE=
  30. else
  31. echo "yes"
  32. fi
  33. else
  34. echo -n "checking for automake $AM_NEEDED or later... "
  35. for am in automake-$AM_NEEDED automake$AM_NEEDED automake; do
  36. ($am --version < /dev/null > /dev/null 2>&1) || continue
  37. ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT`
  38. verneeded=`echo $AM_NEEDED | $VERSIONMKINT`
  39. if test $ver -ge $verneeded; then
  40. AUTOMAKE=$am
  41. echo $AUTOMAKE
  42. break
  43. fi
  44. done
  45. test -z $AUTOMAKE && echo "no"
  46. echo -n "checking for aclocal $AM_NEEDED or later... "
  47. for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal; do
  48. ($ac --version < /dev/null > /dev/null 2>&1) || continue
  49. ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT`
  50. verneeded=`echo $AM_NEEDED | $VERSIONMKINT`
  51. if test $ver -ge $verneeded; then
  52. ACLOCAL=$ac
  53. echo $ACLOCAL
  54. break
  55. fi
  56. done
  57. test -z $ACLOCAL && echo "no"
  58. fi
  59. test -z $AUTOMAKE || test -z $ACLOCAL && {
  60. echo
  61. echo "You must have automake installed to compile $package."
  62. echo "Download the appropriate package for your distribution,"
  63. echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
  64. exit 1
  65. }
  66. fi
  67. echo -n "checking for libtool... "
  68. for LIBTOOLIZE in libtoolize glibtoolize nope; do
  69. ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
  70. done
  71. if test x$LIBTOOLIZE = xnope; then
  72. echo "nope."
  73. LIBTOOLIZE=libtoolize
  74. else
  75. echo $LIBTOOLIZE
  76. fi
  77. ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
  78. echo
  79. echo "You must have libtool installed to compile $package."
  80. echo "Download the appropriate package for your system,"
  81. echo "or get the source from one of the GNU ftp sites"
  82. echo "listed in http://www.gnu.org/order/ftp.html"
  83. DIE=1
  84. }
  85. if test "$DIE" -eq 1; then
  86. exit 1
  87. fi
  88. if test -z "$*"; then
  89. echo "I am going to run ./configure with no arguments - if you wish "
  90. echo "to pass any to it, please specify them on the $0 command line."
  91. fi
  92. echo "Generating configuration files for $package, please wait...."
  93. echo " $ACLOCAL $ACLOCAL_FLAGS"
  94. $ACLOCAL $ACLOCAL_FLAGS || exit 1
  95. echo " $LIBTOOLIZE --automake"
  96. $LIBTOOLIZE --automake || exit 1
  97. echo " autoheader"
  98. autoheader || exit 1
  99. echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS"
  100. $AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1
  101. echo " autoconf"
  102. autoconf || exit 1
  103. cd $olddir
  104. $srcdir/configure --enable-maintainer-mode "$@" && echo