diff -Nur olsrd-90e58c149597.orig/cp.sh olsrd-90e58c149597/cp.sh
--- olsrd-90e58c149597.orig/cp.sh	1970-01-01 01:00:00.000000000 +0100
+++ olsrd-90e58c149597/cp.sh	2008-06-11 07:30:02.000000000 +0200
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+cp -vu ${0%/*}/lib/nameservice/src/compat.c ${0%/*}/src/nameservice_compat.c
+cp -vu ${0%/*}/lib/nameservice/src/compat.h ${0%/*}/src/nameservice_compat.h
+cp -vu ${0%/*}/lib/nameservice/src/mapwrite.c ${0%/*}/src/nameservice_mapwrite.c
+cp -vu ${0%/*}/lib/nameservice/src/mapwrite.h ${0%/*}/src/nameservice_mapwrite.h
+cp -vu ${0%/*}/lib/nameservice/src/nameservice.c ${0%/*}/src/nameservice.c
+cp -vu ${0%/*}/lib/nameservice/src/nameservice.h ${0%/*}/src/nameservice.h
+cp -vu ${0%/*}/lib/nameservice/src/nameservice_msg.h ${0%/*}/src/nameservice_msg.h
+cp -vu ${0%/*}/lib/nameservice/src/olsrd_plugin.c ${0%/*}/src/nameservice_plugin.c
+cp -vu ${0%/*}/src/olsrd_plugin.h ${0%/*}/src/nameservice_plugin.h
diff -Nur olsrd-90e58c149597.orig/gui/linux-gtk/Makefile olsrd-90e58c149597/gui/linux-gtk/Makefile
--- olsrd-90e58c149597.orig/gui/linux-gtk/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/gui/linux-gtk/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 CC ?=	gcc
 
 CFLAGS += -Wall `pkg-config --cflags gtk+-2.0`
diff -Nur olsrd-90e58c149597.orig/lib/arprefresh/Makefile olsrd-90e58c149597/lib/arprefresh/Makefile
--- olsrd-90e58c149597.orig/lib/arprefresh/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/arprefresh/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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)
 # Arprefresh plugin Copyright (c) 2007, Sven-Ola-aet-gmx.de
diff -Nur olsrd-90e58c149597.orig/lib/bmf/Makefile olsrd-90e58c149597/lib/bmf/Makefile
--- olsrd-90e58c149597.orig/lib/bmf/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/bmf/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -1,3 +1,6 @@
+include ${PLATFORM_ROOT}/fs/apps/Make.defs
+include ${PLATFORM_ROOT}/build/Make.context
+
 #
 # OLSR Basic Multicast Forwarding (BMF) plugin.
 # Copyright (c) 2005, 2006, Thales Communications, Huizen, The Netherlands.
diff -Nur olsrd-90e58c149597.orig/lib/dot_draw/Makefile olsrd-90e58c149597/lib/dot_draw/Makefile
--- olsrd-90e58c149597.orig/lib/dot_draw/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/dot_draw/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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-90e58c149597.orig/lib/dyn_gw/Makefile olsrd-90e58c149597/lib/dyn_gw/Makefile
--- olsrd-90e58c149597.orig/lib/dyn_gw/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/dyn_gw/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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-90e58c149597.orig/lib/dyn_gw_plain/Makefile olsrd-90e58c149597/lib/dyn_gw_plain/Makefile
--- olsrd-90e58c149597.orig/lib/dyn_gw_plain/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/dyn_gw_plain/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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-90e58c149597.orig/lib/httpinfo/Makefile olsrd-90e58c149597/lib/httpinfo/Makefile
--- olsrd-90e58c149597.orig/lib/httpinfo/Makefile	2008-06-11 07:29:36.000000000 +0200
+++ olsrd-90e58c149597/lib/httpinfo/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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-90e58c149597.orig/lib/mini/Makefile olsrd-90e58c149597/lib/mini/Makefile
--- olsrd-90e58c149597.orig/lib/mini/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/mini/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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-90e58c149597.orig/lib/nameservice/Makefile olsrd-90e58c149597/lib/nameservice/Makefile
--- olsrd-90e58c149597.orig/lib/nameservice/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/nameservice/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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.
@@ -36,6 +39,8 @@
 # the copyright holders.
 #
 
+INSTALL_PREFIX = $(PLATFORM_ROOT)/fs/fs
+
 OLSRD_PLUGIN =	true
 PLUGIN_NAME =	olsrd_nameservice
 PLUGIN_VER =	0.3
@@ -50,10 +55,10 @@
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
-		$(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-90e58c149597.orig/lib/pgraph/Makefile olsrd-90e58c149597/lib/pgraph/Makefile
--- olsrd-90e58c149597.orig/lib/pgraph/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/pgraph/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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-90e58c149597.orig/lib/quagga/Makefile olsrd-90e58c149597/lib/quagga/Makefile
--- olsrd-90e58c149597.orig/lib/quagga/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/quagga/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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-90e58c149597.orig/lib/secure/Makefile olsrd-90e58c149597/lib/secure/Makefile
--- olsrd-90e58c149597.orig/lib/secure/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/secure/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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-90e58c149597.orig/lib/tas/Makefile olsrd-90e58c149597/lib/tas/Makefile
--- olsrd-90e58c149597.orig/lib/tas/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/tas/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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-90e58c149597.orig/lib/txtinfo/Makefile olsrd-90e58c149597/lib/txtinfo/Makefile
--- olsrd-90e58c149597.orig/lib/txtinfo/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/lib/txtinfo/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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-90e58c149597.orig/Makefile olsrd-90e58c149597/Makefile
--- olsrd-90e58c149597.orig/Makefile	2008-06-11 07:29:36.000000000 +0200
+++ olsrd-90e58c149597/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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.
@@ -41,17 +44,16 @@
 # gui/win32/Inst/installer.nsi (line 57, around "MessageBox MB_YESNO [...]")
 VERS =		0.5.6-90e58c149597
 
+CFLAGS += -DCADENUX
+INSTALL_PREFIX = $(PLATFORM_ROOT)/fs/fs
+
 TOPDIR = .
 include Makefile.inc
 
 # pass generated variables to save time
 MAKECMD = $(MAKE) OS="$(OS)" WARNINGS="$(WARNINGS)"
 
-LIBS +=		$(OS_LIB_DYNLOAD)
-
 ifeq ($(OS), win32)
-LDFLAGS +=	-Wl,--out-implib=libolsrd.a
-LDFLAGS +=	-Wl,--export-all-symbols
 endif
 
 SWITCHDIR =	src/olsr_switch
@@ -60,10 +62,10 @@
 TAG_SRCS =	$(SRCS) $(HDRS) $(wildcard $(CFGDIR)/*.[ch] $(SWITCHDIR)/*.[ch])
 
 .PHONY: default_target switch
-default_target: $(EXENAME)
+default_target: $(EXENAME) nameservice
 
 $(EXENAME):	$(OBJS) src/builddata.o
-		$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+		$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 cfgparser:	$(CFGDEPS)
 		$(MAKE) -C $(CFGDIR)
@@ -98,9 +100,9 @@
 install: install_olsrd
 
 install_bin:
-		mkdir -p $(SBINDIR)
-		install -m 755 $(EXENAME) $(SBINDIR)
-		$(STRIP) $(SBINDIR)/$(EXENAME)
+		mkdir -p $(INSTALL_PREFIX)/usr/sbin
+		install -m 755 $(EXENAME) $(INSTALL_PREFIX)/usr/sbin
+		#$(STRIP) $(SBINDIR)/$(EXENAME)
 
 install_olsrd:	install_bin
 		@echo ========= C O N F I G U R A T I O N - F I L E ============
@@ -112,16 +114,16 @@
 		@echo per default.
 		@echo can be found at files/olsrd.conf.default.lq
 		@echo ==========================================================
-		mkdir -p $(ETCDIR)
-		-cp -i files/olsrd.conf.default.lq $(CFGFILE)
+		#mkdir -p $(ETCDIR)
+		#-cp -i files/olsrd.conf.default.lq $(CFGFILE)
 		@echo -------------------------------------------
 		@echo Edit $(CFGFILE) before running olsrd!!
 		@echo -------------------------------------------
 		@echo Installing manpages $(EXENAME)\(8\) and $(CFGNAME)\(5\)
-		mkdir -p $(MANDIR)/man8/
-		cp files/olsrd.8.gz $(MANDIR)/man8/$(EXENAME).8.gz
-		mkdir -p $(MANDIR)/man5/
-		cp files/olsrd.conf.5.gz $(MANDIR)/man5/$(CFGNAME).5.gz
+		#mkdir -p $(MANDIR)/man8/
+		#cp files/olsrd.8.gz $(MANDIR)/man8/$(EXENAME).8.gz
+		#mkdir -p $(MANDIR)/man5/
+		#cp files/olsrd.conf.5.gz $(MANDIR)/man5/$(CFGNAME).5.gz
 
 tags:
 		$(TAGCMD) -o $(TAGFILE) $(TAG_SRCS)
diff -Nur olsrd-90e58c149597.orig/Makefile.inc olsrd-90e58c149597/Makefile.inc
--- olsrd-90e58c149597.orig/Makefile.inc	2008-06-11 07:29:36.000000000 +0200
+++ olsrd-90e58c149597/Makefile.inc	2008-06-11 07:30:02.000000000 +0200
@@ -54,6 +54,8 @@
 ifneq ($(TOPDIR),.)
 CPPFLAGS +=	-I$(TOPDIR)/src
 endif
+CPPFLAGS +=	-Isrc/linux
+CPPFLAGS +=	-Isrc/cfgparser
 
 # add gcc warnings and optimizations if CFLAGS not set
 ifndef CFLAGS
@@ -123,23 +125,23 @@
 # c and ld flags for libraries (plugins)
 CPPFLAGS +=	-DOLSR_PLUGIN
 LDFLAGS +=	-shared
-LDFLAGS +=	-Wl,-soname,$(PLUGIN_NAME)
-LDFLAGS +=	-Wl,--version-script=version-script.txt 
+LDFLAGS +=	-soname,$(PLUGIN_NAME)
+LDFLAGS +=	--version-script=version-script.txt 
 else
 # c and ld flags for main
-LDFLAGS +=	-Wl,-export-dynamic 
-LDFLAGS +=	-Wl,-rpath,$(LIBDIR)
+LDFLAGS +=	-export-dynamic 
+LDFLAGS +=	-rpath,$(LIBDIR)
 endif
 # LDFLAGS for all 
-LDFLAGS +=	-Wl,--warn-common
+LDFLAGS +=	--warn-common
 # See above at "-ffunction-sections" for an explanation (and why it is disabled).
-#LDOPTS +=	-Wl,--gc-sections
-#LDOPTS +=	-Wl,--print-gc-sections
+#LDOPTS +=	--gc-sections
+#LDOPTS +=	--print-gc-sections
 #LDFLAGS +=	$(shell CC="$(CC)" $(TOPDIR)/ld-warnings $(LDOPTS))
 ifneq ($(MUDFLAP),0)
 LIBS +=		-lmudflapth
 endif
-LIBS +=		$(OS_LIB_PTHREAD)
+LIBS +=		-lc #$(OS_LIB_PTHREAD)
 
 # extra options from the outside
 CPPFLAGS +=	$(EXTRA_CPPFLAGS)
diff -Nur olsrd-90e58c149597.orig/mk.sh olsrd-90e58c149597/mk.sh
--- olsrd-90e58c149597.orig/mk.sh	1970-01-01 01:00:00.000000000 +0100
+++ olsrd-90e58c149597/mk.sh	2008-06-11 07:30:02.000000000 +0200
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+mkdir -p /tmp/fs/apps
+:> /tmp/fs/apps/Make.defs
+mkdir -p /tmp/build
+:> /tmp/build/Make.context
+make PLATFORM_ROOT=/tmp SVEN_OLA_UNBLOAT=1 $*
diff -Nur olsrd-90e58c149597.orig/src/cfgparser/Makefile olsrd-90e58c149597/src/cfgparser/Makefile
--- olsrd-90e58c149597.orig/src/cfgparser/Makefile	2008-05-30 16:58:30.000000000 +0200
+++ olsrd-90e58c149597/src/cfgparser/Makefile	2008-06-11 07:30:02.000000000 +0200
@@ -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)
@@ -71,11 +73,11 @@
 ifeq (${OS}, osx)
 LDFLAGS +=	-dynamiclib -single_module
 else
-LDFLAGS +=	-shared -Wl,-soname,$(LIBNAME)
+LDFLAGS +=	-shared -soname,$(LIBNAME)
 endif
 
 ifeq (${OS}, win32)
-LDFLAGS +=	-Wl,--out-implib=libolsrd_cfgparser.a -Wl,--export-all-symbols
+LDFLAGS +=	--out-implib=libolsrd_cfgparser.a --export-all-symbols
 endif
 
 CPPFLAGS +=	-DMAKELIB
@@ -89,7 +91,7 @@
 default_target: $(NAME)
 
 $(NAME):	$(OBJS)
-		$(CC) $(LDFLAGS) -o "$@" $^ $(LIBS)
+		$(LD) $(LDFLAGS) -o "$@" $^ $(LIBS)
 
 install:
 		install -D -m 755 $(NAME) $(LIBDIR)/$(NAME)
diff -Nur olsrd-90e58c149597.orig/src/defs.h olsrd-90e58c149597/src/defs.h
--- olsrd-90e58c149597.orig/src/defs.h	2008-06-11 07:29:36.000000000 +0200
+++ olsrd-90e58c149597/src/defs.h	2008-06-11 07:30:02.000000000 +0200
@@ -112,7 +112,7 @@
 #define MIN(x,y)	((x) < (y) ? (x) : (y))
 #endif
 
-#define INLINE inline __attribute__((always_inline))
+#define INLINE inline
 
 /*
  * Queueing macros
diff -Nur olsrd-90e58c149597.orig/src/main.c olsrd-90e58c149597/src/main.c
--- olsrd-90e58c149597.orig/src/main.c	2008-06-11 07:29:36.000000000 +0200
+++ olsrd-90e58c149597/src/main.c	2008-06-11 07:30:02.000000000 +0200
@@ -386,10 +386,18 @@
 #ifndef WIN32
   if(olsr_cnf->debug_level == 0 && !olsr_cnf->no_fork) {
     printf("%s detaching from the current process...\n", olsrd_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
 
