Permalink
Browse files

detect automake version for build script

  • Loading branch information...
alexandervdm committed Sep 6, 2018
1 parent 638f52f commit 565a7a0e73b70f713364639114b6bd9af228580e
Showing with 18 additions and 5 deletions.
  1. +18 −5 autogen.sh
View
@@ -1,5 +1,18 @@
#! /bin/sh
AM_VERSION=-1.14
# modified from the freetype2 project - thank you!
check_tool_version () {
field=$2
# assume output of "[TOOL] --version" is "toolname (GNU toolname foo bar) version"
if test "$field"x = x; then
field=3 # default to 3 for all GNU autotools, after filtering enclosed string
fi
version=`$1 --version | head -1 | sed 's/([^)]*)/()/g' | cut -d ' ' -f $field`
# cut off patch from version format (major.minor.patch)
echo `echo $version | cut -d"." -f1,2`
}
AM_VERSION=`check_tool_version automake`
AC_VERSION=
set -x
@@ -8,13 +21,13 @@ if [ "x${ACLOCAL_DIR}" != "x" ]; then
ACLOCAL_ARG=-I ${ACLOCAL_DIR}
fi
${ACLOCAL:-aclocal$AM_VERSION} ${ACLOCAL_ARG}
${ACLOCAL:-aclocal-$AM_VERSION} ${ACLOCAL_ARG}
${AUTOHEADER:-autoheader$AC_VERSION}
AUTOMAKE=${AUTOMAKE:-automake$AM_VERSION} libtoolize -c --automake
${AUTOMAKE:-automake$AM_VERSION} --add-missing --copy --include-deps
AUTOMAKE=${AUTOMAKE:-automake-$AM_VERSION} libtoolize -c --automake
${AUTOMAKE:-automake-$AM_VERSION} --add-missing --copy --include-deps
${AUTOCONF:-autoconf$AC_VERSION}
# mkinstalldirs was not correctly installed in some cases.
cp -f /usr/share/automake${AM_VERSION}/mkinstalldirs .
cp -f /usr/share/automake-${AM_VERSION}/mkinstalldirs .
rm -rf autom4te.cache

0 comments on commit 565a7a0

Please sign in to comment.