summaryrefslogtreecommitdiff
path: root/src/backends/xmlrpc/configure-sub.in
blob: 19fb17686d4a132cc7d2080d067df891f7750a76 (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
dnl -*- mode: Autoconf; -*-
dnl Invoke autogen.sh to produce a configure script.

dnl Checks for required libraries.
dnl
dnl This is from the sqlite backend:
dnl PKG_CHECK_MODULES(SQLITE, sqlite3, SQLITEFOUND=yes, [SQLITEFOUND=no])
dnl AC_SUBST(SQLITE_CFLAGS)
dnl AC_SUBST(SQLITE_LIBS)

dnl No pkg-config available for xmlrpc-c
dnl PKG_CHECK_MODULES(XMLRPC,xmlrpc-c,XMLRPCFOUND=yes, [XMLRPCFOUND=no])

dnl name of backend library (there could be more than one per directory),
dnl name of the directory,
dnl help string,
dnl --enable/disable chosen explicitly
dnl default, may depend on availability of prerequisites in more complex backends
SE_ARG_ENABLE_BACKEND(xmlrpc,
                      xmlrpc,
                      [AS_HELP_STRING([--enable-xmlrpc],
                                      [enable XMLRPC-based backend which stores items on a central web service (default off)])],
                      [enable_xmlrpc="$enableval"],
                      [enable_xmlrpc="no"]
                     )

if test "$enable_xmlrpc" = "yes"; then
        dnl It's good to check the prerequisites here, in case --enable-xmlrpc was used.
        dnl test "x${SQLITEFOUND}" = "xyes" || AC_MSG_ERROR([--enable-sqlite requires pkg-config information for sqlite3, which was not found])

        AC_PATH_PROG([XMLRPC_C_CONFIG], [xmlrpc-c-config], [no])

        test "x$XMLRPC_C_CONFIG" != 'xno' || AC_MSG_ERROR([--enable-xmlrpc requires xmlrpc-c-config, which was not found])

        XMLRPC_CFLAGS=`$XMLRPC_C_CONFIG c++2 client --cflags`
        XMLRPC_LIBS=`$XMLRPC_C_CONFIG c++2 client --libs`
        AC_SUBST(XMLRPC_CFLAGS)
        AC_SUBST(XMLRPC_LIBS)

        dnl If additional compile flags are necessary to include the header
        dnl files of the backend, then add them here.
        BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $XMLRPC_CFLAGS"

        AC_DEFINE(ENABLE_XMLRPC, 1, [XMLRPC available])
fi