1 m4_define(FULL_PAVER, esyscmd(/usr/bin/pkg-config --silence-errors --modversion pulsecore | tr -d \\n))
2 m4_define(PAVER, regexp(FULL_PAVER, [\([0123456789.]+\).*], [\1]))
6 AC_INIT([pulseaudio-modules-mfld-blackbay], [0.1])
7 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
8 AC_CONFIG_HEADERS([config.h:config.h.in])
10 AC_CONFIG_MACRO_DIR([m4])
12 # this would not be really needed if everything would be as it should be
13 AS_IF([test x${exec_prefix} = xNONE], [LIBDIR=$ac_default_prefix/lib], [LIBDIR=${libdir}])
16 AC_SUBST(PA_MAJORMINOR, [PAVER])
19 # Checks for programs.
25 AC_FUNC_SELECT_ARGTYPES
31 AC_PROG_GCC_TRADITIONAL
34 # Checks for libraries.
36 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
38 AC_MSG_CHECKING([target operating system])
42 AC_MSG_RESULT([linux])
46 AC_MSG_RESULT([unknown])
47 pulse_target_os=unknown
51 # If everything else fails use libatomic_ops
52 need_libatomic_ops=yes
54 AC_MSG_CHECKING([whether $CC knows __sync_bool_compare_and_swap()])
55 AC_LANG_CONFTEST([int main() { int a = 4; __sync_bool_compare_and_swap(&a, 4, 5); }])
56 $CC conftest.c $CFLAGS -o conftest > /dev/null 2> /dev/null
58 rm -f conftest.o conftest
59 if test $ret -eq 0 ; then
60 AC_DEFINE([HAVE_ATOMIC_BUILTINS], 1, [Have __sync_bool_compare_and_swap() and friends.])
65 AC_MSG_CHECKING([whether we need libatomic_ops])
66 if test "x$need_libatomic_ops" = "xyes"; then
68 AC_CHECK_HEADERS([atomic_ops.h], [], [
69 AC_MSG_ERROR([*** libatomic-ops headers not found])
72 # Win32 does not need the lib and breaks horribly if we try to include it
73 if test "x$os_is_win32" != "x1" ; then
74 LIBS="$LIBS -latomic_ops"
80 #### libtool stuff ####
82 LT_INIT([dlopen win32-dll disable-static])
84 dnl Unfortunately, even up to libtool 2.2.6a there is no way to know
85 dnl exactly which version of libltdl is present in the system, so we
86 dnl just assume that it's a working version as long as we have the
87 dnl library and the header files.
89 dnl As an extra safety device, check for lt_dladvise_init() which is
90 dnl only implemented in libtool 2.x, and refine as we go if we have
91 dnl refined requirements.
93 dnl Check the header files first since the system may have a
94 dnl libltdl.so for runtime, but no headers, and we want to bail out as
97 dnl We don't need any special variable for this though, since the user
98 dnl can give the proper place to find libltdl through the standard
99 dnl variables like LDFLAGS and CPPFLAGS.
101 AC_CHECK_HEADER([ltdl.h],
102 [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
105 AS_IF([test "x$LIBLTDL" = "x"],
106 [AC_MSG_ERROR([Unable to find libltdl version 2. Makes sure you have libtool 2.2 or later installed.])])
109 PKG_CHECK_MODULES(PULSE, libpulse)
110 AC_SUBST(PULSE_CFLAGS)
114 AC_ARG_WITH([module-dir],
115 [AS_HELP_STRING([--with-module-dir], [Directory where to install the modules to (defaults to ${LIBDIR}/pulse-${PA_MAJORMINOR}/modules/])],
116 [modlibexecdir=$withval],
117 [modlibexecdir=${LIBDIR}/pulse-${PA_MAJORMINOR}/modules]
119 AC_SUBST(modlibexecdir)
121 # Checks for header files.
123 AC_CHECK_HEADERS([fcntl.h memory.h stdlib.h string.h sys/time.h unistd.h errno.h sys/types.h sys/stat.h])
125 # Checks for typedefs, structures, and compiler characteristics.
130 # Checks for library functions.
135 AC_FUNC_SELECT_ARGTYPES
137 AC_CHECK_FUNCS([memset select])