netspeed r133 - in trunk: . src



Author: mfcn
Date: Sun Sep  7 17:12:11 2008
New Revision: 133
URL: http://svn.gnome.org/viewvc/netspeed?rev=133&view=rev

Log:
	* config.h.in:
	* configure.in:
	* src/backend.c (get_device_info):
	Applied patches that make it compile on open-solaris (wireless-tools are
	detected on run-time and a missing header included). Thanks Andras Barna!
	Fixes: #546369 and #546368



Modified:
   trunk/ChangeLog
   trunk/config.h.in
   trunk/configure.in
   trunk/src/backend.c

Modified: trunk/config.h.in
==============================================================================
--- trunk/config.h.in	(original)
+++ trunk/config.h.in	Sun Sep  7 17:12:11 2008
@@ -21,6 +21,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Defined if you have wirelesstools */
+#undef HAVE_IW
+
 /* Define if your <locale.h> file defines LC_MESSAGES. */
 #undef HAVE_LC_MESSAGES
 

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Sun Sep  7 17:12:11 2008
@@ -27,19 +27,21 @@
 
 GNOME_DOC_INIT
 
+ac_have_iwevgenie=no
 AC_MSG_CHECKING([for wireless-tools >= 28pre9])
-AC_TRY_COMPILE([#include <iwlib.h>],
-               [#ifndef IWEVGENIE
+AC_COMPILE_IFELSE([
+		#include <iwlib.h>
+                #ifndef IWEVGENIE
                 #error "not found"
                 #endif],
-               [ac_have_iwevgenie=yes],
-               [ac_have_iwevgenie=no])
-AC_MSG_RESULT($ac_have_iwevgenie)
-if test "$ac_have_iwevgenie" = no; then
-        AC_MSG_ERROR(wireless-tools >= 28pre9 not installed or not functional)
+               ac_have_iwevgenie=yes
+)
+AC_MSG_RESULT([$ac_have_iwevgenie])
+if test "$ac_have_iwevgenie" = yes; then
+        AC_DEFINE(HAVE_IW, 1, [Defined if you have wirelesstools])
+	IWLIB=-liw
+	AC_SUBST(IWLIB)
 fi
-IWLIB=-liw
-AC_SUBST(IWLIB)
 
 AC_OUTPUT([
 netspeed_applet.spec

Modified: trunk/src/backend.c
==============================================================================
--- trunk/src/backend.c	(original)
+++ trunk/src/backend.c	Sun Sep  7 17:12:11 2008
@@ -19,11 +19,19 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif 
+#endif
+
+#if defined(sun) && defined(__SVR4)
+#include <sys/sockio.h>
+#endif
 
 #include <glibtop/netlist.h>
 #include <glibtop/netload.h>
-#include <iwlib.h>
+
+#ifdef HAVE_IW
+ #include <iwlib.h>
+#endif /* HAVE_IW */
+
 #include "backend.h"
 
 gboolean
@@ -220,10 +228,16 @@
 	if(netload.if_flags & (1L << GLIBTOP_IF_FLAGS_LOOPBACK)) {
 		devinfo->type = DEV_LO;
 	}
+
+#ifdef HAVE_IW
+
 	else if (netload.if_flags & (1L << GLIBTOP_IF_FLAGS_WIRELESS)) {
 		devinfo->type = DEV_WIRELESS;
 		get_wireless_info (devinfo);
 	}
+
+#endif /* HAVE_IW */
+
 	else if(netload.if_flags & (1L << GLIBTOP_IF_FLAGS_POINTOPOINT)) {
 		if (g_str_has_prefix(device, "plip")) {
 			devinfo->type = DEV_PLIP;
@@ -260,7 +274,7 @@
 
 	return FALSE;	
 }
-
+#ifdef HAVE_IW
 void
 get_wireless_info (DevInfo *devinfo)
 {
@@ -299,3 +313,4 @@
 	if (fd != -1)
 		close (fd);
 }
+#endif /* HAVE_IW */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]