On Mon, 2007-11-19 at 13:59 +0100, Holger Levsen wrote:
[...]
> On Sunday 18 November 2007 16:22, Bernd Petrovitsch wrote:
> > The simplest is to try sell it as FreeBSD as I expect the kernel to be
> > more relevant than the user-space part (e.g. for the ioctl()s for
> > routing).
> 
> Sounds sensible.
> 
> > So just try "make OS=fbsd" (and finally fixup
> > olsrd-current/make/guess_os.sh to set deliver the correct result).
> 
> I now have access to a kfreebsd/i386 and a kfreebsd/amd64 system. And 
> there, "uname -s | tr '[A-Z]' '[a-z]'" returns: gnu/kfreebsd

Nice to know.

> Wow & LOL :)
> 
> > It that doesn't work (and the thing should also run, not only compile),
> 
> It doesnt compile, log attached. 

----  snip  ----
make[2]: Entering directory `/home/holger/olsrd-0.5.4/src/cfgparser'
gcc -Wall -Wextra -Wold-style-definition -Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wsign-compare -Waggregate-return -Wmissing-noreturn -Wmissing-format-attribute -Wno-multichar -Wno-deprecated-declarations -Wnested-externs -Winline -Wdisabled-optimization -finline-functions-called-once -fearly-inlining -finline-limit=50 -O2  -Isrc -I../../src -pthread -DSUPPORT_OLD_PLUGIN_VERSIONS=1 -DOLSRD_GLOBAL_CONF_FILE=\"/usr/local/etc/olsrd.conf\"   -DMAKELIB  -c -o olsrd_conf.o olsrd_conf.c
In file included from ../../src/olsr_protocol.h:50,
                 from olsrd_conf.h:46,
                 from olsrd_conf.c:52:
../../src/olsr_types.h:86:9: error: #error "Unsupported system"
----  snip  ----
Yup. FreeBSD is selected in the source with the __FreeBSD__ preprocessor
define. Looking into make/Makefile.fbsd, I cannot find it. And it is not
mentioned on the gcc line so it probably comes from the compiler (as
opposed to Makefile.linux which explicitly adds "-Dlinux" - for whatever
reason).
So you should add "-D__FreeBSD__" also explicitly to CPPFLAGS in some
way (if only for testing/trying) and see it it works.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services




