1
-
2
1
dnl $Id$
2
+ dnl config.m4 for extension Xmlrpc
3
+
3
4
4
- sinclude ( ext/xmlrpc/libxmlrpc/acinclude.m4 )
5
- sinclude ( ext/xmlrpc/libxmlrpc/xmlrpc.m4 )
6
- sinclude ( libxmlrpc/acinclude.m4 )
7
- sinclude ( libxmlrpc/xmlrpc.m4 )
8
-
9
- AC_DEFUN ( XMLRPC_LIB_CHK ,[
10
- str="$XMLRPC_DIR/$1 /libxmlrpc.*"
11
- for j in `echo $str`; do
12
- if test -r $j; then
13
- XMLRPC_LIB_DIR=$XMLRPC_DIR/$1
14
- break 2
15
- fi
16
- done
17
- ] )
18
-
19
5
PHP_ARG_WITH(xmlrpc, for XMLRPC-EPI support,
20
- [ --with-xmlrpc[ =DIR] Include XMLRPC-EPI support. DIR is the XMLRPC-EPI base
21
- directory. If unspecified, the bundled XMLRPC-EPI library
22
- will be used.] , yes)
23
-
24
- PHP_ARG_WITH(expat-dir, libexpat dir for XMLRPC-EPI
25
- [ --with-expat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI] )
6
+ [ --with-xmlrpc[ =DIR] Include XMLRPC-EPI support] )
26
7
8
+ PHP_ARG_WITH(expat-dir, libexpat dir for XMLRPC-EPI,
9
+ [ --with-expat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI] )
27
10
28
11
if test "$PHP_XMLRPC" != "no"; then
29
- AC_DEFINE ( HAVE_XMLRPC , 1 , [ Whether you have XMLRPC-EPI] )
30
- PHP_EXTENSION(xmlrpc,$ext_shared)
31
12
32
- dnl check for iconv
33
- found_iconv=no
13
+ PHP_EXTENSION(xmlrpc, $ext_shared)
14
+ PHP_SUBST(XMLRPC_SHARED_LIBADD)
15
+ AC_DEFINE ( HAVE_XMLRPC ,1 ,[ ] )
16
+
17
+ testval=no
18
+ for i in $PHP_EXPAT_DIR $XMLRPC_DIR; do
19
+ if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.s?; then
20
+ AC_DEFINE ( HAVE_LIBEXPAT2 ,1 ,[ ] )
21
+ PHP_ADD_LIBRARY_WITH_PATH(expat, $i/lib, XMLRPC_SHARED_LIBADD)
22
+ PHP_ADD_INCLUDE($i/include)
23
+ testval=yes
24
+ fi
25
+ done
26
+
27
+
28
+ dnl found_iconv=no
34
29
AC_CHECK_LIB ( c , iconv_open , found_iconv=yes )
35
30
if test "$found_iconv" = "no"; then
36
31
for i in /usr /usr/local $ICONV_DIR; do
@@ -42,27 +37,12 @@ dnl check for iconv
42
37
fi
43
38
44
39
if test "$found_iconv" = "no"; then
45
- AC_MSG_ERROR ( iconv not found , in order to build XMLRPC-EPI you need the iconv library )
40
+ AC_MSG_ERROR ( iconv not found , in order to build xmlrpc you need the iconv library )
46
41
fi
47
42
48
- dnl check for expat
49
- testval=no
50
- for i in $PHP_EXPAT_DIR; do
51
- if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.s?; then
52
- AC_DEFINE ( HAVE_LIBEXPAT2 ,1 ,[ ] )
53
- PHP_ADD_LIBRARY_WITH_PATH(expat, $i/lib, XMLRPC_SHARED_LIBADD)
54
- PHP_ADD_INCLUDE($i/include)
55
- testval=yes
56
- fi
57
- done
58
-
59
- if test "$testval" = "no"; then
60
- PHP_ADD_LIBRARY(xmlparse)
61
- PHP_ADD_LIBRARY(xmltok)
62
- fi
63
-
64
43
fi
65
44
45
+
66
46
if test "$PHP_XMLRPC" = "yes"; then
67
47
XMLRPC_CHECKS
68
48
XMLRPC_LIBADD=libxmlrpc/libxmlrpc.la
@@ -73,50 +53,29 @@ if test "$PHP_XMLRPC" = "yes"; then
73
53
LIB_BUILD($ext_builddir/libxmlrpc,$ext_shared,yes)
74
54
PHP_ADD_INCLUDE($ext_srcdir/libxmlrpc)
75
55
XMLRPC_MODULE_TYPE=builtin
76
- elif test "$PHP_XMLRPC" != "no"; then
77
- for i in $PHP_XMLRPC; do
78
- if test -r $i/include/xmlrpc/xmlrpc.h; then
79
- XMLRPC_DIR=$i
80
- XMLRPC_INC_DIR=$i/include/xmlrpc
81
- elif test -r $i/include/xmlrpc.h; then
82
- XMLRPC_DIR=$i
83
- XMLRPC_INC_DIR=$i/include
84
- fi
85
- done
86
-
87
- if test -z "$XMLRPC_DIR"; then
88
- AC_MSG_ERROR ( Cannot find header files under $PHP_XMLRPC )
89
- fi
90
-
91
- XMLRPC_MODULE_TYPE=external
92
56
93
- for i in lib lib/xmlrpc; do
94
- XMLRPC_LIB_CHK($i)
95
- done
57
+ elif test "$PHP_XMLRPC" != "no"; then
96
58
97
- if test -z "$XMLRPC_LIB_DIR"; then
98
- AC_MSG_ERROR ( Cannot find xmlrpc library under $XMLRPC_DIR )
59
+ if test -r $PHP_XMLRPC/include/xmlrpc.h; then
60
+ XMLRPC_DIR=$PHP_XMLRPC
61
+ else
62
+ AC_MSG_CHECKING ( for XMLRPC-EPI in default path )
63
+ for i in /usr/local /usr; do
64
+ if test -r $i/include/xmlrpc.h; then
65
+ XMLRPC_DIR=$i
66
+ AC_MSG_RESULT ( found in $i )
67
+ fi
68
+ done
99
69
fi
100
70
101
- if test "$PHP_ZLIB_DIR" != "no "; then
102
- PHP_ADD_LIBRARY(z,, XMLRPC_SHARED_LIBADD )
103
- XMLRPC_LIBS="-L$PHP_ZLIB_DIR -z"
71
+ if test -z "$XMLRPC_DIR "; then
72
+ AC_MSG_RESULT ( not found )
73
+ AC_MSG_ERROR ( Please reinstall the XMLRPC-EPI distribution )
104
74
fi
105
75
106
- PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_LIB_DIR, XMLRPC_SHARED_LIBADD)
107
- XMLRPC_LIBS="-L$XMLRPC_LIB_DIR -lxmlrpc $XMLRPC_LIBS"
108
-
109
- PHP_ADD_INCLUDE($XMLRPC_INC_DIR)
110
- XMLRPC_INCLUDE="-I$XMLRPC_INC_DIR"
111
-
112
- else
113
- XMLRPC_MODULE_TYPE=none
76
+ PHP_ADD_INCLUDE($XMLRPC_DIR/include)
77
+ PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_DIR/lib, XMLRPC_SHARED_LIBADD)
78
+
114
79
fi
115
80
116
81
117
- PHP_SUBST(XMLRPC_SHARED_LIBADD)
118
- PHP_SUBST_OLD(XMLRPC_MODULE_TYPE)
119
- PHP_SUBST_OLD(XMLRPC_LIBS)
120
- PHP_SUBST_OLD(XMLRPC_INCLUDE)
121
-
122
-
0 commit comments