Recognizes if input is ogg or not.
[xiph/unicode.git] / icecast2yp / autogen.sh
blobc18d176f3c3f0f35d83d1fe8bde4d2f1ab607663
1 #!/bin/sh
2 # Run this to set up the build system: configure, makefiles, etc.
3 # (based on the version in enlightenment's cvs)
5 package="icecast2_yp"
7 olddir=`pwd`
8 srcdir=`dirname $0`
9 test -z "$srcdir" && srcdir=.
11 cd "$srcdir"
12 DIE=0
14 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
15 echo
16 echo "You must have autoconf installed to compile $package."
17 echo "Download the appropriate package for your distribution,"
18 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
19 DIE=1
21 VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
23 # do we need automake?
24 if test -r Makefile.am; then
25 echo Checking for automake version
26 options=`fgrep AUTOMAKE_OPTIONS Makefile.am`
27 AM_NEEDED=`echo "$options" | $VERSIONGREP`
28 AM_PROGS=automake
29 AC_PROGS=aclocal
30 if test -n "$AM_NEEDED" && test "x$AM_NEEDED" != "x$options"
31 then
32 AM_PROGS="automake-$AM_NEEDED automake$AM_NEEDED $AM_PROGS"
33 AC_PROGS="aclocal-$AM_NEEDED aclocal$AM_NEEDED $AC_PROGS"
34 else
35 AM_NEEDED=""
37 AM_PROGS="$AUTOMAKE $AM_PROGS"
38 AC_PROGS="$ACLOCAL $AC_PROGS"
39 for am in $AM_PROGS; do
40 ($am --version > /dev/null 2>&1) 2>/dev/null || continue
41 ver=`$am --version | head -1 | $VERSIONGREP`
42 AWK_RES=`echo $ver $AM_NEEDED | awk '{ if ( $1 >= $2 ) print "yes"; else print "no" }'`
43 if test "$AWK_RES" = "yes"; then
44 AUTOMAKE=$am
45 echo " found $AUTOMAKE"
46 break
48 done
49 for ac in $AC_PROGS; do
50 ($ac --version > /dev/null 2>&1) 2>/dev/null || continue
51 ver=`$ac --version < /dev/null | head -1 | $VERSIONGREP`
52 AWK_RES=`echo $ver $AM_NEEDED | awk '{ if ( $1 >= $2 ) print "yes"; else print "no" }'`
53 if test "$AWK_RES" = "yes"; then
54 ACLOCAL=$ac
55 echo " found $ACLOCAL"
56 break
58 done
59 test -z $AUTOMAKE || test -z $ACLOCAL && {
60 echo
61 if test -n "$AM_NEEDED"; then
62 echo "You must have automake version $AM_NEEDED installed"
63 echo "to compile $package."
64 else
65 echo "You must have automake installed to compile $package."
67 echo "Download the appropriate package for your distribution,"
68 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
69 DIE=1
73 (libtoolize --version) > /dev/null 2>&1 || {
74 echo
75 echo "You must have libtool installed to compile $package."
76 echo "Download the appropriate package for your system,"
77 echo "or get the source from one of the GNU ftp sites"
78 echo "listed in http://www.gnu.org/order/ftp.html"
79 DIE=1
82 if test "$DIE" -eq 1; then
83 exit 1
86 echo "Generating configuration files for $package, please wait...."
88 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4"
89 if test -n "$ACLOCAL"; then
90 echo " $ACLOCAL $ACLOCAL_FLAGS"
91 $ACLOCAL $ACLOCAL_FLAGS
94 echo " autoheader"
95 autoheader
97 echo " libtoolize --automake"
98 libtoolize --automake
100 if test -n "$AUTOMAKE"; then
101 echo " $AUTOMAKE --add-missing"
102 $AUTOMAKE --add-missing
105 echo " autoconf"
106 autoconf
108 if test -z "$*"; then
109 echo "I am going to run ./configure with no arguments - if you wish "
110 echo "to pass any to it, please specify them on the $0 command line."
112 cd $olddir
113 $srcdir/configure "$@" && echo