Subject: pkg/26081: sysutils/asapm doesn't build on 1.6.*
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mlelstv@serpens.de>
List: pkgsrc-bugs
Date: 06/27/2004 13:39:13
>Number: 26081
>Category: pkg
>Synopsis: sysutils/asapm doesn't build on 1.6.*
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jun 27 11:41:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Michael van Elst
>Release: NetBSD 1.6.2_STABLE
>Organization:
--
Michael van Elst
Internet: mlelstv@serpens.de
"A potential Snark may lurk in every tree."
>Environment:
System: NetBSD pepew 1.6.2_STABLE NetBSD 1.6.2_STABLE (PEPEW) #13: Fri Jun 18 22:59:51 MEST 2004 src@pepew:/amd/fud-wave/d/0/src/sys/arch/i386/compile/PEPEW i386
Architecture: i386
Machine: i386
>Description:
Building the current sysutils/asapm (Makefile 1.27) fails with
apm_read.c: In function `TrySysmonDevice':
apm_read.c:200: `ENVSYS_SWATTHOUR' undeclared (first use in this function)
apm_read.c:200: (Each undeclared identifier is reported only once
apm_read.c:200: for each function it appears in.)
apm_read.c:211: `ENVSYS_INDICATOR' undeclared (first use in this function)
and also with
asapm.c: In function `defaults':
asapm.c:56: `_PATH_SYSMON' undeclared (first use in this function)
asapm.c:56: (Each undeclared identifier is reported only once
asapm.c:56: for each function it appears in.)
>How-To-Repeat:
Try to build asapm on a NetBSD 1.6.* machine.
>Fix:
Checking for the new symbols seems to be enough:
--- apm_read.c.dist Sun Jun 27 13:34:40 2004
+++ apm_read.c Sun Jun 27 13:35:17 2004
@@ -197,6 +197,7 @@
if (!(etds.validflags & ENVSYS_FCURVALID))
continue;
+#ifdef ENVSYS_SWATTHOUR
if (etds.units == ENVSYS_SWATTHOUR) {
/* Watt hours, this must be battery capacity info. */
if (match_end(ebis.desc, " design cap")) {
@@ -208,7 +209,10 @@
} else if (match_end(ebis.desc, " low cap")) {
low_cap += etds.cur.data_s;
}
- } else if (etds.units == ENVSYS_INDICATOR) {
+ } else
+#endif
+#ifdef ENVSYS_INDICATOR
+ if (etds.units == ENVSYS_INDICATOR) {
/* Indicator of something, check for connected. */
if (match_end(ebis.desc, " connected")) {
connected = etds.cur.data_us;
@@ -216,7 +220,9 @@
charging = etds.cur.data_us;
}
- } else if (etds.units == ENVSYS_SWATTS) {
+ } else
+#endif
+ if (etds.units == ENVSYS_SWATTS) {
/* Watts, this must discharge rate. */
if (match_end(ebis.desc, " discharge rate")) {
rate += etds.cur.data_s;
--- state.h.dist Sun Jun 27 13:34:40 2004
+++ state.h Sun Jun 27 13:36:53 2004
@@ -14,7 +14,11 @@
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#define APM_PROC "/dev/apm"
#include <paths.h>
+#ifdef _PATH_SYSMON
#define SYSMON_DEV _PATH_SYSMON
+#else
+#define SYSMON_DEV "/dev/sysmon"
+#endif
#else
#define APM_PROC "/proc/apm"
#endif
>Release-Note:
>Audit-Trail:
>Unformatted: