meson: Enable oss module and padsp util
authorArnaud Rebillout <arnaud.rebillout@collabora.com>
Thu, 27 Sep 2018 08:39:21 +0000 (15:39 +0700)
committerArun Raghavan <arun@arunraghavan.net>
Thu, 4 Oct 2018 03:14:18 +0000 (08:44 +0530)
Regarding the module:

This is unlike the autotools where liboss-util is built as a library,
here we build everything in the oss module, as apparently there's no
other consumer for liboss-util.

Regarding padsp:

Setting the install mode for padsp requires meson 0.47, so instead we
set padsp.in as executable in the git repository (which is what glib
does for gdbus-codegen btw).

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
meson.build
src/modules/meson.build
src/utils/meson.build
src/utils/padsp.in [changed mode: 0644->0755]

index db51870..51c6f1e 100644 (file)
@@ -228,6 +228,12 @@ cdata.set('DISABLE_ORC', 1)
 
 # Module dependencies
 
+if cc.has_header('sys/soundcard.h')
+  cdata.set('HAVE_OSS_OUTPUT', 1)
+  cdata.set('HAVE_OSS_WRAPPER', 1)
+  cdata.set_quoted('PULSEDSP_LOCATION',        join_paths(prefix, get_option('libdir'), 'pulseaudio'))
+endif
+
 # X11 deps, we don't define any HAVE_XXX for these one
 ice_dep = dependency('ice', required : false)
 sm_dep = dependency('sm', required: false)
index d295c6d..8efffcc 100644 (file)
@@ -44,7 +44,6 @@ all_modules = [
   [ 'module-native-protocol-unix', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_NATIVE', '-DUSE_UNIX_SOCKETS'], [], libprotocol_native ],
   [ 'module-null-sink', 'module-null-sink.c' ],
   [ 'module-null-source', 'module-null-source.c' ],
-#  [ 'module-oss', 'oss/module-oss.c' ],
   [ 'module-pipe-sink', 'module-pipe-sink.c' ],
   [ 'module-pipe-source', 'module-pipe-source.c' ],
   [ 'module-position-event-sounds', 'module-position-event-sounds.c' ],
@@ -84,6 +83,12 @@ if cc.has_header('linux/input.h')
   ]
 endif
 
+if cc.has_header('sys/soundcard.h')
+  all_modules += [
+    [ 'module-oss', [ 'oss/module-oss.c', 'oss/oss-util.c', 'oss/oss-util.h' ] ],
+  ]
+endif
+
 # Modules enabled by dependencies
 
 if alsa_dep.found()
index e407d07..840fc60 100644 (file)
@@ -65,3 +65,27 @@ executable('pax11publish',
   dependencies : [x11_dep],
   c_args : pa_c_args,
 )
+
+if cc.has_header('sys/soundcard.h')
+  libpulsecommon_sources = [
+    'padsp.c',
+  ]
+
+  libpulsedsp = shared_library('pulsedsp',
+    libpulsecommon_sources,
+    install: true,
+    include_directories : [configinc, topinc],
+    link_with : [libpulsecommon, libpulse],
+    link_args : ['-ldl'],
+    dependencies: [thread_dep],
+    c_args : [pa_c_args, '-Wno-nonnull-compare']
+  )
+
+  configure_file(
+    input : 'padsp.in',
+    output : 'padsp',
+    configuration : cdata,
+    install : true,
+    install_dir : join_paths(prefix, get_option('bindir')),
+  )
+endif
old mode 100644 (file)
new mode 100755 (executable)