openwrt: 编译失败 "Please install the openssl library (with development headers)"

openwrt: 编译失败 “Please install the openssl library (with development headers)”

编译openwrt时,突然发现如下问题,困扰了好久。网上资料说安装openssl,libssl,libssl-dev,但是我ubuntu1604系统中发现,这些都已经安装了。最终,找到了解决办法:

解决办法

1. 方法1:

sudo apt install openssl libssl libssl-dev -y

如果不行,则试试如下方案

2. 方法2:

sudo apt remove libssl-dev

可能是libssl库冲突吧,我也搞不懂,open的检测机制。
简单看了下makefile,主要涉及到以下几个.mk文件

include/prereq-build.mk
包含如下mk文件
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/host-build.mk

检测libssl的地方,看不懂:(希望有人能够帮忙解惑)

sean@sean$ vi include/prereq-build.mk

$(eval $(call TestHostCommand,libssl, \
    Please install the openssl library (with development headers), \
    echo 'int main(int argc, char **argv) { SSL_library_init(); return 0; }' | \
        gcc $(HOST_CFLAGS) -include openssl/ssl.h -x c -o $(TMP_DIR)/a.out - -lcrypto -lssl $(HOST_LDFLAGS)))

问题详情

sean@sean$ make V=s
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'gcc'... ok.
Checking 'working-gcc'... ok.
Checking 'g++'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'libssl'... failed.
Checking 'tar'... ok.
Checking 'find'... ok.
Checking 'bash'... ok.
Checking 'patch'... ok.
Checking 'diff'... ok.
Checking 'cp'... ok.
Checking 'seq'... ok.
Checking 'awk'... ok.
Checking 'grep'... ok.
Checking 'getopt'... ok.
Checking 'stat'... ok.
Checking 'md5sum'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'wget'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'svn'... ok.
Checking 'git'... ok.
Checking 'file'... ok.
Checking 'openssl'... ok.
Checking 'ldconfig-stub'... ok.

Build dependency: Please install the openssl library (with development headers)

/home/sean/work/tmp/openwrt_cat6/include/prereq.mk:12: recipe for target 'prereq' failed
Prerequisite check failed. Use FORCE=1 to override.
/home/sean/work/tmp/openwrt_cat6/include/toplevel.mk:140: recipe for target 'staging_dir/host/.prereq-build' failed
make[2]: *** [staging_dir/host/.prereq-build] Error 1
/home/sean/work/tmp/openwrt_cat6/include/toplevel.mk:69: recipe for target 'prepare-tmpinfo' failed
make[1]: *** [prepare-tmpinfo] Error 2
/home/sean/work/tmp/openwrt_cat6/include/toplevel.mk:181: recipe for target 'world' failed
make: *** [world] Error 2

你可能感兴趣的:(Openwrt)