]> granicus.if.org Git - php/commitdiff
Hack to check for ming version 0.2 and 0.3 to inclue the right libs.
authorFrank M. Kromann <fmk@php.net>
Thu, 11 Mar 2004 18:48:30 +0000 (18:48 +0000)
committerFrank M. Kromann <fmk@php.net>
Thu, 11 Mar 2004 18:48:30 +0000 (18:48 +0000)
ext/ming/config.w32

index 8185ffe784fbded189cc2d15edb3d8ea62025187..78baa2603d42ffc4a3acb8be0577fe311819d07b 100644 (file)
@@ -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 {