porting libiconv to android(arm)——libiconv-1.14.tar.gz


https://groups.google.com/forum/?fromgroups=#!topic/android-ndk/M5XedQm0bvQ

+++++问题

Hi everyone,

I am trying to cross compile the GNU libiconv-1.13.1 library using the
Android standalone toolchain.  I am using Android level 8 for this.
After copying the latest config.guess and config.sub scripts from the
GNU auto tools website I was able to configure the library.

I get a compile error when I do a make.  The complier error is as
follows:

make[5]: Leaving directory `/data/proto/distro/commonc++/
branches/
0.6.4-dti.3x/libiconv-1.13.1'
/data/android-8-toolchain/bin/arm-linux-androideabi-gcc -
DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib  -I../intl -
DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1   -mthumb -g -DANDROID -
c areadlink.c
In file included from /data/android-8-toolchain/bin/../sysroot/usr/
include/sys/time.h:33,
                 from /data/android-8-toolchain/bin/../sysroot/usr/
include/time.h:32,
                 from /data/android-8-toolchain/bin/../sysroot/usr/
include/wchar.h:39,
                 from ./stdint.h:483,
                 from /data/android-8-toolchain/bin/../lib/gcc/arm-
linux-androideabi/4.4.3/include-fixed/sys/types.h:43,
                 from areadlink.c:30:
/data/android-8-toolchain/bin/../sysroot/usr/include/linux/time.h:20:
error: expected specifier-qualifier-list before 'time_t'
/data/android-8-toolchain/bin/../sysroot/usr/include/linux/time.h:26:
error: expected specifier-qualifier-list before 'time_t'

It seems like time_t is not defined in the standalone toolchain's
header files.  Does anyone have any idea if there is a fix or
workaround for this?  Thanks.

Dominique


+++++解决方法

I just hit this too. It looks like libiconv uses gnulib which will
create a fallback stdint.h under the srclib/ directory during ./
configure. That fallback header then wreaks havoc because the android
toolchain itself provides headers that expect to include stdint.h and
they are being forced to include the one generated during ./configure
resulting in a circular dependency and sys/types.h doesn't get
included with the time_t typedef.

After delving a bit into the sysm4/stdinc.m4 file I luckily found it's
possible to override the gnulib macro so it never writes out a
fallback stdint.h if you set gl_cv_header_working_stdint_h=
yes

So my full configure line is now:
gl_cv_header_working_stdint_h=yes ./configure --host=arm-linux-
androideabi

That seems to get things building for me with libiconv-1.14

I hope that helps,
regards,
- Robert


<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(64) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
posted @ 2016-02-01 00:00  张同光  阅读(75)  评论(0编辑  收藏  举报