Thanks for the help!
@David: I followed your hint, and I managed to compile it (I am using
android-ndk-r4-crystax by the way).
This is what I had to do:
1.- export NDK_TOOLCHAIN=x86-4.2.1
2.- edit /home/ikve/android-ndk-r4-crystax/build/core/default-
application.mk by adding
APP_ABI := x86
3.- edit android-ndk-r4-crystax/build/toolchains/x86-4.2.1/
setup.mk:
TOOLCHAIN_PREFIX variable points to android-ndk-r4-crystax/build/
prebuilt/linux-x86/x86-4.2.1/bin/ which does not exist.
Therefore I just commented out TOOLCHAIN_PREFIX, to take the g++ from
the host machine (eg. /usr/bin/g++)
4.- Next problem I had to face were some errors when compiling with
standard headers (string, ...). My host compiler was taking the
includes from the ndk toolchain, that is from: android-ndk-r4-crystax/
build/platforms/android-8/arch-x86/usr/include. I renamed this
directory so that g++ falls back to the host's include path and then
it worked fine.
On Oct 7, 1:03 am, David Turner <
di...@android.com> wrote:
> The support for x86 is currently experimental on Android (i.e. not
> official).
> However, I assume that what you really want is the ability to build your
> program for your host operating system (e.g. Linux) with the NDK build
> system.
>
> Have a look at the content of build/toolchains/<name>. What you want is
> probably possible if you add a new <name> there,
> and modify the
config.mk and
setup.mk to reflect your host toolchain. Your
>
setup.mk will probably be tiny in comparison, and
> you will need to set NDK_TOOLCHAIN=<myname> in your environment in order to
> select your own toolchain during the build.
>
> As far as I know, it is the only thing that depends on the target CPU / ABI
> when building.
>
> Let me know if this works.
>
> On Wed, Oct 6, 2010 at 5:28 PM, JugglingAnt <
thejugglingmon...@gmail.com>wrote:
>
>
>
> > I have a big C++ system with lots of makefiles that have been
> > converted to Android makefiles in order to use the Android build
> > system. Now my problem is that I want to be able to build my system
> > for the x86 platform using the same Android makefiles, just by
> > replacing the compiler toolchain... (basically I don't want to
> > maintain two build systems using a completely different set of
> > makefiles)
>
> > I was hoping that I would be able to override somewhere on my
> > Android.mk the default toolchain and let it point to my own native g++
> > compiler but that seems not to be the case. I tried with the following
> > line in the Android.mk file:
>
> > LOCAL_CXX = g++
>
> > It seems to be ignored!
>
> > Does anybody know if what I am trying to do is possible?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-ndk" group.
> > To post to this group, send email to
andro...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr
oups.com>
> > .