]> granicus.if.org Git - php/commitdiff
add config.w32 for ext/yaz
authorWez Furlong <wez@php.net>
Fri, 19 Dec 2003 16:59:09 +0000 (16:59 +0000)
committerWez Furlong <wez@php.net>
Fri, 19 Dec 2003 16:59:09 +0000 (16:59 +0000)
Edin: we need to update the yaz stuff in php-win32-dev
so that this extension will build.

ext/yaz/config.w32 [new file with mode: 0644]

diff --git a/ext/yaz/config.w32 b/ext/yaz/config.w32
new file mode 100644 (file)
index 0000000..2b208e2
--- /dev/null
@@ -0,0 +1,38 @@
+// $Id$
+// vim:ft=javascript
+
+ARG_WITH("yaz", "YAZ support (ANSI/NISO Z39.50)", "no");
+
+// this is a temporary hack
+function yaz_check_version()
+{
+       var yaz_h = PHP_PHP_BUILD + "\\include\\yaz\\yaz-version.h";
+       var c = null;
+       var v;
+       if (FSO.FileExists(yaz_h)) {
+               c = file_get_contents(yaz_h);
+               if (c.match(/YAZ_VERSIONL\s+0x([a-zA-Z0-9]{2})/)) {
+                       v = RegExp.$1;
+                       if (parseInt(v) >= 2) {
+                               return true;
+                       }
+               }
+       }
+       return false;
+}
+
+if (PHP_YAZ != "no") {
+
+       if (CHECK_HEADER_ADD_INCLUDE("yaz/yaz-version.h", "CFLAGS_YAZ", PHP_YAZ) &&
+                       CHECK_LIB("yaz.lib", "yaz", PHP_YAZ)) {
+               if (yaz_check_version()) {
+                       EXTENSION('yaz', 'php_yaz.c');
+                       AC_DEFINE('HAVE_YAZ', 1);
+               } else {
+                       WARNING("yaz not enabled; version 2.0 or higher required");
+               }
+       } else {
+               WARNING("yaz not enabled; libraries and headers not found");
+       }
+}
+