簡體   English   中英

適用於Android x86_64的Autoconf三元組?

[英]Autoconf triplet for Android x86_64?

我想研究以下問題: x86_64的Android NDK沒有bcopy和index的引用 在問題中,發布者詢問有關Lame聲音庫的 Android x86_64和bcopy

我設置了交叉編譯環境,設置了工具和sysroot的路徑,並導出了諸如CCCXX CFLAGSCXXFLAGS等常見的可疑對象。例如:

$ 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"
$ echo $CFLAGS
--sysroot=/opt/android-ndk-r10d/platforms/android-21/arch-x86_64

以上通常足以使事情開始。 一切設置正確,我可以使用該腳本來構建其他庫,例如Crypto ++和OpenSSL(進行一些細微調整)。

但是,我無法為Android x86_64配置(請參見下文)。 我似乎找不到正確的三元組。

Android x86_64與Autoconf一起使用什么三元組?


在Autoconf中,AC的“構建”是大多數人認為的“主機”,AC的“宿主”是大多數人認為的“目標”。 因此,這些選項在交叉編譯時實際上是正確的。

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

我從GNU FTP站點獲取了autoconf-2.69.tar.xz 我在build-aux目錄中找到了最新的config.guessconfig.sub並將其用於LAME MP3編碼器項目。

看來三元組是x86_64-linux-android

該項目雖然有一個斷開的鏈接。 通過libtool創建共享庫的編譯器驅動程序調用缺少CFLAGS ,因此--sysroot不傳遞給鏈接器。 由於缺少系統庫,例如crtbegin_so.ocrtend_so.o-lc-ldl ,這會導致許多鏈接錯誤。

解決方法是從libmp3lame目錄手動運行失敗的命令。 在命令前添加$CC $CFLAGS <rest of project's command>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM