Discussion:
How To Configure for Android? (Redux for x86_64)
Jeffrey Walton
2015-01-12 02:56:50 UTC
Permalink
This is a follow up to an old email
(https://lists.gnu.org/archive/html/autoconf/2013-10/msg00002.html).
AOSP has added an x86_64 target, so I'm trying to configure for it.

First, I run my setenv-android.sh script to set paths and tools. An
output is shown below.

Then I try to configure:

$ cd lame-3.99.5

$ ./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/jwalton/Desktop/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

What triplet should I be using? Is there a list of triplets anywhere
for common mobile devices?

How do I configure for x86_64 Android?

Thanks in advance.

**********

$ . ./setenv-android.sh
Using toolchain
/opt/android-ndk-r10d/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin
ANDROID_NDK_ROOT: /opt/android-ndk-r10d
ANDROID_EABI: x86_64-4.9
ANDROID_ARCH: arch-x86_64
ANDROID_API: android-21
ANDROID_SYSROOT: /opt/android-ndk-r10d/platforms/android-21/arch-x86_64
ANDROID_TOOLCHAIN:
/opt/android-ndk-r10d/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin
ANDROID_FLAGS:
ANDROID_STL_INC: /opt/android-ndk-r10d/sources/cxx-stl/stlport/stlport/
ANDROID_STL_LIB:
/opt/android-ndk-r10d/sources/cxx-stl/stlport/libs/x86_64/libstlport_shared.so

$ 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

$ export CFLAGS="--sysroot=$ANDROID_SYSROOT"
$ export CXXFLAGS="--sysroot=$ANDROID_SYSROOT"
Mike Frysinger
2015-02-15 10:23:36 UTC
Permalink
Post by Jeffrey Walton
$ ./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
you need to teach the GNU/config project about the new tuple:
https://savannah.gnu.org/projects/config

and then it'll get synced over time to other projects/distros.
-mike
Jeffrey Walton
2015-02-15 23:48:27 UTC
Permalink
Post by Mike Frysinger
https://savannah.gnu.org/projects/config
Thanks Mike.

Would it be possible for Autoconf to publish a list of valid triplets
its recognizes?

When working on these platforms, I don't know if I am encountering a
bug with Autoconf or a bug with a package because I don't know what is
supposed to be recognized.

Jeff
Post by Mike Frysinger
Post by Jeffrey Walton
$ ./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
https://savannah.gnu.org/projects/config
and then it'll get synced over time to other projects/distros.
-mike
Paul Eggert
2015-02-16 04:49:58 UTC
Permalink
Post by Jeffrey Walton
Would it be possible for Autoconf to publish a list of valid triplets
its recognizes?
It is published, as part of the config source code. Perhaps it could also be
published separately, in the form of documentation, but I suspect this is low
priority, as we've survived many years without documentation.
Jeffrey Walton
2015-02-16 05:52:41 UTC
Permalink
Post by Paul Eggert
Post by Jeffrey Walton
Would it be possible for Autoconf to publish a list of valid triplets
its recognizes?
It is published, as part of the config source code.
Oh, self documenting source code :) When I searched for it in the
particular project, it was not present. Its kind of hard to find
something that's absent :)
Post by Paul Eggert
Perhaps it could also
be published separately, in the form of documentation, but I suspect this is
low priority, as we've survived many years without documentation.
Its not for the project, its for the project's users :)

Jeff

Loading...