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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
dnl
dnl $Id$
dnl
AC_DEFUN(PHP_DOM_CHECK_VERSION,[
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$DOMXML_DIR/include$DOMXML_DIR_ADD
AC_MSG_CHECKING(for libxml version)
AC_EGREP_CPP(yes,[
#include <libxml/xmlversion.h>
#if LIBXML_VERSION >= 20414
yes
#endif
],[
AC_MSG_RESULT(>= 2.4.14)
],[
AC_MSG_ERROR(libxml version 2.4.14 or greater required.)
])
CPPFLAGS=$old_CPPFLAGS
])
PHP_ARG_WITH(dom, for DOM support,
[ --with-dom[=DIR] Include DOM support (requires libxml >= 2.4.14).
DIR is the libxml install directory.])
if test -z "$PHP_ZLIB_DIR"; then
PHP_ARG_WITH(zlib-dir, for the location of libz,
[ --with-zlib-dir[=DIR] DOMXML: Set the path to libz install prefix.], no, no)
fi
if test "$PHP_DOM" != "no"; then
DOMXML_DIR_ADD=""
if test -r $PHP_DOM/include/libxml2/libxml/tree.h; then
DOMXML_DIR=$PHP_DOM
DOMXML_DIR_ADD="/libxml2"
elif test -r $PHP_DOM/include/libxml/tree.h; then
DOMXML_DIR=$PHP_DOM
else
for i in /usr/local /usr; do
test -r $i/include/libxml/tree.h && DOMXML_DIR=$i
test -r $i/include/libxml2/libxml/tree.h && DOMXML_DIR=$i && DOMXML_DIR_ADD="/libxml2"
done
fi
if test -z "$DOMXML_DIR"; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Please reinstall the libxml >= 2.4.14 distribution)
fi
PHP_DOM_CHECK_VERSION
if test -f $DOMXML_DIR/lib/libxml2.a -o -f $DOMXML_DIR/lib/libxml2.$SHLIB_SUFFIX_NAME ; then
DOM_LIBNAME=xml2
else
DOM_LIBNAME=xml
fi
XML2_CONFIG=$DOMXML_DIR/bin/xml2-config
if test -x $XML2_CONFIG; then
DOM_LIBS=`$XML2_CONFIG --libs`
PHP_EVAL_LIBLINE($DOM_LIBS, DOMXML_SHARED_LIBADD)
else
PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD)
fi
PHP_ADD_INCLUDE($DOMXML_DIR/include$DOMXML_DIR_ADD)
if test "$PHP_ZLIB_DIR" = "no"; then
AC_MSG_ERROR(DOMXML requires ZLIB. Use --with-zlib-dir=<DIR>)
else
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, DOMXML_SHARED_LIBADD)
fi
AC_DEFINE(HAVE_DOMXML,1,[ ])
PHP_NEW_EXTENSION(domxml, php_domxml.c, $ext_shared)
PHP_SUBST(DOMXML_SHARED_LIBADD)
fi
AC_DEFUN(PHP_DOM_XSLT_CHECK_VERSION,[
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$DOMXSLT_DIR/include
AC_MSG_CHECKING(for libxslt version)
AC_EGREP_CPP(yes,[
#include <libxslt/xsltconfig.h>
#if LIBXSLT_VERSION >= 10018
yes
#endif
],[
AC_MSG_RESULT(>= 1.0.18)
],[
AC_MSG_ERROR(libxslt version 1.0.18 or greater required.)
])
CPPFLAGS=$old_CPPFLAGS
])
AC_DEFUN(PHP_DOM_EXSLT_CHECK_VERSION,[
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$DOMEXSLT_DIR/include
AC_MSG_CHECKING(for libexslt version)
AC_EGREP_CPP(yes,[
#include <libexslt/exsltconfig.h>
#if LIBEXSLT_VERSION >= 600
yes
#endif
],[
AC_MSG_RESULT(>= 1.0.3)
],[
AC_MSG_ERROR(libxslt version 1.0.3 or greater required.)
])
CPPFLAGS=$old_CPPFLAGS
])
PHP_ARG_WITH(dom-xslt, for DOM XSLT support,
[ --with-dom-xslt[=DIR] DOMXML: Include DOM XSLT support (requires libxslt >= 1.0.18).
DIR is the libxslt install directory.], no, no)
PHP_ARG_WITH(dom-exslt, for DOM EXSLT support,
[ --with-dom-exslt[=DIR] DOMXML: Include DOM EXSLT support (requires libxslt >= 1.0.18).
DIR is the libexslt install directory.], no, no)
if test "$PHP_DOM_XSLT" != "no"; then
if test -r $PHP_DOM_XSLT/include/libxslt/transform.h; then
DOMXSLT_DIR=$PHP_DOM_XSLT
else
for i in /usr/local /usr; do
test -r $i/include/libxslt/transform.h && DOMXSLT_DIR=$i
done
fi
if test -z "$DOMXSLT_DIR"; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Please reinstall the libxslt >= 1.0.3 distribution)
fi
PHP_DOM_XSLT_CHECK_VERSION
PHP_ADD_LIBRARY_WITH_PATH(xslt, $DOMXSLT_DIR/lib, DOMXML_SHARED_LIBADD)
PHP_ADD_INCLUDE($DOMXSLT_DIR/include)
if test "$PHP_DOM" = "no"; then
AC_MSG_ERROR(DOMXSLT requires DOMXML. Use --with-dom=<DIR>)
fi
if test -f $DOMXML_DIR/lib/libxml2.a -o -f $DOMXML_DIR/lib/libxml2.$SHLIB_SUFFIX_NAME ; then
DOM_LIBNAME=xml2
else
DOM_LIBNAME=xml
fi
PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD)
PHP_ADD_INCLUDE($DOMXML_DIR/include$DOMXML_DIR_ADD)
if test -f $DOMXML_DIR/lib/libxsltbreakpoint.a -o -f $DOMXML_DIR/lib/libxsltbreakpoint.$SHLIB_SUFFIX_NAME ; then
PHP_ADD_LIBRARY_WITH_PATH(xsltbreakpoint, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD)
fi
AC_DEFINE(HAVE_DOMXSLT,1,[ ])
PHP_SUBST(DOMXML_SHARED_LIBADD)
fi
if test "$PHP_DOM_EXSLT" != "no"; then
if test "$PHP_DOM" = "no"; then
AC_MSG_ERROR(DOMEXSLT requires DOMXML. Use --with-dom=<DIR>)
fi
if test "$PHP_DOM_XSLT" = "no"; then
AC_MSG_ERROR(DOMEXSLT requires DOMXSLT. Use --with-dom-xslt=<DIR>)
fi
if test -r $PHP_DOM_EXSLT/include/libexslt/exslt.h; then
DOMEXSLT_DIR=$PHP_DOM_EXSLT
else
for i in /usr/local /usr; do
test -r $i/include/libexslt/exslt.h && DOMEXSLT_DIR=$i
done
fi
if test -z "$DOMEXSLT_DIR"; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Please reinstall the libxslt >= 1.0.3 distribution)
fi
PHP_DOM_EXSLT_CHECK_VERSION
PHP_ADD_LIBRARY_WITH_PATH(exslt, $DOMEXSLT_DIR/lib, DOMXML_SHARED_LIBADD)
PHP_ADD_INCLUDE($DOMEXSLT_DIR/include)
AC_DEFINE(HAVE_DOMEXSLT,1,[ ])
PHP_SUBST(DOMXML_SHARED_LIBADD)
fi
|