autogen.sh 1.12 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2
#!/bin/sh 

3 4 5
autoconf=${autoconf:-autoconf} autoheader=${autoheader:-autoheader}

for version in 2.59 2.58 2.57 2.53 2.52; do
6
  if autoconf --version 2>&1 | fgrep -q "$version" ; then
7
    break
8
  elif autoconf-$version --version 2>&1 | fgrep -q "$version" ; then
9 10 11 12 13 14 15 16
    autoconf=autoconf-$version autoheader=autoheader-$version
    break
  fi
done

aclocal=${aclocal:-aclocal} automake=${automake:-automake}

for version in 1.9 1.7 1.8; do # No more 1.6
17
  if automake --version 2>&1 | fgrep -q "$version" ; then 
18
    break
19
  elif automake-$version --version 2>&1 | fgrep -q "$version" ; then
20 21 22 23 24 25 26
    automake=automake-$version aclocal=aclocal-$version
    break
  fi
done

libtoolize=${libtoolize:-libtoolize} glibtoolize=${glibtoolize:-glibtoolize}

Pekka Pessi's avatar
Pekka Pessi committed
27 28
set -x

29 30
$aclocal -I m4 &&
$autoheader 
31

32 33 34 35
if $libtoolize --force 2> /dev/null
  then echo using $libtoolize
elif $glibtoolize --force 2> /dev/null
  then echo using $glibtoolize
36 37 38 39 40
else
  echo "error: no libtoolize or glibtoolize found."
  exit -1
fi

41 42
$automake --add-missing --copy --include-deps --foreign &&
$autoconf
Pekka Pessi's avatar
Pekka Pessi committed
43

44
find . \( -name 'run*' -o -name '*.sh' \) -a -type f | xargs chmod +x
Pekka Pessi's avatar
Pekka Pessi committed
45
chmod +x scripts/*