0

I'm trying to run configure telling it to use a cross compiler (the one provided by the Android NDK), but it isn't able to find one. I did the following (note, the Android NDK root is in /prod/ndk/):

(inside the folder I want to compile, which is located at /prod/workspace/jni/gmp/):

   ./configure \
   --host=arm-linux-androideabi \
   CC=arm-linux-androideabi-gcc \
   LD=arm-linux-androideabi-ld \
   CPPFLAGS="-I/prod/ndk/platforms/android-8/usr/include/" \
   CFLAGS="-nostdlib" \
   LDFLAGS="-Wl,-rpath-link=/prod/ndk/platforms/android-8/arch-arm/usr/lib/ 
   -L/prod/ndk/platforms/android-8/arch-arm/usr/lib" \
   LIBS="-lc"

But I receive the following error:

   checking build system type... x86_64-unknown-linux-gnu
   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... arm-linux-androideabi-strip
   checking for a thread-safe mkdir -p... /bin/mkdir -p
   checking for gawk... gawk
   checking whether make sets $(MAKE)... yes
   checking whether to enable maintainer-specific portions of Makefiles... no
   checking ABI=standard
   checking whether arm-linux-androideabi-gcc is gcc... yes
   checking compiler arm-linux-androideabi-gcc -nostdlib 
   -I/prod/ndk/platforms/android-8/usr/include/... no, double -> ulong conversion
   configure: error: could not find a working compiler, see config.log for 
   details

Any help? PS: I included /prod/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/ in my PATH variable.

shblsh
  • 81
  • 1
  • 9

2 Answers2

0

I'm not sure of this, but I would say that this line:

checking ABI=standard

probably means that configure is not trying to build for ARM architecture, but for desktop... so when you try to run it, it tries to build for desktop using the Android compiler and finds this compiler not working.

Try adding:

--host=arm-linux-androideabi

an see if it works.

mbrenon
  • 4,851
  • 23
  • 25
0

You've probably already figured it out, but just in case you...or someone else (like me)...comes across this question, there are a few things you should look at and/or do

  1. Use the make-standalone-toolchain.sh in the directory $NDKROOT/build/tools to make a standalone toolchain targeting the platform you want to develop for. It is easier than using the prebuilt toolchains in the NDK and it's the recommended way to use the toolchain.
  2. Check the config.log. It will tell you exactly where in configure the error happened. If you look at that location, you'll have a better idea of a) what caused the error and b) what can fix it.