aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoelle van Dyne <j@getutm.app>2021-01-25 17:24:56 -0800
committerPeter Maydell <peter.maydell@linaro.org>2021-01-29 10:47:28 +0000
commit422a5fd0872b5c3c7d79a505783a51faad8d398e (patch)
tree8191fc5bdfedeaeafc5cf92b9c32873a6ccd8741
parentf6bca9dff5c9ae3a5afc4678866080ccd5120318 (diff)
darwin: detect CoreAudio for build
On iOS there is no CoreAudio, so we should not assume Darwin always has it. Signed-off-by: Joelle van Dyne <j@getutm.app> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20210126012457.39046-11-j@getutm.app Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rwxr-xr-xconfigure35
1 files changed, 33 insertions, 2 deletions
diff --git a/configure b/configure
index 5cf075ac60..99bf627508 100755
--- a/configure
+++ b/configure
@@ -319,6 +319,7 @@ fdt="auto"
netmap="no"
sdl="auto"
sdl_image="auto"
+coreaudio="auto"
virtiofsd="auto"
virtfs="auto"
libudev="auto"
@@ -778,7 +779,7 @@ Darwin)
QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS"
fi
- audio_drv_list="coreaudio try-sdl"
+ audio_drv_list="try-coreaudio try-sdl"
audio_possible_drivers="coreaudio sdl"
# Disable attempts to use ObjectiveC features in os/object.h since they
# won't work when we're compiling with gcc as a C compiler.
@@ -3147,6 +3148,24 @@ EOF
fi
##########################################
+# detect CoreAudio
+if test "$coreaudio" != "no" ; then
+ coreaudio_libs="-framework CoreAudio"
+ cat > $TMPC << EOF
+#include <CoreAudio/CoreAudio.h>
+int main(void)
+{
+ return (int)AudioGetCurrentHostTime();
+}
+EOF
+ if compile_prog "" "$coreaudio_libs" ; then
+ coreaudio=yes
+ else
+ coreaudio=no
+ fi
+fi
+
+##########################################
# Sound support libraries probe
audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/,/ /g')
@@ -3202,8 +3221,20 @@ for drv in $audio_drv_list; do
fi
;;
- coreaudio)
+ coreaudio | try-coreaudio)
+ if test "$coreaudio" = "no"; then
+ if test "$drv" = "try-coreaudio"; then
+ audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-coreaudio//')
+ else
+ error_exit "$drv check failed" \
+ "Make sure to have the $drv is available."
+ fi
+ else
coreaudio_libs="-framework CoreAudio"
+ if test "$drv" = "try-coreaudio"; then
+ audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-coreaudio/coreaudio/')
+ fi
+ fi
;;
dsound)