[syslog-ng] Compiling 1.9.11 on Solaris 9

Albert Chin syslog-ng at mlists.thewrittenword.com
Fri May 26 21:44:53 CEST 2006


On Fri, May 26, 2006 at 09:31:10PM +0200, Balazs Scheidler wrote:
> On Thu, 2006-05-25 at 18:16 -0500, Albert Chin wrote:
> > I tried building syslog-ng 1.9.11 on Solaris 9 with the Sun C
> > compiler. It failed with the following:
> >   cc -DHAVE_CONFIG_H -I. -I. -I..
> >   -DPATH_SYSCONFDIR=\"/etc/opt/TWWfsw/syslogng1911\"
> >   -DPATH_LOCALSTATEDIR=\"/var/opt/TWWfsw/syslogng1911\"
> >   -I/opt/TWWfsw/libglib26/include -I/opt/TWWfsw/libglib26/lib/include
> >   -I/opt/TWWfsw/gettext014/include
> >   -I/opt/TWWfsw/syslogng198/include/eventlog   -D_GNU_SOURCE  -mr -Qn
> >   -xstrconst -xO2 -xtarget=ultra2 -xarch=v8plusa -c afinet.c
> >   "afinet.c", line 81: warning: implicit function declaration: memset
> >   "afinet.c", line 156: undefined symbol: SOL_IP
> >   "afinet.c", line 162: undefined symbol: SOL_IP
> >   "afinet.c", line 169: undefined symbol: SOL_IP
> >   "afinet.c", line 172: undefined symbol: SOL_IP
> >   "afinet.c", line 181: warning: left operand of "->" must be pointer to struct/union
> >   "afinet.c", line 188: undefined symbol: SOL_IPV6
> >   "afinet.c", line 194: undefined symbol: SOL_IPV6
> >   "afinet.c", line 200: undefined symbol: SOL_IPV6
> >   cc: acomp failed for afinet.c
> >   gmake[2]: *** [afinet.o] Error 2
> >   gmake[2]: Leaving directory `/opt/build/syslog-ng-1.9.11/src'
> > 
> > The prototype for memset() is in <string.h>.
> > 
> > Solaris 9 doesn't have SOL_IP anywhere in /usr/include. From
> > setsockopt(3SOCKET) on Solaris 9:
> >      When manipulating socket options, the  level  at  which  the
> >      option resides and the name of the option must be specified.
> >      To manipulate options at the "socket" level, level is speci-
> >      fied  as  SOL_SOCKET.  To  manipulate  options  at any other
> >      level, level is the protocol number  of  the  protocol  that
> >      controls the option. For example, to indicate that an option
> >      is to be interpreted by the TCP protocol, level  is  set  to
> >      the TCP protocol number .  See getprotobyname(3SOCKET).
> > 
> > AIX 5.3 doesn't build for the same reason:
> >   "afinet.c", line 157.32: 1506-045 (S) Undeclared identifier SOL_IP.
> >   "afinet.c", line 182.13: 1506-021 (S) Expecting struct or union.
> >   "afinet.c", line 189.32: 1506-045 (S) Undeclared identifier SOL_IPV6.
> >   gmake[2]: *** [afinet.o] Error 1
> >   gmake[2]: Leaving directory `/opt/build/syslog-ng-1.9.11/src'
> > 
> > Ditto for HP-UX 11.23/PA and 11.23/IA.
> > 
> 
> Here's the patch, which I have just commited (or use tomorrow's
> snapshot):
> 
> --- orig/src/afinet.c
> +++ mod/src/afinet.c
> @@ -28,6 +28,16 @@
>  #include <arpa/inet.h>
>  #include <netdb.h>
> 
> +#include <string.h>
> +
> +#ifndef SOL_IP
> +#define SOL_IP IPPROTO_IP
> +#endif
> +
> +#ifndef SOL_IPV6
> +#define SOL_IPV6 IPPROTO_IPV6
> +#endif

Why not just use IPPROTO_IP and IPPROTO_IPV6? SOL_IP is
Linux-specific. HP-UX, Solaris, AIX, IRIX, and Tru64 UNIX don't have
it. However, all have IPPROTO_IP and possibly IPPROTO_IPV6.

-- 
albert chin (china at thewrittenword.com)


More information about the syslog-ng mailing list