AFAIK writing Android.mk makefiles is the only option currently. And it doesn't
take so much time in my experience, especially if you use ./configure as I
mentioned recently, and then write Android.mk by reading Makefile.am which is
usually very readable.
Olivier
--
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.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Do you have an (automake) Makefile.am or just a plain Makefile?
Olivier
On 07/12/2010 02:59 PM, Ngo Van Luyen wrote:
> Thank for your useful reply.
>
> I tried to look at Makefile but there are so many thing there. I don't
> know which one I should copy to Android.mk. I tried to copy (with some
> modifications in path to source) the c/c++ source part (source:= ...).
> But when I type ndk-build, I got a blank screen, ndk-build shows me nothing.
>
> Thanks,
>
>
> 2010/7/12 Olivier Guilyardi <li...@samalyse.com <mailto:li...@samalyse.com>>
> <mailto:andro...@googlegroups.com>.
> To unsubscribe from this group, send email to
> android-ndk...@googlegroups.com
> <mailto:android-ndk%2Bunsu...@googlegroups.com>.
Here's an autotools tutorial:
http://www.developingprogrammers.com/index.php/2006/01/05/autotools-tutorial/
You need to understand the basics of autoconf, automake, etc.. to port your libs.
Also, the blank screen symptom that you mentioned before could be caused by an
incomplete Application.mk. Double check $NDK/docs.
Olivier
On 07/12/2010 04:25 PM, Ngo Van Luyen wrote:
> yes, I have Makefile.am file
>
>
>
> 2010/7/12 Olivier Guilyardi <li...@samalyse.com <mailto:li...@samalyse.com>>
>
> You can't just copy stuff from Makefile to Android.mk. You need to
> understand
> what happens and convert.
>
> Do you have an (automake) Makefile.am or just a plain Makefile?
>
> Olivier
>
> On 07/12/2010 02:59 PM, Ngo Van Luyen wrote:
> > Thank for your useful reply.
> >
> > I tried to look at Makefile but there are so many thing there. I don't
> > know which one I should copy to Android.mk. I tried to copy (with some
> > modifications in path to source) the c/c++ source part (source:= ...).
> > But when I type ndk-build, I got a blank screen, ndk-build shows
> me nothing.
> >
> > Thanks,
> >
> >
> > 2010/7/12 Olivier Guilyardi <li...@samalyse.com
> <mailto:li...@samalyse.com> <mailto:li...@samalyse.com
> > <mailto:andro...@googlegroups.com
> <mailto:andro...@googlegroups.com>>.
> > To unsubscribe from this group, send email to
> > android-ndk...@googlegroups.com
> <mailto:android-ndk%2Bunsu...@googlegroups.com>
> > <mailto:android-ndk%2Bunsu...@googlegroups.com
> <mailto:android-ndk%252Buns...@googlegroups.com>>.
I think you're on the right way :)
Olivier
On 07/12/2010 09:47 PM, Ngo Van Luyen wrote:
> Thank you Olivier.
>
> I have just found a nice presentation for beginner like
> me: http://androidcore.com/android-programming-tutorials/553-happy-how-to-porting-x86-application-to-android.html
>
> and playing with android makefile :)
>
>
>
>
> 2010/7/12 Olivier Guilyardi <li...@samalyse.com <mailto:li...@samalyse.com>>
>
> Then, it should be simpler than a handwritten Makefile. Makefile.am
> is usually
> quite readable.
>
> Here's an autotools tutorial:
> http://www.developingprogrammers.com/index.php/2006/01/05/autotools-tutorial/
>
> You need to understand the basics of autoconf, automake, etc.. to
> port your libs.
>
> Also, the blank screen symptom that you mentioned before could be
> caused by an
> incomplete Application.mk. Double check $NDK/docs.
>
> Olivier
>
> On 07/12/2010 04:25 PM, Ngo Van Luyen wrote:
> > yes, I have Makefile.am file
> >
> >
> >
> > 2010/7/12 Olivier Guilyardi <li...@samalyse.com
> <mailto:li...@samalyse.com> <mailto:li...@samalyse.com
> <mailto:li...@samalyse.com>>>
> >
> > You can't just copy stuff from Makefile to Android.mk. You need to
> > understand
> > what happens and convert.
> >
> > Do you have an (automake) Makefile.am or just a plain Makefile?
> >
> > Olivier
> >
> > On 07/12/2010 02:59 PM, Ngo Van Luyen wrote:
> > > Thank for your useful reply.
> > >
> > > I tried to look at Makefile but there are so many thing
> there. I don't
> > > know which one I should copy to Android.mk. I tried to copy
> (with some
> > > modifications in path to source) the c/c++ source part
> (source:= ...).
> > > But when I type ndk-build, I got a blank screen, ndk-build shows
> > me nothing.
> > >
> > > Thanks,
> > >
> > >
> > > 2010/7/12 Olivier Guilyardi <li...@samalyse.com
> <mailto:li...@samalyse.com>
> > <mailto:li...@samalyse.com <mailto:li...@samalyse.com>>
> <mailto:li...@samalyse.com <mailto:li...@samalyse.com>
> > <mailto:li...@samalyse.com <mailto:li...@samalyse.com>>>>
> > > <mailto:android-ndk%2Bunsu...@googlegroups.com
> <mailto:android-ndk%252Buns...@googlegroups.com>
> > <mailto:android-ndk%252Buns...@googlegroups.com
> <mailto:android-ndk%25252Bun...@googlegroups.com>>>.
There's something wrong IMO with the tutorial you mention though. The way
./configure is called might lead to subtle problems in the generated config.h.
For example, with libsndfile, if you just run ./configure you get this in config.h:
#define SIZEOF_OFF_T 8
But if you properly configure it for ARM/NDK, config.h contains:
#define SIZEOF_OFF_T 4
Here's what I mean by properly configuring:
export NDK=/path/to/ndk
export PATH=$PATH:$NDK/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin
./configure \
--host=arm-eabi \
CC=arm-eabi-gcc \
CPPFLAGS="-I$NDK/build/platforms/android-3/arch-arm/usr/include/" \
CFLAGS="-nostdlib" \
LDFLAGS="-Wl,-rpath-link=$NDK/build/platforms/android-3/arch-arm/usr/lib/ \
-L$NDK/build/platforms/android-3/arch-arm/usr/lib/" \
LIBS="-lc "
Of course you can add other configure options, such as --disable-foobar, etc..
Olivier
On 07/13/2010 12:59 PM, Ngo Van Luyen wrote:
> I did it, thank you so much Olivier. I'm going to port my others libs :)
>
>
>
> 2010/7/12 Olivier Guilyardi <li...@samalyse.com <mailto:li...@samalyse.com>>
>
> Yep, this tutorial is the sort of thing that I meant.
>
> I think you're on the right way :)
>
> Olivier
>
> On 07/12/2010 09:47 PM, Ngo Van Luyen wrote:
> > Thank you Olivier.
> >
> > I have just found a nice presentation for beginner like
> > me:
> http://androidcore.com/android-programming-tutorials/553-happy-how-to-porting-x86-application-to-android.html
> >
> > and playing with android makefile :)
> >
> >
> >
> >
> > 2010/7/12 Olivier Guilyardi <li...@samalyse.com
> <mailto:li...@samalyse.com> <mailto:li...@samalyse.com
> <mailto:li...@samalyse.com>>>
> >
> > Then, it should be simpler than a handwritten Makefile.
> Makefile.am
> > is usually
> > quite readable.
> >
> > Here's an autotools tutorial:
> >
> http://www.developingprogrammers.com/index.php/2006/01/05/autotools-tutorial/
> >
> > You need to understand the basics of autoconf, automake, etc.. to
> > port your libs.
> >
> > Also, the blank screen symptom that you mentioned before could be
> > caused by an
> > incomplete Application.mk. Double check $NDK/docs.
> >
> > Olivier
> >
> > On 07/12/2010 04:25 PM, Ngo Van Luyen wrote:
> > > yes, I have Makefile.am file
> > >
> > >
> > >
> > > 2010/7/12 Olivier Guilyardi <li...@samalyse.com
> <mailto:li...@samalyse.com>
> > <mailto:li...@samalyse.com <mailto:li...@samalyse.com>>
> > > <mailto:android-ndk%252Buns...@googlegroups.com
> <mailto:android-ndk%25252Bun...@googlegroups.com>
> > <mailto:android-ndk%25252Bun...@googlegroups.com
> <mailto:android-ndk%2525252Bu...@googlegroups.com>>>>.
It works for you maybe, but it might fail on some current or future devices.
Olivier