meson: build oss plugin
authorTim-Philipp Müller <tim@centricular.com>
Fri, 23 Jun 2017 18:23:52 +0000 (19:23 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 23 Jun 2017 18:34:16 +0000 (19:34 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=784134

sys/meson.build
sys/oss/meson.build [new file with mode: 0644]

index 30761f0..3a2f702 100644 (file)
@@ -1,9 +1,9 @@
+subdir('directsound')
+subdir('oss')
 subdir('v4l2')
 subdir('ximage')
-subdir('directsound')
 
 # FIXME: Implement these
-#subdir('oss')
 #subdir('oss4')
 #subdir('osxaudio')
 #subdir('osxvideo')
diff --git a/sys/oss/meson.build b/sys/oss/meson.build
new file mode 100644 (file)
index 0000000..1176e78
--- /dev/null
@@ -0,0 +1,28 @@
+oss_header_locations = [
+  # Linux and newer BSD versions
+  ['sys/soundcard.h', 'HAVE_OSS_INCLUDE_IN_SYS', 'OSS includes are in sys/'],
+  # Some old BSD versions and also newer OpenBSD versions
+  ['soundcard.h', 'HAVE_OSS_INCLUDE_IN_ROOT', 'OSS includes are in root'],
+  # Some old BSD versions
+  ['machine/soundcard.h', 'HAVE_OSS_INCLUDE_IN_MACHINE', 'OSS includes are in machine/'],
+]
+
+have_oss = false
+foreach hdr : oss_header_locations
+  if not have_oss
+    if cc.has_header(hdr[0])
+      cdata.set(hdr[1], 1, description: hdr[2])
+      have_oss = true
+    endif
+  endif
+endforeach
+
+if have_oss
+  library('gstossaudio',
+    'gstossaudio.c', 'gstosshelper.c', 'gstosssink.c', 'gstosssrc.c',
+    c_args : gst_plugins_good_args,
+    include_directories : [configinc, libsinc],
+    dependencies : [gstaudio_dep, gstbase_dep],
+    install : true,
+    install_dir : plugins_install_dir)
+endif