三重的Autoconf为Android x86_64的? [英] Autoconf triplet for Android x86_64?
问题描述
我想从研究这个问题,这个问题:的Android NDK为x86_64的拥有BCOPY和索引没有提及。在的问题,海报及相对于的 BCOPY 询问关于Android的x86_64 =http://lame.sourceforge.net/相对=nofollow >拉梅音色库。
设置我的交叉编译环境,设置工具和SYSROOT的路径,并出口秋后算账像 CC
, CXX
CFLAGS
, CXXFLAGS
等。例如:
$回声$ CC
x86_64的-Linux的Android平台的GCC
$其中的x86_64-Linux的Android平台的GCC
/opt/android-ndk-r10d/toolchains/x86_64-4.9/$p$pbuilt/darwin-x86_64/bin/x86_64-linux-android-gcc
和
$出口CFLAGS = - SYSROOT = $ ANDROID_SYSROOT
$回声$ CFLAGS
--sysroot = /选择/ Android的NDK-r10d /平台/ Android的21 /拱x86_64的
以上是通常足以让事情开始。所有设置都正确,我可以使用脚本来构建其他的库,例如加密+和OpenSSL(有一些小的调整)。
不过,我一直没能配置为Android x86_64的(见下文)。我似乎无法找到合适的三重。
什么呢三重的Android x86_64的使用利用Autoconf?
在Autoconf的,交流的建是大多数人认为的主机,而AC的主人是大多数人认为的目标。所以选项实际上是正确的,当交叉编译。
$的./configure --build =`/ config.guess`主机= x86_64的-Linux的androideabi
检查创建系统类型... i686的-苹果darwin12.5.0
检查主机系统类型...无效的配置
`x86_64的Linux的-androideabi':'系统androideabi'无法识别
配置:错误:/ bin / sh的./config.sub的x86_64-Linux的androideabi失败$的./configure --build =`/ config.guess`主机= x86_64的-Linux的机器人
检查创建系统类型... i686的-苹果darwin12.5.0
检查主机系统类型...无效的配置
`x86_64的-Linux的Android的:系统'机器人'无法识别
配置:错误:/ bin / sh的./config.sub的x86_64-Linux的Android的失败$的./configure --build =`/ config.guess`
检查创建系统类型... i686的-苹果darwin12.5.0
检查主机系统类型... i686的-苹果darwin12.5.0
检查一个BSD兼容安装...在/ usr /斌/安装-c
检查编译环境是否健全......是的
检查一个线程安全的mkdir -p ... ./install-sh -c -d
检查GAWK ...没有
检查mawk ...没有
检查NAWK ...没有
检查AWK AWK ...
检查是否化妆套$(MAKE)......是的
检查是否启用生成文件的具体维护者,部分无...
检查包括使用的化妆风格... GNU
检查海合会... x86_64的-Linux的Android平台的GCC
检查C编译器是否工作......是的
检查C编译器默认的输出文件名的a.out ...
检查可执行文件后缀...
检查我们是否交叉编译...配置:错误:
`/Users/android/lame-3.99.5:
配置:错误:无法运行C编译的程序。
如果你的意思是交叉编译,使用`--host'。
详细信息请参见'的config.log
我拿来 autoconf的2.69.tar。从GNU FTP站点XZ 。我发现最新的的config.guess
和 config.sub脚本
在打造奥克斯
目录,并用它为LAME MP3连接codeR项目。
这似乎三重是的x86_64-Linux的机器人
。
该项目有断开的链接,但。编译器驱动程序通过的libtool创建了共享对象的调用缺少 CFLAGS
,所以 - SYSROOT
不传递到的连接体。这会导致一堆链接错误,由于缺少系统的库,例如 crtbegin_so.o
, crtend_so.o
, -lc
和 -ldl
。
该解决方法是手动运行从了libmp3lame
目录中失败的命令。 prePEND命令与 $ CC $ CFLAGS<项目的命令的制造&gt休息;
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
I fetched autoconf-2.69.tar.xz from the GNU FTP site. I found the latest config.guess
and config.sub
in the build-aux
directory and used it for the LAME MP3 encoder project.
It appears the triplet is x86_64-linux-android
.
The project has a broken link though. The invocation of the compiler driver through libtool that creates the shared object lacks CFLAGS
, so --sysroot
is not passed to the linker. That causes a bunch of link errors due to missing system libraries, like crtbegin_so.o
, crtend_so.o
, -lc
and -ldl
.
The fix for that is to manually run the the failed command from the libmp3lame
directory. Prepend the command with $CC $CFLAGS <rest of project's command>
.
这篇关于三重的Autoconf为Android x86_64的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!