Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Mar 2004 11:57:00 -0500 (EST)
From:      Hendrik Scholz <hendrik@scholz.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        esn@x123.info
Subject:   ports/64225: net/wistumbler2: unbreak on !i386
Message-ID:  <20040313165700.4999139819@slurmcan.wormulon.net>
Resent-Message-ID: <200403131700.i2DH0Xbh028337@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         64225
>Category:       ports
>Synopsis:       net/wistumbler2: unbreak on !i386
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 13 09:00:33 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Hendrik Scholz
>Release:        FreeBSD 5.2.1-RC amd64
>Organization:
>Environment:
System: FreeBSD slurmcan.wormulon.net 5.2.1-RC FreeBSD 5.2.1-RC #0: Sat Jan 31 12:38:34 GMT 2004 root@ngoc.NUXI.com:/usr/obj/usr/src/sys/GENERIC amd64


	
>Description:

wistumbler2 has been reported to not work on !386 and on 4.x machines by
bento:
http://people.freebsd.org/~fenner/errorlogs/esn@x123.info.html

The code doesn't compile on 5.x !386 systems due to missing machine/speaker.h
so just add stubs where needed.

Changes:

- allow compilation on 5.x !386 systems
- mv second diff to files/patch-gpscontrol.c (just a cosmetic fix)
- mv third diff to files/patch-speaker.c (replaces speaker related
  functions with stubs)

CC'ed to author and maintainer.
This does not allow compilation on 4.x systems due to missing headers!

>How-To-Repeat:
	
>Fix:

	

--- wistumbler2-noni386.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/FreeBSD-CVS/ports/net/wistumbler2/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile	13 Mar 2004 10:09:20 -0000	1.4
+++ Makefile	13 Mar 2004 16:50:36 -0000
@@ -34,8 +34,8 @@
 
 .include <bsd.port.pre.mk>
 
-.if ${ARCH} != "i386" || ${OSVERSION} < 500000
-BROKEN=		"Does not compile on !i386 or 4.x"
+.if ${OSVERSION} < 500000
+BROKEN=		"Does not compile on 4.x"
 .endif
 
 pre-everything::
--- src/gpscontrol.c.orig	Sat Mar 13 11:30:58 2004
+++ src/gpscontrol.c	Sat Mar 13 11:31:37 2004
@@ -37,6 +37,9 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <termios.h>
+#ifdef __FreeBSD__
+#include <string.h>
+#endif
 #include <strings.h>
 #include "gpscontrol.h"
 
--- src/speaker.c.orig	Sat Mar 13 11:28:58 2004
+++ src/speaker.c	Sat Mar 13 11:30:15 2004
@@ -31,16 +31,29 @@
  * $Id: stumbler.c,v 1.5 2003/11/14 15:54:29 pancake Exp $
  */
 
+#ifdef __FreeBSD__
+#ifdef __i386__
+#define _HAVE_SPEAKER
+#endif
+#elif __NetBSD__
+#define _HAVE_SPEAKER
+#endif
+
+
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #ifdef __FreeBSD__
+#ifdef _HAVE_SPEAKER
 #include <machine/speaker.h>
+#endif
 #else
 #include <machine/spkr.h>
 #endif
 
+#ifdef _HAVE_SPEAKER
+
 #define SPKR_DEV "/dev/speaker"
 #define SPKR_SPD "L08"
 
@@ -100,4 +113,8 @@
 	//}
 	fclose(fd);
 }
-
+#else
+	/* no speaker support */
+void swap_beep(void) {}
+void do_beep(int pc) {}
+#endif
--- wistumbler2-noni386.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040313165700.4999139819>