a3a97672f82149af95e47871b0339877804b121b
[awesomized/libmemcached] / memcached / autogen.sh
1 #!/bin/sh
2
3 # Get the initial version.
4 perl version.pl
5
6 die() {
7 echo "$@"
8 exit 1
9 }
10
11 # Try to locate a program by using which, and verify that the file is an
12 # executable
13 locate_binary() {
14 for f in $@
15 do
16 file=`which $f 2>/dev/null | grep -v '^no '`
17 if test -n "$file" -a -x "$file"; then
18 echo $file
19 return 0
20 fi
21 done
22
23 echo ""
24 return 1
25 }
26
27 echo "aclocal..."
28 if test x$ACLOCAL = x; then
29 ACLOCAL=`locate_binary aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal19 aclocal-1.7 aclocal17 aclocal-1.5 aclocal15 aclocal`
30 if test x$ACLOCAL = x; then
31 die "Did not find a supported aclocal"
32 fi
33 fi
34 $ACLOCAL || exit 1
35
36 echo "autoheader..."
37 AUTOHEADER=${AUTOHEADER:-autoheader}
38 $AUTOHEADER || exit 1
39
40 echo "automake..."
41 if test x$AUTOMAKE = x; then
42 AUTOMAKE=`locate_binary automake-1.12 automake-1.11 automake-1.10 automake-1.9 automake-1.7`
43 if test x$AUTOMAKE = x; then
44 die "Did not find a supported automake"
45 fi
46 fi
47 $AUTOMAKE --foreign --add-missing || $AUTOMAKE --gnu --add-missing || exit 1
48
49 echo "autoconf..."
50 AUTOCONF=${AUTOCONF:-autoconf}
51 $AUTOCONF || exit 1
52