Building GMP with NDK

Issue

I am trying to use msys2 on windows to build gmp for Android with the ndk toolchain. But I keep getting this error:

configure: error: Cannot find a build system compiler

I am not even sure what is a build system compiler? Which executable is that in the NDK? How do I specify it?

Running configure step for gmp-6.1.2
sh configure --enable-static --disable-shared --with-pic --prefixC:/Developer/AppPlugin/build/android/deps --with-sysroot/C/Developer/AppPlugin/build/android/toolchain-arm-21/sysroot --hostarm-linux-androideabi
configure: loading site script C:/msys64/mingw64/etc/config.site
checking build system type... x86_64-w64-mingw32
checking host system type... arm-unknown-linux-androideabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI32
checking whether C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang is gcc... yes
checking compiler C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang -Os -IC:/Developer/AppPlugin/build/android/deps/include -marm -mtunecortex-a8 -marcharmv7-a -mfloat-abisoftfp -mfpuneon -fPIC -D__ANDROID_API__21 --sysrootC:/Developer/AppPlugin/build/android/toolchain-arm-21/sysroot ... yes
checking whether ARM gcc unsigned division works... yes
checking for arm-linux-androideabi-gcc... C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang accepts -g... yes
checking for C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang option to accept ISO C89... none needed
checking whether C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang understands -c and -o together... yes
checking for C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang option to accept ISO C99... none needed
checking for C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang option to accept ISO Standard C... (cached) none needed
checking how to run the C preprocessor... C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang -E
checking build system compiler C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang... no
checking build system compiler C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang -Os -IC:/Developer/AppPlugin/build/android/deps/include -marm -mtunecortex-a8 -marcharmv7-a -mfloat-abisoftfp -mfpuneon -fPIC -D__ANDROID_API__21 --sysrootC:/Developer/AppPlugin/build/android/toolchain-arm-21/sysroot ... no
checking build system compiler cc... no
checking build system compiler gcc... no
checking build system compiler c89... no
checking build system compiler c99... no
configure: error: Cannot find a build system compiler
Failed on configure step for gmp-6.1.2: sh configure --enable-static --disable-shared --with-pic --prefixC:/Developer/AppPlugin/build/android/deps --with-sysroot/C/Developer/AppPlugin/build/android/toolchain-arm-21/sysroot --hostarm-linux-androideabi

Solution

I needed to set the as command line option to my gcc executable.

Answered By – rygo6

Leave a Comment