autogen.sh 3.8 KB

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