• ltp 编译


    git clone git@github.com:linux-test-project/ltp.git

    目录下的build.sh,将

    make autotools
    ./configure
    make
    make install
    等步骤串在一起了。


    #CONFIGURE_OPTS_IN_TREE="--with-open-posix-testsuite --with-realtime-testsuite" 注释掉 不编译
    # TODO: open posix testsuite is currently broken in out-tree-build. Enable it once it's fixed.
    #CONFIGURE_OPTS_OUT_TREE="--with-realtime-testsuite" 注释掉 不编译
    
    
    usage()
    {
        cat << EOF
    Usage:
    $0 [ -c CC ] [ -o TREE ] [ -p DIR ] [ -t TYPE ]
    $0 -h
    
    Options:
    -h       Print this help
    -c CC    Define compiler ($CC variable)
    -o TREE  Specify build tree, default: $DEFAULT_TREE
    -p DIR   Change installation directory. For in-tree build is this value passed
             to --prefix option of configure script. For out-of-tree build is this
             value passed to DESTDIR variable (i.e. sysroot) of make install
             target, which means that LTP will be actually installed into
             DIR/PREFIX (i.e. DIR/opt/ltp).
             Default for in-tree build: '$DEFAULT_PREFIX'
             Default for out-of-tree build: '$DEFAULT_PREFIX/opt/ltp'
    -t TYPE  Specify build type, default: $DEFAULT_BUILD
    
    BUILD TREE:
    in       in-tree build
    out      out-of-tree build
    
    BUILD TYPES:
    32       32-bit in-tree build
    cross    cross-compile in-tree build (requires set compiler via -c switch)
    native   native in-tree build
    EOF
    }
    
    
    while getopts "c:hio:p:t:" opt; do
        case "$opt" in
        c) CC="$OPTARG";;
        h) usage; exit 0;;
        i) install=1;; #在usage中没有这一项,所以容易忽略,全部编译完了才想起来的话 也可以加一条 make install
        o) case "$OPTARG" in
            in|out) tree="$OPTARG";;
            *) echo "Wrong build tree '$OPTARG'" >&2; usage; exit 1;;
            esac;;
        p) PREFIX="$OPTARG";;
        t) case "$OPTARG" in
            32|cross|native) build="$OPTARG";;
            *) echo "Wrong build type '$OPTARG'" >&2; usage; exit 1;;
            esac;;
        ?) usage; exit 1;;
        esac
    done

    修改三处:

    #CONFIGURE_OPTS_IN_TREE="--with-open-posix-testsuite --with-realtime-testsuite" 注释掉
    # TODO: open posix testsuite is currently broken in out-tree-build. Enable it once it's fixed.
    #CONFIGURE_OPTS_OUT_TREE="--with-realtime-testsuite" 注释掉
    
    PREFIX="$DEFAULT_PREFIX"
    build="$DEFAULT_BUILD"
    tree="$DEFAULT_TREE"
    #install=0
    install=1 #默认安装

    如何调用

    ./build.sh -c arm-linux-gnueabihf-gcc -t cross -i -p /home/zhangyi/ltp-install
     
  • 相关阅读:
    echarts折线图
    利用echarts制作词云
    本周总结
    本周总结
    云服务器项目数据库连接超时问题解决
    iOS下载图片失败
    解决后台json数据返回的字段需要替换的问题
    设置User Agent
    Xcode升级到9.3之后pod问题
    gitLab创建自己的私有库
  • 原文地址:https://www.cnblogs.com/idyllcheung/p/14068920.html
Copyright © 2020-2023  润新知