]> git.meshlink.io Git - catta/commitdiff
Patch from Padraig O'Briain <Padraig.Obriain@sun.com> to build avahi on Solaris
authorSebastien Estienne <sebastien.estienne@gmail.com>
Tue, 2 May 2006 15:10:31 +0000 (15:10 +0000)
committerSebastien Estienne <sebastien.estienne@gmail.com>
Tue, 2 May 2006 15:10:31 +0000 (15:10 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1206 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/iface-pfroute.c
avahi-core/socket.c
avahi-daemon/simple-protocol.c
bootstrap.sh
configure.ac
service-type-database/Makefile.am

index 8b76afa2a552ea0ec24db4dba40d0faeaa09c544..51f67730e6159cf8afcd194a4fa7e12c4edf1d3a 100644 (file)
@@ -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 @@ static void rtm_info(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m)
 
 #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 @@ static void rtm_addr(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m)
       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 @@ void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
   assert(m);
   
  retry2:
+#ifdef HAVE_SYS_SYSCTL_H
   mib[0] = CTL_NET;
   mib[1] = PF_ROUTE;
   mib[2] = 0;             /* protocol */
@@ -329,11 +338,13 @@ void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
       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 @@ void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
       goto retry2;
     }
   }
+#endif
   lim = buf + needed;
   for (next = buf; next < lim; next += rtm->rtm_msglen) {
     rtm = (struct rt_msghdr *)next;
index 0eb0374d065c6c2c6f75b8dda7e2239f927065f9..bd729341b74de3b942e44dae24ebb64863be4cd2 100644 (file)
@@ -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>
index 740f78b1f581250802fd167c9bb351359264a85b..04b07c77fbff083a45183ac7b11fd5348d26dea2 100644 (file)
 #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
index d0f85cc1c0bfc8bb697efb0df2c71ce0920f000f..ada993ffa8bcd39c8dda51a9e710e4fbb114b2c2 100755 (executable)
@@ -55,7 +55,7 @@ case "$USER" in
     FLAGS="$FLAGS --disable-qt4"
     ;;
     sebest)
-    FLAGS="$FLAGS --enable-monodoc=auto --enable-dbus=auto --enable-mono=auto --enable-qt3=auto --enable-qt4=auto  --sysconfdir=/etc --localstatedir=/var --prefix=/usr  --disable-manpages --disable-xmltoman"
+    FLAGS="$FLAGS --disable-monodoc --enable-dbus=no --enable-mono=no --enable-qt3=no --enable-qt4=no  --sysconfdir=/etc --localstatedir=/var --prefix=/usr  --disable-manpages --disable-xmltoman"
     ;;
 esac
 
index a7d2c65645ca348ce6193cca7a010b790bbf6368..bf22be87970c7eec3e4355fc45d28b761d2d696c 100644 (file)
@@ -84,6 +84,28 @@ AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE])
 
 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 present 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
 #
@@ -541,7 +563,9 @@ if test "x$HAVE_PYTHON" = "xyes" ; then
         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" ])
index 2b20512c25d7d0a4e9605fa87a76cf8adb347dee..3250e9485feb8546ccf1a9f31a4479fd1c698b14 100644 (file)
@@ -22,6 +22,7 @@ EXTRA_DIST=build-db.in service-types
 pkgdata_DATA=service-types
 
 if HAVE_PYTHON
+if HAVE_GDBM
 
 noinst_SCRIPTS=build-db
 pkgdata_DATA+=service-types.db
@@ -36,3 +37,4 @@ service-types.db: service-types build-db
 CLEANFILES = service-types.db build-db
 
 endif
+endif