免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2524 | 回复: 2
打印 上一主题 下一主题

[其它] 编译msmtp支持openssl时遇到的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-04-17 22:51 |只看该作者 |倒序浏览

最近要移植msmtp到arm开发板上,普通的msmtp没有问题,可以正常使用
但现在需要使用TLS安全连接,于是要重新编译msmtp来支持openssl
但编译过程中遇到了一些问题,自己搞了一下午也没解决,求各位帮忙看看

编译的配置为:
./configure --host=arm-hisiv100nptl-linux --with-ssl=openssl --with-libidn=no --with-gnome-keyring=no CC=arm-hisiv100nptl-linux-gcc libssl_CFLAGS=-I/usr/local/arm_openssl/include libssl_LIBS=-L/usr/local/arm_openssl/lib

配置通过,但在make时出错,显示
  CCLD   msmtp
tls.o: In function `tls_close':
/opt/trans/msmtp-1.4.30/src/tls.c:1711: undefined reference to `SSL_shutdown'
/opt/trans/msmtp-1.4.30/src/tls.c:1712: undefined reference to `SSL_free'
/opt/trans/msmtp-1.4.30/src/tls.c:1713: undefined reference to `SSL_CTX_free'
tls.o: In function `openssl_io_error':
/opt/trans/msmtp-1.4.30/src/tls.c:1323: undefined reference to `ERR_get_error'
/opt/trans/msmtp-1.4.30/src/tls.c:1350: undefined reference to `ERR_get_error'
/opt/trans/msmtp-1.4.30/src/tls.c:1350: undefined reference to `ERR_error_string'
。。。
。。。
等等错误

我觉得应该是没有成功连接到库,于是就在配置时加上LIBS,变成
./configure --host=arm-hisiv100nptl-linux --with-ssl=openssl --with-libidn=no --with-gnome-keyring=no CC=arm-hisiv100nptl-linux-gcc LIBS=-lssl libssl_CFLAGS=-I/usr/local/arm_openssl/include libssl_LIBS=-L/usr/local/arm_openssl

但配置通不过,报错
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking build system type... i686-pc-linux-gnu
checking host system type... arm-hisiv100nptl-linux-gnu
checking target system type... arm-hisiv100nptl-linux-gnu
checking for arm-hisiv100nptl-linux-gcc... arm-hisiv100nptl-linux-gcc
checking whether the C compiler works... no
configure: error: in `/opt/trans/msmtp-1.4.30':
configure: error: C compiler cannot create executables
See `config.log' for more details

折腾了一下午,也没成功,希望各位大神能帮帮忙,提供下思路也好,在线等了。。。

论坛徽章:
0
2 [报告]
发表于 2013-04-17 23:43 |只看该作者
本帖最后由 txgc_wm 于 2013-04-18 00:12 编辑

楼主采用以下两种方式配置一下

$ CC=arm-hisiv100nptl-linux-gcc ./configure --host=arm-hisiv100nptl-linux --with-ssl=openssl --with-libidn=no --with-gnome-keyring=no --with-libssl-prefix=/usr/local/arm_openssl



$CC=arm-hisiv100nptl-linux-gcc  ./configure --host=arm-hisiv100nptl-linux --with-ssl=openssl --with-libidn=no --with-gnome-keyring=no  LIBS=-lssl libssl_CFLAGS=-I/usr/local/arm_openssl/include libssl_LIBS=-L/usr/local/arm_openssl


向楼主顺便推荐一篇这方面移植的文章:
http://blog.csdn.net/shelleyhuhu/article/details/5381180

论坛徽章:
0
3 [报告]
发表于 2013-04-18 08:46 |只看该作者
回复 2# txgc_wm
按你所给的配置和我自己的配置效果是一样的
不过受你连接文章的启发
我进入src目录,强制修改Makefile文件,加上链接库,以及库路径后,编译成功了
非常感谢你的帮助


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP