1999-11-24 06:21:48 +00:00
|
|
|
dnl $Id$
|
2000-10-18 22:17:41 +00:00
|
|
|
dnl config.m4 for extension domxml
|
1999-11-24 06:21:48 +00:00
|
|
|
|
2000-12-08 13:09:32 +00:00
|
|
|
AC_DEFUN(PHP_DOM_CHECK_VERSION,[
|
|
|
|
old_CPPFLAGS=$CPPFLAGS
|
2001-05-12 11:09:05 +00:00
|
|
|
CPPFLAGS=-I$DOMXML_DIR/include
|
2000-12-08 13:09:32 +00:00
|
|
|
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
|
|
|
|
])
|
|
|
|
|
2000-10-18 22:17:41 +00:00
|
|
|
PHP_ARG_WITH(dom, for DOM support,
|
2000-12-07 10:04:18 +00:00
|
|
|
[ --with-dom[=DIR] Include DOM support (requires libxml >= 2.2.7).
|
1999-11-24 06:21:48 +00:00
|
|
|
DIR is the libxml install directory,
|
2000-10-18 22:17:41 +00:00
|
|
|
defaults to /usr.])
|
1999-11-24 06:21:48 +00:00
|
|
|
|
2000-10-19 12:10:59 +00:00
|
|
|
if test "$PHP_DOM" != "no"; then
|
1999-11-24 06:21:48 +00:00
|
|
|
|
2000-10-19 12:10:59 +00:00
|
|
|
if test -r $PHP_DOM/include/libxml/tree.h; then
|
|
|
|
DOMXML_DIR=$PHP_DOM
|
2000-10-18 22:17:41 +00:00
|
|
|
else
|
|
|
|
for i in /usr/local /usr; do
|
2001-07-27 14:02:44 +00:00
|
|
|
test -r $i/include/libxml/tree.h && DOMXML_DIR=$i
|
2000-10-18 22:17:41 +00:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$DOMXML_DIR"; then
|
|
|
|
AC_MSG_RESULT(not found)
|
2000-12-07 10:04:18 +00:00
|
|
|
AC_MSG_ERROR(Please reinstall the libxml >= 2.2.7 distribution)
|
2000-10-18 22:17:41 +00:00
|
|
|
fi
|
|
|
|
|
2000-12-08 13:09:32 +00:00
|
|
|
PHP_DOM_CHECK_VERSION
|
|
|
|
|
2001-01-29 23:15:11 +00:00
|
|
|
if test -f $DOMXML_DIR/lib/libxml2.a -o -f $DOMXML_DIR/lib/libxml2.s? ; then
|
2001-05-12 11:09:05 +00:00
|
|
|
DOM_LIBNAME=xml2
|
2001-01-29 23:15:11 +00:00
|
|
|
else
|
2001-05-12 11:09:05 +00:00
|
|
|
DOM_LIBNAME=xml
|
2001-01-29 23:15:11 +00:00
|
|
|
fi
|
|
|
|
|
2001-03-27 20:35:04 +00:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD)
|
2001-07-27 14:02:44 +00:00
|
|
|
PHP_ADD_INCLUDE($DOMXML_DIR/include)
|
2000-10-18 22:17:41 +00:00
|
|
|
|
2001-05-20 23:00:44 +00:00
|
|
|
if test "$PHP_ZLIB_DIR" = "no"; then
|
|
|
|
AC_MSG_ERROR(DOMXML requires ZLIB. Use --with-zlib-dir=<DIR>)
|
2001-07-27 14:02:44 +00:00
|
|
|
else
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, DOMXML_SHARED_LIBADD)
|
2000-10-18 22:17:41 +00:00
|
|
|
fi
|
2001-07-27 14:02:44 +00:00
|
|
|
|
2000-12-08 13:09:32 +00:00
|
|
|
AC_DEFINE(HAVE_DOMXML,1,[ ])
|
2000-10-18 22:17:41 +00:00
|
|
|
PHP_EXTENSION(domxml, $ext_shared)
|
2001-07-27 14:02:44 +00:00
|
|
|
PHP_SUBST(DOMXML_SHARED_LIBADD)
|
2000-10-18 22:17:41 +00:00
|
|
|
fi
|