diff -Nur olsrd-0.4.10.orig/gui/linux-gtk/Makefile olsrd-0.4.10/gui/linux-gtk/Makefile
--- olsrd-0.4.10.orig/gui/linux-gtk/Makefile	2004-11-21 12:01:21.000000000 +0100
+++ olsrd-0.4.10/gui/linux-gtk/Makefile	2006-11-21 09:05:35.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 CC=	gcc
 #CC=     arm-linux-gcc
 
diff -Nur olsrd-0.4.10.orig/lib/dot_draw/Makefile olsrd-0.4.10/lib/dot_draw/Makefile
--- olsrd-0.4.10.orig/lib/dot_draw/Makefile	2005-05-25 15:50:22.000000000 +0200
+++ olsrd-0.4.10/lib/dot_draw/Makefile	2006-11-21 09:05:35.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
 # All rights reserved.
diff -Nur olsrd-0.4.10.orig/lib/dyn_gw/Makefile olsrd-0.4.10/lib/dyn_gw/Makefile
--- olsrd-0.4.10.orig/lib/dyn_gw/Makefile	2005-06-02 16:41:58.000000000 +0200
+++ olsrd-0.4.10/lib/dyn_gw/Makefile	2006-11-21 09:05:35.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+  
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
 # All rights reserved.
diff -Nur olsrd-0.4.10.orig/lib/httpinfo/Makefile olsrd-0.4.10/lib/httpinfo/Makefile
--- olsrd-0.4.10.orig/lib/httpinfo/Makefile	2006-11-21 09:04:59.000000000 +0100
+++ olsrd-0.4.10/lib/httpinfo/Makefile	2006-11-21 09:05:35.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
 # All rights reserved.
diff -Nur olsrd-0.4.10.orig/lib/mini/Makefile olsrd-0.4.10/lib/mini/Makefile
--- olsrd-0.4.10.orig/lib/mini/Makefile	2005-05-26 18:09:25.000000000 +0200
+++ olsrd-0.4.10/lib/mini/Makefile	2006-11-21 09:05:35.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
 # All rights reserved.
diff -Nur olsrd-0.4.10.orig/lib/nameservice/Makefile olsrd-0.4.10/lib/nameservice/Makefile
--- olsrd-0.4.10.orig/lib/nameservice/Makefile	2005-05-25 15:50:22.000000000 +0200
+++ olsrd-0.4.10/lib/nameservice/Makefile	2006-11-21 09:08:30.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
 # All rights reserved.
@@ -37,6 +40,8 @@
 #
 # $Id: Makefile,v 1.10 2005/05/25 13:50:22 br1 Exp $
 
+INSTALL_PREFIX = $(PLATFORM_ROOT)/fs/fs
+
 OLSRD_PLUGIN =	true
 PLUGIN_NAME =	olsrd_nameservice
 PLUGIN_VER =	0.2
@@ -47,10 +52,10 @@
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS)
-		$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+		$(LD) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:	$(PLUGIN_FULLNAME)
-		$(STRIP) $(PLUGIN_FULLNAME)
+		#$(STRIP) $(PLUGIN_FULLNAME)
 		$(INSTALL_LIB)
 
 clean:
diff -Nur olsrd-0.4.10.orig/lib/nameservice/src/nameservice.c olsrd-0.4.10/lib/nameservice/src/nameservice.c
--- olsrd-0.4.10.orig/lib/nameservice/src/nameservice.c	2006-11-21 09:04:59.000000000 +0100
+++ olsrd-0.4.10/lib/nameservice/src/nameservice.c	2006-11-21 09:09:09.000000000 +0100
@@ -700,9 +700,9 @@
 	struct name_entry *tmp;
 	struct name_entry *already_saved_name_entries;
     char *name = (char*)from_packet + sizeof(struct name);
-	OLSR_PRINTF(4, "\nNAME PLUGIN: decapsulating received name, service or forwarder \n");
     int type_of_from_packet = ntohs(from_packet->type);
     unsigned int len_of_name = ntohs(from_packet->len);
+	OLSR_PRINTF(4, "\nNAME PLUGIN: decapsulating received name, service or forwarder \n");
     
     // don't insert the received entry again, if it has already been inserted in the hash table. 
     // Instead only the validity time is set in insert_new_name_in_list function, which calls this one
diff -Nur olsrd-0.4.10.orig/lib/pgraph/Makefile olsrd-0.4.10/lib/pgraph/Makefile
--- olsrd-0.4.10.orig/lib/pgraph/Makefile	2005-07-13 23:45:07.000000000 +0200
+++ olsrd-0.4.10/lib/pgraph/Makefile	2006-11-21 09:05:35.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
 # All rights reserved.
diff -Nur olsrd-0.4.10.orig/lib/powerinfo/Makefile olsrd-0.4.10/lib/powerinfo/Makefile
--- olsrd-0.4.10.orig/lib/powerinfo/Makefile	2005-05-25 15:50:22.000000000 +0200
+++ olsrd-0.4.10/lib/powerinfo/Makefile	2006-11-21 09:05:35.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
 # All rights reserved.
diff -Nur olsrd-0.4.10.orig/lib/secure/Makefile olsrd-0.4.10/lib/secure/Makefile
--- olsrd-0.4.10.orig/lib/secure/Makefile	2005-05-25 15:50:22.000000000 +0200
+++ olsrd-0.4.10/lib/secure/Makefile	2006-11-21 09:05:35.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
 # All rights reserved.
diff -Nur olsrd-0.4.10.orig/lib/tas/Makefile olsrd-0.4.10/lib/tas/Makefile
--- olsrd-0.4.10.orig/lib/tas/Makefile	2005-12-29 20:48:43.000000000 +0100
+++ olsrd-0.4.10/lib/tas/Makefile	2006-11-21 09:05:35.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
 # All rights reserved.
diff -Nur olsrd-0.4.10.orig/Makefile olsrd-0.4.10/Makefile
--- olsrd-0.4.10.orig/Makefile	2006-01-04 09:45:38.000000000 +0100
+++ olsrd-0.4.10/Makefile	2006-11-21 09:08:01.000000000 +0100
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
 # All rights reserved.
@@ -37,12 +40,15 @@
 #
 # $Id: Makefile,v 1.67 2005/12/29 21:26:31 tlopatic Exp $
 
+CFLAGS += -DCADENUX
+INSTALL_PREFIX = $(PLATFORM_ROOT)/fs/fs
+
 VERS =		0.4.10
 
 TOPDIR = .
 include Makefile.inc
 
-LIBS +=		$(OS_LIB_DYNLOAD)
+LIBS +=		-lc #$(OS_LIB_DYNLOAD)
 
 ifeq ($(OS), win32)
 LDFLAGS +=	-Wl,--out-implib=libolsrd.a -Wl,--export-all-symbols
@@ -54,10 +60,10 @@
 CFGDEPS = 	$(wildcard $(CFGDIR)/*.c) $(wildcard $(CFGDIR)/*.h) $(CFGDIR)/oparse.y $(CFGDIR)/oscan.lex
 TAG_SRCS = $(SRCS) $(HDRS) $(wildcard src/cfgparser/*.c) $(wildcard src/cfgparser/*.h) $(wildcard src/olsr_switch/*.c) $(wildcard src/olsr_switch/*.h)
 
-default_target: cfgparser olsrd
+default_target: cfgparser olsrd nameservice
 
 olsrd:		$(OBJS) $(CFGOBJS)
-		$(CC) $(LDFLAGS) -o $@ $(OBJS) $(CFGOBJS) $(LIBS)
+		$(LD) $(LDFLAGS) -o $@ $(OBJS) $(CFGOBJS) $(LIBS)
 
 cfgparser:	$(CFGDEPS)
 		$(MAKE) -C $(CFGDIR)
@@ -84,9 +90,9 @@
 install: install_olsrd
 
 install_bin:
-		$(STRIP) $(EXENAME)
-		mkdir -p $(SBINDIR)
-		install -m 755 $(EXENAME) $(SBINDIR)
+		#$(STRIP) $(EXENAME)
+		mkdir -p $(INSTALL_PREFIX)/usr/sbin
+		install -m 755 olsrd $(INSTALL_PREFIX)/usr/sbin
 
 install_olsrd:	install_bin
 		@echo ========= C O N F I G U R A T I O N - F I L E ============
@@ -95,16 +101,16 @@
 		@echo configfile can be installed. Note that a LQ-based configfile
 		@echo can be found at files/olsrd.conf.default.lq
 		@echo ==========================================================
-		mkdir -p $(ETCDIR)
-		-cp -i files/olsrd.conf.default.rfc $(CFGFILE)
+		#mkdir -p $(ETCDIR)
+		#-cp -i files/olsrd.conf.default.rfc $(CFGFILE)
 		@echo -------------------------------------------
 		@echo Edit $(CFGFILE) before running olsrd!!
 		@echo -------------------------------------------
 		@echo Installing manpages olsrd\(8\) and olsrd.conf\(5\)
-		mkdir -p $(MANDIR)/man8/
-		cp files/olsrd.8.gz $(MANDIR)/man8/olsrd.8.gz
-		mkdir -p $(MANDIR)/man5/
-		cp files/olsrd.conf.5.gz $(MANDIR)/man5/olsrd.conf.5.gz
+		#mkdir -p $(MANDIR)/man8/
+		#cp files/olsrd.8.gz $(MANDIR)/man8/olsrd.8.gz
+		#mkdir -p $(MANDIR)/man5/
+		#cp files/olsrd.conf.5.gz $(MANDIR)/man5/olsrd.conf.5.gz
 
 tags:
 		$(TAGCMD) -o $(TAGFILE) $(TAG_SRCS)
diff -Nur olsrd-0.4.10.orig/Makefile.inc olsrd-0.4.10/Makefile.inc
--- olsrd-0.4.10.orig/Makefile.inc	2006-11-21 09:04:59.000000000 +0100
+++ olsrd-0.4.10/Makefile.inc	2006-11-21 09:05:35.000000000 +0100
@@ -15,7 +15,7 @@
 CFGFILE = $(ETCDIR)/olsrd.conf
 EXENAME = olsrd
 
-INCLUDES =	-Isrc -I$(TOPDIR)/src 
+INCLUDES =	-Isrc -I$(TOPDIR)/src -Isrc/linux
 
 # add gcc warnings and optimizations if CFLAGS not set
 ifndef CFLAGS
diff -Nur olsrd-0.4.10.orig/src/cfgparser/Makefile olsrd-0.4.10/src/cfgparser/Makefile
--- olsrd-0.4.10.orig/src/cfgparser/Makefile	2006-11-21 09:04:59.000000000 +0100
+++ olsrd-0.4.10/src/cfgparser/Makefile	2006-11-21 09:05:35.000000000 +0100
@@ -1,3 +1,5 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
 
 # The olsr.org Optimized Link-State Routing daemon(olsrd)
 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
@@ -87,7 +89,7 @@
 default_target: $(NAME)
 
 $(NAME):	$(OBJS)
-		$(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS)
+		$(LD) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS)
 
 oscan.c:	oscan.lex
 		$(FLEX) -ooscan.c oscan.lex
diff -Nur olsrd-0.4.10.orig/src/cfgparser/olsrd_conf.c olsrd-0.4.10/src/cfgparser/olsrd_conf.c
--- olsrd-0.4.10.orig/src/cfgparser/olsrd_conf.c	2006-11-21 09:04:59.000000000 +0100
+++ olsrd-0.4.10/src/cfgparser/olsrd_conf.c	2006-11-21 09:05:35.000000000 +0100
@@ -475,14 +475,14 @@
   if(inet_pton(AF_INET6, OLSR_IPV6_MCAST_SITE_LOCAL, &in6) < 0)
     {
       fprintf(stderr, "Failed converting IP address %s\n", OLSR_IPV6_MCAST_SITE_LOCAL);
-      return NULL;
+//      return NULL;
     }
   memcpy(&io->ipv6_multi_site.v6, &in6, sizeof(struct in6_addr));
 
   if(inet_pton(AF_INET6, OLSR_IPV6_MCAST_GLOBAL, &in6) < 0)
     {
       fprintf(stderr, "Failed converting IP address %s\n", OLSR_IPV6_MCAST_GLOBAL);
-      return NULL;
+//      return NULL;
     }
   memcpy(&io->ipv6_multi_glbl.v6, &in6, sizeof(struct in6_addr));
 
diff -Nur olsrd-0.4.10.orig/src/linux/net.c olsrd-0.4.10/src/linux/net.c
--- olsrd-0.4.10.orig/src/linux/net.c	2005-09-17 22:48:50.000000000 +0200
+++ olsrd-0.4.10/src/linux/net.c	2006-11-21 09:05:35.000000000 +0100
@@ -44,7 +44,7 @@
  * Linux spesific code
  */
 
-#include "net.h"
+#include "../linux/net.h"
 #include "../defs.h"
 #include "../net_os.h"
 #include "../parser.h"
diff -Nur olsrd-0.4.10.orig/src/main.c olsrd-0.4.10/src/main.c
--- olsrd-0.4.10.orig/src/main.c	2006-11-21 09:04:59.000000000 +0100
+++ olsrd-0.4.10/src/main.c	2006-11-21 09:05:35.000000000 +0100
@@ -367,11 +367,19 @@
   if((olsr_cnf->debug_level == 0) && (!olsr_cnf->no_fork))
     {
       printf("%s detaching from the current process...\n", SOFTWARE_VERSION);
+#ifdef CADENUX
+      if (fork() != 0)
+	{
+	  exit(EXIT_SUCCESS);
+	}
+      setsid();
+#else
       if(daemon(0, 0) < 0)
 	{
 	  printf("daemon(3) failed: %s\n", strerror(errno));
 	  exit(EXIT_FAILURE);
 	}
+#endif
     }
 #endif
 
