From 5b0a1df228ee7c84f38c276cbb9d90f3468bd49b Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Thu, 27 Sep 2018 15:39:21 +0700 Subject: [PATCH] meson: Enable oss module and padsp util 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 --- meson.build | 6 ++++++ src/modules/meson.build | 7 ++++++- src/utils/meson.build | 24 ++++++++++++++++++++++++ src/utils/padsp.in | 0 4 files changed, 36 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/utils/padsp.in diff --git a/meson.build b/meson.build index db518703d..51c6f1efb 100644 --- a/meson.build +++ b/meson.build @@ -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) diff --git a/src/modules/meson.build b/src/modules/meson.build index d295c6d48..8efffcc5b 100644 --- a/src/modules/meson.build +++ b/src/modules/meson.build @@ -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() diff --git a/src/utils/meson.build b/src/utils/meson.build index e407d0721..840fc6068 100644 --- a/src/utils/meson.build +++ b/src/utils/meson.build @@ -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 diff --git a/src/utils/padsp.in b/src/utils/padsp.in old mode 100644 new mode 100755