Menu

#1666 various FreeBsd compilation issues

3.0.0
closed-fixed
None
5
2011-10-01
2011-10-01
Anton Pak
No

I got this from Ed Maste:

I just took at the latest svn trunk to investigate building on FreeBSD
again, and here are my notes relative to my last try. My testing is on
FreeBSD 9.

On Mon, Feb 14, 2011 at 09:51:57PM -0500, Ed Maste wrote:

> I'm doing an initial investigation into porting OpenHPI to FreeBSD, and
> have a couple of observations so far.
>
> 1) GNU configure

Fixed, thanks.

> 2) DST_* conflict
>
> In plugins/snmp_bc/snmp_bc_time.h there's an enum with members DST_NONE,
> DST_USA, etc. These conflict with #DEFINEs of DST_NONE, DST_USA and the
> like in FreeBSD's <sys/time.h> include.

This problem still exists. I can't see how these enums (in
plugins/snmp_bc/snmp_bc_time.h) are actually used. I prefixed
each with an _ to let it compile.

> 3) PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP not defined.

Fixed.

> 4) Unknown assembly pseudo-op .weakref

This was a local issue on my end.

5) HOST_NAME_MAX in plugins/ilo2_ribcl/ilo2_ribcl.h

bits/local_lim.h seems to be a Linuxism. As a workaround I just
deleted the #include and added #define HOST_NAME_MAX 255 for now. I'm
not sure at the moment what the right change is; in limits.h we have a
#define _POSIX_HOST_NAME_MAX 255

6) log2 conflict in plugins/ipmidirect/ipmi_sensor_factors.cpp

Older versions of FreeBSD did not have log2(), 8.3 and 9.0 will and this
conflicts with the local definition in ipmi_sensor_factors.cpp.
FreeBSD defines __FreeBSD_version in sys/param.h and this can be used
for conditionals to address this - e.g.

#include <sys/param.h>
#if __FreeBSD_version < 802502
static double log2( double val )
{
return log( val ) / M_LN2;
}
#endif

The values are documented at
http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html
for example,
802502 March 6, 2011 8.2-STABLE after merging log2 and log2f into libm.

7) sockaddr_in in openhpid/server.cpp

To obtain sockaddr_in I had to add

#include <netinet/in.h>

Thank you for working to make OpenHPI portable.

-Ed

Discussion

  • Anton Pak

    Anton Pak - 2011-10-01

    Fixes for issues #2, #6, #7 added in trunk (rev. #7361)

     
  • Anton Pak

    Anton Pak - 2011-10-01
    • status: open --> open-accepted
     
  • Anton Pak

    Anton Pak - 2011-10-01
    • status: open-accepted --> closed-fixed