Add Russian translation provided by Валерий Крувялис <valkru@mail.ru>
[xiph-mirror.git] / squishyball / autogen.sh
blob68904bb18503a9036d837bf10e6afda93ad2be72
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="squishyball"
7 ACLOCAL_FLAGS=""
9 olddir=`pwd`
10 srcdir=`dirname $0`
11 test -z "$srcdir" && srcdir=.
13 cd "$srcdir"
14 DIE=0
16 /bin/echo "checking for autoconf... "
17 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
18 echo
19 echo "You must have autoconf installed to compile $package."
20 echo "Download the appropriate package for your distribution,"
21 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
22 DIE=1
25 VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/"
26 VERSIONMKMAJ="sed -e s/\([0-9][0-9]*\)[^0-9].*/\\1/"
27 VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//"
29 # do we need automake?
30 if test -r Makefile.am; then
31 AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
32 AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
33 if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then
34 AM_NEEDED=""
36 if test -z $AM_NEEDED; then
37 /bin/echo -n "checking for automake... "
38 AUTOMAKE=automake
39 ACLOCAL=aclocal
40 if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
41 /bin/echo "yes"
42 else
43 /bin/echo "no"
44 AUTOMAKE=
46 else
47 /bin/echo -n "checking for automake $AM_NEEDED or later... "
48 majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ`
49 minneeded=`echo $AM_NEEDED | $VERSIONMKMIN`
50 for am in automake-$AM_NEEDED automake$AM_NEEDED \
51 automake automake-1.7 automake-1.8 automake-1.9 \
52 automake-1.10 automake-1.11; do
53 ($am --version < /dev/null > /dev/null 2>&1) || continue
54 ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP`
55 maj=`echo $ver | $VERSIONMKMAJ`
56 min=`echo $ver | $VERSIONMKMIN`
57 if test $maj -eq $majneeded -a $min -ge $minneeded; then
58 AUTOMAKE=$am
59 /bin/echo $AUTOMAKE
60 break
62 done
63 test -z $AUTOMAKE && /bin/echo "no"
64 /bin/echo -n "checking for aclocal $AM_NEEDED or later... "
65 for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \
66 aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10 aclocal-1.11; do
67 ($ac --version < /dev/null > /dev/null 2>&1) || continue
68 ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP`
69 maj=`echo $ver | $VERSIONMKMAJ`
70 min=`echo $ver | $VERSIONMKMIN`
71 if test $maj -eq $majneeded -a $min -ge $minneeded; then
72 ACLOCAL=$ac
73 /bin/echo $ACLOCAL
74 break
76 done
77 test -z $ACLOCAL && /bin/echo "no"
79 test -z $AUTOMAKE || test -z $ACLOCAL && {
80 echo
81 echo "You must have automake installed to compile $package."
82 echo "Download the appropriate package for your distribution,"
83 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
84 exit 1
88 /bin/echo -n "checking for libtool... "
89 for LIBTOOLIZE in libtoolize glibtoolize nope; do
90 ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
91 done
92 if test x$LIBTOOLIZE = xnope; then
93 /bin/echo "nope."
94 LIBTOOLIZE=libtoolize
95 else
96 /bin/echo $LIBTOOLIZE
98 ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
99 echo
100 echo "You must have libtool installed to compile $package."
101 echo "Download the appropriate package for your system,"
102 echo "or get the source from one of the GNU ftp sites"
103 echo "listed in http://www.gnu.org/order/ftp.html"
104 DIE=1
107 if test "$DIE" -eq 1; then
108 exit 1
111 /bin/echo "Generating configuration files for $package, please wait...."
113 /bin/echo " $ACLOCAL $ACLOCAL_FLAGS"
114 $ACLOCAL $ACLOCAL_FLAGS || exit 1
115 /bin/echo " $LIBTOOLIZE --automake --copy --force"
116 $LIBTOOLIZE --automake --copy --force || exit 1
117 /bin/echo " $AUTOMAKE --add-missing --copy $AUTOMAKE_FLAGS"
118 $AUTOMAKE --add-missing --copy $AUTOMAKE_FLAGS || exit 1
119 /bin/echo " autoconf"
120 autoconf || exit 1
122 if test "x$1" = "x--noconfigure"; then
123 exit 0
126 if test -z "$*"; then
127 echo "I am going to run ./configure with no arguments - if you wish "
128 echo "to pass any to it, please specify them on the $0 command line."
129 echo "(Use --noconfigure to suppress running configure at all.)"
132 cd $olddir
133 $srcdir/configure "$@" && /bin/echo