Boa移植到Android——ztg


[root@localhost boa-0.94.13]# pwd
/opt/cBPM-android/boa-0.94.13
[root@localhost boa-0.94.13]# cd src

[root@localhost src]# flex  boa_lexer.l        //生成lex.yy.c
[root@localhost src]# ls lex.yy.c
lex.yy.c
[root@localhost src]# ls *y
boa_grammar.y
[root@localhost src]# yacc -d boa_grammar.y        //生成 y.tab.c  y.tab.h
[root@localhost src]# ls y.tab.*
y.tab.c  y.tab.h
[root@localhost src]# cd ..

[root@localhost boa-0.94.13]# gedit src/configure

CC="$ac_cv_prog_CC"
替换为:
CC="/opt/android-on-linux/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc"

./src/boa.h
添加:
#include <stddef.h>             /* ztg add */


# grep ' size_t;' -R /opt/android-on-linux/android-ndk-r10d/platforms/android-21/arch-arm/usr/include/|grep typedef|grep size_t

/opt/android-on-linux/android-ndk-r10d/platforms/android-21/arch-arm/usr/include/linux/stddef.h
添加:
typedef unsigned long size_t;
typedef struct __locale_t* locale_t;
typedef __WCHAR_TYPE__ wchar_t;
#define    STDIN_FILENO    0    /* Standard input.  */
#define    STDOUT_FILENO    1    /* Standard output.  */
#define    STDERR_FILENO    2    /* Standard error output.  */
#define NULL ((void*)0)
#define offsetof(s,m) (size_t)&(((s *)0)->m)


[root@localhost boa-0.94.13]#

export NDK_ROOT="/opt/android-on-linux/android-ndk-r10d"
export TOOLCHAIN="$NDK_ROOT/platforms/android-21/arch-arm"
export ARMVERSION=7
export SYSROOT="$TOOLCHAIN"
export CFLAGS="--sysroot=$SYSROOT -I$NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/include/ -I$NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/include-fixed/ -I$NDK_ROOT/platforms/android-21/arch-arm/usr/include/ -I$NDK_ROOT/platforms/android-21/arch-arm/usr/include/linux/ -I/opt/cBPM-android/boa-0.94.13/src"
export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-pie -fPIE"
export CPATH="$NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin"
export CPP="$CPATH/arm-linux-androideabi-cpp"
export CXX="$CPATH/arm-linux-androideabi-g++"
export CC="$CPATH/arm-linux-androideabi-gcc"
export LD="$CPATH/arm-linux-androideabi-ld"
export AR="$CPATH/arm-linux-androideabi-ar"

[root@localhost boa-0.94.13]# gl_cv_header_working_stdint_h=yes ./src/configure --host=arm-linux-androideabi
[root@localhost boa-0.94.13]# ./src/configure --host=arm-linux-androideabi

[root@localhost boa-0.94.13]# make -j5


<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>
阅读(35) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
posted @ 2016-02-01 00:00  张同光  阅读(74)  评论(0编辑  收藏  举报