]> granicus.if.org Git - transmission/commitdiff
(trunk) #3949 "Add --enable-lightweight argument to configure" -- fixed.
authorJordan Lee <jordan@transmissionbt.com>
Thu, 27 Jan 2011 03:53:02 +0000 (03:53 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Thu, 27 Jan 2011 03:53:02 +0000 (03:53 +0000)
TR_EMBEDDED has been around for awhile, but few (any?) repackagers are aware of it. If it was "advertised" through a configure-time argument, and in the status messages at the end of the configure script, more repackagers would be aware of it.

configure.ac
libtransmission/rpc-server.c
libtransmission/session.c
libtransmission/utils.h

index 0817a6e1f09a92a01e6079a53ef34592efaff847..6c7be6530a1968611e604ad3fc84ca8cd9fffa2e 100644 (file)
@@ -406,6 +406,14 @@ case $host_os in
 
 esac
 
+AC_ARG_ENABLE([lightweight],
+              AS_HELP_STRING([--enable-lightweight],[optimize libtransmission for low-resource systems: smaller cache size, prefer unencrypted peer connections, etc.]),
+              [enable_lightweight=${enableval}],
+              [enable_lightweight="no"])
+if test "x$enable_lightweight" = "xyes" ; then 
+  AC_DEFINE([TR_LIGHTWEIGHT],[1],[optimize libtransmission for low-resource systems])
+fi 
+
 AC_ARG_ENABLE([cli],
               [AS_HELP_STRING([--enable-cli],[build command-line client])],
               [build_cli=${enableval}],
@@ -485,6 +493,10 @@ Configuration:
    Source code location:                              ${srcdir}
    Compiler:                                          ${CXX}
 
+   Build libtransmission:                             yes
+
+      * optimized for low-resource systems:           ${enable_lightweight}
+
    Build Command-Line client:                         ${build_cli}
 
    Build GTK+ client:                                 ${build_gtk}
index cfb4fc0d137ae00dc78ea9fb3091a98702474981..0a8f3cce0d8aa96040e8b707a74b6b4b5d05557b 100644 (file)
@@ -363,7 +363,7 @@ add_response( struct evhttp_request * req, struct tr_rpc_server * server,
 
             /* zlib's manual says: "Add 16 to windowBits to write a simple gzip header
              * and trailer around the compressed data instead of a zlib wrapper." */
-#ifdef TR_EMBEDDED
+#ifdef TR_LIGHTWEIGHT
             compressionLevel = Z_DEFAULT_COMPRESSION;
 #else
             compressionLevel = Z_BEST_COMPRESSION;
index 24edee98b25bcfd93632b62942ff4d0559bd2944..8d6813b732fff7ae10568731ba0e3e715a691583 100644 (file)
@@ -55,7 +55,11 @@ enum
 {
     SAVE_INTERVAL_SECS = 360,
 
+#ifdef TR_LIGHTWEIGHT
+    DEFAULT_CACHE_SIZE_MB = 2
+#else
     DEFAULT_CACHE_SIZE_MB = 4
+#endif
 };
 
 
@@ -251,7 +255,7 @@ tr_sessionGetPublicAddress( const tr_session * session, int tr_af_type, tr_bool
 ****
 ***/
 
-#ifdef TR_EMBEDDED
+#ifdef TR_LIGHTWEIGHT
  #define TR_DEFAULT_ENCRYPTION   TR_CLEAR_PREFERRED
 #else
  #define TR_DEFAULT_ENCRYPTION   TR_ENCRYPTION_PREFERRED
index 826d866a547944774ee9a19bda46a6eeab27dbb9..f063c85d309006e119b7e4b8518888fe8bc74fc5 100644 (file)
@@ -101,7 +101,7 @@ const char * tr_strip_positional_args( const char * fmt );
 
 /* #define DISABLE_GETTEXT */
 #ifndef DISABLE_GETTEXT
- #if defined(WIN32) || defined(TR_EMBEDDED)
+ #if defined(WIN32) || defined(TR_LIGHTWEIGHT)
    #define DISABLE_GETTEXT
  #endif
 #endif