diff options
author | Werner Lemberg <wl@gnu.org> | 2008-09-12 16:27:48 +0000 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2008-09-12 16:27:48 +0000 |
commit | b211651ac9a40f3ed2d25474dcf9a9e09c8a81dd (patch) | |
tree | 77d2f5a3c8bd1bab3ace3b402ede56bd945c9c9f /autogen.sh | |
parent | 8d3e6ecc3cf9af0d7c484960ca1dbe649245c08a (diff) | |
download | freetype2-b211651ac9a40f3ed2d25474dcf9a9e09c8a81dd.tar.gz |
* autogen.sh, builds/unix/configure.raw,
include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor
beautifying.
* include/freetype/ftadvanc.h, include/freetype/ftgasp.h,
include/freetype/ftlcdfil.h: Protect against FreeType 1.
Some other minor fixes.
* devel/ftoption.h: Synchronize with
include/freetype/config/ftoption.h.
Formatting, documentation improvements.
Diffstat (limited to 'autogen.sh')
-rw-r--r-- | autogen.sh | 101 |
1 files changed, 51 insertions, 50 deletions
diff --git a/autogen.sh b/autogen.sh index c167abb77..7e868826f 100644 --- a/autogen.sh +++ b/autogen.sh @@ -20,78 +20,78 @@ run () fi } -# extract major version get_major_version () { - echo $1 | sed -e 's/\([0-9]\+\)\..*/\1/g' + echo $1 | sed -e 's/\([0-9]\+\)\..*/\1/g' } get_minor_version () { - echo $1 | sed -e 's/[0-9]\+\.\([0-9]\+\).*/\1/g' + 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'` + # 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=`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 + patch=0 fi - echo $patch + 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 + 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 - else - if test $MAJOR1 -gt $MAJOR2; then - echo 1 - return - fi fi + fi - MINOR1=`get_minor_version $1` - MINOR2=`get_minor_version $2` - if test $MINOR1 -lt $MINOR2; then - echo 0 + 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 - else - if test $MINOR1 -gt $MINOR2; then - echo 1 - return - fi fi + fi - PATCH1=`get_patch_version $1` - PATCH2=`get_patch_version $2` - if test $PATCH1 -lt $PATCH2; then - echo 0 - else - echo 1 - 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 +# check the 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') +# $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 -# +# $5: option field index used to extract the tool version from the +# output of --version + check_tool_version () { field=$5 @@ -101,10 +101,11 @@ check_tool_version () 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 + echo "ERROR: Your version of the \`$2' tool is too old." + echo " Minimum version $4 is required (yours is version $version)." + echo " Please upgrade or use the $3 variable to point to a more recent one." + echo "" + exit 1 fi } @@ -129,9 +130,9 @@ if test "$AUTOCONF"x = x; then AUTOCONF=autoconf fi -check_tool_version $ACLOCAL aclocal ACLOCAL 1.10.1 +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 +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` |