Has anyone tried to compile the newest release of asterisk-1.4.18 on OpenWRT SVN Kamikaze (r10141) trunk source? Of particular interesting is the following patch I created to patch the main/acl.c file which includes the following functions call in its original file:
--- asterisk-1.4.18.orig/main/acl.c 2008-01-24 11:41:29.000000000 -0500
+++ asterisk-1.4.18/main/acl.c 2008-02-09 12:13:20.000000000 -0500
@@ -50,9 +50,6 @@
#if defined(SOLARIS)
#include <sys/sockio.h>
-#include <net/if.h>
-#else
-#include <ifaddrs.h>
#endif
/* netinet/ip.h may not define the following (See RFCs 791 and 1349) */
@@ -164,15 +161,6 @@
struct in_addr best_addr;
int best_score = -100;
memset(&best_addr, 0, sizeof(best_addr));
-
-#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__)
- rtnerr = getifaddrs(&ifaphead);
- if (rtnerr) {
- perror(NULL);
- return -1;
- }
-#endif /* BSD_OR_LINUX */
-
s = socket(AF_INET, SOCK_STREAM, 0);
if (s > 0) {
@@ -233,9 +221,6 @@
close(s);
}
-#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) || defined(__Darwin__)
- freeifaddrs(ifaphead);
-#endif /* BSD_OR_LINUX */
if (res == 0 && ourip)
memcpy(ourip, &best_addr, sizeof(*ourip));
Even though these two functions getifaddrs and freeifaddrs are well defined in the uClibc-0.9.29/libc/inet/ifaddrs.c file (without any ifaddrs.h header file), the codes will fail to produce the asterisk binary file. If I used the above codes to patch the original main/acl.c file, the asterisk-1.4.18 will compile to produce ipkg files, I am not sure if such a removal will have any adverse impact. Anyone?