bonnie++、dbench、iozone在android上的移植

来源:互联网 发布:win10剪贴板软件 编辑:程序博客网 时间:2024/06/09 08:42

一 概述——移植环境

目标板:ARM、Android

交叉编译工具:友善之臂的arm-linux-4.4.3

主机:Fedora14

二 bonnie++

修改 zcav.cpp添加引用文件string.h

修改makefile里的CXX=arm-linux-g++ CFLAGS = -static 

运行->  $  make

三  iozone

修改

CC      = arm-linux-cc -static

GCC     = arm-linux-gcc
CCS     = /opt/arm-linux-443/bin/cc
NACC    = /opt/arm-linux-443/bin/cc
CFLAGS  = -Wall -static

运行->  $  make linux-arm

四 dbench

1、dbench需要popt支持。

        编译popt

        下载popt1.13

        因为会出现编译错误,从网上下载了popt-1.13-configure

        $ ./popt-1.13-configure CC=arm-linux-gcc --build=i686-pc-linux --target=arm-linux --host=arm-linux --enable-shared --enable-shared --enable-static --prefix=/opt/arm-linux-443

        $ make

        $ su

密码:********

        $ make install

        这一步之后,就将popt的东西都自动安装到/opt/arm-linux-443下面了。

        当时我不会设置路径,于是也将popt.h和所有的.libs下的文件都拷贝到dbench的根目录下面。

        cd到dbench跟目录下。

        $./autogen.sh

        $ ./configure CC=arm-linux-gcc --build=i686-pc-linux --target=arm-linux --host=arm-linux CFLAGS="-static" LIBS="-L /opt/arm-linux-443/lib"

        对产生的makefile进行修改,添加-static选项

        $ make



小技巧,观看编译时候的输出,是不是少了-static啦,是不是arm-linux-gcc啦,也可以直接在arm-linux-gcc后面直接加-static


以上要灵活运用,有的时候要拷贝.h文件,有的时候要直接在 arm-linux-gcc后面直接加 -static


原创粉丝点击