Skip to content

Commit 79e6063

Browse files
author
Dan Libby
committed
fix various build errors. default to no xmlrpc
1 parent 25d4500 commit 79e6063

File tree

8 files changed

+92
-180
lines changed

8 files changed

+92
-180
lines changed

ext/rpc/xmlrpc/config.m4

+40-81
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
1-
21
dnl $Id$
2+
dnl config.m4 for extension Xmlrpc
3+
34

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-
195
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])
267

8+
PHP_ARG_WITH(expat-dir, libexpat dir for XMLRPC-EPI,
9+
[ --with-expat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI])
2710

2811
if test "$PHP_XMLRPC" != "no"; then
29-
AC_DEFINE(HAVE_XMLRPC, 1, [Whether you have XMLRPC-EPI])
30-
PHP_EXTENSION(xmlrpc,$ext_shared)
3112

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
3429
AC_CHECK_LIB(c, iconv_open, found_iconv=yes)
3530
if test "$found_iconv" = "no"; then
3631
for i in /usr /usr/local $ICONV_DIR; do
@@ -42,27 +37,12 @@ dnl check for iconv
4237
fi
4338

4439
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)
4641
fi
4742

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-
6443
fi
6544

45+
6646
if test "$PHP_XMLRPC" = "yes"; then
6747
XMLRPC_CHECKS
6848
XMLRPC_LIBADD=libxmlrpc/libxmlrpc.la
@@ -73,50 +53,29 @@ if test "$PHP_XMLRPC" = "yes"; then
7353
LIB_BUILD($ext_builddir/libxmlrpc,$ext_shared,yes)
7454
PHP_ADD_INCLUDE($ext_srcdir/libxmlrpc)
7555
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
9256

93-
for i in lib lib/xmlrpc; do
94-
XMLRPC_LIB_CHK($i)
95-
done
57+
elif test "$PHP_XMLRPC" != "no"; then
9658

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
9969
fi
10070

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)
10474
fi
10575

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+
11479
fi
11580

11681

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-

ext/rpc/xmlrpc/libxmlrpc/acinclude.m4

-6
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,5 @@ AC_TYPE_SIZE_T
2828
AC_HEADER_TIME
2929
AC_TYPE_UID_T
3030
31-
XMLRPC_CHECK_ULONG
32-
XMLRPC_CHECK_UCHAR
33-
XMLRPC_CHECK_UINT
34-
XMLRPC_CHECK_INT_8_16_32
35-
36-
XMLRPC_TYPE_QSORT
3731
3832
])

ext/rpc/xmlrpc/libxmlrpc/xmlrpc.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,16 @@
4141
extern "C" {
4242
#endif
4343

44+
/* allow version to be specified via compile line define */
45+
#ifndef XMLRPC_LIB_VERSION
46+
#define XMLRPC_LIB_VERSION "0.41"
47+
#endif
48+
4449
/* this number, representing the date, must be increased each time the API changes */
4550
#define XMLRPC_API_NO 20010721
4651

4752
/* this string should be changed with each packaged release */
48-
#define XMLRPC_VERSION_STR "xmlrpc-epi v. " VERSION
53+
#define XMLRPC_VERSION_STR "xmlrpc-epi v. " XMLRPC_LIB_VERSION
4954

5055
/* where to find more info. shouldn't need to change much */
5156
#define XMLRPC_HOME_PAGE_STR "http://xmlprc-epi.sourceforge.net/"

ext/rpc/xmlrpc/libxmlrpc/xmlrpc.m4

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
CPPFLAGS="$CPPFLAGS -DVERSION=\\\"0.42\\\""
2-
31
AC_DEFUN(XMLRPC_CHECKS,[
42
53
AC_REQUIRE([AC_PROG_CC])

ext/xmlrpc/config.m4

+40-81
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
1-
21
dnl $Id$
2+
dnl config.m4 for extension Xmlrpc
3+
34

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-
195
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])
267

8+
PHP_ARG_WITH(expat-dir, libexpat dir for XMLRPC-EPI,
9+
[ --with-expat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI])
2710

2811
if test "$PHP_XMLRPC" != "no"; then
29-
AC_DEFINE(HAVE_XMLRPC, 1, [Whether you have XMLRPC-EPI])
30-
PHP_EXTENSION(xmlrpc,$ext_shared)
3112

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
3429
AC_CHECK_LIB(c, iconv_open, found_iconv=yes)
3530
if test "$found_iconv" = "no"; then
3631
for i in /usr /usr/local $ICONV_DIR; do
@@ -42,27 +37,12 @@ dnl check for iconv
4237
fi
4338

4439
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)
4641
fi
4742

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-
6443
fi
6544

45+
6646
if test "$PHP_XMLRPC" = "yes"; then
6747
XMLRPC_CHECKS
6848
XMLRPC_LIBADD=libxmlrpc/libxmlrpc.la
@@ -73,50 +53,29 @@ if test "$PHP_XMLRPC" = "yes"; then
7353
LIB_BUILD($ext_builddir/libxmlrpc,$ext_shared,yes)
7454
PHP_ADD_INCLUDE($ext_srcdir/libxmlrpc)
7555
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
9256

93-
for i in lib lib/xmlrpc; do
94-
XMLRPC_LIB_CHK($i)
95-
done
57+
elif test "$PHP_XMLRPC" != "no"; then
9658

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
9969
fi
10070

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)
10474
fi
10575

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+
11479
fi
11580

11681

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-

ext/xmlrpc/libxmlrpc/acinclude.m4

-6
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,5 @@ AC_TYPE_SIZE_T
2828
AC_HEADER_TIME
2929
AC_TYPE_UID_T
3030
31-
XMLRPC_CHECK_ULONG
32-
XMLRPC_CHECK_UCHAR
33-
XMLRPC_CHECK_UINT
34-
XMLRPC_CHECK_INT_8_16_32
35-
36-
XMLRPC_TYPE_QSORT
3731
3832
])

ext/xmlrpc/libxmlrpc/xmlrpc.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,16 @@
4141
extern "C" {
4242
#endif
4343

44+
/* allow version to be specified via compile line define */
45+
#ifndef XMLRPC_LIB_VERSION
46+
#define XMLRPC_LIB_VERSION "0.41"
47+
#endif
48+
4449
/* this number, representing the date, must be increased each time the API changes */
4550
#define XMLRPC_API_NO 20010721
4651

4752
/* this string should be changed with each packaged release */
48-
#define XMLRPC_VERSION_STR "xmlrpc-epi v. " VERSION
53+
#define XMLRPC_VERSION_STR "xmlrpc-epi v. " XMLRPC_LIB_VERSION
4954

5055
/* where to find more info. shouldn't need to change much */
5156
#define XMLRPC_HOME_PAGE_STR "http://xmlprc-epi.sourceforge.net/"

ext/xmlrpc/libxmlrpc/xmlrpc.m4

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
CPPFLAGS="$CPPFLAGS -DVERSION=\\\"0.42\\\""
2-
31
AC_DEFUN(XMLRPC_CHECKS,[
42
53
AC_REQUIRE([AC_PROG_CC])

0 commit comments

Comments
 (0)