From 4a449bae6797b5f1424162d1d8a7ddb0feacb38c Mon Sep 17 00:00:00 2001 From: rakshasa Date: Tue, 10 Apr 2007 22:36:43 +0000 Subject: [PATCH] * Added configure options that allow building universal binaries. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@889 e378c898-3ddf-0310-93e7-cc216c733640 --- configure.ac | 3 +++ scripts/common.m4 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/rpc/xmlrpc.cc | 3 +++ 3 files changed, 52 insertions(+) diff --git a/configure.ac b/configure.ac index 94602180..f19b6560 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,9 @@ AC_SYS_LARGEFILE TORRENT_CHECK_EXECINFO() TORRENT_OTFD() +TORRENT_ENABLE_ARCH +TORRENT_WITH_SYSROOT + TORRENT_WITHOUT_VARIABLE_FDSET() TORRENT_WITHOUT_NCURSESW() TORRENT_WITHOUT_STATVFS() diff --git a/scripts/common.m4 b/scripts/common.m4 index a433ad98..efd086b5 100644 --- a/scripts/common.m4 +++ b/scripts/common.m4 @@ -48,6 +48,52 @@ AC_DEFUN([TORRENT_ENABLE_EXTRA_DEBUG], [ ]) +AC_DEFUN([TORRENT_WITH_SYSROOT], [ + AC_ARG_WITH(sysroot, + [ --with-sysroot=PATH compile and link with a specific sysroot.], + [ + AC_MSG_CHECKING(for sysroot) + + if test "$withval" = "no"; then + AC_MSG_RESULT(no) + + elif test "$withval" = "yes"; then + AC_MSG_RESULT(not a path) + AC_MSG_ERROR(The sysroot option must point to a directory, like f.ex "/Developer/SDKs/MacOSX10.4u.sdk".) + else + AC_MSG_RESULT($withval) + + CXXFLAGS="$CXXFLAGS -isysroot $withval" + LDFLAGS="$LDFLAGS -Wl,-syslibroot,$withval" + fi + ]) +]) + + +AC_DEFUN([TORRENT_ENABLE_ARCH], [ + AC_ARG_ENABLE(arch, + [ --enable-arch=ARCH comma seprated list of architectures to compile for.], + [ + AC_MSG_CHECKING(for target architectures) + + if test "$enableval" = "yes"; then + AC_MSG_ERROR(no arch supplied) + + elif test "$enableval" = "no"; then + AC_MSG_RESULT(using default) + + else + AC_MSG_RESULT($enableval) + + for i in `IFS=,; echo $enableval`; do + CXXFLAGS="$CXXFLAGS -arch $i" + LDFLAGS="$LDFLAGS -arch $i" + done + fi + ]) +]) + + AC_DEFUN([TORRENT_OTFD], [ AC_LANG_PUSH(C++) AC_MSG_CHECKING(for proper overloaded template function disambiguation) diff --git a/src/rpc/xmlrpc.cc b/src/rpc/xmlrpc.cc index 7ff559de..a1a88106 100644 --- a/src/rpc/xmlrpc.cc +++ b/src/rpc/xmlrpc.cc @@ -72,6 +72,7 @@ xmlrpc_call_command(xmlrpc_env* env, xmlrpc_value* args, void* voidServerInfo) { if (env->fault_occurred) return NULL; + // Move this into a helper function. for (unsigned int i = 0; i != last; i++) { xmlrpc_value* value; xmlrpc_array_read_item(env, args, i, &value); @@ -154,6 +155,8 @@ XmlRpc::XmlRpc() : m_env(new xmlrpc_env) { xmlrpc_env_init(m_env); m_registry = xmlrpc_registry_new(m_env); + // Add a helper function for this... + xmlrpc_registry_add_method_w_doc(m_env, m_registry, NULL, "call.set_upload_rate", &xmlrpc_call_command, new server_info_t("upload_rate", &m_slotSet), "i:i", ""); xmlrpc_registry_add_method_w_doc(m_env, m_registry, NULL, "call.get_upload_rate", &xmlrpc_call_command, new server_info_t("upload_rate", &m_slotGet), "i:", "");