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
This commit is contained in:
Doug Torrance 2015-02-19 23:34:19 -06:00 committed by Carlos R. Mafra
parent 085f47b758
commit 535b83d232
3 changed files with 3 additions and 4 deletions

View file

@ -8,7 +8,7 @@
#include <i386/apmvar.h>
#endif
#ifdef HAVE_APM_H
#ifdef HAVE_LIBAPM
#include <apm.h>
#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;

View file

@ -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

View file

@ -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;