summaryrefslogtreecommitdiff
path: root/configure.ac
blob: c0eb433a8d6f586f221ea091a4df9114caadaa31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
AC_INIT([dwxinfo], [0.1.0])

AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])

: ${CFLAGS="-O2"}

AC_PROG_CC
AC_C_CONST
AC_C_VARARRAYS
AC_FUNC_MALLOC
AC_PROG_SED
AC_CHECK_INCLUDES_DEFAULT

AC_CHECK_HEADER([fcntl.h], [], [
    echo "Missing fcntl.h header"
    exit -1
])

AC_CHECK_HEADER([errno.h], [], [
    echo "Missing errno.h header"
    exit -1
])

AC_CHECK_HEADER([signal.h], [], [
    echo "Missing signal.h header"
    exit -1
])

AC_CHECK_HEADER([poll.h], [], [
    echo "Missing poll.h header"
    exit -1
])

PKG_CHECK_MODULES([LIBPULSE], [libpulse])

AC_ARG_ENABLE(debug,
    AS_HELP_STRING([--enable-debug], [enable debugging, default: yes]),
        [case "${enableval}" in
            yes) debug=true ;;
            no)  debug=false ;;
            *)   AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
        esac],
    [debug=true])

if test x"$debug" = x"true"; then
    CFLAGS="$CFLAGS -g"
fi

CFLAGS="$CFLAGS -Wall"

AC_CONFIG_FILES([
    Makefile
])
AC_OUTPUT