Compiling ohNet on FreeBSD
|
22-12-2014, 03:54 PM
Post: #11
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
Hi Simon,
thanks for your continuing support. I just tried to implement the changes you suggested. First, I built the code generation tools you mentioned after I compiled and installed mono. This worked flawlessly, there were no errors and I think these tools are now in place (I didn't gmake install them, tough). Thanks for the clarification regarding the needed modifications. My Makefile now looks like this: Code: root@testus_1:/usr/local/ohnet # diff Makefile.orig Makefile Also, the Os.c file has been modified like this: Code: root@testus_1:/usr/local/ohnet # diff Os/Posix/Os.c.orig Os/Posix/Os.c Please note that for Os.c I somewhat changed my modification as I saw it necessary, as there were not only "#ifndef PLATFORM_MACOSX_GNU"-lines, but also these: "#ifdef PLATFORM_MACOSX_GNU". Please have a short look and tell me if this is correct or if I should revert this. In my logical understanding it makes sense. Compilation with above changes still fails with: Code: gcc -o Build/Obj/Posix/Release/Os.o -c -fexceptions -Wall -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -g -O2 -fvisibility=hidden -fPIC -Werror -IBuild/Include/ Os/Posix/Os.c Greetings, airflow |
|||
22-12-2014, 04:30 PM
Post: #12
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
It looks like the PLATFORM_FREEBSD define isn't being set. (You can see this from the compiler command line - the line starting gcc -o). Can you try editing Makefile to move the block starting
else ifeq ($(freebsd), 1) to around line 60 (the point shown in the diff from my previous post)? At the same time, you can remove the similar section at line 288 in the diff you just posted. This may fix the build. At the very least it should reduce the number of errors you get compiling OS.c. (Your changes to this file look spot on btw.) |
|||
26-12-2014, 03:25 PM
Post: #13
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(22-12-2014 04:30 PM)simonc Wrote: It looks like the PLATFORM_FREEBSD define isn't being set. (You can see this from the compiler command line - the line starting gcc -o). Can you try editing Makefile to move the block starting Hello again, I hope you had a merry Christmas! I tried implementing the changes you suggested. I was confused about the precise destination of where to move the paragraph to. Line 60 is within multiple convoluted if/else-clauses. So I tried different places. With some the platform-paramater wasn't properly set, with others I assume it was, but compilation failed with the following error: Code: root@testus_1:/usr/local/ohnet # gmake all nocpp11=yes freebsd=1 In my understanding this is because the variable objdir is not set in my platform-section. So I added the following one: Code: # added for FreeBSD-compatibility Actually this fixed the above problem, and compilation begins. It ends later with Code: rsync -u Os/*.inl Build/Include/OpenHome I've no clue with this one. Should the file Ascii.o be there? I couldn't find it with find. Did I set objdir to the wrong location? Greetings, airflow |
|||
31-12-2014, 01:17 PM
Post: #14
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
I think you'll need to add something like
Code: compiler = gcc -o $(objdir) The compiler assignment should fix your immediate problem. The other lines will fix problems later in the build process. |
|||
03-01-2015, 02:17 AM
Post: #15
|
|||
|
|||
![]() (31-12-2014 01:17 PM)simonc Wrote: The compiler assignment should fix your immediate problem. The other lines will fix problems later in the build process. I implemented above changes. It fixed the previous errors. Building fails now with the following lines: Code: gcc -o Build/Obj/Posix/Release/Os.o -c -fexceptions -Wall -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -g -O2 -fvisibility=hidden -fPIC -DPLATFORM_FREEBSD -Werror -IBuild/Include/ Os/Posix/Os.c I tried researching similar errors in the internet, but didn't succeed. I did find this thread, though! ;-) greetings, airflow |
|||
05-01-2015, 10:59 AM
Post: #16
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
SystemConfiguration/SystemConfiguration.h is included inside a PLATFORM_MACOSX_GNU ifdef. The compiler command in your post suggests this isn't set for you.
Have you removed this ifdef as part of your local changes? Or done anything to cause PLATFORM_MACOSX_GNU to be defined? |
|||
05-01-2015, 06:37 PM
Post: #17
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(05-01-2015 10:59 AM)simonc Wrote: SystemConfiguration/SystemConfiguration.h is included inside a PLATFORM_MACOSX_GNU ifdef. The compiler command in your post suggests this isn't set for you. I haven't done anything to define PLATFORM_MACOSX_GNU, but I have indeed modified file Os/Posix/Os.c as described in this post: Code: #if defined(PLATFORM_MACOSX_GNU) || defined(PLATFORM_FREEBSD) I thought this was necessary, as I understood the contents of Os.c as the inclusion of certain network-functions of the OS, where there are different sys-flavours supported (e.g. Linux or MAC, where MAC is using BSD as its basis). But now I changed these lines back to its original state: Code: #ifdef PLATFORM_MACOSX_GNU In the end the diff to the original looks now like this (only 2 changes): Code: root@testus_1:/usr/local/share/ohnet # diff Os/Posix/Os.c.orig Os/Posix/Os.c With this setup, compilation fails with these lines: Code: gcc -o Build/Obj/Posix/Release/Os.o -c -fexceptions -Wall -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -g -O2 -fvisibility=hidden -fPIC -DPLATFORM_FREEBSD -Werror -IBuild/Include/ Os/Posix/Os.c |
|||
05-01-2015, 07:22 PM
Post: #18
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
Getting close now!
You can fix the error at line 341 by enabling the local define of TEMP_FAILURE_RETRY for PLATFORM_FREEBSD (line 59 in my code; may have moved slightly with your diffs). The above change may also fix the error at line 649. If not, try searching for where to find a definition of FD_SETSIZE or what define to use in its place. You can fix the errors at lines 1373 and 1385 by modifying the ifdefs inside DestroyInterfaceChangedObserver and OsNetworkSetInterfaceChangedObserver such that the functions have an empty implementation for PLATFORM_FREEBSD. |
|||
05-01-2015, 10:17 PM
Post: #19
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(05-01-2015 07:22 PM)simonc Wrote: Getting close now! :-) Quote:You can fix the error at line 341 by enabling the local define of TEMP_FAILURE_RETRY for PLATFORM_FREEBSD (line 59 in my code; may have moved slightly with your diffs). And did that and yep, both errors are gone. Quote:You can fix the errors at lines 1373 and 1385 by modifying the ifdefs inside DestroyInterfaceChangedObserver and OsNetworkSetInterfaceChangedObserver such that the functions have an empty implementation for PLATFORM_FREEBSD. I'm not sure with that one. You mean this section: Code: static void DestroyInterfaceChangedObserver(OsContext* aContext) I understand that I could a section like Code: #ifdef PLATFORM_FREEBSD but what should come inside - what's an "empty implementation"? |
|||
05-01-2015, 11:57 PM
Post: #20
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(05-01-2015 10:17 PM)airflow Wrote: I'm not sure with that one. You mean this section: An empty implementation is exactly what you showed above - an ifdef/endif with nothing in between. Since there are other ifdefs in these functions already, you'll need to do something like Code: static void DestroyInterfaceChangedObserver(OsContext* aContext) |
|||
« Next Oldest | Next Newest »
|