]> granicus.if.org Git - php/commitdiff
Version checking for domxml. Requires >= 2.2.7 at the moment.
authorfoobar <sniper@php.net>
Fri, 8 Dec 2000 13:09:32 +0000 (13:09 +0000)
committerfoobar <sniper@php.net>
Fri, 8 Dec 2000 13:09:32 +0000 (13:09 +0000)
ext/domxml/config.m4

index e8125d20184564b934a71e1169ad9ce65be54dee..f7fd9aed099c87781332888a923e14259f87ad77 100644 (file)
@@ -1,6 +1,23 @@
 dnl $Id$
 dnl config.m4 for extension domxml
 
+AC_DEFUN(PHP_DOM_CHECK_VERSION,[
+  old_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="-I$DOMXML_DIR/include"
+  AC_MSG_CHECKING(for libxml version)
+  AC_EGREP_CPP(yes,[
+  #include <libxml/xmlversion.h>
+  #if LIBXML_VERSION >= 20207
+  yes
+  #endif
+  ],[
+    AC_MSG_RESULT(>= 2.2.7)
+  ],[
+    AC_MSG_ERROR(libxml version 2.2.7 or greater required.)
+  ])
+  CPPFLAGS=$old_CPPFLAGS
+])
+
 PHP_ARG_WITH(dom, for DOM support,
 [  --with-dom[=DIR]        Include DOM support (requires libxml >= 2.2.7).
                           DIR is the libxml install directory,
@@ -25,6 +42,8 @@ if test "$PHP_DOM" != "no"; then
     AC_MSG_ERROR(Please reinstall the libxml >= 2.2.7 distribution)
   fi
 
+  PHP_DOM_CHECK_VERSION
+
   AC_ADD_INCLUDE($DOMXML_DIR/include)
 
   PHP_SUBST(DOMXML_SHARED_LIBADD)
@@ -52,8 +71,7 @@ if test "$PHP_DOM" != "no"; then
     LIBS="$LIBS -L$withval/lib -lz"
   fi
 
-  AC_CHECK_LIB(xml, xmlFreeURI, [AC_DEFINE(HAVE_DOMXML,1,[ ])],
-    [AC_MSG_ERROR(DOM module requires libxml >= 2.2.7)])
+  AC_DEFINE(HAVE_DOMXML,1,[ ])
   AC_ADD_LIBRARY(z)
 
   PHP_EXTENSION(domxml, $ext_shared)