红联Linux门户
Linux帮助

在armlinux上添加DNS库

发布时间:2008-10-01 10:25:35来源:红联作者:Cuibtoy
工作需要要在嵌入linux上实现DNS, 从Delphi的Indy9中移植了一个dns,用了半年了还可以。

今日偶然看到了网上有源码(竟然原来没有搜到)

1. 找到bind-9.5.0.tar.gz源码,其中有包含DNS协议的源码,./configure --prefix=/home/hxs/lib --host=arm-linux,编译提示

checking for struct lifconf... no
checking if unistd.h or sys/types.h defines fd_set... yes
checking whether byte ordering is bigendian... no
checking for OpenSSL library... using OpenSSL from /usr/lib and /usr/include
checking whether linking with OpenSSL works... assuming it does work on target platform
checking whether linking with OpenSSL requires -ldl... unknown
configure: error: OpenSSL has unsupported dynamic loading

原来还需要OpenSSL支持。

2. 下载openssl http://www.openssl.org/ 我下载的是i版

./config no-asm --prefix=/home/hxs/lib #去掉asm

修改Makefile, 把其中的gcc改成arm-linux-gcc

make; make install

可以看到

drwxr-xr-x 2 hxs users 4096 09-28 16:35 engines
-rw-r--r-- 1 hxs users 2307146 09-28 16:35 libcrypto.a
-rw-r--r-- 1 hxs users 384152 09-28 16:35 libssl.a
drwxr-xr-x 2 hxs users 4096 09-28 10:48 pkgconfig

3.继续编译dns包

./configure --prefix=/home/hxs/lib --with-openssl=/home/hxs/lib host=arm-linux-gcc

make; make install

那么库中多了几个

libisc.a libisccfg.a libssl.a libbind9.a libdns.a libisccc.a liblwres.a

测试一下,可以用,但是都是静态库很讨厌,把Makefile中的ar改成arm-linux-ar,动态库就编译出来了,没有测试,感觉应该没有问题吧。
文章评论

共有 0 条评论