Update of /cvsroot/leaf/src/bering-uclibc/contrib/aiccu
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23774

Modified Files:
        buildtool.cfg buildtool.mk 
Added Files:
        100-cross_compile.patch 200-add_dn_skipname.patch 
        aiccu-uclibc-resolver.patch 
Log Message:
Make aiccu_20070115 compile (hacking DNS resolver stuff)

That takes two patches from OpenWRT (they have the very same problem with
uClibc not supporting dn_skipname()) and one special for LEAF (to get rid
of the res_ninit() and res_nquery() calls).


Index: buildtool.cfg
===================================================================
RCS file: /cvsroot/leaf/src/bering-uclibc/contrib/aiccu/buildtool.cfg,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** buildtool.cfg       16 Nov 2007 03:57:05 -0000      1.8
--- buildtool.cfg       16 Nov 2007 06:08:07 -0000      1.9
***************
*** 18,21 ****
--- 18,45 ----
  </File>
  
+ # Remove resolver parts not in uclibc
+ <File aiccu-uclibc-resolver.patch>
+       Server = cvs-contrib-sourceforge
+       Revision = HEAD
+       Directory = aiccu
+       envname = PATCH_UCLIBC_RESOLVER
+ </File>
+ 
+ # 
https://svn.openwrt.org/openwrt/packages/ipv6/aiccu/patches/100-cross_compile.patch
+ <File 100-cross_compile.patch>
+       Server = cvs-contrib-sourceforge
+       Revision = HEAD
+       Directory = aiccu
+       envname = PATCH_OPENWRT_100
+ </File>
+ 
+ # 
https://svn.openwrt.org/openwrt/packages/ipv6/aiccu/patches/200-add_dn_skipname.patch
+ <File 200-add_dn_skipname.patch>
+       Server = cvs-contrib-sourceforge
+       Revision = HEAD
+       Directory = aiccu
+       envname = PATCH_OPENWRT_200
+ </File>
+ 
  # FIXME:
  # - write aiccu.txt  (cf. bin/packages/uclibc-0.9/20/contrib/README)

Index: buildtool.mk
===================================================================
RCS file: /cvsroot/leaf/src/bering-uclibc/contrib/aiccu/buildtool.mk,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** buildtool.mk        24 Jan 2007 20:53:47 -0000      1.3
--- buildtool.mk        16 Nov 2007 06:08:07 -0000      1.4
***************
*** 7,10 ****
--- 7,13 ----
  $(AICCU_DIR)/.source:
        zcat $(SRC_TARBALL) | tar -xvf -
+       (cd $(AICCU_DIR) && patch -p1) < $(PATCH_GLIBC_RESOLVER)
+       (cd $(AICCU_DIR) && patch -p1) < $(PATCH_OPENWRT_100)
+       (cd $(AICCU_DIR) && patch -p1) < $(PATCH_OPENWRT_200)
        touch $(AICCU_DIR)/.source
  

--- NEW FILE: 200-add_dn_skipname.patch ---
diff -Nru aiccu.old/common/dn_skipname.c aiccu/common/dn_skipname.c
--- aiccu.old/common/dn_skipname.c      1970-01-01 02:00:00.000000000 +0200
+++ aiccu/common/dn_skipname.c  2006-11-04 00:50:23.000000000 +0200
@@ -0,0 +1,51 @@
+#include <errno.h>
+#include <resolv.h>
+
+/* Ripped from glibc 2.4 sources. */
+
+/*
+ * ns_name_skip(ptrptr, eom)
+ *      Advance *ptrptr to skip over the compressed name it points at.
+ * return:
+ *      0 on success, -1 (with errno set) on failure.
+ */
+int ns_name_skip(const u_char **ptrptr, const u_char *eom)
+{
+       const u_char *cp;
+       u_int n;
+
+       cp = *ptrptr;
+       while (cp < eom && (n = *cp++) != 0)
+       {
+               /* Check for indirection. */
+               switch (n & NS_CMPRSFLGS) {
+               case 0:                 /* normal case, n == len */
+                       cp += n;
+                       continue;
+               case NS_CMPRSFLGS:      /* indirection */
+                       cp++;
+                       break;
+               default:                /* illegal type */
+                       errno = EMSGSIZE;
+                       return (-1);
+               }
+               break;
+       }
+       if (cp > eom)
+       {
+               errno = EMSGSIZE;
+               return (-1);
+       }
+       *ptrptr = cp;
+       return (0);
+}
+
+int dn_skipname(const u_char *ptr, const u_char *eom)
+{
+       const u_char *saveptr = ptr;
+
+       if(ns_name_skip(&ptr, eom) == -1)
+               return (-1);
+       return (ptr - saveptr);
+}
+
diff -Nru aiccu.old/unix-console/Makefile aiccu/unix-console/Makefile
--- aiccu.old/unix-console/Makefile     2006-11-04 00:51:20.000000000 +0200
+++ aiccu/unix-console/Makefile 2006-11-04 00:48:51.000000000 +0200
@@ -10,9 +10,9 @@
 #  $Date: 2007/11/16 06:08:07 $
 # **********************************************************/
 
-SRCS   = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c 
../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c 
../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c
+SRCS   = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c 
../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c 
../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c 
../common/dn_skipname.c
 INCS   = ../common/tun.h ../common/aiccu.h ../common/hash_md5.h 
../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h 
../common/ayiya.h ../common/resolver.h
-OBJS   = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o 
../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o 
../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o
+OBJS   = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o 
../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o 
../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o 
../common/dn_skipname.o
 
 # New features not fully implemented and thus disabled for now
 #CFLAGS        += -D NEWSTUFF_TSP -D NEWSTUFF_TEEPEE

--- NEW FILE: aiccu-uclibc-resolver.patch ---
diff -ru aiccu.orig/common/resolver.c aiccu/common/resolver.c
--- aiccu.orig/common/resolver.c        2006-07-23 16:55:14.000000000 +0200
+++ aiccu/common/resolver.c     2007-11-16 06:14:56.000000000 +0100
@@ -26,9 +26,6 @@
 
 int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int 
type, const char *record))
 {
-#ifdef _LINUX
-       struct __res_state      res;
-#endif
        unsigned char           answer[8192];
        HEADER                  *header = (HEADER *)answer;
        char                    buf[2048];
@@ -38,20 +35,10 @@
        uint16_t                type = 0, class = 0;
        uint32_t                ttl = 0;
 
-#ifdef _LINUX
-       memset(&res, 0, sizeof(res));
-       res.options = RES_DEBUG;
-       res_ninit(&res);
-#else
        res_init();
-#endif
 
        memset(answer, 0, sizeof(answer));
-#ifdef _LINUX
-       ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer));
-#else
        ret = res_query(label, C_IN, rrtype, answer, sizeof(answer));
-#endif
        if (ret < 0) return -1;
 
        /* Our start and end */

--- NEW FILE: 100-cross_compile.patch ---
diff -urN aiccu/unix-console/Makefile aiccu.new/unix-console/Makefile
--- aiccu/unix-console/Makefile 2007-01-15 12:04:27.000000000 +0100
+++ aiccu.new/unix-console/Makefile     2007-01-18 15:08:28.000000000 +0100
@@ -10,6 +10,9 @@
 #  $Date: 2007/11/16 06:08:07 $
 # **********************************************************/
 
+OS_NAME=$(shell uname)
+OS_VERSION=$(shell uname -r)
+
 SRCS   = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c 
../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c 
../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c
 INCS   = ../common/tun.h ../common/aiccu.h ../common/hash_md5.h 
../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h 
../common/ayiya.h ../common/resolver.h
 OBJS   = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o 
../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o 
../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o
@@ -40,13 +43,13 @@
 # GnuTLS Support ?
 # Used by TIC to secure that communication
 # Currently defaultly builds only on Linux, but other platforms might easily 
also support it
-ifeq ($(shell uname | grep -c "Linux"),1)
+ifneq ($(HAVE_GNUTLS),)
 CFLAGS += -D AICCU_GNUTLS
 LDFLAGS += -lgnutls
 endif
 
 # Linux
-ifeq ($(shell uname | grep -c "Linux"),1)
+ifeq ($(shell echo $(OS_NAME) | grep -c "Linux"),1)
 CFLAGS  += -D_LINUX -D HAS_IFHEAD -D AICCU_TYPE="\"linux\""
 SRCS   += ../common/aiccu_linux.c
 OBJS   += ../common/aiccu_linux.o
@@ -54,11 +57,11 @@
 endif
 
 # FreeBSD
-ifeq ($(shell uname | grep -c "FreeBSD"),1)
+ifeq ($(shell echo $(OS_NAME) | grep -c "FreeBSD"),1)
 CFLAGS += -D_FREEBSD
 
 # FreeBSD 4.x
-ifeq ($(shell uname -r | cut -c 1),4)
+ifeq ($(shell echo $(OS_VERSION) | cut -c 1),4)
 CFLAGS += -D AICCU_TYPE="\"freebsd4\""
 SRCS   += ../common/aiccu_freebsd4.c
 OBJS   += ../common/aiccu_freebsd4.o
@@ -71,7 +74,7 @@
 endif
 
 # DragonFlyBSD
-ifeq ($(shell uname | grep -c "DragonFly"),1)
+ifeq ($(shell echo $(OS_NAME) | grep -c "DragonFly"),1)
 CFLAGS += -D_DFBSD -D NEED_IFHEAD -D AICCU_TYPE="\"dragonfly\""
 SRCS   += ../common/aiccu_freebsd4.c
 OBJS   += ../common/aiccu_freebsd4.o
@@ -79,7 +82,7 @@
 endif
 
 # NetBSD
-ifeq ($(shell uname | grep -c "NetBSD"),1)
+ifeq ($(shell echo $(OS_NAME) | grep -c "NetBSD"),1)
 CFLAGS += -D_NETBSD -D AICCU_TYPE="\"kame\""
 
 # Check if net/if_tun.h has TUNSIFHEAD and enable support for it
@@ -97,10 +100,10 @@
 endif
 
 # OpenBSD
-ifeq ($(shell uname | grep -c "OpenBSD"),1)
+ifeq ($(shell echo $(OS_NAME) | grep -c "OpenBSD"),1)
 CFLAGS += -D_OPENBSD -D HAS_IFHEAD
 # 2.7-2.9
-ifeq ($(shell uname -r | cut -c 1),2)
+ifeq ($(shell echo $(OS_VERSION) | cut -c 1),2)
 CFLAGS += -D AICCU_TYPE="\"openbsd2\""
 SRCS   += ../common/aiccu_openbsd2.c
 OBJS   += ../common/aiccu_openbsd2.o
@@ -114,7 +117,7 @@
 endif
 
 # Darwin
-ifeq ($(shell uname | grep -c "Darwin"),1)
+ifeq ($(shell echo $(OS_NAME) | grep -c "Darwin"),1)
 CFLAGS += -D_DARWIN -D NEED_IFHEAD -D AICCU_TYPE="\"darwin\""
 SRCS   += ../common/aiccu_darwin.c
 OBJS   += ../common/aiccu_darwin.o
@@ -122,7 +125,7 @@
 endif
 
 # SunOS / Solaris
-ifeq ($(shell uname | grep -c "SunOS"),1)
+ifeq ($(shell echo $(OS_NAME) | grep -c "SunOS"),1)
 CFLAGS += -D_SUNOS -D AICCU_TYPE="\"sunos\""
 SRCS   += ../common/aiccu_sunos.c
 OBJS   += ../common/aiccu_sunos.o
@@ -130,7 +133,7 @@
 endif
 
 # AIX
-ifeq ($(shell uname | grep -c "AIX"),1)
+ifeq ($(shell echo $(OS_NAME) | grep -c "AIX"),1)
 CC     = @/usr/vac/bin/xlc_r
 CFLAGS = -qthreaded -q64 -qlanglvl=stdc99 -bmaxdata:0xD0000000 -D_64BIT -g 
-qdbxextra -qfullpath -qheapdebug -qformat=all -qcheck=all
 CFLAGS += -D AICCU_CONSOLE


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
leaf-cvs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/leaf-cvs-commits

Reply via email to