编译的Android NDK启用的Objective-C-gcc的错误 [英] Compiling Android NDK with Objective-C-enabled gcc errors
问题描述
我工作过杰基格利森的presentation的有关获取的Objective-C编写Android上还有的就同一主题(加Mac OS X上,而我的工作)迈克尔f1337的博客文章。他们的岗位和我之间的主要区别是,我的工作使用最新的NDK(R8B)。我按照下列步骤操作:
I am working off of Jackie Gleason's presentation about getting objective-c to compile on Android as well as Michael f1337's blog post on the same subject (with the addition of working on Mac OS X, which I am). The major difference between their posts and mine is that I am working to use the latest NDK (r8b). I have followed these steps:
1)下载最新版本NDK这里: http://developer.android。 COM /工具/ SDK / NDK / index.html的
1) Download the latest NDK here: http://developer.android.com/tools/sdk/ndk/index.html
2)创建一个名为NDK的目录,并在这里解压下载。
2) Create a directory called NDK, and unpack the download here.
3)在NDK目录下,创建文件夹工具链-SRC。 cd到这个目录。
3) In the NDK directory, create the folder toolchain-src. cd to this directory.
4)下载的工具链:
git clone https://android.googlesource.com/toolchain/build.git
git clone https://android.googlesource.com/toolchain/gmp.git
git clone https://android.googlesource.com/toolchain/gdb.git
git clone https://android.googlesource.com/toolchain/mpc.git
git clone https://android.googlesource.com/toolchain/mpfr.git
5)创建目录的binutils。 cd到这个目录。
5) Create the directory binutils. cd to this directory.
6)下载最新的binutils焦油球在这里: http://ftp.gnu.org/gnu / binutils的/
6) Download the latest binutils tar ball here: http://ftp.gnu.org/gnu/binutils/
7)解压缩文件到当前目录。
7) Unpack file to current directory.
8)早在工具链-src目录下,创建目录的gcc。
8) back in the toolchain-src directory, create the directory gcc.
9)下载,支持目标C(用gcc-4.6.1测试) HTTP一个gcc:/ /ftp.gnu.org/gnu/gcc/
9) Download a gcc that supports objective c (tested with gcc-4.6.1) http://ftp.gnu.org/gnu/gcc/
10)打开这个文件放到gcc的文件夹,然后导航回到工具链-src目录
10) Unpack this file into the gcc folder, then navigate back to the toolchain-src directory
11),CD到构建目录,并编辑Makefile.in文件,更改行:
11) cd to the build directory, and edit the Makefile.in file, changing the line:
--with-gnu-as --with-gnu-ld --enable-languages=c,c++
to
--with-gnu-as --with-gnu-ld --enable-languages=c,c++,objc
12)从gcc目录,下载并安装补丁的gcc:
12) From the gcc directory, Download and install the gcc patch:
curl http://gcc.gnu.org/bugzilla/attachment.cgi?id=24879 > gcc.patch
cd gcc-4.6.1
patch -p1 < ../gcc-4.6.1.patch
13),发现在NDK这个文件:编译/工具/ build-mingw64-toolchain.sh。在这个文件中,更改行:
13) find this file in the ndk: build/tools/build-mingw64-toolchain.sh. In this file, change the line:
var_append GCC_CONFIGURE_OPTIONS "--enable-languages=c,c++"
to
var_append GCC_CONFIGURE_OPTIONS "--enable-languages=c,c++,objc"
14)接着,发现在NDK这个文件:编译/工具/ build-host-gcc.sh。在这里,更改该行:
14) Next, find this file in the ndk: build/tools/build-host-gcc.sh. Here, change the line:
ARGS=$ARGS" --enable-languages=c,c++"
to
ARGS=$ARGS" --enable-languages=c,c++,objc"
15)输入Bash终端(通过输入的bash),然后输入以下行(替换&LT; ...>与实际路径:
15) Enter the bash terminal (by typing bash), and enter these lines (replacing <...> with actual paths:
LOC="<path to NDK folder>/android-ndk-r8b/build/tools/build-gcc.sh"
SRC="<path to NDK folder>/toolchain-src"
NDK="<path to NDK folder>/android-ndk-r8b"
TOOL="arm-linux-androideabi-4.6.1"
sh $LOC --gmp-version=4.2.4 --mpfr-version=2.4.1 --mpc-version=0.8.1 --binutils-version=2.23 --try-64 $SRC $NDK $TOOL
这开始工作,但失败,出现以下消息(输出的config.log文件中):
This begins to work, but fails with the following message (found in the output config.log file):
build-gcc.sh:1771: error: cannot find install-sh, install.sh, or shtool in "<path to NDK>/android-ndk-r8b/build/tools" "<path to NDK>/android-ndk-r8b/build/tools/.." "<path to NDK>/android-ndk-r8b/build/tools/../.."
综观build-gcc.sh文件,它远不如数多于1771年进一步的调查使我相信,这个错误在/toolchain-src/gcc/gcc-4.6.1/configure文件中发生的,但我不知道要解决什么。
Looking at the build-gcc.sh file, it has far less lines than 1771. Further investigation has brought me to believe that this error is occurring in the /toolchain-src/gcc/gcc-4.6.1/configure file, but I do not know what to fix.
有谁知道我怎么能解决这个问题?我不是在寻找外部链接,或prebuilt解决方案(如CrystaX定制NDK-R7),因为我已经阅读并尝试了很多。
Does anyone know how I can fix this? I am not looking for external links, or prebuilt solutions (such as CrystaX' custom ndk-r7), as I have already read and tried a lot.
推荐答案
奇怪的是,我不得不删除我现有的NDK,并重新将其解压缩。之后,它的工作。我原本安装NDK作为第一步,但它应该一步15日前迁入。
Strangely, I had to delete my existing NDK and re-unarchive it. After that it worked. I had originally installed the NDK as the first step, however it should be moved to before step 15.
这篇关于编译的Android NDK启用的Objective-C-gcc的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!