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

Karl Heyes's avatar
Karl Heyes committed
5
package="icecast"
Jack Moffitt's avatar
Jack Moffitt committed
6

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
VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
                                                                                
# do we need automake?
if test -r Makefile.am; then
25 26 27 28 29 30 31 32 33
    echo Checking for automake version
    options=`fgrep AUTOMAKE_OPTIONS Makefile.am`
    AM_NEEDED=`echo "$options" | $VERSIONGREP`
    AM_PROGS=automake
    AC_PROGS=aclocal
    if test -n "$AM_NEEDED" && test "x$AM_NEEDED" != "x$options"
    then
        AM_PROGS="automake-$AM_NEEDED automake$AM_NEEDED $AM_PROGS"
        AC_PROGS="aclocal-$AM_NEEDED aclocal$AM_NEEDED $AC_PROGS"
34
    else
35
        AM_NEEDED=""
36
    fi
37 38 39 40 41 42 43
    AM_PROGS="$AUTOMAKE $AM_PROGS"
    AC_PROGS="$ACLOCAL $AC_PROGS"
    for am in $AM_PROGS; do
      ($am --version > /dev/null 2>&1) 2>/dev/null || continue
      ver=`$am --version | head -1 | $VERSIONGREP`
      AWK_RES=`echo $ver $AM_NEEDED | awk '{ if ( $1 >= $2 ) print "yes"; else print "no" }'`
      if test "$AWK_RES" = "yes"; then
44
        AUTOMAKE=$am
45
        echo "  found $AUTOMAKE"
46 47 48
        break
      fi
    done
49 50
    for ac in $AC_PROGS; do
      ($ac --version > /dev/null 2>&1) 2>/dev/null || continue
51
      ver=`$ac --version < /dev/null | head -1 | $VERSIONGREP`
52 53
      AWK_RES=`echo $ver $AM_NEEDED | awk '{ if ( $1 >= $2 ) print "yes"; else print "no" }'`
      if test "$AWK_RES" = "yes"; then
54
        ACLOCAL=$ac
55
        echo "  found $ACLOCAL"
56 57 58
        break
      fi
    done
59
    test -z $AUTOMAKE || test -z $ACLOCAL && {
Jack Moffitt's avatar
Jack Moffitt committed
60
        echo
61 62 63 64 65 66
        if test -n "$AM_NEEDED"; then
            echo "You must have automake version $AM_NEEDED installed"
            echo "to compile $package."
        else
            echo "You must have automake installed to compile $package."
        fi
67 68
        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
69
        DIE=1
70
      }
71
fi
Jack Moffitt's avatar
Jack Moffitt committed
72

73
(libtoolize --version)  > /dev/null 2>&1 || {
Jack Moffitt's avatar
Jack Moffitt committed
74 75
	echo
	echo "You must have libtool installed to compile $package."
76
	echo "Download the appropriate package for your system,"
Jack Moffitt's avatar
Jack Moffitt committed
77 78 79 80 81 82 83 84 85
	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

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

ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4"
89
if test -n "$ACLOCAL"; then
90 91
  echo "  $ACLOCAL $ACLOCAL_FLAGS"
  $ACLOCAL $ACLOCAL_FLAGS
Jack Moffitt's avatar
Jack Moffitt committed
92 93
fi

94 95
echo "  autoheader"
autoheader
Jack Moffitt's avatar
Jack Moffitt committed
96 97 98

echo "  libtoolize --automake"
libtoolize --automake
99

100
if test -n "$AUTOMAKE"; then
101 102 103 104
  echo "  $AUTOMAKE --add-missing"
  $AUTOMAKE --add-missing 
fi

Jack Moffitt's avatar
Jack Moffitt committed
105 106 107
echo "  autoconf"
autoconf

108 109 110 111
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
112
cd $olddir
Jack Moffitt's avatar
Jack Moffitt committed
113
$srcdir/configure "$@" && echo