【问题标题】:compiling wget with static linking, self compiled (open)ssl library linking issue使用静态链接编译 wget,自编译(打开)ssl 库链接问题
【发布时间】:2012-03-22 06:16:13
【问题描述】:

我正在尝试使用静态链接编译 wget,但遇到了 ssl 问题。 我的设置没有安装ssl,所以我必须自己编译它,它似乎没问题,这是/usr/local/ssh/lib的列表:

/usr/local/ssl/lib> ls -la
total 2000
drwxr-xr-x  3 root root    4096 2012-03-22 14:28 .
drwxr-xr-x  9 root root    4096 2012-03-22 14:28 ..
-rw-r--r--  1 root root 1752954 2012-03-22 14:28 libcrypto.a
-rw-r--r--  1 root root  272388 2012-03-22 14:28 libssl.a
drw-r--r--  2 root root    4096 2012-03-22 14:28 pkgconfig

尝试配置编译时:

wget-1.13> env LDFLAGS="-L/usr/local/ssh/lib" ./configure --with-ssl=openssl
.....
configure: error. openssl development libraries not found 

有什么提示可能是错的吗?我为 linux-elf 编译了 openssl

【问题讨论】:

    标签: compilation openssl static-libraries wget


    【解决方案1】:

    好的,看起来这是经典的“无法阅读自己的作品”问题。 上面我试图链接到 ssh 库,而不是 ssl O_o。

    为了将来参考,使用 openssl 链接和编译静态 wget 的正确过程是:

    $>env CPPFLAGS="-I/dir/to/openssl/include" LDFLAGS="-L/dir/to/ssl/lib" ./configure --with-ssl=openssl
    

    包括可以是 ie: ~/openssl/openssl-0.9.8u/include(已编译的 openssl 头文件) 图书馆可能在即: usr/local/ssl/lib(包含 libssl.a 的文件夹)

    然后编译:

    $>make CPPFLAGS="-I/dir/to/openssl/include" LDFLAGS="-L/dir/to/ssl/lib -all-static"
    

    二进制文件将在 src 文件夹中。

    请注意,在某些系统上 -all-static 选项应该只是 -static。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-06
    相关资源
    最近更新 更多