summaryrefslogtreecommitdiff
path: root/ext/xmlwriter/config.m4
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2004-07-13 17:01:30 (GMT)
committerRob Richards <rrichards@php.net>2004-07-13 17:01:30 (GMT)
commitd64a00da0449efbe8c72f3385eac377ceacc1e59 (patch)
tree020f4d09665c3f9a8ddf5daddd6b0b71e2e8a52d /ext/xmlwriter/config.m4
parent971fcd4254daaba21209556c53576640a3930495 (diff)
downloadphp-d64a00da0449efbe8c72f3385eac377ceacc1e59.tar.gz
initial xmlwriter code
Diffstat (limited to 'ext/xmlwriter/config.m4')
-rw-r--r--ext/xmlwriter/config.m461
1 files changed, 61 insertions, 0 deletions
diff --git a/ext/xmlwriter/config.m4 b/ext/xmlwriter/config.m4
new file mode 100644
index 0000000..18d6304
--- /dev/null
+++ b/ext/xmlwriter/config.m4
@@ -0,0 +1,61 @@
+dnl
+dnl $Id$
+dnl
+
+AC_DEFUN(PHP_XMLWRITER_CHECK_VERSION,[
+ old_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS=-I$XMLWRITER_DIR/include$XMLWRITER_DIR_ADD
+ AC_MSG_CHECKING(for libxml version)
+ AC_EGREP_CPP(yes,[
+#include <libxml/xmlversion.h>
+#if LIBXML_VERSION >= 20600
+ yes
+#endif
+ ],[
+ AC_MSG_RESULT(>= 2.6.0)
+ ],[
+ AC_MSG_ERROR(libxml version 2.6.0 or greater required.)
+ ])
+ CPPFLAGS=$old_CPPFLAGS
+])
+
+PHP_ARG_WITH(xmlwriter, for XMLWriter support,
+[ --with-xmlwriter Include XMLWriter support.])
+
+if test "$PHP_XMLWRITER" != "no"; then
+
+ XMLWRITER_DIR_ADD=""
+ if test -r $PHP_XMLWRITER/include/libxml2/libxml/xmlwriter.h; then
+ XMLWRITER_DIR=$PHP_XMLWRITER
+ XMLWRITER_DIR_ADD="/libxml2"
+ elif test -r $PHP_XMLWRITER/include/libxml/xmlwriter.h; then
+ XMLWRITER_DIR=$PHP_XMLWRITER
+ else
+ for i in /usr/local /usr; do
+ test -r $i/include/libxml/xmlwriter.h && XMLWRITER_DIR=$i
+ test -r $i/include/libxml2/libxml/xmlwriter.h && XMLWRITER_DIR=$i && XMLWRITER_DIR_ADD="/libxml2"
+ done
+ fi
+
+ if test -z "$XMLWRITER_DIR"; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(Please reinstall the libxml >= 2.6.0 distribution)
+ fi
+
+ PHP_XMLWRITER_CHECK_VERSION
+
+ XML2_CONFIG=$XMLWRITER_DIR/bin/xml2-config
+
+ if test -x $XML2_CONFIG; then
+ XMLWRITER_LIBS=`$XML2_CONFIG --libs`
+ PHP_EVAL_LIBLINE($XMLWRITER_LIBS, XMLWRITER_SHARED_LIBADD)
+ else
+ PHP_ADD_LIBRARY_WITH_PATH($XMLWRITER_LIBNAME, $XMLWRITER_DIR/lib, XMLWRITER_SHARED_LIBADD)
+ fi
+
+ PHP_ADD_INCLUDE($XMLWRITER_DIR/include$XMLWRITER_DIR_ADD)
+
+ AC_DEFINE(HAVE_XMLWRITER,1,[ ])
+ PHP_NEW_EXTENSION(xmlwriter, php_xmlwriter.c, $ext_shared)
+ PHP_SUBST(XMLWRITER_SHARED_LIBADD)
+fi