bluetooth: Fix a2dp processing
[profile/ivi/pulseaudio.git] / configure.ac
index 05312d3..5216c01 100644 (file)
@@ -22,8 +22,7 @@
 
 AC_PREREQ(2.63)
 
-AC_INIT([pulseaudio], m4_esyscmd([./git-version-gen .tarball-version]),
-       [mzchyfrnhqvb (at) 0pointer (dot) net])
+AC_INIT([pulseaudio],[m4_esyscmd(./git-version-gen .tarball-version)],[mzchyfrnhqvb (at) 0pointer (dot) net])
 AC_CONFIG_SRCDIR([src/daemon/main.c])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS([config.h])
@@ -31,21 +30,18 @@ AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
 
 m4_define(pa_major, `echo $VERSION | cut -d. -f1 | cut -d- -f1`)
 m4_define(pa_minor, `echo $VERSION | cut -d. -f2 | cut -d- -f1`)
-m4_define(pa_micro, `echo $VERSION | cut -d. -f3 | cut -d- -f1`)
 
 AC_SUBST(PA_MAJOR, pa_major)
 AC_SUBST(PA_MINOR, pa_minor)
-AC_SUBST(PA_MICRO, pa_micro)
 AC_SUBST(PA_MAJORMINOR, pa_major.pa_minor)
-AC_SUBST(PA_MAJORMINORMICRO, pa_major.pa_minor.pa_micro)
 AC_SUBST(PACKAGE_URL, [http://pulseaudio.org/])
 
 AC_SUBST(PA_API_VERSION, 12)
-AC_SUBST(PA_PROTOCOL_VERSION, 16)
+AC_SUBST(PA_PROTOCOL_VERSION, 19)
 
 # The stable ABI for client applications, for the version info x:y:z
 # always will hold y=z
-AC_SUBST(LIBPULSE_VERSION_INFO, [9:0:9])
+AC_SUBST(LIBPULSE_VERSION_INFO, [12:3:12])
 
 # A simplified, synchronous, ABI-stable interface for client
 # applications, for the version info x:y:z always will hold y=z
@@ -62,23 +58,12 @@ AC_SUBST(LIBPULSE_MAINLOOP_GLIB_VERSION_INFO, [0:4:0])
 AC_CANONICAL_HOST
 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
 
-if type -p stow > /dev/null && test -d /usr/local/stow ; then
+AC_CHECK_PROG([STOW], [stow], [yes], [no])
+
+AS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [
    AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
    ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
-fi
-
-#### Platform hacks ####
-
-case $host in
-   *-*-solaris* )
-      AC_DEFINE(_XOPEN_SOURCE,        600, Needed to get declarations for msg_control and msg_controllen on Solaris)
-      AC_DEFINE(__EXTENSIONS__,         1, Needed to get declarations for msg_control and msg_controllen on Solaris)
-      ;;
-   *-*-darwin* )
-      AC_DEFINE([_POSIX_C_SOURCE], [200112L], [Needed to get clock_gettime on Mac OS X])
-      AC_DEFINE([_DARWIN_C_SOURCE], [200112L], [Needed to get NSIG on Mac OS X])
-      ;;
-esac
+])
 
 AM_SILENT_RULES([yes])
 
@@ -96,6 +81,19 @@ AM_PROG_CC_C_O
 AC_PROG_GCC_TRADITIONAL
 AC_USE_SYSTEM_EXTENSIONS
 
+#### Platform hacks ####
+
+case $host in
+   *-*-solaris* )
+      AC_DEFINE(_XOPEN_SOURCE,        600, Needed to get declarations for msg_control and msg_controllen on Solaris)
+      AC_DEFINE(__EXTENSIONS__,         1, Needed to get declarations for msg_control and msg_controllen on Solaris)
+      ;;
+   *-*-darwin* )
+      AC_DEFINE([_POSIX_C_SOURCE], [200112L], [Needed to get clock_gettime on Mac OS X])
+      AC_DEFINE([_DARWIN_C_SOURCE], [200112L], [Needed to get NSIG on Mac OS X])
+      ;;
+esac
+
 # M4
 
 AC_CHECK_PROGS([M4], gm4 m4, no)
@@ -165,26 +163,15 @@ AC_ARG_ENABLE([atomic-arm-memory-barrier],
             esac
         ],)
 
-AC_ARG_ENABLE([netbsd-atomic-ops],
-    AS_HELP_STRING([--enable-netbsd-atomic-ops],[Use the native NetBSD atomic_ops implementation]),
-        [
-            case "${enableval}" in
-                yes) atomic_netbsd_helpers=yes ;;
-                no) atomic_netbsd_helpers=no ;;
-                *) AC_MSG_ERROR(bad value ${enableval} for --enable-netbsd-atomic-ops) ;;
-            esac
-        ],
-        [atomic_netbsd_helpers=auto])
-
 AC_MSG_CHECKING([target operating system])
 case $host in
         *-*-linux*)
             AC_MSG_RESULT([linux])
             pulse_target_os=linux
         ;;
-        *-*-netbsd*)
-            AC_MSG_RESULT([netbsd])
-            pulse_target_os=netbsd
+        *-*-darwin*)
+            AC_MSG_RESULT([darwin])
+            pulse_target_os=darwin
         ;;
         *)
             AC_MSG_RESULT([unknown])
@@ -209,7 +196,7 @@ if test "$pulseaudio_cv_sync_bool_compare_and_swap" = "yes" ; then
 else
     # HW specific atomic ops stuff
     AC_MSG_CHECKING([architecture for native atomic operations])
-    case $host_cpu in
+    case $host in
         arm*)
             AC_MSG_RESULT([arm])
             AC_MSG_CHECKING([whether we can use Linux kernel helpers])
@@ -240,23 +227,56 @@ else
                     [pulseaudio_cv_support_arm_atomic_ops=no])
                  ])
                AS_IF([test "$pulseaudio_cv_support_arm_atomic_ops" = "yes"], [
-                   AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARMv6 instructions.])
+                   AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARM atomic instructions.])
                    need_libatomic_ops=no
                  ])
            fi
         ;;
+       *-netbsdelf5*)
+            AC_MSG_RESULT([yes])
+            need_libatomic_ops=no
+       ;;
+       *-freebsd*)
+            AC_MSG_RESULT([yes])
+            need_libatomic_ops=no
+       ;;
         *)
-            if test "x$pulse_target_os" = "xnetbsd" && test "x$atomic_netbsd_helpers" = "xyes"; then
-                AC_MSG_RESULT([yes])
-                AC_DEFINE_UNQUOTED(NETBSD_ATOMIC_OPS, 1, [netbsd implementation])
-                need_libatomic_ops=no
-            else
-                AC_MSG_RESULT([unknown])
-            fi
+            AC_MSG_RESULT([unknown])
         ;;
     esac
 fi
 
+# If we're on ARM, check for the ARMV6 instructions we need */
+case $host in
+  arm*)
+    AC_CACHE_CHECK([support for required armv6 instructions],
+      pulseaudio_cv_support_armv6,
+      [AC_COMPILE_IFELSE(
+         AC_LANG_PROGRAM([],
+           [[volatile int a = -60000, b = 0xaaaabbbb, c = 0xccccdddd;
+             asm volatile ("ldr r0, %2 \n"
+                           "ldr r2, %3 \n"
+                           "ldr r3, %4 \n"
+                           "ssat r1, #8, r0 \n"
+                           "str r1, %0 \n"
+                           "pkhbt r1, r3, r2, LSL #8 \n"
+                           "str r1, %1 \n"
+                           : "=m" (a), "=m" (b)
+                           : "m" (a), "m" (b), "m" (c)
+                           : "r0", "r1", "r2", "r3", "cc");
+             return (a == -128 && b == 0xaabbdddd) ? 0 : -1;
+           ]]),
+         [pulseaudio_cv_support_armv6=yes],
+         [pulseaudio_cv_support_armv6=no])
+      ])
+    AS_IF([test "$pulseaudio_cv_support_armv6" = "yes"], [
+        AC_DEFINE([HAVE_ARMV6], 1, [Have ARMv6 instructions.])
+      ])
+  ;;
+  *)
+  ;;
+esac
+
 CC_CHECK_TLS
 
 AC_CACHE_CHECK([whether $CC knows _Bool],
@@ -303,15 +323,21 @@ AC_SUBST([LIBLTDL])
 #### Determine build environment ####
 
 os_is_win32=0
+os_is_darwin=0
 
 case "$host_os" in
         mingw*)
         AC_DEFINE([OS_IS_WIN32], 1, [Build target is Windows.])
         os_is_win32=1
                 ;;
+        darwin*)
+        AC_DEFINE([OS_IS_DARWIN], 1, [Build target is Darwin.])
+        os_is_darwin=1
+                ;;
         esac
 
 AM_CONDITIONAL(OS_IS_WIN32, test "x$os_is_win32" = "x1")
+AM_CONDITIONAL(OS_IS_DARWIN, test "x$os_is_darwin" = "x1")
 
 ###################################
 #   Basic environment checks      #
@@ -404,6 +430,7 @@ AC_SEARCH_LIBS([dlopen], [dl])
 AC_SEARCH_LIBS([shm_open], [rt])
 AC_SEARCH_LIBS([inet_ntop], [nsl])
 AC_SEARCH_LIBS([timer_create], [rt])
+AC_SEARCH_LIBS([pthread_setaffinity_np], [pthread])
 
 # BSD
 AC_SEARCH_LIBS([connect], [socket])
@@ -415,6 +442,22 @@ AC_SEARCH_LIBS([backtrace], [execinfo])
 # build, disabling its ability to make dlls.
 AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
 
+# Darwin/OS X
+if test "x$os_is_darwin" = "x1" ; then
+    AC_MSG_CHECKING([looking for Apple CoreService Framework])
+    # How do I check a framework "library" - AC_CHECK_LIB prob. won't work??, just assign LIBS & hope
+    AC_CHECK_HEADER([/Developer/Headers/FlatCarbon/CoreServices.h],
+    [LIBS="$LIBS -framework CoreServices"],
+    [AC_MSG_ERROR([CoreServices.h header file not found]) ])
+
+    AC_MSG_RESULT([ok])
+    AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [Using clock_gettime() replacement])
+    HAVE_BONJOUR=1
+fi
+
+AC_SUBST(HAVE_BONJOUR)
+AM_CONDITIONAL([HAVE_BONJOUR], [test "x$HAVE_BONJOUR" = x1])
+
 #### Check for functions ####
 
 # ISO
@@ -424,7 +467,7 @@ AC_CHECK_FUNCS_ONCE([lrintf strtof])
 AC_FUNC_FORK
 AC_FUNC_GETGROUPS
 AC_FUNC_SELECT_ARGTYPES
-AC_CHECK_FUNCS_ONCE([chmod chown clock_gettime getaddrinfo getgrgid_r getgrnam_r \
+AC_CHECK_FUNCS_ONCE([chmod chown fstat fchown fchmod clock_gettime getaddrinfo getgrgid_r getgrnam_r \
     getpwnam_r getpwuid_r gettimeofday getuid inet_ntop inet_pton mlock nanosleep \
     pipe posix_fadvise posix_madvise posix_memalign setpgid setsid shm_open \
     sigaction sleep sysconf pthread_setaffinity_np])
@@ -446,7 +489,7 @@ AC_CHECK_FUNCS_ONCE([lstat])
 
 # Non-standard
 
-AC_CHECK_FUNCS_ONCE([setresuid setresgid setreuid setregid seteuid setegid ppoll strsignal sig2str strtof_l])
+AC_CHECK_FUNCS_ONCE([setresuid setresgid setreuid setregid seteuid setegid ppoll strsignal sig2str strtof_l pipe2 accept4])
 
 AC_FUNC_ALLOCA
 
@@ -516,7 +559,7 @@ AC_ARG_ENABLE([x11],
         [x11=auto])
 
 if test "x${x11}" != xno ; then
-    PKG_CHECK_MODULES(X11, [ x11 ice sm xtst ],
+    PKG_CHECK_MODULES(X11, [ x11-xcb ice sm xtst xcb-atom ],
         HAVE_X11=1,
         [
             HAVE_X11=0
@@ -743,6 +786,28 @@ AC_SUBST(HAVE_OSS)
 AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test "x$HAVE_OSS" = x1 && test "x${oss_output}" != "xno"])
 AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test "x$HAVE_OSS" = x1 && test "x${oss_wrapper}" != "xno"])
 
+#### CoreAudio support (optional) ####
+
+AC_ARG_ENABLE([coreaudio-output],
+    AS_HELP_STRING([--disable-coreaudio-output],[Disable optional CoreAudio output support]),
+        [
+            case "${enableval}" in
+                yes) coreaudio_enabled=yes ;;
+                no) coreaudio_enabled=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --disable-coreaudio-output) ;;
+            esac
+        ],
+        [coreaudio_enabled=auto])
+
+if test "x${coreaudio_enabled}" != xno ; then
+    AC_CHECK_HEADERS([CoreAudio/CoreAudio.h], HAVE_COREAUDIO=1)
+else
+    HAVE_COREAUDIO=0
+fi
+
+AC_SUBST(HAVE_COREAUDIO)
+AM_CONDITIONAL([HAVE_COREAUDIO], [test "x$HAVE_COREAUDIO" = x1 && test "x${coreaudio_enabled}" != "xno"])
+
 #### ALSA support (optional) ####
 
 AC_ARG_ENABLE([alsa],
@@ -893,7 +958,7 @@ AC_ARG_ENABLE([gconf],
         [gconf=auto])
 
 if test "x${gconf}" != xno ; then
-    PKG_CHECK_MODULES(GCONF, [ gconf-2.0 >= 2.4.0 ],
+    PKG_CHECK_MODULES(GCONF, [ gconf-2.0 >= 2.4.0 gobject-2.0 ],
         HAVE_GCONF=1,
         [
             HAVE_GCONF=0
@@ -941,12 +1006,6 @@ AC_SUBST(AVAHI_LIBS)
 AC_SUBST(HAVE_AVAHI)
 AM_CONDITIONAL([HAVE_AVAHI], [test "x$HAVE_AVAHI" = x1])
 
-### LIBOIL ####
-
-PKG_CHECK_MODULES(LIBOIL, [ liboil-0.3 >= 0.3.0 ])
-AC_SUBST(LIBOIL_CFLAGS)
-AC_SUBST(LIBOIL_LIBS)
-
 ### JACK (optional) ####
 
 AC_ARG_ENABLE([jack],
@@ -1205,6 +1264,7 @@ if test "x${dbus}" != xno || test "x${bluez}" != xno || test "x${hal}" != xno ;
             HAVE_DBUS=1
             saved_LIBS="$LIBS"
             LIBS="$LIBS $DBUS_LIBS"
+            CFLAGS="$CFLAGS $DBUS_CFLAGS"
             AC_CHECK_FUNCS(dbus_watch_get_unix_fd)
             LIBS="$saved_LIBS"
             AC_DEFINE([HAVE_DBUS], 1, [Have D-Bus.])
@@ -1279,6 +1339,19 @@ AC_SUBST(OPENSSL_LIBS)
 AC_SUBST(HAVE_OPENSSL)
 AM_CONDITIONAL([HAVE_OPENSSL], [test "x$HAVE_OPENSSL" = x1])
 
+#### FFTW (optional) ####
+AC_ARG_WITH(
+       [fftw],
+       AS_HELP_STRING([--without-fftw], [Omit FFTW-using modules (equalizer)]))
+
+if test "x${with_fftw}" != "xno"; then
+    PKG_CHECK_MODULES([FFTW], [fftw3f], [HAVE_FFTW=1], [HAVE_FFTW=0])
+fi
+AM_CONDITIONAL([HAVE_FFTW], [test "x$HAVE_FFTW" = "x1"])
+
+### ORC (optional) ###
+ORC_CHECK([0.4.9])
+
 ### Build and Install man pages ###
 AC_ARG_ENABLE(manpages,
         AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
@@ -1375,11 +1448,18 @@ fi
 
 AC_ARG_WITH(
         [module-dir],
-        AS_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${libdir}/pulse-${PA_MAJORMINORMICRO}/modules]),
-        [modlibexecdir=$withval], [modlibexecdir="${libdir}/pulse-${PA_MAJORMINORMICRO}/modules"])
+        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)
 
+AC_ARG_WITH(
+        [udev-rules-dir],
+        AS_HELP_STRING([--with-udev-rules-dir],[Directory where to install udev rules to (defaults to /lib/udev/rules.d)]),
+        [udevrulesdir=$withval], [udevrulesdir="/lib/udev/rules.d"])
+
+AC_SUBST(udevrulesdir)
+
 AC_ARG_ENABLE(
         [force-preopen],
         AS_HELP_STRING([--enable-force-preopen],[Preopen modules, even when dlopen() is supported.]),
@@ -1398,6 +1478,25 @@ doxygen/Makefile
 doxygen/doxygen.conf
 src/pulse/version.h
 po/Makefile.in
+src/daemon/Makefile
+src/modules/Makefile
+src/modules/alsa/Makefile
+src/modules/alsa/mixer/Makefile
+src/modules/alsa/mixer/paths/Makefile
+src/modules/alsa/mixer/profile-sets/Makefile
+src/modules/bluetooth/Makefile
+src/modules/dbus/Makefile
+src/modules/gconf/Makefile
+src/modules/jack/Makefile
+src/modules/oss/Makefile
+src/modules/raop/Makefile
+src/modules/rtp/Makefile
+src/modules/x11/Makefile
+src/pulse/Makefile
+src/pulsecore/Makefile
+src/pulsecore/ffmpeg/Makefile
+src/tests/Makefile
+src/utils/Makefile
 ])
 
 AC_OUTPUT
@@ -1419,6 +1518,11 @@ if test "x$HAVE_OSS" = "x1" ; then
    fi
 fi
 
+ENABLE_COREAUDIO=no
+if test "x$HAVE_COREAUDIO" = "x1" ; then
+   ENABLE_COREAUDIO=yes
+fi
+
 ENABLE_ALSA=no
 if test "x$HAVE_ALSA" = "x1" ; then
    ENABLE_ALSA=yes
@@ -1464,6 +1568,11 @@ if test "x$HAVE_LIRC" = "x1" ; then
    ENABLE_LIRC=yes
 fi
 
+ENABLE_DBUS=no
+if test "x$HAVE_DBUS" = "x1" ; then
+   ENABLE_DBUS=yes
+fi
+
 ENABLE_HAL=no
 if test "x$HAVE_HAL" = "x1" ; then
    ENABLE_HAL=yes
@@ -1509,6 +1618,16 @@ if test "x${HAVE_SIMPLEDB}" = "x1" ; then
     ENABLE_SIMPLEDB=yes
 fi
 
+ENABLE_FFTW=no
+if test "x${HAVE_FFTW}" = "x1" ; then
+   ENABLE_FFTW=yes
+fi
+
+ENABLE_ORC=no
+if test "x${HAVE_ORC}" = "xyes" ; then
+   ENABLE_ORC=yes
+fi
+
 ENABLE_OPENSSL=no
 if test "x${HAVE_OPENSSL}" = "x1" ; then
    ENABLE_OPENSSL=yes
@@ -1539,6 +1658,7 @@ echo "
     Have X11:                      ${ENABLE_X11}
     Enable OSS Output:             ${ENABLE_OSS_OUTPUT}
     Enable OSS Wrapper:            ${ENABLE_OSS_WRAPPER}
+    Enable CoreAudio:              ${ENABLE_COREAUDIO}
     Enable Alsa:                   ${ENABLE_ALSA}
     Enable Solaris:                ${ENABLE_SOLARIS}
     Enable GLib 2.0:               ${ENABLE_GLIB20}
@@ -1548,6 +1668,7 @@ echo "
     Enable Jack:                   ${ENABLE_JACK}
     Enable Async DNS:              ${ENABLE_LIBASYNCNS}
     Enable LIRC:                   ${ENABLE_LIRC}
+    Enable DBUS:                   ${ENABLE_DBUS}
     Enable HAL:                    ${ENABLE_HAL}
     Enable udev:                   ${ENABLE_UDEV}
     Enable HAL->udev compat:       ${ENABLE_HAL_COMPAT}
@@ -1559,6 +1680,8 @@ echo "
     Enable tdb:                    ${ENABLE_TDB}
     Enable gdbm:                   ${ENABLE_GDBM}
     Enable simple database:        ${ENABLE_SIMPLEDB}
+    Enable fftw:                   ${ENABLE_FFTW}
+    Enable orc:                    ${ENABLE_ORC}
 
     System User:                   ${PA_SYSTEM_USER}
     System Group:                  ${PA_SYSTEM_GROUP}