svn commit: r448001 - in head/net/wmwifi: . files
Tobias Kortkamp
tobik at FreeBSD.org
Tue Aug 15 19:09:52 UTC 2017
Author: tobik
Date: Tue Aug 15 19:09:51 2017
New Revision: 448001
URL: https://svnweb.freebsd.org/changeset/ports/448001
Log:
net/wmwifi: Fix runtime on amd64
Currently wmwifi doesn't start on amd64 and simply fails with
wmwifi: No wireless interface found!
The code assumes that sizeof(int) == sizeof(size_t) which isn't the
case on amd64 (and other architectures) and all sysctl() calls will
fail because of it.
While here:
- Fix a build failure when automake+autoconf are installed in the
build environment. By patching configure.in the build wants to
regenerate configure which doesn't work correctly:
gmake[1]: Entering directory '/usr/ports/net/wmwifi/work/wmwifi-0.4-bsd'
cd . && aclocal
aclocal-1.15: warning: autoconf input should be named 'configure.ac', not 'configure.in'
/usr/local/share/aclocal/gdk-pixbuf.m4:12: warning: underquoted definition of AM_PATH_GDK_PIXBUF
/usr/local/share/aclocal/gdk-pixbuf.m4:12: run info Automake 'Extending aclocal'
/usr/local/share/aclocal/gdk-pixbuf.m4:12: or see http://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
cd . && automake --gnu Makefile
automake-1.15: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:3: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see:
configure.in:3: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
configure.in:6: error: required file './compile' not found
configure.in:6: 'automake --add-missing' can install 'compile'
gmake[1]: *** [Makefile:82: Makefile.in] Error 1
gmake[1]: Leaving directory '/usr/ports/net/wmwifi/work/wmwifi-0.4-bsd'
*** Error code 1
Remove files/patch-configure.in and pass CFLAGS through
CONFIGURE_ENV instead.
- Add LICENSE, LICENSE_FILE
- Add missing dependency on libXext
[1] https://forums.freebsd.org/threads/61981/
PR: 221531
Reported by: forester on the FreeBSD forums [1]
Approved by: uqs (maintainer)
MFH: 2017Q3
Deleted:
head/net/wmwifi/files/patch-configure.in
Modified:
head/net/wmwifi/Makefile
head/net/wmwifi/files/patch-wireless.c
Modified: head/net/wmwifi/Makefile
==============================================================================
--- head/net/wmwifi/Makefile Tue Aug 15 19:01:24 2017 (r448000)
+++ head/net/wmwifi/Makefile Tue Aug 15 19:09:51 2017 (r448001)
@@ -4,7 +4,7 @@
PORTNAME= wmwifi
PORTVERSION= 0.4
DISTVERSIONSUFFIX=-bsd
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= net
MASTER_SITES= http://digitalssg.net/debian/ \
LOCAL/uqs
@@ -12,11 +12,14 @@ MASTER_SITES= http://digitalssg.net/debian/ \
MAINTAINER= uqs at FreeBSD.org
COMMENT= Dockapp displaying the signal strength of WiFi connection
-GNU_CONFIGURE= yes
-USE_XORG= x11 xpm
-USES= gmake
+LICENSE= GPLv2+
+LICENSE_FILE= ${WRKSRC}/COPYING
-CPPFLAGS+= -I${LOCALBASE}/include
+USES= gmake localbase
+USE_XORG= x11 xext xpm
+
+CONFIGURE_ENV= X_CFLAGS="${CFLAGS}"
+GNU_CONFIGURE= yes
PLIST_FILES= bin/wmwifi
Modified: head/net/wmwifi/files/patch-wireless.c
==============================================================================
--- head/net/wmwifi/files/patch-wireless.c Tue Aug 15 19:01:24 2017 (r448000)
+++ head/net/wmwifi/files/patch-wireless.c Tue Aug 15 19:09:51 2017 (r448001)
@@ -1,5 +1,5 @@
---- src/wireless.c.orig 2004-03-09 20:39:17.000000000 +0100
-+++ src/wireless.c 2007-11-01 17:58:13.170763665 +0100
+--- src/wireless.c.orig 2004-03-09 19:39:17 UTC
++++ src/wireless.c
@@ -25,7 +25,13 @@
#include <net/if_mib.h>
#include <net/if_var.h>
@@ -14,7 +14,14 @@
#else
#error "sorry, your OS is not supported yet"
#endif
-@@ -143,6 +149,7 @@
+@@ -138,11 +144,13 @@ int get_wlaniface(int old, int dir)
+ int i, max, step, found, index;
+ struct ifmibdata ifmd;
+ struct ifmediareq ifmr;
+- int name[6], len, s;
++ int name[6], s;
++ size_t len;
+ char *iface[IFNAMSIZ];
max = get_max_ifs();
step = 0;
@@ -22,7 +29,7 @@
if (old > max)
old = max; /* just be sure to not be out of bounds */
-@@ -178,8 +185,8 @@
+@@ -178,8 +186,8 @@ int get_wlaniface(int old, int dir)
len = sizeof(ifmd);
sysctl(name, 6, &ifmd, &len, NULL, 0);
@@ -33,7 +40,7 @@
continue;
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
-@@ -193,9 +200,11 @@
+@@ -193,9 +201,11 @@ int get_wlaniface(int old, int dir)
if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0)
{
@@ -47,7 +54,7 @@
}
close(s);
/* we cannot monitor interfaces in hostap mode, so just
-@@ -207,6 +216,10 @@
+@@ -207,12 +217,17 @@ int get_wlaniface(int old, int dir)
found++;
}
}
@@ -58,7 +65,21 @@
return index;
}
/* how many interfaces do we have? this includes non-wireless! */
-@@ -224,9 +237,18 @@
+ int get_max_ifs(void)
+ {
+- int count, len;
++ int count;
++ size_t len;
+
+ len = sizeof(count);
+ sysctlbyname("net.link.generic.system.ifcount", &count, &len, NULL, 0);
+@@ -220,13 +235,23 @@ int get_max_ifs(void)
+ }
+ int wifi_info(struct wifi *wfi)
+ {
+- int name[6], len; /* interface name */
++ int name[6]; /* interface name */
++ size_t len;
struct ifmibdata ifmd;
struct ifreq ifr; /* interface stats */
@@ -77,7 +98,7 @@
/* lets find the current interface name */
name[0] = CTL_NET;
name[1] = PF_LINK;
-@@ -247,13 +269,38 @@
+@@ -247,13 +272,38 @@ int wifi_info(struct wifi *wfi)
perror("socket");
exit(1);
}
@@ -117,7 +138,7 @@
strncpy(ifr.ifr_name, wfi->ifname, strlen(wfi->ifname));
wireq.wi_type = WI_RID_COMMS_QUALITY;
wireq.wi_len = WI_MAX_DATALEN;
-@@ -272,7 +319,7 @@
+@@ -272,7 +322,7 @@ int wifi_info(struct wifi *wfi)
* wi_val[2] = noise
*/
wfi->link = (int) wireq.wi_val[1];
More information about the svn-ports-all
mailing list