美文网首页
itop4412 python,boost,libxml2移植

itop4412 python,boost,libxml2移植

作者: Jason416 | 来源:发表于2019-05-31 17:03 被阅读0次

    python移植

    host:

    ./configure
    make python Parser/pgen
    mv python hostpython
    mv Parser/pgen Parser/hostpgen
    make distclean
    

    optional:

    echo ac_cv_file__dev_ptmx=yes > config.site
    echo ac_cv_file__dev_ptc=yes >> config.site
    export CONFIG_SITE=config.site
    

    configure arm:

    CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ AR=arm-linux-gnueabihf-ar RANLIB=arm-linux-gnueabihf-ranlib
    ./configure --host=arm-linux --build=x86_64-linux-gnu --prefix=/home/jason/lib/arm-python --disable-ipv6 --enable-shared
    

    build:

    chmod 777 ./setup.py
    make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="arm-linux-gnueabihf-gcc -shared" CROSS_COMPILE=arm-linux-gnueabihf- CROSS_COMPILE_TARGET=yes HOSTARCH=arm-linux BUILDARCH=x86_64-linux-gnu
    make install HOSTPYTHON=./hostpython BLDSHARED="arm-linux-gnueabihf-gcc -shared" CROSS_COMPILE=arm-linux-gnueabihf- CROSS_COMPILE_TARGET=yes prefix=/home/jason/lib/arm-python
    

    Note

    • 编译好的目录可由其他库引用,具体如下:
    • include paths: ~/lib/arm-python/include
    • library paths: ~/lib/arm-python/lib

    boost_python移植

    • 备份宿主机的/usr/include/python2.7文件夹
    • 将移植好的arm-python中的头文件拷贝到/usr/include/python2.7
    • ./bootstrap.sh
    • 修改生成的project-config.jam文件,具体可以参照

    修改:(共五处)

    • using gcc : arm : arm-none-linux-gnueabi-gcc ;
    • option.set prefix :(交叉编译器所在位置);
    • option.set exec-prefix :(交叉编译器所在位置)/bin ;
    • option.set libdir :(交叉编译器所在位置)/lib ;
    • option.set includedir :(交叉编译器所在位置)/include ;
    • ./bjam stage
    • 还原宿主机的python2.7头文件夹
    • 编译好的目录可由其他库引用,具体如下:
    • include paths: ~/lib/boost/boost
    • library paths: ~/lib/boost/stage/lib

    libxml2移植

    1. mkdir build
    2. ./configure CC=/usr/bin/arm-linux-gnueabihf-gcc --host=arm-linux --prefix=/home/jason/lib/libxml2/build/ --with-python=/home/jason/lib/libxml2/python
      CFLAGS="-I/home/jason/lib/arm-python/include/python2.7/" LDFLAGS="-L/home/jason/lib/arm-python/lib"
    3. make -j8
    4. make install
    • 编译好的目录可由其他库引用,具体如下:
    • include paths: ~/lib/libxml2/build/include
    • library paths: ~/lib/libxml2/build/lib

    相关文章

      网友评论

          本文标题:itop4412 python,boost,libxml2移植

          本文链接:https://www.haomeiwen.com/subject/ksegtctx.html