Compiling 1.9.11 on Solaris 9
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. -- albert chin (china@thewrittenword.com)
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 + static void afinet_set_port(GSockAddr *addr, gint port, gchar *service, gchar *proto) @@ -243,9 +253,13 @@ afinet_sd_new(gint af, gchar *host, gint } else { +#if ENABLE_IPV6 self->super.bind_addr = g_sockaddr_inet6_new("::", port); if (!host) host = "::"; +#else + g_assert_not_reached(); +#endif } afinet_resolve_name(self->super.bind_addr, host); self->super.setup_socket = afinet_sd_setup_socket; @@ -300,8 +314,12 @@ afinet_dd_new(gint af, gchar *host, gint } else { +#if ENABLE_IPV6 self->super.bind_addr = g_sockaddr_inet6_new("::", 0); self->super.dest_addr = g_sockaddr_inet6_new("::", port); +#else + g_assert_not_reached(); +#endif } afinet_resolve_name(self->super.dest_addr, host); self->super.setup_socket = afinet_dd_setup_socket; -- Bazsi
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@thewrittenword.com)
On Fri, 2006-05-26 at 14:44 -0500, Albert Chin wrote:
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.
As I see those are at least partially broken. setsockopt() is defined to use a 'level' argument, and there's a protocol independent level, which is called SOL_SOCKET, this macro is defined on those platforms as well. I don't think it is consistent to use SOL_SOCKET for socket level operations, and IPPROTO_* for non-socket operations. Not to mention that IPPROTO_IPV6 as a name suggests the IPv6 is a subprotocol of IP itself, which is IPv4. This is certainly not true. Linux supports the IPX protocol through the same socket interface, in this case I would use SOL_IPX So as I see those are the platforms that lack proper naming for the setsockopt level argument. :) -- Bazsi
participants (2)
-
Albert Chin
-
Balazs Scheidler