php-src/ext/domxml/config.m4

77 lines
1.9 KiB
Plaintext
Raw Normal View History

1999-11-24 06:21:48 +00:00
dnl $Id$
dnl config.m4 for extension domxml
1999-11-24 06:21:48 +00:00
AC_DEFUN(PHP_DOM_CHECK_VERSION,[
old_CPPFLAGS=$CPPFLAGS
2001-05-12 11:09:05 +00:00
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,
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,
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
else
AC_MSG_CHECKING(for DOM in default path)
for i in /usr/local /usr; do
if test -r $i/include/libxml/tree.h; then
DOMXML_DIR=$i
AC_MSG_RESULT(found in $i)
fi
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)
fi
PHP_DOM_CHECK_VERSION
PHP_ADD_INCLUDE($DOMXML_DIR/include)
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
else
2001-05-12 11:09:05 +00:00
DOM_LIBNAME=xml
fi
PHP_SUBST(DOMXML_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD)
2001-05-10 00:59:41 +00:00
if test "$PHP_ZLIB" = "no"; then
AC_MSG_CHECKING([for zlib (needed by DOM support)])
2001-05-10 00:59:41 +00:00
AC_CHECK_LIB(z,deflate, [
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, DOMXML_SHARED_LIBADD)
],[
AC_MSG_ERROR(libz.(a|so) not found! Try with --with-zlib-dir=<DIR>)
],[
2001-05-10 00:59:41 +00:00
-L$PHP_ZLIB_DIR/lib
])
2001-05-10 00:59:41 +00:00
else
2000-11-23 09:56:18 +00:00
echo "checking for libz needed by libxml ... already zlib support"
2001-05-10 00:59:41 +00:00
PHP_ADD_LIBRARY(z,, DOMXML_SHARED_LIBADD)
fi
AC_DEFINE(HAVE_DOMXML,1,[ ])
PHP_EXTENSION(domxml, $ext_shared)
fi