wmbattery: use PKG_CHECK_MODULES, rather than calling pkg-config explicitly.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
This commit is contained in:
Jeremy Sowden 2019-10-27 19:55:45 +00:00 committed by Carlos R. Mafra
parent 08912c26f3
commit 7434685dae
2 changed files with 8 additions and 4 deletions

View file

@ -43,18 +43,20 @@ OBJS=wmbattery.o acpi.o sonypi.o
ifdef USE_HAL ifdef USE_HAL
CPPFLAGS += -DHAL CPPFLAGS += -DHAL
LIBS += $(shell pkg-config --libs hal) CFLAGS += @HAL_CFLAGS@
LIBS += @HAL_LIBS@
OBJS += simplehal.o OBJS += simplehal.o
simplehal.o: simplehal.c simplehal.o: simplehal.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(shell pkg-config --cflags hal) -c simplehal.c -o simplehal.o $(CC) $(CPPFLAGS) $(CFLAGS) -c simplehal.c -o simplehal.o
endif endif
ifdef USE_UPOWER ifdef USE_UPOWER
CPPFLAGS += -DUPOWER CPPFLAGS += -DUPOWER
LIBS += $(shell pkg-config --libs upower-glib) CFLAGS += @UPOWER_GLIB_CFLAGS@
LIBS += @UPOWER_GLIB_LIBS@
OBJS += upower.o OBJS += upower.o
upower.o: upower.c upower.o: upower.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(shell pkg-config --cflags upower-glib) -c upower.c -o upower.o $(CC) $(CPPFLAGS) $(CFLAGS) -c upower.c -o upower.o
endif endif
wmbattery: $(OBJS) wmbattery: $(OBJS)

View file

@ -28,6 +28,8 @@ AC_CHECK_LIB(X11, XOpenDisplay)
AC_CHECK_LIB(Xext, XShapeCombineMask) AC_CHECK_LIB(Xext, XShapeCombineMask)
AC_CHECK_LIB(Xpm, XpmReadFileToPixmap) AC_CHECK_LIB(Xpm, XpmReadFileToPixmap)
AC_CHECK_LIB(apm, apm_read) AC_CHECK_LIB(apm, apm_read)
dnl PKG_CHECK_MODULES([HAL], [hal])
PKG_CHECK_MODULES([UPOWER_GLIB], [upower-glib])
dnl Checks for header files. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC