Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compiling ohNet on FreeBSD
13-12-2014, 02:27 PM
Post: #1
Compiling ohNet on FreeBSD
Hi!

I'd like to compile ohNet on a FreeBSD box. Reasoning behind it is my goal to run Minimserver (which uses ohNet) an my FreeNAS box. I'm not a programmer, but have intermediate Linux/BSD-skills.

I got an github-account and downloaded the source of ohNet. I compiled and installed the dependencies I'm aware of. When I try to "make" the build, I get these error-messages:

Code:
root@testus_1:/usr/local/ohnet # make
"Makefile", line 6: Missing dependency operator
"Makefile", line 8: Need an operator
"Makefile", line 10: Need an operator
"Makefile", line 12: Missing dependency operator
"Makefile", line 18: Need an operator
"Makefile", line 24: Need an operator
Unknown modifier ' '

"Makefile", line 33: Need an operator
Unknown modifier ' '

"Makefile", line 34: Need an operator
Unknown modifier ' '

"Makefile", line 35: Need an operator
"Makefile", line 37: Missing dependency operator
"Makefile", line 38: Missing dependency operator
"Makefile", line 42: Missing dependency operator
"Makefile", line 46: Need an operator
"Makefile", line 49: Missing dependency operator
"Makefile", line 51: Need an operator
"Makefile", line 53: Need an operator
"Makefile", line 54: Need an operator
Error expanding embedded variable.

I haven't investigated a lot of time yet about what I could change in the Makefile to make it happen. I just wanted to check back in this forum before that to find out if 1) this is a realistic and achievable goal or of it's impossible to do it for some reason 2) if there are any plans for the development team to make it compile on BSD too for the future 3) if there are any knowledgable people on the forum who would be willing to assist me (I could theoreticall also provide shell-access to try out stuff together).

Thanks a lot,
airflow
Find all posts by this user
15-12-2014, 10:55 AM (This post was last modified: 15-12-2014 10:56 AM by simonc.)
Post: #2
RE: Compiling ohNet on FreeBSD
Welcome to the forum airflow!

In answer to your questions:

1) Yes, building for FreeBSD should be entirely realistic and achievable.

2)No, we don't have any work in this area planned. We would however be happy to integrate and maintain any changes you find are required.

3)We're not expert in FreeBSD. On the assumption that all *nix systems will be broadly similar, we can certainly try to help. Your current problems suggest that a different version of make is being used. A bit of googling suggests that it's possible to install a different package and build using gmake (GNU make) instead. See http://stackoverflow.com/q/10257713/311966 for details.
Find all posts by this user
15-12-2014, 01:00 PM
Post: #3
Rainbow RE: Compiling ohNet on FreeBSD
(15-12-2014 10:55 AM)simonc Wrote:  3)We're not expert in FreeBSD. On the assumption that all *nix systems will be broadly similar, we can certainly try to help. Your current problems suggest that a different version of make is being used. A bit of googling suggests that it's possible to install a different package and build using gmake (GNU make) instead. See http://stackoverflow.com/q/10257713/311966 for details.

Hello simonc, thanks for the welcome and for the tip regarding gmake. I found that I had to compile rsync as another dependency. I had another error after that:

Code:
gcc -o Build/Obj/Posix/Release/Ascii.o -c -fexceptions -Wall  -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -g -O2 -fvisibility=hidden   -fPIC -std=c++0x -D__STDC_VERSION__=199901L -Werror -IBuild/Include/  OpenHome/Ascii.cpp
cc1plus: error: unrecognized command line option "-std=c++0x"
Common.mak:231: recipe for target 'Build/Obj/Posix/Release/Ascii.o' failed
gmake: *** [Build/Obj/Posix/Release/Ascii.o] Error 1

I could mitigate this error by searching for the command line option "-std=c++0x" and removing it in the Makefile. After that compilation begins, runs for quite a while and stops later with the following error:

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
Os/Posix/Os.c:29:28: error: linux/netlink.h: No such file or directory
Os/Posix/Os.c:30:30: error: linux/rtnetlink.h: No such file or directory
cc1: warnings being treated as errors
Os/Posix/Os.c: In function 'OsSemaphoreDestroy':
Os/Posix/Os.c:341: warning: implicit declaration of function 'TEMP_FAILURE_RETRY'
Os/Posix/Os.c: In function 'CreateHandle':
Os/Posix/Os.c:649: error: '__FD_SETSIZE' undeclared (first use in this function)
Os/Posix/Os.c:649: error: (Each undeclared identifier is reported only once
Os/Posix/Os.c:649: error: for each function it appears in.)
Os/Posix/Os.c: In function 'adapterChangeObserverThread':
Os/Posix/Os.c:1283: warning: type-punning to incomplete type might break strict-aliasing rules
Os/Posix/Os.c:1285: warning: implicit declaration of function 'NLMSG_OK'
Os/Posix/Os.c:1285: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1285: error: 'NLMSG_DONE' undeclared (first use in this function)
Os/Posix/Os.c:1286: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1286: error: 'RTM_NEWADDR' undeclared (first use in this function)
Os/Posix/Os.c:1287: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1287: error: 'RTM_DELADDR' undeclared (first use in this function)
Os/Posix/Os.c:1288: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1288: error: 'RTM_NEWLINK' undeclared (first use in this function)
Os/Posix/Os.c:1291: warning: implicit declaration of function 'NLMSG_NEXT'
Os/Posix/Os.c:1291: warning: assignment makes pointer from integer without a cast
Os/Posix/Os.c: In function 'SetInterfaceChangedObserver_Linux':
Os/Posix/Os.c:1323: error: storage size of 'addr' isn't known
Os/Posix/Os.c:1331: error: 'PF_NETLINK' undeclared (first use in this function)
Os/Posix/Os.c:1331: error: 'NETLINK_ROUTE' undeclared (first use in this function)
Os/Posix/Os.c:1336: error: 'AF_NETLINK' undeclared (first use in this function)
Os/Posix/Os.c:1337: error: 'RTMGRP_LINK' undeclared (first use in this function)
Os/Posix/Os.c:1337: error: 'RTMGRP_IPV4_IFADDR' undeclared (first use in this function)
Os/Posix/Os.c:1323: warning: unused variable 'addr'
Common.mak:421: recipe for target 'Build/Obj/Posix/Release/Os.o' failed
gmake: *** [Build/Obj/Posix/Release/Os.o] Error 1

For me it looks like there are functions called which are only available in Linux. I searched for this in the web, but am not sure if this is easily fixable. What's your opinion on this?

Best Regards,
airflow
Find all posts by this user
15-12-2014, 01:34 PM
Post: #4
RE: Compiling ohNet on FreeBSD
(15-12-2014 01:00 PM)airflow Wrote:  Hello simonc, thanks for the welcome and for the tip regarding gmake. I found that I had to compile rsync as another dependency. I had another error after that:

Code:
gcc -o Build/Obj/Posix/Release/Ascii.o -c -fexceptions -Wall  -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -g -O2 -fvisibility=hidden   -fPIC -std=c++0x -D__STDC_VERSION__=199901L -Werror -IBuild/Include/  OpenHome/Ascii.cpp
cc1plus: error: unrecognized command line option "-std=c++0x"
Common.mak:231: recipe for target 'Build/Obj/Posix/Release/Ascii.o' failed
gmake: *** [Build/Obj/Posix/Release/Ascii.o] Error 1

You should be able to suppress attempts to enable C++11 support by specifying nocpp11=yes when you invoke gmake


(15-12-2014 01:00 PM)airflow Wrote:  After that compilation begins, runs for quite a while and stops later with the following error:

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
Os/Posix/Os.c:29:28: error: linux/netlink.h: No such file or directory
Os/Posix/Os.c:30:30: error: linux/rtnetlink.h: No such file or directory
cc1: warnings being treated as errors
Os/Posix/Os.c: In function 'OsSemaphoreDestroy':
Os/Posix/Os.c:341: warning: implicit declaration of function 'TEMP_FAILURE_RETRY'
Os/Posix/Os.c: In function 'CreateHandle':
Os/Posix/Os.c:649: error: '__FD_SETSIZE' undeclared (first use in this function)
Os/Posix/Os.c:649: error: (Each undeclared identifier is reported only once
Os/Posix/Os.c:649: error: for each function it appears in.)
Os/Posix/Os.c: In function 'adapterChangeObserverThread':
Os/Posix/Os.c:1283: warning: type-punning to incomplete type might break strict-aliasing rules
Os/Posix/Os.c:1285: warning: implicit declaration of function 'NLMSG_OK'
Os/Posix/Os.c:1285: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1285: error: 'NLMSG_DONE' undeclared (first use in this function)
Os/Posix/Os.c:1286: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1286: error: 'RTM_NEWADDR' undeclared (first use in this function)
Os/Posix/Os.c:1287: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1287: error: 'RTM_DELADDR' undeclared (first use in this function)
Os/Posix/Os.c:1288: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1288: error: 'RTM_NEWLINK' undeclared (first use in this function)
Os/Posix/Os.c:1291: warning: implicit declaration of function 'NLMSG_NEXT'
Os/Posix/Os.c:1291: warning: assignment makes pointer from integer without a cast
Os/Posix/Os.c: In function 'SetInterfaceChangedObserver_Linux':
Os/Posix/Os.c:1323: error: storage size of 'addr' isn't known
Os/Posix/Os.c:1331: error: 'PF_NETLINK' undeclared (first use in this function)
Os/Posix/Os.c:1331: error: 'NETLINK_ROUTE' undeclared (first use in this function)
Os/Posix/Os.c:1336: error: 'AF_NETLINK' undeclared (first use in this function)
Os/Posix/Os.c:1337: error: 'RTMGRP_LINK' undeclared (first use in this function)
Os/Posix/Os.c:1337: error: 'RTMGRP_IPV4_IFADDR' undeclared (first use in this function)
Os/Posix/Os.c:1323: warning: unused variable 'addr'
Common.mak:421: recipe for target 'Build/Obj/Posix/Release/Os.o' failed
gmake: *** [Build/Obj/Posix/Release/Os.o] Error 1

For me it looks like there are functions called which are only available in Linux. I searched for this in the web, but am not sure if this is easily fixable. What's your opinion on this?

This does appear to be linux code being incorrectly referenced. The easiest way to fix this would be to add support for a command line flag that signifies FreeBSD support, say

freebsd=1

set an extra define inside Makefile when this command line flag is present. You could possibly do this by setting

Code:
ifeq ($(freebsd), 1)
    cflags_base = $(cflags_base) -DPLATFORM_FREE_BSD
around line 289 of Makefile.

You'll then need to check for this define inside ohNet/Os/Posix/Os.c. Probably everywhere that checks

#ifndef PLATFORM_MACOSX_GNU

should change to

#if !defined(PLATFORM_MACOSX_GNU) && !defined(PLATFORM_FREEBSD)
Find all posts by this user
15-12-2014, 02:16 PM
Post: #5
RE: Compiling ohNet on FreeBSD
(15-12-2014 01:34 PM)simonc Wrote:  [...]
You'll then need to check for this define inside ohNet/Os/Posix/Os.c. Probably everywhere that checks

#ifndef PLATFORM_MACOSX_GNU

should change to

#if !defined(PLATFORM_MACOSX_GNU) && !defined(PLATFORM_FREEBSD)

Thanks again for your suggestions, I implemented them.

In the file Os/Posix/Os.c I also found a few lines

#endif /* PLATFOTM_MACOSX_GNU */

do these also have to be modified? Yes, it really says PLATFOTM, not PLATFORM. I think that these are possibly the reason for compilation still not working:

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
Os/Posix/Os.c:29:28: error: linux/netlink.h: No such file or directory
Os/Posix/Os.c:30:30: error: linux/rtnetlink.h: No such file or directory
Os/Posix/Os.c:40:53: error: SystemConfiguration/SystemConfiguration.h: No such file or directory
Os/Posix/Os.c:41:22: error: execinfo.h: No such file or directory
Os/Posix/Os.c:67:1: error: "MSG_NOSIGNAL" redefined
In file included from Os/Posix/Os.c:23:
/usr/include/sys/socket.h:461:1: error: this is the location of the previous definition
Os/Posix/Os.c:1138: error: expected specifier-qualifier-list before 'SCDynamicStoreRef'
Os/Posix/Os.c: In function 'adapterChangeObserverThread':
Os/Posix/Os.c:1263: error: 'InterfaceChangedObserver' has no member named 'netHnd'
cc1: warnings being treated as errors
Os/Posix/Os.c:1283: warning: type-punning to incomplete type might break strict-aliasing rules
Os/Posix/Os.c:1285: warning: implicit declaration of function 'NLMSG_OK'
Os/Posix/Os.c:1285: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1285: error: 'NLMSG_DONE' undeclared (first use in this function)
Os/Posix/Os.c:1285: error: (Each undeclared identifier is reported only once
Os/Posix/Os.c:1285: error: for each function it appears in.)
Os/Posix/Os.c:1286: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1286: error: 'RTM_NEWADDR' undeclared (first use in this function)
Os/Posix/Os.c:1287: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1287: error: 'RTM_DELADDR' undeclared (first use in this function)
Os/Posix/Os.c:1288: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1288: error: 'RTM_NEWLINK' undeclared (first use in this function)
Os/Posix/Os.c:1291: warning: implicit declaration of function 'NLMSG_NEXT'
Os/Posix/Os.c:1291: warning: assignment makes pointer from integer without a cast
Os/Posix/Os.c: In function 'DestroyInterfaceChangedObserver_Linux':
Os/Posix/Os.c:1308: error: 'struct InterfaceChangedObserver' has no member named 'iThread'
Os/Posix/Os.c:1309: error: 'struct InterfaceChangedObserver' has no member named 'netHnd'
Os/Posix/Os.c:1310: error: 'struct InterfaceChangedObserver' has no member named 'iThread'
Os/Posix/Os.c:1311: error: 'struct InterfaceChangedObserver' has no member named 'iThread'
Os/Posix/Os.c:1314: error: 'struct InterfaceChangedObserver' has no member named 'netHnd'
Os/Posix/Os.c: In function 'SetInterfaceChangedObserver_Linux':
Os/Posix/Os.c:1323: error: storage size of 'addr' isn't known
Os/Posix/Os.c:1331: error: 'PF_NETLINK' undeclared (first use in this function)
Os/Posix/Os.c:1331: error: 'NETLINK_ROUTE' undeclared (first use in this function)
Os/Posix/Os.c:1336: error: 'AF_NETLINK' undeclared (first use in this function)
Os/Posix/Os.c:1337: error: 'RTMGRP_LINK' undeclared (first use in this function)
Os/Posix/Os.c:1337: error: 'RTMGRP_IPV4_IFADDR' undeclared (first use in this function)
Os/Posix/Os.c:1343: error: 'struct InterfaceChangedObserver' has no member named 'netHnd'
Os/Posix/Os.c:1350: error: 'struct InterfaceChangedObserver' has no member named 'iThread'
Os/Posix/Os.c:1323: warning: unused variable 'addr'
Os/Posix/Os.c: In function 'DestroyInterfaceChangedObserver':
Os/Posix/Os.c:1370: warning: implicit declaration of function 'DestroyInterfaceChangedObserver_MacDesktop'
Os/Posix/Os.c: In function 'OsNetworkSetInterfaceChangedObserver':
Os/Posix/Os.c:1382: warning: implicit declaration of function 'SetInterfaceChangedObserver_MacDesktop'
Os/Posix/Os.c:31:1: error: unterminated #if
Os/Posix/Os.c:28:1: error: unterminated #if
Common.mak:421: recipe for target 'Build/Obj/Posix/Release/Os.o' failed
gmake: *** [Build/Obj/Posix/Release/Os.o] Error 1
Find all posts by this user
15-12-2014, 02:34 PM
Post: #6
RE: Compiling ohNet on FreeBSD
(15-12-2014 02:16 PM)airflow Wrote:  Thanks again for your suggestions, I implemented them.

In the file Os/Posix/Os.c I also found a few lines

#endif /* PLATFOTM_MACOSX_GNU */

do these also have to be modified? Yes, it really says PLATFOTM, not PLATFORM.

Text inside /* .... */ is a comment. It'd be good practice to update this but it isn't required. The typos you've spotted have been there for a long time so, while embarrassing, don't disrupt the build.

(15-12-2014 02:16 PM)airflow Wrote:  ...compilation still not working:

It looks like your changes haven't taken effect. (The command line used to compile OS.c doesn't include a PLATFORM_FREEBSD define). Can you confirm the full command line you use with gmake please? I'd expect it to be

gmake all nocpp11=yes freebsd=1
Find all posts by this user
15-12-2014, 03:57 PM
Post: #7
RE: Compiling ohNet on FreeBSD
(15-12-2014 02:34 PM)simonc Wrote:  It looks like your changes haven't taken effect. (The command line used to compile OS.c doesn't include a PLATFORM_FREEBSD define). Can you confirm the full command line you use with gmake please? I'd expect it to be

gmake all nocpp11=yes freebsd=1

Thanks for stating the obvious, I did indeed miss the flag! Undecided

Giving it reveals that there is a problem in the statement I added in the Makefile for defining the freebsd-flag:

Code:
Makefile:299: *** Recursive variable 'cflags_base' references itself (eventually).  Stop.

This points exactly to the code (define) I added for the freebsd-flag:

Code:
# added for FreeBSD-compatibility
ifeq ($(freebsd), 1)
    cflags_base = $(cflags_base) -DPLATFORM_FREE_BSD
endif

Could it be that this should rather be:

Code:
# added for FreeBSD-compatibility
ifeq ($(freebsd), 1)
    cflags = $(cflags_base) -DPLATFORM_FREE_BSD
endif

If I change this, the compilation begins, but fails with the same error-message like before:

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
Os/Posix/Os.c:29:28: error: linux/netlink.h: No such file or directory
Os/Posix/Os.c:30:30: error: linux/rtnetlink.h: No such file or directory
Os/Posix/Os.c:40:53: error: SystemConfiguration/SystemConfiguration.h: No such file or directory
Os/Posix/Os.c:41:22: error: execinfo.h: No such file or directory
Os/Posix/Os.c:67:1: error: "MSG_NOSIGNAL" redefined
In file included from Os/Posix/Os.c:23:
/usr/include/sys/socket.h:461:1: error: this is the location of the previous definition
Os/Posix/Os.c:1138: error: expected specifier-qualifier-list before 'SCDynamicStoreRef'
Os/Posix/Os.c: In function 'adapterChangeObserverThread':
Os/Posix/Os.c:1263: error: 'InterfaceChangedObserver' has no member named 'netHnd'
cc1: warnings being treated as errors
Os/Posix/Os.c:1283: warning: type-punning to incomplete type might break strict-aliasing rules
Os/Posix/Os.c:1285: warning: implicit declaration of function 'NLMSG_OK'
Os/Posix/Os.c:1285: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1285: error: 'NLMSG_DONE' undeclared (first use in this function)
Os/Posix/Os.c:1285: error: (Each undeclared identifier is reported only once
Os/Posix/Os.c:1285: error: for each function it appears in.)
Os/Posix/Os.c:1286: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1286: error: 'RTM_NEWADDR' undeclared (first use in this function)
Os/Posix/Os.c:1287: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1287: error: 'RTM_DELADDR' undeclared (first use in this function)
Os/Posix/Os.c:1288: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1288: error: 'RTM_NEWLINK' undeclared (first use in this function)
Os/Posix/Os.c:1291: warning: implicit declaration of function 'NLMSG_NEXT'
Os/Posix/Os.c:1291: warning: assignment makes pointer from integer without a cast
Os/Posix/Os.c: In function 'DestroyInterfaceChangedObserver_Linux':
Os/Posix/Os.c:1308: error: 'struct InterfaceChangedObserver' has no member named 'iThread'
Os/Posix/Os.c:1309: error: 'struct InterfaceChangedObserver' has no member named 'netHnd'
Os/Posix/Os.c:1310: error: 'struct InterfaceChangedObserver' has no member named 'iThread'
Os/Posix/Os.c:1311: error: 'struct InterfaceChangedObserver' has no member named 'iThread'
Os/Posix/Os.c:1314: error: 'struct InterfaceChangedObserver' has no member named 'netHnd'
Os/Posix/Os.c: In function 'SetInterfaceChangedObserver_Linux':
Os/Posix/Os.c:1323: error: storage size of 'addr' isn't known
Os/Posix/Os.c:1331: error: 'PF_NETLINK' undeclared (first use in this function)
Os/Posix/Os.c:1331: error: 'NETLINK_ROUTE' undeclared (first use in this function)
Os/Posix/Os.c:1336: error: 'AF_NETLINK' undeclared (first use in this function)
Os/Posix/Os.c:1337: error: 'RTMGRP_LINK' undeclared (first use in this function)
Os/Posix/Os.c:1337: error: 'RTMGRP_IPV4_IFADDR' undeclared (first use in this function)
Os/Posix/Os.c:1343: error: 'struct InterfaceChangedObserver' has no member named 'netHnd'
Os/Posix/Os.c:1350: error: 'struct InterfaceChangedObserver' has no member named 'iThread'
Os/Posix/Os.c:1323: warning: unused variable 'addr'
Os/Posix/Os.c: In function 'DestroyInterfaceChangedObserver':
Os/Posix/Os.c:1370: warning: implicit declaration of function 'DestroyInterfaceChangedObserver_MacDesktop'
Os/Posix/Os.c: In function 'OsNetworkSetInterfaceChangedObserver':
Os/Posix/Os.c:1382: warning: implicit declaration of function 'SetInterfaceChangedObserver_MacDesktop'
Os/Posix/Os.c:31:1: error: unterminated #if
Os/Posix/Os.c:28:1: error: unterminated #if
Common.mak:421: recipe for target 'Build/Obj/Posix/Release/Os.o' failed
gmake: *** [Build/Obj/Posix/Release/Os.o] Error 1

I assume I miss somthing in the Os.c-file. There is one occurrence of PLATFORM_MACOSX_GNU in the file, where I didn't change anything:

Code:
#if defined(PLATFORM_MACOSX_GNU) && !defined(PLATFORM_IOS)

Could that be the problem?
Find all posts by this user
15-12-2014, 04:33 PM
Post: #8
RE: Compiling ohNet on FreeBSD
You probably want to replace my suggested Makefile changes with

Code:
ifeq ($(platform), FreeBSD)
    platform_cflags = $(version_specific_cflags) -fPIC -DPLATFORM_FREEBSD
    platform_linkflags = $(version_specific_linkflags) -pthread
        linkopts_ohNet = -Wl,-soname,libohNet.so
    osbuilddir = Posix
    osdir = Posix
    endian ?= LITTLE
endif

around the similar lines for "Vanilla" (around line 264).

I'm not sure how best to set platform but the top of the file has a number of examples to experiment with clones of.
Find all posts by this user
21-12-2014, 05:48 PM
Post: #9
RE: Compiling ohNet on FreeBSD
(15-12-2014 04:33 PM)simonc Wrote:  You probably want to replace my suggested Makefile changes with

Code:
ifeq ($(platform), FreeBSD)
    platform_cflags = $(version_specific_cflags) -fPIC -DPLATFORM_FREEBSD
    platform_linkflags = $(version_specific_linkflags) -pthread
        linkopts_ohNet = -Wl,-soname,libohNet.so
    osbuilddir = Posix
    osdir = Posix
    endian ?= LITTLE
endif

around the similar lines for "Vanilla" (around line 264).

I'm not sure how best to set platform but the top of the file has a number of examples to experiment with clones of.

Your suggestion is to work with the already existing "platform"-parameter instead of introducing a new one (freebsd). This parameter has of course to be given when calling gmake, right? For example "gmake nocpp11=yes platform=FreeBSD".

So far so good. If I try this with the settings you suggested, compilation immediately stops like this:

Code:
root@testus_1:/usr/local/ohnet # gmake nocpp11=yes platform=FreeBSD
CROSS_COMPILE:
Machine reported by compiler is: amd64-undermydesk-freebsd
Machine reported by uname is: FreeBSD
Building for system Unknown and architecture x64
mkdir -p Generated
o Generated/Devices.mak OpenHome/Net/T4/Templates/DvUpnpMakeDevices.tt -a xml:OpenHome/Net/Service/Services.xml
gmake: o: Command not found
Common.mak:1354: recipe for target 'Generated/Devices.mak' failed
gmake: [Generated/Devices.mak] Error 127 (ignored)
Attention: a makefile has been re-generated.
mkdir -p Generated
o Generated/Proxies.mak OpenHome/Net/T4/Templates/CpUpnpMakeProxies.tt -a xml:OpenHome/Net/Service/Services.xml
gmake: o: Command not found
Common.mak:1349: recipe for target 'Generated/Proxies.mak' failed
gmake: [Generated/Proxies.mak] Error 127 (ignored)
Attention: a makefile has been re-generated.
mkdir -p
usage: mkdir [-pv] [-m mode] directory_name ...
Makefile:419: recipe for target 'make_obj_dir' failed
gmake: *** [make_obj_dir] Error 64

I then experimented by modifying the "ifeq ($(platform), FreeBSD)"-snippet. First, I tried to copy the contents of the "Vanilla"-section, to see if I can work from there. I assume that "Vanilla" is the platform that is chosen by default? Fact is, if I explicitely set platform=Vanilla, it compiles just as it did before (ending with the C.os/linux error), so I assume this is the case.

So after changing the code to

Code:
ifeq ($(platform), FreeBSD)
        # platform == Vanilla (i.e. Kirkwood, x86 or x64)
        platform_cflags = $(version_specific_cflags) -fPIC
        platform_linkflags = $(version_specific_linkflags) -pthread
        linkopts_ohNet = -Wl,-soname,libohNet.so
        osbuilddir = Posix
        osdir = Posix
        endian ?= LITTLE
        ifeq ($(Qnap-anycpu), 1)
            openhome_system = Qnap
            nocpp11=yes
        else
            openhome_system = Linux
        endif
endif

...I would expect platform=FreeBSD to behave the same like platform=Vanilla. Because it now contains the same settings, doesn't it? Strangely, it doesn't - it fails immediately like before:

Code:
root@testus_1:/usr/local/ohnet # gmake nocpp11=yes platform=FreeBSD
CROSS_COMPILE:
Machine reported by compiler is: amd64-undermydesk-freebsd
Machine reported by uname is: FreeBSD
Building for system Linux and architecture x64
mkdir -p Generated
o Generated/Devices.mak OpenHome/Net/T4/Templates/DvUpnpMakeDevices.tt -a xml:OpenHome/Net/Service/Services.xml
gmake: o: Command not found
Common.mak:1354: recipe for target 'Generated/Devices.mak' failed
gmake: [Generated/Devices.mak] Error 127 (ignored)
Attention: a makefile has been re-generated.
mkdir -p Generated
o Generated/Proxies.mak OpenHome/Net/T4/Templates/CpUpnpMakeProxies.tt -a xml:OpenHome/Net/Service/Services.xml
gmake: o: Command not found
Common.mak:1349: recipe for target 'Generated/Proxies.mak' failed
gmake: [Generated/Proxies.mak] Error 127 (ignored)
Attention: a makefile has been re-generated.
mkdir -p
usage: mkdir [-pv] [-m mode] directory_name ...
Makefile:426: recipe for target 'make_obj_dir' failed
gmake: *** [make_obj_dir] Error 64


I tried to wrap my head around this for several times these days. I'm afraid I don't understand this stuff enough to fix it myself. I'll try out anyhing you suggest, if you are willing to continue to help, tough! :-)

Thanks & greetings,
airflow
Find all posts by this user
22-12-2014, 09:42 AM
Post: #10
RE: Compiling ohNet on FreeBSD
(21-12-2014 05:48 PM)airflow Wrote:  Your suggestion is to work with the already existing "platform"-parameter instead of introducing a new one (freebsd). This parameter has of course to be given when calling gmake, right? For example "gmake nocpp11=yes platform=FreeBSD".

I'd meant for you to add a section like
Code:
@@ -60,6 +60,10 @@ else ifeq ($(Android-anycpu), 1)
     platform = Android
     detected_openhome_system = Android
     detected_openhome_architecture = anycpu
+else ifeq ($(freebsd), 1)
+    platform = FreeBSD
+    detected_openhome_system = FreeBSD
+    detected_openhome_architecture = x86
(note that only the lines prefixed with + are new)
then build using
Code:
gmake all nocpp11=yes freebsd=1


(21-12-2014 05:48 PM)airflow Wrote:  So far so good. If I try this with the settings you suggested, compilation immediately stops like this:

Code:
root@testus_1:/usr/local/ohnet # gmake nocpp11=yes platform=FreeBSD
CROSS_COMPILE:
Machine reported by compiler is: amd64-undermydesk-freebsd
Machine reported by uname is: FreeBSD
Building for system Unknown and architecture x64
mkdir -p Generated
o Generated/Devices.mak OpenHome/Net/T4/Templates/DvUpnpMakeDevices.tt -a xml:OpenHome/Net/Service/Services.xml
gmake: o: Command not found
Common.mak:1354: recipe for target 'Generated/Devices.mak' failed
gmake: [Generated/Devices.mak] Error 127 (ignored)
Attention: a makefile has been re-generated.
mkdir -p Generated
o Generated/Proxies.mak OpenHome/Net/T4/Templates/CpUpnpMakeProxies.tt -a xml:OpenHome/Net/Service/Services.xml
gmake: o: Command not found
Common.mak:1349: recipe for target 'Generated/Proxies.mak' failed
gmake: [Generated/Proxies.mak] Error 127 (ignored)
Attention: a makefile has been re-generated.
mkdir -p
usage: mkdir [-pv] [-m mode] directory_name ...
Makefile:419: recipe for target 'make_obj_dir' failed
gmake: *** [make_obj_dir] Error 64

Our builds include some amount of code generation. The tools for this are written in C#. Use of these should be optional but it sounds like there might be a bug somewhere that's making it mandatory. Is it possible for you to install mono (an open source implementation of the .NET runtime) for FreeBSD? You'd then have to build our code generation tools using
Code:
gmake tt freebsd=1 uset4=yes
Find all posts by this user


Forum Jump: