aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-10-02 14:35:56 +0300
committerLasse Collin <lasse.collin@tukaani.org>2009-10-02 14:35:56 +0300
commit29fd321033276261b87da7be5223db33d879a4c7 (patch)
tree0f8d551186d41e06a72e291a8db6ed66cd78bb3a /configure.ac
parentUse unaligned access (if possible) on both endiannesses (diff)
downloadxz-29fd321033276261b87da7be5223db33d879a4c7.tar.xz
Add support for --enable-assume-ram=SIZE.
Diffstat (limited to '')
-rw-r--r--configure.ac24
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index c576d224..d4a51ffd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -380,6 +380,30 @@ AC_MSG_RESULT([$enable_threads])
# We use the actual result a little later.
+#########################
+# Assumed amount of RAM #
+#########################
+
+# We use 32 MiB as default, because it should be small enough for most
+# cases and allows decompressing files compressed with the default settings.
+# Probably it is too small for most systems, but it's safer to guess too low.
+AC_MSG_CHECKING([how much RAM to assume if the real amount is unknown])
+AC_ARG_ENABLE([assume-ram], AC_HELP_STRING([--enable-assume-ram=SIZE],
+ [If and only if the real amount of RAM cannot be determined,
+ assume SIZE MiB. The default is 32 MiB. This affects the
+ default memory usage limit.]),
+ [], [enable_assume_ram=32])
+assume_ram_check=`echo "$enable_assume_ram" | tr -d 0123456789`
+if test -z "$enable_assume_ram" || test -n "$assume_ram_check"; then
+ AC_MSG_RESULT([])
+ AC_MSG_ERROR([--enable-assume-ram accepts only an integer argument])
+fi
+AC_MSG_RESULT([$enable_assume_ram MiB])
+AC_DEFINE_UNQUOTED([ASSUME_RAM], [$enable_assume_ram],
+ [How many MiB of RAM to assume if the real amount cannot
+ be determined.])
+
+
############################################
# xz/xzdec/lzmadec linkage against liblzma #
############################################