autogen.sh 3.8 KB

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