Prerequisites:
MSYSMinGW
Android NDK
LibIconv source code
Download and extract LibIconv.
Let's assume that we have the following directory structure:
LibIconv in: D:\temp\android\libiconv-1.14
Android NDK in: D:\tools\android\android-ndk-r10b-win
MinGW in: D:\tools\mingw482_32
Start a MSYS console.
Add MinGW to PATH:
export PATH=$PATH:/d/mingw482_32/bin
Set Android NDK environment variables:
export ANDROID_NDK_ROOT=/d/tools/android/android-ndk-r10b-win
export SR="$ANDROID_NDK_ROOT"/platforms/android-12/arch-arm/usr
export BR="$ANDROID_NDK_ROOT"/toolchains/arm-linux-androideabi-4.8/prebuilt/windows/bin/arm-linux-androideabi-
export CC="$BR"gcc
export AR="$BR"ar
export STRIP="$BR"strip
export RANLIB="$BR"ranlib
export OBJDUMP="$BR"objdump
export CC="$BR"gcc CFLAGS=--sysroot=$SR CPP="$BR"cpp CPPFLAGS=$CFLAGS
Go to libiconv directory:
cd /d/temp/android/libiconv-1.14
Configure:
./configure --host=arm --with-sysroot=$SR
Make:
make
You can also download a prebuild version from here (libiconv-1.14_android.7z).
Thanks a lot for the detailed instructions. I followed all steps but after configure command. i am getting this Error ( "...\android-ndk-r10d\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64\bin\arm-linux-androideabi-cpp" fails sanity check)
ReplyDeleteAlthough i habe tried to use MinGW from Qt-Tools always same Error on the MSYS-screen.
I would be grateful if you would help me...
Post here exactly what you do.
ReplyDeleteI must build a Qt MySQL driver plugin for Android (on Windows) so that Android-Emulator (on Windows) connect with mysql database. According to your tutorial i have started with Building Libiconv-1.14 and i have downloaded Prerequisites:
ReplyDelete-MSYS-1.0.11
-MinGW : i am using that from QT-Tools
-Android-NDK: android-ndk-r10d
-libiconv-1.14: downloaded and extracted with WinRAR
i have used for all of them in the same directory as C:/android/...*except MinGW.
then i have wrote all steps,which you said, on MSYS console with my directories.
But i am getting that on MSYS console :
$ ./configure --host=arm --with-sysroot=$SR
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for arm-strip... /c/android/android-ndk-r10d/toolchains/arm-linux-andro
ideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for arm-gcc... /c/android/android-ndk-r10d/toolchains/arm-linux-android
eabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi-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... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /c/android/android-ndk-r10d/toolchains/arm-linux-androideabi-4.
8/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc accepts -g... yes
checking for /c/android/android-ndk-r10d/toolchains/arm-linux-androideabi-4.8/pr
ebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc option to accept ISO C89...
unsupported
checking for style of include used by make... GNU
checking dependency style of /c/android/android-ndk-r10d/toolchains/arm-linux-an
droideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc... none
checking how to run the C preprocessor... /c/android/android-ndk-r10d/toolchains
/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi-cpp
configure: error: in `/c/android/libiconv-1.14':
configure: error: C preprocessor "/c/android/android-ndk-r10d/toolchains/arm-lin
ux-androideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi-cpp" fails
sanity check
See `config.log' for more details
if you want to see my config.log file it is under this Link:
http://s000.tinyupload.com/?file_id=35862901769340813526
I thank you in advance for your help..
export C_INCLUDE_PATH=$SR/include
Deleteexport CPP_INCLUDE_PATH=$SR/include
will solve the above problem
This comment has been removed by the author.
ReplyDeleteI have the exact same issue with the preprocessor sanity check.
ReplyDeleteCould you please help me with that?
This comment has been removed by the author.
ReplyDeleteYou have to include your 'config.log'.
ReplyDelete