Fix Android base (no-gui) compilation (PR #26539)

31 views
Skip to first unread message

phantomhugo

unread,
May 31, 2026, 12:30:26 PM (3 days ago) May 31
to wx-...@googlegroups.com, Subscribed

Hello, this fixes the android compilation with no GUI with a straight configure. I know android is not officially supported but I see no harm in allowing easy use of wxBase classes. For anyone who wants to test the commands I used were:

export NDK=~/Android/Sdk/ndk/29.0.14206865
export HOST_TAG=linux-x86_64
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG
export AR=$TOOLCHAIN/bin/llvm-ar
export AS=$TOOLCHAIN/bin/llvm-as
export CC=$TOOLCHAIN/bin/x86_64-linux-android35-clang
export CXX=$TOOLCHAIN/bin/x86_64-linux-android35-clang++
export LD=$TOOLCHAIN/bin/ld.lld
export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
export STRIP=$TOOLCHAIN/bin/llvm-strip
CXX_FLAGS=-fno-keep-inline-dllexport
./configure --disable-gui --with-zlib=builtin --with-regex=builtin --enable-intl --prefix=${NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/35/ --host x86_64-linux-android
make -j12
make install

I tested targeting android x64 and arm64. I did my best to avoid messing with other platforms but let me know any extra fix that is needed.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26539

Commit Summary

  • 4110803 Removed unneeded files for android compilation
  • bfa7aa6 Removed unneeded files for android compilation
  • e9601f6 Adjustments to buildin zlib due to missing header
  • 539d35a Android compiles sckaddr
  • 5ebbbbf Added link to log on android

File Changes

(10 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539@github.com>

VZ

unread,
May 31, 2026, 2:07:44 PM (3 days ago) May 31
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26539)

Thanks, any work on wxAndroid is welcome but I am not sure that deleting the existing files is a step in right direction as they could be used for compilation under Windows and I just don't see why do they need to be removed.

I also have big reservations about -include unistd.h, I'd expect zlib to compile without hacks like this under Android and I hope there is some better way.

Also, as you can see, this broke a few CI builds and this needs to be fixed, of course.

Speaking of CI jobs, if we can make wxAndroid build at all, it would be very useful to add a CI job building it because this is the only way to prevent it from getting broken again in the future.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539/c4587598268@github.com>

phantomhugo

unread,
May 31, 2026, 7:53:20 PM (3 days ago) May 31
to wx-...@googlegroups.com, Push

@phantomhugo pushed 1 commit.

  • a85ee31 Do not force the inclusion of unistd


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539/before/5ebbbbfcaf9472ac1248b5d0496e638f5adabe2b/after/a85ee31411007e1df3f13c490432ba3e34df4ddf@github.com>

phantomhugo

unread,
May 31, 2026, 8:22:02 PM (3 days ago) May 31
to wx-...@googlegroups.com, Push

@phantomhugo pushed 1 commit.


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539/before/a85ee31411007e1df3f13c490432ba3e34df4ddf/after/aeae436923246e8bcd415321726486ed97b38ac6@github.com>

phantomhugo

unread,
May 31, 2026, 8:39:48 PM (3 days ago) May 31
to wx-...@googlegroups.com, Push

@phantomhugo pushed 1 commit.

  • eb5dcbd Removed unneded check for autoconf 2.69


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539/before/aeae436923246e8bcd415321726486ed97b38ac6/after/eb5dcbde1643c04d71b6ab172c6738e4ec00c57a@github.com>

phantomhugo

unread,
May 31, 2026, 9:34:44 PM (3 days ago) May 31
to wx-...@googlegroups.com, Subscribed
phantomhugo left a comment (wxWidgets/wxWidgets#26539)

Hello @vadz thank you for taking the time to review this. I was trying to make the compilation as easy as possible, but you are right, the forced inclusion of unistd is a hack and the same results can be achieved with export CFLAGS="-include unistd.h" or using an external zlib, so I reverted that specific change.

Regarding the deleted files, those are all related with android and I think are not needed on modern NDKs as all those values can be achieved via running configure or cmake, and even in one of those files the content was ignored via preprocessor when building wxQt for android. If you still think is better to avoid the deletion I can restore the files and just remove the lines that use it.

I have fixed the issues on the CI/CD by regenerating the configure script with autoconf 2.69.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539/c4588920948@github.com>

VZ

unread,
Jun 1, 2026, 8:19:46 AM (2 days ago) Jun 1
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26539)

Regarding the deleted files, those are all related with android and I think are not needed on modern NDKs as all those values can be achieved via running configure or cmake

The setup.h files are supposed to be used for build systems without configuration step, e.g. when using MSVS or Xcode. Now I'm not really sure if wxAndroid can be built without configure/CMake but I think there was a way to do it using MSVS in the past. So for me it would be easier to leave these files alone and just avoid including them when using configure or CMake if necessary.

I have fixed the issues on the CI/CD by regenerating the configure script with autoconf 2.69.

It's probably too late, but we have instructions in build/tools/autoconf/README.md about configure regeneration.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539/c4592503770@github.com>

phantomhugo

unread,
Jun 1, 2026, 2:51:36 PM (2 days ago) Jun 1
to wx-...@googlegroups.com, Push

@phantomhugo pushed 2 commits.

  • 8c11616 Restored deleted files
  • f730157 Regenerated configure with documented instructions


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539/before/eb5dcbde1643c04d71b6ab172c6738e4ec00c57a/after/f730157050e38b02f88ab982ec385f2169a98e5d@github.com>

phantomhugo

unread,
Jun 1, 2026, 2:55:19 PM (2 days ago) Jun 1
to wx-...@googlegroups.com, Subscribed
phantomhugo left a comment (wxWidgets/wxWidgets#26539)

The setup.h files are supposed to be used for build systems without configuration step, e.g. when using MSVS or Xcode. Now I'm not really sure if wxAndroid can be built without configure/CMake but I think there was a way to do it using MSVS in the past. So for me it would be easier to leave these files alone and just avoid including them when using configure or CMake if necessary.

Done.

It's probably too late, but we have instructions in build/tools/autoconf/README.md about configure regeneration.

Not too late, I'm sorry I miss that. I have regenerated the configure script with the instructions given.

Let me know if you have any other concern or suggestion.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539/c4595555378@github.com>

VZ

unread,
Jun 1, 2026, 5:23:25 PM (2 days ago) Jun 1
to wx-...@googlegroups.com, Subscribed

@vadz approved this pull request.

Sorry for change of mind, but after searching more carefully and looking at 1b4bff8 which was the only commit that affected this, I finally agree that wx/android/setup.h and config_android.h are not needed, so I'll finally remove them just as you did.

I'll merge this soon, thanks.


In include/wx/platform.h:

> @@ -141,11 +141,6 @@
 
 #endif /* (__WXGTK__ || __WXQT__) && __WINDOWS__ */
 
-#ifdef __ANDROID__

Oh, sorry, I do agree that it doesn't make sense to keep the config_android.h file if it's not included from anywhere any more. I thought we'd modify the condition here in some way, e.g.

#if defined(__ANDROID__) && !defined(wxHAVE_SETUP_H)

(wxHAVE_SETUP_H is not currently defined, but we could easily define it).


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539/review/4404765068@github.com>

VZ

unread,
Jun 1, 2026, 5:48:58 PM (2 days ago) Jun 1
to wx-...@googlegroups.com, Subscribed

Closed #26539 via c52190e.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26539/issue_event/26208640079@github.com>

Reply all
Reply to author
Forward
0 new messages