Compiling wxWidgets 3.1.1 in Termux

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
igavronski
Knows some wx things
Knows some wx things
Posts: 30
Joined: Mon Jul 15, 2019 12:52 pm

Compiling wxWidgets 3.1.1 in Termux

Post by igavronski » Mon Jul 15, 2019 1:27 pm

I want to compile wxWidgets in Termux, a distro that runs under Android. I am deeply sorry for the cross-posting. I started a similar thread in the Termux github page (https://github.com/termux/x11-packages/issues/112), but folks there did not respond. I am following the instructions from the Audacity page (that's my end goal), here: https://wiki.audacityteam.org/wiki/Building_On_Linux

I downloaded the source for wx 3.1.1 here:

Code: Select all

git clone --recurse-submodules https://github.com/audacity/wxWidgets/
My last attempt (see the github post for the complete history of attempts) was:

../configure --with-gtk=2 --enable-cmdline --enable-monolithic --with-expat=builtin
...

Code: Select all

Configured wxWidgets 3.1.1 for `aarch64-unknown-linux-gnu'

  Which GUI toolkit should wxWidgets use?                 GTK+ 2 with support for GTK+ printing libnotify
  Should wxWidgets be compiled into single library?       yes
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets support Unicode?                       yes (using wchar_t)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.8      no
                                       wxWidgets 3.0      yes
  Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               sys
                                       png                sys
                                       regex              builtin
                                       tiff               sys
                                       zlib               sys
                                       expat              builtin
                                       libmspack          no
                                       sdl                no
This time, I had to fix the overloaded operator in the following sources: ../src/common/{cmdline fmapbase fileconf}.cpp, replacing [0u] by [(size_t)ou]

This time, the output of make -j8 install goes like this:

Code: Select all

In file included from ../src/common/string.cpp:39:
../include/wx/xlocale.h:251:18: error: use of undeclared identifier 'strtoul_l'
        { return wxCRT_Strtoul_lA(c, endptr, base, loc.Get()); }
                 ^
../include/wx/xlocale.h:244:46: note: expanded from macro 'wxCRT_Strtoul_lA'
    #define wxCRT_Strtoul_lA wxXLOCALE_IDENT(strtoul_l)
                                             ^
../include/wx/xlocale.h:305:22: error: use of undeclared identifier 'wcstod_l'; did you mean 'wcstold_l'?
            { return wxCRT_Strtod_lW(c, endptr, loc.Get()); }
                     ^~~~~~~~~~~~~~~
                     wcstold_l
../include/wx/xlocale.h:300:49: note: expanded from macro 'wxCRT_Strtod_lW'
        #define wxCRT_Strtod_lW wxXLOCALE_IDENT(wcstod_l)
                                                ^
../include/wx/xlocale.h:59:39: note: expanded from macro 'wxXLOCALE_IDENT'
        #define wxXLOCALE_IDENT(name) name
                                      ^
/data/data/com.termux/files/usr/include/wchar.h:191:13: note: 'wcstold_l' declared here
long double wcstold_l(const wchar_t* __s, wchar_t** __end_ptr, locale_t __l) __INTRODUCED_IN(21);
            ^
In file included from ../src/common/string.cpp:39:
../include/wx/xlocale.h:307:22: error: use of undeclared identifier 'wcstol_l'; did you mean 'wcstoll_l'?
            { return wxCRT_Strtol_lW(c, endptr, base, loc.Get()); }
                     ^~~~~~~~~~~~~~~
                     wcstoll_l
../include/wx/xlocale.h:301:49: note: expanded from macro 'wxCRT_Strtol_lW'
        #define wxCRT_Strtol_lW wxXLOCALE_IDENT(wcstol_l)
                                                ^
../include/wx/xlocale.h:59:39: note: expanded from macro 'wxXLOCALE_IDENT'
        #define wxXLOCALE_IDENT(name) name
                                      ^
/data/data/com.termux/files/usr/include/wchar.h:189:11: note: 'wcstoll_l' declared here
long long wcstoll_l(const wchar_t* __s, wchar_t** __end_ptr, int __base, locale_t __l) __INTRODUCED_IN(21);
          ^
In file included from ../src/common/string.cpp:39:
../include/wx/xlocale.h:309:22: error: use of undeclared identifier 'wcstoul_l'
            { return wxCRT_Strtoul_lW(c, endptr, base, loc.Get()); }
                     ^
../include/wx/xlocale.h:302:50: note: expanded from macro 'wxCRT_Strtoul_lW'
        #define wxCRT_Strtoul_lW wxXLOCALE_IDENT(wcstoul_l)
                                                 ^
4 errors generated.
make: *** [Makefile:16191: monodll_string.o] Error 1
make: *** Waiting for unfinished jobs....
Per your request, this is platform and compiler:

Code: Select all

$ uname -a
Linux localhost 4.4.141-perf+ #1 SMP PREEMPT Sun Jun 23 13:09:29 CST 2019 aarch64 Android
$ make --version
GNU Make 4.2.1
Built for aarch64-unknown-linux-android
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ g++ --version
clang version 8.0.0 (tags/RELEASE_800/final)
Target: aarch64-unknown-linux-android
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin
I need some guidance regarding the flags for the configure command. Any help is appreciated.

catalin
Moderator
Moderator
Posts: 1525
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Compiling wxWidgets 3.1.1 in Termux

Post by catalin » Mon Jul 15, 2019 2:15 pm

Why not use regular build instructions for Linux? i.e.
- get sources from https://github.com/wxWidgets/wxWidgets
- follow instructions from https://docs.wxwidgets.org/trunk/plat_gtk_install.html

Aside from that, IIRC functions taking wchar_t are not available under Android, so you might need to use utf8 build there. Configure has --enable-utf8 and --enable-utf8only. I guess the latter is needed, but try it yourself.

igavronski
Knows some wx things
Knows some wx things
Posts: 30
Joined: Mon Jul 15, 2019 12:52 pm

Re: Compiling wxWidgets 3.1.1 in Termux

Post by igavronski » Mon Jul 15, 2019 5:15 pm

I have to admit that I tried to find the wx 3.1.1 in the site you point to, but no luck. Could you please point me to the 3.1.1 sources?

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3464
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Compiling wxWidgets 3.1.1 in Termux

Post by ONEEYEMAN » Mon Jul 15, 2019 5:55 pm

Hi,
You can the source code from the http://www.wxwidgets.org/downloads/.

However it will be the 3.1.2 version, which is the latest development release.

Thank you.

igavronski
Knows some wx things
Knows some wx things
Posts: 30
Joined: Mon Jul 15, 2019 12:52 pm

Re: Compiling wxWidgets 3.1.1 in Termux

Post by igavronski » Mon Jul 15, 2019 5:58 pm

In this case, I will have to stick with the Audacity fork, which is 3.1.1.
Is there any problem with that?

DavidHart
Site Admin
Site Admin
Posts: 3887
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Compiling wxWidgets 3.1.1 in Termux

Post by DavidHart » Mon Jul 15, 2019 6:34 pm

Hi,

Earlier tarballs are available too e.g. https://github.com/wxWidgets/wxWidgets/ ... tag/v3.1.1

Regards,

David

igavronski
Knows some wx things
Knows some wx things
Posts: 30
Joined: Mon Jul 15, 2019 12:52 pm

Re: Compiling wxWidgets 3.1.1 in Termux

Post by igavronski » Mon Jul 15, 2019 6:52 pm

Hi,

I used the configuration as:

Code: Select all

../configure --with-gtk=2 --enable-cmdline --enable-monolithic --with-expat=builtin --enable-stl --with-sdl --enable-utf8
This is the final message from configure:

Code: Select all


Configured wxWidgets 3.1.1 for `aarch64-unknown-linux-gnu'

  Which GUI toolkit should wxWidgets use?                 GTK+ 2 with support for GTK+ printing libnotify
  Should wxWidgets be compiled into single library?       yes
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets support Unicode?                       yes (using UTF-8)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.8      no
                                       wxWidgets 3.0      yes
  Which libraries should wxWidgets use?
                                       STL                yes
                                       jpeg               sys
                                       png                sys
                                       regex              builtin
                                       tiff               sys
                                       zlib               sys
                                       expat              builtin
                                       libmspack          no
                                       sdl                yes

$ 
As you can see, the Unicode support moved to UTF-8, as suggested.

However, the build problems persist.

All the build messages are attached.
make.out.txt
Output of the make command above.
(724.94 KiB) Downloaded 7 times

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3464
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Compiling wxWidgets 3.1.1 in Termux

Post by ONEEYEMAN » Mon Jul 15, 2019 7:05 pm

Hi,
Could you please check the config.log file and see whether the test for strtoul_l(), succeeded?

Thank you.

igavronski
Knows some wx things
Knows some wx things
Posts: 30
Joined: Mon Jul 15, 2019 12:52 pm

Re: Compiling wxWidgets 3.1.1 in Termux

Post by igavronski » Mon Jul 15, 2019 7:15 pm

Hi,

There is no test for strtoul_l(), only strtoull (are the same?)

See output:

Code: Select all

configure:22708: checking for strtoull
configure:22735: g++ -o conftest   -llog -v --system-header-prefix=/data/data/com.termux/files/usr conftest.cpp  -lm >&5
clang version 8.0.0 (tags/RELEASE_800/final)
Target: aarch64-unknown-linux-android
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin
 "/data/data/com.termux/files/usr/bin/clang-8" -cc1 -triple aarch64-unknown-linux-android -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name conftest.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mthread-model posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu generic -target-feature +neon -target-abi aapcs -mllvm -aarch64-fix-cortex-a53-835769=1 -fallow-half-arguments-and-returns -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /data/data/com.termux/files/usr/lib/clang/8.0.0 --system-header-prefix=/data/data/com.termux/files/usr -internal-isystem /data/data/com.termux/files/usr/bin/../include/c++/v1 -internal-isystem /data/data/com.termux/files/usr/include/aarch64-linux-android -internal-isystem /usr/local/include -internal-isystem /data/data/com.termux/files/usr/lib/clang/8.0.0/include -internal-externc-isystem /data/data/com.termux/files/usr/include -fdeprecated-macro -fdebug-compilation-dir /data/data/com.termux/files/home/wxWidgets/gtk -ferror-limit 19 -fmessage-length 0 -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o /data/data/com.termux/files/usr/tmp/conftest-989d86.o -x c++ conftest.cpp
clang -cc1 version 8.0.0 based upon LLVM 8.0.0 default target aarch64-linux-android
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
 /data/data/com.termux/files/usr/bin/../include/c++/v1
 /data/data/com.termux/files/usr/include/aarch64-linux-android
 /data/data/com.termux/files/usr/lib/clang/8.0.0/include
 /data/data/com.termux/files/usr/include
End of search list.
conftest.cpp:92:19: warning: expression result unused [-Wunused-value]
                  &strtoull;
                  ^~~~~~~~~
1 warning generated.
 "/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld" -pie -EL --fix-cortex-a53-843419 -z now -z relro -z max-page-size=4096 --hash-style=both --enable-new-dtags -rpath=/data/data/com.termux/files/usr/lib --eh-frame-hdr -m aarch64linux -dynamic-linker /system/bin/linker64 -o conftest /data/data/com.termux/files/usr/lib/crtbegin_dynamic.o -L/data/data/com.termux/files/usr/lib -L/data/data/com.termux/files/usr/bin/../lib -llog /data/data/com.termux/files/usr/tmp/conftest-989d86.o -lm -lc++_shared -lgcc -ldl -lm -lc -lgcc -ldl /data/data/com.termux/files/usr/lib/crtend_android.o
configure:22735: $? = 0
configure:22745: result: yes

igavronski
Knows some wx things
Knows some wx things
Posts: 30
Joined: Mon Jul 15, 2019 12:52 pm

Re: Compiling wxWidgets 3.1.1 in Termux

Post by igavronski » Mon Jul 15, 2019 7:23 pm

I also need a way to set wxUSE_UNSAFE_WXSTRING_CONV to zero.
Where do I do that?

igavronski
Knows some wx things
Knows some wx things
Posts: 30
Joined: Mon Jul 15, 2019 12:52 pm

Re: Compiling wxWidgets 3.1.1 in Termux

Post by igavronski » Mon Jul 15, 2019 7:33 pm

I believe configure --disable-unsafe_conv_in_wxstring
my bad!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3464
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Compiling wxWidgets 3.1.1 in Termux

Post by ONEEYEMAN » Mon Jul 15, 2019 7:36 pm

Hi,
You best bet would probably be to send an E-mail to wx-users ML, where you can reach core wx-devs.
This looks like a bug in "configure" and needs to be fixed there in order to make the compilation succeed.

Thank you.

DavidHart
Site Admin
Site Admin
Posts: 3887
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Compiling wxWidgets 3.1.1 in Termux

Post by DavidHart » Mon Jul 15, 2019 7:44 pm

BTW, debian have official aarch64 builds that includes wx3.0.4. Even if you can't use that direct, it might be worth looking at how they build it (see the source package's debian/rules). The build process for wx3.1.1 won't be much different.

igavronski
Knows some wx things
Knows some wx things
Posts: 30
Joined: Mon Jul 15, 2019 12:52 pm

Re: Compiling wxWidgets 3.1.1 in Termux

Post by igavronski » Mon Jul 15, 2019 7:47 pm

DavidHart wrote:
Mon Jul 15, 2019 6:34 pm
Hi,

Earlier tarballs are available too e.g. https://github.com/wxWidgets/wxWidgets/ ... tag/v3.1.1

Regards,

David
I downloaded the wx 3.1.1 source from the link you provided.
Configured with: ../configure --with-gtk=2 --enable-cmdline --enable-monolithic --with-expat=builtin --enable-stl --with-sdl --enable-utf8 --enable-utf8only --disable-unsafe_conv_in_wxstring --enable-gui --enable-universal

This is the result (end of configure messages)

Code: Select all

Configured wxWidgets 3.1.1 for `aarch64-unknown-linux-gnu'

  Which GUI toolkit should wxWidgets use?                 GTK+ 2 with support for GTK+ printing libnotify
  Should wxWidgets be compiled into single library?       yes
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets support Unicode?                       yes (using UTF-8)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.8      no
                                       wxWidgets 3.0      yes
  Which libraries should wxWidgets use?
                                       STL                yes
                                       jpeg               sys
                                       png                sys
                                       regex              builtin
                                       tiff               sys
                                       zlib               sys
                                       expat              builtin
                                       libmspack          no
                                       sdl                yes
And the output of the make is here:
make.out.txt
(724.94 KiB) Downloaded 4 times

User avatar
doublemax
Moderator
Moderator
Posts: 14076
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Compiling wxWidgets 3.1.1 in Termux

Post by doublemax » Mon Jul 15, 2019 7:47 pm

As the errors seem to be xlocale related, you could also try to disable that during configure.
--disable-xlocale
Use the source, Luke!

Post Reply