Skip to content

Commit

Permalink
Fix libgmp for Android
Browse files Browse the repository at this point in the history
Android terminated immediately after start since commit
181f7ba
because library wasn't loaded, and libminetest.so required
libgmp.so.10 instead of libgmp.so.

The second issue has been solved by the linker flags.
  • Loading branch information
est31 committed May 15, 2015
1 parent be18bd6 commit 33a633a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build/android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ CURL_URL_HTTP = http://curl.haxx.se/download/curl-${CURL_VERSION}.tar.bz2

GMP_VERSION = 6.0.0
GMP_DIR = $(ROOT)/deps/gmp-$(GMP_VERSION)
GMP_LIB = $(GMP_DIR)/usr/lib/libgmp.la
GMP_LIB = $(GMP_DIR)/usr/lib/libgmp.so
GMP_TIMESTAMP = $(GMP_DIR)/timestamp
GMP_TIMESTAMP_INT = $(ROOT)/deps/gmp_timestamp
GMP_URL_HTTP = https://gmplib.org/download/gmp/gmp-$(GMP_VERSION).tar.bz2
Expand Down Expand Up @@ -602,6 +602,8 @@ $(GMP_LIB): $(GMP_TIMESTAMP)
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
export CC=${CROSS_PREFIX}gcc; \
export CXX=${CROSS_PREFIX}g++; \
export LIBGMP_LDFLAGS="-avoid-version"; \
export LIBGMPXX_LDFLAGS="-avoid-version"; \
./configure --disable-static --host=${TARGET_HOST} --prefix=/usr; \
$(MAKE) install DESTDIR=/${GMP_DIR} || exit 1; \
touch ${GMP_TIMESTAMP}; \
Expand Down
6 changes: 6 additions & 0 deletions build/android/src/net/minetest/minetest/MtNativeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ protected void onActivityResult(int requestCode, int resultCode,
System.loadLibrary("vorbis");
System.loadLibrary("ssl");
System.loadLibrary("crypto");
System.loadLibrary("gmp");

// We don't have to load libminetest.so ourselves,
// but if we do, we get nicer logcat errors when
// loading fails.
System.loadLibrary("minetest");
}

private int m_MessagReturnCode;
Expand Down

0 comments on commit 33a633a

Please sign in to comment.