From patchwork Thu Feb 15 17:35:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 10222787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F312602CB for ; Thu, 15 Feb 2018 17:37:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ECC928865 for ; Thu, 15 Feb 2018 17:37:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4270028927; Thu, 15 Feb 2018 17:37:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B01D728865 for ; Thu, 15 Feb 2018 17:37:31 +0000 (UTC) Received: from localhost ([::1]:42588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emNTO-0000zH-Pv for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Feb 2018 12:37:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emNS1-0007HO-Tm for qemu-devel@nongnu.org; Thu, 15 Feb 2018 12:36:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emNRy-0001Fl-Qc for qemu-devel@nongnu.org; Thu, 15 Feb 2018 12:36:05 -0500 Received: from mail-qt0-x22c.google.com ([2607:f8b0:400d:c0d::22c]:38385) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emNRy-0001Fe-Lw for qemu-devel@nongnu.org; Thu, 15 Feb 2018 12:36:02 -0500 Received: by mail-qt0-x22c.google.com with SMTP id k13so595962qtg.5 for ; Thu, 15 Feb 2018 09:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pE9XOtcZmKXplnUK7VGqIHXxDuJS3mIi0ZzxYttwDXw=; b=aoPk3KyNxjvdb2qYs7LRL3kkWiM7oeVE3glcVcCAUbHcTVgamPOIUCsBV6AfssbaQ9 qSIK+SUwIRINnXsSlw9BHjBR4K5HE2rkB6dCwf0/ydJy8QBujoVlBhDgvFt2N+lqVY5h xuKKoQYen8Rz1irhfv4bystN6WHpXzqLRIpxb28JnAvnvw1PKByiga+9tSs+GVCsEdYu PQrHDJA05Re0D2AQhpOVty7hhg21rYBqwY+eNlauqv9PJqKtJPoYzhjUT5Dxb7Fg1aJ5 jtxNcugT1Oto+CPxGRUfX5bQ3s2KbiDBr4/RQkh0+2ST61BfGea2TYhEqq/MklIh5Jxv Fm4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=pE9XOtcZmKXplnUK7VGqIHXxDuJS3mIi0ZzxYttwDXw=; b=H25/oRRDBer46Kk8CxO5PXd/2rdTRuj1xeNKWp37K+eM+9eBoYlGPbOknv+vARt+jm vMRG4u6MsbMqKLCCSqRSt64dvB2u/GEPhauEPHZhmo4yhQ8GFCoZcTtY/5htlWLNuEyL jywT+M/i8h5u+crpZSQfzjud1ZGeK/xDxUV7nFbFjjZKD+S9hibc0CmA44lXd+leY+XQ iveVcUd6XfMxP1MHQGzZZIylBe8kE1N5ZrfMOCmKu8PFG3MLw77Vw85aA19T2TCjadTp LAIpLzLLfg/AWyK9cyY8qYJWaxrpoLUMqyToBeZn4J/ni4WGZRUY5E4KZD3dCqHlBBVt wKyA== X-Gm-Message-State: APf1xPBmBuXDwjJN21qNup4Lc3sypKArXZ6m87zkTalnfd+hywU5pq62 kjSoaGWeEeSuWdwIx1dn/A4= X-Google-Smtp-Source: AH8x224FOt0gafCqSoniK7444ad2p7iMj3TeYnAZe3oXjNc2f5P/QTmYK+0iiPu0AvrVrK6kG+oGeQ== X-Received: by 10.200.28.84 with SMTP id j20mr5274273qtk.188.1518716162102; Thu, 15 Feb 2018 09:36:02 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id q2sm11310787qti.81.2018.02.15.09.35.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 09:36:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Richard Henderson , Mike Frysinger , Sergei Trofimovich , =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= Date: Thu, 15 Feb 2018 14:35:39 -0300 Message-Id: <20180215173539.11033-1-f4bug@amsat.org> X-Mailer: git-send-email 2.16.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22c Subject: [Qemu-devel] [RFC PATCH] capstone: fix building using system package X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Alexey Kardashevskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The use of is recommended by the upstream project: http://www.capstone-engine.org/lang_c.html However when building the in-tree cloned submodule, the header is accessible via . This fixes building on Gentoo (and Haiku OS - not supported since 898be3e0415): CC disas.o /sources/qemu-2.11.0/include/disas/capstone.h:6:22: fatal error: capstone.h: No such file or directory #include ^~~~~~~~~~~~ On Haiku `pkg-config --cflags capstone` reports "-I/usr/develop/headers". Bug: https://bugs.gentoo.org/647570 Reported-by: Zoltán Mizsei Signed-off-by: Philippe Mathieu-Daudé --- RFC because this might be a Gentoo portage issue. configure | 1 + include/disas/capstone.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 913e14839d..3657a61a35 100755 --- a/configure +++ b/configure @@ -7017,6 +7017,7 @@ if [ "$dtc_internal" = "yes" ]; then echo "config-host.h: subdir-dtc" >> $config_host_mak fi if [ "$capstone" = "git" -o "$capstone" = "internal" ]; then + echo "CONFIG_LIBCAPSTONE_INTERNAL=y" >> $config_host_mak echo "config-host.h: subdir-capstone" >> $config_host_mak fi if test -n "$LIBCAPSTONE"; then diff --git a/include/disas/capstone.h b/include/disas/capstone.h index 84e214956d..aea9601f41 100644 --- a/include/disas/capstone.h +++ b/include/disas/capstone.h @@ -3,9 +3,13 @@ #ifdef CONFIG_CAPSTONE +#ifdef CONFIG_LIBCAPSTONE_INTERNAL #include - #else +#include +#endif /* CONFIG_LIBCAPSTONE_INTERNAL */ + +#else /* CONFIG_CAPSTONE */ /* Just enough to allow backends to init without ifdefs. */