xref: /memcached-1.4.29/autogen.sh (revision 543959a7)
11b533267SBrad Fitzpatrick#!/bin/sh
21b533267SBrad Fitzpatrick
3923a335bSDustin Sallings# Get the initial version.
42906fae0Sdormandoperl version.pl
5923a335bSDustin Sallings
6457ef49cSnirvanazcdie() {
7457ef49cSnirvanazc    echo "$@"
8457ef49cSnirvanazc    exit 1
9457ef49cSnirvanazc}
10457ef49cSnirvanazc
11fcc09305STrond Norbye# Try to locate a program by using which, and verify that the file is an
12fcc09305STrond Norbye# executable
13fcc09305STrond Norbyelocate_binary() {
14fcc09305STrond Norbye  for f in $@
15fcc09305STrond Norbye  do
16fcc09305STrond Norbye    file=`which $f 2>/dev/null | grep -v '^no '`
17fcc09305STrond Norbye    if test -n "$file" -a -x "$file"; then
18fcc09305STrond Norbye      echo $file
19fcc09305STrond Norbye      return 0
20fcc09305STrond Norbye    fi
21fcc09305STrond Norbye  done
22fcc09305STrond Norbye
23fcc09305STrond Norbye  echo ""
24fcc09305STrond Norbye  return 1
25fcc09305STrond Norbye}
26fcc09305STrond Norbye
271b533267SBrad Fitzpatrickecho "aclocal..."
28fcc09305STrond Norbyeif test x$ACLOCAL = x; then
294fabbe31SEric McConville  ACLOCAL=`locate_binary aclocal-1.14 aclocal-1.13 aclocal-1.12 aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal19 aclocal-1.7 aclocal17 aclocal-1.5 aclocal15 aclocal`
30fcc09305STrond Norbye  if test x$ACLOCAL = x; then
31fcc09305STrond Norbye    die "Did not find a supported aclocal"
32fcc09305STrond Norbye  fi
33fcc09305STrond Norbyefi
34b65aa2abSPaul Lindner$ACLOCAL || exit 1
351b533267SBrad Fitzpatrick
361b533267SBrad Fitzpatrickecho "autoheader..."
371b533267SBrad FitzpatrickAUTOHEADER=${AUTOHEADER:-autoheader}
381b533267SBrad Fitzpatrick$AUTOHEADER || exit 1
391b533267SBrad Fitzpatrick
401b533267SBrad Fitzpatrickecho "automake..."
41fcc09305STrond Norbyeif test x$AUTOMAKE = x; then
42*543959a7Sdormando  AUTOMAKE=`locate_binary automake-1.14 automake-1.13 automake-1.12 automake-1.11 automake-1.10 automake-1.9 automake-1.7 automake`
43fcc09305STrond Norbye  if test x$AUTOMAKE = x; then
44fcc09305STrond Norbye    die "Did not find a supported automake"
45fcc09305STrond Norbye  fi
46fcc09305STrond Norbyefi
47fcc09305STrond Norbye$AUTOMAKE --foreign --add-missing || $AUTOMAKE --gnu --add-missing || exit 1
481b533267SBrad Fitzpatrick
491b533267SBrad Fitzpatrickecho "autoconf..."
501b533267SBrad FitzpatrickAUTOCONF=${AUTOCONF:-autoconf}
511b533267SBrad Fitzpatrick$AUTOCONF || exit 1
521b533267SBrad Fitzpatrick
53