LIBSSH2移植
libssh2使用libgcrypto加密库实现加密(大部分会选择openssl库),gcrypto库依赖libgpg-error,以下是相关库的编译过程和遇到的问题。
libgpg-error-1.42编译:
./configure --prefix=/home/work/ssh2/build CC=/opt/peta_toolchain/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc --host=aarch64-linux --build=aarch64-linux-gnu
make && make install
问题总结:
编译过程遇到gpg-error.h文件无法生成问题
./gpg-error.h.in:508: error including `./syscfg/lock-obj-pub.gnu-.h': No such file or directory
Makefile:1757: recipe for target 'gpg-error.h' failed
调整–host=aarch64-linux(原先为aarch64-linux-gnu-) 增加–build=aarch64-linux-gnu,可以识别出$(src/syscfg/lock-obj-pub.aarch64-unknown-linux-gnu.h)文件,以生成gpg-error.h
下面是官方回复的此问题解决方法:
Cross-Compiling
Libgpg-error needs to figure out some platform specific properties.
These are used to build the platform specific gpg-error.h file. The
detection is done during build time but can’t be done when
cross-compiling. Thus if you run into an error during building you
need to figure out these values. You may use these commands:build=" ( b u i l d − a u x / c o n f i g . g u e