summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorDavid Turner <david@freetype.org>2008-09-01 21:35:21 +0000
committerDavid Turner <david@freetype.org>2008-09-01 21:35:21 +0000
commit28534d616be45a45767e5cfa65164a863d068eea (patch)
tree6712bf0ecf33fb8ecd1029ef85e535a9ecdf58ff /autogen.sh
parent7981fe2a0f9b79d384e98e8868bdeeaf9ec6b5f0 (diff)
downloadfreetype2-28534d616be45a45767e5cfa65164a863d068eea.tar.gz
* include/freetype/ftadvanc.h, src/base/ftadvanc.c,
include/freetype/config/ftheader.h, include/freetype/freetype.h, src/base/Jamfile, src/base/rules.mk, src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffgload.h, src/truetype/ttdriver.c, src/truetype/ttgload.h, src/truetype/ttgload.c, src/type1/t1driver.c, src/type1/t1gload.h, src/type1/t1gload.c: Add a new header named FT_ADVANCES_H declaring some new APIs to extract the advances of one or more glyphs without necessarily loading their outlines. Also provide 'fast loaders' for the TrueType, Type1 and CFF font drivers (more to come later) * autogen.sh: add checks for minimum version of the 'autotools' stuff.
Diffstat (limited to 'autogen.sh')
-rw-r--r--autogen.sh120
1 files changed, 110 insertions, 10 deletions
diff --git a/autogen.sh b/autogen.sh
index 87f30a1ca..c167abb77 100644
--- a/autogen.sh
+++ b/autogen.sh
@@ -20,12 +20,119 @@ run ()
fi
}
+# extract major version
+get_major_version ()
+{
+ echo $1 | sed -e 's/\([0-9]\+\)\..*/\1/g'
+}
+
+get_minor_version ()
+{
+ echo $1 | sed -e 's/[0-9]\+\.\([0-9]\+\).*/\1/g'
+}
+
+get_patch_version ()
+{
+ # tricky, some version numbers don't include a patch
+ # separated with a point, but something like 1.4-p6
+ #
+ patch=`echo $1 | sed -e 's/[0-9]\+\.[0-9]\+\.\([0-9]\+\).*/\1/g'`
+ if test "$patch" = "$1"; then
+ patch=`echo $1 | sed -e 's/[0-9]\+\.[0-9]\+\-p\([0-9]\+\).*/\1/g'`
+ # if there isn't any patch number, default to 0
+ if test "$patch" = "$1"; then
+ patch=0
+ fi
+ fi
+ echo $patch
+}
+
+# $1: version to check
+# $2: minimum version
+compare_to_minimum_version ()
+{
+ MAJOR1=`get_major_version $1`
+ MAJOR2=`get_major_version $2`
+ if test $MAJOR1 -lt $MAJOR2; then
+ echo 0
+ return
+ else
+ if test $MAJOR1 -gt $MAJOR2; then
+ echo 1
+ return
+ fi
+ fi
+
+ MINOR1=`get_minor_version $1`
+ MINOR2=`get_minor_version $2`
+ if test $MINOR1 -lt $MINOR2; then
+ echo 0
+ return
+ else
+ if test $MINOR1 -gt $MINOR2; then
+ echo 1
+ return
+ fi
+ fi
+
+ PATCH1=`get_patch_version $1`
+ PATCH2=`get_patch_version $2`
+ if test $PATCH1 -lt $PATCH2; then
+ echo 0
+ else
+ echo 1
+ fi
+}
+
+
+# check that version of a given tool against a minimum version number
+# $1: tool path
+# $2: tool usual name (e.g. 'aclocal')
+# $3: tool variable (e.g. 'ACLOCAL')
+# $4: minimum version to check against
+# $5: option field index used to extract the tool version from the output of --version
+#
+check_tool_version ()
+{
+ field=$5
+ if test "$field"x = x; then
+ field=4 # default to 4 for all GNU autotools
+ fi
+ version=`$1 --version | head -1 | cut -d ' ' -f $field`
+ version_check=`compare_to_minimum_version $version $4`
+ if test "$version_check"x = 0x; then
+ echo "ERROR: You $2 version is too old. minimum version $4 is required (yours is $version)"
+ echo "please upgrade or use the $3 variable to point to a more recent one"
+ echo ""
+ exit 1
+ fi
+}
+
if test ! -f ./builds/unix/configure.raw; then
- echo "You must be in the same directory as \`autogen.sh'."
- echo "Bootstrapping doesn't work if srcdir != builddir."
- exit 1
+ echo "You must be in the same directory as \`autogen.sh'."
+ echo "Bootstrapping doesn't work if srcdir != builddir."
+ exit 1
+fi
+
+# On MacOS X, the GNU libtool is named `glibtool'.
+HOSTOS=`uname`
+LIBTOOLIZE=libtoolize
+if test "$HOSTOS"x = Darwinx; then
+ LIBTOOLIZE=glibtoolize
+fi
+
+if test "$ACLOCAL"x = x; then
+ ACLOCAL=aclocal
fi
+if test "$AUTOCONF"x = x; then
+ AUTOCONF=autoconf
+fi
+
+check_tool_version $ACLOCAL aclocal ACLOCAL 1.10.1
+check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4
+check_tool_version $AUTOCONF autoconf AUTOCONF 2.62
+
# This sets freetype_major, freetype_minor, and freetype_patch.
eval `sed -nf version.sed include/freetype/freetype.h`
@@ -40,13 +147,6 @@ echo "generating \`configure.ac'"
sed -e "s;@VERSION@;$freetype_major$freetype_minor$freetype_patch;" \
< configure.raw > configure.ac
-# On MacOS X, the GNU libtool is named `glibtool'.
-HOSTOS=`uname`
-LIBTOOLIZE=libtoolize
-if test "$HOSTOS"x = Darwinx; then
- LIBTOOLIZE=glibtoolize
-fi
-
run aclocal -I . --force
run $LIBTOOLIZE --force --copy --install
run autoconf --force