Add support for --enable-envsys when running ./configure

This commit is contained in:
snow 2020-05-01 20:19:55 -07:00
parent 91cc0594d9
commit ea844727f7
2 changed files with 16 additions and 0 deletions

View file

@ -21,6 +21,7 @@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ @Xlib_LIBS@ @Xext_LIBS@ @libXpm_LIBS@ LIBS = @LIBS@ @Xlib_LIBS@ @Xext_LIBS@ @libXpm_LIBS@
USE_HAL = @USE_HAL@ USE_HAL = @USE_HAL@
USE_UPOWER = @USE_UPOWER@ USE_UPOWER = @USE_UPOWER@
USE_ENVSYS = @USE_ENVSYS@
all: wmbattery all: wmbattery
@ -80,6 +81,14 @@ upower.o: upower.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c upower.c -o upower.o $(CC) $(CPPFLAGS) $(CFLAGS) -c upower.c -o upower.o
endif endif
ifdef USE_ENVSYS
CPPFLAGS += -DENVSYS
LIBS += -lprop
OBJS += envsys.o
envsys.o: envsys.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c envsys.c -o envsys.o
endif
wmbattery: $(OBJS) wmbattery: $(OBJS)
$(CC) -o wmbattery $(LDFLAGS) $(OBJS) $(LIBS) $(CC) -o wmbattery $(LDFLAGS) $(OBJS) $(LIBS)

View file

@ -39,6 +39,13 @@ AS_IF([test x$enable_upower != xno], [
PKG_CHECK_MODULES([upower], [upower-glib]) PKG_CHECK_MODULES([upower], [upower-glib])
AC_SUBST(USE_UPOWER, 1) AC_SUBST(USE_UPOWER, 1)
]) ])
AC_ARG_ENABLE(envsys, AS_HELP_STRING([--enable-envsys], [enable envsys]),
[], [enable_envsys=no])
AS_IF([test x$enable_envsys != xno], [
AC_CHECK_HEADERS(sys/envsys.h)
AC_CHECK_HEADERS(prop/proplib.h)
AC_SUBST(USE_ENVSYS, 1)
])
dnl Checks for header files. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC