Merge branch 'master' of ssh://git.onelab.eu/git/plcapi
[plcapi.git] / php / xmlrpc / config.m4.lib64
1 dnl
2 dnl $Id$
3 dnl
4
5 sinclude(ext/xmlrpc/libxmlrpc/acinclude.m4)
6 sinclude(ext/xmlrpc/libxmlrpc/xmlrpc.m4)
7 sinclude(libxmlrpc/acinclude.m4)
8 sinclude(libxmlrpc/xmlrpc.m4)
9
10 PHP_ARG_WITH(xmlrpc, for XMLRPC-EPI support,
11 [  --with-xmlrpc[=DIR]     Include XMLRPC-EPI support.])
12
13 PHP_ARG_WITH(expat-dir, libexpat dir for XMLRPC-EPI,
14 [  --with-expat-dir=DIR      XMLRPC-EPI: libexpat dir for XMLRPC-EPI.],no,no)
15
16 PHP_ARG_WITH(iconv-dir, iconv dir for XMLRPC-EPI,
17 [  --with-iconv-dir=DIR      XMLRPC-EPI: iconv dir for XMLRPC-EPI.],no,no)
18
19 if test "$PHP_XMLRPC" != "no"; then
20
21   PHP_SUBST(XMLRPC_SHARED_LIBADD)
22   AC_DEFINE(HAVE_XMLRPC,1,[ ])
23
24   testval=no
25   for i in $PHP_EXPAT_DIR $XMLRPC_DIR /usr/local /usr; do
26     if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.$SHLIB_SUFFIX_NAME; then
27       AC_DEFINE(HAVE_LIBEXPAT2,1,[ ])
28       PHP_ADD_LIBRARY_WITH_PATH(expat, $i/lib, XMLRPC_SHARED_LIBADD)
29       PHP_ADD_INCLUDE($i/include)
30       testval=yes
31       break
32     fi
33   done
34
35   if test "$testval" = "no"; then
36     AC_MSG_ERROR(XML-RPC support requires libexpat. Use --with-expat-dir=<DIR>)
37   fi
38
39   if test "$PHP_ICONV_DIR" != "no"; then
40     PHP_ICONV=$PHP_ICONV_DIR
41   fi
42   
43   if test "$PHP_ICONV" = "no"; then
44     PHP_ICONV=yes
45   fi
46   
47   PHP_SETUP_ICONV(XMLRPC_SHARED_LIBADD, [], [
48     AC_MSG_ERROR([iconv not found, in order to build xmlrpc you need the iconv library])
49   ])
50 fi
51
52
53 if test "$PHP_XMLRPC" = "yes"; then
54   XMLRPC_CHECKS
55   PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c libxmlrpc/base64.c \
56           libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \
57           libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \
58           libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \
59           libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \
60           libxmlrpc/xml_to_soap.c,$ext_shared,,
61           -I@ext_srcdir@/libxmlrpc -DVERSION="0.50")
62   PHP_ADD_BUILD_DIR($ext_builddir/libxmlrpc)
63   XMLRPC_MODULE_TYPE=builtin
64
65 elif test "$PHP_XMLRPC" != "no"; then
66
67   if test -r $PHP_XMLRPC/include/xmlrpc.h; then
68     XMLRPC_DIR=$PHP_XMLRPC/include
69   elif test -r $PHP_XMLRPC/include/xmlrpc-epi/xmlrpc.h; then
70 dnl some xmlrpc-epi header files have generic file names like
71 dnl queue.h or base64.h. Distributions have to create dir
72 dnl for xmlrpc-epi because of this.
73     XMLRPC_DIR=$PHP_XMLRPC/include/xmlrpc-epi
74   else
75     AC_MSG_CHECKING(for XMLRPC-EPI in default path)
76     for i in /usr/local /usr; do
77       if test -r $i/include/xmlrpc.h; then
78         XMLRPC_DIR=$i/include
79         AC_MSG_RESULT(found in $i)
80         break
81       fi
82     done
83   fi
84
85   if test -z "$XMLRPC_DIR"; then
86     AC_MSG_RESULT(not found)
87     AC_MSG_ERROR(Please reinstall the XMLRPC-EPI distribution)
88   fi
89
90   PHP_ADD_INCLUDE($XMLRPC_DIR)
91   PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_DIR/lib, XMLRPC_SHARED_LIBADD)
92 fi
93