返回> 网站首页
linux编译so库 - iconv、jsoncpp、sqlite、openssl、curl
yoours2023-03-08 21:00:06
简介一边听听音乐,一边写写文章。
一、编译
1. iconv
a) ./configure --prefix=/root/2023/libiconv-1.17/build
b) make
c) make install
2. jsoncpp
a) 创建jsoncpp文件夹拷贝源码,同级目录下创建build文件夹,在此文件夹中打开终端执行
cmake ../jsoncpp/ -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DINCLUDE_INSTALL_DIR=/root/2023/jsoncpp-1.9.5/build/include -DARCHIVE_INSTALL_DIR=/root/2023/jsoncpp-1.9.5/build
make
make install
3. sqlite3
./configure --prefix=/root/2023/sqlite-autoconf-3410000/build/
make
make install
4. openssl
a) ./config no-asm no-async -shared no-tests --prefix=/root/2023/openssl-1.1.1t/build/
b) make
c) make install
5. curl
./configure --prefix=/root/2023/curl-7.88.1/build LDFLAGS=-Wl,-rpath=./,--disable-new-dtags --with-openssl=/root/2023/openssl-1.1.1t/build --disable-tls-srp --disable-rtsp --disable-hsts --disable-alt-svc --disable-mqtt --disable-ftp --disable-tftp --disable-smb --disable-gopher --disable-imap --disable-pop3 --disable-smtp --disable-telnet --disable-dict --disable-tests
make
make install
二、交叉编译
下载编译工具链
https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
1. iconv
a) ./configure --prefix=/root/2023/libiconv-1.17/build CC=/tools/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc --host=aarch64-linux-gnu
b) make
c) make install
2. jsoncpp
a) 创建jsoncpp文件夹拷贝源码,同级目录下创建build文件夹,在此文件夹中打开终端执行
cmake ../jsoncpp/ -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER=/tools/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release
make
make install
3. sqlite3
./configure --prefix=/root/2023/sqlite-autoconf-3410000/build/ CC=/tools/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc --host=aarch64-linux-gnu
make
make install
4. openssl
a) ./config no-asm no-async -shared no-tests --prefix=/root/2023/openssl-1.1.1t/build/ --cross-compile-prefix=/tools/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
b) make
c) make install
5. curl
./configure --prefix=/root/2023/curl-7.88.1/build LDFLAGS=-Wl,-rpath=./,--disable-new-dtags --with-openssl=/root/2023/openssl-1.1.1t/build CC=/tools/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc --host=aarch64-linux-gnu --disable-tls-srp --disable-rtsp --disable-hsts --disable-alt-svc --disable-mqtt --disable-ftp --disable-tftp --disable-smb --disable-gopher --disable-imap --disable-pop3 --disable-smtp --disable-telnet --disable-dict --disable-tests
make
make install
6. Jetson nano
a) mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/root/2023/JetsonGPIO-master/build/ -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER=/tools/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-lpthread