1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(wmbattery.c, 2.52)
3 AC_CONFIG_HEADER(config.h)
5 AC_CONFIG_AUX_DIR(autoconf)
7 dnl Checks for the apm device other than /proc/apm.
8 AC_CHECK_FILES(/dev/apm)
10 dnl Checks for programs.
16 if test "x${no_x}" = "xyes"; then
17 AC_MSG_ERROR(Can't find X windows include files and libraries)
19 if test "x${x_includes}" != "x"; then
20 CPPFLAGS="$CPPFLAGS -I`echo ${x_includes}`"
22 if test "x${x_libraries}" != "x"; then
23 LIBS="$LIBS -L`echo ${x_libraries}`"
26 dnl Checks for libraries.
27 PKG_CHECK_MODULES([Xlib], [x11])
28 PKG_CHECK_MODULES([Xext], [xext])
29 PKG_CHECK_MODULES([libXpm], [xpm])
30 AC_CHECK_LIB(apm, apm_read)
31 AC_ARG_ENABLE(hal, AS_HELP_STRING([--enable-hal], [enable hal]),
33 AS_IF([test x$enable_hal != xno], [
34 PKG_CHECK_MODULES([HAL], [hal])
37 AC_ARG_ENABLE(upower, AS_HELP_STRING([--disable-upower], [disable upower]),
38 [], [enable_upower=yes])
39 AS_IF([test x$enable_upower != xno], [
40 PKG_CHECK_MODULES([UPOWER_GLIB], [upower-glib])
41 AC_SUBST(USE_UPOWER, 1)
44 dnl Checks for header files.
46 AC_CHECK_HEADERS(getopt.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.
55 dnl Checks for library functions.
56 AC_PROG_GCC_TRADITIONAL
58 AC_CHECK_FUNCS(strdup)