wmclockmon: use `AS_IF` and `AS_CASE`
[dockapps.git] / wmclockmon / configure.ac
blob0f31831f9c146f783f8da5ab3f099fce9de49a7d
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ([2.52])
4 AC_INIT([wmclockmon], [0.8.1], [tnemeth@free.fr])
5 AM_INIT_AUTOMAKE
6 AC_CONFIG_SRCDIR([src/main.c])
7 AC_CONFIG_HEADERS([config.h])
9 AC_CANONICAL_HOST
11 dnl Checks for programs.
12 AC_PROG_AWK
13 AC_PROG_CC
14 AC_PROG_INSTALL
15 AC_PROG_LN_S
17 PKG_CHECK_MODULES([gtk], [gtk+-2.0])
19 dnl ===========================================
20 dnl             Stuff that uses X
21 dnl ===========================================
23 PKG_CHECK_MODULES([x11],  [x11])
24 PKG_CHECK_MODULES([xext], [xext])
25 PKG_CHECK_MODULES([xpm],  [xpm])
27 dnl ===============================================
28 dnl             End of stuff that uses X
29 dnl ===============================================
31 dnl =========
32 dnl Debugging
33 dnl =========
35 AC_ARG_ENABLE([debug],
36               [AS_HELP_STRING([--enable-debug], [turn on debugging [default=no]])])
37 AS_IF([test "$enable_debug" = yes], [
38   debug_CFLAGS="-Wall -g -ansi -pedantic"
39   AC_DEFINE([DEBUG], [1], [use debug code])
41 AC_SUBST([debug_CFLAGS])
44 dnl ============
45 dnl Check for OS
46 dnl ============
48 AS_CASE([${host_os}],
49         [freebsd*], [
50           LIBS="$LIBS -lkvm"
51           SETGID_FLAGS="-g kmem -m 2755 -o root"
52         ],
53         [linux*|netbsd*|openbsd*|solaris*], [],
54         [AC_MSG_ERROR([Sorry, ${host_os} is not supported yet])])
55 AC_SUBST([SETGID_FLAGS])
57 dnl Checks for header files.
58 AC_CHECK_HEADERS([fcntl.h memory.h stddef.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h])
60 dnl Checks for typedefs, structures, and compiler characteristics.
61 AC_C_CONST
62 AC_TYPE_SIZE_T
64 dnl Checks for library functions.
65 AC_FUNC_MALLOC
66 AC_CHECK_FUNCS([select strtoul uname])
68 AC_CONFIG_FILES([Makefile
69                  doc/Makefile
70                  src/Makefile
71                  styles/Makefile
72                  wmclockmon-config/Makefile
73                  wmclockmon-cal/Makefile])
74 AC_OUTPUT