1 #! /bin/sh
2 # Check Autoconf version
3 if [ -x `which autoconf` ]; then
4 AC_VER=`autoconf --version | head -1 | sed 's/^[^0-9]*//'`
5 AC_VER_MAJOR=`echo $AC_VER | cut -f1 -d'.'`
6 AC_VER_MINOR=`echo $AC_VER | cut -f2 -d'.' | sed 's/[^0-9]*$//'`
8 if [ "$AC_VER_MAJOR" -lt "2" ]; then
9 echo "Autoconf 2.13 or greater needed to build configure."
10 exit 1
11 fi
13 if [ "$AC_VER_MINOR" -lt "13" ]; then
14 echo "Autoconf 2.13 or greater needed to build configure."
15 exit 1
16 fi
18 if [ "$AC_VER_MINOR" -lt "50" ]; then
19 if [ ! -e configure.in ]; then
20 ln -s configure.ac configure.in
21 fi
22 echo "If you see some warnings about cross-compiling, don't worry; this is normal."
23 else
24 echo "rm -f configure.in ?"
25 fi
26 else
27 echo Autoconf not found. AlsaPlayer CVS requires autoconf to bootstrap itself.
28 exit 1
29 fi
31 run_cmd() {
32 echo running $* ...
33 if ! $*; then
34 echo failed!
35 exit 1
36 fi
37 }
39 # Check if /usr/local/share/aclocal exists
40 if [ -d /usr/local/share/aclocal ]; then
41 ACLOCAL_INCLUDE="$ACLOCAL_INCLUDE -I /usr/local/share/aclocal"
42 fi
44 if [ -d m4 ] ; then
45 run_cmd cat m4/*.m4 > acinclude.m4
46 fi
47 run_cmd aclocal $ACLOCAL_INCLUDE
48 run_cmd autoheader
49 run_cmd libtoolize --automake
50 run_cmd automake --add-missing
51 run_cmd autoconf
52 echo
53 echo "Now run './configure'"
54 echo