From: Frank M. Kromann Date: Thu, 11 Mar 2004 18:48:30 +0000 (+0000) Subject: Hack to check for ming version 0.2 and 0.3 to inclue the right libs. X-Git-Tag: php-5.0.0RC1RC1~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=542dc54ce47a3f775c9df46fb7ddc642a6f91e9d;p=php Hack to check for ming version 0.2 and 0.3 to inclue the right libs. --- diff --git a/ext/ming/config.w32 b/ext/ming/config.w32 index 8185ffe784..78baa2603d 100644 --- a/ext/ming/config.w32 +++ b/ext/ming/config.w32 @@ -3,10 +3,38 @@ ARG_WITH("ming", "MING support", "no"); -if (PHP_MING != "no") { +// this is a temporary hack +function ming_check_version() +{ + var c = null; + var v; + var ming_h = CHECK_HEADER_ADD_INCLUDE("ming.h", "CFLAGS_MING", PHP_MING); + + if (!ming_h) { + return false; + } - if (CHECK_HEADER_ADD_INCLUDE("ming.h", "CFLAGS_MING", PHP_MING) && - CHECK_LIB("libming.lib", "ming", PHP_MING)) { + c = file_get_contents(ming_h + "\\ming.h"); + if (c.match(/MING_VERSION\s+(0.[a-zA-Z0-9]+)/)) { + v = RegExp.$1; + if (v > "0.2") { + if (CHECK_LIB("libungif.lib", "ming", PHP_MING) && + CHECK_LIB("libpng.lib", "ming", PHP_MING)) { + AC_DEFINE('HAVE_NEW_MING', 1); + if (PHP_ZLIB != "no") { + AC_DEFINE('HAVE_MING_ZLIB', 1); + } + } + } + } + return true; +} + +if (PHP_MING != "no") { + if (ming_check_version() && CHECK_LIB("libming.lib", "ming", PHP_MING)) { + if (PHP_ZLIB_SHARED) { + CHECK_LIB("zlib.lib", "ming", PHP_MING); + } EXTENSION('ming', 'ming.c'); AC_DEFINE('HAVE_MING', 1); } else {