From patchwork Fri Jan 29 10:59:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 373302 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2095263jam; Fri, 29 Jan 2021 03:11:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcB3diTIjPuOJPmGjfUyImkXoQUg7FHhhCllyWdDRgDBmaJotvbHNMvYmiHxtlxsGDAC/a X-Received: by 2002:a25:4445:: with SMTP id r66mr5285720yba.376.1611918667850; Fri, 29 Jan 2021 03:11:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611918667; cv=none; d=google.com; s=arc-20160816; b=rkTs2eeW8o0v7upAUL+6KvAIYEwGOAdZIWZHBSxjVFwgOJv3u7KhRRdyO6Htg+4ghQ EYX1wrSDuAzprPT+bt2PUg+hhHChuSFVhNsp4m3o2WX2ePzgoV2oM2YLFcJQXyhctmRx zX5n+uG6ZybzsJHwkfD2T0b9g1M1B7Tja7sulw9/Kcx3GxhE9c4QgQ3EnMvSybbcdTpu UfGYwtKmUwDz6w6MojCMdZwLJRtuW2eV78yajPVrAhyB7KraI+4uKC9J1exqnBTqALNd WuJPgAxdH9qIiTzJMJbcJg3itL3I9so3B8ezceIembbwk/wFJczsB7JsfQ9kWw9svRuZ HL4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=zFshe6a9XOs+UpYhaoy/bCbUaTZ0COXMECt5cI7PQd8=; b=UAGX6KRxLNEPEo3rka8vGM5lKNlkmg/w8H/3c4DJ87eGzYElauoM+mhsIKyuZwgo5s Znl51DMo996WDSVnqsAs9Mxmk11b96Rxnjlw1CJDdll7KX1/4apApralwpR/FpThm60n 7d47CeOwssE/vaQTfYm0Ty+mN6JSC6ykdpTKGTzvwM8YzE/wmSWjqy9a04veREnR9q12 6CuSHaDeo8GPaLbdwNnst36eNxruKRdWou6EZosZTbloAYnRf7AJeZyxq5IaIHODz5hP hoeftzm2bHoOkRzNWyYuFFuE5QDoR+n/vDPqe8UurUQyHxFmHPCuMQ96V6EGTPlZVMff MzrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yD4+BBLs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 22si8260718ybl.12.2021.01.29.03.11.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jan 2021 03:11:07 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yD4+BBLs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5RgB-00031U-AM for patch@linaro.org; Fri, 29 Jan 2021 06:11:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5RW9-0004ck-S8 for qemu-devel@nongnu.org; Fri, 29 Jan 2021 06:00:45 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:45856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l5RVx-0006zU-JH for qemu-devel@nongnu.org; Fri, 29 Jan 2021 06:00:45 -0500 Received: by mail-wr1-x432.google.com with SMTP id m13so8384001wro.12 for ; Fri, 29 Jan 2021 03:00:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=zFshe6a9XOs+UpYhaoy/bCbUaTZ0COXMECt5cI7PQd8=; b=yD4+BBLsRwM9XpgywxFDhTiYSby5V7R0G5WdUBdsYIuMS36w+UhTy6GwWCBgOUnZBW S+QPX9CtEdH6R3yJiHxv341fTGlf3ofCRZSOy5fNbYmJN3LoIyY3LpMkEouQYdd3/H+O FozKmNWJHyby6XAFf9bfcVUEmguvpeFyvWktnaWYY5/0TKwXx0YJdTcwbPbJM7opMViM d6JChUGvWOHC1WhU9jYP7NOaPakLoreA/dtsAfeuWFXPRJxrpUppkLzkCkgEmb2psUUO DaibqDKgW35tvRTY5DEdWuANR5/qSL739DGxLkQyVc+OqGdvKVYeLwCgygUQX/cDGXwA 6HSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zFshe6a9XOs+UpYhaoy/bCbUaTZ0COXMECt5cI7PQd8=; b=P1GE52z/byD0M6WMDs0yivXmteC7DqCVy+CDacuRQotAh33fN+RSpacFicWLUMU4b0 r63i+FvRoI8XSJUqAX++82DLGnyF4VVgSyhQirRJpnkkkWBm5rSpiFAI1ObqJZMKPLJx 9GewPHNACcTWV2pTTthVy+n/pYCcS1PKJfKX5NSiV6KvDYojkD+445MBKdB2LnAhn01+ E76jGvgedBPTiyMABLmiW9fjuAusdVbP7swQNCPN+Q9IVOymKpSq7udBhLZQZWlEL2/O O2pVtUqDXlAXIfYL3nLqFViqT0RY83kAmMOMS7d3+HTpH/wG3LAbzHkd5p+pTcBEy1hv homw== X-Gm-Message-State: AOAM531Z35b1PkvCMiozj5Ket4QyuGyVcwVnjd8CyIYx2afsoIp2NpGs 2wMhw7bKNEsk418b4F3B80xYH8OywSwFSA== X-Received: by 2002:adf:eb4e:: with SMTP id u14mr3882960wrn.99.1611918028674; Fri, 29 Jan 2021 03:00:28 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id w20sm9268761wmm.12.2021.01.29.03.00.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 03:00:28 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 15/46] darwin: detect CoreAudio for build Date: Fri, 29 Jan 2021 10:59:41 +0000 Message-Id: <20210129110012.8660-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210129110012.8660-1-peter.maydell@linaro.org> References: <20210129110012.8660-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Joelle van Dyne On iOS there is no CoreAudio, so we should not assume Darwin always has it. Signed-off-by: Joelle van Dyne Reviewed-by: Philippe Mathieu-Daudé Message-id: 20210126012457.39046-11-j@getutm.app Signed-off-by: Peter Maydell --- configure | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 5cf075ac60e..99bf6275087 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. @@ -3146,6 +3147,24 @@ EOF fi fi +########################################## +# detect CoreAudio +if test "$coreaudio" != "no" ; then + coreaudio_libs="-framework CoreAudio" + cat > $TMPC << EOF +#include +int main(void) +{ + return (int)AudioGetCurrentHostTime(); +} +EOF + if compile_prog "" "$coreaudio_libs" ; then + coreaudio=yes + else + coreaudio=no + fi +fi + ########################################## # Sound support libraries probe @@ -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)