Compiling emacs for Android. Linking GLIB

hey guys,

glad to be part of such an awesome community.

I am asking for help. I am on ubuntu and try to compile Emacs for Android.

Did anyone manage to link GLIB in emacs when building for Android? I followed instructions in this topic: Emacs packaging - #6 by repetitivestrain (btw thank you @repetitivestrain for the awesome job! :muscle:).

This is what I do just like in the linked post:

./configure --with-android=/home/mold/android-sdk/platforms/android-34/android.jar ANDROID_CC=/home/mold/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android34-clang SDK_BUILD_TOOLS=/home/mold/android-sdk/build-tools/34.0.0 --without-android-debug --with-ndk-path="$(cat $deps/search-path.txt)" --with-gif --with-xml2 --with-jpeg --with-png --with-sqlite3 --with-webp --with-gnutls --with-tiff --with-selinux --with-tree-sitter --with-harfbuzz

The search-path.txt includes a path to glib:

/home/mold/projects/test3/emacs/emacs_deps/glib-2.33.14

After the configure script I run make all and install the app on an android emulator.

In the app I go to Help → Describe Variable → I type in system-configuration-features. Emacs lists here all enabled features and my expectation was that GLIB is listed as well, like in the attached picture.

In my case all features but GLIB is listed. I do no understand why.
Am I missing smth?

Please let me know, if you had the same problem.

You haven’t all of Glib’s dependencies in your search path. It isn’t quite necessary to link to Glib as doing so confers no advantage otherwise than as one of librsvg’s mandatory dependencies.

@repetitivestrain thank you for responding! You are probably right that the GLIB library is not needed on its own but I do not even know how to test it. Additionally, I download a packaged emacs-30.1-21-x86_64.apk from Android ports for GNU Emacs - Browse Files at SourceForge.net and when I install the app on emulator, the GLIB is somehow there(see screenshot above).

I followed your instructions carefully, I have every dependency in the path($deps) and libglib_emacs.so is built in /cross/ndk-build after running make all. I assume that it is successfully linked for the RSVG library because RSVG library shows up under features.

Maybe you could give me a direction how I could link GLIB extra as a separate dependency? Maybe you have an example or some docs or some place in code where the change belongs?

In any case thank you for your time!

I build these Emacs binaries as documented in java/INSTALL. To investigate any further I need the contents of config.log and config.log.android.

@repetitivestrain thank you for the reply and awesome job with the Android port!