瀏覽代碼

Add --with-disk-cache configure option

Enables packagers more fine grained control over the default value
without having to mess with config files.

See GH-115
Nils Maier 12 年之前
父節點
當前提交
303f987ee9
共有 2 個文件被更改,包括 9 次插入0 次删除
  1. 5 0
      configure.ac
  2. 4 0
      src/OptionHandlerFactory.cc

+ 5 - 0
configure.ac

@@ -54,6 +54,11 @@ AC_ARG_WITH([ca-bundle],
   AS_HELP_STRING([--with-ca-bundle=FILE],[Use FILE as default CA bundle.]),
   [ca_bundle=$withval], [ca_bundle=""])
 
+AC_ARG_WITH([disk-cache],
+  AS_HELP_STRING([--with-disk-cache=SIZE],[Use SIZE as the default disk-cache size.]),
+  [AC_DEFINE_UNQUOTED([DEFAULT_DISK_CACHE], ["$withval"], [Define to choose default disk-cache size])],
+  [])
+
 AC_ARG_WITH([bashcompletiondir],
   AS_HELP_STRING([--with-bashcompletiondir=DIR],
                  [Directory to install bash_completion file]),

+ 4 - 0
src/OptionHandlerFactory.cc

@@ -210,7 +210,11 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
     OptionHandler* op(new UnitNumberOptionHandler
                       (PREF_DISK_CACHE,
                        TEXT_DISK_CACHE,
+#ifdef DEFAULT_DISK_CACHE
+                       DEFAULT_DISK_CACHE,
+#else
                        "16M",
+#endif
                        0));
     op->addTag(TAG_ADVANCED);
     handlers.push_back(op);