From 535b83d232782516be879497e7273a3f19543295 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 19 Feb 2015 23:34:19 -0600 Subject: [PATCH] wmbattery: Use AC_CHECK_LIB instead of AC_CHECK_HEADERS to check for libapm. If autoconf finds an apm.h other than the one belonging to libapm, we get builds errors like the ones reported by Haroldo Gambini Santos in [1]. [1] http://lists.windowmaker.org/dev/msg07937.html --- wmbattery/apm.h | 4 ++-- wmbattery/configure.ac | 1 - wmbattery/wmbattery.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/wmbattery/apm.h b/wmbattery/apm.h index fc2428e..04b6e7f 100644 --- a/wmbattery/apm.h +++ b/wmbattery/apm.h @@ -8,7 +8,7 @@ #include #endif -#ifdef HAVE_APM_H +#ifdef HAVE_LIBAPM #include #endif @@ -37,7 +37,7 @@ #define BATTERY_TIME_UNKNOWN (-1) #endif /* AC_LINE_STATUS_ON */ -#if !defined(HAVE_APM_H) +#if !defined(HAVE_LIBAPM) typedef struct { const char driver_version[10]; int apm_version_major; diff --git a/wmbattery/configure.ac b/wmbattery/configure.ac index 5c5a8fc..0d9b57b 100644 --- a/wmbattery/configure.ac +++ b/wmbattery/configure.ac @@ -34,7 +34,6 @@ AC_HEADER_STDC AC_CHECK_HEADERS(X11/xpm.h) AC_CHECK_HEADERS(X11/extensions/shape.h) AC_CHECK_HEADERS(getopt.h) -AC_CHECK_HEADERS(apm.h) dnl FreeBSD needs apm_bios.h AC_CHECK_HEADERS(machine/apm_bios.h) dnl NetBSD and OpenBSD need apmvar.h diff --git a/wmbattery/wmbattery.c b/wmbattery/wmbattery.c index 74d39fd..1c74409 100644 --- a/wmbattery/wmbattery.c +++ b/wmbattery/wmbattery.c @@ -148,7 +148,7 @@ int apm_exists(void) return apm_read(&i); } #endif -#if !defined(HAVE_APM_H) +#if !defined(HAVE_LIBAPM) int apm_read(apm_info *i) { return -1;