1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT([wmbattery], [2.56], [wmaker-dev@googlegroups.com])
4 AC_CONFIG_HEADERS([config.h])
5 AC_CONFIG_SRCDIR([wmbattery.c])
6 AC_CONFIG_AUX_DIR([autoconf])
8 dnl Checks for the apm device other than /proc/apm.
9 AC_CHECK_FILES([/dev/apm])
11 dnl Checks for programs.
17 if test "x${no_x}" = "xyes"; then
18 AC_MSG_ERROR([Can't find X windows include files and libraries])
20 if test "x${x_includes}" != "x"; then
21 CPPFLAGS="$CPPFLAGS -I`echo ${x_includes}`"
23 if test "x${x_libraries}" != "x"; then
24 LIBS="$LIBS -L`echo ${x_libraries}`"
27 dnl Checks for libraries.
28 PKG_CHECK_MODULES([Xlib], [x11])
29 PKG_CHECK_MODULES([Xext], [xext])
30 PKG_CHECK_MODULES([libXpm], [xpm])
31 AC_CHECK_LIB([apm], [apm_read])
32 AC_ARG_ENABLE([hal], [AS_HELP_STRING([--enable-hal], [enable hal])],
34 AS_IF([test x$enable_hal != xno], [
35 PKG_CHECK_MODULES([hal], [hal])
36 AC_SUBST([USE_HAL], [1])
38 AC_ARG_ENABLE([upower], [AS_HELP_STRING([--disable-upower], [disable upower])],
39 [], [enable_upower=yes])
40 AS_IF([test x$enable_upower != xno], [
41 PKG_CHECK_MODULES([upower], [upower-glib])
42 AC_SUBST([USE_UPOWER], [1])
45 dnl Checks for header files.
46 AC_CHECK_HEADERS([fcntl.h getopt.h stdint.h sys/ioctl.h sys/socket.h unistd.h])
47 dnl FreeBSD needs apm_bios.h
48 AC_CHECK_HEADERS([machine/apm_bios.h])
49 dnl NetBSD and OpenBSD need apmvar.h
50 AC_CHECK_HEADERS([i386/apmvar.h])
52 dnl Checks for typedefs, structures, and compiler characteristics.
58 AC_CHECK_TYPES([ptrdiff_t])
60 dnl Checks for library functions.
64 AC_CHECK_FUNCS([alarm strcasecmp strchr strdup strerror strstr])
66 AC_CONFIG_FILES([Makefile])