summaryrefslogtreecommitdiff
path: root/ext/xslt/config.m4
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2001-04-26 00:13:26 +0000
committerSterling Hughes <sterling@php.net>2001-04-26 00:13:26 +0000
commit35890db0a1be8c3539cc99b4813cbd98c0f007f7 (patch)
tree831a9ea348515aa4f773b6d52ecfca392b25d8ed /ext/xslt/config.m4
parent073fa0ee737d12266617073210768dc406c194a4 (diff)
downloadphp-git-35890db0a1be8c3539cc99b4813cbd98c0f007f7.tar.gz
Add an experimental version of the new XSLT extension. This is by no means
to be used on anything production, if you want to test it, beware, it may or may not work (feel free to complain to me if it doesn't work, or shower praise if it does work)... Mainly in PHP's CVS so that work on the other backends can take place. The api (function_entry) is what I'm thinking of for all backends. Every backend simply needs to define these functions, I'll send an e-mail describing all this in a bit....
Diffstat (limited to 'ext/xslt/config.m4')
-rw-r--r--ext/xslt/config.m481
1 files changed, 81 insertions, 0 deletions
diff --git a/ext/xslt/config.m4 b/ext/xslt/config.m4
new file mode 100644
index 0000000000..f1685069b1
--- /dev/null
+++ b/ext/xslt/config.m4
@@ -0,0 +1,81 @@
+dnl config.m4 for extension xslt
+dnl +------------------------------------------------------------------------------+
+dnl | This is where the magic of the extension reallly is. Depending on what |
+dnl | backend the user chooses, this script performs the magic |
+dnl +------------------------------------------------------------------------------+
+dnl $Id$
+
+PHP_ARG_ENABLE(xslt, whether to enable xslt support,
+[ --enable-xslt Enable xslt support])
+
+PHP_ARG_WITH(xslt-sablot, whether to enable the sablotron backend,
+[ --with-xslt-sablot Enable the sablotron backend])
+
+PHP_ARG_WITH(expat-dir, for Sablotron XSL support,
+[ --with-expat-dir=DIR Sablotron: libexpat dir for Sablotron 0.50])
+
+if test "$PHP_XSLT" != "no"; then
+ if test "$PHP_XSLT_SABLOT" != "no"; then
+ XSLT_CHECK_DIR=$PHP_XSLT_SABLOT
+ XSLT_TEST_FILE=/include/sablot.h
+ XSLT_BACKEND_NAME=Sablotron
+ XSLT_LIBNAME=sablot
+ fi
+
+ condition="$XSLT_CHECK_DIR$XSLT_TEST_FILE"
+
+ if test -r $condition; then
+ XSLT_DIR=$XSLT_CHECK_DIR
+ else
+ AC_MSG_CHECKING(for $XSLT_BACKEND_NAME libraries in the default path)
+ for i in /usr /usr/local; do
+ condition="$i$XSLT_TEST_FILE"
+ if test -r $condition; then
+ XSLT_DIR=$i
+ AC_MSG_RESULT(found $XSLT_BACKEND_NAME in $i)
+ fi
+ done
+ fi
+
+ if test -z "$XSLT_DIR"; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(Please re-install the $XSLT_BACKEND_NAME distribution)
+ fi
+
+
+ if test -z "$XSLT_DIR"; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(Please re-install the $XSLT_BACKEND distribution)
+ fi
+
+ PHP_ADD_INCLUDE($XSLT_DIR/include)
+
+ PHP_SUBST(XSLT_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH($XSLT_LIBNAME, $XSLT_DIR/lib, XSLT_SHARED_LIBADD)
+
+ if test "$PHP_XSLT_SABLOT" != "no"; then
+ if test -z "$PHP_EXPAT_DIR"; then
+ PHP_EXPAT_DIR=""
+ fi
+
+ found_expat=no
+ for i in $PHP_EXPAT_DIR $XSLT_DIR; do
+ if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.so; then
+ AC_DEFINE(HAVE_LIBEXPAT2, 1, [ ])
+ PHP_ADD_LIBRARY_WITH_PATH(expat, $i/lib)
+ found_expat=yes
+ fi
+ done
+
+ if test "$found_expat" = "no"; then
+ PHP_ADD_LIBRARY(xmlparse)
+ PHP_ADD_LIBRARY(xmltok)
+ fi
+
+ AC_DEFINE(HAVE_SABLOT, 1, [ ])
+ AC_CHECK_LIB(sablot, SablotSetEncoding, AC_DEFINE(HAVE_SABLOT_SET_ENCODING, 1, [ ]))
+ fi
+
+ AC_DEFINE(HAVE_XSLT, 1, [ ])
+ PHP_EXTENSION(xslt, $ext_shared)
+fi