Compiling Android NDK with Objective-C-blocked gcc errors

I am debugging Jackie Gleason 's presentation on compiling objective-c on Android, as well as Michael f1337 on a blog on the same issue (with the addition of work on Mac OS X, which I am). The main difference between their posts and mine is that I am working on using the latest NDK (r8b). I have completed the following steps:

1) Download the latest NDK here: http://developer.android.com/tools/sdk/ndk/index.html

2) Create a directory called NDK and unzip it here.

3) In the NDK directory, create the toolchain-src folder. cd to this directory.

4) Download the toolchain:

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) Create a binutils directory. cd to this directory.

6) Download the latest binutils bittun here: http://ftp.gnu.org/gnu/binutils/

7) Unzip the file to the current directory.

8) back to the toolchain-src directory, create the gcc directory.

9) Download gcc that supports the c object (verified with gcc-4.6.1) http://ftp.gnu.org/gnu/gcc/

10) Unzip this file to the gcc folder, then go to the toolchain-src directory

11) cd into the assembly directory and edit the Makefile.in file by 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) In 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) find this file in the ndk file: 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) Then find this file in the ndk file: build / tools / build-host-gcc.sh. Change the line here:

 ARGS=$ARGS" --enable-languages=c,c++" to ARGS=$ARGS" --enable-languages=c,c++,objc" 

15) Enter the terminal bash (by typing bash) and enter these lines (replacing <...> with real 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 

This starts to work, but does not work with the following message (found in the config.log output 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/../.." 

Looking at the build-gcc.sh file, it has much fewer lines than 1771. Further research led me to believe that this error occurs in the / toolchain -src / gcc / gcc-4.6.1 / configure file, but I don’t know what to fix.

Does anyone know how I can fix this? I am not looking for external links or ready-made solutions (for example, the custom ndk-r7 from CrystaX), since I already read a lot and tried a lot.

+1
gcc android objective-c macos toolchain
Oct 25
source share
1 answer

Strange, I had to delete the existing NDK and re-unzip it. After that, everything worked out. I initially installed the NDK as the first step, however I need to migrate it to step 15.

+2
Oct 25
source share



All Articles