I wanted to examine the issue from this question: Android NDK for x86_64 has no reference for bcopy and index. In the question, the poster asked about Android x86_64 and bcopy
in relation to the Lame sound library.
I set up my cross-compile environment, set the paths for tools and sysroot, and exported the usual suspects like CC
, CXX
CFLAGS
, CXXFLAGS
, etc. For example:
$ echo $CC
x86_64-linux-android-gcc
$ which x86_64-linux-android-gcc
/opt/android-ndk-r10d/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin/x86_64-linux-android-gcc
And:
$ export CFLAGS="--sysroot=$ANDROID_SYSROOT"
$ echo $CFLAGS
--sysroot=/opt/android-ndk-r10d/platforms/android-21/arch-x86_64
The above is usually enough to get things started. Everything is set correctly, and I can use the script to build other libraries, like Crypto++ and OpenSSL (with some minor adjustments).
However, I have not been able to configure for Android x86_64 (see below). I can't seem to find the right triplet.
What triplet does Android x86_64 use with Autoconf?
Under Autoconf, AC's "build" is what most people consider "host", and AC's "host" is what most people consider "target". So the options are actually correct when cross compiling.
$ ./configure --build=`./config.guess` --host=x86_64-linux-androideabi
checking build system type... i686-apple-darwin12.5.0
checking host system type... Invalid configuration
`x86_64-linux-androideabi': system `androideabi' not recognized
configure: error: /bin/sh ./config.sub x86_64-linux-androideabi failed
$ ./configure --build=`./config.guess` --host=x86_64-linux-android
checking build system type... i686-apple-darwin12.5.0
checking host system type... Invalid configuration
`x86_64-linux-android': system `android' not recognized
configure: error: /bin/sh ./config.sub x86_64-linux-android failed
$ ./configure --build=`./config.guess`
checking build system type... i686-apple-darwin12.5.0
checking host system type... i686-apple-darwin12.5.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... x86_64-linux-android-gcc
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... configure: error: in
`/Users/android/lame-3.99.5':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details