OpenWRT编译 -- 解决 Package test is missing dependencies for the following libraries libcrypto.so.1.1

根据项目要求需要用到 openssl 这个库,看了看编译环境幸好本身就集成了该库。但在编译 openssl 的功能时,碰到缺少类库的错误。

Package user-crypto-test is missing dependencies for the following libraries:

libcrypto.so.1.1

 看了看 编译器路径

/home/song/openwrt/openwrt_bak/staging_dir/target-mipsel_24kc_musl/usr/lib

这个目录下是存在 libcrypto.so.1.1 以及 libcrypto.so 的。

然后在 make menuconfig 里面,选择关于 openssl-crypto 的选项,主要涉及到的有:

Libraries --> SSL --> libopenssl

Utilities --> openssl-util

 /home/song/openwrt/openwrt_bak/staging_dir/target-mipsel_24kc_musl/pkginfo/libcrypto.provides 

下面增加内容

/openwrt_bak/staging_dir/target-mipsel_24kc_musl/usr/lib

libcrypto.so.1.1

如果在此文件夹下不存在文件 libcrypto.provides ,那么 Makefile 中新增如下内容

也就是在 Makefile 定义 Package/cpp-demo/extra_provides 宏来强制性地将那几个库加进去。

define Package/$(PKG_NAME)/extra_provides
    echo "/openwrt_bak/staging_dir/target-mipsel_24kc_musl/usr/lib"; \
    echo "libcrypto.so.1.1"                                   
endef

请注意后面的 \ 字符,如果有多个的话是需要 \ 字符的 ,不然会报语法错误的提示。

然后 make V=99 进行编译,之后出现异常信息 

Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for user-crypto-test:
*     libcrypto
* opkg_install_cmd: Cannot install package user-crypto-test.
package/Makefile:65: recipe for target 'package/install' failed
make[2]: *** [package/install] Error 255
make[2]: Leaving directory '/home/song/openwrt/openwrt_bak'
package/Makefile:104: recipe for target '/home/song/openwrt/openwrt_bak/staging_dir/target-mipsel_24kc_musl/stamp/.package_install' failed
make[1]: *** [/home/song/openwrt/openwrt_bak/staging_dir/target-mipsel_24kc_musl/stamp/.package_install] Error 2
make[1]: Leaving directory '/home/song/openwrt/openwrt_bak'
/home/song/openwrt/openwrt_bak/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 2

如果实在不知道该怎么解决,那么修改 Makefile,注释掉(下面的注释的部分):

define Package/$(PKG_NAME)                                                                      
  SECTION:=utils
  CATEGORY:=Songshuai Package
  SUBMENU:=Openssl Crypto Software Testing modules
  TITLE:=This is songshuai $(PKG_NAME)
  MAINTAINER:=Songshuai <[email protected]>
#  DEPENDS:=+libcrypto
endef

然后编译即可正常通过。

但是总觉得有问题,不够Official,但是不知道在什么地方,反正好用暂时好用,先放着吧,等有时间在试试吧。

猜你喜欢

转载自blog.csdn.net/zhemingbuhao/article/details/103720552