I have been looking at building avahi 0.6.9 on Solaris.

The attached patch allows me to build with the following configure command:

CPPFLAGS="-I/usr/sfw/include" CFLAGS="-I/usr/sfw/include -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" LDFLAGS="-lsocket -lnsl -L/usr/sfw/lib" ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-distro=none --disable-qt3 --disable-qt4 --disable-mono --disable-monodoc --enable-tests --disable-compat-howl --disable-compat-libdns_sd -enable-expat --disable-gdbm

Could this patch be applied?

Padraig
--- /usr/tmp/clean/avahi-0.6.9/configure.ac	2006-03-02 01:32:38.000000000 +0000
+++ avahi-0.6.9/configure.ac	2006-05-02 14:13:31.194233000 +0100
@@ -85,6 +85,30 @@
 AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ])
 
 #
+# Check for sys/filio.h; needed for FIONREAD on Solaris
+#
+AC_CHECK_HEADER(sys/filio.h, 
+HAVE_SYS_FILIO_H=yes
+AC_DEFINE([HAVE_SYS_FILIO_H],[],[Support for sys/filio.h])
+, [], [
+])
+
+AM_CONDITIONAL(HAVE_SYS_FILIO_H, [ test x"$HAVE_SYS_FILIO_H" = xyes ])
+
+#
+# Check for sys/sysctl.h; not rpesent on Solaris
+#
+AC_CHECK_HEADER(sys/sysctl.h, 
+HAVE_SYS_SYSCTL=yes
+AC_DEFINE([HAVE_SYS_SYSCTL_H],[],[Support for sys/sysctl.h])
+, [], [
+])
+
+AM_CONDITIONAL(HAVE_SYS_SYSCTL_H, [ test x"$HAVE_SYS_SYSCTL_H" = xyes ])
+
+#
+
+#
 # Check for struct ip_mreqn
 #
 AC_MSG_CHECKING(for struct ip_mreqn)
@@ -541,7 +565,9 @@
         fi
 
         AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)])
-        AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
+        if test "x$HAVE_GDBM" = "xyes"; then
+            AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
+        fi
     fi
 fi
 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
--- /usr/tmp/clean/avahi-0.6.9/config.h.in	2006-03-02 01:33:53.000000000 +0000
+++ avahi-0.6.9/config.h.in	2006-05-02 14:55:16.038999000 +0100
@@ -92,6 +92,12 @@
 /* Support for PF_ROUTE */
 #undef HAVE_PF_ROUTE
 
+/* Define to 1 if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+#undef HAVE_SYS_SYSCTL_H
+
 /* Define if you have POSIX threads libraries and header files. */
 #undef HAVE_PTHREAD
 
--- /usr/tmp/clean/avahi-0.6.9/avahi-core/socket.c	2006-02-10 01:45:09.000000000 +0000
+++ avahi-0.6.9/avahi-core/socket.c	2006-05-02 11:39:20.823140000 +0100
@@ -31,6 +31,9 @@
 #include <fcntl.h>
 #include <sys/time.h>
 #include <sys/ioctl.h>
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
 #include <assert.h>
 
 #include <sys/types.h>
--- /usr/tmp/clean/avahi-0.6.9/avahi-core/iface-pfroute.c	2006-02-23 00:55:00.000000000 +0000
+++ avahi-0.6.9/avahi-core/iface-pfroute.c	2006-05-02 14:20:17.212944000 +0100
@@ -32,7 +32,9 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/param.h>
+#ifdef HAVE_SYS_SYSCTL_H
 #include <sys/sysctl.h>
+#endif
 
 #include <net/route.h>
 #include <net/if.h>
@@ -108,7 +110,11 @@
 
 #define ROUNDUP(a) \
      ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+#ifdef HAVE_SYS_SYSCTL_H
 #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
+#else
+#define ADVANCE(x, n) (x += ROUNDUP(sizeof(struct sockaddr)))
+#endif
 
 static void rtm_addr(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m)
 {
@@ -140,8 +146,10 @@
       if (!(addrs & 1<<i))
 	continue;
       sa = (struct sockaddr *)cp;
+#ifdef HAVE_SYS_SYSCTL_H
       if (sa->sa_len == 0) 
 	continue;
+#endif
       switch(sa->sa_family) {
       case AF_INET:
 	switch (1<<i) {
@@ -317,6 +325,7 @@
   assert(m);
   
  retry2:
+#ifdef HAVE_SYS_SYSCTL_H
   mib[0] = CTL_NET;
   mib[1] = PF_ROUTE;
   mib[2] = 0;             /* protocol */
@@ -329,11 +338,13 @@
       avahi_log_error("route-sysctl-estimate");
       return;
     }
+#endif
   if ((buf = avahi_malloc(needed)) == NULL)
     {
       avahi_log_error("malloc failed in avahi_interface_monitor_sync");
       return;
     }
+#ifdef HAVE_SYS_SYSCTL_H
   if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
     avahi_log_warn("sysctl failed: %s", strerror(errno));
     if (errno == ENOMEM && count++ < 10) {
@@ -343,6 +354,7 @@
       goto retry2;
     }
   }
+#endif
   lim = buf + needed;
   for (next = buf; next < lim; next += rtm->rtm_msglen) {
     rtm = (struct rt_msghdr *)next;
--- /usr/tmp/clean/avahi-0.6.9/avahi-daemon/simple-protocol.c	2006-02-23 00:44:03.000000000 +0000
+++ avahi-0.6.9/avahi-daemon/simple-protocol.c	2006-05-02 14:33:59.808756000 +0100
@@ -49,6 +49,13 @@
 #include "chroot.h"
 #endif
 
+#ifndef AF_LOCAL
+#define AF_LOCAL AF_UNIX
+#endif
+#ifndef PF_LOCAL
+#define PF_LOCAL PF_UNIX
+#endif
+
 #define BUFFER_SIZE (20*1024)
 
 #define CLIENTS_MAX 50
--- /usr/tmp/clean/avahi-0.6.9/service-type-database/Makefile.am	2005-09-25 21:34:48.000000000 +0100
+++ avahi-0.6.9/service-type-database/Makefile.am	2006-05-02 14:37:48.880859000 +0100
@@ -22,6 +22,7 @@
 pkgdata_DATA=service-types
 
 if HAVE_PYTHON
+if HAVE_GDBM
 
 noinst_SCRIPTS=build-db
 pkgdata_DATA+=service-types.db
@@ -36,3 +37,4 @@
 CLEANFILES = service-types.db build-db
 
 endif
+endif
_______________________________________________
avahi mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/avahi

Reply via email to