# # SYNOPSIS # # AX_SAGA_CHECK_XMLRPC([MINIMUM-VERSION]) # # DESCRIPTION # # Test for the XMLRPC libraries of a particular version (or newer) # # If no path to the installed xmlrpc library is given, # the macro searchs under /usr, /usr/local, /opt and # /usr/local/package/xmlrpc-* # # This macro calls: # # AC_SUBST(HAVE_XMLRPC) # AC_SUBST(XMLRPC_LOCATION) # AC_SUBST(XMLRPC_CPPFLAGS) # AC_SUBST(XMLRPC_LDFLAGS) # # LAST MODIFICATION # # 2007-03-04 # # COPYLEFT # # Copyright (c) 2007 Andre Merzky # # Copying and distribution of this file, with or without # modification, are permitted in any medium without royalty provided # the copyright notice and this notice are preserved. AC_DEFUN([AX_SAGA_CHECK_XMLRPC], [ AC_ARG_VAR([XMLRPC_LOCATION],[XMLRPC installation directory]) HAVE_XMLRPC=no tmp_location="" AC_ARG_WITH([xmlrpc], AS_HELP_STRING([--with-xmlrpc=DIR], [use xmlrpc (default is YES) at DIR (optional)]), [ if test "$withval" = "no"; then want_xmlrpc="no" elif test "$withval" = "yes"; then want_xmlrpc="yes" tmp_location="" else want_xmlrpc="yes" tmp_location="$withval" fi ], [want_xmlrpc="yes"]) # use XMLRPC_LOCATION if avaialble, and if not # overwritten by --with-xmlrpc= if test "x$want_xmlrpc" = "xyes"; then # unused # xmlrpc_lib_version_req=ifelse([$1], ,0.8.6,$1) packages=`ls /usr/local/package/xmlrpc-* 2>>/dev/null` for tmp_path in $tmp_location $XMLRPC_LOCATION /usr /usr/local /opt $packages; do AC_MSG_CHECKING(for xmlrpc in $tmp_path) saved_cppflags=$CPPFLAGS saved_ldflags=$LDFLAGS XMLRPC_PATH=$tmp_path XMLRPC_LDFLAGS="-L$tmp_path/lib/ -lxmlrpc++" XMLRPC_CPPFLAGS="-I$tmp_path/include/" CPPFLAGS="$CPPFLAGS $XMLRPC_CPPFLAGS" export CPPFLAGS LDFLAGS="$LDFLAGS $XMLRPC_LDFLAGS" export LDFLAGS AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], [[ XmlRpc::XmlRpcClient c ("localhost", 1234); return (0); ]])], link_xmlrpc="yes", link_xmlrpc="no") if test "x$link_xmlrpc" = "xno"; then AC_MSG_RESULT(no) LDFLAGS=$saved_ldflags CPPFLAGS=$saved_cppflags else AC_MSG_RESULT(yes) XMLRPC_LOCATION=$tmp_path HAVE_XMLRPC=yes export HAVE_XMLRPC AC_SUBST(HAVE_XMLRPC) AC_SUBST(XMLRPC_LOCATION) AC_SUBST(XMLRPC_CPPFLAGS) AC_SUBST(XMLRPC_LDFLAGS) if test "$tmp_location" != "" && \ test "$tmp_location" != "$tmp_path" ; then AC_MSG_WARN([XMLRPC found: not in $tmp_location but in $tmp_path]) fi break; fi # link ok done # foreach path if test "$HAVE_XMLRPC" == "no" ; then AC_MSG_WARN(XMLRPC not found) fi fi # want_xmlrpc ])