summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-03-19 10:08:26 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-23 09:19:04 +0100
commit149792414e767c7526123f0e2abb7c4dc9491fa0 (patch)
treedd02cc39ef44cb797f4e1ae04bce480fe593cfee /configure.ac
parent718143b55ca9163f49fa7e86f677e3e83226a9fc (diff)
android: add a check for the installed memory in the machine
... and just error out with < 16G and all symbols. Should help newcomers who have e.g. 8GB of memory, build with dbgutil, but then unable to complete the build as the linker never finishes. Change-Id: I9f3ad5c6d76a18d6aa5b0b2d61aa115ed441b8e3
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index d9f0c70031c8..69688b5b6d6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3858,6 +3858,18 @@ else
fi
AC_SUBST(ENABLE_SYMBOLS)
+if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
+ # Building on Android with full symbols: without enough memory the linker never finishes currently.
+ AC_MSG_CHECKING([whether enough memory is available for linking])
+ mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
+ # Check for 15GB, as Linux reports a bit less than the physical memory size.
+ if test -n "$mem_size" -a $mem_size -lt 15728640; then
+ AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
+ else
+ AC_MSG_RESULT([yes])
+ fi
+fi
+
# Debug information format for iOS. Running dsymutil takes a long time... you really need a separate
# .dSYM only if running Instruments, I think. (Not for normal debugging in Xcode.) To enable a
# separate .dSYM, either use --enable-release-build or change manually to "DWARF with DSYM" in Xcode.