m4_define(FULL_PAVER, esyscmd(/usr/bin/pkg-config --silence-errors --modversion pulsecore | tr -d \\n)) m4_define(PAVER, regexp(FULL_PAVER, [\([0123456789.]+\).*], [\1])) AC_PREREQ(2.52) AC_INIT([pulseaudio-modules-mfld-blackbay], [0.1]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_CONFIG_HEADERS([config.h:config.h.in]) AC_CONFIG_MACRO_DIR([m4]) # this would not be really needed if everything would be as it should be AS_IF([test x${exec_prefix} = xNONE], [LIBDIR=$ac_default_prefix/lib], [LIBDIR=${libdir}]) AC_SUBST(LIBDIR) AC_SUBST(PA_MAJORMINOR, [PAVER]) # Checks for programs. AC_PROG_CC AC_C_CONST dnl AC_FUNC_MALLOC AC_FUNC_MMAP AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_STAT AC_FUNC_VPRINTF AC_HEADER_STDBOOL AC_HEADER_STDC AC_HEADER_TIME AC_PROG_GCC_TRADITIONAL AC_PROG_LIBTOOL # Checks for libraries. AC_CANONICAL_HOST AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.]) AC_MSG_CHECKING([target operating system]) case $host in *-*-linux*) AC_MSG_RESULT([linux]) pulse_target_os=linux ;; *) AC_MSG_RESULT([unknown]) pulse_target_os=unknown ;; esac # If everything else fails use libatomic_ops need_libatomic_ops=yes AC_MSG_CHECKING([whether $CC knows __sync_bool_compare_and_swap()]) AC_LANG_CONFTEST([int main() { int a = 4; __sync_bool_compare_and_swap(&a, 4, 5); }]) $CC conftest.c $CFLAGS -o conftest > /dev/null 2> /dev/null ret=$? rm -f conftest.o conftest if test $ret -eq 0 ; then AC_DEFINE([HAVE_ATOMIC_BUILTINS], 1, [Have __sync_bool_compare_and_swap() and friends.]) AC_MSG_RESULT([yes]) need_libatomic_ops=no fi AC_MSG_CHECKING([whether we need libatomic_ops]) if test "x$need_libatomic_ops" = "xyes"; then AC_MSG_RESULT([yes]) AC_CHECK_HEADERS([atomic_ops.h], [], [ AC_MSG_ERROR([*** libatomic-ops headers not found]) ]) # Win32 does not need the lib and breaks horribly if we try to include it if test "x$os_is_win32" != "x1" ; then LIBS="$LIBS -latomic_ops" fi else AC_MSG_RESULT([no]) fi #### libtool stuff #### LT_PREREQ(2.2) LT_INIT([dlopen win32-dll disable-static]) dnl Unfortunately, even up to libtool 2.2.6a there is no way to know dnl exactly which version of libltdl is present in the system, so we dnl just assume that it's a working version as long as we have the dnl library and the header files. dnl dnl As an extra safety device, check for lt_dladvise_init() which is dnl only implemented in libtool 2.x, and refine as we go if we have dnl refined requirements. dnl dnl Check the header files first since the system may have a dnl libltdl.so for runtime, but no headers, and we want to bail out as dnl soon as possible. dnl dnl We don't need any special variable for this though, since the user dnl can give the proper place to find libltdl through the standard dnl variables like LDFLAGS and CPPFLAGS. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])], [LIBLTDL=]) AS_IF([test "x$LIBLTDL" = "x"], [AC_MSG_ERROR([Unable to find libltdl version 2. Makes sure you have libtool 2.2 or later installed.])]) AC_SUBST([LIBLTDL]) PKG_CHECK_MODULES(PULSE, libpulse) AC_SUBST(PULSE_CFLAGS) AC_SUBST(PULSE_LIBS) # module directory AC_ARG_WITH([module-dir], [AS_HELP_STRING([--with-module-dir], [Directory where to install the modules to (defaults to ${LIBDIR}/pulse-${PA_MAJORMINOR}/modules/])], [modlibexecdir=$withval], [modlibexecdir=${LIBDIR}/pulse-${PA_MAJORMINOR}/modules] ) AC_SUBST(modlibexecdir) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h memory.h stdlib.h string.h sys/time.h unistd.h errno.h sys/types.h sys/stat.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_SELECT_ARGTYPES AC_TYPE_SIGNAL AC_CHECK_FUNCS([memset select]) AC_CONFIG_FILES([ Makefile ]) AC_OUTPUT