From nobody Fri Oct 24 09:57:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of _spf.google.com designates 209.85.216.170 as permitted sender) client-ip=209.85.216.170; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-qt0-f170.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of _spf.google.com designates 209.85.216.170 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-qt0-f170.google.com (mail-qt0-f170.google.com [209.85.216.170]) by mx.zohomail.com with SMTPS id 1518716163014399.8760891515532; Thu, 15 Feb 2018 09:36:03 -0800 (PST) Received: by mail-qt0-f170.google.com with SMTP id g14so604244qti.2 for ; Thu, 15 Feb 2018 09:36:02 -0800 (PST) Return-Path: Return-Path: 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) 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=nM/LWQ/rWQDpNH9LQ2ZMvfTQqGisvij2bA4WQsUEn6m+IPWi/Fq4Ysatkdo0ZPg/WZ vcs/spr77kU5/Am96qDGzCnQg9QLPi+n7u3xYzUGNoWQsEqz5aINV16broJw2u0SVq6q xi9hHAxeTeRaOncRASGApVKh8v9MnbTa+/66p6dzLMEW0PKruwDbbGpWvklbJssxMKTX KGztZu13XERXZ1wNnhE0dAJM3Dw0m6UjwY249oX2OgjntsHDwTEbxsowCbbv1vRAsq9D fYkqgaGJAUsrpm91SYdjlhDkJJ6nQo/ie+ZMloniBR6S+a1QlVmAw5UHW+IcKkhkL6/Z Fobw== X-Gm-Message-State: APf1xPB/0nTSk+URWzI3sTzpnwBfgJ8v2+nnbpTA3qEYXunUrc3e3Vep 4iP8e6DHEmlX+GWiK1ivScPyE6d0698= 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) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Richard Henderson , Mike Frysinger , Sergei Trofimovich , =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Daniel P . Berrange" , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Alexey Kardashevskiy , Thomas Huth , qemu-devel@nongnu.org Subject: [RFC PATCH] capstone: fix building using system package 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZohoMail: RDKM_0 RSF_0 Z_629925259 SPT_0 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 898be3e04= 15): 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=C3=A1n Mizsei Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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" =3D "yes" ]; then echo "config-host.h: subdir-dtc" >> $config_host_mak fi if [ "$capstone" =3D "git" -o "$capstone" =3D "internal" ]; then + echo "CONFIG_LIBCAPSTONE_INTERNAL=3Dy" >> $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 @@ =20 #ifdef CONFIG_CAPSTONE =20 +#ifdef CONFIG_LIBCAPSTONE_INTERNAL #include - #else +#include +#endif /* CONFIG_LIBCAPSTONE_INTERNAL */ + +#else /* CONFIG_CAPSTONE */ =20 /* Just enough to allow backends to init without ifdefs. */ =20 --=20 2.16.1