Improve OSS4 detection on Linux.
authorStephen Sinclair <radarsat1@gmail.com>
Sat, 14 Jul 2018 00:24:27 +0000 (20:24 -0400)
committerStephen Sinclair <radarsat1@gmail.com>
Sat, 14 Jul 2018 16:42:15 +0000 (12:42 -0400)
configure.ac

index 90cf02f6dcc3077f93b07c03e0c8b1d2bb08b3b2..4585cd4b595eacebb3d85cddd1b278dfd4e4be84 100644 (file)
@@ -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 "*], [