diff --git a/config.lib b/config.lib index dbe8d5a702..5e399bf2eb 100644 --- a/config.lib +++ b/config.lib @@ -443,9 +443,9 @@ detect_params() { CFLAGS=* | --CFLAGS=*) CFLAGS="$optarg";; CXXFLAGS=* | --CXXFLAGS=*) CXXFLAGS="$optarg";; LDFLAGS=* | --LDFLAGS=*) LDFLAGS="$optarg";; - CFLAGS_BUILD=* | --CFLAGS_BUILD=*) CFLAGS_BUILD="$optarg";; - CXXFLAGS_BUILD=* | --CXXFLAGS_BUILD=*) CXXFLAGS_BUILD="$optarg";; - LDFLAGS_BUILD=* | --LDFLAGS_BUILD=*) LDFLAGS_BUILD="$optarg";; + CFLAGS_BUILD=* | --CFLAGS_BUILD=* | --CFLAGS-BUILD=*) CFLAGS_BUILD="$optarg";; + CXXFLAGS_BUILD=* | --CXXFLAGS_BUILD=* | --CXXFLAGS-BUILD=*) CXXFLAGS_BUILD="$optarg";; + LDFLAGS_BUILD=* | --LDFLAGS_BUILD=* | --LDFLAGS-BUILD=*) LDFLAGS_BUILD="$optarg";; --ignore-extra-parameters) ignore_extra_parameters="1";; @@ -2138,6 +2138,30 @@ check_makedepend() { log 1 "checking makedepend... $makedepend" } +check_version() { + # $1 - requested version (major.minor) + # $2 - version we got (major.minor) + + if [ -z "$2" ]; then + return 0 + fi + + req_major=`echo $1 | cut -d. -f1` + got_major=`echo $2 | cut -d. -f1` + if [ $got_major -lt $req_major ]; then + return 0 + elif [ $got_major -gt $req_major ]; then + return 1 + fi + + req_minor=`echo $1 | cut -d. -f2` + got_minor=`echo $2 | cut -d. -f2` + if [ $got_minor -lt $req_minor ]; then + return 0 + fi + return 1 +} + detect_awk() { # Not all awks allow gsub(), so we test for that here! It is in fact all we need... @@ -2823,13 +2847,14 @@ detect_fontconfig() { version=`$fontconfig_config --modversion 2>/dev/null` ret=$? - shortversion=`echo $version | cut -c 1,3` + check_version '2.3' "$version" + version_ok=$? log 2 "executing $fontconfig_config --modversion" log 2 " returned $version" log 2 " exit code $ret" - if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$shortversion" -le "22" ]; then - if [ -n "$shortversion" ] && [ "$shortversion" -le "22" ]; then + if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$version_ok" != "1" ]; then + if [ -n "$version" ] && [ "$version_ok" != "1" ]; then log 1 "checking libfontconfig... needs at least version 2.3.0, fontconfig NOT enabled" else log 1 "checking libfontconfig... not found" @@ -2872,13 +2897,14 @@ detect_icu() { version=`$icu_config --version 2>/dev/null` ret=$? - shortversion=`echo $version | cut -d\. -f1,2 | sed "s/\.//g" | cut -c1-2` + check_version '3.6' "$version" + version_ok=$? log 2 "executing $icu_config --version" log 2 " returned $version" log 2 " exit code $ret" - if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$shortversion" -lt "36" ]; then - if [ -n "$shortversion" ] && [ "$shortversion" -lt "36" ]; then + if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$version_ok" != "1" ]; then + if [ -n "$version" ] && [ "$version_ok" != "1" ]; then log 1 "checking libicu... needs at least version 3.6.0, icu NOT enabled" else log 1 "checking libicu... not found" diff --git a/src/bootstrap_gui.cpp b/src/bootstrap_gui.cpp index 2b3e231b29..a9459f967f 100644 --- a/src/bootstrap_gui.cpp +++ b/src/bootstrap_gui.cpp @@ -218,7 +218,7 @@ bool HandleBootstrap() if (BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() == 0) goto failure; /* If there is no network or no freetype, then there is nothing we can do. Go straight to failure. */ -#if defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) && !defined(__APPLE__) +#if defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) && !defined(__APPLE__) && (defined(WITH_FONTCONFIG) || defined(WIN32)) if (!_network_available) goto failure; /* First tell the game we're bootstrapping. */ diff --git a/src/strings.cpp b/src/strings.cpp index 181ac83108..a0391af99f 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -62,6 +62,24 @@ void StringParameters::ClearTypeInformation() MemSetT(this->type, 0, this->num_param); } + +/** + * Read an int64 from the argument array. The offset is increased + * so the next time GetInt64 is called the next value is read. + */ +int64 StringParameters::GetInt64(WChar type) +{ + if (this->offset >= this->num_param) { + DEBUG(misc, 0, "Trying to read invalid string parameter"); + return 0; + } + if (this->type != NULL) { + assert(this->type[this->offset] == 0 || this->type[this->offset] == type); + this->type[this->offset] = type; + } + return this->data[this->offset++]; +} + /** * Shift all data in the data array by the given amount to make * room for some extra parameters. @@ -781,7 +799,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg } int i = 0; - while (*p != '\0') { + while (*p != '\0' && i < 20) { uint64 param; s = ++p; diff --git a/src/strings_func.h b/src/strings_func.h index eef78d84e4..395a80e1a1 100644 --- a/src/strings_func.h +++ b/src/strings_func.h @@ -73,19 +73,7 @@ public: void ClearTypeInformation(); - /** - * Read an int64 from the argument array. The offset is increased - * so the next time GetInt64 is called the next value is read. - */ - int64 GetInt64(WChar type = 0) - { - assert(this->offset < this->num_param); - if (this->type != NULL) { - assert(this->type[this->offset] == 0 || this->type[this->offset] == type); - this->type[this->offset] = type; - } - return this->data[this->offset++]; - } + int64 GetInt64(WChar type = 0); /** Read an int32 from the argument array. @see GetInt64. */ int32 GetInt32(WChar type = 0)