• linux开源库交叉编译汇总


    openssl:

    makefile中搜索-m64选项并删除,共两处
    1.

    ./config no-asm shared --prefix=$(pwd)/_install --cross-compile-prefix=arm-none-linux-gnueabi-
    ./config no-asm no-async shared --prefix=$(pwd)/_install --cross-compile-prefix=arm-himix100-linux-
    make
    make install
    1.  
    ./config no-asm -shared --prefix=$(pwd)/_install
    make CROSS_COMPILE=arm-rockchip-linux-gnueabihf-
    make install

    sqlite3:

    ./configure --prefix=`pwd`/_install --host=arm-rockchip-linux-gnueabihf CC=arm-rockchip-linux-gnueabihf-gcc
    • 1

    paho-mqtt-c:

    1.  
    cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/_install -DPAHO_BUILD_STATIC=TRUE -DCMAKE_C_COMPILER=arm-rockchip-linux-gnueabihf-gcc
    1.  
    cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/_install -DPAHO_BUILD_STATIC=TRUE -DCMAKE_C_COMPILER=arm-rockchip-linux-gnueabihf-gcc -DPAHO_WITH_SSL=TRUE -DCMAKE_C_FLAGS+=$HOME/openssl/_install/include -DCMAKE_LIBRARY_PATH+=$HOME/openssl/_install/lib

    curl:

    1.  
    ./configure --prefix=$(pwd)/_install --host=arm-rockchip-linux-gnueabihf CC=arm-rockchip-linux-gnueabihf-gcc --with-ssl=$HOME/openssl/_install```
    1.  
    ./configure --prefix=`pwd`/_install --host=arm-rockchip-linux-gnueabihf CC=arm-rockchip-linux-gnueabihf-gcc --without-zlib --without-ssl

    python3:

    ./configure --prefix=`pwd`/_install --host=mipsel-openwrt-linux --build=mips CC=mipsel-openwrt-linux-gcc --enable-shared --disable-ipv6 ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=no --enable-optimizations

    ffmpeg:

    1. 非交叉编译
    ./configure --prefix=`pwd`/_install --enable-shared --enable-nonfree --enable-gpl --disable-asm \
    --enable-libx264 --enable-libx265 --enable-libmp3lame --enable-libxvid --enable-libfdk-aac --enable-openssl --enable-librtmp \
    --extra-cflags='-I$HOME/x264-master/_install/include -I$HOME/lame-3.100/_install/include -I$HOME/xvidcore/build/generic/_install/include -I$HOME/fdk-aac-2.0.1/_install/include -I$HOME/x265_3.2.1/build/_install/include  -I$HOME/openssl-1.0.1u/_install/include  -I$HOME/rtmpdump-2.3/librtmp/_install/include' \
    --extra-ldflags='-L$HOME/x264-master/_install/lib -L$HOME/lame-3.100/_install/lib -L$HOME/xvidcore/build/generic/_install/lib -L$HOME/fdk-aac-2.0.1/_install/lib -L$HOME/x265_3.2.1/build/_install/lib  -L$HOME/openssl-1.0.1u/_install/lib -L$HOME/rtmpdump-2.3/librtmp/_install/lib' \
    --extra-libs=-ldl
    1. 交叉编译
    ./configure --prefix=`pwd`/_install --enable-cross-compile --cpu=cortex-a7 --arch=armv7 --target-os=linux  \
    --cross-prefix=arm-himix100-linux- --cc=arm-himix100-linux-gcc \
    --enable-shared --enable-gpl --disable-asm --enable-pthreads --disable-programs \
    --enable-libx264 \
    --extra-cflags='-I../x264-master/_install/include' \
    --extra-ldflags='-L../x264-master/_install/lib' \
    --extra-libs='-ldl -lm -lpthread'
    1. 编译过程可能会报错,可以手动添加PKG_CONFIG_PATH
    export PKG_CONFIG_PATH=$HOME/x265_3.2.1/build/_install/lib/pkgconfig:$HOME/rtmpdump-2.3/librtmp/_install/lib/pkgconfig:$HOME/openssl-1.0.1u/_install/lib/pkgconfig

    librtmp:

    librtmp版本有点旧,需要使用旧的openssl,如openssl-1.0.1u

    make prefix=`pwd`/_install XCFLAGS+='-I$HOME/openssl-1.0.1u/_install/include -I$HOME/zlib/_install/include' \
    XLDFLAGS+='-L$HOME/openssl-1.0.1u/_install/lib -L$HOME/git/zlib/_install/lib'

    libx264:

    ./configure --prefix=`pwd`/_install --disable-asm --enable-shared --enable-static --enable-pic --host=arm-himix100-linux --cross-prefix=arm-himix100-linux-

    nginx:

    1. nginx添加rtmp模块
    ./configure --add-module=../nginx-rtmp-module --with-http_ssl_module --prefix=`pwd`/_install
    1. nginx添加flv模块
    ./configure --add-module=../nginx-http-flv-module  --with-http_ssl_module --prefix=`pwd`/_install 

    Valgrind:

    ./configure --host=arm-rockchip-linux-gnueabihf CC=arm-rockchip-linux-gnueabihf-gcc CPP=arm-rockchip-linux-gnueabihf-cpp CXX=arm-rockchip-linux-gnueabihf-g++ AR=arm-rockchip-linux-gnueabihf-ar --prefix=`pwd`/_install

    dlib:

    cmake .. -DCMAKE_INSTALL_PREFIX=./_install -DCMAKE_BUILD_TYPE=Release -DDLIB_NO_GUI_SUPPORT=OFF -DCMAKE_C_COMPILER=arm-rockchip-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-rockchip-linux-gnueabihf-g++ 

    gdb:

    ./configure --prefix=`pwd`/_install --target=arm-rockchip-linux-gnueabihf --host=arm-rockchip-linux-gnueabihf CC=arm-rockchip-linux-gnueabihf-gcc 

    gdb调试时,可以手动添加链接库
    set solib-absolute-prefix “ H O M E / n f s / l i b : HOME/nfs/lib: HOME/nfs/lib:HOME/nfs/usrlib”
    set solib-search-path “ H O M E / n f s / l i b : HOME/nfs/lib: HOME/nfs/lib:HOME/nfs/usrlib”

    libcoap:

    ./configure --prefix=`pwd`/_install --disable-doxygen --disable-dtls  --host=mipsel-openwrt-linux CC=$HOME/lede-toolchain-ramips-mt7688_gcc-5.4.0_musl-1.1.16.Linux-x86_64/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/bin/mipsel-openwrt-linux-gcc --without-openssl  --disable-manpages

    i2ctools:

    export CC=mipsel-openwrt-linux-gcc
    export STRIP=mipsel-openwrt-linux-strip
    export AR=mipsel-openwrt-linux-ar
    make USE_STATIC_LIB=1 
    make install PREFIX=$(pwd)/_install

    qrencode:

    ./configure --prefix=$(pwd)/_install --host=arm-rockchip-linux-gnueabihf CC=arm-rockchip-linux-gnueabihf-gcc --enable-static

    zlog:

    make PREFIX=$(pwd)/_install CC=arm-rockchip-linux-gnueabihf-gcc
    make PREFIX=$(pwd)/_install install

    gsoap:

    1. 编译
    ./configure --prefix=`pwd`/_install --with-openssl=$HOME/openssl-1.0.1u/_install --with-zlib=$HOME/git/zlib/_install --enable-samples
    ./configure --prefix=`pwd`/_install --disable-c-locale --without-openssl --disable-ssl --enable-samples
    1. 生成onvif客户端、服务端代码(具体细节需要再查询)
    ./wsdl2h -o onvif.h -P -x -c -s -t ./typemap.dat http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl http://www.onvif.org/onvif/ver10/event/wsdl/event.wsdl http://www.onvif.org/onvif/ver10/display.wsdl http://www.onvif.org/onvif/ver10/deviceio.wsdl http://www.onvif.org/onvif/ver20/imaging/wsdl/imaging.wsdl http://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl http://www.onvif.org/onvif/ver10/receiver.wsdl http://www.onvif.org/onvif/ver10/recording.wsdl http://www.onvif.org/onvif/ver10/search.wsdl http://www.onvif.org/onvif/ver10/network/wsdl/remotediscovery.wsdl http://www.onvif.org/onvif/ver10/replay.wsdl http://www.onvif.org/onvif/ver20/analytics/wsdl/analytics.wsdl http://www.onvif.org/onvif/ver10/analyticsdevice.wsdl http://www.onvif.org/ver10/actionengine.wsdl http://www.onvif.org/ver10/pacs/accesscontrol.wsdl http://www.onvif.org/ver10/pacs/doorcontrol.wsdl
    ./soapcpp2 -L -x -C -2 -I../share/gsoap -I../share/gsoap/import -I../share/gsoap/plugin -I../share/gsoap/custom onvif.h

    cunit:

    autoheader
    automake --add-missing

    1. makefile编译
    ./configure --prefix=`pwd`/_install --host=arm-rockchip-linux-gnueabihf CC=arm-rockchip-linux-gnueabihf-gcc
    1. cmake编译
    cmake -DCMAKE_C_COMPILER=arm-rockchip-linux-gnueabihf-gcc -DCMAKE_INSTALL_PREFIX=`pwd`/_install ../
    make install DESTDIR=../_install
  • 相关阅读:
    在bindingNavigator1中加入具有更好体验性的DateTimePicker
    static的初始化顺序 (转)
    C#数据结构求最大公约数和最小公倍数[辗转相除法]
    DataGridView控件显示行号
    C# 小票打印机 直接打印 无需驱动[转]
    Core Data 中遇到的一些问题
    字符指针不分配存储区,字符常量存储于静态数据区
    传送门
    Error Set
    实现类似iPhone通讯录新增名片,保存,之后可进行编辑操作的功能
  • 原文地址:https://www.cnblogs.com/lidabo/p/16659011.html
Copyright © 2020-2023  润新知