Case sensitive header perhaps?
[rtaudio-cdist.git] / configure.ac
index 90cf02f6dcc3077f93b07c03e0c8b1d2bb08b3b2..aab625a6f2e0fc9f0387248310f02539aa97f531 100644 (file)
@@ -38,9 +38,9 @@ use_asio=""
 
 # configure flags
 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable various debug output])])
-AC_ARG_WITH(jack, [AS_HELP_STRING([--with-jack], [choose JACK server support (mac and linux only)])])
+AC_ARG_WITH(jack, [AS_HELP_STRING([--with-jack], [choose JACK server support])])
 AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa], [choose native ALSA API support (linux only)])])
-AC_ARG_WITH(pulse, [AS_HELP_STRING([--with-pulse], [choose PulseAudio API support (linux only)])])
+AC_ARG_WITH(pulse, [AS_HELP_STRING([--with-pulse], [choose PulseAudio API support (unixes)])])
 AC_ARG_WITH(oss, [AS_HELP_STRING([--with-oss], [choose OSS API support (unixes)])])
 AC_ARG_WITH(core, [AS_HELP_STRING([--with-core], [choose CoreAudio API support (mac only)])])
 AC_ARG_WITH(asio, [AS_HELP_STRING([--with-asio], [choose ASIO API support (win32 only)])])
@@ -216,12 +216,17 @@ AS_CASE(["$systems"], [*" oss "*], [
     AS_CASE(["$required"], [*" oss "*],
       AS_IF([test "x$need_ossaudio" = xyes],
         AC_MSG_WARN([RtAudio may require the ossaudio library]))))
-  AC_CHECK_HEADER(sys/soundcard.h,
+
+  # linux systems may have soundcard.h but *not* have OSS4 installed,
+  # we have to actually check if it exports OSS4 symbols
+  AC_CHECK_DECL(SNDCTL_SYSINFO,
     [api="$api -D__LINUX_OSS__"
      need_pthread=yes
      found="$found OSS"],
-    AS_CASE(["$required"], [*" oss "*],
-      AC_MSG_ERROR([sys/soundcard.h not found])))
+     AS_CASE(["$required"], [*" oss "*],
+       AC_MSG_ERROR([sys/soundcard.h not found]))
+    [],
+    [#include <sys/soundcard.h>])
 ])
 
 AS_CASE(["$systems"], [*" jack "*], [
@@ -254,18 +259,20 @@ AS_CASE(["$systems"], [*" asio "*], [
 ])
 
 AS_CASE(["$systems"], [*" ds "*], [
-  api="$api -D__WINDOWS_DS__"
-  need_ole32=yes
-  found="$found DirectSound"
-  LIBS="-ldsound -lwinmm $LIBS"
+  AC_CHECK_HEADERS(mmsystem.h mmreg.h dsound.h,
+    [api="$api -D__WINDOWS_DS__"
+     need_ole32=yes
+     found="$found DirectSound"
+     LIBS="-ldsound -lwinmm $LIBS"])
 ])
 
 AS_CASE(["$systems"], [*" wasapi "*], [
-  api="$api -D__WINDOWS_WASAPI__"
-  CPPFLAGS="-I$srcdir/include $CPPFLAGS"
-  need_ole32=yes
-  found="$found WASAPI"
-  LIBS="-lwinmm -luuid -lksuser $LIBS"
+  AC_CHECK_HEADERS(windows.h audioclient.h avrt.h mmdeviceapi.h,
+    [api="$api -D__WINDOWS_WASAPI__"
+     CPPFLAGS="-I$srcdir/include $CPPFLAGS"
+     need_ole32=yes
+     found="$found WASAPI"
+     LIBS="-lwinmm -luuid -lksuser $LIBS"])
 ])
 
 AS_IF([test -n "$need_ole32"], [LIBS="-lole32 $LIBS"])
@@ -280,7 +287,7 @@ AC_MSG_CHECKING([for audio API])
 # Error case: no known realtime systems found.
 AS_IF([test x"$api" = "x"], [
   AC_MSG_RESULT([none])
-  AC_MSG_ERROR([Unknown system type for realtime support!])
+  AC_MSG_ERROR([No known system type found for realtime support!])
 ], [
   AC_MSG_RESULT([$found])
 ])