Build for android
Hi,
I'm trying to build this project for android on ubuntu 23.04 and here is how I make and the issues I am facing right now:
I enter : make NDK=/home/X/android-ndk-r25c
Here is what I get:
make -C arm/openconnect/android ARCH=arm NDK=/home/X/android-ndk-r25c/
make[1]: Entering directory '/home/X/MyProjects/ics-openconnect/external/arm/openconnect/android'
/home/X/android-ndk-r25c//build/tools/make-standalone-toolchain.sh --platform=android-14 --arch=arm --install-dir=/home/X/MyProjects/ics-openconnect/external/arm/openconnect/android/arm-linux-androideabi/toolchain || \
/home/X/android-ndk-r25c//build/tools/make-standalone-toolchain.sh \
--platform=android-14 --arch=arm --install-dir=/home/X/MyProjects/ics-openconnect/external/arm/openconnect/android/arm-linux-androideabi/toolchain --system=linux-x86_64
/bin/sh: 1: /home/X/android-ndk-r25c//build/tools/make-standalone-toolchain.sh: not found
/bin/sh: 2: /home/X/android-ndk-r25c//build/tools/make-standalone-toolchain.sh: not found
make[1]: *** [Makefile:82: /home/X/MyProjects/ics-openconnect/external/arm/openconnect/android/arm-linux-androideabi/toolchain/.built] Error 127
make[1]: Leaving directory '/home/X/MyProjects/ics-openconnect/external/arm/openconnect/android'
make: *** [Makefile:114: arm/libopenconnect.so] Error 2
if you check the ndk, you will see that /home/X/android-ndk-r25c//build/tools/make-standalone-toolchain.sh
doesn't exist anymore, and instead there is a make_standalone_toolchain.py
which has some complications calling. So I change the external/openconnect/android/Makefile
like this:
In line 81, under the target $(TOOLCHAIN_BUILT):
we have :
$(NDK)/build/tools/make-standalone-toolchain.sh $(TOOLCHAIN_OPTS) || \
$(NDK)/build/tools/make-standalone-toolchain.sh \
$(TOOLCHAIN_OPTS) --system=linux-x86_64
touch $@
Since the sh files don't exist and the --system option is no longer accepted(I'm not sure if it has some alternative now) I change it to this:
$(TOOLCHAIN_BUILT):
python3 $(NDK)/build/tools/make_standalone_toolchain.py $(TOOLCHAIN_OPTS)
touch $@
and also the TOOLCHAIN_OPTS
should be changed to this:
TOOLCHAIN_OPTS := --api=$(API_LEVEL) --arch=$(ARCH) \
--install-dir=$(TOOLCHAIN)
(I API_LEVEL to 21 for arm). Then I get this error:
checking for HOGWEED... no
configure: error:
***
*** Libhogweed (nettle's companion library) was not found. Note that you must compile nettle with gmp support.
make[1]: *** [Makefile:228: arm-linux-androideabi/gnutls/Makefile] Error 1
make[1]: Leaving directory '/home/X/MyProjects/ics-openconnect/external/arm/openconnect/android'
make: *** [Makefile:114: arm/libopenconnect.so] Error 2
Though if I run command locate hogweed.pc
I get the address /usr/lib64/pkgconfig/hogweed.pc
. So again I run export PKG_CONFIG_PATH=/usr/lib64/pkgconfig/
and re-run the make command, I get error :
ld: error: /usr/lib64/libnettle.so is incompatible with armelf_linux_eabi
ld: error: /usr/lib64/libhogweed.so is incompatible with armelf_linux_eabi
clang140: error: linker command failed with exit code 1 (use -v to see invocation)
make[6]: *** [Makefile:1896: psktool] Error 1
make[6]: Leaving directory '/home/ali/MyProjects/ics-openconnect/external/arm/openconnect/android/arm-linux-androideabi/gnutls/src'
make[5]: *** [Makefile:1988: all-recursive] Error 1
make[5]: Leaving directory '/home/ali/MyProjects/ics-openconnect/external/arm/openconnect/android/arm-linux-androideabi/gnutls/src'
make[4]: *** [Makefile:1730: all] Error 2
make[4]: Leaving directory '/home/ali/MyProjects/ics-openconnect/external/arm/openconnect/android/arm-linux-androideabi/gnutls/src'
make[3]: *** [Makefile:1463: all-recursive] Error 1
make[3]: Leaving directory '/home/ali/MyProjects/ics-openconnect/external/arm/openconnect/android/arm-linux-androideabi/gnutls'
make[2]: *** [Makefile:1391: all] Error 2
make[2]: Leaving directory '/home/ali/MyProjects/ics-openconnect/external/arm/openconnect/android/arm-linux-androideabi/gnutls'
make[1]: *** [Makefile:240: arm-linux-androideabi/gnutls/lib/libgnutls.la] Error 2
make[1]: Leaving directory '/home/ali/MyProjects/ics-openconnect/external/arm/openconnect/android'
make: *** [Makefile:114: arm/libopenconnect.so] Error 2
and I haven't been able to move forward.