Robert Millan wrote:
> 2010/10/30 Michael Dorrington <michael.dorring...@gmail.com>:
>   
>> On kfreebsd, the gnome-netstatus-applet does not understand the way the
>> kernel presents network interface information.
>>     
>
> Probably related to:
>
> ./src/netstatus-sysdeps.c:#ifdef __FreeBSD__
> ./src/netstatus-sysdeps.c:#if !defined (__FreeBSD__)
> ./src/netstatus-sysdeps.c:#else /* defined(__FreeBSD__) */
> ./src/netstatus-sysdeps.c:#endif /* !defined(__FreeBSD__) */
>
> Does s/__FreeBSD__/__FreeBSD_kernel__/ help?
>   
I applied the attached patch but it failed to build with the following:

gcc -DHAVE_CONFIG_H -I. -I.. -I../src -DPREFIX=\""/usr\"" 
-DSYSCONFDIR=\""/etc\"" -DDATADIR=\""/usr/share\"" -DLIBDIR=\""/usr/lib\"" 
-DORBIT2=1 -pthread -I/usr/include/panel-2.0 -I/usr/include/gconf/2 
-I/usr/include/gtk-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/orbit-2.0 
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ 
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 
-I/usr/include/libxml2 -I/usr/include/libbonobo-2.0 
-I/usr/include/libgnomecanvas-2.0 -I/usr/include/libgnome-2.0 
-I/usr/include/bonobo-activation-2.0 -I/usr/include/gail-1.0 
-I/usr/include/libart-2.0 -I/usr/include/gnome-vfs-2.0 
-I/usr/lib/gnome-vfs-2.0/include    -Wall -Wmissing-prototypes  
-DNETSTATUS_ICONDIR=\""/usr/share/icons/gnome-netstatus\"" 
-DNETSTATUS_BUILDERDIR=\""/usr/share/gnome-netstatus\"" 
-DGNOMELOCALEDIR=\""/usr/share/locale"\"    -g -O2 -g -Wall -O2 -c 
netstatus-iface.c
netstatus-iface.c:768: warning: ‘print_ash_addr’ defined but not used
netstatus-iface.c:792: warning: ‘print_ax25_addr’ defined but not used
netstatus-iface.c:826: warning: ‘print_rose_addr’ defined but not used
netstatus-iface.c:832: warning: ‘print_x25_addr’ defined but not used
netstatus-iface.c:844: warning: ‘print_dlci_addr’ defined but not used
netstatus-iface.c:850: warning: ‘print_irda_addr’ defined but not used
netstatus-iface.c:856: warning: ‘print_econet_addr’ defined but not used
netstatus-iface.c:874: warning: ‘hw_types’ defined but not used
netstatus-iface.c: In function ‘netstatus_iface_get_inet4_details’:
netstatus-iface.c:715: warning: dereferencing pointer ‘({anonymous})’ does 
break strict-aliasing rules
netstatus-iface.c:715: note: initialized from here
netstatus-iface.c:737: warning: dereferencing pointer ‘({anonymous})’ does 
break strict-aliasing rules
netstatus-iface.c:737: note: initialized from here
netstatus-iface.c:743: warning: dereferencing pointer ‘({anonymous})’ does 
break strict-aliasing rules
netstatus-iface.c:743: note: initialized from here
netstatus-iface.c:748: warning: dereferencing pointer ‘({anonymous})’ does 
break strict-aliasing rules
netstatus-iface.c:748: note: initialized from here
gcc -DHAVE_CONFIG_H -I. -I.. -I../src -DPREFIX=\""/usr\"" 
-DSYSCONFDIR=\""/etc\"" -DDATADIR=\""/usr/share\"" -DLIBDIR=\""/usr/lib\"" 
-DORBIT2=1 -pthread -I/usr/include/panel-2.0 -I/usr/include/gconf/2 
-I/usr/include/gtk-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/orbit-2.0 
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ 
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 
-I/usr/include/libxml2 -I/usr/include/libbonobo-2.0 
-I/usr/include/libgnomecanvas-2.0 -I/usr/include/libgnome-2.0 
-I/usr/include/bonobo-activation-2.0 -I/usr/include/gail-1.0 
-I/usr/include/libart-2.0 -I/usr/include/gnome-vfs-2.0 
-I/usr/lib/gnome-vfs-2.0/include    -Wall -Wmissing-prototypes  
-DNETSTATUS_ICONDIR=\""/usr/share/icons/gnome-netstatus\"" 
-DNETSTATUS_BUILDERDIR=\""/usr/share/gnome-netstatus\"" 
-DGNOMELOCALEDIR=\""/usr/share/locale"\"    -g -O2 -g -Wall -O2 -c 
netstatus-sysdeps.c
netstatus-sysdeps.c: In function ‘wireless_getval’:
netstatus-sysdeps.c:408: warning: implicit declaration of function ‘strlcpy’
netstatus-sysdeps.c: In function ‘get_wi_data’:
netstatus-sysdeps.c:474: error: storage size of ‘wreq’ isn’t known
netstatus-sysdeps.c:513: warning: assignment makes pointer from integer without 
a cast
netstatus-sysdeps.c:516: warning: assignment makes integer from pointer without 
a cast
netstatus-sysdeps.c:521: warning: assignment makes pointer from integer without 
a cast
netstatus-sysdeps.c:474: warning: unused variable ‘wreq’
make[4]: *** [netstatus-sysdeps.o] Error 1
make[4]: Leaving directory `/usr/src/gnome-netstatus-2.28.1-kfreebsd2/src'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/usr/src/gnome-netstatus-2.28.1-kfreebsd2/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/src/gnome-netstatus-2.28.1-kfreebsd2'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/gnome-netstatus-2.28.1-kfreebsd2'
make: *** [debian/stamp-makefile-build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Regards,
Mike.

Index: gnome-netstatus-2.28.1-kfreebsd2/src/netstatus-sysdeps.c
===================================================================
--- gnome-netstatus-2.28.1-kfreebsd2.orig/src/netstatus-sysdeps.c	2010-11-13 17:03:09.000000000 +0000
+++ gnome-netstatus-2.28.1-kfreebsd2/src/netstatus-sysdeps.c	2010-11-13 17:05:57.000000000 +0000
@@ -35,7 +35,7 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
@@ -78,7 +78,7 @@
   return TRUE;
 }
 
-#if !defined (__FreeBSD__)
+#if ! defined (__FreeBSD__) && ! defined (__FreeBSD_kernel__)
 
 static inline char *
 parse_iface_name (const char *buf)
@@ -357,7 +357,7 @@
   return error_message;
 }
 
-#else /* defined(__FreeBSD__) */
+#else /* defined(__FreeBSD__) || defined (__FreeBSD_kernel__) */
 
 static inline void
 parse_header (char *buf,
@@ -670,4 +670,4 @@
   return error_message;
 }
 
-#endif /* !defined(__FreeBSD__) */
+#endif /* ! defined(__FreeBSD__) && ! defined(__FreeBSD_kernel__) */

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to