dhcpcd-6.4.3移植记录

来源:互联网 发布:全民k歌刷花软件 编辑:程序博客网 时间:2024/04/30 11:03

下载:http://roy.marples.name/downloads/dhcpcd/

我下载的是dhcpcd-6.4.3

解压后进入目录,执行

./configure --disable-debug \
--enable-fork \
--disable-ipv6 \
--disable-inet6 \
--enable-embedded \
--prefix=./install \
--host=powerpc-linux

然后make;make install

注1:上面powerpc-linux已经做过连接为powerpc-e300c3-linux-gnu-gcc:
     ln -s powerpc-e300c3-linux-gnu-gcc powerpc-linux-gcc
注2:如果要静态编译可以添加--enable-static 这些选项都可以通过vi configure来查看


要修改的地方:
①修改 Makefile 中CSTD?=     c99 为gnu99
②编译中发现linux/ipv6.h 中有结构体in6_pktinfo重复定义,通过查找发现与netinet/in.h中的定义重复
参照主机中的netinet/in.h,修改编译器的in.h 把#ifdef __USE_GNU 移动到结构体in6_pktinfo定义之上问题解决。


468 469 #ifdef __USE_GNU470 /* IPv6 packet information.  */471 struct in6_pktinfo472   {473     struct in6_addr ipi6_addr;  /* src/dst IPv6 address */474     unsigned int ipi6_ifindex;  /* send/recv interface index */475   };476 477 /* IPv6 MTU information.  */478 struct ip6_mtuinfo479   {480     struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */481     uint32_t ip6m_mtu;         /* path MTU in host byte order */482   };483 484 485 /* Obsolete hop-by-hop and Destination Options Processing (RFC 2292).  */486 extern int inet6_option_space (int __nbytes)487      __THROW __attribute_deprecated__;488 extern int inet6_option_init (void *__bp, struct cmsghdr **__cmsgp,489                   int __type) __THROW __attribute_deprecated__;490 extern int inet6_option_append (struct cmsghdr *__cmsg,



0 0