diff options
-rw-r--r-- | Makefile.am | 7 | ||||
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | src/print_battery_info.c | 1 |
3 files changed, 16 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index bb251f0..c2c1c0a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,8 +68,11 @@ i3status_SOURCES = \ src/print_volume.c \ src/print_wireless_info.c \ src/print_file_contents.c \ - src/process_runs.c \ - src/pulse.c + src/process_runs.c + +if PULSE +i3status_SOURCES += src/pulse.c +endif dist_sysconf_DATA = \ i3status.conf diff --git a/configure.ac b/configure.ac index cf9e430..a6c31d7 100644 --- a/configure.ac +++ b/configure.ac @@ -80,16 +80,25 @@ AC_CANONICAL_HOST PKG_CHECK_MODULES([CONFUSE], [libconfuse]) PKG_CHECK_MODULES([YAJL], [yajl]) +pulse=true case $host_os in linux*) PKG_CHECK_MODULES([NLGENL], [libnl-genl-3.0]) PKG_CHECK_MODULES([ALSA], [alsa]) - PKG_CHECK_MODULES([PULSE], [libpulse]) + ;; + openbsd*) + pulse=false + ;; + dragonfly*) + pulse=false ;; netbsd*) AC_SEARCH_LIBS([prop_string_create], [prop]) ;; esac +AM_CONDITIONAL([PULSE], [test x$pulse = xtrue]) +AS_IF([test x"$pulse" = x"true"], + [PKG_CHECK_MODULES([PULSE], [libpulse])]) dnl TODO: check for libbsd for GNU/kFreeBSD diff --git a/src/print_battery_info.c b/src/print_battery_info.c index 1768bc5..c8a1d3d 100644 --- a/src/print_battery_info.c +++ b/src/print_battery_info.c @@ -33,6 +33,7 @@ #include <sys/types.h> #include <sys/sysctl.h> #include <sys/sensors.h> +#include <sys/sysctl.h> #endif #if defined(__NetBSD__) |