autogen.sh 4.0 KB

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