summaryrefslogtreecommitdiff
path: root/ext/xsl/config.m4
blob: 13290409ac293787725f79420fc408fdb50fe916 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
dnl
dnl $Id$
dnl

PHP_ARG_WITH(xsl, for XSL support,
[  --with-xsl[=DIR]        Include new XSL support (requires libxslt >= 1.0.18).
                          DIR is the libxslt install directory.])

if test "$PHP_XSL" != "no" -a "$PHP_DOM" = "no"; then
  AC_MSG_ERROR([XSL extension requires DOM extension, add --enable-dom.])
fi

if test "$PHP_XSL" != "no"; then

  for i in $PHP_XSL /usr/local /usr; do
    if test -x "$i/bin/xslt-config"; then
      XSLT_CONFIG=$i/bin/xslt-config
      break
    fi
  done

  if test -z "$XSLT_CONFIG"; then
    AC_MSG_ERROR([xslt-config not found. Please reinstall the libxslt >= 1.0.18 distribution])
  else
    libxslt_full_version=`$XSLT_CONFIG --version`
    ac_IFS=$IFS
    IFS="."
    set $libxslt_full_version
    IFS=$ac_IFS
    LIBXSLT_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
    if test "$LIBXSLT_VERSION" -ge "1000018"; then
      XSL_LIBS=`$XSLT_CONFIG --libs`
      XSL_INCS=`$XSLT_CONFIG --cflags`
      PHP_EVAL_LIBLINE($XSL_LIBS, XSL_SHARED_LIBADD)
      PHP_EVAL_INCLINE($XSL_INCS)
      
      AC_MSG_CHECKING([for EXSLT support])
      for i in $PHP_XSL /usr/local /usr; do
        if test -r "$i/include/libexslt/exslt.h"; then
          PHP_XSL_EXSL_DIR=$i
          break
        fi
      done
      if test -z "$PHP_XSL_EXSL_DIR"; then
        AC_MSG_RESULT(not found)
      else 
        AC_MSG_RESULT(found)
        PHP_ADD_LIBRARY_WITH_PATH(exslt, $PHP_XSL_EXSL_DIR/lib, XSL_SHARED_LIBADD)
        PHP_ADD_INCLUDE($PHP_XSL_EXSL_DIR/include)
        AC_DEFINE(HAVE_XSL_EXSLT,1,[ ])
      fi
    else
      AC_MSG_ERROR([libxslt version 1.0.18 or greater required.])
    fi
    
  
  fi
  
  AC_DEFINE(HAVE_XSL,1,[ ])
  PHP_NEW_EXTENSION(xsl, php_xsl.c xsltprocessor.c, $ext_shared)
  PHP_SUBST(XSL_SHARED_LIBADD)
fi