autogen.sh 3.08 KB
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1 2 3 4 5 6
#!/bin/sh
# Run this to set up the build system: configure, makefiles, etc.
# (based on the version in enlightenment's cvs)

package="icecast"

7
olddir=`pwd`
Jack Moffitt's avatar
Jack Moffitt committed
8 9 10 11 12 13 14 15 16 17 18 19 20
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

cd "$srcdir"
DIE=0

(autoconf --version) < /dev/null > /dev/null 2>&1 || {
        echo
        echo "You must have autoconf installed to compile $package."
        echo "Download the appropriate package for your distribution,"
        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
        DIE=1
}
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
                                                                                
# do we need automake?
if test -r Makefile.am; then
  options=`fgrep AUTOMAKE_OPTIONS Makefile.am`
  AM_NEEDED=`echo "$options" | $VERSIONGREP`
  if test -z "$AM_NEEDED" || test "x$AM_NEEDED" = "x$options"; then
    echo -n "checking for automake..."
    AUTOMAKE=automake
    ACLOCAL=aclocal
    if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
      echo "yes"
    else
      echo "no"
      AUTOMAKE=""
    fi
  else
    echo -n "checking for automake $AM_NEEDED or later..."
    for am in automake-$AM_NEEDED automake$AM_NEEDED automake; do
      ($am --version < /dev/null > /dev/null 2>&1) || continue
      ver=`$am --version < /dev/null | head -1 | $VERSIONGREP`
      if test $ver = $AM_NEEDED; then
        AUTOMAKE=$am
        echo $AUTOMAKE
        break
      fi
    done
    test -z $AUTOMAKE &&  echo "no"
    echo -n "checking for aclocal $AM_NEEDED or later..."
    for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal; do
      ($ac --version < /dev/null > /dev/null 2>&1) || continue
      ver=`$ac --version < /dev/null | head -1 | $VERSIONGREP`
      if test $ver = $AM_NEEDED; then
        ACLOCAL=$ac
        echo $ACLOCAL
        break
      fi
    done
    test -z $ACLOCAL && echo "no"
  fi
  test -z $AUTOMAKE || test -z $ACLOCAL && {
Jack Moffitt's avatar
Jack Moffitt committed
62 63
        echo
        echo "You must have automake installed to compile $package."
64 65
        echo "Download the appropriate package for your distribution,"
        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
Jack Moffitt's avatar
Jack Moffitt committed
66
        DIE=1
67 68
  }
fi
Jack Moffitt's avatar
Jack Moffitt committed
69

70
(libtoolize --version) < /dev/null > /dev/null 2>&1 || {
Jack Moffitt's avatar
Jack Moffitt committed
71 72
	echo
	echo "You must have libtool installed to compile $package."
73
	echo "Download the appropriate package for your system,"
Jack Moffitt's avatar
Jack Moffitt committed
74 75 76 77 78 79 80 81 82
	echo "or get the source from one of the GNU ftp sites"
	echo "listed in http://www.gnu.org/order/ftp.html"
	DIE=1
}

if test "$DIE" -eq 1; then
        exit 1
fi

83 84 85 86 87 88
echo "Generating configuration files for $package, please wait...."

ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4"
if ! test -z $ACLOCAL; then
  echo "  $ACLOCAL $ACLOCAL_FLAGS"
  $ACLOCAL $ACLOCAL_FLAGS
Jack Moffitt's avatar
Jack Moffitt committed
89 90
fi

91 92
echo "  autoheader"
autoheader
Jack Moffitt's avatar
Jack Moffitt committed
93 94 95

echo "  libtoolize --automake"
libtoolize --automake
96 97 98 99 100 101

if ! test -z $AUTOMAKE; then
  echo "  $AUTOMAKE --add-missing"
  $AUTOMAKE --add-missing 
fi

Jack Moffitt's avatar
Jack Moffitt committed
102 103 104
echo "  autoconf"
autoconf

105 106 107 108
if test -z "$*"; then
        echo "I am going to run ./configure with no arguments - if you wish "
        echo "to pass any to it, please specify them on the $0 command line."
fi
109
cd $olddir
Jack Moffitt's avatar
Jack Moffitt committed
110
$srcdir/configure "$@" && echo