[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 047/132] meson: convert audio directory to Meson
From: |
Paolo Bonzini |
Subject: |
[PATCH 047/132] meson: convert audio directory to Meson |
Date: |
Thu, 12 Dec 2019 13:51:31 +0100 |
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
Makefile.objs | 8 ++++++--
Makefile.target | 6 ++++--
audio/Makefile.objs | 31 -------------------------------
audio/meson.build | 30 ++++++++++++++++++++++++++++++
configure | 12 ++++++++++++
meson.build | 25 ++++++++++++++++++++++++-
6 files changed, 76 insertions(+), 36 deletions(-)
delete mode 100644 audio/Makefile.objs
create mode 100644 audio/meson.build
diff --git a/Makefile.objs b/Makefile.objs
index 8d14390..cea6f9a 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -36,6 +36,7 @@ qom-obj-y = qom/libqom.fa
ifeq ($(CONFIG_SOFTMMU),y)
common-obj-y = blockdev.o blockdev-nbd.o block/
+
common-obj-y += bootdevice.o iothread.o
common-obj-y += dump/
common-obj-y += job-qmp.o
@@ -49,6 +50,11 @@ common-obj-$(CONFIG_LINUX) += fsdev/
common-obj-y += migration/
+common-obj-$(CONFIG_AUDIO_ALSA) += audio-alsa$(DSOSUF)
+common-obj-$(CONFIG_AUDIO_OSS) += audio-oss$(DSOSUF)
+common-obj-$(CONFIG_AUDIO_PA) += audio-pa$(DSOSUF)
+common-obj-$(CONFIG_AUDIO_SDL) += audio-sdl$(DSOSUF)
+
common-obj-$(if $(CONFIG_CURL),m) += block-curl$(DSOSUF)
common-obj-$(if $(CONFIG_GLUSTERFS),m) += block-gluster$(DSOSUF)
common-obj-$(if $(CONFIG_LIBISCSI),m) += block-iscsi$(DSOSUF)
@@ -59,8 +65,6 @@ common-obj-$(if $(CONFIG_RBD),m) += block-rbd$(DSOSUF)
common-obj-$(if $(CONFIG_LZFSE),m) += block-dmg-lzfse$(DSOSUF)
common-obj-$(if $(and $(CONFIG_BZIP2),$(CONFIG_DMG)),m) +=
block-dmg-bz2$(DSOSUF)
-common-obj-y += audio/
-common-obj-m += audio/
common-obj-y += hw/
common-obj-y += replay/
diff --git a/Makefile.target b/Makefile.target
index 702e6f8..65f1312 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -165,9 +165,11 @@ LIBS := $(libs_softmmu) $(LIBS)
# Temporary until emulators are linked by Meson
LIBS := $(LIBS) @../block.syms @../qemu.syms
ifneq ($(CONFIG_MODULES),y)
-LIBS := $(LIBS)
+LIBS := $(LIBS) $(ALSA_LIBS) $(OSS_LIBS) $(PULSE_LIBS) $(SDL_LIBS)
endif
LIBS := $(LIBS) $(BRLAPI_LIBS) $(SDL_LIBS) $(SPICE_LIBS)
+LIBS := $(LIBS) $(COREAUDIO_LIBS) $(DSOUND_LIBS)
+
# Hardware support
ifeq ($(TARGET_NAME), sparc64)
@@ -193,7 +195,7 @@ dummy := $(call fix-paths,../,, \
qom-obj-y)
dummy := $(call unnest-vars,.., \
common-obj-y \
- common-obj-m)
+ common-obj-m)
all-obj-y += $(common-obj-y)
all-obj-y += $(qom-obj-y)
all-obj-$(CONFIG_SOFTMMU) += $(authz-obj-y)
diff --git a/audio/Makefile.objs b/audio/Makefile.objs
deleted file mode 100644
index dca87f6..0000000
--- a/audio/Makefile.objs
+++ /dev/null
@@ -1,31 +0,0 @@
-common-obj-y = audio.o audio_legacy.o noaudio.o wavaudio.o mixeng.o
-common-obj-$(CONFIG_SPICE) += spiceaudio.o
-common-obj-$(CONFIG_AUDIO_COREAUDIO) += coreaudio.o
-common-obj-$(CONFIG_AUDIO_DSOUND) += dsoundaudio.o
-common-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
-common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
-common-obj-y += wavcapture.o
-
-coreaudio.o-libs := $(COREAUDIO_LIBS)
-dsoundaudio.o-libs := $(DSOUND_LIBS)
-
-# alsa module
-common-obj-$(CONFIG_AUDIO_ALSA) += alsa.mo
-alsa.mo-objs = alsaaudio.o
-alsa.mo-libs := $(ALSA_LIBS)
-
-# oss module
-common-obj-$(CONFIG_AUDIO_OSS) += oss.mo
-oss.mo-objs = ossaudio.o
-oss.mo-libs := $(OSS_LIBS)
-
-# pulseaudio module
-common-obj-$(CONFIG_AUDIO_PA) += pa.mo
-pa.mo-objs = paaudio.o
-pa.mo-libs := $(PULSE_LIBS)
-
-# sdl module
-common-obj-$(CONFIG_AUDIO_SDL) += sdl.mo
-sdl.mo-objs = sdlaudio.o
-sdl.mo-cflags := $(SDL_CFLAGS)
-sdl.mo-libs := $(SDL_LIBS)
diff --git a/audio/meson.build b/audio/meson.build
new file mode 100644
index 0000000..e58a936
--- /dev/null
+++ b/audio/meson.build
@@ -0,0 +1,30 @@
+softmmu_ss.add(files(
+ 'audio.c',
+ 'audio_legacy.c',
+ 'mixeng.c',
+ 'noaudio.c',
+ 'wavaudio.c',
+ 'wavcapture.c',
+))
+
+softmmu_ss.add(when: [spice, 'CONFIG_SPICE'], if_true: files('spiceaudio.c'))
+softmmu_ss.add(when: [coreaudio, 'CONFIG_AUDIO_COREAUDIO'], if_true:
files('coreaudio.c'))
+softmmu_ss.add(when: [dsound, 'CONFIG_AUDIO_DSOUND'], if_true:
files('dsoundaudio.c'))
+softmmu_ss.add(when: ['CONFIG_AUDIO_PT_INT'], if_true: files('audio_pt_int.c'))
+softmmu_ss.add(when: ['CONFIG_AUDIO_WIN_INT'], if_true:
files('audio_win_int.c'))
+
+audio_modules = []
+if 'CONFIG_AUDIO_ALSA' in config_host
+ audio_modules += [['alsa', files('alsaaudio.c'), alsa]]
+endif
+if 'CONFIG_AUDIO_OSS' in config_host
+ audio_modules += [['oss', files('ossaudio.c'), oss]]
+endif
+if 'CONFIG_AUDIO_PA' in config_host
+ audio_modules += [['pa', files('paaudio.c'), pulse]]
+endif
+if 'CONFIG_AUDIO_SDL' in config_host
+ audio_modules += [['sdl', files('sdlaudio.c'), sdl]]
+endif
+
+modules += {'audio': audio_modules}
diff --git a/configure b/configure
index 9d33df3..0be0735 100755
--- a/configure
+++ b/configure
@@ -3396,6 +3396,8 @@ for drv in $audio_drv_list; do
alsa | try-alsa)
if $pkg_config alsa --exists; then
alsa_libs=$($pkg_config alsa --libs)
+ alsa_cflags=$($pkg_config alsa --cflags)
+ alsa=yes
if test "$drv" = "try-alsa"; then
audio_drv_list=$(echo "$audio_drv_list" | sed -e
's/try-alsa/alsa/')
fi
@@ -3411,7 +3413,9 @@ for drv in $audio_drv_list; do
pa | try-pa)
if $pkg_config libpulse --exists; then
+ libpulse=yes
pulse_libs=$($pkg_config libpulse --libs)
+ pulse_cflags=$($pkg_config libpulse --cflags)
audio_pt_int="yes"
if test "$drv" = "try-pa"; then
audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa/pa/')
@@ -6589,8 +6593,16 @@ for drv in $audio_drv_list; do
echo "$def=y" >> $config_host_mak ;;
esac
done
+if test "$alsa" = "yes" ; then
+ echo "CONFIG_ALSA=y" >> $config_host_mak
+fi
echo "ALSA_LIBS=$alsa_libs" >> $config_host_mak
+echo "ALSA_CFLAGS=$alsa_cflags" >> $config_host_mak
+if test "$libpulse" = "yes" ; then
+ echo "CONFIG_LIBPULSE=y" >> $config_host_mak
+fi
echo "PULSE_LIBS=$pulse_libs" >> $config_host_mak
+echo "PULSE_CFLAGS=$pulse_cflags" >> $config_host_mak
echo "COREAUDIO_LIBS=$coreaudio_libs" >> $config_host_mak
echo "DSOUND_LIBS=$dsound_libs" >> $config_host_mak
echo "OSS_LIBS=$oss_libs" >> $config_host_mak
diff --git a/meson.build b/meson.build
index df16b58..90a15ad 100644
--- a/meson.build
+++ b/meson.build
@@ -107,6 +107,16 @@ if 'CONFIG_LIBCAP_NG' in config_host
libcap_ng = declare_dependency(link_args:
config_host['LIBCAP_NG_LIBS'].split())
endif
xkbcommon = dependency('xkbcommon', required: false)
+pulse = declare_dependency()
+if 'CONFIG_LIBPULSE' in config_host
+ pulse = declare_dependency(compile_args: config_host['PULSE_CFLAGS'].split(),
+ link_args: config_host['PULSE_LIBS'].split())
+endif
+alsa = declare_dependency()
+if 'CONFIG_ALSA' in config_host
+ alsa = declare_dependency(compile_args: config_host['ALSA_CFLAGS'].split(),
+ link_args: config_host['ALSA_LIBS'].split())
+endif
spice = declare_dependency()
if 'CONFIG_SPICE' in config_host
spice = declare_dependency(compile_args: config_host['SPICE_CFLAGS'].split(),
@@ -176,6 +186,18 @@ liblzfse = declare_dependency()
if 'CONFIG_LZFSE' in config_host
liblzfse = declare_dependency(link_args: config_host['LZFSE_LIBS'].split())
endif
+oss = declare_dependency()
+if 'CONFIG_AUDIO_OSS' in config_host
+ oss = declare_dependency(link_args: config_host['OSS_LIBS'].split())
+endif
+dsound = declare_dependency()
+if 'CONFIG_AUDIO_DSOUND' in config_host
+ dsound = declare_dependency(link_args: config_host['DSOUND_LIBS'].split())
+endif
+coreaudio = declare_dependency()
+if 'CONFIG_AUDIO_COREAUDIO' in config_host
+ coreaudio = declare_dependency(link_args:
config_host['COREAUDIO_LIBS'].split())
+endif
create_config = find_program('scripts/create_config')
minikconf = find_program('scripts/minikconf.py')
@@ -453,6 +475,7 @@ libqemuutil = static_library('qemuutil',
qemuutil = declare_dependency(link_with: libqemuutil,
sources: version_res)
+subdir('audio')
subdir('io')
subdir('chardev')
subdir('fsdev')
@@ -481,7 +504,7 @@ foreach d, list : modules
else
softmmu_mods += sl
endif
- mods += {'dir': d, 'name': m[0], 'lib': sl, 'deps': m[2]}
+ mods += {'dir': d, 'name': m[0], 'lib': [sl, libmodulecommon], 'deps':
m[2]}
else
if d == 'block'
block_ss.add(when: m[2], if_true: m[1])
--
1.8.3.1
- [PATCH 037/132] meson: convert io directory to Meson, (continued)
- [PATCH 037/132] meson: convert io directory to Meson, Paolo Bonzini, 2019/12/12
- [PATCH 039/132] meson: add macos dependencies, Paolo Bonzini, 2019/12/12
- [PATCH 038/132] meson: infrastructure for building emulators, Paolo Bonzini, 2019/12/12
- [PATCH 041/132] meson: convert chardev directory to Meson (tools part), Paolo Bonzini, 2019/12/12
- [PATCH 043/132] meson: qemu-{img,io,nbd}, Paolo Bonzini, 2019/12/12
- [PATCH 042/132] meson: convert block, Paolo Bonzini, 2019/12/12
- [PATCH 044/132] meson: qemu-pr-helper, Paolo Bonzini, 2019/12/12
- [PATCH 040/132] meson: add modules infrastructure, Paolo Bonzini, 2019/12/12
- [PATCH 045/132] configure, Makefile; remove TOOLS and HELPERS-y variable, Paolo Bonzini, 2019/12/12
- [PATCH 046/132] meson: convert chardev directory to Meson (emulator part), Paolo Bonzini, 2019/12/12
- [PATCH 047/132] meson: convert audio directory to Meson,
Paolo Bonzini <=
- [PATCH 049/132] meson: convert root directory to Meson, Paolo Bonzini, 2019/12/12
- [PATCH 048/132] meson: convert ui directory to Meson, Paolo Bonzini, 2019/12/12
- [PATCH 051/132] meson: convert qom/, Paolo Bonzini, 2019/12/12
- [PATCH 050/132] meson: convert trace/, Paolo Bonzini, 2019/12/12
- [PATCH 052/132] meson: convert block/, Paolo Bonzini, 2019/12/12
- [PATCH 053/132] meson: convert dump/, Paolo Bonzini, 2019/12/12
- [PATCH 054/132] meson: convert monitor directory to Meson, Paolo Bonzini, 2019/12/12
- [PATCH 055/132] meson: convert replay directory to Meson, Paolo Bonzini, 2019/12/12
- [PATCH 056/132] meson: convert migration directory to Meson, Paolo Bonzini, 2019/12/12
- [PATCH 057/132] meson: build softmmu-specific migration/ram.c, Paolo Bonzini, 2019/12/12