diff options
Diffstat (limited to 'ext/yaz')
-rw-r--r-- | ext/yaz/config.w32 | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ext/yaz/config.w32 b/ext/yaz/config.w32 new file mode 100644 index 0000000000..2b208e24d7 --- /dev/null +++ b/ext/yaz/config.w32 @@ -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"); + } +} + |