]> git.meshlink.io Git - catta/commitdiff
Fix build on NetBSD. Patch contributed by Daniel S. Haischt (closes #59)
authorLennart Poettering <lennart@poettering.net>
Thu, 21 Sep 2006 00:18:11 +0000 (00:18 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 21 Sep 2006 00:18:11 +0000 (00:18 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1328 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/iface-pfroute.c
configure.ac

index a67b8267a1bf5bcbe957a469a29b3a7ddf537bab..035e2672af90adcd223e5d7781363c39c8af3014 100644 (file)
@@ -318,7 +318,7 @@ void avahi_interface_monitor_free_osdep(AvahiInterfaceMonitor *m) {
     }
 }
 
-#ifndef HAVE_SYS_SYSCTL_H
+#if defined (SIOCGLIFNUM) && defined(HAVE_STRUCT_LIFCONF) /* Solaris 8 and later; Sol 7? */
 /*
  * I got this function from GNU zsbra
  */
@@ -428,7 +428,7 @@ static void if_add_interface(struct lifreq *lifreq, AvahiInterfaceMonitor *m, in
 #endif
 
 void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
-#ifdef HAVE_SYS_SYSCTL_H
+#ifndef HAVE_STRUCT_LIFCONF
   size_t needed;
   int mib[6];
   char *buf, *lim, *next, count = 0;
@@ -473,7 +473,7 @@ void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
   avahi_interface_monitor_check_relevant(m);
   avahi_interface_monitor_update_rrs(m, 0);
   avahi_log_info("Network interface enumeration completed.");
-#else
+#elif defined (SIOCGLIFNUM) && defined(HAVE_STRUCT_LIFCONF) /* Solaris 8 and later; Sol 7? */
     int sockfd;
     int ret;
     int n;
index ea6ef45d9b7e1aca8e628e9146266fb18bf4df5e..0acb7dc88b70db01de9f409810c4ea497c28bbe9 100644 (file)
@@ -104,10 +104,26 @@ AC_DEFINE([HAVE_SYS_SYSCTL_H],[],[Support for sys/sysctl.h])
 , [], [
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/param.h>
 ])
 
 AM_CONDITIONAL(HAVE_SYS_SYSCTL_H, [ test x"$HAVE_SYS_SYSCTL_H" = xyes ])
 
+#
+# Check for lifconf struct; only present on Solaris
+#
+AC_MSG_CHECKING(for struct lifconf)
+AC_CACHE_VAL(avahi_cv_has_struct_lifconf,
+[AC_TRY_COMPILE(
+[#include <sys/socket.h>
+#include <net/if.h>
+],[sizeof (struct lifconf);],
+avahi_cv_has_struct_lifconf=yes,avahi_cv_has_struct_lifconf=no)])
+AC_MSG_RESULT($avahi_cv_has_struct_lifconf)
+if test $avahi_cv_has_struct_lifconf = yes; then
+    AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
+fi
+
 #
 # Check for struct ip_mreqn
 #