Make libossaudio a soft OSS requirement, but do check for sys/soundcard.h
authorStephen Sinclair <radarsat1@gmail.com>
Wed, 2 May 2018 21:57:43 +0000 (18:57 -0300)
committerStephen Sinclair <radarsat1@gmail.com>
Wed, 2 May 2018 22:13:52 +0000 (19:13 -0300)
configure.ac

index 5a663a5ac1239d5f0e839a3aaceca673417d5ef9..a2e2299850536e3107a0ff420047fabca9040f40 100644 (file)
@@ -198,13 +198,20 @@ AS_CASE(["$systems"], [*" pulse "*], [
 ])
 
 AS_CASE(["$systems"], [*" oss "*], [
-  AC_CHECK_LIB(ossaudio, main,
+  # libossaudio not required on some platforms (e.g. linux) so we
+  # don't break things if it's not found, but issue a warning when we
+  # are not sure (i.e. not on linux)
+  AS_CASE([$host], [*-*-linux*], [], [*], [need_ossaudio=yes])
+  AC_CHECK_LIB(ossaudio, main, [have_ossaudio=true],
+    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,
     [api="$api -D__LINUX_OSS__"
      need_pthread=yes
-     found="$found OSS"
-     LIBS="-lossaudio $LIBS"],
+     found="$found OSS"],
     AS_CASE(["$required"], [*" oss "*],
-      AC_MSG_ERROR([RtAudio requires the ossaudio library])))
+      AC_MSG_ERROR([sys/soundcard.h not found])))
 ])
 
 AS_CASE(["$systems"], [*" jack "*], [