autogen.sh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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="opus"
  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_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
  23. AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
  24. if test "$AM_NEEDED" = "$AM_OPTIONS"; then
  25. AM_NEEDED=""
  26. fi
  27. if test -z $AM_NEEDED; then
  28. echo -n "checking for automake... "
  29. AUTOMAKE=automake
  30. ACLOCAL=aclocal
  31. if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
  32. echo "yes"
  33. else
  34. echo "no"
  35. AUTOMAKE=
  36. fi
  37. else
  38. echo -n "checking for automake $AM_NEEDED or later... "
  39. for am in automake-$AM_NEEDED automake$AM_NEEDED automake; do
  40. ($am --version < /dev/null > /dev/null 2>&1) || continue
  41. ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT`
  42. verneeded=`echo $AM_NEEDED | $VERSIONMKINT`
  43. if test $ver -ge $verneeded; then
  44. AUTOMAKE=$am
  45. echo $AUTOMAKE
  46. break
  47. fi
  48. done
  49. test -z $AUTOMAKE && echo "no"
  50. echo -n "checking for aclocal $AM_NEEDED or later... "
  51. for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal; do
  52. ($ac --version < /dev/null > /dev/null 2>&1) || continue
  53. ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT`
  54. verneeded=`echo $AM_NEEDED | $VERSIONMKINT`
  55. if test $ver -ge $verneeded; then
  56. ACLOCAL=$ac
  57. echo $ACLOCAL
  58. break
  59. fi
  60. done
  61. test -z $ACLOCAL && echo "no"
  62. fi
  63. test -z $AUTOMAKE || test -z $ACLOCAL && {
  64. echo
  65. echo "You must have automake installed to compile $package."
  66. echo "Download the appropriate package for your distribution,"
  67. echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
  68. exit 1
  69. }
  70. fi
  71. echo -n "checking for libtool... "
  72. for LIBTOOLIZE in libtoolize glibtoolize nope; do
  73. ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
  74. done
  75. if test x$LIBTOOLIZE = xnope; then
  76. echo "nope."
  77. LIBTOOLIZE=libtoolize
  78. else
  79. echo $LIBTOOLIZE
  80. fi
  81. ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
  82. echo
  83. echo "You must have libtool installed to compile $package."
  84. echo "Download the appropriate package for your system,"
  85. echo "or get the source from one of the GNU ftp sites"
  86. echo "listed in http://www.gnu.org/order/ftp.html"
  87. DIE=1
  88. }
  89. if test "$DIE" -eq 1; then
  90. exit 1
  91. fi
  92. echo "Generating configuration files for $package, please wait...."
  93. echo " $ACLOCAL $ACLOCAL_FLAGS"
  94. $ACLOCAL $ACLOCAL_FLAGS || exit 1
  95. echo " autoheader"
  96. autoheader || exit 1
  97. echo " $LIBTOOLIZE --automake"
  98. $LIBTOOLIZE --automake || 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 "$@" && echo