All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joelle van Dyne <j@getutm.app>
To: qemu-devel@nongnu.org
Cc: Joelle van Dyne <j@getutm.app>
Subject: [PATCH v7 10/11] darwin: detect CoreAudio for build
Date: Fri, 22 Jan 2021 12:11:12 -0800	[thread overview]
Message-ID: <20210122201113.63788-11-j@getutm.app> (raw)
In-Reply-To: <20210122201113.63788-1-j@getutm.app>

On iOS there is no CoreAudio, so we should not assume Darwin always
has it.

Signed-off-by: Joelle van Dyne <j@getutm.app>
---
 configure | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index f487be3cfe..fb671258e6 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"
@@ -779,7 +780,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.
@@ -3162,6 +3163,24 @@ EOF
   fi
 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
 
@@ -3218,8 +3237,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)
-- 
2.28.0



  parent reply	other threads:[~2021-01-22 20:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 20:11 [PATCH v7 00/11] iOS and Apple Silicon host support Joelle van Dyne
2021-01-22 20:11 ` [PATCH v7 01/11] block: feature detection for host block support Joelle van Dyne
2021-01-22 20:11 ` [PATCH v7 02/11] configure: cross-compiling with empty cross_prefix Joelle van Dyne
2021-01-22 20:11 ` [PATCH v7 03/11] configure: check for sys/disk.h Joelle van Dyne
2021-01-22 23:16   ` Peter Maydell
2021-01-22 20:11 ` [PATCH v7 04/11] slirp: feature detection for smbd Joelle van Dyne
2021-01-22 22:49   ` Peter Maydell
2021-01-22 23:12     ` Joelle van Dyne
2021-01-22 20:11 ` [PATCH v7 05/11] osdep: build with non-working system() function Joelle van Dyne
2021-01-22 23:12   ` Peter Maydell
2021-01-22 23:17     ` Peter Maydell
2021-01-23  3:18       ` Joelle van Dyne
2021-01-23 13:45         ` Peter Maydell
2021-01-25  8:04           ` Paolo Bonzini
2021-01-26  0:12             ` Joelle van Dyne
2021-01-26  0:42               ` Paolo Bonzini
2021-01-26  9:29               ` Peter Maydell
2021-01-22 20:11 ` [PATCH v7 06/11] darwin: remove redundant dependency declaration Joelle van Dyne
2021-01-22 22:43   ` Peter Maydell
2021-01-22 20:11 ` [PATCH v7 07/11] darwin: fix cross-compiling for Darwin Joelle van Dyne
2021-01-22 22:41   ` Peter Maydell
2021-01-22 20:11 ` [PATCH v7 08/11] configure: cross compile should use x86_64 cpu_family Joelle van Dyne
2021-01-22 20:11 ` [PATCH v7 09/11] block: check availablity for preadv/pwritev on mac Joelle van Dyne
2021-01-22 20:11 ` Joelle van Dyne [this message]
2021-01-22 20:11 ` [PATCH v7 11/11] darwin: remove 64-bit build detection on 32-bit OS Joelle van Dyne
2021-01-22 22:39   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210122201113.63788-11-j@getutm.app \
    --to=j@getutm.app \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.