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

[patch] netcfg wireless



This patch makes netcfg building and linking more fine-grained.
It also disables wireless by default on non-linux archs.

I tested this patch in a draft porting on kfreebsd-i386, and it builds.


Note that this patch does not enable building netcfg on kfreebsd-i386
(this is only the generic part of the patch).
At the moment I managed to build netcfg on kfreebsd-i386 only in a
hackish (not working) way, because ethtool-lite is highly Linux
specific.


Cheers,
Luca Favatella
Index: packages/netcfg/debian/changelog
===================================================================
--- packages/netcfg/debian/changelog	(.../trunk)	(revision 59177)
+++ packages/netcfg/debian/changelog	(.../branches/d-i/kfreebsd)	(revision 59186)
@@ -4,6 +4,10 @@
     Thanks to Marco d'Itri for the proposed change
     Closes: #533384
 
+  [ Luca Favatella ]
+  * If wireless is disabled, don't build and link wireless related stuff.
+  * Disable by default wireless on non-linux archs.
+
  -- Christian Perrier <bubulle@debian.org>  Thu, 18 Jun 2009 06:11:33 +0200
 
 netcfg (1.49) unstable; urgency=low
Index: packages/netcfg/Makefile
===================================================================
--- packages/netcfg/Makefile	(.../trunk)	(revision 59177)
+++ packages/netcfg/Makefile	(.../branches/d-i/kfreebsd)	(revision 59186)
@@ -1,11 +1,16 @@
 CC		= gcc
 TARGETS		?= netcfg-static netcfg
 
-LDOPTS		= -ldebconfclient -ldebian-installer -liw
+LDOPTS		= -ldebconfclient -ldebian-installer
 CFLAGS		= -W -Wall -DNDEBUG 
 COMMON_OBJS	= netcfg-common.o wireless.o
 
+ifneq ($(DEB_HOST_ARCH_OS),linux)
+NO_WIRELESS	= 1
+endif
+
 ifeq ($(NO_WIRELESS),)
+LDOPTS		+= -liw
 CFLAGS		+= -DWIRELESS
 endif
 
Index: packages/netcfg/netcfg-common.c
===================================================================
--- packages/netcfg/netcfg-common.c	(.../trunk)	(revision 59177)
+++ packages/netcfg/netcfg-common.c	(.../branches/d-i/kfreebsd)	(revision 59186)
@@ -180,6 +184,7 @@
 
 #undef SYSCLASSNET
 
+#if defined(WIRELESS)
 int is_raw_80211(const char *iface)
 {
     struct ifreq ifr;
@@ -203,6 +208,7 @@
         return 0;
     }
 }
+#endif
 
 int is_interface_up(char *inter)
 {
@@ -263,8 +269,10 @@
             continue;
         if (!strncmp(ibuf, "sit", 3))        /* ignore tunnel devices */
             continue;
+#if defined(WIRELESS)
         if (is_raw_80211(ibuf))
             continue;
+#endif
         if (all || is_interface_up(ibuf) == 1) {
             list = realloc(list, sizeof(char*) * (len + 1));
             list[len] = strdup(ibuf);

Reply to: