2001-11-30 19:00:13 +00:00
|
|
|
dnl
|
|
|
|
dnl $Id$
|
|
|
|
dnl
|
2001-04-26 00:13:26 +00:00
|
|
|
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 +------------------------------------------------------------------------------+
|
|
|
|
|
|
|
|
PHP_ARG_ENABLE(xslt, whether to enable xslt support,
|
2001-11-30 19:00:13 +00:00
|
|
|
[ --enable-xslt Enable xslt support.])
|
2001-04-26 00:13:26 +00:00
|
|
|
|
2001-11-30 19:00:13 +00:00
|
|
|
PHP_ARG_WITH(xslt-sablot, for XSLT Sablotron backend,
|
2002-02-15 03:08:41 +00:00
|
|
|
[ --with-xslt-sablot=DIR XSLT: Enable the sablotron backend.])
|
2001-04-26 00:13:26 +00:00
|
|
|
|
2001-06-01 06:41:45 +00:00
|
|
|
PHP_ARG_WITH(expat-dir, libexpat dir for Sablotron XSL support,
|
2001-11-30 19:00:13 +00:00
|
|
|
[ --with-expat-dir=DIR XSLT: libexpat dir for Sablotron 0.50])
|
2001-04-26 00:13:26 +00:00
|
|
|
|
2002-01-17 17:21:38 +00:00
|
|
|
PHP_ARG_WITH(sablot-js, enable JavaScript for Sablotron,
|
|
|
|
[ --with-sablot-js=DIR Sablotron: enable JavaScript support for Sablotron])
|
|
|
|
|
2001-06-01 06:41:45 +00:00
|
|
|
if test "$PHP_XSLT" != "no"; then
|
2001-04-26 00:13:26 +00:00
|
|
|
|
2002-03-12 16:44:00 +00:00
|
|
|
PHP_NEW_EXTENSION(xslt, xslt.c sablot.c, $ext_shared)
|
2001-06-01 06:41:45 +00:00
|
|
|
PHP_SUBST(XSLT_SHARED_LIBADD)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2001-06-30 00:48:35 +00:00
|
|
|
if test -z "$XSLT_BACKEND_NAME"; then
|
|
|
|
AC_MSG_ERROR(No backend specified for XSLT extension.)
|
|
|
|
fi
|
|
|
|
|
2001-06-01 06:41:45 +00:00
|
|
|
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_ERROR(not found. Please re-install the $XSLT_BACKEND_NAME distribution)
|
|
|
|
fi
|
2001-04-26 00:13:26 +00:00
|
|
|
|
2001-06-01 06:41:45 +00:00
|
|
|
if test "$PHP_XSLT_SABLOT" != "no"; then
|
|
|
|
found_expat=no
|
|
|
|
for i in $PHP_EXPAT_DIR $XSLT_DIR; do
|
2002-03-21 15:49:55 +00:00
|
|
|
if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.$SHLIB_SUFFIX_NAME; then
|
2001-06-01 06:41:45 +00:00
|
|
|
AC_DEFINE(HAVE_LIBEXPAT2, 1, [ ])
|
|
|
|
PHP_ADD_INCLUDE($i/include)
|
2001-07-02 01:55:43 +00:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(expat, $i/lib, XSLT_SHARED_LIBADD)
|
2001-06-01 06:41:45 +00:00
|
|
|
found_expat=yes
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if test "$found_expat" = "no"; then
|
|
|
|
PHP_ADD_LIBRARY(xmlparse)
|
|
|
|
PHP_ADD_LIBRARY(xmltok)
|
|
|
|
fi
|
|
|
|
|
2002-03-22 13:55:11 +00:00
|
|
|
if test "$PHP_ICONV" = "no"; then
|
|
|
|
PHP_ICONV=yes
|
|
|
|
fi
|
2002-03-17 21:09:21 +00:00
|
|
|
PHP_SETUP_ICONV(XSLT_SHARED_LIBADD, [], [
|
2002-01-04 14:15:25 +00:00
|
|
|
AC_MSG_ERROR([iconv not found, in order to build sablotron you need the iconv library])
|
2002-03-17 21:09:21 +00:00
|
|
|
])
|
|
|
|
|
2002-01-17 17:21:38 +00:00
|
|
|
if test "$PHP_SABLOT_JS" != "no"; then
|
|
|
|
found_js=no
|
|
|
|
AC_CHECK_LIB(js, JS_GetRuntime, found_js=yes)
|
|
|
|
if test "$found_js" = "yes"; then
|
|
|
|
PHP_ADD_LIBRARY(js)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2001-06-01 06:41:45 +00:00
|
|
|
AC_DEFINE(HAVE_SABLOT_BACKEND, 1, [ ])
|
2001-11-25 22:20:27 +00:00
|
|
|
if test "$found_expat" = "yes"; then
|
|
|
|
old_LIBS=$LIBS
|
|
|
|
LIBS="$LIBS -lexpat"
|
|
|
|
AC_CHECK_LIB(sablot, SablotSetEncoding, AC_DEFINE(HAVE_SABLOT_SET_ENCODING, 1, [ ]))
|
|
|
|
LIBS=$old_LIBS
|
|
|
|
fi
|
2001-06-01 06:41:45 +00:00
|
|
|
fi
|
2001-04-26 00:13:26 +00:00
|
|
|
|
2001-08-02 11:19:19 +00:00
|
|
|
PHP_ADD_INCLUDE($XSLT_DIR/include)
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH($XSLT_LIBNAME, $XSLT_DIR/lib, XSLT_SHARED_LIBADD)
|
|
|
|
|
2001-06-01 06:41:45 +00:00
|
|
|
AC_DEFINE(HAVE_XSLT, 1, [ ])
|
2001-04-26 00:13:26 +00:00
|
|
|
fi
|